sharetribe-community-cli 1.17.2 → 1.17.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/dist/index.js +14 -15
- package/dist/index.js.map +4 -4
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import{Command as
|
|
4
|
-
`).join(`${
|
|
3
|
+
import{Command as Ur}from"commander";import{readFileSync as Vr}from"node:fs";import{fileURLToPath as Hr}from"node:url";import{dirname as Jr,join as Wr}from"node:path";import{readFileSync as Qe}from"node:fs";import{fileURLToPath as Ye}from"node:url";import{dirname as ne,join as ze}from"node:path";function Ze(){let t=Ye(import.meta.url),r=ne(t);for(;r!=="/";)try{let e=ze(r,"package.json");return Qe(e,"utf-8")}catch{r=ne(r)}throw new Error("Could not find package.json")}function ie(){let t=JSON.parse(Ze());console.log(t.version)}import ot from"inquirer";import{Writable as nt}from"node:stream";import{writeAuth as it,getCurrentAdmin as at}from"sharetribe-flex-build-sdk";import I from"chalk";import K from"jsedn";import T from"chalk";function F(t){return Object.keys(t[0]??{})}function C(t,r){let e={};for(let o of t)e[o]=o.length+1;for(let o of r)for(let n of t){let i=o[n]||"";e[n]=Math.max(e[n]||0,i.length)}console.log("");let s=t.map((o,n)=>{let i=e[o]||0,a=T.bold.black(o)+" ".repeat(Math.max(0,i+1-o.length));return n===t.length-1?a:a+" "});console.log(s.join(""));for(let o of r){let i=t.map((a,p)=>{let l=o[a]||"",d=e[a]||0,u=l.padEnd(d+1);return p===t.length-1?u:u+" "}).join("");console.log(i)}return console.log(""),e}function ae(t,r,e){for(let s of e){let o=t.map((n,i)=>{let a=s[n]||"",p=r[n]||0,l=a.padEnd(p+1);return i===t.length-1?l:l+" "});console.log(o.join(""))}}function c(t){console.error(T.red(`Error: ${t}`))}var Xe="\u203A";function R(t){return` ${T.bold.red(Xe)}${t}`}function $(t){let r=t.map(e=>`${R(` ${e}`)}
|
|
4
|
+
`).join(`${R(" ")}
|
|
5
5
|
`);process.stderr.write(`${r}
|
|
6
6
|
|
|
7
|
-
`)}function
|
|
8
|
-
`))}function pt(t){return t.slice(t.indexOf("/")+1)}import{readFileSync as mt}from"node:fs";async function K(t,r,e){try{I(e);let s=mt(v(e),"utf-8"),o=b(e);x(e,o);let n=await dt(void 0,t,r,s,o);y(`Process ${n.name} successfully created.`)}catch(s){s&&typeof s=="object"&&"message"in s?l(s.message):l("Failed to create process"),process.exitCode=1;return}}import{pushProcess as ut}from"sharetribe-flex-build-sdk";import{readFileSync as ft}from"node:fs";async function U(t,r,e){try{I(e);let s=ft(v(e),"utf-8"),o=b(e);x(e,o);let n=await ut(void 0,t,r,s,o);n.noChanges?console.log("No changes"):y(`Version ${n.version} successfully saved for process ${r}`)}catch(s){s&&typeof s=="object"&&"message"in s?l(s.message):l("Failed to push process"),process.exitCode=1;return}}import{getProcess as ht}from"sharetribe-flex-build-sdk";import{writeFileSync as V,mkdirSync as J}from"node:fs";import{join as D}from"node:path";async function H(t,r,e,s,o){try{let n=await ht(void 0,t,r,{version:s,alias:o});if(!n.definition)throw new Error("No process definition in response");let{existsSync:i}=await import("node:fs"),a=i(e);J(e,{recursive:!0}),a||console.error(`Creating a new directory: ${e}`);let p=D(e,"process.edn");V(p,n.definition,"utf-8");let c=n.emailTemplates||[];if(c&&Array.isArray(c)&&c.length>0){let d=D(e,"templates");J(d,{recursive:!0});for(let u of c){let h=u.name,P=u.html,S=u.subject;if(h){let m=D(d,h);if(J(m,{recursive:!0}),P){let g=D(m,`${h}-html.html`);V(g,P,"utf-8")}if(S){let g=D(m,`${h}-subject.txt`);V(g,S,"utf-8")}}}}console.error(`Saved process to ${e}`)}catch(n){n&&typeof n=="object"&&"message"in n?l(n.message):l("Failed to pull process"),process.exitCode=1;return}}import{createAlias as gt,updateAlias as yt,deleteAlias as Et}from"sharetribe-flex-build-sdk";async function B(t,r,e,s){try{let o=await gt(void 0,t,r,e,s);y(`Alias ${o.alias} successfully created to point to version ${o.version}.`)}catch(o){o&&typeof o=="object"&&"message"in o?l(o.message):l("Failed to create alias"),process.exitCode=1;return}}async function W(t,r,e,s){try{let o=await yt(void 0,t,r,e,s);y(`Alias ${o.alias} successfully updated to point to version ${o.version}.`)}catch(o){o&&typeof o=="object"&&"message"in o?l(o.message):l("Failed to update alias"),process.exitCode=1;return}}async function G(t,r,e){try{let s=await Et(void 0,t,r,e);y(`Alias ${s.alias} successfully deleted.`)}catch(s){s&&typeof s=="object"&&"message"in s?l(s.message):l("Failed to delete alias"),process.exitCode=1;return}}import{createAlias as de,createProcess as St,listProcessVersions as At,pushProcess as wt,updateAlias as Ct}from"sharetribe-flex-build-sdk";import{readFileSync as vt}from"node:fs";async function kt(t,r){try{return await At(void 0,t,r)}catch(e){if(e&&typeof e=="object"&&e.code==="tx-process-not-found")return null;throw e}}async function Q(t,r,e,s){try{I(e);let o=vt(v(e),"utf-8"),n=b(e);x(e,n);let i=await kt(t,r);if(i===null){let d=await St(void 0,t,r,o,n);y(`Process ${d.name} successfully created.`);let u=await de(void 0,t,r,d.version,s);y(`Alias ${u.alias} successfully created to point to version ${u.version}.`);return}let a=i.some(d=>d.aliases?.includes(s)),p=await wt(void 0,t,r,o,n),c;if(p.noChanges)console.log("No changes"),c=Math.max(...i.map(d=>d.version));else{if(p.version===void 0)throw new Error(`The API saved a version of ${r} but did not say which`);c=p.version,y(`Version ${c} successfully saved for process ${r}`)}if(a){let d=await Ct(void 0,t,r,c,s);y(`Alias ${d.alias} successfully updated to point to version ${d.version}.`)}else{let d=await de(void 0,t,r,c,s);y(`Alias ${d.alias} successfully created to point to version ${d.version}.`)}}catch(o){o&&typeof o=="object"&&"message"in o?l(o.message):l("Failed to create/push process and alias"),process.exitCode=1;return}}function me(t){let r=t.command("process").description("describe a process file").option("--path <PROCESS_DIR>","path to the directory where the process.edn file is").option("--transition <TRANSITION_NAME>","transition name, e.g. transition/request to get more details of it").action(async e=>{e.path?(console.log(`Describing process at: ${e.path}`),e.transition&&console.log(`Transition: ${e.transition}`),console.log("Process description not yet implemented")):r.outputHelp()});r.command("list").description("list all transaction processes").option("--process <PROCESS_NAME>","print version and alias info of a specific process").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await j(s,e.process)}),r.command("create").description("create a new transaction process").requiredOption("--process <PROCESS_NAME>","name for the new process").requiredOption("--path <LOCAL_PROCESS_DIR>","path to the directory where the process.edn file is").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await K(s,e.process,e.path)}),r.command("push").description("push a process file to the remote").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--path <LOCAL_PROCESS_DIR>","path to the directory where the process.edn file is").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await U(s,e.process,e.path)}),r.command("pull").description("fetch a process file").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--path <LOCAL_PROCESS_DIR>","path where to save the process").option("--version <VERSION_NUM>","version number").option("--alias <PROCESS_ALIAS>","alias name").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await H(s,e.process,e.path,e.version,e.alias)}),r.command("create-alias").description("create a new alias").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--version <VERSION_NUM>","version number").requiredOption("--alias <ALIAS>","alias name").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").allowUnknownOption(!1).action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await B(s,e.process,parseInt(e.version),e.alias)}),r.command("update-alias").description("update an existing alias").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--version <VERSION_NUM>","version number").requiredOption("--alias <ALIAS>","alias name").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await W(s,e.process,parseInt(e.version),e.alias)}),r.command("delete-alias").description("delete an existing alias").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--alias <ALIAS>","alias name").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await G(s,e.process,e.alias)}),r.command("deploy").description("deploy a process file with alias (create/push + alias create/update)").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--path <LOCAL_PROCESS_DIR>","path to the directory with the process files").requiredOption("--alias <ALIAS>","alias name").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await Q(s,e.process,e.path,e.alias)}),t.command("process-list",{hidden:!0}).description("list all transaction processes").option("--process <PROCESS_NAME>","print version and alias info of a specific process").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await j(s,e.process)}),t.command("process-create",{hidden:!0}).description("create a new transaction process").requiredOption("--process <PROCESS_NAME>","name for the new process").requiredOption("--path <LOCAL_PROCESS_DIR>","path to the directory where the process.edn file is").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await K(s,e.process,e.path)}),t.command("process-push",{hidden:!0}).description("push a process file to the remote").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--path <LOCAL_PROCESS_DIR>","path to the directory where the process.edn file is").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await U(s,e.process,e.path)}),t.command("process-pull",{hidden:!0}).description("fetch a process file").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--path <LOCAL_PROCESS_DIR>","path where to save the process").option("--version <VERSION_NUM>","version number").option("--alias <PROCESS_ALIAS>","alias name").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await H(s,e.process,e.path,e.version,e.alias)}),t.command("process-create-alias",{hidden:!0}).description("create a new alias").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--version <VERSION_NUM>","version number").requiredOption("--alias <ALIAS>","alias name").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await B(s,e.process,parseInt(e.version),e.alias)}),t.command("process-update-alias",{hidden:!0}).description("update an existing alias").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--version <VERSION_NUM>","version number").requiredOption("--alias <ALIAS>","alias name").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await W(s,e.process,parseInt(e.version),e.alias)}),t.command("process-delete-alias",{hidden:!0}).description("delete an existing alias").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--alias <ALIAS>","alias name").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await G(s,e.process,e.alias)}),t.command("process-deploy",{hidden:!0}).description("deploy a process file with alias (create/push + alias create/update)").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--path <LOCAL_PROCESS_DIR>","path to the directory with the process files").requiredOption("--alias <ALIAS>","alias name").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await Q(s,e.process,e.path,e.alias)})}import{listSearchSchemas as Pt,setSearchSchema as It,unsetSearchSchema as bt}from"sharetribe-flex-build-sdk";var ue={metadata:"Metadata",private:"Private data",protected:"Protected data",public:"Public data"};async function xt(t,r){try{await It(void 0,t,{key:r.key,scope:r.scope,type:r.type,doc:r.doc,defaultValue:r.default,schemaFor:r.schemaFor});let e=r.schemaFor||"listing",s=ue[r.scope]||r.scope;console.log(`${s} schema, ${r.key} is successfully set for ${e}.`)}catch(e){e&&typeof e=="object"&&"message"in e?l(e.message):l("Failed to set search schema"),process.exitCode=1;return}}async function Ot(t,r){try{await bt(void 0,t,{key:r.key,scope:r.scope,schemaFor:r.schemaFor});let e=r.schemaFor||"listing",s=ue[r.scope]||r.scope;console.log(`${s} schema, ${r.key} is successfully unset for ${e}.`)}catch(e){e&&typeof e=="object"&&"message"in e?l(e.message):l("Failed to unset search schema"),process.exitCode=1;return}}function Rt(t){return t==null?"":Array.isArray(t)?t.join(", "):String(t)}async function Tt(t){try{let e=(await Pt(void 0,t)).map(o=>({"Schema for":o.schemaFor,Scope:o.scope,Key:o.key,Type:o.type,"Default value":Rt(o.defaultValue),Doc:o.doc||""})).sort((o,n)=>o["Schema for"]!==n["Schema for"]?o["Schema for"].localeCompare(n["Schema for"]):o.Scope!==n.Scope?o.Scope.localeCompare(n.Scope):o.Key.localeCompare(n.Key));C(["Schema for","Scope","Key","Type","Default value","Doc"],e)}catch(r){r&&typeof r=="object"&&"message"in r?l(r.message):l("Failed to list search schemas"),process.exitCode=1;return}}function fe(t){let r=t.command("search").description("list all search schemas").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await Tt(s)});r.command("set").description("set search schema").requiredOption("--key <KEY>","key name").requiredOption("--scope <SCOPE>","extended data scope (either metadata or public for listing schema, metadata, private, protected or public for userProfile schema, metadata or protected for transaction schema)").requiredOption("--type <TYPE>","value type (either enum, multi-enum, boolean, long or text)").option("--doc <DOC>","description of the schema").option("--default <DEFAULT>","default value for search if value is not set").option("--schema-for <SCHEMA_FOR>","Subject of the schema (either listing, userProfile or transaction, defaults to listing)").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await xt(s,{key:e.key,scope:e.scope,type:e.type,doc:e.doc,default:e.default,schemaFor:e.schemaFor})}),r.command("unset").description("unset search schema").requiredOption("--key <KEY>","key name").requiredOption("--scope <SCOPE>","extended data scope (either metadata or public for listing schema, metadata, private, protected or public for userProfile schema, metadata or protected for transaction schema)").option("--schema-for <SCHEMA_FOR>","Subject of the schema (either listing, userProfile or transaction, defaults to listing)").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await Ot(s,{key:e.key,scope:e.scope,schemaFor:e.schemaFor})})}import{pushAssets as Lt,stageAsset as Nt,getApiBaseUrl as Ft,readAuth as Se}from"sharetribe-flex-build-sdk";import M from"chalk";import Y from"jsedn";var Dt="sharetribe-community-cli";function $t(t){try{return JSON.parse(t).errors?.[0]?.title}catch{return}}function Mt(t){try{let e=Y.parse(t).at(Y.kw(":errors"))?.val?.[0];return e?e.at(Y.kw(":title")):void 0}catch{return}}function _t(t){let r;try{r=JSON.parse(t).errors?.[0]?.details?.assets}catch{return}if(!(!Array.isArray(r)||r.length===0))return r.map(e=>{let s=new Set,o=[];for(let n of e.errors??[]){let i=JSON.stringify(n);s.has(i)||(s.add(i),o.push(n.message??""))}return{path:e.path??"",messages:o}})}function qt(t){return t.flatMap(({path:r,messages:e})=>[O(` In ${M.bold(r)}:`),...e.map(s=>O(` ${s}`))]).map(r=>`
|
|
9
|
-
${r}`).join("")}function z(t,r){return{status:r,title:$t(t)??Mt(t),originalText:t||void 0,assetErrors:_t(t)}}function Z(t,r,e){let{status:s,title:o,originalText:n,assetErrors:i}=t;if(s===500){$(["API call failed. Reason: Internal server error."]);return}if(s===401){$(["Error: Access denied",`Failed to access marketplace ${M.bold(r)} with API key ending with ...${M.bold(e.slice(-4))}`,`Use ${M.bold(`${Dt} login`)} to relogin if needed.`]);return}let a=`API call failed. Status: ${s}, reason: ${o||n||"Unspecified"}`;$([i?.length?`${a}${qt(i)}`:a])}import{readFileSync as Ae,writeFileSync as jt,existsSync as k,mkdirSync as X,readdirSync as we,statSync as q,unlinkSync as he,createWriteStream as Ce}from"node:fs";import{join as A,dirname as Kt}from"node:path";import{createHash as Ut}from"node:crypto";import*as Vt from"node:http";import*as Jt from"node:https";import{tmpdir as Ht}from"node:os";import{pipeline as ve}from"node:stream/promises";import ge from"chalk";import E from"jsedn";import Bt from"yauzl";var Wt="meta/asset-meta.edn",ye="assets/",Gt="\x1B[K",Qt="\r";function ke(t){try{let r=E.parse(t),e=r.at(E.kw(":version"))||r.at(E.kw(":aliased-version")),s=r.at(E.kw(":assets")),o=[];if(s&&s.val)for(let n of s.val)o.push({path:n.at(E.kw(":path")),"content-hash":n.at(E.kw(":content-hash"))});return e?{version:e,assets:o}:null}catch{return null}}function Pe(t){let r=A(t,".flex-cli","asset-meta.edn");if(!k(r))return null;try{let e=Ae(r,"utf-8");return ke(e)}catch{return null}}function Ie(t,r){let e=A(t,".flex-cli");k(e)||X(e,{recursive:!0});let s=r.assets.map(i=>new E.Map([E.kw(":path"),i.path,E.kw(":content-hash"),i["content-hash"]])),o=new E.Map([E.kw(":version"),r.version,E.kw(":assets"),new E.Vector(s)]),n=A(t,".flex-cli","asset-meta.edn");jt(n,E.encode(o),"utf-8")}function Yt(t){let r=Buffer.from(`${t.length}|`,"utf-8");return Ut("sha1").update(r).update(t).digest("hex")}function zt(t){let r=[];function e(s,o=""){let n=we(s);for(let i of n){if(i===".flex-cli"||i===".DS_Store")continue;let a=A(s,i),p=o?A(o,i):i,c=q(a);if(c.isDirectory())e(a,p);else if(c.isFile()){let d=Ae(a),u=Yt(d);r.push({path:p,data:d,hash:u})}}}return e(t),r}function Zt(t){let r=[];function e(s,o=""){let n=we(s);for(let i of n){if(i===".flex-cli"||i===".DS_Store")continue;let a=A(s,i),p=o?A(o,i):i,c=q(a);c.isDirectory()?e(a,p):c.isFile()&&r.push(p)}}return e(t),r}function Xt(t){for(let r of t)if(r.path.endsWith(".json"))try{JSON.parse(r.data.toString("utf-8"))}catch(e){throw new Error(`Invalid JSON in ${r.path}: ${e}`)}}function er(t){let r=t/1024/1024;return`${Qt}${Gt}Downloaded ${r.toFixed(2)}MB`}function tr(t){let r=0,e=()=>{process.stderr.write(er(r))},s=setInterval(e,100);t.on("data",o=>{r+=o.length}),t.on("end",()=>{clearInterval(s),e(),process.stderr.write(`
|
|
7
|
+
`)}function j(t){console.error("Could not parse arguments:");for(let r of t)console.error(`${r} is required`)}function y(t){console.log(T.green(t))}function ce(t){console.error(T.yellow(`Warning: ${t}`))}var le="sharetribe-community-cli",U="/current_admin/show";function et(t){try{return JSON.parse(t).errors?.[0]?.title}catch{return}}function tt(t){try{let e=K.parse(t).at(K.kw(":errors"))?.val?.[0];return e?e.at(K.kw(":title")):void 0}catch{return}}function rt(t){let r;try{r=JSON.parse(t).errors?.[0]?.details?.assets}catch{return}if(!(!Array.isArray(r)||r.length===0))return r.map(e=>{let s=new Set,o=[];for(let n of e.errors??[]){let i=JSON.stringify(n);s.has(i)||(s.add(i),o.push(n.message??""))}return{path:e.path??"",messages:o}})}function st(t){return t.flatMap(({path:r,messages:e})=>[R(` In ${I.bold(r)}:`),...e.map(s=>R(` ${s}`))]).map(r=>`
|
|
8
|
+
${r}`).join("")}function V(t,r){return{status:r,title:et(t)??tt(t),originalText:t||void 0,assetErrors:rt(t)}}function D(t,r,e){let{status:s,path:o,title:n,originalText:i,assetErrors:a}=t;if(s===500){$(["API call failed. Reason: Internal server error."]);return}if(s===401&&o===U){$(["Error: Access denied",`Failed to verify API key ending with ...${I.bold(e.slice(-4))}`,`Check your API key and use ${I.bold(`${le} login`)} to relogin.`]);return}if(s===401){$(["Error: Access denied",`Failed to access marketplace ${I.bold(r)} with API key ending with ...${I.bold(e.slice(-4))}`,`Use ${I.bold(`${le} login`)} to relogin if needed.`]);return}let p=`API call failed. Status: ${s}, reason: ${n||i||"Unspecified"}`;$([a?.length?`${p}${st(a)}`:p])}function ct(t){return typeof t=="object"&&t!==null&&"status"in t&&"code"in t}var H="\x1B[?25h";function lt(t){let r="";return new nt({write(e,s,o){let n=r+String(e);r="";for(let a=H.length-1;a>0;a-=1)if(n.endsWith(H.slice(0,a))){r=n.slice(-a);break}let i=r?n.slice(0,-r.length):n;t.write(i.split(H).join("")),o()},final(e){r&&t.write(r),e()}})}async function pe(){let e=(await ot.createPromptModule({output:lt(process.stderr)})([{type:"password",name:"apiKey",message:"API key"}])).apiKey,s;try{({email:s}=await at(e))}catch(o){if(ct(o)){D({status:o.status,path:U,title:o.title,originalText:o.body},"",e),process.exitCode=1;return}o&&typeof o=="object"&&"message"in o?c(o.message):c("Failed to log in"),process.exitCode=1;return}it({apiKey:e}),console.log(`Hello ${s}!`)}import{clearAuth as pt}from"sharetribe-flex-build-sdk";async function de(){await pt(),console.log("Successfully logged out.")}import{listProcesses as dt,listProcessVersions as mt}from"sharetribe-flex-build-sdk";function ut(t){try{let r=new Date(t),e=r.getFullYear(),s=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0"),n=r.toLocaleTimeString("en-US");return`${e}-${s}-${o} ${n}`}catch{return t}}async function J(t,r){try{if(r){let s=(await mt(void 0,t,r)).map(o=>({Created:ut(o.createdAt),Version:o.version.toString(),Aliases:o.aliases?.join(", ")||"",Transactions:o.transactionCount?.toString()||"0"}));C(F(s),s)}else{let s=(await dt(void 0,t)).map(o=>({Name:o.name,"Latest version":o.version?.toString()||""}));C(F(s),s)}}catch(e){e&&typeof e=="object"&&"message"in e?c(e.message):c("Failed to list processes"),process.exitCode=1;return}}import{createProcess as Et}from"sharetribe-flex-build-sdk";import{readdirSync as ft,readFileSync as me,statSync as ht}from"node:fs";import{join as _}from"node:path";import{parseProcessFile as gt}from"sharetribe-flex-build-sdk";function k(t){return _(t,"process.edn")}function b(t){try{if(ht(k(t)).isFile())return}catch{}throw new Error("--path should be a process directory")}function x(t){let r=_(t,"templates"),e=[],s;try{s=ft(r)}catch{return e}for(let o of s){let n=_(r,o);try{e.push({name:o,html:me(_(n,`${o}-html.html`),"utf-8"),subject:me(_(n,`${o}-subject.txt`),"utf-8")})}catch{}}return e}function O(t,r){let{notifications:e}=gt(k(t)),s=new Set(r.map(i=>i.name)),o=new Set(e.map(i=>i.template));for(let i of s)o.has(i)||ce(`template exists but is not used in the process: ${i}`);let n=e.filter(i=>!s.has(i.template));if(n.length>0)throw new Error(n.map(i=>`Template ${i.template} not found for notification ${yt(i.name)}`).join(`
|
|
9
|
+
`))}function yt(t){return t.slice(t.indexOf("/")+1)}import{readFileSync as St}from"node:fs";async function W(t,r,e){try{b(e);let s=St(k(e),"utf-8"),o=x(e);O(e,o);let n=await Et(void 0,t,r,s,o);y(`Process ${n.name} successfully created.`)}catch(s){s&&typeof s=="object"&&"message"in s?c(s.message):c("Failed to create process"),process.exitCode=1;return}}import{pushProcess as At}from"sharetribe-flex-build-sdk";import{readFileSync as wt}from"node:fs";async function B(t,r,e){try{b(e);let s=wt(k(e),"utf-8"),o=x(e);O(e,o);let n=await At(void 0,t,r,s,o);n.noChanges?console.log("No changes"):y(`Version ${n.version} successfully saved for process ${r}`)}catch(s){s&&typeof s=="object"&&"message"in s?c(s.message):c("Failed to push process"),process.exitCode=1;return}}import{getProcess as Ct}from"sharetribe-flex-build-sdk";import{writeFileSync as G,mkdirSync as Q}from"node:fs";import{join as M}from"node:path";async function Y(t,r,e,s,o){try{let n=await Ct(void 0,t,r,{version:s,alias:o});if(!n.definition)throw new Error("No process definition in response");let{existsSync:i}=await import("node:fs"),a=i(e);Q(e,{recursive:!0}),a||console.error(`Creating a new directory: ${e}`);let p=M(e,"process.edn");G(p,n.definition,"utf-8");let l=n.emailTemplates||[];if(l&&Array.isArray(l)&&l.length>0){let d=M(e,"templates");Q(d,{recursive:!0});for(let u of l){let h=u.name,P=u.html,S=u.subject;if(h){let m=M(d,h);if(Q(m,{recursive:!0}),P){let g=M(m,`${h}-html.html`);G(g,P,"utf-8")}if(S){let g=M(m,`${h}-subject.txt`);G(g,S,"utf-8")}}}}console.error(`Saved process to ${e}`)}catch(n){n&&typeof n=="object"&&"message"in n?c(n.message):c("Failed to pull process"),process.exitCode=1;return}}import{createAlias as kt,updateAlias as vt,deleteAlias as Pt}from"sharetribe-flex-build-sdk";async function z(t,r,e,s){try{let o=await kt(void 0,t,r,e,s);y(`Alias ${o.alias} successfully created to point to version ${o.version}.`)}catch(o){o&&typeof o=="object"&&"message"in o?c(o.message):c("Failed to create alias"),process.exitCode=1;return}}async function Z(t,r,e,s){try{let o=await vt(void 0,t,r,e,s);y(`Alias ${o.alias} successfully updated to point to version ${o.version}.`)}catch(o){o&&typeof o=="object"&&"message"in o?c(o.message):c("Failed to update alias"),process.exitCode=1;return}}async function X(t,r,e){try{let s=await Pt(void 0,t,r,e);y(`Alias ${s.alias} successfully deleted.`)}catch(s){s&&typeof s=="object"&&"message"in s?c(s.message):c("Failed to delete alias"),process.exitCode=1;return}}import{createAlias as ue,createProcess as It,listProcessVersions as bt,pushProcess as xt,updateAlias as Ot}from"sharetribe-flex-build-sdk";import{readFileSync as Rt}from"node:fs";async function Tt(t,r){try{return await bt(void 0,t,r)}catch(e){if(e&&typeof e=="object"&&e.code==="tx-process-not-found")return null;throw e}}async function ee(t,r,e,s){try{b(e);let o=Rt(k(e),"utf-8"),n=x(e);O(e,n);let i=await Tt(t,r);if(i===null){let d=await It(void 0,t,r,o,n);y(`Process ${d.name} successfully created.`);let u=await ue(void 0,t,r,d.version,s);y(`Alias ${u.alias} successfully created to point to version ${u.version}.`);return}let a=i.some(d=>d.aliases?.includes(s)),p=await xt(void 0,t,r,o,n),l;if(p.noChanges)console.log("No changes"),l=Math.max(...i.map(d=>d.version));else{if(p.version===void 0)throw new Error(`The API saved a version of ${r} but did not say which`);l=p.version,y(`Version ${l} successfully saved for process ${r}`)}if(a){let d=await Ot(void 0,t,r,l,s);y(`Alias ${d.alias} successfully updated to point to version ${d.version}.`)}else{let d=await ue(void 0,t,r,l,s);y(`Alias ${d.alias} successfully created to point to version ${d.version}.`)}}catch(o){o&&typeof o=="object"&&"message"in o?c(o.message):c("Failed to create/push process and alias"),process.exitCode=1;return}}function fe(t){let r=t.command("process").description("describe a process file").option("--path <PROCESS_DIR>","path to the directory where the process.edn file is").option("--transition <TRANSITION_NAME>","transition name, e.g. transition/request to get more details of it").action(async e=>{e.path?(console.log(`Describing process at: ${e.path}`),e.transition&&console.log(`Transition: ${e.transition}`),console.log("Process description not yet implemented")):r.outputHelp()});r.command("list").description("list all transaction processes").option("--process <PROCESS_NAME>","print version and alias info of a specific process").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await J(s,e.process)}),r.command("create").description("create a new transaction process").requiredOption("--process <PROCESS_NAME>","name for the new process").requiredOption("--path <LOCAL_PROCESS_DIR>","path to the directory where the process.edn file is").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await W(s,e.process,e.path)}),r.command("push").description("push a process file to the remote").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--path <LOCAL_PROCESS_DIR>","path to the directory where the process.edn file is").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await B(s,e.process,e.path)}),r.command("pull").description("fetch a process file").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--path <LOCAL_PROCESS_DIR>","path where to save the process").option("--version <VERSION_NUM>","version number").option("--alias <PROCESS_ALIAS>","alias name").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await Y(s,e.process,e.path,e.version,e.alias)}),r.command("create-alias").description("create a new alias").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--version <VERSION_NUM>","version number").requiredOption("--alias <ALIAS>","alias name").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").allowUnknownOption(!1).action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await z(s,e.process,parseInt(e.version),e.alias)}),r.command("update-alias").description("update an existing alias").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--version <VERSION_NUM>","version number").requiredOption("--alias <ALIAS>","alias name").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await Z(s,e.process,parseInt(e.version),e.alias)}),r.command("delete-alias").description("delete an existing alias").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--alias <ALIAS>","alias name").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await X(s,e.process,e.alias)}),r.command("deploy").description("deploy a process file with alias (create/push + alias create/update)").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--path <LOCAL_PROCESS_DIR>","path to the directory with the process files").requiredOption("--alias <ALIAS>","alias name").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await ee(s,e.process,e.path,e.alias)}),t.command("process-list",{hidden:!0}).description("list all transaction processes").option("--process <PROCESS_NAME>","print version and alias info of a specific process").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await J(s,e.process)}),t.command("process-create",{hidden:!0}).description("create a new transaction process").requiredOption("--process <PROCESS_NAME>","name for the new process").requiredOption("--path <LOCAL_PROCESS_DIR>","path to the directory where the process.edn file is").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await W(s,e.process,e.path)}),t.command("process-push",{hidden:!0}).description("push a process file to the remote").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--path <LOCAL_PROCESS_DIR>","path to the directory where the process.edn file is").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await B(s,e.process,e.path)}),t.command("process-pull",{hidden:!0}).description("fetch a process file").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--path <LOCAL_PROCESS_DIR>","path where to save the process").option("--version <VERSION_NUM>","version number").option("--alias <PROCESS_ALIAS>","alias name").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await Y(s,e.process,e.path,e.version,e.alias)}),t.command("process-create-alias",{hidden:!0}).description("create a new alias").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--version <VERSION_NUM>","version number").requiredOption("--alias <ALIAS>","alias name").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await z(s,e.process,parseInt(e.version),e.alias)}),t.command("process-update-alias",{hidden:!0}).description("update an existing alias").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--version <VERSION_NUM>","version number").requiredOption("--alias <ALIAS>","alias name").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await Z(s,e.process,parseInt(e.version),e.alias)}),t.command("process-delete-alias",{hidden:!0}).description("delete an existing alias").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--alias <ALIAS>","alias name").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await X(s,e.process,e.alias)}),t.command("process-deploy",{hidden:!0}).description("deploy a process file with alias (create/push + alias create/update)").requiredOption("--process <PROCESS_NAME>","name of the process").requiredOption("--path <LOCAL_PROCESS_DIR>","path to the directory with the process files").requiredOption("--alias <ALIAS>","alias name").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await ee(s,e.process,e.path,e.alias)})}import{listSearchSchemas as $t,setSearchSchema as Dt,unsetSearchSchema as _t}from"sharetribe-flex-build-sdk";var he={metadata:"Metadata",private:"Private data",protected:"Protected data",public:"Public data"};async function Mt(t,r){try{await Dt(void 0,t,{key:r.key,scope:r.scope,type:r.type,doc:r.doc,defaultValue:r.default,schemaFor:r.schemaFor});let e=r.schemaFor||"listing",s=he[r.scope]||r.scope;console.log(`${s} schema, ${r.key} is successfully set for ${e}.`)}catch(e){e&&typeof e=="object"&&"message"in e?c(e.message):c("Failed to set search schema"),process.exitCode=1;return}}async function qt(t,r){try{await _t(void 0,t,{key:r.key,scope:r.scope,schemaFor:r.schemaFor});let e=r.schemaFor||"listing",s=he[r.scope]||r.scope;console.log(`${s} schema, ${r.key} is successfully unset for ${e}.`)}catch(e){e&&typeof e=="object"&&"message"in e?c(e.message):c("Failed to unset search schema"),process.exitCode=1;return}}function Nt(t){return t==null?"":Array.isArray(t)?t.join(", "):String(t)}async function Lt(t){try{let e=(await $t(void 0,t)).map(o=>({"Schema for":o.schemaFor,Scope:o.scope,Key:o.key,Type:o.type,"Default value":Nt(o.defaultValue),Doc:o.doc||""})).sort((o,n)=>o["Schema for"]!==n["Schema for"]?o["Schema for"].localeCompare(n["Schema for"]):o.Scope!==n.Scope?o.Scope.localeCompare(n.Scope):o.Key.localeCompare(n.Key));C(["Schema for","Scope","Key","Type","Default value","Doc"],e)}catch(r){r&&typeof r=="object"&&"message"in r?c(r.message):c("Failed to list search schemas"),process.exitCode=1;return}}function ge(t){let r=t.command("search").description("list all search schemas").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await Lt(s)});r.command("set").description("set search schema").requiredOption("--key <KEY>","key name").requiredOption("--scope <SCOPE>","extended data scope (either metadata or public for listing schema, metadata, private, protected or public for userProfile schema, metadata or protected for transaction schema)").requiredOption("--type <TYPE>","value type (either enum, multi-enum, boolean, long or text)").option("--doc <DOC>","description of the schema").option("--default <DEFAULT>","default value for search if value is not set").option("--schema-for <SCHEMA_FOR>","Subject of the schema (either listing, userProfile or transaction, defaults to listing)").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await Mt(s,{key:e.key,scope:e.scope,type:e.type,doc:e.doc,default:e.default,schemaFor:e.schemaFor})}),r.command("unset").description("unset search schema").requiredOption("--key <KEY>","key name").requiredOption("--scope <SCOPE>","extended data scope (either metadata or public for listing schema, metadata, private, protected or public for userProfile schema, metadata or protected for transaction schema)").option("--schema-for <SCHEMA_FOR>","Subject of the schema (either listing, userProfile or transaction, defaults to listing)").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await qt(s,{key:e.key,scope:e.scope,schemaFor:e.schemaFor})})}import{pushAssets as Ft,stageAsset as jt,getApiBaseUrl as Kt,readAuth as we}from"sharetribe-flex-build-sdk";import{readFileSync as Ce,writeFileSync as Ut,existsSync as v,mkdirSync as te,readdirSync as ke,statSync as N,unlinkSync as ye,createWriteStream as ve}from"node:fs";import{join as A,dirname as Vt}from"node:path";import{createHash as Ht}from"node:crypto";import*as Jt from"node:http";import*as Wt from"node:https";import{tmpdir as Bt}from"node:os";import{pipeline as Pe}from"node:stream/promises";import Ee from"chalk";import E from"jsedn";import Gt from"yauzl";var Qt="meta/asset-meta.edn",Se="assets/",Yt="\x1B[K",zt="\r";function Ie(t){try{let r=E.parse(t),e=r.at(E.kw(":version"))||r.at(E.kw(":aliased-version")),s=r.at(E.kw(":assets")),o=[];if(s&&s.val)for(let n of s.val)o.push({path:n.at(E.kw(":path")),"content-hash":n.at(E.kw(":content-hash"))});return e?{version:e,assets:o}:null}catch{return null}}function be(t){let r=A(t,".flex-cli","asset-meta.edn");if(!v(r))return null;try{let e=Ce(r,"utf-8");return Ie(e)}catch{return null}}function xe(t,r){let e=A(t,".flex-cli");v(e)||te(e,{recursive:!0});let s=r.assets.map(i=>new E.Map([E.kw(":path"),i.path,E.kw(":content-hash"),i["content-hash"]])),o=new E.Map([E.kw(":version"),r.version,E.kw(":assets"),new E.Vector(s)]),n=A(t,".flex-cli","asset-meta.edn");Ut(n,E.encode(o),"utf-8")}function Zt(t){let r=Buffer.from(`${t.length}|`,"utf-8");return Ht("sha1").update(r).update(t).digest("hex")}function Xt(t){let r=[];function e(s,o=""){let n=ke(s);for(let i of n){if(i===".flex-cli"||i===".DS_Store")continue;let a=A(s,i),p=o?A(o,i):i,l=N(a);if(l.isDirectory())e(a,p);else if(l.isFile()){let d=Ce(a),u=Zt(d);r.push({path:p,data:d,hash:u})}}}return e(t),r}function er(t){let r=[];function e(s,o=""){let n=ke(s);for(let i of n){if(i===".flex-cli"||i===".DS_Store")continue;let a=A(s,i),p=o?A(o,i):i,l=N(a);l.isDirectory()?e(a,p):l.isFile()&&r.push(p)}}return e(t),r}function tr(t){for(let r of t)if(r.path.endsWith(".json"))try{JSON.parse(r.data.toString("utf-8"))}catch(e){throw new Error(`Invalid JSON in ${r.path}: ${e}`)}}function rr(t){let r=t/1024/1024;return`${zt}${Yt}Downloaded ${r.toFixed(2)}MB`}function sr(t){let r=0,e=()=>{process.stderr.write(rr(r))},s=setInterval(e,100);t.on("data",o=>{r+=o.length}),t.on("end",()=>{clearInterval(s),e(),process.stderr.write(`
|
|
10
10
|
Finished downloading assets
|
|
11
|
-
`)})}function
|
|
12
|
-
Fix the file and rerun assets push to retry staging.`)}throw w}}let P=i.map(m=>{let g=h.get(m.path);return{path:m.path,op:"upsert",...g?{stagingId:g}:{data:m.data,filename:m.path}}}),S=await
|
|
11
|
+
`)})}function or(){let t=we();if(!t?.apiKey)throw new Error("Not logged in. Please provide apiKey or run: sharetribe-community-cli login");return t.apiKey}function nr(t,r){let e=new URL(Kt()+"/assets/pull");return e.searchParams.set("marketplace",t),r?e.searchParams.set("version",r):e.searchParams.set("version-alias","latest"),e}var q=class extends Error{constructor(e){super(`API call failed. Status: ${e.status}`);this.details=e;this.name="AssetsApiError"}details};function ir(t){return typeof t=="object"&&t!==null&&"status"in t&&"code"in t}function Oe(){return we()?.apiKey??""}async function ar(t,r){let e=nr(t,r),s=or(),o=e.protocol==="https:",n=o?Wt:Jt;return new Promise((i,a)=>{let p=n.request({method:"GET",hostname:e.hostname,port:e.port||(o?443:80),path:e.pathname+e.search,headers:{Authorization:`Apikey ${s}`,Accept:"application/zip"}},l=>{let d=l.statusCode||0;if(d<200||d>=300){let u=[];l.on("data",h=>u.push(h)),l.on("end",()=>{let h=Buffer.concat(u).toString("utf-8");a(new q(V(h,d)))});return}i(l)});p.setTimeout(12e4,()=>{p.destroy(new Error("Request timeout"))}),p.on("error",a),p.end()})}function cr(){return A(Bt(),`assets-${Date.now()}.zip`)}function lr(t){return t.startsWith(Se)?t.slice(Se.length):t}function pr(t){return new Promise((r,e)=>{let s=[];t.on("data",o=>s.push(o)),t.on("end",()=>r(Buffer.concat(s).toString("utf-8"))),t.on("error",e)})}async function dr(t,r){return new Promise((e,s)=>{Gt.open(t,{lazyEntries:!0},(o,n)=>{if(o||!n){s(o||new Error("Failed to open zip file"));return}let i=null;n.on("error",s),n.on("end",()=>{if(!i){s(new Error("Asset metadata not found in zip"));return}e(i)}),n.readEntry(),n.on("entry",a=>{if(a.fileName.endsWith("/")){n.readEntry();return}n.openReadStream(a,(p,l)=>{if(p||!l){s(p||new Error("Failed to read zip entry"));return}if(a.fileName===Qt){pr(l).then(h=>{if(i=Ie(h),!i){s(new Error("Invalid asset metadata"));return}n.readEntry()}).catch(s);return}let d=A(r,lr(a.fileName)),u=Vt(d);v(u)||te(u,{recursive:!0}),Pe(l,ve(d)).then(()=>n.readEntry()).catch(s)})})})})}async function mr(t,r,e,s){try{if(v(r)||te(r,{recursive:!0}),!N(r).isDirectory())throw new Error(`${r} is not a directory`);let n=s?er(r):[],i=be(r),a=cr();try{let p=await ar(t,e);sr(p),await Pe(p,ve(a));let l=await dr(a,r),d=l.version,u=s?new Set(n.filter(S=>!l.assets.some(m=>m.path===S))):new Set,P=i?.version!==d||u.size>0;if(u.size>0)for(let S of u){let m=A(r,S);v(m)&&ye(m)}P?(xe(r,{version:d,assets:l.assets}),console.log(`Version ${d} successfully pulled.`)):console.log("Assets are up to date.")}finally{v(a)&&ye(a)}}catch(o){if(o instanceof q){D(o.details,t,Oe()),process.exitCode=1;return}o&&typeof o=="object"&&"message"in o?c(o.message):c("Failed to pull assets"),process.exitCode=1;return}}function ur(t,r){let e=new Map(t.map(s=>[s.path,s["content-hash"]]));return r.filter(s=>{let o=e.get(s.path);return!o||o!==s.hash})}async function fr(t,r,e){try{if(!v(r)||!N(r).isDirectory())throw new Error(`${r} is not a valid directory`);let s=be(r),o=s?.version||"nil",n=Xt(r);tr(n);let i=ur(s?.assets||[],n),a=m=>m.toLowerCase().endsWith(".json"),p=i.filter(m=>!a(m.path)),l=new Map(n.map(m=>[m.path,m])),d=[];if(e&&s)for(let m of s.assets)l.has(m.path)||d.push({path:m.path,op:"delete"});if(i.length===0&&d.length===0){console.log("Assets are up to date.");return}if(i.length>0){let m=i.map(g=>g.path).join(", ");console.error(Ee.green(`Uploading changed assets: ${m}`))}let h=new Map;if(p.length>0){let m=p.map(g=>g.path).join(", ");console.error(Ee.green(`Staging assets: ${m}`));for(let g of p)try{let w=await jt(void 0,t,g.data,g.path);h.set(g.path,w.stagingId)}catch(w){if(w&&typeof w=="object"&&"code"in w&&w.code==="asset-invalid-content"){let Ge="message"in w?w.message:"The file is missing or uses an unsupported format.";throw new Error(`Failed to stage image ${g.path}: ${Ge}
|
|
12
|
+
Fix the file and rerun assets push to retry staging.`)}throw w}}let P=i.map(m=>{let g=h.get(m.path);return{path:m.path,op:"upsert",...g?{stagingId:g}:{data:m.data,filename:m.path}}}),S=await Ft(void 0,t,o,[...P,...d]);xe(r,{version:S.version,assets:S.assets.map(m=>({path:m.path,"content-hash":m.contentHash}))}),console.log(`New version ${S.version} successfully created.`)}catch(s){if(ir(s)){D(V(s.body??"",s.status),t,Oe()),process.exitCode=1;return}s&&typeof s=="object"&&"message"in s?c(s.message):c("Failed to push assets"),process.exitCode=1;return}}function Ae(t,r){let e=[];return t||e.push("--path"),r||e.push("--marketplace"),e}function Re(t){let r=t.command("assets").description("manage marketplace assets");r.command("pull").description("pull assets from remote").option("--path <PATH>","path to directory where assets will be stored").option("--version <VERSION>","version of assets to pull").option("--prune","delete local files no longer present as remote assets").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace,o=Ae(e.path,s);if(o.length>0){j(o),process.exitCode=1;return}await mr(s,e.path,e.version,e.prune)}),r.command("push").description("push assets to remote").option("--path <PATH>","path to directory with assets").option("--prune","delete remote assets no longer present locally").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace,o=Ae(e.path,s);if(o.length>0){j(o),process.exitCode=1;return}await fr(s,e.path,e.prune)})}import{sendNotification as hr,previewNotification as gr}from"sharetribe-flex-build-sdk";import{readFileSync as re,existsSync as L,statSync as yr}from"node:fs";import{join as Te}from"node:path";import{createServer as Er}from"node:http";function $e(t){if(!L(t)||!yr(t).isDirectory())throw new Error(`Template directory not found: ${t}`);let r=Te(t,"template.html"),e=Te(t,"template-subject.txt");if(!L(r))throw new Error(`template.html not found in ${t}`);if(!L(e))throw new Error(`template-subject.txt not found in ${t}`);let s=re(r,"utf-8"),o=re(e,"utf-8").trim();return{html:s,subject:o}}function De(t){if(!t)return;if(!L(t))throw new Error(`Context file not found: ${t}`);let r=re(t,"utf-8");try{return JSON.parse(r)}catch(e){throw new Error(`Invalid JSON in context file: ${e}`)}}async function Sr(t,r,e){try{let s=$e(r),o=De(e),n=await hr(void 0,t,{template:s,context:o});console.log(`Preview successfully sent to ${n.adminEmail}`)}catch(s){s&&typeof s=="object"&&"message"in s?c(s.message):c("Failed to send notification"),process.exitCode=1;return}}async function Ar(t,r,e){try{let s=$e(r),o=De(e);console.log(`Template: ${r}`),console.log(`Subject: ${s.subject}`),console.log(""),console.log("Starting preview server at http://localhost:3535"),console.log("Press Ctrl+C to stop"),console.log("");let n=null,i=async()=>{try{let d=(await gr(void 0,t,{template:s,context:o})).html,u=`<title>${s.subject}</title>`;d.includes("<head>")?n=d.replace("<head>",`<head>
|
|
13
13
|
${u}`):d.includes("<html>")?n=d.replace("<html>",`<html>
|
|
14
|
-
<head>${u}</head>`):n=`<html><head>${u}</head><body>${d}</body></html>`}catch(
|
|
14
|
+
<head>${u}</head>`):n=`<html><head>${u}</head><body>${d}</body></html>`}catch(l){n=`
|
|
15
15
|
<html>
|
|
16
16
|
<head><title>Error</title></head>
|
|
17
17
|
<body style="font-family: sans-serif; padding: 20px;">
|
|
18
18
|
<h1 style="color: #d32f2f;">Error</h1>
|
|
19
|
-
<pre style="background: #f5f5f5; padding: 15px; border-radius: 4px;">${
|
|
19
|
+
<pre style="background: #f5f5f5; padding: 15px; border-radius: 4px;">${l&&typeof l=="object"&&"message"in l?l.message:"Failed to preview notification"}</pre>
|
|
20
20
|
</body>
|
|
21
21
|
</html>
|
|
22
|
-
`}};await i();let a=
|
|
23
|
-
Shutting down preview server...`),a.close(()=>{process.exitCode=0})};process.on("SIGINT",p),process.on("SIGTERM",p)}catch(s){s&&typeof s=="object"&&"message"in s?
|
|
24
|
-
Stopping tail...`),s(),process.exitCode=0};process.on("SIGINT",o),process.on("SIGTERM",o)}catch(e){e&&typeof e=="object"&&"message"in e?
|
|
25
|
-
`)}function
|
|
26
|
-
`);try{Jr(We,{recursive:!0}),Vr(He,new Date().toISOString())}catch{}}var Ge=Je(process.argv),f=new jr;Ve(f);f.configureOutput({writeOut:t=>process.stdout.write(t+`
|
|
22
|
+
`}};await i();let a=Er(async(l,d)=>{l.url==="/"||l.url===""?(await i(),d.writeHead(200,{"Content-Type":"text/html"}),d.end(n)):(d.writeHead(404,{"Content-Type":"text/plain"}),d.end("Not Found"))});a.listen(3535,()=>{console.log("Preview server started. Open http://localhost:3535 in your browser.")});let p=()=>{console.log(`
|
|
23
|
+
Shutting down preview server...`),a.close(()=>{process.exitCode=0})};process.on("SIGINT",p),process.on("SIGTERM",p)}catch(s){s&&typeof s=="object"&&"message"in s?c(s.message):c("Failed to preview notification"),process.exitCode=1;return}}function _e(t){let r=t.command("notifications").description("manage email notifications");r.command("preview").description("render a preview of an email template").requiredOption("--template <TEMPLATE_DIR>","path to template directory").option("--context <CONTEXT_FILE>","path to email rendering context JSON file").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await Ar(s,e.template,e.context)}),r.command("send").description("send a preview of an email template to the logged in admin").requiredOption("--template <TEMPLATE_DIR>","path to template directory").option("--context <CONTEXT_FILE>","path to email rendering context JSON file").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await Sr(s,e.template,e.context)})}import{getListingApprovalStatus as wr,enableListingApproval as Cr,disableListingApproval as kr}from"sharetribe-flex-build-sdk";async function vr(t){try{(await wr(void 0,t)).enabled?console.log(`Listing approvals are enabled in ${t}`):console.log(`Listing approvals are disabled in ${t}`)}catch(r){r&&typeof r=="object"&&"message"in r?c(r.message):c("Failed to get listing approval status"),process.exitCode=1;return}}async function Pr(t){try{await Cr(void 0,t),console.log(`Successfully enabled listing approvals in ${t}`)}catch(r){r&&typeof r=="object"&&"message"in r?c(r.message):c("Failed to enable listing approvals"),process.exitCode=1;return}}async function Ir(t){try{await kr(void 0,t),console.log(`Successfully disabled listing approvals in ${t}`)}catch(r){r&&typeof r=="object"&&"message"in r?c(r.message):c("Failed to disable listing approvals"),process.exitCode=1;return}}function Me(t){let r=t.command("listing-approval").description("manage listing approvals (DEPRECATED - use Console instead)").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier");r.action(async e=>{console.warn("Warning: CLI command `listing-approval` is deprecated. Use Console instead.");let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await vr(s)}),r.command("enable").description("enable listing approvals").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{console.warn("Warning: CLI command `listing-approval` is deprecated. Use Console instead.");let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await Pr(s)}),r.command("disable").description("disable listing approvals").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{console.warn("Warning: CLI command `listing-approval` is deprecated. Use Console instead.");let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await Ir(s)})}import{queryEvents as br,pollEvents as xr}from"sharetribe-flex-build-sdk";var se=["Seq ID","Resource ID","Event type","Created at local time","Source","Actor"];function qe(t){if([t.sequenceId!==void 0,t.afterSeqId!==void 0,t.beforeSeqId!==void 0,t.afterTs!==void 0,t.beforeTs!==void 0].filter(Boolean).length>1)throw new Error("Only one of --seqid, --after-seqid, --before-seqid, --after-ts, or --before-ts can be specified");if(t.resourceId&&t.relatedResourceId)throw new Error("Only one of --resource or --related-resource can be specified")}function Ne(t){try{let r=new Date(t),e=r.getFullYear(),s=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0"),n=r.toLocaleTimeString("en-US");return`${e}-${s}-${o} ${n}`}catch{return t}}async function Or(t,r){try{qe(r);let e=await br(void 0,t,{resourceId:r.resourceId,relatedResourceId:r.relatedResourceId,eventTypes:r.eventTypes,sequenceId:r.sequenceId,afterSeqId:r.afterSeqId,beforeSeqId:r.beforeSeqId,afterTs:r.afterTs,beforeTs:r.beforeTs,limit:r.limit});if(r.json)for(let s of e){let{auditEmails:o,...n}=s;console.log(JSON.stringify(n))}else if(r.jsonPretty)for(let s of e){let{auditEmails:o,...n}=s;console.log(JSON.stringify(n,null,2))}else C(se,e.map(s=>{let o=s.auditEmails?.userEmail||s.auditEmails?.adminEmail||"",n=s.source?.replace("source/","")||"";return{"Seq ID":s.sequenceId.toString(),"Resource ID":s.resourceId,"Event type":s.eventType,"Created at local time":Ne(s.createdAt),Source:n,Actor:o}}))}catch(e){e&&typeof e=="object"&&"message"in e?c(e.message):c("Failed to query events"),process.exitCode=1;return}}async function Rr(t,r){try{qe(r),console.log("Tailing events... Press Ctrl+C to stop"),console.log("");let e,s=xr(void 0,t,{resourceId:r.resourceId,relatedResourceId:r.relatedResourceId,eventTypes:r.eventTypes,limit:r.limit||10},n=>{if(r.json)for(let i of n){let{auditEmails:a,...p}=i;console.log(JSON.stringify(p))}else if(r.jsonPretty)for(let i of n){let{auditEmails:a,...p}=i;console.log(JSON.stringify(p,null,2))}else{let i=n.map(a=>{let p=a.auditEmails?.userEmail||a.auditEmails?.adminEmail||"",l=a.source?.replace("source/","")||"";return{"Seq ID":a.sequenceId.toString(),"Resource ID":a.resourceId,"Event type":a.eventType,"Created at local time":Ne(a.createdAt),Source:l,Actor:p}});e?ae(se,e,i):e=C(se,i)}},5e3),o=()=>{console.log(`
|
|
24
|
+
Stopping tail...`),s(),process.exitCode=0};process.on("SIGINT",o),process.on("SIGTERM",o)}catch(e){e&&typeof e=="object"&&"message"in e?c(e.message):c("Failed to tail events"),process.exitCode=1;return}}function Le(t){let r=t.command("events").description("Get a list of events.").option("--resource <RESOURCE_ID>","show events for specific resource ID").option("--related-resource <RELATED_RESOURCE_ID>","show events related to specific resource ID").option("--filter <EVENT_TYPES>","filter by event types (comma-separated)").option("--seqid <SEQUENCE_ID>","get event with specific sequence ID",parseInt).option("--after-seqid <SEQUENCE_ID>","show events after sequence ID (exclusive)",parseInt).option("--before-seqid <SEQUENCE_ID>","show events before sequence ID (exclusive)",parseInt).option("--after-ts <TIMESTAMP>","show events after timestamp").option("--before-ts <TIMESTAMP>","show events before timestamp").option("-l, --limit <NUMBER>","limit results (default: 100, max: 100)",parseInt).option("--json","output as single-line JSON strings").option("--json-pretty","output as indented multi-line JSON").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier");r.action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Could not parse arguments:"),console.error("--marketplace is required"),process.exitCode=1;return}await Or(s,{resourceId:e.resource,relatedResourceId:e.relatedResource,eventTypes:e.filter,sequenceId:e.seqid,afterSeqId:e.afterSeqid,beforeSeqId:e.beforeSeqid,afterTs:e.afterTs,beforeTs:e.beforeTs,limit:e.limit||100,json:e.json,jsonPretty:e.jsonPretty})}),r.command("tail").description("Tail events live as they happen").option("--resource <RESOURCE_ID>","show events for specific resource ID").option("--related-resource <RELATED_RESOURCE_ID>","show events related to specific resource ID").option("--filter <EVENT_TYPES>","filter by event types (comma-separated)").option("-l, --limit <NUMBER>","limit results per poll (default: 10, max: 100)",parseInt).option("--json","output as single-line JSON strings").option("--json-pretty","output as indented multi-line JSON").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Could not parse arguments:"),console.error("--marketplace is required"),process.exitCode=1;return}await Rr(s,{resourceId:e.resource,relatedResourceId:e.relatedResource,eventTypes:e.filter,limit:e.limit||10,json:e.json,jsonPretty:e.jsonPretty})})}import{updateStripeVersion as Tr,SUPPORTED_STRIPE_VERSIONS as $r}from"sharetribe-flex-build-sdk";import Fe from"inquirer";async function Dr(){return(await Fe.prompt([{type:"list",name:"version",message:"Select Stripe API version:",choices:[...$r]}])).version}async function _r(){return console.log(""),console.log("WARNING: Changing Stripe API version may affect your integration."),console.log(""),console.log("After updating the Stripe API version, you may need to:"),console.log("- Handle new Capabilities requirements"),console.log("- Update identity verification settings"),console.log(""),console.log("See Stripe documentation for details:"),console.log("https://stripe.com/docs/connect/capabilities-overview"),console.log("https://stripe.com/docs/connect/identity-verification"),console.log(""),(await Fe.prompt([{type:"confirm",name:"confirmed",message:"Do you want to continue?",default:!1}])).confirmed}async function Mr(t,r,e){try{let s=r;if(s||(s=await Dr()),!e&&!await _r()){console.log("Cancelled."),process.exitCode=0;return}await Tr(void 0,t,s),console.log(`Stripe API version successfully changed to ${s}`)}catch(s){s&&typeof s=="object"&&"message"in s?c(s.message):c("Failed to update Stripe API version"),process.exitCode=1;return}}function je(t){t.command("stripe").description("manage Stripe integration").command("update-version").description("update Stripe API version in use").option("--version <VERSION>","Stripe API version to update to").option("-f, --force","skip confirmation prompt and force update").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier").action(async e=>{let s=e.marketplace||t.opts().marketplace;if(!s){console.error("Error: --marketplace is required"),process.exitCode=1;return}await Mr(s,e.version,e.force)})}import{getConfigMap as qr,readAuth as Nr}from"sharetribe-flex-build-sdk";function Lr(t){return t.length<=4?`...${t}`:`...${t.slice(-4)}`}function Ke(){let t=Nr(),r=t?.apiKey?Lr(t.apiKey):"No API key set",e=qr(),s=Object.keys(e).sort().map(n=>`:${n} ${e[n]}`).join(" "),o=s?`{${s}}`:"{}";console.log(`{:api-key ${r}, :conf-map ${o}}`)}function Fr(t){let r=[],e=!t.parent,s=t.description();if(s&&(r.push(s),r.push("")),e){let a=t.version();a&&(r.push("VERSION"),r.push(` ${a}`),r.push(""))}r.push("USAGE");let o=jr(t);r.push(` $ ${o}`),r.push("");let n=Ve(t),i=t.options.length>0&&!e;if(n.length>0&&!i){r.push("COMMANDS");let a=Math.max(...n.map(p=>p.name.length));for(let p of n){let l=p.name.padEnd(a+2);r.push(` ${l}${p.description}`)}r.push("")}if(!e){let a=t.options;if(a.length>0){r.push("OPTIONS");let p=Math.max(...a.map(l=>Ue(l).length));for(let l of a){let u=Ue(l).padEnd(p+2),h=l.description||"";r.push(` ${u}${h}`)}r.push("")}}if(n.length>0&&!i){r.push("Subcommand help:");let a=He(t);r.push(` $ ${a} help [COMMAND]`)}return r.push(""),r.join(`
|
|
25
|
+
`)}function Ve(t){let r=[],e=t.commands.filter(s=>!s._hidden&&s.name()!=="help");for(let s of e){let o=Kr(s),n=s.commands.filter(i=>!i._hidden);if(s.description()&&r.push({name:o,description:s.description()||""}),n.length>0){let i=Ve(s);for(let a of i)r.push(a)}}return t.parent||r.unshift({name:"help",description:"display help for Flex CLI"}),r.sort((s,o)=>s.name.localeCompare(o.name)),r}function He(t){let r=[],e=t;for(;e;)e.name()&&r.unshift(e.name()),e=e.parent;return r.length>0&&(r[0]="sharetribe-community-cli"),r.join(" ")}function jr(t){let r=He(t),e=t.commands.filter(n=>!n._hidden),s=t.options.length>0;return!t.parent&&e.length>0?`${r} [COMMAND]`:e.length>0&&!s?`${r} [COMMAND]`:r}function Kr(t){let r=[],e=t;for(;e&&e.parent;)e.name()&&r.unshift(e.name()),e=e.parent;return r.join(" ")}function Ue(t){let e=(t.flags||"").split(/,\s*/),s=[];for(let o of e){let n=o.trim(),i=n.match(/^((?:-{1,2}[\w-]+))\s*[<\[]([^\]>]+)[\]>]/);if(i){let a=i[1],p=i[2];s.push(`${a}=${p}`)}else s.push(n)}return s.join(", ")}function Je(t){t.configureHelp({formatHelp:(r,e)=>Fr(r)})}function We(t){let r=t.findIndex(o=>o==="process");if(r===-1)return t;let e=t[r+1];return e&&["list","create","push","pull","create-alias","update-alias","delete-alias","deploy"].includes(e)?[...t.slice(0,r),`process-${e}`,...t.slice(r+2)]:t}var Br=Hr(import.meta.url),Gr=Jr(Br),Qr=JSON.parse(Vr(Wr(Gr,"../package.json"),"utf-8")),Be=We(process.argv),f=new Ur;Je(f);f.configureOutput({writeOut:t=>process.stdout.write(t+`
|
|
27
26
|
`),writeErr:t=>process.stderr.write(t+`
|
|
28
|
-
`)});f.name("sharetribe-community-cli").description("CLI to interact with Sharetribe Flex").version(
|
|
27
|
+
`)});f.name("sharetribe-community-cli").description("CLI to interact with Sharetribe Flex").version(Qr.version,"-V","output the version number").option("-m, --marketplace <MARKETPLACE_ID>","marketplace identifier");f.command("version").description("show version").action(()=>{ie()});f.command("login").description("log in with API key").action(async()=>{await pe()});f.command("logout").description("logout").action(async()=>{await de()});f.command("debug").description("display debug info").action(()=>{Ke()});fe(f);ge(f);Re(f);_e(f);Me(f);Le(f);je(f);f.command("help [command...]").description("display help for Flex CLI").action(t=>{if(!t||t.length===0){f.outputHelp();return}let r=f;for(let e of t){let s=r.commands.find(o=>o.name()===e);if(!s){console.error(`Unknown command: ${t.join(" ")}`),process.exitCode=1;return}r=s}r.outputHelp()});var oe=Be.slice(2),Yr=oe[0]==="assets"&&!["pull","push","help"].includes(oe[1]??"");oe.length?Yr?(console.error("Command not found: assets"),process.exitCode=1):f.parse(Be):f.outputHelp();
|
|
29
28
|
//# sourceMappingURL=index.js.map
|