@vendure-platform/create 1.0.2 → 1.0.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 1.0.3 (2026-11-06)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - name the project after its directory, not the path argument ([#857](https://github.com/vendurehq/vendure-platform/pull/857))
6
+
1
7
  ## 1.0.2 (2026-11-04)
2
8
 
3
9
  ### 🩹 Fixes
@@ -1 +1 @@
1
- "use strict";var e=this&&this.__createBinding||(Object.create?function(e,n,t,r){void 0===r&&(r=t);var o=Object.getOwnPropertyDescriptor(n,t);o&&!("get"in o?!n.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,r,o)}:function(e,n,t,r){void 0===r&&(r=t),e[r]=n[t]}),n=this&&this.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),t=this&&this.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(e){var n=[];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[n.length]=t);return n},t(e)};return function(r){if(r&&r.__esModule)return r;var o={};if(null!=r)for(var i=t(r),s=0;s<i.length;s++)"default"!==i[s]&&e(o,r,i[s]);return n(o,r),o}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.detectExistingProject=b,exports.assertSupportedProject=S,exports.applyAddToExisting=D,exports.runAddToExistingCli=_,exports.addToExisting=I,exports.formatChecklist=q;const r=t(require("@clack/prompts")),o=require("@vendure-platform/console-auth"),i=require("@vendure-platform/plugin-meta"),s=t(require("fs-extra")),a=require("node:os"),d=t(require("path")),l=require("./console-onboarding"),u=require("./docs-url"),c=require("./env-file"),p=require("./plugin-registry"),h=require("./registry"),f=require("./template-renderer"),g="vendure-platform-installation-guide.md",v="@vendure-platform/cli",m="3.8.0",y='After the first boot, reindex search once, or storefront search returns nothing. See "Rebuild the search index" in the installation guide.',w=["postgres","mysql","mariadb","better-sqlite3","sqljs","sqlite","mssql","oracle","cockroachdb"];async function b(e){var n,t;const r=d.join(e,"package.json");if(!await s.pathExists(r))throw new Error(`No package.json found at ${r}. Run this from your Vendure project root.`);const o=await s.readJson(r),i={...null!==(n=o.dependencies)&&void 0!==n?n:{},...null!==(t=o.devDependencies)&&void 0!==t?t:{}},a="@vendure/core"in i,l=[d.join(e,"src","vendure-config.ts"),d.join(e,"server","src","vendure-config.ts"),d.join(e,"src","vendure-config.js")];let u=null;for(const e of l)if(await s.pathExists(e)){u=e;break}const c=P(u?await s.readFile(u,"utf8"):""),p=await k(e,i["@vendure/core"]);return{projectDir:e,packageJsonPath:r,vendureConfigPath:u,hasVendureCore:a,coreVersion:p.version,coreVersionIsRangeFloor:p.isRangeFloor,databaseType:j(c),hasDefaultSearchPlugin:c.includes("DefaultSearchPlugin.init"),envPath:d.join(e,".env"),npmrcPath:d.join(e,".npmrc"),gitignorePath:d.join(e,".gitignore")}}async function k(e,n){var t,r;for(let n=e;;n=d.dirname(n)){const e=d.join(n,"node_modules","@vendure","core","package.json");if(await s.pathExists(e)){const n=(await s.readJson(e)).version;if("string"==typeof n)return{version:n,isRangeFloor:!1};break}if(d.dirname(n)===n)break}if("string"!=typeof n)return{version:null,isRangeFloor:!1};const o=null!==(r=null===(t=n.match(/\d+\.\d+\.\d+(?:-[\w.-]+)?/))||void 0===t?void 0:t[0])&&void 0!==r?r:null,i=n.trim();return{version:o,isRangeFloor:!(/^[=v]?\d+\.\d+\.\d+(?:-[\w.-]+)?$/.test(i)||/^~\d+\.\d+\.\d+$/.test(i))}}function P(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/(^|[^:'"`])\/\/.*$/gm,"$1")}function j(e){var n,t;const r=e.match(/dbConnectionOptions\s*:\s*\{/);if(!r||void 0===r.index)return null;let o=0,i=e.length;for(let n=r.index+r[0].length-1;n<e.length;n++)if("{"===e[n])o++;else if("}"===e[n]&&0===--o){i=n;break}const s=new RegExp(`\\btype:\\s*['"\`](${w.join("|")})['"\`]`);return null!==(t=null===(n=e.slice(r.index,i).match(s))||void 0===n?void 0:n[1])&&void 0!==t?t:null}function S(e){const n=[],t=null===e.coreVersion?null:$(e.coreVersion);if(null===t)n.push(`Could not read the @vendure/core version. Vendure Platform needs ${m} or later.`);else if(t){if(e.coreVersionIsRangeFloor)throw x(e),new Error(`package.json allows @vendure/core ${e.coreVersion} or later, and no installed @vendure/core was found to check the version. Vendure Platform needs ${m} or later. Nothing was changed. Run \`npm install\` (or \`pnpm install\`, \`yarn install\` or \`bun install\`) in this directory, then run this command again.`);throw new Error(`This project uses @vendure/core ${e.coreVersion}. Vendure Platform needs ${m} or later, so the install would fail. Nothing was changed. Upgrade @vendure/core to ${m} or later, then run this command again.`)}return n.concat(x(e))}function $(e){const n=/^(\d+)\.(\d+)\.(\d+)(-)?/.exec(e);if(!n)return null;const t=m.split(".").map(Number);for(let e=0;e<3;e++){const r=Number(n[e+1]);if(r!==t[e])return r<t[e]}return void 0!==n[4]}function x(e){if(null===e.databaseType)return["Could not read dbConnectionOptions.type from vendure-config.ts. Vendure Platform needs PostgreSQL."];if("postgres"!==e.databaseType)throw new Error(`This project uses the "${e.databaseType}" database. Vendure Platform needs PostgreSQL, because its entities use column types other databases do not support. Nothing was changed. Move the project to PostgreSQL, then run this command again.`);return[]}async function D(e,n){const{profile:t,dryRun:r,licenseToken:c,consoleOnboarding:m}=n,w=(0,p.resolveProfilePluginKeys)(t).map(e=>(0,p.getPlugin)(e)),b=(0,f.resolvePluginVersionSpec)(),k=[],P=await(0,l.finishConsoleOnboarding)(r?void 0:m,n.projectDir,n.registryToken);P.registryLogin&&k.push(`Log in to the registry: ${P.registryLogin}`);const{token:j,projectId:S}=(0,l.resolveRegistryToken)(n.registryToken,P);P.registryAccessDenied&&!j?k.push(`Ask a member with the Credential manager, Project admin or Admin role to create an access token on the Registry access page of the Project in Vendure Console. ${(0,h.setRegistryTokenStep)(P.registryUrl,e.npmrcPath)}`):j||P.registryLogin||k.push((0,l.registryTokenStep)(n.projectDir));const $=w.map(e=>e.packageName),{added:x,cliPluginRegistered:D}=await R(e.packageJsonPath,b,t,$,r);if(x.length>0){const e=1===x.length?x[0]:`${x.length} packages (${x[0]}, \u2026)`;k.push(`Added ${e} at ${b} to package.json \u2014 run \`npm install\` (or your package manager equivalent).`)}D&&k.push(`Registered ${v} under vendure.cli.plugins in package.json.`),k.push(...await C(e.packageJsonPath,(0,f.resolveMcpSdkVersion)(),r));const{context:A,hbs:V}=(0,f.buildTemplateContext)("","",!1,{profile:t,licenseToken:c,existingProject:!0}),_=(0,f.renderTemplate)((0,f.getTemplatePath)("env.hbs"),A,V),I=await E(e.envPath,_,r);if(I>0&&k.push(`Appended ${I} env var(s) to .env \u2014 fill in real values before booting.`),c&&await T(e.envPath,c,r)&&k.push("Filled in the empty VENDURE_PLATFORM_LICENSE_TOKEN value in .env."),r)k.push("Update .npmrc (registry scope, auth token, pnpm hoist line).");else{const n=!m||Boolean(j)||Boolean(P.registryLogin)||await(0,o.hasRegistryAuthToken)(e.projectDir,P.registryUrl)||await(0,o.hasRegistryAuthToken)((0,a.homedir)(),P.registryUrl);"written"===(await(0,o.ensureRegistryNpmrc)(e.projectDir,{registryUrl:P.registryUrl,scope:P.scope,token:j,projectId:S,routeScope:n})).kind&&k.push("Updated .npmrc."),n||k.push(`Left the ${P.scope} registry line out of .npmrc, because it fails every install without a token. Add it with a Registry Access Token: ${u.PLATFORM_DOCS_URL}/getting-started/registry-access`)}await N(e.gitignorePath,".npmrc",r)&&k.push("Added .npmrc to .gitignore so any future registry token never gets committed.");const q=O(w,t),F=d.join(e.projectDir,g);r||await s.writeFile(F,q),k.push(`Wrote ${d.relative(e.projectDir,F)} \u2014 follow it to wire up your vendure-config.ts.`);const L=d.join(e.vendureConfigPath?d.dirname(e.vendureConfigPath):d.join(e.projectDir,"src"),"platform-edition.ts"),U=await s.pathExists(L);r||U||(await s.ensureDir(d.dirname(L)),await s.writeFile(L,(0,i.renderEditionConfig)(t)));const W=d.relative(e.projectDir,L);return k.push(U?`Kept existing ${W}. Confirm that it exports the ${t} edition.`:`Wrote ${W} for the ${t} edition.`),k.push("Swap `import { bootstrap } from '@vendure/core'` for `'./platform-edition'` in your server entry file (and `bootstrapWorker` if you have a worker). See the installation guide's \"Bootstrap import\" section."),e.hasDefaultSearchPlugin&&k.push('Remove `DefaultSearchPlugin` from vendure-config.ts. Advanced Search replaces it, and the server fails to start with both. See the installation guide\'s "Remove DefaultSearchPlugin" section.'),k.push("Generate and run a migration for the new platform entities."),k.push("Rebuild the dashboard if you serve a pre-built artefact."),k.push("Grant new permissions to existing admin roles via Settings \u2192 Roles."),k.push(y),k}async function R(e,n,t,r,o){var a,d,l,u,c,p;const h=await s.readJson(e);null!==(a=h.dependencies)&&void 0!==a||(h.dependencies={});const f=[(0,i.facadePackageName)(t),...r].filter((e,n,t)=>t.indexOf(e)===n),g=[];for(const e of f)h.dependencies[e]||(h.dependencies[e]=n,g.push(e));null!==(d=h.devDependencies)&&void 0!==d||(h.devDependencies={}),h.dependencies[v]||h.devDependencies[v]||(h.devDependencies[v]=n,g.push(v));const m=null!==(c=null===(u=null===(l=h.vendure)||void 0===l?void 0:l.cli)||void 0===u?void 0:u.plugins)&&void 0!==c?c:[],y=!m.includes(v);return y&&(h.vendure={...h.vendure,cli:{...null===(p=h.vendure)||void 0===p?void 0:p.cli,plugins:[...m,v]}}),(g.length>0||y)&&!o&&await s.writeJson(e,h,{spaces:2}),{added:g,cliPluginRegistered:y}}async function C(e,n,t){var r,o;const i=await s.readJson(e),a=[];let d=!1;const l=null===(r=i.overrides)||void 0===r?void 0:r["@vendure/mcp-sdk"];if(void 0===l?(i.overrides={...i.overrides,"@vendure/mcp-sdk":n},d=!0,a.push(`Added an "overrides" entry for @vendure/mcp-sdk ${n} to package.json, so every package uses one copy of the MCP SDK. With pnpm, put the same entry under "overrides" in pnpm-workspace.yaml instead.`)):"string"!=typeof l||l.startsWith("$")?a.push(`package.json already overrides @vendure/mcp-sdk. Check that it resolves to ${n}, the version the Vendure Platform packages need.`):l!==n&&a.push(`package.json overrides @vendure/mcp-sdk to ${l}, but the Vendure Platform packages need ${n}. Set it to ${n}, or the MCP server lists none of their tools.`),i.overrides["@vendure/mcp-sdk"]===n)for(const e of["dependencies","devDependencies"]){const t=null===(o=i[e])||void 0===o?void 0:o["@vendure/mcp-sdk"];void 0!==t&&t!==n&&(i[e]["@vendure/mcp-sdk"]=n,d=!0,a.push(`Changed @vendure/mcp-sdk in package.json ${e} from ${t} to ${n}, the version of the override. npm refuses an override that differs from a direct dependency.`))}return d&&!t&&await s.writeJson(e,i,{spaces:2}),a}async function T(e,n,t){if(!await s.pathExists(e))return!1;const r=(await s.readFile(e,"utf8")).split("\n");let o=!1;const i="VENDURE_PLATFORM_LICENSE_TOKEN";for(let e=0;e<r.length;e++){const t=r[e].trim();if(!t.startsWith("#")&&t===`${i}=`){r[e]=`${i}=${n}`,o=!0;break}}return o&&!t&&await(0,c.writeEnvFile)(e,r.join("\n")),o}async function E(e,n,t){const r=await s.pathExists(e)?await s.readFile(e,"utf8"):"",o=new Set(r.split("\n").map(V).filter(Boolean)),i=[];let a=0;for(const e of n.split(/\n{2,}/)){const n=A(e.split("\n"),o),t=n.filter(e=>V(e)).length;0!==t&&(a+=t,i.push(n.join("\n")))}if(0===a||t)return a;if(""===r.trim())await(0,c.writeEnvFile)(e,n);else{const n=r.endsWith("\n")?"":"\n",t=`\n# Added by @vendure-platform/create add\n${i.join("\n\n")}\n`;await(0,c.writeEnvFile)(e,r+n+t)}return a}function A(e,n){const t=[];for(const r of e)if(n.has(V(r)))for(;t.length>1&&t[t.length-1].trim().startsWith("#");)t.pop();else t.push(r);return t}function V(e){var n,t;const r=e.trim();return r.startsWith("#")?"":null!==(t=null===(n=r.split("=")[0])||void 0===n?void 0:n.trim())&&void 0!==t?t:""}async function N(e,n,t){let r="";await s.pathExists(e)&&(r=await s.readFile(e,"utf8"));const o=r.split("\n").map(e=>e.trim());if(o.includes(n)||o.includes(`/${n}`))return!1;const i=""===r||r.endsWith("\n")?"":"\n";return t||await s.writeFile(e,r+i+n+"\n"),!0}function O(e,n){const t=(0,i.facadePackageName)(n),r=["import { VendurePlatform } from './platform-edition';"],{context:o,hbs:s}=(0,f.buildTemplateContext)("","",!1,{profile:n});for(const n of e)n.platformImports&&r.push(...n.platformImports);return`# Vendure Platform installation guide\n\nPaste these changes into your existing project. Step 1 is the most important \u2014\nwithout it, every Vendure Platform plugin refuses to start with\n\`LICENSE_GUARD_NONCE_MISMATCH\`.\n\n## 1. Bootstrap import (server entry point)\n\nIn your server entry file (typically \`src/index.ts\` or wherever you call\n\`bootstrap()\`), swap the bootstrap import from \`@vendure/core\` to\n\`./platform-edition\`:\n\n\`\`\`ts\n// before\nimport { bootstrap } from '@vendure/core';\n\n// after\nimport { bootstrap } from './platform-edition';\n\`\`\`\n\nIf you also run a separate worker process, swap \`bootstrapWorker\` too:\n\n\`\`\`ts\nimport { bootstrapWorker } from './platform-edition';\n\`\`\`\n\nThe \`./platform-edition\` bootstrap re-exports the \`${t}\`\ndrop-in wrapper around \`@vendure/core\`'s \`bootstrap\`. It primes the runtime license guard before\nNest builds the DI container. Without this swap, plugins like \`OrgAccountsPlugin\`\nfail at startup with \`LICENSE_GUARD_NONCE_MISMATCH\`.\n\n## 2. Imports in vendure-config.ts\n\nAdd to the top of the file (after your existing imports):\n\n\`\`\`ts\n${r.join("\n")}\n\`\`\`\n\n## 3. Plugins array\n\nSpread \`VendurePlatform.init({...})\` into the \`plugins\` array \u2014 typically\nbetween \`DefaultJobQueuePlugin\` and \`DashboardPlugin\`:\n\n\`\`\`ts\n...VendurePlatform.init({\n${s.compile("{{platformPluginOptions}}")(o)}\n}),\n\`\`\`\n\n## 4. Remove DefaultSearchPlugin\n\nAdvanced Search replaces Vendure's default search. If your config has it, delete \`DefaultSearchPlugin.init({...})\`\nfrom the \`plugins\` array and its import from \`@vendure/core\`. Projects from \`@vendure/create\`\nhave it. With both plugins the server stops at startup with\n\`Field "SearchResult.inStock" can only be defined once\`.\n\n## 5. Order process\n\nIf \`approvalWorkflows\` is selected, VendurePlatform will append\n\`approvalOrderProcess\` to your order process chain and override\n\`arrangingPaymentRequiresContents\` and \`checkAllItemsBeforeCancel\`. If you\nhave custom order process handlers they are preserved; the flags above are\nnot.\n\n## 6. Rebuild the search index\n\nAdvanced Search starts with an empty index and nothing fills it from your existing catalog. Until you rebuild it,\n\`search\` on the Shop API returns \`totalItems: 0\` even though \`products\` lists every product. Do this once per\nenvironment, after the server and a worker are running.\n\nUse a role with the \`UpdateCatalog\` permission. \`Superadmin\` has it. In the Dashboard, open **Search** and use the\n**Reindex** button, or call the Admin API:\n\n\`\`\`graphql\nmutation {\n reindex {\n id\n }\n}\n\`\`\`\n\nThe work runs on the worker, so a project with no running worker never finishes it. Watch the job under\n**System** \u2192 **Job queue**. The time grows with the number of product variants. A sample catalog of a few dozen\nproducts is quick, and a large catalog takes noticeably longer. When the\njob is completed, \`search(input: {}) { totalItems }\` returns your variants. New and changed products reach the\nindex by themselves from then on.\n\nSee https://docs.vendure.io/current/platform/getting-started/introduction for the full reference.\n`}async function _(e){var n,t,o,i;const s=process.cwd(),a=await b(s);a.hasVendureCore||r.log.warn("No @vendure/core dependency found in package.json. Continuing anyway \u2014 make sure this is the right directory."),a.vendureConfigPath?r.log.info(`Detected vendure-config.ts at ${d.relative(s,a.vendureConfigPath)}`):r.log.warn("No vendure-config.ts found under src/ or server/src/. The installation guide will still be written to the project root.");for(const e of S(a))r.log.warn(e);a.hasDefaultSearchPlugin&&r.log.warn("vendure-config.ts uses DefaultSearchPlugin. Remove it when you apply the installation guide: Advanced Search replaces it, and the server fails to start with both."),(void 0===e.profile||void 0===e.registryToken)&&r.intro("Add Vendure Platform to existing project");const u=null===(n=e.profile)||void 0===n?void 0:n.trim();let c;if(void 0!==u){if(!(0,p.isCapabilityProfileName)(u))throw new Error(`Unknown edition "${u}". Use starter, growth, scale, or enterprise.`);c=u}const h=void 0!==c||void 0!==e.registryToken||e.dryRun?void 0:await(0,l.startConsoleOnboarding)({projectDir:s,interactive:(0,l.isInteractive)()}),f=null!=c?c:null==h?void 0:h.edition;if(!f){if(void 0!==e.registryToken||e.dryRun)throw new Error("--profile is required when Console onboarding is skipped.");throw new Error("Could not determine the project edition. Link a Console Project with an edition or pass --profile.")}return{projectDir:s,profile:f,dryRun:null!==(t=e.dryRun)&&void 0!==t&&t,registryToken:(null===(o=e.registryToken)||void 0===o?void 0:o.trim())||void 0,licenseToken:(null===(i=e.licenseToken)||void 0===i?void 0:i.trim())||void 0,consoleOnboarding:h}}async function I(e){const n=await b(e.projectDir),t=p.ALWAYS_ACTIVE_KEYS.map(e=>(0,p.getPlugin)(e).displayName);t.length>0&&r.log.info(`Always-on core plugins: ${t.join(", ")}`);const o=q(await D(n,e));r.note(o,e.dryRun?"Dry run \u2014 would do:":"Next steps"),r.outro(e.dryRun?"Dry run complete \u2014 no files written.":"Done.")}function q(e){const n=Math.max(40,Math.min(process.stdout.columns||80,100)-6);return e.map((e,t)=>{const r=`${t+1}. `,o=" ".repeat(r.length);return F(e,n-r.length).map((e,n)=>(0===n?r:o)+e).join("\n")}).join("\n")}function F(e,n){const t=[];let r="";for(const o of e.split(/\s+/))""===r?r=o:r.length+1+o.length<=n?r+=" "+o:(t.push(r),r=o);return""!==r&&t.push(r),t.length>0?t:[""]}
1
+ "use strict";var e=this&&this.__createBinding||(Object.create?function(e,n,t,r){void 0===r&&(r=t);var o=Object.getOwnPropertyDescriptor(n,t);o&&!("get"in o?!n.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,r,o)}:function(e,n,t,r){void 0===r&&(r=t),e[r]=n[t]}),n=this&&this.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),t=this&&this.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(e){var n=[];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[n.length]=t);return n},t(e)};return function(r){if(r&&r.__esModule)return r;var o={};if(null!=r)for(var i=t(r),s=0;s<i.length;s++)"default"!==i[s]&&e(o,r,i[s]);return n(o,r),o}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.detectExistingProject=k,exports.assertSupportedProject=S,exports.applyAddToExisting=D,exports.runAddToExistingCli=_,exports.addToExisting=I,exports.formatChecklist=q;const r=t(require("@clack/prompts")),o=require("@vendure-platform/console-auth"),i=require("@vendure-platform/plugin-meta"),s=t(require("fs-extra")),a=require("node:os"),d=t(require("path")),l=require("./console-onboarding"),u=require("./docs-url"),c=require("./env-file"),p=require("./plugin-registry"),h=require("./registry"),f=require("./template-renderer"),g="vendure-platform-installation-guide.md",v="@vendure-platform/cli",m="3.8.0",y='After the first boot, reindex search once, or storefront search returns nothing. See "Rebuild the search index" in the installation guide.',w=["postgres","mysql","mariadb","better-sqlite3","sqljs","sqlite","mssql","oracle","cockroachdb"];async function k(e){var n,t;const r=d.join(e,"package.json");if(!await s.pathExists(r))throw new Error(`No package.json found at ${r}. Run this from your Vendure project root.`);const o=await s.readJson(r),i={...null!==(n=o.dependencies)&&void 0!==n?n:{},...null!==(t=o.devDependencies)&&void 0!==t?t:{}},a="@vendure/core"in i,l=[d.join(e,"src","vendure-config.ts"),d.join(e,"server","src","vendure-config.ts"),d.join(e,"src","vendure-config.js")];let u=null;for(const e of l)if(await s.pathExists(e)){u=e;break}const c=P(u?await s.readFile(u,"utf8"):""),p=await b(e,i["@vendure/core"]);return{projectDir:e,packageJsonPath:r,vendureConfigPath:u,hasVendureCore:a,coreVersion:p.version,coreVersionIsRangeFloor:p.isRangeFloor,databaseType:j(c),hasDefaultSearchPlugin:c.includes("DefaultSearchPlugin.init"),envPath:d.join(e,".env"),npmrcPath:d.join(e,".npmrc"),gitignorePath:d.join(e,".gitignore")}}async function b(e,n){var t,r;for(let n=e;;n=d.dirname(n)){const e=d.join(n,"node_modules","@vendure","core","package.json");if(await s.pathExists(e)){const n=(await s.readJson(e)).version;if("string"==typeof n)return{version:n,isRangeFloor:!1};break}if(d.dirname(n)===n)break}if("string"!=typeof n)return{version:null,isRangeFloor:!1};const o=null!==(r=null===(t=n.match(/\d+\.\d+\.\d+(?:-[\w.-]+)?/))||void 0===t?void 0:t[0])&&void 0!==r?r:null,i=n.trim();return{version:o,isRangeFloor:!(/^[=v]?\d+\.\d+\.\d+(?:-[\w.-]+)?$/.test(i)||/^~\d+\.\d+\.\d+$/.test(i))}}function P(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/(^|[^:'"`])\/\/.*$/gm,"$1")}function j(e){var n,t;const r=e.match(/dbConnectionOptions\s*:\s*\{/);if(!r||void 0===r.index)return null;let o=0,i=e.length;for(let n=r.index+r[0].length-1;n<e.length;n++)if("{"===e[n])o++;else if("}"===e[n]&&0===--o){i=n;break}const s=new RegExp(`\\btype:\\s*['"\`](${w.join("|")})['"\`]`);return null!==(t=null===(n=e.slice(r.index,i).match(s))||void 0===n?void 0:n[1])&&void 0!==t?t:null}function S(e){const n=[],t=null===e.coreVersion?null:x(e.coreVersion);if(null===t)n.push(`Could not read the @vendure/core version. Vendure Platform needs ${m} or later.`);else if(t){if(e.coreVersionIsRangeFloor)throw $(e),new Error(`package.json allows @vendure/core ${e.coreVersion} or later, and no installed @vendure/core was found to check the version. Vendure Platform needs ${m} or later. Nothing was changed. Run \`npm install\` (or \`pnpm install\`, \`yarn install\` or \`bun install\`) in this directory, then run this command again.`);throw new Error(`This project uses @vendure/core ${e.coreVersion}. Vendure Platform needs ${m} or later, so the install would fail. Nothing was changed. Upgrade @vendure/core to ${m} or later, then run this command again.`)}return n.concat($(e))}function x(e){const n=/^(\d+)\.(\d+)\.(\d+)(-)?/.exec(e);if(!n)return null;const t=m.split(".").map(Number);for(let e=0;e<3;e++){const r=Number(n[e+1]);if(r!==t[e])return r<t[e]}return void 0!==n[4]}function $(e){if(null===e.databaseType)return["Could not read dbConnectionOptions.type from vendure-config.ts. Vendure Platform needs PostgreSQL."];if("postgres"!==e.databaseType)throw new Error(`This project uses the "${e.databaseType}" database. Vendure Platform needs PostgreSQL, because its entities use column types other databases do not support. Nothing was changed. Move the project to PostgreSQL, then run this command again.`);return[]}async function D(e,n){const{profile:t,dryRun:r,licenseToken:c,consoleOnboarding:m}=n,w=(0,p.resolveProfilePluginKeys)(t).map(e=>(0,p.getPlugin)(e)),k=(0,f.resolvePluginVersionSpec)(),b=[],P=await(0,l.finishConsoleOnboarding)(r?void 0:m,n.projectDir,n.registryToken);P.registryLogin&&b.push(`Log in to the registry: ${P.registryLogin}`);const{token:j,projectId:S}=(0,l.resolveRegistryToken)(n.registryToken,P);P.registryAccessDenied&&!j?b.push(`Ask a member with the Credential manager, Project admin or Admin role to create an access token on the Registry access page of the Project in Vendure Console. ${(0,h.setRegistryTokenStep)(P.registryUrl,e.npmrcPath)}`):j||P.registryLogin||b.push((0,l.registryTokenStep)(n.projectDir));const x=w.map(e=>e.packageName),{added:$,cliPluginRegistered:D}=await R(e.packageJsonPath,k,t,x,r);if($.length>0){const e=1===$.length?$[0]:`${$.length} packages (${$[0]}, \u2026)`;b.push(`Added ${e} at ${k} to package.json \u2014 run \`npm install\` (or your package manager equivalent).`)}D&&b.push(`Registered ${v} under vendure.cli.plugins in package.json.`),b.push(...await C(e.packageJsonPath,(0,f.resolveMcpSdkVersion)(),r));const{context:A,hbs:O}=(0,f.buildTemplateContext)("","",!1,{profile:t,licenseToken:c,existingProject:!0}),_=(0,f.renderTemplate)((0,f.getTemplatePath)("env.hbs"),A,O),I=await E(e.envPath,_,r);if(I>0&&b.push(`Appended ${I} env var(s) to .env \u2014 fill in real values before booting.`),c&&await T(e.envPath,c,r)&&b.push("Filled in the empty VENDURE_PLATFORM_LICENSE_TOKEN value in .env."),r)b.push("Update .npmrc (registry scope, auth token, pnpm hoist line).");else{const n=!m||Boolean(j)||Boolean(P.registryLogin)||await(0,o.hasRegistryAuthToken)(e.projectDir,P.registryUrl)||await(0,o.hasRegistryAuthToken)((0,a.homedir)(),P.registryUrl);"written"===(await(0,o.ensureRegistryNpmrc)(e.projectDir,{registryUrl:P.registryUrl,scope:P.scope,token:j,projectId:S,routeScope:n})).kind&&b.push("Updated .npmrc."),n||b.push(`Left the ${P.scope} registry line out of .npmrc, because it fails every install without a token. Add it with a Registry Access Token: ${u.PLATFORM_DOCS_URL}/getting-started/registry-access`)}await V(e.gitignorePath,".npmrc",r)&&b.push("Added .npmrc to .gitignore so any future registry token never gets committed.");const q=N(w,t),F=d.join(e.projectDir,g);r||await s.writeFile(F,q),b.push(`Wrote ${d.relative(e.projectDir,F)} \u2014 follow it to wire up your vendure-config.ts.`);const L=d.join(e.vendureConfigPath?d.dirname(e.vendureConfigPath):d.join(e.projectDir,"src"),"platform-edition.ts"),U=await s.pathExists(L);r||U||(await s.ensureDir(d.dirname(L)),await s.writeFile(L,(0,i.renderEditionConfig)(t)));const W=d.relative(e.projectDir,L);return b.push(U?`Kept existing ${W}. Confirm that it exports the ${t} edition.`:`Wrote ${W} for the ${t} edition.`),b.push("Swap `import { bootstrap } from '@vendure/core'` for `'./platform-edition'` in your server entry file (and `bootstrapWorker` if you have a worker). See the installation guide's \"Bootstrap import\" section."),e.hasDefaultSearchPlugin&&b.push('Remove `DefaultSearchPlugin` from vendure-config.ts. Advanced Search replaces it, and the server fails to start with both. See the installation guide\'s "Remove DefaultSearchPlugin" section.'),b.push("Generate and run a migration for the new platform entities."),b.push("Rebuild the dashboard if you serve a pre-built artefact."),b.push("Grant new permissions to existing admin roles via Settings \u2192 Roles."),b.push(y),b}async function R(e,n,t,r,o){var a,d,l,u,c,p;const h=await s.readJson(e);null!==(a=h.dependencies)&&void 0!==a||(h.dependencies={});const f=[(0,i.facadePackageName)(t),...r].filter((e,n,t)=>t.indexOf(e)===n),g=[];for(const e of f)h.dependencies[e]||(h.dependencies[e]=n,g.push(e));null!==(d=h.devDependencies)&&void 0!==d||(h.devDependencies={}),h.dependencies[v]||h.devDependencies[v]||(h.devDependencies[v]=n,g.push(v));const m=null!==(c=null===(u=null===(l=h.vendure)||void 0===l?void 0:l.cli)||void 0===u?void 0:u.plugins)&&void 0!==c?c:[],y=!m.includes(v);return y&&(h.vendure={...h.vendure,cli:{...null===(p=h.vendure)||void 0===p?void 0:p.cli,plugins:[...m,v]}}),(g.length>0||y)&&!o&&await s.writeJson(e,h,{spaces:2}),{added:g,cliPluginRegistered:y}}async function C(e,n,t){var r,o;const i=await s.readJson(e),a=[];let d=!1;const l=null===(r=i.overrides)||void 0===r?void 0:r["@vendure/mcp-sdk"];if(void 0===l?(i.overrides={...i.overrides,"@vendure/mcp-sdk":n},d=!0,a.push(`Added an "overrides" entry for @vendure/mcp-sdk ${n} to package.json, so every package uses one copy of the MCP SDK. With pnpm, put the same entry under "overrides" in pnpm-workspace.yaml instead.`)):"string"!=typeof l||l.startsWith("$")?a.push(`package.json already overrides @vendure/mcp-sdk. Check that it resolves to ${n}, the version the Vendure Platform packages need.`):l!==n&&a.push(`package.json overrides @vendure/mcp-sdk to ${l}, but the Vendure Platform packages need ${n}. Set it to ${n}, or the MCP server lists none of their tools.`),i.overrides["@vendure/mcp-sdk"]===n)for(const e of["dependencies","devDependencies"]){const t=null===(o=i[e])||void 0===o?void 0:o["@vendure/mcp-sdk"];void 0!==t&&t!==n&&(i[e]["@vendure/mcp-sdk"]=n,d=!0,a.push(`Changed @vendure/mcp-sdk in package.json ${e} from ${t} to ${n}, the version of the override. npm refuses an override that differs from a direct dependency.`))}return d&&!t&&await s.writeJson(e,i,{spaces:2}),a}async function T(e,n,t){if(!await s.pathExists(e))return!1;const r=(await s.readFile(e,"utf8")).split("\n");let o=!1;const i="VENDURE_PLATFORM_LICENSE_TOKEN";for(let e=0;e<r.length;e++){const t=r[e].trim();if(!t.startsWith("#")&&t===`${i}=`){r[e]=`${i}=${n}`,o=!0;break}}return o&&!t&&await(0,c.writeEnvFile)(e,r.join("\n")),o}async function E(e,n,t){const r=await s.pathExists(e)?await s.readFile(e,"utf8"):"",o=new Set(r.split("\n").map(O).filter(Boolean)),i=[];let a=0;for(const e of n.split(/\n{2,}/)){const n=A(e.split("\n"),o),t=n.filter(e=>O(e)).length;0!==t&&(a+=t,i.push(n.join("\n")))}if(0===a||t)return a;if(""===r.trim())await(0,c.writeEnvFile)(e,n);else{const n=r.endsWith("\n")?"":"\n",t=`\n# Added by @vendure-platform/create add\n${i.join("\n\n")}\n`;await(0,c.writeEnvFile)(e,r+n+t)}return a}function A(e,n){const t=[];for(const r of e)if(n.has(O(r)))for(;t.length>1&&t[t.length-1].trim().startsWith("#");)t.pop();else t.push(r);return t}function O(e){var n,t;const r=e.trim();return r.startsWith("#")?"":null!==(t=null===(n=r.split("=")[0])||void 0===n?void 0:n.trim())&&void 0!==t?t:""}async function V(e,n,t){let r="";await s.pathExists(e)&&(r=await s.readFile(e,"utf8"));const o=r.split("\n").map(e=>e.trim());if(o.includes(n)||o.includes(`/${n}`))return!1;const i=""===r||r.endsWith("\n")?"":"\n";return t||await s.writeFile(e,r+i+n+"\n"),!0}function N(e,n){const t=(0,i.facadePackageName)(n),r=["import { VendurePlatform } from './platform-edition';"],{context:o,hbs:s}=(0,f.buildTemplateContext)("","",!1,{profile:n});for(const n of e)n.platformImports&&r.push(...n.platformImports);return`# Vendure Platform installation guide\n\nPaste these changes into your existing project. Step 1 is the most important \u2014\nwithout it, every Vendure Platform plugin refuses to start with\n\`LICENSE_GUARD_NONCE_MISMATCH\`.\n\n## 1. Bootstrap import (server entry point)\n\nIn your server entry file (typically \`src/index.ts\` or wherever you call\n\`bootstrap()\`), swap the bootstrap import from \`@vendure/core\` to\n\`./platform-edition\`:\n\n\`\`\`ts\n// before\nimport { bootstrap } from '@vendure/core';\n\n// after\nimport { bootstrap } from './platform-edition';\n\`\`\`\n\nIf you also run a separate worker process, swap \`bootstrapWorker\` too:\n\n\`\`\`ts\nimport { bootstrapWorker } from './platform-edition';\n\`\`\`\n\nThe \`./platform-edition\` bootstrap re-exports the \`${t}\`\ndrop-in wrapper around \`@vendure/core\`'s \`bootstrap\`. It primes the runtime license guard before\nNest builds the DI container. Without this swap, plugins like \`OrgAccountsPlugin\`\nfail at startup with \`LICENSE_GUARD_NONCE_MISMATCH\`.\n\n## 2. Imports in vendure-config.ts\n\nAdd to the top of the file (after your existing imports):\n\n\`\`\`ts\n${r.join("\n")}\n\`\`\`\n\n## 3. Plugins array\n\nSpread \`VendurePlatform.init({...})\` into the \`plugins\` array \u2014 typically\nbetween \`DefaultJobQueuePlugin\` and \`DashboardPlugin\`:\n\n\`\`\`ts\n...VendurePlatform.init({\n${s.compile("{{platformPluginOptions}}")(o)}\n}),\n\`\`\`\n\n## 4. Remove DefaultSearchPlugin\n\nAdvanced Search replaces Vendure's default search. If your config has it, delete \`DefaultSearchPlugin.init({...})\`\nfrom the \`plugins\` array and its import from \`@vendure/core\`. Projects from \`@vendure/create\`\nhave it. With both plugins the server stops at startup with\n\`Field "SearchResult.inStock" can only be defined once\`.\n\n## 5. Order process\n\nIf \`approvalWorkflows\` is selected, VendurePlatform keeps your default order\nprocess and its options, and appends \`approvalOrderProcess\` to your order\nprocess chain. It relaxes the contents, shipping and cancellation checks only\nwhen an order in AwaitingApproval is cancelled and when a quote-converted order\ngoes to ArrangingPayment. On those two transitions core's defaults apply to your\nother order process options. Custom order process handlers are preserved.\n\n## 6. Rebuild the search index\n\nAdvanced Search starts with an empty index and nothing fills it from your existing catalog. Until you rebuild it,\n\`search\` on the Shop API returns \`totalItems: 0\` even though \`products\` lists every product. Do this once per\nenvironment, after the server and a worker are running.\n\nUse a role with the \`UpdateCatalog\` permission. \`Superadmin\` has it. In the Dashboard, open **Search** and use the\n**Reindex** button, or call the Admin API:\n\n\`\`\`graphql\nmutation {\n reindex {\n id\n }\n}\n\`\`\`\n\nThe work runs on the worker, so a project with no running worker never finishes it. Watch the job under\n**System** \u2192 **Job queue**. The time grows with the number of product variants. A sample catalog of a few dozen\nproducts is quick, and a large catalog takes noticeably longer. When the\njob is completed, \`search(input: {}) { totalItems }\` returns your variants. New and changed products reach the\nindex by themselves from then on.\n\nSee https://docs.vendure.io/current/platform/getting-started/introduction for the full reference.\n`}async function _(e){var n,t,o,i;const s=process.cwd(),a=await k(s);a.hasVendureCore||r.log.warn("No @vendure/core dependency found in package.json. Continuing anyway \u2014 make sure this is the right directory."),a.vendureConfigPath?r.log.info(`Detected vendure-config.ts at ${d.relative(s,a.vendureConfigPath)}`):r.log.warn("No vendure-config.ts found under src/ or server/src/. The installation guide will still be written to the project root.");for(const e of S(a))r.log.warn(e);a.hasDefaultSearchPlugin&&r.log.warn("vendure-config.ts uses DefaultSearchPlugin. Remove it when you apply the installation guide: Advanced Search replaces it, and the server fails to start with both."),(void 0===e.profile||void 0===e.registryToken)&&r.intro("Add Vendure Platform to existing project");const u=null===(n=e.profile)||void 0===n?void 0:n.trim();let c;if(void 0!==u){if(!(0,p.isCapabilityProfileName)(u))throw new Error(`Unknown edition "${u}". Use starter, growth, scale, or enterprise.`);c=u}const h=void 0!==c||void 0!==e.registryToken||e.dryRun?void 0:await(0,l.startConsoleOnboarding)({projectDir:s,interactive:(0,l.isInteractive)()}),f=null!=c?c:null==h?void 0:h.edition;if(!f){if(void 0!==e.registryToken||e.dryRun)throw new Error("--profile is required when Console onboarding is skipped.");throw new Error("Could not determine the project edition. Link a Console Project with an edition or pass --profile.")}return{projectDir:s,profile:f,dryRun:null!==(t=e.dryRun)&&void 0!==t&&t,registryToken:(null===(o=e.registryToken)||void 0===o?void 0:o.trim())||void 0,licenseToken:(null===(i=e.licenseToken)||void 0===i?void 0:i.trim())||void 0,consoleOnboarding:h}}async function I(e){const n=await k(e.projectDir),t=p.ALWAYS_ACTIVE_KEYS.map(e=>(0,p.getPlugin)(e).displayName);t.length>0&&r.log.info(`Always-on core plugins: ${t.join(", ")}`);const o=q(await D(n,e));r.note(o,e.dryRun?"Dry run \u2014 would do:":"Next steps"),r.outro(e.dryRun?"Dry run complete \u2014 no files written.":"Done.")}function q(e){const n=Math.max(40,Math.min(process.stdout.columns||80,100)-6);return e.map((e,t)=>{const r=`${t+1}. `,o=" ".repeat(r.length);return F(e,n-r.length).map((e,n)=>(0===n?r:o)+e).join("\n")}).join("\n")}function F(e,n){const t=[];let r="";for(const o of e.split(/\s+/))""===r?r=o:r.length+1+o.length<=n?r+=" "+o:(t.push(r),r=o);return""!==r&&t.push(r),t.length>0?t:[""]}
@@ -37,7 +37,7 @@
37
37
  "@radix-ui/react-toggle": "^1.1.10",
38
38
  "@radix-ui/react-toggle-group": "^1.1.11",
39
39
  "@radix-ui/react-tooltip": "^1.2.8",
40
- "@vendure-platform/storefront-client": "^1.0.2",
40
+ "@vendure-platform/storefront-client": "^1.0.3",
41
41
  "class-variance-authority": "^0.7.1",
42
42
  "clsx": "^2.1.1",
43
43
  "cmdk": "^1.1.1",
@@ -18,8 +18,8 @@ import { useState, useTransition } from 'react';
18
18
  import { toast } from 'sonner';
19
19
  import {
20
20
  addSharedCartMember,
21
- fetchCompanyMembers,
22
- type CompanyMemberOption,
21
+ fetchMemberCandidates,
22
+ type MemberCandidate,
23
23
  type SharedCartRole,
24
24
  } from '../actions';
25
25
 
@@ -33,7 +33,8 @@ export function AddMemberDialog({
33
33
  onAdded: () => void;
34
34
  }) {
35
35
  const [open, setOpen] = useState(false);
36
- const [candidates, setCandidates] = useState<CompanyMemberOption[] | null>(null);
36
+ const [candidates, setCandidates] = useState<MemberCandidate[] | null>(null);
37
+ const [loadError, setLoadError] = useState<string | null>(null);
37
38
  const [selected, setSelected] = useState<string>('');
38
39
  const [role, setRole] = useState<SharedCartRole>('edit');
39
40
  const [isPending, startTransition] = useTransition();
@@ -41,7 +42,14 @@ export function AddMemberDialog({
41
42
  function loadOnOpen(next: boolean) {
42
43
  setOpen(next);
43
44
  if (next && candidates === null) {
44
- fetchCompanyMembers().then(setCandidates);
45
+ setLoadError(null);
46
+ fetchMemberCandidates(cartId).then((result) => {
47
+ if (result.success) {
48
+ setCandidates(result.candidates);
49
+ } else {
50
+ setLoadError(result.message);
51
+ }
52
+ });
45
53
  }
46
54
  }
47
55
 
@@ -81,7 +89,11 @@ export function AddMemberDialog({
81
89
  <div className="space-y-4 py-2">
82
90
  <div className="space-y-2">
83
91
  <Label>Colleague</Label>
84
- {candidates === null ? (
92
+ {loadError ? (
93
+ <p role="alert" className="text-sm text-destructive">
94
+ Could not load your colleagues: {loadError}
95
+ </p>
96
+ ) : candidates === null ? (
85
97
  <p className="text-sm text-muted-foreground">Loading colleagues…</p>
86
98
  ) : available.length === 0 ? (
87
99
  <p className="text-sm text-muted-foreground">
@@ -95,7 +107,7 @@ export function AddMemberDialog({
95
107
  <SelectContent>
96
108
  {available.map((c) => (
97
109
  <SelectItem key={c.customerId} value={c.customerId}>
98
- {c.firstName} {c.lastName} — {c.emailAddress}
110
+ {c.firstName} {c.lastName}
99
111
  </SelectItem>
100
112
  ))}
101
113
  </SelectContent>
@@ -1,10 +1,9 @@
1
1
  'use server';
2
2
 
3
3
  import { roleAtLeast } from '@/components/commerce/shared-cart-role';
4
- import { readFragment, type ResultOf } from '@/graphql';
4
+ import { type ResultOf } from '@/graphql';
5
5
  import { getActiveCustomer } from '@/lib/vendure/actions';
6
6
  import { client } from '@/lib/vendure/api';
7
- import { CompanyUserFragment } from '@/lib/vendure/fragments';
8
7
  import {
9
8
  AddItemToSharedCartMutation,
10
9
  AddSharedCartMemberMutation,
@@ -20,8 +19,8 @@ import {
20
19
  } from '@/lib/vendure/mutations';
21
20
  import {
22
21
  GetMySharedCartsQuery,
22
+ GetSharedCartMemberCandidatesQuery,
23
23
  GetSharedCartQuery,
24
- GetShopCompanyUsersQuery,
25
24
  SearchVariantsQuery,
26
25
  } from '@/lib/vendure/queries';
27
26
  import { revalidatePath, updateTag } from 'next/cache';
@@ -220,24 +219,19 @@ export async function searchVariantsForSharedCart(term: string): Promise<Variant
220
219
 
221
220
  // --- Members & governance (owner OR company-admin; server enforces) --------
222
221
 
223
- export type CompanyMemberOption = {
224
- customerId: string;
225
- firstName: string;
226
- lastName: string;
227
- emailAddress: string;
228
- };
222
+ export type MemberCandidate = ResultOf<
223
+ typeof GetSharedCartMemberCandidatesQuery
224
+ >['sharedCartMemberCandidates'][number];
229
225
 
230
- export async function fetchCompanyMembers(): Promise<CompanyMemberOption[]> {
231
- const [result, error] = await client.query(GetShopCompanyUsersQuery, {});
232
- if (error) return [];
233
- return result.data.shopCompanyUsers
234
- .map((user) => readFragment(CompanyUserFragment, user))
235
- .map((user) => ({
236
- customerId: user.customer.id,
237
- firstName: user.customer.firstName,
238
- lastName: user.customer.lastName,
239
- emailAddress: user.customer.emailAddress,
240
- }));
226
+ /** The colleagues the caller may add to the cart, by name only. */
227
+ export async function fetchMemberCandidates(
228
+ sharedCartId: string,
229
+ ): Promise<{ success: true; candidates: MemberCandidate[] } | { success: false; message: string }> {
230
+ const [result, error] = await client.query(GetSharedCartMemberCandidatesQuery, { sharedCartId });
231
+ if (error) {
232
+ return { success: false, message: error.message };
233
+ }
234
+ return { success: true, candidates: result.data.sharedCartMemberCandidates };
241
235
  }
242
236
 
243
237
  export async function addSharedCartMember(
@@ -294,7 +294,7 @@ export type introspection_types = {
294
294
  'PunchoutAuthInput': { kind: 'INPUT_OBJECT'; name: 'PunchoutAuthInput'; isOneOf: false; inputFields: [{ name: 'token'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; };
295
295
  'PunchoutCartTransferResult': { kind: 'OBJECT'; name: 'PunchoutCartTransferResult'; fields: { 'browserFormPostUrl': { name: 'browserFormPostUrl'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'cxmlPayload': { name: 'cxmlPayload'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; };
296
296
  'PunchoutSessionInfo': { kind: 'OBJECT'; name: 'PunchoutSessionInfo'; fields: { 'buyerCookie': { name: 'buyerCookie'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'expiresAt': { name: 'expiresAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'extrinsics': { name: 'extrinsics'; type: { kind: 'SCALAR'; name: 'JSON'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'operation': { name: 'operation'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'tradingPartnerName': { name: 'tradingPartnerName'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; };
297
- 'Query': { kind: 'OBJECT'; name: 'Query'; fields: { 'activeChannel': { name: 'activeChannel'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Channel'; ofType: null; }; } }; 'activeCompanyUser': { name: 'activeCompanyUser'; type: { kind: 'OBJECT'; name: 'CompanyUser'; ofType: null; } }; 'activeCustomer': { name: 'activeCustomer'; type: { kind: 'OBJECT'; name: 'Customer'; ofType: null; } }; 'activeOrder': { name: 'activeOrder'; type: { kind: 'OBJECT'; name: 'Order'; ofType: null; } }; 'activePaymentMethods': { name: 'activePaymentMethods'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'PublicPaymentMethod'; ofType: null; }; }; } }; 'activePunchoutSession': { name: 'activePunchoutSession'; type: { kind: 'OBJECT'; name: 'PunchoutSessionInfo'; ofType: null; } }; 'activeShippingMethods': { name: 'activeShippingMethods'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'PublicShippingMethod'; ofType: null; }; }; } }; 'activeUserShoppingList': { name: 'activeUserShoppingList'; type: { kind: 'OBJECT'; name: 'ShoppingList'; ofType: null; } }; 'activeUserShoppingLists': { name: 'activeUserShoppingLists'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ShoppingList'; ofType: null; }; }; }; } }; 'approvalHistoryForEntity': { name: 'approvalHistoryForEntity'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ApprovalRequest'; ofType: null; }; }; }; } }; 'availableCountries': { name: 'availableCountries'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Country'; ofType: null; }; }; }; } }; 'collection': { name: 'collection'; type: { kind: 'OBJECT'; name: 'Collection'; ofType: null; } }; 'collections': { name: 'collections'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'CollectionList'; ofType: null; }; } }; 'companyAccount': { name: 'companyAccount'; type: { kind: 'OBJECT'; name: 'CompanyAccount'; ofType: null; } }; 'companyAddresses': { name: 'companyAddresses'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'CompanyAddress'; ofType: null; }; }; }; } }; 'companyBusinessUnits': { name: 'companyBusinessUnits'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'CompanyBusinessUnit'; ofType: null; }; }; }; } }; 'companyInvitation': { name: 'companyInvitation'; type: { kind: 'OBJECT'; name: 'CompanyInvitation'; ofType: null; } }; 'companyOrders': { name: 'companyOrders'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'OrderList'; ofType: null; }; } }; 'companyPaymentMethods': { name: 'companyPaymentMethods'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'CompanyPaymentMethod'; ofType: null; }; }; }; } }; 'companyRoles': { name: 'companyRoles'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'CompanyRole'; ofType: null; }; }; }; } }; 'companySharedCarts': { name: 'companySharedCarts'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SharedCartList'; ofType: null; }; } }; 'configuratorSystem': { name: 'configuratorSystem'; type: { kind: 'OBJECT'; name: 'ConfiguratorSystem'; ofType: null; } }; 'configuratorSystems': { name: 'configuratorSystems'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ConfiguratorSystem'; ofType: null; }; }; }; } }; 'contentVersioningProductVariant': { name: 'contentVersioningProductVariant'; type: { kind: 'OBJECT'; name: 'ProductVariant'; ofType: null; } }; 'eligiblePaymentMethods': { name: 'eligiblePaymentMethods'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PaymentMethodQuote'; ofType: null; }; }; }; } }; 'eligibleShippingMethods': { name: 'eligibleShippingMethods'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ShippingMethodQuote'; ofType: null; }; }; }; } }; 'evaluateProductConfiguration': { name: 'evaluateProductConfiguration'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ProductConfigurationEvaluation'; ofType: null; }; } }; 'facet': { name: 'facet'; type: { kind: 'OBJECT'; name: 'Facet'; ofType: null; } }; 'facets': { name: 'facets'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'FacetList'; ofType: null; }; } }; 'giftCardTemplates': { name: 'giftCardTemplates'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'GiftCardTemplateList'; ofType: null; }; } }; 'me': { name: 'me'; type: { kind: 'OBJECT'; name: 'CurrentUser'; ofType: null; } }; 'myApprovalRequests': { name: 'myApprovalRequests'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ApprovalRequestList'; ofType: null; }; } }; 'myQuote': { name: 'myQuote'; type: { kind: 'OBJECT'; name: 'Quote'; ofType: null; } }; 'myQuotes': { name: 'myQuotes'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'QuoteList'; ofType: null; }; } }; 'mySharedCarts': { name: 'mySharedCarts'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SharedCartList'; ofType: null; }; } }; 'myStoreCredits': { name: 'myStoreCredits'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'StoreCreditList'; ofType: null; }; } }; 'nextOrderStates': { name: 'nextOrderStates'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; }; } }; 'order': { name: 'order'; type: { kind: 'OBJECT'; name: 'Order'; ofType: null; } }; 'orderByCode': { name: 'orderByCode'; type: { kind: 'OBJECT'; name: 'Order'; ofType: null; } }; 'previewReorder': { name: 'previewReorder'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ReorderPreview'; ofType: null; }; } }; 'product': { name: 'product'; type: { kind: 'OBJECT'; name: 'Product'; ofType: null; } }; 'products': { name: 'products'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ProductList'; ofType: null; }; } }; 'publicDemoStoryState': { name: 'publicDemoStoryState'; type: { kind: 'OBJECT'; name: 'PublicDemoStoryState'; ofType: null; } }; 'publicShoppingList': { name: 'publicShoppingList'; type: { kind: 'OBJECT'; name: 'ShoppingList'; ofType: null; } }; 'quickOrderSearch': { name: 'quickOrderSearch'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'QuickOrderSearchResult'; ofType: null; }; }; }; } }; 'quoteStockCheck': { name: 'quoteStockCheck'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'QuoteStockCheckResult'; ofType: null; }; } }; 'search': { name: 'search'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SearchResponse'; ofType: null; }; } }; 'searchCollections': { name: 'searchCollections'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'CollectionsResponse'; ofType: null; }; } }; 'searchExternal': { name: 'searchExternal'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'ExternalIndexResponse'; ofType: null; }; }; }; } }; 'searchGlobal_search': { name: 'searchGlobal_search'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Global_searchResponse'; ofType: null; }; } }; 'sharedCart': { name: 'sharedCart'; type: { kind: 'OBJECT'; name: 'SharedCart'; ofType: null; } }; 'shopCompanyUsers': { name: 'shopCompanyUsers'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'CompanyUser'; ofType: null; }; }; }; } }; 'taxIds': { name: 'taxIds'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TaxId'; ofType: null; }; }; }; } }; }; };
297
+ 'Query': { kind: 'OBJECT'; name: 'Query'; fields: { 'activeChannel': { name: 'activeChannel'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Channel'; ofType: null; }; } }; 'activeCompanyUser': { name: 'activeCompanyUser'; type: { kind: 'OBJECT'; name: 'CompanyUser'; ofType: null; } }; 'activeCustomer': { name: 'activeCustomer'; type: { kind: 'OBJECT'; name: 'Customer'; ofType: null; } }; 'activeOrder': { name: 'activeOrder'; type: { kind: 'OBJECT'; name: 'Order'; ofType: null; } }; 'activePaymentMethods': { name: 'activePaymentMethods'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'PublicPaymentMethod'; ofType: null; }; }; } }; 'activePunchoutSession': { name: 'activePunchoutSession'; type: { kind: 'OBJECT'; name: 'PunchoutSessionInfo'; ofType: null; } }; 'activeShippingMethods': { name: 'activeShippingMethods'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'PublicShippingMethod'; ofType: null; }; }; } }; 'activeUserShoppingList': { name: 'activeUserShoppingList'; type: { kind: 'OBJECT'; name: 'ShoppingList'; ofType: null; } }; 'activeUserShoppingLists': { name: 'activeUserShoppingLists'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ShoppingList'; ofType: null; }; }; }; } }; 'approvalHistoryForEntity': { name: 'approvalHistoryForEntity'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ApprovalRequest'; ofType: null; }; }; }; } }; 'availableCountries': { name: 'availableCountries'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Country'; ofType: null; }; }; }; } }; 'collection': { name: 'collection'; type: { kind: 'OBJECT'; name: 'Collection'; ofType: null; } }; 'collections': { name: 'collections'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'CollectionList'; ofType: null; }; } }; 'companyAccount': { name: 'companyAccount'; type: { kind: 'OBJECT'; name: 'CompanyAccount'; ofType: null; } }; 'companyAddresses': { name: 'companyAddresses'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'CompanyAddress'; ofType: null; }; }; }; } }; 'companyBusinessUnits': { name: 'companyBusinessUnits'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'CompanyBusinessUnit'; ofType: null; }; }; }; } }; 'companyInvitation': { name: 'companyInvitation'; type: { kind: 'OBJECT'; name: 'CompanyInvitation'; ofType: null; } }; 'companyOrders': { name: 'companyOrders'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'OrderList'; ofType: null; }; } }; 'companyPaymentMethods': { name: 'companyPaymentMethods'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'CompanyPaymentMethod'; ofType: null; }; }; }; } }; 'companyRoles': { name: 'companyRoles'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'CompanyRole'; ofType: null; }; }; }; } }; 'companySharedCarts': { name: 'companySharedCarts'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SharedCartList'; ofType: null; }; } }; 'configuratorSystem': { name: 'configuratorSystem'; type: { kind: 'OBJECT'; name: 'ConfiguratorSystem'; ofType: null; } }; 'configuratorSystems': { name: 'configuratorSystems'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ConfiguratorSystem'; ofType: null; }; }; }; } }; 'contentVersioningProductVariant': { name: 'contentVersioningProductVariant'; type: { kind: 'OBJECT'; name: 'ProductVariant'; ofType: null; } }; 'eligiblePaymentMethods': { name: 'eligiblePaymentMethods'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PaymentMethodQuote'; ofType: null; }; }; }; } }; 'eligibleShippingMethods': { name: 'eligibleShippingMethods'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ShippingMethodQuote'; ofType: null; }; }; }; } }; 'evaluateProductConfiguration': { name: 'evaluateProductConfiguration'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ProductConfigurationEvaluation'; ofType: null; }; } }; 'facet': { name: 'facet'; type: { kind: 'OBJECT'; name: 'Facet'; ofType: null; } }; 'facets': { name: 'facets'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'FacetList'; ofType: null; }; } }; 'giftCardTemplates': { name: 'giftCardTemplates'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'GiftCardTemplateList'; ofType: null; }; } }; 'me': { name: 'me'; type: { kind: 'OBJECT'; name: 'CurrentUser'; ofType: null; } }; 'myApprovalRequests': { name: 'myApprovalRequests'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ApprovalRequestList'; ofType: null; }; } }; 'myQuote': { name: 'myQuote'; type: { kind: 'OBJECT'; name: 'Quote'; ofType: null; } }; 'myQuotes': { name: 'myQuotes'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'QuoteList'; ofType: null; }; } }; 'mySharedCarts': { name: 'mySharedCarts'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SharedCartList'; ofType: null; }; } }; 'myStoreCredits': { name: 'myStoreCredits'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'StoreCreditList'; ofType: null; }; } }; 'nextOrderStates': { name: 'nextOrderStates'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; }; } }; 'order': { name: 'order'; type: { kind: 'OBJECT'; name: 'Order'; ofType: null; } }; 'orderByCode': { name: 'orderByCode'; type: { kind: 'OBJECT'; name: 'Order'; ofType: null; } }; 'previewReorder': { name: 'previewReorder'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ReorderPreview'; ofType: null; }; } }; 'product': { name: 'product'; type: { kind: 'OBJECT'; name: 'Product'; ofType: null; } }; 'products': { name: 'products'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ProductList'; ofType: null; }; } }; 'publicDemoStoryState': { name: 'publicDemoStoryState'; type: { kind: 'OBJECT'; name: 'PublicDemoStoryState'; ofType: null; } }; 'publicShoppingList': { name: 'publicShoppingList'; type: { kind: 'OBJECT'; name: 'ShoppingList'; ofType: null; } }; 'quickOrderSearch': { name: 'quickOrderSearch'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'QuickOrderSearchResult'; ofType: null; }; }; }; } }; 'quoteStockCheck': { name: 'quoteStockCheck'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'QuoteStockCheckResult'; ofType: null; }; } }; 'search': { name: 'search'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SearchResponse'; ofType: null; }; } }; 'searchCollections': { name: 'searchCollections'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'CollectionsResponse'; ofType: null; }; } }; 'searchExternal': { name: 'searchExternal'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'ExternalIndexResponse'; ofType: null; }; }; }; } }; 'searchGlobal_search': { name: 'searchGlobal_search'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Global_searchResponse'; ofType: null; }; } }; 'sharedCart': { name: 'sharedCart'; type: { kind: 'OBJECT'; name: 'SharedCart'; ofType: null; } }; 'sharedCartMemberCandidates': { name: 'sharedCartMemberCandidates'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SharedCartMemberCandidate'; ofType: null; }; }; }; } }; 'shopCompanyUsers': { name: 'shopCompanyUsers'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'CompanyUser'; ofType: null; }; }; }; } }; 'taxIds': { name: 'taxIds'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TaxId'; ofType: null; }; }; }; } }; }; };
298
298
  'QuickOrderAddToOrderError': { kind: 'OBJECT'; name: 'QuickOrderAddToOrderError'; fields: { 'errorCode': { name: 'errorCode'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'ErrorCode'; ofType: null; }; } }; 'message': { name: 'message'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; };
299
299
  'QuickOrderAddToOrderResult': { kind: 'UNION'; name: 'QuickOrderAddToOrderResult'; fields: {}; possibleTypes: 'QuickOrderAddToOrderError' | 'QuickOrderAddToOrderSuccess'; };
300
300
  'QuickOrderAddToOrderSuccess': { kind: 'OBJECT'; name: 'QuickOrderAddToOrderSuccess'; fields: { 'addedCount': { name: 'addedCount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; } }; 'messages': { name: 'messages'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'QuickOrderMessage'; ofType: null; }; }; }; } }; 'order': { name: 'order'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Order'; ofType: null; }; } }; 'skippedCount': { name: 'skippedCount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; } }; }; };
@@ -375,6 +375,7 @@ export type introspection_types = {
375
375
  'SharedCartList': { kind: 'OBJECT'; name: 'SharedCartList'; fields: { 'items': { name: 'items'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SharedCart'; ofType: null; }; }; }; } }; 'totalItems': { name: 'totalItems'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; } }; }; };
376
376
  'SharedCartListOptions': { kind: 'INPUT_OBJECT'; name: 'SharedCartListOptions'; isOneOf: false; inputFields: [{ name: 'skip'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'take'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'sort'; type: { kind: 'INPUT_OBJECT'; name: 'SharedCartSortParameter'; ofType: null; }; defaultValue: null }, { name: 'filter'; type: { kind: 'INPUT_OBJECT'; name: 'SharedCartFilterParameter'; ofType: null; }; defaultValue: null }, { name: 'filterOperator'; type: { kind: 'ENUM'; name: 'LogicalOperator'; ofType: null; }; defaultValue: null }]; };
377
377
  'SharedCartMember': { kind: 'OBJECT'; name: 'SharedCartMember'; fields: { 'createdAt': { name: 'createdAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'customFields': { name: 'customFields'; type: { kind: 'SCALAR'; name: 'JSON'; ofType: null; } }; 'customer': { name: 'customer'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Customer'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'role': { name: 'role'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'SharedCartRole'; ofType: null; }; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; }; };
378
+ 'SharedCartMemberCandidate': { kind: 'OBJECT'; name: 'SharedCartMemberCandidate'; fields: { 'customerId': { name: 'customerId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'firstName': { name: 'firstName'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'lastName': { name: 'lastName'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; };
378
379
  'SharedCartRole': { name: 'SharedCartRole'; enumValues: 'view' | 'edit' | 'checkout'; };
379
380
  'SharedCartSortParameter': { kind: 'INPUT_OBJECT'; name: 'SharedCartSortParameter'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'createdAt'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'updatedAt'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'name'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'description'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'companyId'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }]; };
380
381
  'SharedCartStatus': { name: 'SharedCartStatus'; enumValues: 'Open' | 'Locked' | 'Closed'; };
@@ -222,7 +222,7 @@ export const STOREFRONT_CAPABILITY_CONTRIBUTIONS: Readonly<Record<string, Schema
222
222
  },
223
223
  'shared-carts.collaboration': {
224
224
  fields: {
225
- Query: ['mySharedCarts', 'sharedCart', 'companySharedCarts'],
225
+ Query: ['mySharedCarts', 'sharedCart', 'sharedCartMemberCandidates', 'companySharedCarts'],
226
226
  Mutation: [
227
227
  'createSharedCart',
228
228
  'updateSharedCart',
@@ -1992,6 +1992,20 @@ export const GetSharedCartQuery = composeCapabilityDocument(
1992
1992
  ],
1993
1993
  );
1994
1994
 
1995
+ export const GetSharedCartMemberCandidatesQuery = forCapability(
1996
+ 'shared-carts.collaboration',
1997
+ graphql(`
1998
+ query GetSharedCartMemberCandidates($sharedCartId: ID!) {
1999
+ sharedCartMemberCandidates(sharedCartId: $sharedCartId) {
2000
+ customerId
2001
+ firstName
2002
+ lastName
2003
+ }
2004
+ }
2005
+ `),
2006
+ [['sharedCartMemberCandidates']],
2007
+ );
2008
+
1995
2009
  export const GetActivePunchoutSessionQuery = forCapability(
1996
2010
  'punchout',
1997
2011
  graphql(`
@@ -3749,6 +3749,11 @@ type Query {
3749
3749
  quoteStockCheck(quoteId: ID!): QuoteStockCheckResult!
3750
3750
  mySharedCarts(options: SharedCartListOptions): SharedCartList!
3751
3751
  sharedCart(id: ID!): SharedCart
3752
+
3753
+ """
3754
+ The colleagues the caller can add to the cart. Requires the right to manage the cart's members.
3755
+ """
3756
+ sharedCartMemberCandidates(sharedCartId: ID!): [SharedCartMemberCandidate!]!
3752
3757
  companySharedCarts(options: SharedCartListOptions): SharedCartList!
3753
3758
 
3754
3759
  """
@@ -5481,6 +5486,16 @@ type SharedCartList implements PaginatedList {
5481
5486
  totalItems: Int!
5482
5487
  }
5483
5488
 
5489
+ """
5490
+ A colleague who can be added to a shared cart: an active member of the cart's company who is not
5491
+ on the cart yet, by name only. The list is sorted by name and carries no contact details.
5492
+ """
5493
+ type SharedCartMemberCandidate {
5494
+ customerId: ID!
5495
+ firstName: String!
5496
+ lastName: String!
5497
+ }
5498
+
5484
5499
  input SharedCartListOptions {
5485
5500
  """Skips the first n results, for use in pagination"""
5486
5501
  skip: Int
package/dist/cli.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e=this&&this.__createBinding||(Object.create?function(e,o,n,t){void 0===t&&(t=n);var i=Object.getOwnPropertyDescriptor(o,n);i&&!("get"in i?!o.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return o[n]}}),Object.defineProperty(e,t,i)}:function(e,o,n,t){void 0===t&&(t=n),e[t]=o[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,o){Object.defineProperty(e,"default",{enumerable:!0,value:o})}:function(e,o){e.default=o}),n=this&&this.__importStar||function(){var n=function(e){return n=Object.getOwnPropertyNames||function(e){var o=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(o[o.length]=n);return o},n(e)};return function(t){if(t&&t.__esModule)return t;var i={};if(null!=t)for(var r=n(t),l=0;l<r.length;l++)"default"!==r[l]&&e(i,t,r[l]);return o(i,t),i}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.runStorefrontOnlyCli=j,exports.runCli=w;const t=n(require("@clack/prompts")),i=require("@vendure-platform/plugin-meta"),r=n(require("path")),l=require("./console-onboarding"),a=require("./hub-projects"),s=require("./plugin-registry");function c(e){if(e){if(!(0,s.isCapabilityProfileName)(e))throw new Error(`Invalid --profile value "${e}". Must be one of: ${i.EDITION_ORDER.join(", ")}`);return e}}function u(e){return e?[...i.CAPABILITY_PROFILES[e]]:void 0}const d=i.EDITION_ORDER.filter(e=>(0,s.grantsIncludeStorefront)(i.CAPABILITY_PROFILES[e]));function p(e,o){if(!d.includes(e))throw new Error(`${o} needs the "${s.STOREFRONT_CAPABILITY}" capability, which the ${e} edition does not grant. These editions include the storefront: ${d.join(", ")}.`)}function v(e,o){return o&&p(e,"--storefront"),null!=o?o:d.includes(e)}const f=["bun","npm","pnpm"];function m(e){if(!e)return"bun";if(f.includes(e))return e;throw new Error(`Invalid --pm value "${e}". Must be one of: ${f.join(", ")}`)}function h(e){if(e)try{return new URL(e),e}catch{throw new Error(`Invalid --api-url value "${e}": not a valid URL`)}}function g(e){return 0===e.trim().length?"Project name is required":/[^a-zA-Z0-9._-]/.test(e)?"Project name may only contain letters, numbers, dots, hyphens, and underscores":void 0}function y(e){if(!(0,l.isInteractive)())throw new Error(`No interactive terminal is available and required values are missing: ${e.join(", ")}. Pass them as flags to scaffold non-interactively.`)}async function b(e){const o=(0,a.resolveHubProjectSource)();if(!o)return;const n=await(0,a.listHubProjects)(o,e=>t.log.warn(`Could not read your Vendure Console projects: ${e}`));if(0===n.length)return;if(e){const o=n.find(o=>o.id===e);if(!o)throw new Error(`--console-project ${e} is not in the project list. Available: ${n.map(e=>e.id).join(", ")}`);return o}const i=await t.select({message:"Which Vendure Console project is this?",options:[...n.map(e=>({label:e.name,value:e.id,hint:`${e.edition} edition`})),{label:"None of these (choose an edition myself)",value:""}]});return t.isCancel(i)&&(t.cancel("Setup cancelled."),process.exit(0)),n.find(e=>e.id===i)}async function j(e,o){var n,i,r;const l=m(null==o?void 0:o.pm),a=h(null==o?void 0:o.apiUrl),s=null!==(n=null==o?void 0:o.scenario)&&void 0!==n?n:"customer",v=c(null==o?void 0:o.profile);if(v&&p(v,"--storefront-only"),e&&a){const n=g(e);return n&&(t.log.error(`Error: ${n}`),process.exit(1)),{projectName:e,apiUrl:a,scenario:s,capabilities:u(v),packageManager:l,skipInstall:!1===(null==o?void 0:o.install),skipGit:!1===(null==o?void 0:o.git),dryRun:null!==(i=null==o?void 0:o.dryRun)&&void 0!==i&&i}}if(y([...e?[]:["<project-name>"],...a?[]:["--api-url"]]),t.intro("create-vendure-platform (storefront-only)"),e){const o=g(e);o&&(t.cancel(o),process.exit(1))}const f=await t.group({projectName:()=>e?Promise.resolve(e):t.text({message:"Project name:",validate:g}),apiUrl:()=>a?Promise.resolve(a):t.text({message:"Vendure Shop API URL (leave blank to use http://localhost:3500/shop-api):",placeholder:"https://shop.example.com/shop-api",validate:e=>{if(e)try{new URL(e)}catch{return"Must be a valid URL"}}}),profile:()=>v?Promise.resolve(v):t.select({message:"Capability profile of the Vendure server this storefront connects to:",options:[...d.map(e=>({label:e,value:e})),{label:"Not known yet (set NEXT_PUBLIC_VENDURE_CAPABILITIES in .env.local later)",value:""}]}),installDeps:()=>void 0!==(null==o?void 0:o.install)?Promise.resolve(o.install):t.confirm({message:`Install dependencies with ${l}?`,initialValue:!0})},{onCancel:()=>{t.cancel("Setup cancelled."),process.exit(0)}});return{projectName:f.projectName,apiUrl:f.apiUrl||void 0,scenario:s,capabilities:u(f.profile||void 0),packageManager:l,skipInstall:!f.installDeps,skipGit:!1===(null==o?void 0:o.git),dryRun:null!==(r=null==o?void 0:o.dryRun)&&void 0!==r&&r}}async function w(e,o){var n,a,s,u,d,p,f,h,j,w,I,R,O;const k=m(null==o?void 0:o.pm),D=c(null==o?void 0:o.profile);if((null==o?void 0:o.consoleProject)&&D)throw new Error("--console-project is mutually exclusive with --profile. The Project names the edition.");if(e&&(null==o?void 0:o.company)&&D){const i=g(e);return i&&(t.log.error(`Error: ${i}`),process.exit(1)),{projectName:e,companyName:o.company,profile:D,includeStorefront:v(D,o.storefront),includeDemoData:null===(n=o.demoData)||void 0===n||n,createGithubRepo:null!==(a=o.github)&&void 0!==a&&a,githubOrg:o.githubOrg,packageManager:k,skipInstall:!1===o.install,skipGit:!1===o.git,dryRun:null!==(s=o.dryRun)&&void 0!==s&&s,registryToken:(null===(u=o.registryToken)||void 0===u?void 0:u.trim())||void 0,licenseToken:(null===(d=o.licenseToken)||void 0===d?void 0:d.trim())||void 0}}if(e&&(null==o?void 0:o.company)&&(null==o?void 0:o.consoleProject)){const n=g(e);if(n)throw new Error(n);const t=await b(o.consoleProject);let i,a=null==t?void 0:t.edition;if(!t){if(i=await(0,l.startConsoleOnboarding)({projectDir:r.resolve(process.cwd(),e),interactive:!1,projectId:o.consoleProject}),!i)throw new Error("--console-project needs a stored Vendure Console session, or VENDURE_HUB_PROJECTS naming a file that lists it. Neither was usable, and this run has no terminal to sign in from.");a=i.edition}const s=c(a);if(!s)throw new Error(`Vendure Console reports no edition for project ${o.consoleProject}, so there is no package set to scaffold. Give the Project an edition, or scaffold with --profile instead.`);return{projectName:e,companyName:o.company,profile:s,includeStorefront:v(s,o.storefront),includeDemoData:null===(p=o.demoData)||void 0===p||p,createGithubRepo:null!==(f=o.github)&&void 0!==f&&f,githubOrg:o.githubOrg,packageManager:k,skipInstall:!1===o.install,skipGit:!1===o.git,dryRun:null!==(h=o.dryRun)&&void 0!==h&&h,registryToken:(null===(j=o.registryToken)||void 0===j?void 0:j.trim())||void 0,licenseToken:(null===(w=o.licenseToken)||void 0===w?void 0:w.trim())||void 0,consoleOnboarding:i}}if(y([...e?[]:["<project-name>"],...(null==o?void 0:o.company)?[]:["--company"],...D?[]:["--profile"]]),t.intro("create-vendure-platform"),e){const o=g(e);o&&(t.cancel(o),process.exit(1))}const E=null!=e?e:await P();let N,T=D;if(!D&&!(null==o?void 0:o.dryRun)){const e=await b(null==o?void 0:o.consoleProject);e?(T=e.edition,t.log.info(`${e.name} is on the ${e.edition} edition.`)):(N=await(0,l.startConsoleOnboarding)({projectDir:r.resolve(process.cwd(),E),interactive:!0,projectId:null==o?void 0:o.consoleProject}),T=null==N?void 0:N.edition)}T&&v(T,null==o?void 0:o.storefront);const _=await t.group({companyName:()=>{if(null==o?void 0:o.company)return Promise.resolve(o.company);const e=E.replace(/^vendure-/,"").replace(/-demo$/,"").replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase());return t.text({message:"Company name (used in README and project branding):",defaultValue:e,placeholder:e})},edition:()=>T?Promise.resolve(T):t.select({message:"Which Vendure Platform edition is this project on?",options:i.EDITION_ORDER.map(e=>({label:e,value:e}))}),includeStorefront:({results:e})=>{const n=v(e.edition,null==o?void 0:o.storefront);return void 0===(null==o?void 0:o.storefront)&&n?t.confirm({message:"Include the Next.js storefront?",initialValue:!0}):Promise.resolve(n)},includeDemoData:()=>void 0!==(null==o?void 0:o.demoData)?Promise.resolve(o.demoData):t.confirm({message:"Include demo data?",initialValue:!0}),installDeps:()=>void 0!==(null==o?void 0:o.install)?Promise.resolve(o.install):t.confirm({message:`Install dependencies with ${k}?`,initialValue:!0})},{onCancel:()=>{t.cancel("Setup cancelled."),process.exit(0)}}),C=_.edition;return{projectName:E,companyName:_.companyName,profile:C,includeStorefront:_.includeStorefront,includeDemoData:_.includeDemoData,createGithubRepo:!1,githubOrg:void 0,packageManager:k,skipInstall:!_.installDeps,skipGit:!1===(null==o?void 0:o.git),dryRun:null!==(I=null==o?void 0:o.dryRun)&&void 0!==I&&I,registryToken:(null===(R=null==o?void 0:o.registryToken)||void 0===R?void 0:R.trim())||void 0,licenseToken:(null===(O=null==o?void 0:o.licenseToken)||void 0===O?void 0:O.trim())||void 0,consoleOnboarding:N}}async function P(){const e=await t.text({message:"Project name:",validate:g});return t.isCancel(e)&&(t.cancel("Setup cancelled."),process.exit(0)),e}
1
+ "use strict";var e=this&&this.__createBinding||(Object.create?function(e,o,n,t){void 0===t&&(t=n);var i=Object.getOwnPropertyDescriptor(o,n);i&&!("get"in i?!o.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return o[n]}}),Object.defineProperty(e,t,i)}:function(e,o,n,t){void 0===t&&(t=n),e[t]=o[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,o){Object.defineProperty(e,"default",{enumerable:!0,value:o})}:function(e,o){e.default=o}),n=this&&this.__importStar||function(){var n=function(e){return n=Object.getOwnPropertyNames||function(e){var o=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(o[o.length]=n);return o},n(e)};return function(t){if(t&&t.__esModule)return t;var i={};if(null!=t)for(var r=n(t),l=0;l<r.length;l++)"default"!==r[l]&&e(i,t,r[l]);return o(i,t),i}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.runStorefrontOnlyCli=j,exports.runCli=w;const t=n(require("@clack/prompts")),i=require("@vendure-platform/plugin-meta"),r=n(require("path")),l=require("./console-onboarding"),a=require("./hub-projects"),s=require("./plugin-registry");function c(e){if(e){if(!(0,s.isCapabilityProfileName)(e))throw new Error(`Invalid --profile value "${e}". Must be one of: ${i.EDITION_ORDER.join(", ")}`);return e}}function u(e){return e?[...i.CAPABILITY_PROFILES[e]]:void 0}const d=i.EDITION_ORDER.filter(e=>(0,s.grantsIncludeStorefront)(i.CAPABILITY_PROFILES[e]));function p(e,o){if(!d.includes(e))throw new Error(`${o} needs the "${s.STOREFRONT_CAPABILITY}" capability, which the ${e} edition does not grant. These editions include the storefront: ${d.join(", ")}.`)}function v(e,o){return o&&p(e,"--storefront"),null!=o?o:d.includes(e)}const f=["bun","npm","pnpm"];function m(e){if(!e)return"bun";if(f.includes(e))return e;throw new Error(`Invalid --pm value "${e}". Must be one of: ${f.join(", ")}`)}function h(e){if(e)try{return new URL(e),e}catch{throw new Error(`Invalid --api-url value "${e}": not a valid URL`)}}function g(e){return 0===e.trim().length?"Project name is required":/[^a-zA-Z0-9._-]/.test(e)?"Project name may only contain letters, numbers, dots, hyphens, and underscores":void 0}function y(e){if(!(0,l.isInteractive)())throw new Error(`No interactive terminal is available and required values are missing: ${e.join(", ")}. Pass them as flags to scaffold non-interactively.`)}async function b(e){const o=(0,a.resolveHubProjectSource)();if(!o)return;const n=await(0,a.listHubProjects)(o,e=>t.log.warn(`Could not read your Vendure Console projects: ${e}`));if(0===n.length)return;if(e){const o=n.find(o=>o.id===e);if(!o)throw new Error(`--console-project ${e} is not in the project list. Available: ${n.map(e=>e.id).join(", ")}`);return o}const i=await t.select({message:"Which Vendure Console project is this?",options:[...n.map(e=>({label:e.name,value:e.id,hint:`${e.edition} edition`})),{label:"None of these (choose an edition myself)",value:""}]});return t.isCancel(i)&&(t.cancel("Setup cancelled."),process.exit(0)),n.find(e=>e.id===i)}async function j(e,o){var n,i,r;const l=m(null==o?void 0:o.pm),a=h(null==o?void 0:o.apiUrl),s=null!==(n=null==o?void 0:o.scenario)&&void 0!==n?n:"customer",v=c(null==o?void 0:o.profile);if(v&&p(v,"--storefront-only"),e&&a){const n=g(e);return n&&(t.log.error(`Error: ${n}`),process.exit(1)),{projectName:e,apiUrl:a,scenario:s,capabilities:u(v),packageManager:l,skipInstall:!1===(null==o?void 0:o.install),skipGit:!1===(null==o?void 0:o.git),dryRun:null!==(i=null==o?void 0:o.dryRun)&&void 0!==i&&i}}if(y([...e?[]:["<project-name>"],...a?[]:["--api-url"]]),t.intro("create-vendure-platform (storefront-only)"),e){const o=g(e);o&&(t.cancel(o),process.exit(1))}const f=await t.group({projectName:()=>e?Promise.resolve(e):t.text({message:"Project name:",validate:g}),apiUrl:()=>a?Promise.resolve(a):t.text({message:"Vendure Shop API URL (leave blank to use http://localhost:3500/shop-api):",placeholder:"https://shop.example.com/shop-api",validate:e=>{if(e)try{new URL(e)}catch{return"Must be a valid URL"}}}),profile:()=>v?Promise.resolve(v):t.select({message:"Capability profile of the Vendure server this storefront connects to:",options:[...d.map(e=>({label:e,value:e})),{label:"Not known yet (set NEXT_PUBLIC_VENDURE_CAPABILITIES in .env.local later)",value:""}]}),installDeps:()=>void 0!==(null==o?void 0:o.install)?Promise.resolve(o.install):t.confirm({message:`Install dependencies with ${l}?`,initialValue:!0})},{onCancel:()=>{t.cancel("Setup cancelled."),process.exit(0)}});return{projectName:f.projectName,apiUrl:f.apiUrl||void 0,scenario:s,capabilities:u(f.profile||void 0),packageManager:l,skipInstall:!f.installDeps,skipGit:!1===(null==o?void 0:o.git),dryRun:null!==(r=null==o?void 0:o.dryRun)&&void 0!==r&&r}}async function w(e,o){var n,a,s,u,d,p,f,h,j,w,I,R,O;const k=m(null==o?void 0:o.pm),D=c(null==o?void 0:o.profile);if((null==o?void 0:o.consoleProject)&&D)throw new Error("--console-project is mutually exclusive with --profile. The Project names the edition.");if(e&&(null==o?void 0:o.company)&&D){const i=g(e);return i&&(t.log.error(`Error: ${i}`),process.exit(1)),{projectName:e,companyName:o.company,profile:D,includeStorefront:v(D,o.storefront),includeDemoData:null===(n=o.demoData)||void 0===n||n,createGithubRepo:null!==(a=o.github)&&void 0!==a&&a,githubOrg:o.githubOrg,packageManager:k,skipInstall:!1===o.install,skipGit:!1===o.git,dryRun:null!==(s=o.dryRun)&&void 0!==s&&s,registryToken:(null===(u=o.registryToken)||void 0===u?void 0:u.trim())||void 0,licenseToken:(null===(d=o.licenseToken)||void 0===d?void 0:d.trim())||void 0}}if(e&&(null==o?void 0:o.company)&&(null==o?void 0:o.consoleProject)){const n=g(e);if(n)throw new Error(n);const t=await b(o.consoleProject);let i,a=null==t?void 0:t.edition;if(!t){if(i=await(0,l.startConsoleOnboarding)({projectDir:r.resolve(process.cwd(),e),interactive:!1,projectId:o.consoleProject}),!i)throw new Error("--console-project needs a stored Vendure Console session, or VENDURE_HUB_PROJECTS naming a file that lists it. Neither was usable, and this run has no terminal to sign in from.");a=i.edition}const s=c(a);if(!s)throw new Error(`Vendure Console reports no edition for project ${o.consoleProject}, so there is no package set to scaffold. Give the Project an edition, or scaffold with --profile instead.`);return{projectName:e,companyName:o.company,profile:s,includeStorefront:v(s,o.storefront),includeDemoData:null===(p=o.demoData)||void 0===p||p,createGithubRepo:null!==(f=o.github)&&void 0!==f&&f,githubOrg:o.githubOrg,packageManager:k,skipInstall:!1===o.install,skipGit:!1===o.git,dryRun:null!==(h=o.dryRun)&&void 0!==h&&h,registryToken:(null===(j=o.registryToken)||void 0===j?void 0:j.trim())||void 0,licenseToken:(null===(w=o.licenseToken)||void 0===w?void 0:w.trim())||void 0,consoleOnboarding:i}}if(y([...e?[]:["<project-name>"],...(null==o?void 0:o.company)?[]:["--company"],...D?[]:["--profile"]]),t.intro("create-vendure-platform"),e){const o=g(e);o&&(t.cancel(o),process.exit(1))}const E=null!=e?e:await P();let N,T=D;if(!D&&!(null==o?void 0:o.dryRun)){const e=await b(null==o?void 0:o.consoleProject);e?(T=e.edition,t.log.info(`${e.name} is on the ${e.edition} edition.`)):(N=await(0,l.startConsoleOnboarding)({projectDir:r.resolve(process.cwd(),E),interactive:!0,projectId:null==o?void 0:o.consoleProject}),T=null==N?void 0:N.edition)}T&&v(T,null==o?void 0:o.storefront);const _=await t.group({companyName:()=>{if(null==o?void 0:o.company)return Promise.resolve(o.company);const e=r.basename(r.resolve(process.cwd(),E)).replace(/^vendure-/,"").replace(/-demo$/,"").replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase());return t.text({message:"Company name (used in README and project branding):",defaultValue:e,placeholder:e})},edition:()=>T?Promise.resolve(T):t.select({message:"Which Vendure Platform edition is this project on?",options:i.EDITION_ORDER.map(e=>({label:e,value:e}))}),includeStorefront:({results:e})=>{const n=v(e.edition,null==o?void 0:o.storefront);return void 0===(null==o?void 0:o.storefront)&&n?t.confirm({message:"Include the Next.js storefront?",initialValue:!0}):Promise.resolve(n)},includeDemoData:()=>void 0!==(null==o?void 0:o.demoData)?Promise.resolve(o.demoData):t.confirm({message:"Include demo data?",initialValue:!0}),installDeps:()=>void 0!==(null==o?void 0:o.install)?Promise.resolve(o.install):t.confirm({message:`Install dependencies with ${k}?`,initialValue:!0})},{onCancel:()=>{t.cancel("Setup cancelled."),process.exit(0)}}),C=_.edition;return{projectName:E,companyName:_.companyName,profile:C,includeStorefront:_.includeStorefront,includeDemoData:_.includeDemoData,createGithubRepo:!1,githubOrg:void 0,packageManager:k,skipInstall:!_.installDeps,skipGit:!1===(null==o?void 0:o.git),dryRun:null!==(I=null==o?void 0:o.dryRun)&&void 0!==I&&I,registryToken:(null===(R=null==o?void 0:o.registryToken)||void 0===R?void 0:R.trim())||void 0,licenseToken:(null===(O=null==o?void 0:o.licenseToken)||void 0===O?void 0:O.trim())||void 0,consoleOnboarding:N}}async function P(){const e=await t.text({message:"Project name:",validate:g});return t.isCancel(e)&&(t.cancel("Setup cancelled."),process.exit(0)),e}
@@ -6,3 +6,13 @@
6
6
  * the commit to the caller.
7
7
  */
8
8
  export declare function assertProjectDirAvailable(projectDir: string): Promise<void>;
9
+ /**
10
+ * The name the scaffold gives the project: the package name, the Docker image name and the name it
11
+ * reports. It comes from the directory, so `create .` in a clone named "Oliver's Olives" names the
12
+ * project `olivers-olives`, not `.`.
13
+ *
14
+ * npm refuses a package name that starts with a dot or an underscore, or that holds spaces or
15
+ * other characters a URL must escape. Docker refuses capital letters in an image name, and a name
16
+ * that starts or ends with a separator.
17
+ */
18
+ export declare function projectNameFor(projectDir: string): string;
@@ -1 +1 @@
1
- "use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),t=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(){var r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},r(e)};return function(i){if(i&&i.__esModule)return i;var n={};if(null!=i)for(var o=r(i),a=0;a<o.length;a++)"default"!==o[a]&&e(n,i,o[a]);return t(n,i),n}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.assertProjectDirAvailable=o;const i=r(require("@clack/prompts")),n=r(require("fs-extra"));async function o(e){await n.pathExists(e)&&(await n.readdir(e)).filter(e=>".git"!==e).length>0&&(i.log.error(`Directory "${e}" already exists and is not empty. A directory that holds only a .git directory, such as a fresh clone of an empty repository, is accepted.`),process.exit(1))}
1
+ "use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(){var r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},r(e)};return function(n){if(n&&n.__esModule)return n;var a={};if(null!=n)for(var o=r(n),i=0;i<o.length;i++)"default"!==o[i]&&e(a,n,o[i]);return t(a,n),a}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.assertProjectDirAvailable=i,exports.projectNameFor=c;const n=r(require("@clack/prompts")),a=r(require("fs-extra")),o=r(require("path"));async function i(e){await a.pathExists(e)&&(await a.readdir(e)).filter(e=>".git"!==e).length>0&&(n.log.error(`Directory "${e}" already exists and is not empty. A directory that holds only a .git directory, such as a fresh clone of an empty repository, is accepted.`),process.exit(1))}function c(e){return o.basename(e).toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9._-]/g,"").replace(/^[._-]+|[._-]+$/g,"")||"vendure-project"}
@@ -1 +1 @@
1
- "use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(){var r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},r(e)};return function(n){if(n&&n.__esModule)return n;var o={};if(null!=n)for(var i=r(n),a=0;a<i.length;a++)"default"!==i[a]&&e(o,n,i[a]);return t(o,n),o}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.scaffoldStorefrontOnly=u;const n=r(require("@clack/prompts")),o=r(require("fs-extra")),i=r(require("path")),a=require("./next-steps"),s=require("./project-dir"),c=require("./scaffold-shared"),l=require("./storefront-copier");async function u(e){const{projectName:t,apiUrl:r,scenario:u,capabilities:d,packageManager:p,skipInstall:f,skipGit:y,dryRun:_}=e,v=i.resolve(process.cwd(),t);if(await(0,s.assertProjectDirAvailable)(v),_){const e=[`Project: ${t} \u2192 ${v}`,"","Mode: storefront-only",`Scenario: ${u}`,`API URL: ${null!=r?r:"(use default localhost)"}`,`Capabilities: ${void 0===d?"not set. The storefront does not build until NEXT_PUBLIC_VENDURE_CAPABILITIES is set.":d.join(",")||"(none)"}`,`Package manager: ${p}`,"Install deps: "+(f?"no":"yes"),"Git init: "+(y?"no":"yes")].join("\n");return n.note(e,"Dry run"),void n.outro("Dry run complete \u2014 no files written.")}const b=n.spinner();b.start("Creating project directory..."),await o.ensureDir(v),b.message("Copying storefront..."),await(0,l.copyStorefront)(v,{mode:"storefront-only",scenario:u,apiUrl:r,capabilities:d,packageName:t,packageManager:p});const P=!!f||await(0,c.installDependencies)(v,p,b);y||await(0,c.initRepository)(v,!1,void 0,b),b.stop(P?`Project "${t}" created successfully!`:`Project "${t}" created, but dependency installation failed.`);const g=[`cd ${t}`,...P?[]:[`${p} install`],r?`# .env.local already points VENDURE_SHOP_API_URL at ${r}`:"# Edit .env.local and set VENDURE_SHOP_API_URL to your Vendure server",...void 0===d?["# Edit .env.local and set NEXT_PUBLIC_VENDURE_CAPABILITIES to your server's capability keys.","# The storefront does not build until it is set."]:[],"npm"===p?"npm run dev":`${p} run dev`];(0,a.printNextSteps)(g,["Storefront: http://localhost:${STOREFRONT_PORT:-3001}"]),n.outro(P?"Happy building!":"Install dependencies to continue.")}
1
+ "use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(){var r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},r(e)};return function(n){if(n&&n.__esModule)return n;var o={};if(null!=n)for(var i=r(n),a=0;a<i.length;a++)"default"!==i[a]&&e(o,n,i[a]);return t(o,n),o}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.scaffoldStorefrontOnly=u;const n=r(require("@clack/prompts")),o=r(require("fs-extra")),i=r(require("path")),a=require("./next-steps"),s=require("./project-dir"),c=require("./scaffold-shared"),l=require("./storefront-copier");async function u(e){const{projectName:t,apiUrl:r,scenario:u,capabilities:p,packageManager:d,skipInstall:f,skipGit:y,dryRun:v}=e,_=i.resolve(process.cwd(),t),b=(0,s.projectNameFor)(_),P=i.relative(process.cwd(),_);if(await(0,s.assertProjectDirAvailable)(_),v){const e=[`Project: ${b} \u2192 ${_}`,"","Mode: storefront-only",`Scenario: ${u}`,`API URL: ${null!=r?r:"(use default localhost)"}`,`Capabilities: ${void 0===p?"not set. The storefront does not build until NEXT_PUBLIC_VENDURE_CAPABILITIES is set.":p.join(",")||"(none)"}`,`Package manager: ${d}`,"Install deps: "+(f?"no":"yes"),"Git init: "+(y?"no":"yes")].join("\n");return n.note(e,"Dry run"),void n.outro("Dry run complete \u2014 no files written.")}const g=n.spinner();g.start("Creating project directory..."),await o.ensureDir(_),g.message("Copying storefront..."),await(0,l.copyStorefront)(_,{mode:"storefront-only",scenario:u,apiUrl:r,capabilities:p,packageName:b,packageManager:d});const j=!!f||await(0,c.installDependencies)(_,d,g);y||await(0,c.initRepository)(_,!1,void 0,g),g.stop(j?`Project "${b}" created successfully!`:`Project "${b}" created, but dependency installation failed.`);const O=[...P?[`cd ${P}`]:[],...j?[]:[`${d} install`],r?`# .env.local already points VENDURE_SHOP_API_URL at ${r}`:"# Edit .env.local and set VENDURE_SHOP_API_URL to your Vendure server",...void 0===p?["# Edit .env.local and set NEXT_PUBLIC_VENDURE_CAPABILITIES to your server's capability keys.","# The storefront does not build until it is set."]:[],"npm"===d?"npm run dev":`${d} run dev`];(0,a.printNextSteps)(O,["Storefront: http://localhost:${STOREFRONT_PORT:-3001}"]),n.outro(j?"Happy building!":"Install dependencies to continue.")}
@@ -1 +1 @@
1
- "use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),t=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(){var r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},r(e)};return function(o){if(o&&o.__esModule)return o;var n={};if(null!=o)for(var s=r(o),i=0;i<s.length;i++)"default"!==s[i]&&e(n,o,s[i]);return t(n,o),n}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.SHARED_FILES=exports.TEMPLATE_FILES=void 0,exports.scaffold=h,exports.consoleLinkRoot=y;const o=r(require("@clack/prompts")),n=require("@vendure-platform/console-auth"),s=require("@vendure-platform/plugin-meta"),i=r(require("fs-extra")),a=r(require("path")),p=require("./console-onboarding"),c=require("./env-file"),l=require("./next-steps"),u=require("./plugin-registry"),d=require("./pnpm-build-approvals"),m=require("./project-dir"),g=require("./scaffold-shared"),f=require("./storefront-copier"),v=require("./template-renderer"),j=require("./types");async function h(e){var t;const{projectName:r,companyName:h,profile:b,includeStorefront:k,includeDemoData:S=!0,createGithubRepo:_,githubOrg:A,packageManager:T=j.DEFAULT_PACKAGE_MANAGER,skipInstall:$,skipGit:D,dryRun:P,registryToken:x,licenseToken:I,consoleOnboarding:L}=e,O=a.resolve(process.cwd(),r),R=(0,u.resolveProfilePluginKeys)(b);o.log.info(`Edition: ${b}`);const F=u.ALWAYS_ACTIVE_KEYS.map(e=>(0,u.getPlugin)(e).displayName);F.length>0&&o.log.info(`Always-on core plugins: ${F.join(", ")}`);const M=[...s.CAPABILITY_PROFILES[b]],q=(0,u.grantsIncludeStorefront)(M),N=k&&q;if(k&&!q&&o.log.warn(`The ${b} profile does not grant "${u.STOREFRONT_CAPABILITY}", so no storefront was emitted. The storefront ships with Scale and Enterprise.`),await(0,m.assertProjectDirAvailable)(O),P){const e=R.map(e=>(0,u.getPlugin)(e).displayName),t=[`Project: ${r} \u2192 ${O}`,`Edition: ${b}`,"","Files to generate:",[...[...exports.TEMPLATE_FILES.map(e=>e.output),...exports.SHARED_FILES].map(e=>` ${e}`),..."pnpm"===T?[" pnpm-workspace.yaml"]:[]].join("\n"),(S?[" server/src/demo-data/products.csv"," server/src/demo-data/initial-data.json"," server/src/demo-data/images/"]:[" server/src/initial-data/products.csv"," server/src/initial-data/initial-data.json"]).join("\n")," server/src/migrations/ (empty dir)","",`Plugins (${e.length}):`,` ${e.join(", ")}`,"","Demo data: "+(S?"yes":"no"),"Storefront: "+(N?"yes":q?"no":`no (needs ${u.STOREFRONT_CAPABILITY})`),`Install deps with ${T}: ${$?"no":"yes"}`,"Git init: "+(D?"no":"yes"),"GitHub repo: "+(_?"yes":"no")].join("\n");return o.note(t,"Dry run"),void o.outro("Dry run complete \u2014 no files written.")}const C="pnpm"===T||"npm"===T?(0,d.getBuildApprovals)(await i.readJson(a.join(__dirname,"..","dist","assets","build-dependencies.json")),b,S,N):[],G=o.spinner();G.start("Creating project directory..."),await i.ensureDir(O),G.stop("Created the project directory.");const B=await(0,p.finishConsoleOnboarding)(L,y(O),x),{context:H,hbs:J}=(0,v.buildTemplateContext)(r,h,N,{licenseToken:I,profile:b,includeDemoData:S,packageManager:T,buildApprovals:C});G.start("Generating server files...");const U=a.join(O,"server"),Y=a.join(U,"src");await i.ensureDir(Y);for(const{template:e,output:t}of exports.TEMPLATE_FILES){const r=(0,v.getTemplatePath)(e),o=(0,v.renderTemplate)(r,H,J),n=a.join(O,t);await i.ensureDir(a.dirname(n)),".env"===t?await(0,c.writeEnvFile)(n,o):await i.writeFile(n,o)}await i.writeFile(a.join(Y,"platform-edition.ts"),(0,s.renderEditionConfig)(b));const K=(0,p.resolveRegistryToken)(x,B);if(await(0,n.ensureRegistryNpmrc)(O,{registryUrl:B.registryUrl,scope:B.scope,token:K.token,projectId:K.projectId,hoist:"npm"!==T}),"pnpm"===T){const e=["server",...N?["storefront"]:[]];await i.writeFile(a.join(O,"pnpm-workspace.yaml"),`packages:\n${e.map(e=>` - ${e}`).join("\n")}\nallowBuilds:\n${C.map(e=>` ${JSON.stringify(e)}: true`).join("\n")}\npublicHoistPattern:\n - "@vendure-platform/*"\nminimumReleaseAgeExclude:\n - "@vendure-platform/*"\n - "@vendure/*"\noverrides:\n "@vendure/mcp-sdk": ${JSON.stringify(H.mcpSdkVersion)}\n`)}if(S?(G.message("Copying demo data..."),await w(Y)):await E(Y),await i.ensureDir(a.join(Y,"migrations")),N){G.message("Copying storefront...");try{await(0,f.copyStorefront)(O,{mode:"full-project",scenario:"customer",packageName:`${r}-storefront`,capabilities:M,registryUrl:B.registryUrl,registryToken:K.token,registryProjectId:K.projectId,packageManager:T})}catch(e){G.stop("Storefront copy failed.");const t=e instanceof Error?e.message:String(e);o.log.warn(`Storefront copy failed \u2014 you can set it up manually later. (${t})`),G.start("Continuing...")}}const V=!!$||await(0,g.installDependencies)(O,T,G,{...B,accessDenied:B.registryAccessDenied&&!K.token});D||await(0,g.initRepository)(O,_,A,G),G.stop(V?`Project "${r}" created successfully!`:`Project "${r}" created, but dependency installation failed.`);const Z="npm"===T?"npm run":`${T} run`,W=[`cd ${r}`,null!==(t=B.registryLogin)&&void 0!==t?t:"",!V||$?`${T} install`:"",await i.pathExists(a.join(y(O),".vendure","project.json"))?"":"cd server && npx vendure console link && cd ..","docker compose up -d",`${Z} populate`,"cd server && npx vendure dev",N?`# In a second terminal: cd storefront && ${Z} dev`:""].filter(Boolean),z=["Dashboard: http://localhost:3500/dashboard",N?"Storefront: http://localhost:3001":""].filter(Boolean);(0,l.printNextSteps)(W,z),o.outro(V?"Happy building!":"Install dependencies to continue.")}function y(e){return a.join(e,"server")}function b(){const e=[a.join(__dirname,"..","..","scenario-default","assets"),a.join(__dirname,"assets","demo-data")];for(const t of e)if(i.pathExistsSync(t))return t;throw new Error("Could not find scenario-default assets. Tried:\n"+e.map(e=>` - ${e}`).join("\n"))}async function w(e){const t=b(),r=a.join(e,"demo-data");await i.ensureDir(r),await i.copy(a.join(t,"initial-data.json"),a.join(r,"initial-data.json")),await i.copy(a.join(t,"products.csv"),a.join(r,"products.csv")),await i.copy(a.join(t,"images"),a.join(r,"images"))}async function E(e){const t=b(),r=await i.readJson(a.join(t,"initial-data.json")),o=a.join(e,"initial-data");await i.ensureDir(o),await i.writeJson(a.join(o,"initial-data.json"),{defaultLanguage:r.defaultLanguage,defaultZone:r.defaultZone,countries:r.countries,taxRates:r.taxRates,shippingMethods:r.shippingMethods,paymentMethods:r.paymentMethods,collections:[]},{spaces:4});const[n]=(await i.readFile(a.join(t,"products.csv"),"utf8")).split("\n");await i.writeFile(a.join(o,"products.csv"),`${n}\n`)}exports.TEMPLATE_FILES=[{template:"vendure-config.ts.hbs",output:"server/src/vendure-config.ts"},{template:"populate.ts.hbs",output:"server/src/populate.ts"},{template:"migrate.ts.hbs",output:"server/src/migrate.ts"},{template:"custom-populate.ts.hbs",output:"server/src/custom-populate.ts"},{template:"load-env.ts.hbs",output:"server/src/load-env.ts"},{template:"index.ts.hbs",output:"server/src/index.ts"},{template:"index-worker.ts.hbs",output:"server/src/index-worker.ts"},{template:"server-package.json.hbs",output:"server/package.json"},{template:"root-package.json.hbs",output:"package.json"},{template:"env.hbs",output:".env"},{template:"docker-compose.yml.hbs",output:"docker-compose.yml"},{template:"AGENTS.md.hbs",output:"AGENTS.md"},{template:"README.md.hbs",output:"README.md"},{template:"tsconfig.root.json.hbs",output:"tsconfig.json"},{template:"tsconfig.server.json.hbs",output:"server/tsconfig.json"},{template:"vite.config.mts.hbs",output:"server/vite.config.mts"},{template:"tsconfig.dashboard.json.hbs",output:"server/tsconfig.dashboard.json"},{template:"environment.d.ts.hbs",output:"server/src/environment.d.ts"},{template:"gitignore.hbs",output:".gitignore"},{template:"dockerignore.hbs",output:".dockerignore"},{template:"Dockerfile.hbs",output:"Dockerfile"},{template:"bunfig.toml.hbs",output:"bunfig.toml"}],exports.SHARED_FILES=["server/src/platform-edition.ts",".npmrc"];
1
+ "use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),t=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(){var r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},r(e)};return function(o){if(o&&o.__esModule)return o;var n={};if(null!=o)for(var s=r(o),i=0;i<s.length;i++)"default"!==s[i]&&e(n,o,s[i]);return t(n,o),n}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.SHARED_FILES=exports.TEMPLATE_FILES=void 0,exports.scaffold=h,exports.consoleLinkRoot=y;const o=r(require("@clack/prompts")),n=require("@vendure-platform/console-auth"),s=require("@vendure-platform/plugin-meta"),i=r(require("fs-extra")),a=r(require("path")),p=require("./console-onboarding"),c=require("./env-file"),l=require("./next-steps"),u=require("./plugin-registry"),d=require("./pnpm-build-approvals"),m=require("./project-dir"),g=require("./scaffold-shared"),f=require("./storefront-copier"),v=require("./template-renderer"),j=require("./types");async function h(e){var t;const{projectName:r,companyName:h,profile:b,includeStorefront:k,includeDemoData:S=!0,createGithubRepo:_,githubOrg:A,packageManager:T=j.DEFAULT_PACKAGE_MANAGER,skipInstall:$,skipGit:D,dryRun:P,registryToken:x,licenseToken:I,consoleOnboarding:L}=e,O=a.resolve(process.cwd(),r),R=(0,m.projectNameFor)(O),F=a.relative(process.cwd(),O),M=(0,u.resolveProfilePluginKeys)(b);o.log.info(`Edition: ${b}`);const N=u.ALWAYS_ACTIVE_KEYS.map(e=>(0,u.getPlugin)(e).displayName);N.length>0&&o.log.info(`Always-on core plugins: ${N.join(", ")}`);const q=[...s.CAPABILITY_PROFILES[b]],C=(0,u.grantsIncludeStorefront)(q),G=k&&C;if(k&&!C&&o.log.warn(`The ${b} profile does not grant "${u.STOREFRONT_CAPABILITY}", so no storefront was emitted. The storefront ships with Scale and Enterprise.`),await(0,m.assertProjectDirAvailable)(O),P){const e=M.map(e=>(0,u.getPlugin)(e).displayName),t=[`Project: ${R} \u2192 ${O}`,`Edition: ${b}`,"","Files to generate:",[...[...exports.TEMPLATE_FILES.map(e=>e.output),...exports.SHARED_FILES].map(e=>` ${e}`),..."pnpm"===T?[" pnpm-workspace.yaml"]:[]].join("\n"),(S?[" server/src/demo-data/products.csv"," server/src/demo-data/initial-data.json"," server/src/demo-data/images/"]:[" server/src/initial-data/products.csv"," server/src/initial-data/initial-data.json"]).join("\n")," server/src/migrations/ (empty dir)","",`Plugins (${e.length}):`,` ${e.join(", ")}`,"","Demo data: "+(S?"yes":"no"),"Storefront: "+(G?"yes":C?"no":`no (needs ${u.STOREFRONT_CAPABILITY})`),`Install deps with ${T}: ${$?"no":"yes"}`,"Git init: "+(D?"no":"yes"),"GitHub repo: "+(_?"yes":"no")].join("\n");return o.note(t,"Dry run"),void o.outro("Dry run complete \u2014 no files written.")}const B="pnpm"===T||"npm"===T?(0,d.getBuildApprovals)(await i.readJson(a.join(__dirname,"..","dist","assets","build-dependencies.json")),b,S,G):[],H=o.spinner();H.start("Creating project directory..."),await i.ensureDir(O),H.stop("Created the project directory.");const J=await(0,p.finishConsoleOnboarding)(L,y(O),x),{context:U,hbs:Y}=(0,v.buildTemplateContext)(R,h,G,{licenseToken:I,profile:b,includeDemoData:S,packageManager:T,buildApprovals:B});H.start("Generating server files...");const K=a.join(O,"server"),V=a.join(K,"src");await i.ensureDir(V);for(const{template:e,output:t}of exports.TEMPLATE_FILES){const r=(0,v.getTemplatePath)(e),o=(0,v.renderTemplate)(r,U,Y),n=a.join(O,t);await i.ensureDir(a.dirname(n)),".env"===t?await(0,c.writeEnvFile)(n,o):await i.writeFile(n,o)}await i.writeFile(a.join(V,"platform-edition.ts"),(0,s.renderEditionConfig)(b));const Z=(0,p.resolveRegistryToken)(x,J);if(await(0,n.ensureRegistryNpmrc)(O,{registryUrl:J.registryUrl,scope:J.scope,token:Z.token,projectId:Z.projectId,hoist:"npm"!==T}),"pnpm"===T){const e=["server",...G?["storefront"]:[]];await i.writeFile(a.join(O,"pnpm-workspace.yaml"),`packages:\n${e.map(e=>` - ${e}`).join("\n")}\nallowBuilds:\n${B.map(e=>` ${JSON.stringify(e)}: true`).join("\n")}\npublicHoistPattern:\n - "@vendure-platform/*"\nminimumReleaseAgeExclude:\n - "@vendure-platform/*"\n - "@vendure/*"\noverrides:\n "@vendure/mcp-sdk": ${JSON.stringify(U.mcpSdkVersion)}\n`)}if(S?(H.message("Copying demo data..."),await w(V)):await E(V),await i.ensureDir(a.join(V,"migrations")),G){H.message("Copying storefront...");try{await(0,f.copyStorefront)(O,{mode:"full-project",scenario:"customer",packageName:`${R}-storefront`,capabilities:q,registryUrl:J.registryUrl,registryToken:Z.token,registryProjectId:Z.projectId,packageManager:T})}catch(e){H.stop("Storefront copy failed.");const t=e instanceof Error?e.message:String(e);o.log.warn(`Storefront copy failed \u2014 you can set it up manually later. (${t})`),H.start("Continuing...")}}const W=!!$||await(0,g.installDependencies)(O,T,H,{...J,accessDenied:J.registryAccessDenied&&!Z.token});D||await(0,g.initRepository)(O,_,A,H),H.stop(W?`Project "${R}" created successfully!`:`Project "${R}" created, but dependency installation failed.`);const z="npm"===T?"npm run":`${T} run`,Q=[F?`cd ${F}`:"",null!==(t=J.registryLogin)&&void 0!==t?t:"",!W||$?`${T} install`:"",await i.pathExists(a.join(y(O),".vendure","project.json"))?"":"cd server && npx vendure console link && cd ..","docker compose up -d",`${z} populate`,"cd server && npx vendure dev",G?`# In a second terminal: cd storefront && ${z} dev`:""].filter(Boolean),X=["Dashboard: http://localhost:3500/dashboard",G?"Storefront: http://localhost:3001":""].filter(Boolean);(0,l.printNextSteps)(Q,X),o.outro(W?"Happy building!":"Install dependencies to continue.")}function y(e){return a.join(e,"server")}function b(){const e=[a.join(__dirname,"..","..","scenario-default","assets"),a.join(__dirname,"assets","demo-data")];for(const t of e)if(i.pathExistsSync(t))return t;throw new Error("Could not find scenario-default assets. Tried:\n"+e.map(e=>` - ${e}`).join("\n"))}async function w(e){const t=b(),r=a.join(e,"demo-data");await i.ensureDir(r),await i.copy(a.join(t,"initial-data.json"),a.join(r,"initial-data.json")),await i.copy(a.join(t,"products.csv"),a.join(r,"products.csv")),await i.copy(a.join(t,"images"),a.join(r,"images"))}async function E(e){const t=b(),r=await i.readJson(a.join(t,"initial-data.json")),o=a.join(e,"initial-data");await i.ensureDir(o),await i.writeJson(a.join(o,"initial-data.json"),{defaultLanguage:r.defaultLanguage,defaultZone:r.defaultZone,countries:r.countries,taxRates:r.taxRates,shippingMethods:r.shippingMethods,paymentMethods:r.paymentMethods,collections:[]},{spaces:4});const[n]=(await i.readFile(a.join(t,"products.csv"),"utf8")).split("\n");await i.writeFile(a.join(o,"products.csv"),`${n}\n`)}exports.TEMPLATE_FILES=[{template:"vendure-config.ts.hbs",output:"server/src/vendure-config.ts"},{template:"populate.ts.hbs",output:"server/src/populate.ts"},{template:"migrate.ts.hbs",output:"server/src/migrate.ts"},{template:"custom-populate.ts.hbs",output:"server/src/custom-populate.ts"},{template:"load-env.ts.hbs",output:"server/src/load-env.ts"},{template:"index.ts.hbs",output:"server/src/index.ts"},{template:"index-worker.ts.hbs",output:"server/src/index-worker.ts"},{template:"server-package.json.hbs",output:"server/package.json"},{template:"root-package.json.hbs",output:"package.json"},{template:"env.hbs",output:".env"},{template:"docker-compose.yml.hbs",output:"docker-compose.yml"},{template:"AGENTS.md.hbs",output:"AGENTS.md"},{template:"README.md.hbs",output:"README.md"},{template:"tsconfig.root.json.hbs",output:"tsconfig.json"},{template:"tsconfig.server.json.hbs",output:"server/tsconfig.json"},{template:"vite.config.mts.hbs",output:"server/vite.config.mts"},{template:"tsconfig.dashboard.json.hbs",output:"server/tsconfig.dashboard.json"},{template:"environment.d.ts.hbs",output:"server/src/environment.d.ts"},{template:"gitignore.hbs",output:".gitignore"},{template:"dockerignore.hbs",output:".dockerignore"},{template:"Dockerfile.hbs",output:"Dockerfile"},{template:"bunfig.toml.hbs",output:"bunfig.toml"}],exports.SHARED_FILES=["server/src/platform-edition.ts",".npmrc"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vendure-platform/create",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "CLI tool to scaffold a Vendure demo project with Vendure Platform plugins",
5
5
  "vendurePlugin": {
6
6
  "slug": "create",
@@ -50,8 +50,8 @@
50
50
  "dependencies": {
51
51
  "@clack/prompts": "^0.10.0",
52
52
  "@vendure/cli": "~3.8.0",
53
- "@vendure-platform/console-auth": "1.0.2",
54
- "@vendure-platform/plugin-meta": "1.0.2",
53
+ "@vendure-platform/console-auth": "1.0.3",
54
+ "@vendure-platform/plugin-meta": "1.0.3",
55
55
  "commander": "^13.1.0",
56
56
  "fs-extra": "^11.3.0",
57
57
  "handlebars": "^4.7.8",