@burdenoff/cli-sdk 2026.1102.1 → 2026.1102.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/chunk-O6UCQ5IT.js +1 -0
- package/dist/{chunk-AYNNSLCL.js → chunk-ZGT7IIOP.js} +409 -418
- package/dist/modules/adaptercloud/index.cjs +9 -6
- package/dist/modules/adaptercloud/index.js +7 -4
- package/dist/modules/artistrybase/index.js +2 -2
- package/dist/modules/assethandler/index.cjs +2 -2
- package/dist/modules/assethandler/index.js +2 -2
- package/dist/modules/atheletebridge/index.cjs +35 -21
- package/dist/modules/atheletebridge/index.js +33 -19
- package/dist/modules/auth/index.cjs +37 -37
- package/dist/modules/auth/index.js +33 -29
- package/dist/modules/billing/index.cjs +1 -1
- package/dist/modules/billing/index.js +2 -2
- package/dist/modules/brainyrich/index.cjs +44 -28
- package/dist/modules/brainyrich/index.js +47 -31
- package/dist/modules/buildmyiq/index.cjs +64 -67
- package/dist/modules/buildmyiq/index.js +60 -63
- package/dist/modules/channels/index.cjs +3 -3
- package/dist/modules/channels/index.js +2 -2
- package/dist/modules/collabkin/index.cjs +4 -4
- package/dist/modules/collabkin/index.js +2 -2
- package/dist/modules/comradecircle/index.cjs +24 -16
- package/dist/modules/comradecircle/index.js +20 -12
- package/dist/modules/conversations/index.cjs +7 -7
- package/dist/modules/conversations/index.js +2 -2
- package/dist/modules/coolandlovely/index.cjs +28 -15
- package/dist/modules/coolandlovely/index.js +30 -17
- package/dist/modules/cosmicintersection/index.cjs +6 -6
- package/dist/modules/cosmicintersection/index.js +2 -2
- package/dist/modules/crewfoundry/index.js +2 -2
- package/dist/modules/devportal/index.cjs +2 -2
- package/dist/modules/devportal/index.js +2 -2
- package/dist/modules/ecoimpacthub/index.cjs +23 -13
- package/dist/modules/ecoimpacthub/index.js +20 -10
- package/dist/modules/eventfullymanaged/index.cjs +74 -74
- package/dist/modules/eventfullymanaged/index.js +78 -78
- package/dist/modules/export/index.cjs +4 -4
- package/dist/modules/export/index.js +2 -2
- package/dist/modules/files/index.cjs +3 -3
- package/dist/modules/files/index.js +4 -4
- package/dist/modules/fluidgrids/index.cjs +16 -16
- package/dist/modules/fluidgrids/index.js +3 -3
- package/dist/modules/ggnomad/index.cjs +4 -4
- package/dist/modules/ggnomad/index.js +2 -2
- package/dist/modules/govcitizenhub/index.cjs +10 -7
- package/dist/modules/govcitizenhub/index.js +8 -5
- package/dist/modules/groups/index.cjs +4 -4
- package/dist/modules/groups/index.js +2 -2
- package/dist/modules/headshotmarketing/index.js +2 -2
- package/dist/modules/hookmovies/index.cjs +6 -6
- package/dist/modules/hookmovies/index.js +2 -2
- package/dist/modules/housingvista/index.cjs +3 -3
- package/dist/modules/housingvista/index.js +2 -2
- package/dist/modules/integrations/index.cjs +5 -5
- package/dist/modules/integrations/index.js +2 -2
- package/dist/modules/intelwatchtower/index.cjs +28 -16
- package/dist/modules/intelwatchtower/index.js +25 -13
- package/dist/modules/kadaikodi/index.cjs +2 -2
- package/dist/modules/kadaikodi/index.js +2 -2
- package/dist/modules/labsofscience/index.cjs +10 -6
- package/dist/modules/labsofscience/index.js +9 -5
- package/dist/modules/manufacturedops/index.cjs +35 -22
- package/dist/modules/manufacturedops/index.js +35 -22
- package/dist/modules/movethewheels/index.js +2 -2
- package/dist/modules/notifications/index.cjs +2 -2
- package/dist/modules/notifications/index.js +2 -2
- package/dist/modules/organizations/index.js +2 -2
- package/dist/modules/planmagnet/index.cjs +21 -21
- package/dist/modules/planmagnet/index.js +32 -32
- package/dist/modules/products/index.cjs +4 -4
- package/dist/modules/products/index.js +2 -2
- package/dist/modules/proserviceworld/index.cjs +18 -13
- package/dist/modules/proserviceworld/index.js +18 -13
- package/dist/modules/rbac/index.js +2 -2
- package/dist/modules/sandbox/index.cjs +17 -17
- package/dist/modules/sandbox/index.js +1 -1
- package/dist/modules/scheduler/index.cjs +2 -2
- package/dist/modules/scheduler/index.js +2 -2
- package/dist/modules/security/index.cjs +3 -3
- package/dist/modules/security/index.js +2 -2
- package/dist/modules/semanticfed/index.cjs +3 -3
- package/dist/modules/semanticfed/index.js +2 -2
- package/dist/modules/store/index.cjs +3 -3
- package/dist/modules/store/index.js +2 -2
- package/dist/modules/subscriberbot/index.cjs +43 -19
- package/dist/modules/subscriberbot/index.js +47 -23
- package/dist/modules/support/index.cjs +2 -2
- package/dist/modules/support/index.js +2 -2
- package/dist/modules/tags/index.js +2 -2
- package/dist/modules/technospam/index.cjs +18 -9
- package/dist/modules/technospam/index.js +18 -9
- package/dist/modules/theculturepost/index.cjs +27 -22
- package/dist/modules/theculturepost/index.js +32 -27
- package/dist/modules/theglobalfuel/index.cjs +65 -60
- package/dist/modules/theglobalfuel/index.js +65 -60
- package/dist/modules/timecampus/index.js +2 -2
- package/dist/modules/tours/index.cjs +2 -2
- package/dist/modules/tours/index.js +2 -2
- package/dist/modules/vibecontrols/index.cjs +563 -567
- package/dist/modules/vibecontrols/index.js +5 -4
- package/dist/modules/workspaces/index.cjs +4 -4
- package/dist/modules/workspaces/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-W4JZR7RJ.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var g=class extends Error{exitCode;hint;constructor(o,n){super(o),this.name="CliUserError",this.exitCode=n?.exitCode??1,this.hint=n?.hint;}},m=class extends g{constructor(o,n){super(o,{exitCode:2,hint:n?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},l=class extends Error{cause;constructor(o,n){super(o),this.name="CliInternalError",this.cause=n;}};var h=null;function
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var g=class extends Error{exitCode;hint;constructor(o,n){super(o),this.name="CliUserError",this.exitCode=n?.exitCode??1,this.hint=n?.hint;}},m=class extends g{constructor(o,n){super(o,{exitCode:2,hint:n?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},l=class extends Error{cause;constructor(o,n){super(o),this.name="CliInternalError",this.cause=n;}};var h=null;function y(r){h=r;}function f(){if(!h)throw new l("vibecontrols module helpers used before setHelpersContext was called");return h}function fe(){let r=f();if(!r.auth.isAuthenticated())throw new m("Authentication required.",{hint:`Run \`${r.productName} auth login\` to authenticate.`})}async function s(r,o){return fe(),f().gql.workspace.request(r,o)}function a(r){let o=r instanceof Error?r.message:String(r);throw new g(o)}function d(r,o,n){f().output.formatAndOutput(r,o,n);}function c(r){f().output.printSuccess(r);}function w(r){return f().output.formatDate(r)}function I(r,o){return f().output.truncate(r,o)}function k(){return f()}var A=`
|
|
2
2
|
query ListConversations($filter: ConversationFilter, $first: Int, $after: String) {
|
|
3
3
|
conversations(filter: $filter, first: $first, after: $after) {
|
|
4
4
|
edges { node { id title type description createdAt updatedAt unreadCount } }
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
mutation DeleteConversation($id: ID!) {
|
|
23
23
|
deleteConversation(id: $id) { success }
|
|
24
24
|
}
|
|
25
|
-
`,
|
|
25
|
+
`,b=`
|
|
26
26
|
mutation UpdateConversation($input: UpdateConversationInput!) {
|
|
27
27
|
updateConversation(input: $input) {
|
|
28
28
|
conversation { id title description }
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
`,
|
|
31
|
+
`,R=`
|
|
32
32
|
mutation SendMessage($input: SendMessageInput!) {
|
|
33
33
|
sendMessage(input: $input) {
|
|
34
34
|
message { id content type createdAt }
|
|
@@ -103,15 +103,15 @@
|
|
|
103
103
|
mutation LeaveConversation($conversationId: ID!) {
|
|
104
104
|
leaveConversation(conversationId: $conversationId) { success conversationId }
|
|
105
105
|
}
|
|
106
|
-
`,
|
|
106
|
+
`,B=`
|
|
107
107
|
mutation ArchiveConversation($id: ID!) {
|
|
108
108
|
archiveConversation(id: $id) { id state }
|
|
109
109
|
}
|
|
110
|
-
`,
|
|
110
|
+
`,z=`
|
|
111
111
|
mutation UnarchiveConversation($id: ID!) {
|
|
112
112
|
unarchiveConversation(id: $id) { id state }
|
|
113
113
|
}
|
|
114
|
-
`,
|
|
114
|
+
`,K=`
|
|
115
115
|
mutation MuteConversation($conversationId: ID!, $until: DateTime) {
|
|
116
116
|
muteConversation(conversationId: $conversationId, until: $until) {
|
|
117
117
|
id conversationId userId
|
|
@@ -152,4 +152,4 @@
|
|
|
152
152
|
conversation { id title type }
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
`;function ne(r){let o=r.command("conversations").description("Conversation management");o.command("list").description("List conversations").option("--type <t>","Filter by type (DIRECT|GROUP|CHANNEL)").option("--limit <n>","Page size",n=>parseInt(n,10),50).option("-f, --format <format>").action(async n=>{try{let e={};n.type&&(e.type=n.type.toUpperCase());let i=(await s(A,{filter:Object.keys(e).length?e:void 0,first:n.limit})).conversations.edges.map(p=>p.node);d(n,i,{headers:["ID","Title","Type","Unread","Created"],rows:i.map(p=>[I(p.id,12),p.title??"-",p.type??"-",String(p.unreadCount??0),w(p.createdAt)])});}catch(e){a(e);}}),o.command("get").description("Get a conversation").argument("<id>").option("-f, --format <format>").action(async(n,e)=>{try{let t=await s(T,{id:n});if(!t.conversation)throw new g(`Conversation ${n} not found`);d(e,t.conversation);}catch(t){a(t);}}),o.command("create").description("Create a conversation").requiredOption("--title <s>").requiredOption("--participants <ids>","Comma-separated participant userIds (required by schema)").option("--description <s>").option("--type <t>","DIRECT|GROUP|CHANNEL","GROUP").option("-f, --format <format>").action(async n=>{try{let e=k().auth.read();if(!e?.workspaceId)throw new g("No workspace set. Run: vibecontrols workspace set <id>");let t={title:n.title,description:n.description,type:(n.type??"GROUP").toUpperCase(),participantIds:n.participants.split(","),workspaceId:e.workspaceId},i=await s(O,{input:t});c("Conversation created"),d(n,i.createConversation.conversation);}catch(e){a(e);}}),o.command("update").description("Update a conversation").argument("<id>").option("--title <s>").option("--description <s>").option("-f, --format <format>").action(async(n,e)=>{try{let t={id:n};if(e.title&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),Object.keys(t).length===1)throw new g("No updates specified");let i=await s(
|
|
155
|
+
`;function ne(r){let o=r.command("conversations").description("Conversation management");o.command("list").description("List conversations").option("--type <t>","Filter by type (DIRECT|GROUP|CHANNEL)").option("--limit <n>","Page size",n=>parseInt(n,10),50).option("-f, --format <format>").action(async n=>{try{let e={};n.type&&(e.type=n.type.toUpperCase());let i=(await s(A,{filter:Object.keys(e).length?e:void 0,first:n.limit})).conversations.edges.map(p=>p.node);d(n,i,{headers:["ID","Title","Type","Unread","Created"],rows:i.map(p=>[I(p.id,12),p.title??"-",p.type??"-",String(p.unreadCount??0),w(p.createdAt)])});}catch(e){a(e);}}),o.command("get").description("Get a conversation").argument("<id>").option("-f, --format <format>").action(async(n,e)=>{try{let t=await s(T,{id:n});if(!t.conversation)throw new g(`Conversation ${n} not found`);d(e,t.conversation);}catch(t){a(t);}}),o.command("create").description("Create a conversation").requiredOption("--title <s>").requiredOption("--participants <ids>","Comma-separated participant userIds (required by schema)").option("--description <s>").option("--type <t>","DIRECT|GROUP|CHANNEL","GROUP").option("-f, --format <format>").action(async n=>{try{let e=k().auth.read();if(!e?.workspaceId)throw new g("No workspace set. Run: vibecontrols workspace set <id>");let t={title:n.title,description:n.description,type:(n.type??"GROUP").toUpperCase(),participantIds:n.participants.split(","),workspaceId:e.workspaceId},i=await s(O,{input:t});c("Conversation created"),d(n,i.createConversation.conversation);}catch(e){a(e);}}),o.command("update").description("Update a conversation").argument("<id>").option("--title <s>").option("--description <s>").option("-f, --format <format>").action(async(n,e)=>{try{let t={id:n};if(e.title&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),Object.keys(t).length===1)throw new g("No updates specified");let i=await s(b,{input:t});c("Conversation updated"),d(e,i.updateConversation.conversation);}catch(t){a(t);}}),o.command("delete").description("Delete a conversation").argument("<id>").action(async n=>{try{await s(S,{id:n}),c("Conversation deleted");}catch(e){a(e);}}),o.command("send").description("Send a message to a conversation").argument("<conversationId>").requiredOption("--content <text>").option("--parent <messageId>","Reply parent").option("-f, --format <format>").action(async(n,e)=>{try{let t={conversationId:n,content:{text:e.content},type:"TEXT",parentMessageId:e.parent},i=await s(R,{input:t});c("Message sent"),d(e,i.sendMessage.message);}catch(t){a(t);}}),Ie(o),ve(o),Ce(o),he(o),we(o),Ee(o);}function Ie(r){let o=r.command("messages").description("Message operations");o.command("edit").description("Edit a message").argument("<id>").requiredOption("--content <text>").option("--reason <s>").option("-f, --format <format>").action(async(n,e)=>{try{let t={id:n,content:{text:e.content}};e.reason&&(t.reason=e.reason);let i=await s(N,{input:t});c("Message edited"),d(e,i.editMessage);}catch(t){a(t);}}),o.command("delete").description("Delete a message").argument("<id>").option("--hard","Hard delete (default: soft)").action(async(n,e)=>{try{await s(D,{id:n,hard:e.hard??!1}),c("Message deleted");}catch(t){a(t);}}),o.command("forward").description("Forward a message to another conversation").argument("<messageId>").requiredOption("--to <targetConversationId>").option("-f, --format <format>").action(async(n,e)=>{try{let t=await s($,{messageId:n,targetConversationId:e.to});c("Message forwarded"),d(e,t.forwardMessage.message);}catch(t){a(t);}}),o.command("pin").description("Pin a message").argument("<messageId>").action(async n=>{try{await s(P,{messageId:n}),c("Message pinned");}catch(e){a(e);}}),o.command("unpin").description("Unpin a message").argument("<messageId>").action(async n=>{try{await s(_,{messageId:n}),c("Message unpinned");}catch(e){a(e);}}),o.command("search").description("Search messages").requiredOption("--query <s>").option("--conversation <id>","Restrict to a conversation").option("--limit <n>","Page size",n=>parseInt(n,10),50).option("-f, --format <format>").action(async n=>{try{let t=(await s(M,{query:n.query,conversationId:n.conversation,first:n.limit})).searchMessages.edges.map(i=>i.node);d(n,t,{headers:["ID","Conversation","Author","Created"],rows:t.map(i=>[I(i.id,12),I(i.conversationId??"-",12),I(i.authorId??"-",12),w(i.createdAt)])});}catch(e){a(e);}});}function ve(r){let o=r.command("drafts").description("Draft message operations");o.command("get").description("Get the actor\u2019s draft for a conversation").argument("<conversationId>").option("-f, --format <format>").action(async(n,e)=>{try{let t=await s(L,{conversationId:n});if(!t.draft){c("No draft saved");return}d(e,t.draft);}catch(t){a(t);}}),o.command("save").description("Save (upsert) a draft for a conversation").argument("<conversationId>").requiredOption("--content <text>").option("--parent <messageId>").option("-f, --format <format>").action(async(n,e)=>{try{let t={conversationId:n,content:{text:e.content}};e.parent&&(t.parentMessageId=e.parent);let i=await s(q,{input:t});c("Draft saved"),d(e,i.saveDraft);}catch(t){a(t);}}),o.command("delete").description("Delete the actor\u2019s draft for a conversation").argument("<conversationId>").action(async n=>{try{await s(U,{conversationId:n}),c("Draft deleted");}catch(e){a(e);}});}function Ce(r){let o=r.command("reactions").description("Reaction operations");o.command("add").description("Add an emoji reaction to a message").argument("<messageId>").requiredOption("--emoji <e>").option("-f, --format <format>").action(async(n,e)=>{try{let t=await s(V,{messageId:n,emoji:e.emoji});c("Reaction added"),d(e,t.addReaction);}catch(t){a(t);}}),o.command("remove").description("Remove an emoji reaction from a message").argument("<messageId>").requiredOption("--emoji <e>").action(async(n,e)=>{try{await s(G,{messageId:n,emoji:e.emoji}),c("Reaction removed");}catch(t){a(t);}});}function he(r){let o=r.command("participants").description("Participant operations");o.command("add").description("Add a participant to a conversation").argument("<conversationId>").requiredOption("--user <userId>").option("--role <role>","ADMIN | MODERATOR | MEMBER | GUEST").option("-f, --format <format>").action(async(n,e)=>{try{let t={conversationId:n,userId:e.user};e.role&&(t.role=e.role.toUpperCase());let i=await s(j,{input:t});c("Participant added"),d(e,i.addParticipant);}catch(t){a(t);}}),o.command("remove").description("Remove a participant from a conversation").argument("<conversationId>").requiredOption("--user <userId>").option("--reason <s>").action(async(n,e)=>{try{let t={conversationId:n,userId:e.user};e.reason&&(t.reason=e.reason),await s(F,{input:t}),c("Participant removed");}catch(t){a(t);}}),o.command("role").description("Update a participant\u2019s role").argument("<conversationId>").requiredOption("--user <userId>").requiredOption("--role <role>","ADMIN | MODERATOR | MEMBER | GUEST").action(async(n,e)=>{try{await s(W,{input:{conversationId:n,userId:e.user,role:e.role.toUpperCase()}}),c("Participant role updated");}catch(t){a(t);}});}function we(r){let o=(e,t,i,p)=>{r.command(e).description(t).argument("<id>").action(async v=>{try{await s(i,{id:v}),c(p);}catch(C){a(C);}});},n=(e,t,i,p)=>{r.command(e).description(t).argument("<conversationId>").action(async v=>{try{await s(i,{conversationId:v}),c(p);}catch(C){a(C);}});};o("archive","Archive a conversation",B,"Archived"),o("unarchive","Unarchive a conversation",z,"Unarchived"),r.command("mute").description("Mute a conversation").argument("<conversationId>").option("--until <iso>","ISO timestamp; omit for indefinite").action(async(e,t)=>{try{await s(K,{conversationId:e,until:t.until}),c("Muted");}catch(i){a(i);}}),n("unmute","Unmute a conversation",J,"Unmuted"),n("pin","Pin a conversation",Y,"Pinned"),n("unpin","Unpin a conversation",Q,"Unpinned"),r.command("read").description("Mark a conversation as read").argument("<conversationId>").option("--message <messageId>","Mark read up to this message (defaults to latest)").action(async(e,t)=>{try{await s(X,{conversationId:e,messageId:t.message}),c("Marked as read");}catch(i){a(i);}}),n("leave","Leave a conversation",H,"Left conversation");}function Ee(r){let o=r.command("invites").description("Invite link operations");o.command("create").description("Create an invite link for a conversation").argument("<conversationId>").option("--max-uses <n>","Maximum number of uses",n=>parseInt(n,10)).option("--expires-at <iso>","ISO expiry timestamp").option("-f, --format <format>").action(async(n,e)=>{try{let t={conversationId:n};e.maxUses!==void 0&&(t.maxUses=e.maxUses),e.expiresAt&&(t.expiresAt=e.expiresAt);let i=await s(Z,{input:t});c("Invite link created"),d(e,i.createInviteLink);}catch(t){a(t);}}),o.command("join").description("Join a conversation via invite code").argument("<code>").action(async n=>{try{await s(ee,{code:n}),c("Joined via invite link");}catch(e){a(e);}}),o.command("validate").description("Validate an invite code").argument("<code>").option("-f, --format <format>").action(async(n,e)=>{try{let t=await s(te,{code:n});d(e,t.validateInviteLink);}catch(t){a(t);}});}var xe={id:"conversations",version:"1.0.0",displayName:"Conversations",dependsOn:["auth","workspaces"],register(r,o){y(o),ne(r);}},Dt=xe;module.exports=Dt;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a,b as b$1,h as h$1,
|
|
1
|
+
import {a,b as b$1,i,r,q as q$1,h as h$1,u,k as k$1}from'../../chunk-O6UCQ5IT.js';import {o}from'../../chunk-YIY5IDXQ.js';var l=`
|
|
2
2
|
query ListConversations($filter: ConversationFilter, $first: Int, $after: String) {
|
|
3
3
|
conversations(filter: $filter, first: $first, after: $after) {
|
|
4
4
|
edges { node { id title type description createdAt updatedAt unreadCount } }
|
|
@@ -152,4 +152,4 @@ import {a,b as b$1,h as h$1,p,o,g,s,i}from'../../chunk-W4JZR7RJ.js';import {o as
|
|
|
152
152
|
conversation { id title type }
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
`;function Q(d){let o$
|
|
155
|
+
`;function Q(d){let o$1=d.command("conversations").description("Conversation management");o$1.command("list").description("List conversations").option("--type <t>","Filter by type (DIRECT|GROUP|CHANNEL)").option("--limit <n>","Page size",n=>parseInt(n,10),50).option("-f, --format <format>").action(async n=>{try{let t={};n.type&&(t.type=n.type.toUpperCase());let i$1=(await b$1(l,{filter:Object.keys(t).length?t:void 0,first:n.limit})).conversations.edges.map(p=>p.node);i(n,i$1,{headers:["ID","Title","Type","Unread","Created"],rows:i$1.map(p=>[r(p.id,12),p.title??"-",p.type??"-",String(p.unreadCount??0),q$1(p.createdAt)])});}catch(t){h$1(t);}}),o$1.command("get").description("Get a conversation").argument("<id>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(R,{id:n});if(!e.conversation)throw new o(`Conversation ${n} not found`);i(t,e.conversation);}catch(e){h$1(e);}}),o$1.command("create").description("Create a conversation").requiredOption("--title <s>").requiredOption("--participants <ids>","Comma-separated participant userIds (required by schema)").option("--description <s>").option("--type <t>","DIRECT|GROUP|CHANNEL","GROUP").option("-f, --format <format>").action(async n=>{try{let t=u().auth.read();if(!t?.workspaceId)throw new o("No workspace set. Run: vibecontrols workspace set <id>");let e={title:n.title,description:n.description,type:(n.type??"GROUP").toUpperCase(),participantIds:n.participants.split(","),workspaceId:t.workspaceId},i$1=await b$1(N,{input:e});k$1("Conversation created"),i(n,i$1.createConversation.conversation);}catch(t){h$1(t);}}),o$1.command("update").description("Update a conversation").argument("<id>").option("--title <s>").option("--description <s>").option("-f, --format <format>").action(async(n,t)=>{try{let e={id:n};if(t.title&&(e.title=t.title),t.description!==void 0&&(e.description=t.description),Object.keys(e).length===1)throw new o("No updates specified");let i$1=await b$1(T,{input:e});k$1("Conversation updated"),i(t,i$1.updateConversation.conversation);}catch(e){h$1(e);}}),o$1.command("delete").description("Delete a conversation").argument("<id>").action(async n=>{try{await b$1(y,{id:n}),k$1("Conversation deleted");}catch(t){h$1(t);}}),o$1.command("send").description("Send a message to a conversation").argument("<conversationId>").requiredOption("--content <text>").option("--parent <messageId>","Reply parent").option("-f, --format <format>").action(async(n,t)=>{try{let e={conversationId:n,content:{text:t.content},type:"TEXT",parentMessageId:t.parent},i$1=await b$1(O,{input:e});k$1("Message sent"),i(t,i$1.sendMessage.message);}catch(e){h$1(e);}}),Z(o$1),tt(o$1),et(o$1),nt(o$1),ot(o$1),it(o$1);}function Z(d){let o=d.command("messages").description("Message operations");o.command("edit").description("Edit a message").argument("<id>").requiredOption("--content <text>").option("--reason <s>").option("-f, --format <format>").action(async(n,t)=>{try{let e={id:n,content:{text:t.content}};t.reason&&(e.reason=t.reason);let i$1=await b$1(S,{input:e});k$1("Message edited"),i(t,i$1.editMessage);}catch(e){h$1(e);}}),o.command("delete").description("Delete a message").argument("<id>").option("--hard","Hard delete (default: soft)").action(async(n,t)=>{try{await b$1($,{id:n,hard:t.hard??!1}),k$1("Message deleted");}catch(e){h$1(e);}}),o.command("forward").description("Forward a message to another conversation").argument("<messageId>").requiredOption("--to <targetConversationId>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(D,{messageId:n,targetConversationId:t.to});k$1("Message forwarded"),i(t,e.forwardMessage.message);}catch(e){h$1(e);}}),o.command("pin").description("Pin a message").argument("<messageId>").action(async n=>{try{await b$1(M,{messageId:n}),k$1("Message pinned");}catch(t){h$1(t);}}),o.command("unpin").description("Unpin a message").argument("<messageId>").action(async n=>{try{await b$1(_,{messageId:n}),k$1("Message unpinned");}catch(t){h$1(t);}}),o.command("search").description("Search messages").requiredOption("--query <s>").option("--conversation <id>","Restrict to a conversation").option("--limit <n>","Page size",n=>parseInt(n,10),50).option("-f, --format <format>").action(async n=>{try{let e=(await b$1(h,{query:n.query,conversationId:n.conversation,first:n.limit})).searchMessages.edges.map(i=>i.node);i(n,e,{headers:["ID","Conversation","Author","Created"],rows:e.map(i=>[r(i.id,12),r(i.conversationId??"-",12),r(i.authorId??"-",12),q$1(i.createdAt)])});}catch(t){h$1(t);}});}function tt(d){let o=d.command("drafts").description("Draft message operations");o.command("get").description("Get the actor\u2019s draft for a conversation").argument("<conversationId>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(x,{conversationId:n});if(!e.draft){k$1("No draft saved");return}i(t,e.draft);}catch(e){h$1(e);}}),o.command("save").description("Save (upsert) a draft for a conversation").argument("<conversationId>").requiredOption("--content <text>").option("--parent <messageId>").option("-f, --format <format>").action(async(n,t)=>{try{let e={conversationId:n,content:{text:t.content}};t.parent&&(e.parentMessageId=t.parent);let i$1=await b$1(w,{input:e});k$1("Draft saved"),i(t,i$1.saveDraft);}catch(e){h$1(e);}}),o.command("delete").description("Delete the actor\u2019s draft for a conversation").argument("<conversationId>").action(async n=>{try{await b$1(P,{conversationId:n}),k$1("Draft deleted");}catch(t){h$1(t);}});}function et(d){let o=d.command("reactions").description("Reaction operations");o.command("add").description("Add an emoji reaction to a message").argument("<messageId>").requiredOption("--emoji <e>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(V,{messageId:n,emoji:t.emoji});k$1("Reaction added"),i(t,e.addReaction);}catch(e){h$1(e);}}),o.command("remove").description("Remove an emoji reaction from a message").argument("<messageId>").requiredOption("--emoji <e>").action(async(n,t)=>{try{await b$1(U,{messageId:n,emoji:t.emoji}),k$1("Reaction removed");}catch(e){h$1(e);}});}function nt(d){let o=d.command("participants").description("Participant operations");o.command("add").description("Add a participant to a conversation").argument("<conversationId>").requiredOption("--user <userId>").option("--role <role>","ADMIN | MODERATOR | MEMBER | GUEST").option("-f, --format <format>").action(async(n,t)=>{try{let e={conversationId:n,userId:t.user};t.role&&(e.role=t.role.toUpperCase());let i$1=await b$1(k,{input:e});k$1("Participant added"),i(t,i$1.addParticipant);}catch(e){h$1(e);}}),o.command("remove").description("Remove a participant from a conversation").argument("<conversationId>").requiredOption("--user <userId>").option("--reason <s>").action(async(n,t)=>{try{let e={conversationId:n,userId:t.user};t.reason&&(e.reason=t.reason),await b$1(L,{input:e}),k$1("Participant removed");}catch(e){h$1(e);}}),o.command("role").description("Update a participant\u2019s role").argument("<conversationId>").requiredOption("--user <userId>").requiredOption("--role <role>","ADMIN | MODERATOR | MEMBER | GUEST").action(async(n,t)=>{try{await b$1(G,{input:{conversationId:n,userId:t.user,role:t.role.toUpperCase()}}),k$1("Participant role updated");}catch(e){h$1(e);}});}function ot(d){let o=(t,e,i,p)=>{d.command(t).description(e).argument("<id>").action(async I=>{try{await b$1(i,{id:I}),k$1(p);}catch(g){h$1(g);}});},n=(t,e,i,p)=>{d.command(t).description(e).argument("<conversationId>").action(async I=>{try{await b$1(i,{conversationId:I}),k$1(p);}catch(g){h$1(g);}});};o("archive","Archive a conversation",j,"Archived"),o("unarchive","Unarchive a conversation",b,"Unarchived"),d.command("mute").description("Mute a conversation").argument("<conversationId>").option("--until <iso>","ISO timestamp; omit for indefinite").action(async(t,e)=>{try{await b$1(F,{conversationId:t,until:e.until}),k$1("Muted");}catch(i){h$1(i);}}),n("unmute","Unmute a conversation",H,"Unmuted"),n("pin","Pin a conversation",K,"Pinned"),n("unpin","Unpin a conversation",J,"Unpinned"),d.command("read").description("Mark a conversation as read").argument("<conversationId>").option("--message <messageId>","Mark read up to this message (defaults to latest)").action(async(t,e)=>{try{await b$1(B,{conversationId:t,messageId:e.message}),k$1("Marked as read");}catch(i){h$1(i);}}),n("leave","Leave a conversation",q,"Left conversation");}function it(d){let o=d.command("invites").description("Invite link operations");o.command("create").description("Create an invite link for a conversation").argument("<conversationId>").option("--max-uses <n>","Maximum number of uses",n=>parseInt(n,10)).option("--expires-at <iso>","ISO expiry timestamp").option("-f, --format <format>").action(async(n,t)=>{try{let e={conversationId:n};t.maxUses!==void 0&&(e.maxUses=t.maxUses),t.expiresAt&&(e.expiresAt=t.expiresAt);let i$1=await b$1(W,{input:e});k$1("Invite link created"),i(t,i$1.createInviteLink);}catch(e){h$1(e);}}),o.command("join").description("Join a conversation via invite code").argument("<code>").action(async n=>{try{await b$1(z,{code:n}),k$1("Joined via invite link");}catch(t){h$1(t);}}),o.command("validate").description("Validate an invite code").argument("<code>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(X,{code:n});i(t,e.validateInviteLink);}catch(e){h$1(e);}});}var at={id:"conversations",version:"1.0.0",displayName:"Conversations",dependsOn:["auth","workspaces"],register(d,o){a(o),Q(d);}},ut=at;export{ut as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var d=class extends Error{exitCode;hint;constructor(n,t){super(n),this.name="CliUserError",this.exitCode=t?.exitCode??1,this.hint=t?.hint;}},y=class extends d{constructor(n,t){super(n,{exitCode:2,hint:t?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},C=class extends Error{cause;constructor(n,t){super(n),this.name="CliInternalError",this.cause=t;}};var h=null;function
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var d=class extends Error{exitCode;hint;constructor(n,t){super(n),this.name="CliUserError",this.exitCode=t?.exitCode??1,this.hint=t?.hint;}},y=class extends d{constructor(n,t){super(n,{exitCode:2,hint:t?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},C=class extends Error{cause;constructor(n,t){super(n),this.name="CliInternalError",this.cause=t;}};var h=null;function O(r){h=r;}function b(){if(!h)throw new C("vibecontrols module helpers used before setHelpersContext was called");return h}function Dt(){let r=b();if(!r.auth.isAuthenticated())throw new y("Authentication required.",{hint:`Run \`${r.productName} auth login\` to authenticate.`})}async function a(r,n){return Dt(),b().gql.workspace.request(r,n)}async function w(r,n){return b().gql.workspaceAuthOnly.request(r,n)}function i(r){let n=r instanceof Error?r.message:String(r);throw new d(n)}function s(r,n,t){b().output.formatAndOutput(r,n,t);}function c(r){b().output.printSuccess(r);}function p(r,n){return b().output.truncate(r,n)}var A=`
|
|
2
2
|
query CooGetBrand($id: ID!) {
|
|
3
3
|
cooBrand(id: $id) {
|
|
4
4
|
id name handle tagline bio status isFeatured aesthetics tags websiteUrl
|
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
`,$=`
|
|
49
49
|
query CooListCollections($brandId: ID, $status: CooCollectionStatus) {
|
|
50
50
|
cooListCollections(brandId: $brandId, status: $status) {
|
|
51
|
-
id name description season status brandId tags publishAt endAt createdAt
|
|
51
|
+
items { id name description season status brandId tags publishAt endAt createdAt }
|
|
52
|
+
pageInfo { cursor hasMore }
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
55
|
`,P=`
|
|
@@ -126,8 +127,11 @@
|
|
|
126
127
|
`,G=`
|
|
127
128
|
query CooListCollaborations($brandId: ID, $creatorId: ID, $status: CooCollaborationStatus) {
|
|
128
129
|
cooListCollaborations(brandId: $brandId, creatorId: $creatorId, status: $status) {
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
items {
|
|
131
|
+
id title status role brandId creatorId compensation currency startDate endDate
|
|
132
|
+
createdAt
|
|
133
|
+
}
|
|
134
|
+
pageInfo { cursor hasMore }
|
|
131
135
|
}
|
|
132
136
|
}
|
|
133
137
|
`,z=`
|
|
@@ -146,9 +150,11 @@
|
|
|
146
150
|
`,H=`
|
|
147
151
|
query CooGetLook($id: ID!) {
|
|
148
152
|
cooLook(id: $id) {
|
|
149
|
-
id title caption occasion visibility isFeatured likeCount saveCount
|
|
150
|
-
|
|
151
|
-
|
|
153
|
+
id title caption occasion visibility isFeatured likeCount saveCount authorId
|
|
154
|
+
collaborationId
|
|
155
|
+
image { id }
|
|
156
|
+
tags publishedAt
|
|
157
|
+
items { items { id styleItemId position styling } pageInfo { cursor hasMore } }
|
|
152
158
|
createdAt updatedAt workspaceId
|
|
153
159
|
}
|
|
154
160
|
}
|
|
@@ -175,8 +181,9 @@
|
|
|
175
181
|
`,V=`
|
|
176
182
|
mutation CooCreateLook($input: CooCreateLookInput!) {
|
|
177
183
|
cooCreateLook(input: $input) {
|
|
178
|
-
id title caption occasion visibility isFeatured authorId collaborationId
|
|
179
|
-
|
|
184
|
+
id title caption occasion visibility isFeatured authorId collaborationId tags
|
|
185
|
+
items { items { id styleItemId position styling } pageInfo { cursor hasMore } }
|
|
186
|
+
createdAt
|
|
180
187
|
}
|
|
181
188
|
}
|
|
182
189
|
`,Y=`
|
|
@@ -204,15 +211,18 @@
|
|
|
204
211
|
`,Z=`
|
|
205
212
|
query CooGetLookbook($id: ID!) {
|
|
206
213
|
cooLookbook(id: $id) {
|
|
207
|
-
id name description visibility ownerId profileId
|
|
208
|
-
|
|
214
|
+
id name description visibility ownerId profileId
|
|
215
|
+
cover { id }
|
|
216
|
+
tags
|
|
217
|
+
entries { items { id lookId styleItemId note position } pageInfo { cursor hasMore } }
|
|
209
218
|
createdAt updatedAt workspaceId
|
|
210
219
|
}
|
|
211
220
|
}
|
|
212
221
|
`,tt=`
|
|
213
222
|
query CooListLookbooks($ownerId: ID) {
|
|
214
223
|
cooListLookbooks(ownerId: $ownerId) {
|
|
215
|
-
id name description visibility ownerId profileId tags createdAt
|
|
224
|
+
items { id name description visibility ownerId profileId tags createdAt }
|
|
225
|
+
pageInfo { cursor hasMore }
|
|
216
226
|
}
|
|
217
227
|
}
|
|
218
228
|
`,ot=`
|
|
@@ -234,8 +244,11 @@
|
|
|
234
244
|
`,rt=`
|
|
235
245
|
query CooListWardrobeItems($category: CooStyleCategory, $source: CooWardrobeSource) {
|
|
236
246
|
cooListWardrobeItems(category: $category, source: $source) {
|
|
237
|
-
|
|
238
|
-
|
|
247
|
+
items {
|
|
248
|
+
id name brandName category colour size source styleItemId timesWorn lastWornAt tags
|
|
249
|
+
createdAt
|
|
250
|
+
}
|
|
251
|
+
pageInfo { cursor hasMore }
|
|
239
252
|
}
|
|
240
253
|
}
|
|
241
254
|
`,it=`
|
|
@@ -279,4 +292,4 @@
|
|
|
279
292
|
query CooHealth {
|
|
280
293
|
cooHealth
|
|
281
294
|
}
|
|
282
|
-
`;function k(r,n){try{return JSON.parse(n)}catch{throw new d(`--${r} must be valid JSON`)}}function g(r){let n=Number.parseInt(r,10);if(Number.isNaN(n))throw new d(`Expected an integer but got "${r}"`);return n}function I(r){let n=Number.parseFloat(r);if(Number.isNaN(n))throw new d(`Expected a number but got "${r}"`);return n}function l(r){return r.split(",").map(n=>n.trim()).filter(n=>n.length>0)}function pt(r){let n=r.command("brands").description("Coolandlovely brand storefronts");n.command("list").description("List brand storefronts").option("--status <s>","Filter by brand status").option("--featured","Only featured brands").option("--limit <n>","Page size",g,50).option("--offset <n>","Offset",g,0).option("--cursor <c>","Pagination cursor").option("-f, --format <format>","Output format").action(async t=>{try{let o=await a(v,{status:t.status?t.status.toUpperCase():void 0,featured:t.featured?!0:void 0,pagination:{limit:t.limit,offset:t.offset,cursor:t.cursor}});s(t,o.cooListBrands.items,{headers:["ID","Name","Handle","Status","Featured"],rows:o.cooListBrands.items.map(e=>[p(e.id,12),e.name,e.handle,e.status,e.isFeatured?"yes":"no"])});}catch(o){i(o);}}),n.command("get").description("Get a brand by id").argument("<id>","Brand ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(A,{id:t});if(!e.cooBrand)throw new d(`Brand ${t} not found`);s(o,e.cooBrand);}catch(e){i(e);}}),n.command("create").description("Create a brand storefront").requiredOption("--name <name>","Brand name").requiredOption("--handle <handle>","Unique storefront handle").option("--tagline <s>","Tagline").option("--bio <s>","Bio").option("--website-url <url>","Website URL").option("--logo-file <id>","Logo File ID (wspace-files-svc)").option("--cover-file <id>","Cover File ID (wspace-files-svc)").option("--aesthetics <csv>","Comma-separated aesthetics").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let o={name:t.name,handle:t.handle};t.tagline&&(o.tagline=t.tagline),t.bio&&(o.bio=t.bio),t.websiteUrl&&(o.websiteUrl=t.websiteUrl),t.logoFile&&(o.logoFileId=t.logoFile),t.coverFile&&(o.coverFileId=t.coverFile),t.aesthetics&&(o.aesthetics=l(t.aesthetics)),t.tags&&(o.tags=l(t.tags));let e=await a(T,{input:o});c(`Brand created: ${e.cooCreateBrand.name}`),s(t,e.cooCreateBrand);}catch(o){i(o);}}),n.command("update").description("Update a brand storefront").argument("<id>","Brand ID").option("--name <name>","Brand name").option("--tagline <s>","Tagline").option("--bio <s>","Bio").option("--website-url <url>","Website URL").option("--logo-file <id>","Logo File ID").option("--cover-file <id>","Cover File ID").option("--featured <bool>","true|false",t=>t==="true").option("--aesthetics <csv>","Comma-separated aesthetics").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e={};if(o.name&&(e.name=o.name),o.tagline!==void 0&&(e.tagline=o.tagline),o.bio!==void 0&&(e.bio=o.bio),o.websiteUrl!==void 0&&(e.websiteUrl=o.websiteUrl),o.logoFile&&(e.logoFileId=o.logoFile),o.coverFile&&(e.coverFileId=o.coverFile),o.featured!==void 0&&(e.isFeatured=o.featured),o.aesthetics&&(e.aesthetics=l(o.aesthetics)),o.tags&&(e.tags=l(o.tags)),!Object.keys(e).length)throw new d("No updates specified");let m=await a(x,{id:t,input:e});c("Brand updated"),s(o,m.cooUpdateBrand);}catch(e){i(e);}}),n.command("transition").description("Advance a brand through its publish lifecycle").argument("<id>","Brand ID").requiredOption("--status <s>","DRAFT|PENDING_REVIEW|PUBLISHED|SUSPENDED|ARCHIVED").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(S,{id:t,status:o.status.toUpperCase()});c(`Brand status set to ${e.cooTransitionBrand.status}`),s(o,e.cooTransitionBrand);}catch(e){i(e);}}),n.command("archive").description("Archive a brand storefront").argument("<id>","Brand ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(R,{id:t});c(`Brand archived: ${e.cooArchiveBrand}`),s(o,{archived:e.cooArchiveBrand});}catch(e){i(e);}});}function mt(r){let n=r.command("collections").description("Coolandlovely seasonal collections");n.command("list").description("List collections").option("--brand <id>","Filter by brand ID").option("--status <s>","Filter by collection status").option("-f, --format <format>","Output format").action(async t=>{try{let o=await a($,{brandId:t.brand,status:t.status?t.status.toUpperCase():void 0});s(t,o.cooListCollections,{headers:["ID","Name","Season","Status","Brand"],rows:o.cooListCollections.map(e=>[p(e.id,12),e.name,e.season,e.status,p(e.brandId,12)])});}catch(o){i(o);}}),n.command("get").description("Get a collection by id").argument("<id>","Collection ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(D,{id:t});if(!e.cooCollection)throw new d(`Collection ${t} not found`);s(o,e.cooCollection);}catch(e){i(e);}}),n.command("create").description("Create a collection").requiredOption("--brand <id>","Brand ID").requiredOption("--name <name>","Collection name").option("--description <s>","Description").option("--season <s>","ALL_SEASON|SPRING|SUMMER|AUTUMN|WINTER|RESORT").option("--cover-file <id>","Cover File ID").option("--publish-at <iso>","Scheduled publish date (ISO 8601)").option("--end-at <iso>","End date (ISO 8601)").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let o={brandId:t.brand,name:t.name};t.description&&(o.description=t.description),t.season&&(o.season=t.season.toUpperCase()),t.coverFile&&(o.coverFileId=t.coverFile),t.publishAt&&(o.publishAt=t.publishAt),t.endAt&&(o.endAt=t.endAt),t.tags&&(o.tags=l(t.tags));let e=await a(P,{input:o});c(`Collection created: ${e.cooCreateCollection.name}`),s(t,e.cooCreateCollection);}catch(o){i(o);}}),n.command("update").description("Update a collection").argument("<id>","Collection ID").option("--name <name>","Collection name").option("--description <s>","Description").option("--season <s>","ALL_SEASON|SPRING|SUMMER|AUTUMN|WINTER|RESORT").option("--cover-file <id>","Cover File ID").option("--publish-at <iso>","Scheduled publish date (ISO 8601)").option("--end-at <iso>","End date (ISO 8601)").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e={};if(o.name&&(e.name=o.name),o.description!==void 0&&(e.description=o.description),o.season&&(e.season=o.season.toUpperCase()),o.coverFile&&(e.coverFileId=o.coverFile),o.publishAt&&(e.publishAt=o.publishAt),o.endAt&&(e.endAt=o.endAt),o.tags&&(e.tags=l(o.tags)),!Object.keys(e).length)throw new d("No updates specified");let m=await a(_,{id:t,input:e});c("Collection updated"),s(o,m.cooUpdateCollection);}catch(e){i(e);}}),n.command("publish").description("Publish a collection (go live)").argument("<id>","Collection ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(N,{id:t});c(`Collection published: ${e.cooPublishCollection.status}`),s(o,e.cooPublishCollection);}catch(e){i(e);}});}function gt(r){let n=r.command("style-items").description("Coolandlovely style items (catalog products)");n.command("list").description("List style items").option("--brand <id>","Filter by brand ID").option("--collection <id>","Filter by collection ID").option("--category <c>","Filter by category").option("--status <s>","Filter by status").option("--limit <n>","Page size",g,50).option("--offset <n>","Offset",g,0).option("--cursor <c>","Pagination cursor").option("-f, --format <format>","Output format").action(async t=>{try{let o=await a(U,{brandId:t.brand,collectionId:t.collection,category:t.category?t.category.toUpperCase():void 0,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset,cursor:t.cursor}});s(t,o.cooListStyleItems.items,{headers:["ID","Name","Category","Status","Price"],rows:o.cooListStyleItems.items.map(e=>[p(e.id,12),e.name,e.category,e.status,`${e.price} ${e.currency}`])});}catch(o){i(o);}}),n.command("get").description("Get a style item by id").argument("<id>","Style item ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(F,{id:t});if(!e.cooStyleItem)throw new d(`Style item ${t} not found`);s(o,e.cooStyleItem);}catch(e){i(e);}}),n.command("create").description("Create a style item").requiredOption("--brand <id>","Brand ID").requiredOption("--name <name>","Item name").option("--category <c>","Category").option("--collection <id>","Collection ID").option("--description <s>","Description").option("--sku <sku>","SKU").option("--price <n>","Price",I).option("--currency <c>","Currency code").option("--image-file <id>","Image File ID").option("--colours <csv>","Comma-separated colours").option("--sizes <csv>","Comma-separated sizes").option("--materials <csv>","Comma-separated materials").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let o={brandId:t.brand,name:t.name};t.category&&(o.category=t.category.toUpperCase()),t.collection&&(o.collectionId=t.collection),t.description&&(o.description=t.description),t.sku&&(o.sku=t.sku),t.price!==void 0&&(o.price=t.price),t.currency&&(o.currency=t.currency),t.imageFile&&(o.imageFileId=t.imageFile),t.colours&&(o.colours=l(t.colours)),t.sizes&&(o.sizes=l(t.sizes)),t.materials&&(o.materials=l(t.materials)),t.tags&&(o.tags=l(t.tags));let e=await a(B,{input:o});c(`Style item created: ${e.cooCreateStyleItem.name}`),s(t,e.cooCreateStyleItem);}catch(o){i(o);}}),n.command("update").description("Update a style item").argument("<id>","Style item ID").option("--name <name>","Item name").option("--category <c>","Category").option("--collection <id>","Collection ID").option("--description <s>","Description").option("--sku <sku>","SKU").option("--price <n>","Price",I).option("--currency <c>","Currency code").option("--image-file <id>","Image File ID").option("--colours <csv>","Comma-separated colours").option("--sizes <csv>","Comma-separated sizes").option("--materials <csv>","Comma-separated materials").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e={};if(o.name&&(e.name=o.name),o.category&&(e.category=o.category.toUpperCase()),o.collection&&(e.collectionId=o.collection),o.description!==void 0&&(e.description=o.description),o.sku!==void 0&&(e.sku=o.sku),o.price!==void 0&&(e.price=o.price),o.currency&&(e.currency=o.currency),o.imageFile&&(e.imageFileId=o.imageFile),o.colours&&(e.colours=l(o.colours)),o.sizes&&(e.sizes=l(o.sizes)),o.materials&&(e.materials=l(o.materials)),o.tags&&(e.tags=l(o.tags)),!Object.keys(e).length)throw new d("No updates specified");let m=await a(W,{id:t,input:e});c("Style item updated"),s(o,m.cooUpdateStyleItem);}catch(e){i(e);}}),n.command("archive").description("Archive (retire) a style item").argument("<id>","Style item ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(q,{id:t});c(`Style item archived: ${e.cooArchiveStyleItem}`),s(o,{archived:e.cooArchiveStyleItem});}catch(e){i(e);}});}function ft(r){let n=r.command("collaborations").description("Coolandlovely brand \u2194 creator collaborations");n.command("list").description("List collaborations").option("--brand <id>","Filter by brand ID").option("--creator <id>","Filter by creator ID").option("--status <s>","Filter by status").option("-f, --format <format>","Output format").action(async t=>{try{let o=await a(G,{brandId:t.brand,creatorId:t.creator,status:t.status?t.status.toUpperCase():void 0});s(t,o.cooListCollaborations,{headers:["ID","Title","Status","Role","Brand","Creator"],rows:o.cooListCollaborations.map(e=>[p(e.id,12),e.title,e.status,e.role,p(e.brandId,12),p(e.creatorId,12)])});}catch(o){i(o);}}),n.command("get").description("Get a collaboration by id").argument("<id>","Collaboration ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(M,{id:t});if(!e.cooCollaboration)throw new d(`Collaboration ${t} not found`);s(o,e.cooCollaboration);}catch(e){i(e);}}),n.command("create").description("Create a collaboration").requiredOption("--brand <id>","Brand ID").requiredOption("--creator <id>","Creator user ID").requiredOption("--title <title>","Collaboration title").option("--brief <s>","Brief").option("--collection <id>","Collection ID").option("--role <r>","CREATOR|STYLIST|PHOTOGRAPHER|BRAND").option("--compensation <n>","Compensation",I).option("--currency <c>","Currency code").option("--start-date <iso>","Start date (ISO 8601)").option("--end-date <iso>","End date (ISO 8601)").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let o={brandId:t.brand,creatorId:t.creator,title:t.title};t.brief&&(o.brief=t.brief),t.collection&&(o.collectionId=t.collection),t.role&&(o.role=t.role.toUpperCase()),t.compensation!==void 0&&(o.compensation=t.compensation),t.currency&&(o.currency=t.currency),t.startDate&&(o.startDate=t.startDate),t.endDate&&(o.endDate=t.endDate),t.tags&&(o.tags=l(t.tags));let e=await a(z,{input:o});c(`Collaboration created: ${e.cooCreateCollaboration.title}`),s(t,e.cooCreateCollaboration);}catch(o){i(o);}}),n.command("transition").description("Advance a collaboration through its lifecycle").argument("<id>","Collaboration ID").requiredOption("--status <s>","PROPOSED|ACCEPTED|DECLINED|IN_PROGRESS|PUBLISHED|CANCELLED").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(K,{id:t,status:o.status.toUpperCase()});c(`Collaboration status set to ${e.cooTransitionCollaboration.status}`),s(o,e.cooTransitionCollaboration);}catch(e){i(e);}});}function Ct(r){let n=r.command("looks").description("Coolandlovely styled looks");n.command("list").description("List looks").option("--author <id>","Filter by author ID").option("--occasion <o>","Filter by occasion").option("--featured","Only featured looks").option("--limit <n>","Page size",g,50).option("--offset <n>","Offset",g,0).option("--cursor <c>","Pagination cursor").option("-f, --format <format>","Output format").action(async t=>{try{let o=await a(j,{authorId:t.author,occasion:t.occasion?t.occasion.toUpperCase():void 0,featured:t.featured?!0:void 0,pagination:{limit:t.limit,offset:t.offset,cursor:t.cursor}});s(t,o.cooListLooks.items,{headers:["ID","Title","Occasion","Visibility","Likes","Featured"],rows:o.cooListLooks.items.map(e=>[p(e.id,12),e.title,e.occasion,e.visibility,String(e.likeCount??0),e.isFeatured?"yes":"no"])});}catch(o){i(o);}}),n.command("get").description("Get a look by id").argument("<id>","Look ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(H,{id:t});if(!e.cooLook)throw new d(`Look ${t} not found`);s(o,e.cooLook);}catch(e){i(e);}}),n.command("create").description("Create a look").requiredOption("--title <title>","Look title").option("--caption <s>","Caption").option("--collaboration <id>","Collaboration ID").option("--image-file <id>","Image File ID").option("--occasion <o>","EVERYDAY|WORK|EVENING|PARTY|WEDDING_GUEST|VACATION|ACTIVE|OTHER").option("--visibility <v>","PUBLIC|FOLLOWERS|PRIVATE").option("--items <json>","Look items JSON array: [{ styleItemId, position?, styling? }]").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let o={title:t.title};if(t.caption&&(o.caption=t.caption),t.collaboration&&(o.collaborationId=t.collaboration),t.imageFile&&(o.imageFileId=t.imageFile),t.occasion&&(o.occasion=t.occasion.toUpperCase()),t.visibility&&(o.visibility=t.visibility.toUpperCase()),t.items){let m=k("items",t.items);if(!Array.isArray(m))throw new d("--items must be a JSON array");o.items=m;}t.tags&&(o.tags=l(t.tags));let e=await a(V,{input:o});c(`Look created: ${e.cooCreateLook.title}`),s(t,e.cooCreateLook);}catch(o){i(o);}}),n.command("update").description("Update a look").argument("<id>","Look ID").option("--title <title>","Look title").option("--caption <s>","Caption").option("--image-file <id>","Image File ID").option("--occasion <o>","Occasion").option("--visibility <v>","PUBLIC|FOLLOWERS|PRIVATE").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e={};if(o.title&&(e.title=o.title),o.caption!==void 0&&(e.caption=o.caption),o.imageFile&&(e.imageFileId=o.imageFile),o.occasion&&(e.occasion=o.occasion.toUpperCase()),o.visibility&&(e.visibility=o.visibility.toUpperCase()),o.tags&&(e.tags=l(o.tags)),!Object.keys(e).length)throw new d("No updates specified");let m=await a(Y,{id:t,input:e});c("Look updated"),s(o,m.cooUpdateLook);}catch(e){i(e);}}),n.command("publish").description("Publish a look").argument("<id>","Look ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(J,{id:t});c(`Look published: ${e.cooPublishLook.title}`),s(o,e.cooPublishLook);}catch(e){i(e);}}),n.command("like").description("Like a published look").argument("<id>","Look ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(Q,{id:t});c(`Look liked (likes: ${e.cooLikeLook.likeCount??0})`),s(o,e.cooLikeLook);}catch(e){i(e);}}),n.command("delete").description("Delete a look").argument("<id>","Look ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(X,{id:t});c(`Look deleted: ${e.cooDeleteLook}`),s(o,{deleted:e.cooDeleteLook});}catch(e){i(e);}});}function yt(r){let n=r.command("lookbooks").description("Coolandlovely curated lookbooks");n.command("list").description("List lookbooks").option("--owner <id>","Filter by owner ID").option("-f, --format <format>","Output format").action(async t=>{try{let o=await a(tt,{ownerId:t.owner});s(t,o.cooListLookbooks,{headers:["ID","Name","Visibility","Owner"],rows:o.cooListLookbooks.map(e=>[p(e.id,12),e.name,e.visibility,p(e.ownerId,12)])});}catch(o){i(o);}}),n.command("get").description("Get a lookbook by id").argument("<id>","Lookbook ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(Z,{id:t});if(!e.cooLookbook)throw new d(`Lookbook ${t} not found`);s(o,e.cooLookbook);}catch(e){i(e);}}),n.command("create").description("Create a lookbook").requiredOption("--name <name>","Lookbook name").option("--description <s>","Description").option("--cover-file <id>","Cover File ID").option("--visibility <v>","PUBLIC|FOLLOWERS|PRIVATE").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let o={name:t.name};t.description&&(o.description=t.description),t.coverFile&&(o.coverFileId=t.coverFile),t.visibility&&(o.visibility=t.visibility.toUpperCase()),t.tags&&(o.tags=l(t.tags));let e=await a(ot,{input:o});c(`Lookbook created: ${e.cooCreateLookbook.name}`),s(t,e.cooCreateLookbook);}catch(o){i(o);}}),n.command("add-entry").description("Add an entry (look or style item) to a lookbook").requiredOption("--lookbook <id>","Lookbook ID").option("--look <id>","Look ID to add").option("--style-item <id>","Style item ID to add").option("--note <s>","Note").option("--position <n>","Position",g).option("-f, --format <format>","Output format").action(async t=>{try{let o={lookbookId:t.lookbook};t.look&&(o.lookId=t.look),t.styleItem&&(o.styleItemId=t.styleItem),t.note&&(o.note=t.note),t.position!==void 0&&(o.position=t.position);let e=await a(et,{input:o});c(`Lookbook entry added: ${e.cooAddLookbookEntry.id}`),s(t,e.cooAddLookbookEntry);}catch(o){i(o);}}),n.command("remove-entry").description("Remove an entry from a lookbook").argument("<id>","Lookbook entry ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(nt,{id:t});c(`Lookbook entry removed: ${e.cooRemoveLookbookEntry}`),s(o,{removed:e.cooRemoveLookbookEntry});}catch(e){i(e);}});}function bt(r){let n=r.command("wardrobe").description("Coolandlovely digital wardrobe (the shopper's own pieces)");n.command("list").description("List wardrobe items").option("--category <c>","Filter by category").option("--source <s>","Filter by source").option("-f, --format <format>","Output format").action(async t=>{try{let o=await a(rt,{category:t.category?t.category.toUpperCase():void 0,source:t.source?t.source.toUpperCase():void 0});s(t,o.cooListWardrobeItems,{headers:["ID","Name","Category","Source","Times Worn"],rows:o.cooListWardrobeItems.map(e=>[p(e.id,12),e.name,e.category,e.source,String(e.timesWorn??0)])});}catch(o){i(o);}}),n.command("create").description("Add an item to the wardrobe").requiredOption("--name <name>","Item name").option("--brand-name <s>","Brand name (free text)").option("--category <c>","Category").option("--colour <s>","Colour").option("--size <s>","Size").option("--source <s>","OWNED|PURCHASED_ON_PLATFORM|GIFTED|WISHLIST").option("--style-item <id>","Linked style item ID").option("--image-file <id>","Image File ID").option("--notes <s>","Notes").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let o={name:t.name};t.brandName&&(o.brandName=t.brandName),t.category&&(o.category=t.category.toUpperCase()),t.colour&&(o.colour=t.colour),t.size&&(o.size=t.size),t.source&&(o.source=t.source.toUpperCase()),t.styleItem&&(o.styleItemId=t.styleItem),t.imageFile&&(o.imageFileId=t.imageFile),t.notes&&(o.notes=t.notes),t.tags&&(o.tags=l(t.tags));let e=await a(it,{input:o});c(`Wardrobe item added: ${e.cooCreateWardrobeItem.name}`),s(t,e.cooCreateWardrobeItem);}catch(o){i(o);}}),n.command("update").description("Update a wardrobe item").argument("<id>","Wardrobe item ID").option("--name <name>","Item name").option("--brand-name <s>","Brand name (free text)").option("--category <c>","Category").option("--colour <s>","Colour").option("--size <s>","Size").option("--source <s>","OWNED|PURCHASED_ON_PLATFORM|GIFTED|WISHLIST").option("--image-file <id>","Image File ID").option("--notes <s>","Notes").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e={};if(o.name&&(e.name=o.name),o.brandName!==void 0&&(e.brandName=o.brandName),o.category&&(e.category=o.category.toUpperCase()),o.colour!==void 0&&(e.colour=o.colour),o.size!==void 0&&(e.size=o.size),o.source&&(e.source=o.source.toUpperCase()),o.imageFile&&(e.imageFileId=o.imageFile),o.notes!==void 0&&(e.notes=o.notes),o.tags&&(e.tags=l(o.tags)),!Object.keys(e).length)throw new d("No updates specified");let m=await a(st,{id:t,input:e});c("Wardrobe item updated"),s(o,m.cooUpdateWardrobeItem);}catch(e){i(e);}}),n.command("wear").description("Log that the shopper wore a wardrobe piece").argument("<id>","Wardrobe item ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(at,{id:t});c(`Wear logged (times worn: ${e.cooLogWardrobeWear.timesWorn??0})`),s(o,e.cooLogWardrobeWear);}catch(e){i(e);}}),n.command("remove").description("Remove a wardrobe item").argument("<id>","Wardrobe item ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(ct,{id:t});c(`Wardrobe item removed: ${e.cooRemoveWardrobeItem}`),s(o,{removed:e.cooRemoveWardrobeItem});}catch(e){i(e);}});}function It(r){let n=r.command("profile").description("Coolandlovely shopper style profile (self-scoped)");n.command("get").description("Show the calling shopper's own style profile").option("-f, --format <format>","Output format").action(async t=>{try{let o=await a(dt);if(!o.cooMyStyleProfile)throw new d("No style profile yet. Run `profile upsert` to create one.");s(t,o.cooMyStyleProfile);}catch(o){i(o);}}),n.command("upsert").description("Create or update the calling shopper style profile").option("--display-name <s>","Display name").option("--bio <s>","Bio").option("--visibility <v>","PUBLIC|FOLLOWERS|PRIVATE").option("--favourite-brands <csv>","Comma-separated favourite brands").option("--palette <csv>","Comma-separated colour palette").option("--style-preferences <csv>","Comma-separated style preferences").option("--sizes <json>",'Sizes JSON (e.g. {"tops":"M","shoes":"8"})').option("-f, --format <format>","Output format").action(async t=>{try{let o={};t.displayName&&(o.displayName=t.displayName),t.bio!==void 0&&(o.bio=t.bio),t.visibility&&(o.visibility=t.visibility.toUpperCase()),t.favouriteBrands&&(o.favouriteBrands=l(t.favouriteBrands)),t.palette&&(o.palette=l(t.palette)),t.stylePreferences&&(o.stylePreferences=l(t.stylePreferences)),t.sizes&&(o.sizes=k("sizes",t.sizes));let e=await a(lt,{input:o});c("Style profile saved"),s(t,e.cooUpsertStyleProfile);}catch(o){i(o);}});}function kt(r){r.command("health").description("Coolandlovely service health check (public)").option("-f, --format <format>","Output format").action(async n=>{try{let t=await w(ut);c(t.cooHealth),s(n,{health:t.cooHealth});}catch(t){i(t);}});}var $t={id:"coolandlovely",version:"1.0.0",displayName:"Coolandlovely",dependsOn:["auth","workspaces"],register(r,n){E(n);let t=r.command("coolandlovely").description("Coolandlovely fashion & lifestyle platform");pt(t),mt(t),gt(t),ft(t),Ct(t),yt(t),bt(t),It(t),kt(t);}},ve=$t;module.exports=ve;
|
|
295
|
+
`;function k(r,n){try{return JSON.parse(n)}catch{throw new d(`--${r} must be valid JSON`)}}function g(r){let n=Number.parseInt(r,10);if(Number.isNaN(n))throw new d(`Expected an integer but got "${r}"`);return n}function I(r){let n=Number.parseFloat(r);if(Number.isNaN(n))throw new d(`Expected a number but got "${r}"`);return n}function l(r){return r.split(",").map(n=>n.trim()).filter(n=>n.length>0)}function pt(r){let n=r.command("brands").description("Coolandlovely brand storefronts");n.command("list").description("List brand storefronts").option("--status <s>","Filter by brand status").option("--featured","Only featured brands").option("--limit <n>","Page size",g,50).option("--offset <n>","Offset",g,0).option("--cursor <c>","Pagination cursor").option("-f, --format <format>","Output format").action(async t=>{try{let o=await a(v,{status:t.status?t.status.toUpperCase():void 0,featured:t.featured?!0:void 0,pagination:{limit:t.limit,offset:t.offset,cursor:t.cursor}});s(t,o.cooListBrands.items,{headers:["ID","Name","Handle","Status","Featured"],rows:o.cooListBrands.items.map(e=>[p(e.id,12),e.name,e.handle,e.status,e.isFeatured?"yes":"no"])});}catch(o){i(o);}}),n.command("get").description("Get a brand by id").argument("<id>","Brand ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(A,{id:t});if(!e.cooBrand)throw new d(`Brand ${t} not found`);s(o,e.cooBrand);}catch(e){i(e);}}),n.command("create").description("Create a brand storefront").requiredOption("--name <name>","Brand name").requiredOption("--handle <handle>","Unique storefront handle").option("--tagline <s>","Tagline").option("--bio <s>","Bio").option("--website-url <url>","Website URL").option("--logo-file <id>","Logo File ID (wspace-files-svc)").option("--cover-file <id>","Cover File ID (wspace-files-svc)").option("--aesthetics <csv>","Comma-separated aesthetics").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let o={name:t.name,handle:t.handle};t.tagline&&(o.tagline=t.tagline),t.bio&&(o.bio=t.bio),t.websiteUrl&&(o.websiteUrl=t.websiteUrl),t.logoFile&&(o.logoFileId=t.logoFile),t.coverFile&&(o.coverFileId=t.coverFile),t.aesthetics&&(o.aesthetics=l(t.aesthetics)),t.tags&&(o.tags=l(t.tags));let e=await a(T,{input:o});c(`Brand created: ${e.cooCreateBrand.name}`),s(t,e.cooCreateBrand);}catch(o){i(o);}}),n.command("update").description("Update a brand storefront").argument("<id>","Brand ID").option("--name <name>","Brand name").option("--tagline <s>","Tagline").option("--bio <s>","Bio").option("--website-url <url>","Website URL").option("--logo-file <id>","Logo File ID").option("--cover-file <id>","Cover File ID").option("--featured <bool>","true|false",t=>t==="true").option("--aesthetics <csv>","Comma-separated aesthetics").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e={};if(o.name&&(e.name=o.name),o.tagline!==void 0&&(e.tagline=o.tagline),o.bio!==void 0&&(e.bio=o.bio),o.websiteUrl!==void 0&&(e.websiteUrl=o.websiteUrl),o.logoFile&&(e.logoFileId=o.logoFile),o.coverFile&&(e.coverFileId=o.coverFile),o.featured!==void 0&&(e.isFeatured=o.featured),o.aesthetics&&(e.aesthetics=l(o.aesthetics)),o.tags&&(e.tags=l(o.tags)),!Object.keys(e).length)throw new d("No updates specified");let m=await a(x,{id:t,input:e});c("Brand updated"),s(o,m.cooUpdateBrand);}catch(e){i(e);}}),n.command("transition").description("Advance a brand through its publish lifecycle").argument("<id>","Brand ID").requiredOption("--status <s>","DRAFT|PENDING_REVIEW|PUBLISHED|SUSPENDED|ARCHIVED").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(S,{id:t,status:o.status.toUpperCase()});c(`Brand status set to ${e.cooTransitionBrand.status}`),s(o,e.cooTransitionBrand);}catch(e){i(e);}}),n.command("archive").description("Archive a brand storefront").argument("<id>","Brand ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(R,{id:t});c(`Brand archived: ${e.cooArchiveBrand}`),s(o,{archived:e.cooArchiveBrand});}catch(e){i(e);}});}function mt(r){let n=r.command("collections").description("Coolandlovely seasonal collections");n.command("list").description("List collections").option("--brand <id>","Filter by brand ID").option("--status <s>","Filter by collection status").option("-f, --format <format>","Output format").action(async t=>{try{let o=await a($,{brandId:t.brand,status:t.status?t.status.toUpperCase():void 0});s(t,o.cooListCollections.items,{headers:["ID","Name","Season","Status","Brand"],rows:o.cooListCollections.items.map(e=>[p(e.id,12),e.name,e.season,e.status,p(e.brandId,12)])});}catch(o){i(o);}}),n.command("get").description("Get a collection by id").argument("<id>","Collection ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(D,{id:t});if(!e.cooCollection)throw new d(`Collection ${t} not found`);s(o,e.cooCollection);}catch(e){i(e);}}),n.command("create").description("Create a collection").requiredOption("--brand <id>","Brand ID").requiredOption("--name <name>","Collection name").option("--description <s>","Description").option("--season <s>","ALL_SEASON|SPRING|SUMMER|AUTUMN|WINTER|RESORT").option("--cover-file <id>","Cover File ID").option("--publish-at <iso>","Scheduled publish date (ISO 8601)").option("--end-at <iso>","End date (ISO 8601)").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let o={brandId:t.brand,name:t.name};t.description&&(o.description=t.description),t.season&&(o.season=t.season.toUpperCase()),t.coverFile&&(o.coverFileId=t.coverFile),t.publishAt&&(o.publishAt=t.publishAt),t.endAt&&(o.endAt=t.endAt),t.tags&&(o.tags=l(t.tags));let e=await a(P,{input:o});c(`Collection created: ${e.cooCreateCollection.name}`),s(t,e.cooCreateCollection);}catch(o){i(o);}}),n.command("update").description("Update a collection").argument("<id>","Collection ID").option("--name <name>","Collection name").option("--description <s>","Description").option("--season <s>","ALL_SEASON|SPRING|SUMMER|AUTUMN|WINTER|RESORT").option("--cover-file <id>","Cover File ID").option("--publish-at <iso>","Scheduled publish date (ISO 8601)").option("--end-at <iso>","End date (ISO 8601)").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e={};if(o.name&&(e.name=o.name),o.description!==void 0&&(e.description=o.description),o.season&&(e.season=o.season.toUpperCase()),o.coverFile&&(e.coverFileId=o.coverFile),o.publishAt&&(e.publishAt=o.publishAt),o.endAt&&(e.endAt=o.endAt),o.tags&&(e.tags=l(o.tags)),!Object.keys(e).length)throw new d("No updates specified");let m=await a(_,{id:t,input:e});c("Collection updated"),s(o,m.cooUpdateCollection);}catch(e){i(e);}}),n.command("publish").description("Publish a collection (go live)").argument("<id>","Collection ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(N,{id:t});c(`Collection published: ${e.cooPublishCollection.status}`),s(o,e.cooPublishCollection);}catch(e){i(e);}});}function gt(r){let n=r.command("style-items").description("Coolandlovely style items (catalog products)");n.command("list").description("List style items").option("--brand <id>","Filter by brand ID").option("--collection <id>","Filter by collection ID").option("--category <c>","Filter by category").option("--status <s>","Filter by status").option("--limit <n>","Page size",g,50).option("--offset <n>","Offset",g,0).option("--cursor <c>","Pagination cursor").option("-f, --format <format>","Output format").action(async t=>{try{let o=await a(U,{brandId:t.brand,collectionId:t.collection,category:t.category?t.category.toUpperCase():void 0,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset,cursor:t.cursor}});s(t,o.cooListStyleItems.items,{headers:["ID","Name","Category","Status","Price"],rows:o.cooListStyleItems.items.map(e=>[p(e.id,12),e.name,e.category,e.status,`${e.price} ${e.currency}`])});}catch(o){i(o);}}),n.command("get").description("Get a style item by id").argument("<id>","Style item ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(F,{id:t});if(!e.cooStyleItem)throw new d(`Style item ${t} not found`);s(o,e.cooStyleItem);}catch(e){i(e);}}),n.command("create").description("Create a style item").requiredOption("--brand <id>","Brand ID").requiredOption("--name <name>","Item name").option("--category <c>","Category").option("--collection <id>","Collection ID").option("--description <s>","Description").option("--sku <sku>","SKU").option("--price <n>","Price",I).option("--currency <c>","Currency code").option("--image-file <id>","Image File ID").option("--colours <csv>","Comma-separated colours").option("--sizes <csv>","Comma-separated sizes").option("--materials <csv>","Comma-separated materials").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let o={brandId:t.brand,name:t.name};t.category&&(o.category=t.category.toUpperCase()),t.collection&&(o.collectionId=t.collection),t.description&&(o.description=t.description),t.sku&&(o.sku=t.sku),t.price!==void 0&&(o.price=t.price),t.currency&&(o.currency=t.currency),t.imageFile&&(o.imageFileId=t.imageFile),t.colours&&(o.colours=l(t.colours)),t.sizes&&(o.sizes=l(t.sizes)),t.materials&&(o.materials=l(t.materials)),t.tags&&(o.tags=l(t.tags));let e=await a(B,{input:o});c(`Style item created: ${e.cooCreateStyleItem.name}`),s(t,e.cooCreateStyleItem);}catch(o){i(o);}}),n.command("update").description("Update a style item").argument("<id>","Style item ID").option("--name <name>","Item name").option("--category <c>","Category").option("--collection <id>","Collection ID").option("--description <s>","Description").option("--sku <sku>","SKU").option("--price <n>","Price",I).option("--currency <c>","Currency code").option("--image-file <id>","Image File ID").option("--colours <csv>","Comma-separated colours").option("--sizes <csv>","Comma-separated sizes").option("--materials <csv>","Comma-separated materials").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e={};if(o.name&&(e.name=o.name),o.category&&(e.category=o.category.toUpperCase()),o.collection&&(e.collectionId=o.collection),o.description!==void 0&&(e.description=o.description),o.sku!==void 0&&(e.sku=o.sku),o.price!==void 0&&(e.price=o.price),o.currency&&(e.currency=o.currency),o.imageFile&&(e.imageFileId=o.imageFile),o.colours&&(e.colours=l(o.colours)),o.sizes&&(e.sizes=l(o.sizes)),o.materials&&(e.materials=l(o.materials)),o.tags&&(e.tags=l(o.tags)),!Object.keys(e).length)throw new d("No updates specified");let m=await a(W,{id:t,input:e});c("Style item updated"),s(o,m.cooUpdateStyleItem);}catch(e){i(e);}}),n.command("archive").description("Archive (retire) a style item").argument("<id>","Style item ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(q,{id:t});c(`Style item archived: ${e.cooArchiveStyleItem}`),s(o,{archived:e.cooArchiveStyleItem});}catch(e){i(e);}});}function ft(r){let n=r.command("collaborations").description("Coolandlovely brand \u2194 creator collaborations");n.command("list").description("List collaborations").option("--brand <id>","Filter by brand ID").option("--creator <id>","Filter by creator ID").option("--status <s>","Filter by status").option("-f, --format <format>","Output format").action(async t=>{try{let o=await a(G,{brandId:t.brand,creatorId:t.creator,status:t.status?t.status.toUpperCase():void 0});s(t,o.cooListCollaborations.items,{headers:["ID","Title","Status","Role","Brand","Creator"],rows:o.cooListCollaborations.items.map(e=>[p(e.id,12),e.title,e.status,e.role,p(e.brandId,12),p(e.creatorId,12)])});}catch(o){i(o);}}),n.command("get").description("Get a collaboration by id").argument("<id>","Collaboration ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(M,{id:t});if(!e.cooCollaboration)throw new d(`Collaboration ${t} not found`);s(o,e.cooCollaboration);}catch(e){i(e);}}),n.command("create").description("Create a collaboration").requiredOption("--brand <id>","Brand ID").requiredOption("--creator <id>","Creator user ID").requiredOption("--title <title>","Collaboration title").option("--brief <s>","Brief").option("--collection <id>","Collection ID").option("--role <r>","CREATOR|STYLIST|PHOTOGRAPHER|BRAND").option("--compensation <n>","Compensation",I).option("--currency <c>","Currency code").option("--start-date <iso>","Start date (ISO 8601)").option("--end-date <iso>","End date (ISO 8601)").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let o={brandId:t.brand,creatorId:t.creator,title:t.title};t.brief&&(o.brief=t.brief),t.collection&&(o.collectionId=t.collection),t.role&&(o.role=t.role.toUpperCase()),t.compensation!==void 0&&(o.compensation=t.compensation),t.currency&&(o.currency=t.currency),t.startDate&&(o.startDate=t.startDate),t.endDate&&(o.endDate=t.endDate),t.tags&&(o.tags=l(t.tags));let e=await a(z,{input:o});c(`Collaboration created: ${e.cooCreateCollaboration.title}`),s(t,e.cooCreateCollaboration);}catch(o){i(o);}}),n.command("transition").description("Advance a collaboration through its lifecycle").argument("<id>","Collaboration ID").requiredOption("--status <s>","PROPOSED|ACCEPTED|DECLINED|IN_PROGRESS|PUBLISHED|CANCELLED").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(K,{id:t,status:o.status.toUpperCase()});c(`Collaboration status set to ${e.cooTransitionCollaboration.status}`),s(o,e.cooTransitionCollaboration);}catch(e){i(e);}});}function Ct(r){let n=r.command("looks").description("Coolandlovely styled looks");n.command("list").description("List looks").option("--author <id>","Filter by author ID").option("--occasion <o>","Filter by occasion").option("--featured","Only featured looks").option("--limit <n>","Page size",g,50).option("--offset <n>","Offset",g,0).option("--cursor <c>","Pagination cursor").option("-f, --format <format>","Output format").action(async t=>{try{let o=await a(j,{authorId:t.author,occasion:t.occasion?t.occasion.toUpperCase():void 0,featured:t.featured?!0:void 0,pagination:{limit:t.limit,offset:t.offset,cursor:t.cursor}});s(t,o.cooListLooks.items,{headers:["ID","Title","Occasion","Visibility","Likes","Featured"],rows:o.cooListLooks.items.map(e=>[p(e.id,12),e.title,e.occasion,e.visibility,String(e.likeCount??0),e.isFeatured?"yes":"no"])});}catch(o){i(o);}}),n.command("get").description("Get a look by id").argument("<id>","Look ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(H,{id:t});if(!e.cooLook)throw new d(`Look ${t} not found`);s(o,e.cooLook);}catch(e){i(e);}}),n.command("create").description("Create a look").requiredOption("--title <title>","Look title").option("--caption <s>","Caption").option("--collaboration <id>","Collaboration ID").option("--image-file <id>","Image File ID").option("--occasion <o>","EVERYDAY|WORK|EVENING|PARTY|WEDDING_GUEST|VACATION|ACTIVE|OTHER").option("--visibility <v>","PUBLIC|FOLLOWERS|PRIVATE").option("--items <json>","Look items JSON array: [{ styleItemId, position?, styling? }]").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let o={title:t.title};if(t.caption&&(o.caption=t.caption),t.collaboration&&(o.collaborationId=t.collaboration),t.imageFile&&(o.imageFileId=t.imageFile),t.occasion&&(o.occasion=t.occasion.toUpperCase()),t.visibility&&(o.visibility=t.visibility.toUpperCase()),t.items){let m=k("items",t.items);if(!Array.isArray(m))throw new d("--items must be a JSON array");o.items=m;}t.tags&&(o.tags=l(t.tags));let e=await a(V,{input:o});c(`Look created: ${e.cooCreateLook.title}`),s(t,e.cooCreateLook);}catch(o){i(o);}}),n.command("update").description("Update a look").argument("<id>","Look ID").option("--title <title>","Look title").option("--caption <s>","Caption").option("--image-file <id>","Image File ID").option("--occasion <o>","Occasion").option("--visibility <v>","PUBLIC|FOLLOWERS|PRIVATE").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e={};if(o.title&&(e.title=o.title),o.caption!==void 0&&(e.caption=o.caption),o.imageFile&&(e.imageFileId=o.imageFile),o.occasion&&(e.occasion=o.occasion.toUpperCase()),o.visibility&&(e.visibility=o.visibility.toUpperCase()),o.tags&&(e.tags=l(o.tags)),!Object.keys(e).length)throw new d("No updates specified");let m=await a(Y,{id:t,input:e});c("Look updated"),s(o,m.cooUpdateLook);}catch(e){i(e);}}),n.command("publish").description("Publish a look").argument("<id>","Look ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(J,{id:t});c(`Look published: ${e.cooPublishLook.title}`),s(o,e.cooPublishLook);}catch(e){i(e);}}),n.command("like").description("Like a published look").argument("<id>","Look ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(Q,{id:t});c(`Look liked (likes: ${e.cooLikeLook.likeCount??0})`),s(o,e.cooLikeLook);}catch(e){i(e);}}),n.command("delete").description("Delete a look").argument("<id>","Look ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(X,{id:t});c(`Look deleted: ${e.cooDeleteLook}`),s(o,{deleted:e.cooDeleteLook});}catch(e){i(e);}});}function yt(r){let n=r.command("lookbooks").description("Coolandlovely curated lookbooks");n.command("list").description("List lookbooks").option("--owner <id>","Filter by owner ID").option("-f, --format <format>","Output format").action(async t=>{try{let o=await a(tt,{ownerId:t.owner});s(t,o.cooListLookbooks.items,{headers:["ID","Name","Visibility","Owner"],rows:o.cooListLookbooks.items.map(e=>[p(e.id,12),e.name,e.visibility,p(e.ownerId,12)])});}catch(o){i(o);}}),n.command("get").description("Get a lookbook by id").argument("<id>","Lookbook ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(Z,{id:t});if(!e.cooLookbook)throw new d(`Lookbook ${t} not found`);s(o,e.cooLookbook);}catch(e){i(e);}}),n.command("create").description("Create a lookbook").requiredOption("--name <name>","Lookbook name").option("--description <s>","Description").option("--cover-file <id>","Cover File ID").option("--visibility <v>","PUBLIC|FOLLOWERS|PRIVATE").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let o={name:t.name};t.description&&(o.description=t.description),t.coverFile&&(o.coverFileId=t.coverFile),t.visibility&&(o.visibility=t.visibility.toUpperCase()),t.tags&&(o.tags=l(t.tags));let e=await a(ot,{input:o});c(`Lookbook created: ${e.cooCreateLookbook.name}`),s(t,e.cooCreateLookbook);}catch(o){i(o);}}),n.command("add-entry").description("Add an entry (look or style item) to a lookbook").requiredOption("--lookbook <id>","Lookbook ID").option("--look <id>","Look ID to add").option("--style-item <id>","Style item ID to add").option("--note <s>","Note").option("--position <n>","Position",g).option("-f, --format <format>","Output format").action(async t=>{try{let o={lookbookId:t.lookbook};t.look&&(o.lookId=t.look),t.styleItem&&(o.styleItemId=t.styleItem),t.note&&(o.note=t.note),t.position!==void 0&&(o.position=t.position);let e=await a(et,{input:o});c(`Lookbook entry added: ${e.cooAddLookbookEntry.id}`),s(t,e.cooAddLookbookEntry);}catch(o){i(o);}}),n.command("remove-entry").description("Remove an entry from a lookbook").argument("<id>","Lookbook entry ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(nt,{id:t});c(`Lookbook entry removed: ${e.cooRemoveLookbookEntry}`),s(o,{removed:e.cooRemoveLookbookEntry});}catch(e){i(e);}});}function bt(r){let n=r.command("wardrobe").description("Coolandlovely digital wardrobe (the shopper's own pieces)");n.command("list").description("List wardrobe items").option("--category <c>","Filter by category").option("--source <s>","Filter by source").option("-f, --format <format>","Output format").action(async t=>{try{let o=await a(rt,{category:t.category?t.category.toUpperCase():void 0,source:t.source?t.source.toUpperCase():void 0});s(t,o.cooListWardrobeItems.items,{headers:["ID","Name","Category","Source","Times Worn"],rows:o.cooListWardrobeItems.items.map(e=>[p(e.id,12),e.name,e.category,e.source,String(e.timesWorn??0)])});}catch(o){i(o);}}),n.command("create").description("Add an item to the wardrobe").requiredOption("--name <name>","Item name").option("--brand-name <s>","Brand name (free text)").option("--category <c>","Category").option("--colour <s>","Colour").option("--size <s>","Size").option("--source <s>","OWNED|PURCHASED_ON_PLATFORM|GIFTED|WISHLIST").option("--style-item <id>","Linked style item ID").option("--image-file <id>","Image File ID").option("--notes <s>","Notes").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let o={name:t.name};t.brandName&&(o.brandName=t.brandName),t.category&&(o.category=t.category.toUpperCase()),t.colour&&(o.colour=t.colour),t.size&&(o.size=t.size),t.source&&(o.source=t.source.toUpperCase()),t.styleItem&&(o.styleItemId=t.styleItem),t.imageFile&&(o.imageFileId=t.imageFile),t.notes&&(o.notes=t.notes),t.tags&&(o.tags=l(t.tags));let e=await a(it,{input:o});c(`Wardrobe item added: ${e.cooCreateWardrobeItem.name}`),s(t,e.cooCreateWardrobeItem);}catch(o){i(o);}}),n.command("update").description("Update a wardrobe item").argument("<id>","Wardrobe item ID").option("--name <name>","Item name").option("--brand-name <s>","Brand name (free text)").option("--category <c>","Category").option("--colour <s>","Colour").option("--size <s>","Size").option("--source <s>","OWNED|PURCHASED_ON_PLATFORM|GIFTED|WISHLIST").option("--image-file <id>","Image File ID").option("--notes <s>","Notes").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e={};if(o.name&&(e.name=o.name),o.brandName!==void 0&&(e.brandName=o.brandName),o.category&&(e.category=o.category.toUpperCase()),o.colour!==void 0&&(e.colour=o.colour),o.size!==void 0&&(e.size=o.size),o.source&&(e.source=o.source.toUpperCase()),o.imageFile&&(e.imageFileId=o.imageFile),o.notes!==void 0&&(e.notes=o.notes),o.tags&&(e.tags=l(o.tags)),!Object.keys(e).length)throw new d("No updates specified");let m=await a(st,{id:t,input:e});c("Wardrobe item updated"),s(o,m.cooUpdateWardrobeItem);}catch(e){i(e);}}),n.command("wear").description("Log that the shopper wore a wardrobe piece").argument("<id>","Wardrobe item ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(at,{id:t});c(`Wear logged (times worn: ${e.cooLogWardrobeWear.timesWorn??0})`),s(o,e.cooLogWardrobeWear);}catch(e){i(e);}}),n.command("remove").description("Remove a wardrobe item").argument("<id>","Wardrobe item ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await a(ct,{id:t});c(`Wardrobe item removed: ${e.cooRemoveWardrobeItem}`),s(o,{removed:e.cooRemoveWardrobeItem});}catch(e){i(e);}});}function It(r){let n=r.command("profile").description("Coolandlovely shopper style profile (self-scoped)");n.command("get").description("Show the calling shopper's own style profile").option("-f, --format <format>","Output format").action(async t=>{try{let o=await a(dt);if(!o.cooMyStyleProfile)throw new d("No style profile yet. Run `profile upsert` to create one.");s(t,o.cooMyStyleProfile);}catch(o){i(o);}}),n.command("upsert").description("Create or update the calling shopper style profile").option("--display-name <s>","Display name").option("--bio <s>","Bio").option("--visibility <v>","PUBLIC|FOLLOWERS|PRIVATE").option("--favourite-brands <csv>","Comma-separated favourite brands").option("--palette <csv>","Comma-separated colour palette").option("--style-preferences <csv>","Comma-separated style preferences").option("--sizes <json>",'Sizes JSON (e.g. {"tops":"M","shoes":"8"})').option("-f, --format <format>","Output format").action(async t=>{try{let o={};t.displayName&&(o.displayName=t.displayName),t.bio!==void 0&&(o.bio=t.bio),t.visibility&&(o.visibility=t.visibility.toUpperCase()),t.favouriteBrands&&(o.favouriteBrands=l(t.favouriteBrands)),t.palette&&(o.palette=l(t.palette)),t.stylePreferences&&(o.stylePreferences=l(t.stylePreferences)),t.sizes&&(o.sizes=k("sizes",t.sizes));let e=await a(lt,{input:o});c("Style profile saved"),s(t,e.cooUpsertStyleProfile);}catch(o){i(o);}});}function kt(r){r.command("health").description("Coolandlovely service health check (public)").option("-f, --format <format>","Output format").action(async n=>{try{let t=await w(ut);c(t.cooHealth),s(n,{health:t.cooHealth});}catch(t){i(t);}});}var $t={id:"coolandlovely",version:"1.0.0",displayName:"Coolandlovely",dependsOn:["auth","workspaces"],register(r,n){O(n);let t=r.command("coolandlovely").description("Coolandlovely fashion & lifestyle platform");pt(t),mt(t),gt(t),ft(t),Ct(t),yt(t),bt(t),It(t),kt(t);}},ve=$t;module.exports=ve;
|