@burdenoff/cli-sdk 2026.627.2 → 2026.627.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/modules/artistrybase/index.cjs +334 -0
- package/dist/modules/artistrybase/index.d.cts +7 -0
- package/dist/modules/artistrybase/index.d.ts +7 -0
- package/dist/modules/artistrybase/index.js +334 -0
- package/dist/modules/brainyrich/index.cjs +340 -0
- package/dist/modules/brainyrich/index.d.cts +7 -0
- package/dist/modules/brainyrich/index.d.ts +7 -0
- package/dist/modules/brainyrich/index.js +340 -0
- package/dist/modules/buildmyiq/index.cjs +231 -0
- package/dist/modules/buildmyiq/index.d.cts +7 -0
- package/dist/modules/buildmyiq/index.d.ts +7 -0
- package/dist/modules/buildmyiq/index.js +231 -0
- package/dist/modules/collabkin/index.cjs +208 -0
- package/dist/modules/collabkin/index.d.cts +7 -0
- package/dist/modules/collabkin/index.d.ts +7 -0
- package/dist/modules/collabkin/index.js +208 -0
- package/dist/modules/comradecircle/index.cjs +281 -0
- package/dist/modules/comradecircle/index.d.cts +7 -0
- package/dist/modules/comradecircle/index.d.ts +7 -0
- package/dist/modules/comradecircle/index.js +281 -0
- package/package.json +1 -1
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var p=class extends Error{exitCode;hint;constructor(n,e){super(n),this.name="CliUserError",this.exitCode=e?.exitCode??1,this.hint=e?.hint;}},C=class extends p{constructor(n,e){super(n,{exitCode:2,hint:e?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},g=class extends Error{cause;constructor(n,e){super(n),this.name="CliInternalError",this.cause=e;}};var E=null;function T(o){E=o;}function y(){if(!E)throw new g("vibecontrols module helpers used before setHelpersContext was called");return E}function Te(){let o=y();if(!o.auth.isAuthenticated())throw new C(`Authentication required. Run \`${o.productName} auth login\`.`)}async function a(o,n){return Te(),y().gql.workspace.request(o,n)}async function b(o,n){return y().gql.workspaceAuthOnly.request(o,n)}function i(o){let n=o instanceof Error?o.message:String(o);throw new p(n)}function s(o,n,e){y().output.formatAndOutput(o,n,e);}function c(o){y().output.printSuccess(o);}function I(o){return y().output.formatDate(o)}function d(o,n){return y().output.truncate(o,n)}var D=`
|
|
2
|
+
query ColGetFamilyTree($id: ID!) {
|
|
3
|
+
colFamilyTree(id: $id) {
|
|
4
|
+
id name surname description status tags createdAt updatedAt workspaceId
|
|
5
|
+
coverFile { id }
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
`,x=`
|
|
9
|
+
query ColListFamilyTrees($pagination: PaginationInput, $status: ColTreeStatus) {
|
|
10
|
+
colListFamilyTrees(pagination: $pagination, status: $status) {
|
|
11
|
+
items { id name surname status tags createdAt }
|
|
12
|
+
pageInfo { cursor hasMore }
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`,v=`
|
|
16
|
+
mutation ColCreateFamilyTree($input: ColCreateFamilyTreeInput!) {
|
|
17
|
+
colCreateFamilyTree(input: $input) {
|
|
18
|
+
id name surname description status tags createdAt
|
|
19
|
+
coverFile { id }
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
`,A=`
|
|
23
|
+
mutation ColUpdateFamilyTree($id: ID!, $input: ColUpdateFamilyTreeInput!) {
|
|
24
|
+
colUpdateFamilyTree(id: $id, input: $input) {
|
|
25
|
+
id name surname description status tags updatedAt
|
|
26
|
+
coverFile { id }
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`,S=`
|
|
30
|
+
mutation ColArchiveFamilyTree($id: ID!) {
|
|
31
|
+
colArchiveFamilyTree(id: $id)
|
|
32
|
+
}
|
|
33
|
+
`,R=`
|
|
34
|
+
query ColGetPerson($id: ID!) {
|
|
35
|
+
colPerson(id: $id) {
|
|
36
|
+
id treeId givenName familyName maidenName nickname gender lifeStatus
|
|
37
|
+
birthDate birthPlace deathDate bio tags linkedUserId
|
|
38
|
+
photoFile { id }
|
|
39
|
+
createdAt updatedAt workspaceId
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
`,O=`
|
|
43
|
+
query ColListPeople($treeId: ID, $lifeStatus: ColLifeStatus, $pagination: PaginationInput) {
|
|
44
|
+
colListPeople(treeId: $treeId, lifeStatus: $lifeStatus, pagination: $pagination) {
|
|
45
|
+
items { id treeId givenName familyName gender lifeStatus birthDate createdAt }
|
|
46
|
+
pageInfo { cursor hasMore }
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
`,M=`
|
|
50
|
+
mutation ColCreatePerson($input: ColCreatePersonInput!) {
|
|
51
|
+
colCreatePerson(input: $input) {
|
|
52
|
+
id treeId givenName familyName gender lifeStatus birthDate tags createdAt
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
`,$=`
|
|
56
|
+
mutation ColUpdatePerson($id: ID!, $input: ColUpdatePersonInput!) {
|
|
57
|
+
colUpdatePerson(id: $id, input: $input) {
|
|
58
|
+
id treeId givenName familyName gender lifeStatus birthDate tags updatedAt
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
`,P=`
|
|
62
|
+
mutation ColDeletePerson($id: ID!) {
|
|
63
|
+
colDeletePerson(id: $id)
|
|
64
|
+
}
|
|
65
|
+
`,L=`
|
|
66
|
+
query ColListRelationships($treeId: ID, $personId: ID) {
|
|
67
|
+
colListRelationships(treeId: $treeId, personId: $personId) {
|
|
68
|
+
id treeId fromPersonId toPersonId type certainty startDate endDate notes
|
|
69
|
+
createdAt updatedAt workspaceId
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
`,N=`
|
|
73
|
+
mutation ColCreateRelationship($input: ColCreateRelationshipInput!) {
|
|
74
|
+
colCreateRelationship(input: $input) {
|
|
75
|
+
id treeId fromPersonId toPersonId type certainty startDate endDate notes createdAt
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
`,F=`
|
|
79
|
+
mutation ColDeleteRelationship($id: ID!) {
|
|
80
|
+
colDeleteRelationship(id: $id)
|
|
81
|
+
}
|
|
82
|
+
`,_=`
|
|
83
|
+
query ColTimeline($treeId: ID!, $personId: ID, $type: ColEventType) {
|
|
84
|
+
colTimeline(treeId: $treeId, personId: $personId, type: $type) {
|
|
85
|
+
id treeId personId title description type date place isApproximate
|
|
86
|
+
createdAt updatedAt workspaceId
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
`,U=`
|
|
90
|
+
mutation ColCreateEvent($input: ColCreateEventInput!) {
|
|
91
|
+
colCreateEvent(input: $input) {
|
|
92
|
+
id treeId personId title description type date place isApproximate createdAt
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
`,q=`
|
|
96
|
+
mutation ColDeleteEvent($id: ID!) {
|
|
97
|
+
colDeleteEvent(id: $id)
|
|
98
|
+
}
|
|
99
|
+
`,W=`
|
|
100
|
+
query ColGetMemory($id: ID!) {
|
|
101
|
+
colMemory(id: $id) {
|
|
102
|
+
id treeId personId title description kind place takenAt tags visibility
|
|
103
|
+
file { id }
|
|
104
|
+
comments { id body createdAt }
|
|
105
|
+
createdAt updatedAt workspaceId
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
`,G=`
|
|
109
|
+
query ColListMemories(
|
|
110
|
+
$treeId: ID
|
|
111
|
+
$personId: ID
|
|
112
|
+
$kind: ColMemoryKind
|
|
113
|
+
$pagination: PaginationInput
|
|
114
|
+
) {
|
|
115
|
+
colListMemories(treeId: $treeId, personId: $personId, kind: $kind, pagination: $pagination) {
|
|
116
|
+
items { id treeId title kind place takenAt visibility createdAt }
|
|
117
|
+
pageInfo { cursor hasMore }
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
`,H=`
|
|
121
|
+
mutation ColCreateMemory($input: ColCreateMemoryInput!) {
|
|
122
|
+
colCreateMemory(input: $input) {
|
|
123
|
+
id treeId personId title description kind place takenAt tags visibility createdAt
|
|
124
|
+
file { id }
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
`,V=`
|
|
128
|
+
mutation ColUpdateMemory($id: ID!, $input: ColUpdateMemoryInput!) {
|
|
129
|
+
colUpdateMemory(id: $id, input: $input) {
|
|
130
|
+
id treeId title description kind place takenAt tags visibility updatedAt
|
|
131
|
+
file { id }
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
`,j=`
|
|
135
|
+
mutation ColDeleteMemory($id: ID!) {
|
|
136
|
+
colDeleteMemory(id: $id)
|
|
137
|
+
}
|
|
138
|
+
`,B=`
|
|
139
|
+
query ColGetStory($id: ID!) {
|
|
140
|
+
colStory(id: $id) {
|
|
141
|
+
id treeId personId title body format narrator tags visibility
|
|
142
|
+
recordingFile { id }
|
|
143
|
+
comments { id body createdAt }
|
|
144
|
+
createdAt updatedAt workspaceId
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
`,Y=`
|
|
148
|
+
query ColListStories($treeId: ID, $personId: ID, $pagination: PaginationInput) {
|
|
149
|
+
colListStories(treeId: $treeId, personId: $personId, pagination: $pagination) {
|
|
150
|
+
items { id treeId title format narrator visibility createdAt }
|
|
151
|
+
pageInfo { cursor hasMore }
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
`,z=`
|
|
155
|
+
mutation ColCreateStory($input: ColCreateStoryInput!) {
|
|
156
|
+
colCreateStory(input: $input) {
|
|
157
|
+
id treeId personId title body format narrator tags visibility createdAt
|
|
158
|
+
recordingFile { id }
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
`,K=`
|
|
162
|
+
mutation ColDeleteStory($id: ID!) {
|
|
163
|
+
colDeleteStory(id: $id)
|
|
164
|
+
}
|
|
165
|
+
`,J=`
|
|
166
|
+
query ColListComments($memoryId: ID, $storyId: ID) {
|
|
167
|
+
colListComments(memoryId: $memoryId, storyId: $storyId) {
|
|
168
|
+
id body memoryId storyId createdAt updatedAt workspaceId
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
`,Q=`
|
|
172
|
+
mutation ColAddComment($input: ColCreateCommentInput!) {
|
|
173
|
+
colAddComment(input: $input) {
|
|
174
|
+
id body memoryId storyId createdAt
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
`,X=`
|
|
178
|
+
mutation ColDeleteComment($id: ID!) {
|
|
179
|
+
colDeleteComment(id: $id)
|
|
180
|
+
}
|
|
181
|
+
`,Z=`
|
|
182
|
+
query ColListMemberships($treeId: ID!) {
|
|
183
|
+
colListMemberships(treeId: $treeId) {
|
|
184
|
+
id treeId memberUserId personId role status invitedAt acceptedAt
|
|
185
|
+
invitedById createdAt updatedAt workspaceId
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
`,ee=`
|
|
189
|
+
mutation ColInviteMember($input: ColInviteMemberInput!) {
|
|
190
|
+
colInviteMember(input: $input) {
|
|
191
|
+
id treeId memberUserId personId role status invitedAt
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
`,te=`
|
|
195
|
+
mutation ColAcceptMembership($id: ID!) {
|
|
196
|
+
colAcceptMembership(id: $id) {
|
|
197
|
+
id treeId memberUserId role status acceptedAt updatedAt
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
`,re=`
|
|
201
|
+
mutation ColRemoveMember($id: ID!) {
|
|
202
|
+
colRemoveMember(id: $id)
|
|
203
|
+
}
|
|
204
|
+
`,ne=`
|
|
205
|
+
query ColHealth {
|
|
206
|
+
colHealth
|
|
207
|
+
}
|
|
208
|
+
`;function m(o){let n=Number.parseInt(o,10);if(Number.isNaN(n))throw new p(`Expected an integer but got "${o}"`);return n}function u(o){return o.split(",").map(n=>n.trim()).filter(n=>n.length>0)}function oe(o){let n=o.command("trees").description("Collabkin family trees");n.command("list").description("List family trees").option("--status <s>","ACTIVE|ARCHIVED").option("--limit <n>","Page size",m,50).option("--offset <n>","Offset",m,0).option("-f, --format <format>","Output format").action(async e=>{try{let t=await a(x,{status:e.status?e.status.toUpperCase():void 0,pagination:{limit:e.limit,offset:e.offset}});s(e,t.colListFamilyTrees.items,{headers:["ID","Name","Surname","Status","Tags"],rows:t.colListFamilyTrees.items.map(r=>[d(r.id,12),r.name,r.surname??"-",r.status,(r.tags??[]).join(", ")])});}catch(t){i(t);}}),n.command("get").description("Get a family tree by id").argument("<id>","Family tree ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let r=await a(D,{id:e});if(!r.colFamilyTree)throw new p(`Family tree ${e} not found`);s(t,r.colFamilyTree);}catch(r){i(r);}}),n.command("create").description("Create a family tree").requiredOption("--name <name>","Tree name").option("--surname <s>","Family surname").option("--description <s>","Description").option("--cover-file <id>","Cover file ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async e=>{try{let t={name:e.name};e.surname&&(t.surname=e.surname),e.description&&(t.description=e.description),e.coverFile&&(t.coverFileId=e.coverFile),e.tags&&(t.tags=u(e.tags));let r=await a(v,{input:t});c(`Family tree created: ${r.colCreateFamilyTree.name}`),s(e,r.colCreateFamilyTree);}catch(t){i(t);}}),n.command("update").description("Update a family tree").argument("<id>","Family tree ID").option("--name <name>","Tree name").option("--surname <s>","Family surname").option("--description <s>","Description").option("--cover-file <id>","Cover file ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let r={};if(t.name&&(r.name=t.name),t.surname!==void 0&&(r.surname=t.surname),t.description!==void 0&&(r.description=t.description),t.coverFile&&(r.coverFileId=t.coverFile),t.tags&&(r.tags=u(t.tags)),!Object.keys(r).length)throw new p("No updates specified");let h=await a(A,{id:e,input:r});c("Family tree updated"),s(t,h.colUpdateFamilyTree);}catch(r){i(r);}}),n.command("archive").description("Archive a family tree").argument("<id>","Family tree ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let r=await a(S,{id:e});c(`Family tree archived: ${r.colArchiveFamilyTree}`),s(t,{archived:r.colArchiveFamilyTree});}catch(r){i(r);}});}function ie(o){let n=o.command("people").description("Collabkin people");n.command("list").description("List people in a tree").option("--tree <id>","Filter by family tree ID").option("--life-status <s>","LIVING|DECEASED|UNKNOWN").option("--limit <n>","Page size",m,50).option("--offset <n>","Offset",m,0).option("-f, --format <format>","Output format").action(async e=>{try{let t=await a(O,{treeId:e.tree,lifeStatus:e.lifeStatus?e.lifeStatus.toUpperCase():void 0,pagination:{limit:e.limit,offset:e.offset}});s(e,t.colListPeople.items,{headers:["ID","Given","Family","Gender","Life","Born"],rows:t.colListPeople.items.map(r=>[d(r.id,12),r.givenName,r.familyName??"-",r.gender,r.lifeStatus,I(r.birthDate)])});}catch(t){i(t);}}),n.command("get").description("Get a person by id").argument("<id>","Person ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let r=await a(R,{id:e});if(!r.colPerson)throw new p(`Person ${e} not found`);s(t,r.colPerson);}catch(r){i(r);}}),n.command("create").description("Create a person").requiredOption("--tree <id>","Family tree ID").requiredOption("--given-name <name>","Given name").option("--family-name <name>","Family name").option("--maiden-name <name>","Maiden name").option("--nickname <name>","Nickname").option("--gender <g>","MALE|FEMALE|OTHER|UNKNOWN").option("--life-status <s>","LIVING|DECEASED|UNKNOWN").option("--birth-date <iso>","Birth date (ISO)").option("--birth-place <s>","Birth place").option("--death-date <iso>","Death date (ISO)").option("--bio <s>","Biography").option("--linked-user <id>","Linked user ID").option("--photo-file <id>","Photo file ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async e=>{try{let t={treeId:e.tree,givenName:e.givenName};e.familyName&&(t.familyName=e.familyName),e.maidenName&&(t.maidenName=e.maidenName),e.nickname&&(t.nickname=e.nickname),e.gender&&(t.gender=e.gender.toUpperCase()),e.lifeStatus&&(t.lifeStatus=e.lifeStatus.toUpperCase()),e.birthDate&&(t.birthDate=e.birthDate),e.birthPlace&&(t.birthPlace=e.birthPlace),e.deathDate&&(t.deathDate=e.deathDate),e.bio&&(t.bio=e.bio),e.linkedUser&&(t.linkedUserId=e.linkedUser),e.photoFile&&(t.photoFileId=e.photoFile),e.tags&&(t.tags=u(e.tags));let r=await a(M,{input:t});c(`Person created: ${r.colCreatePerson.givenName}`),s(e,r.colCreatePerson);}catch(t){i(t);}}),n.command("update").description("Update a person").argument("<id>","Person ID").option("--given-name <name>","Given name").option("--family-name <name>","Family name").option("--maiden-name <name>","Maiden name").option("--nickname <name>","Nickname").option("--gender <g>","MALE|FEMALE|OTHER|UNKNOWN").option("--life-status <s>","LIVING|DECEASED|UNKNOWN").option("--birth-date <iso>","Birth date (ISO)").option("--birth-place <s>","Birth place").option("--death-date <iso>","Death date (ISO)").option("--bio <s>","Biography").option("--linked-user <id>","Linked user ID").option("--photo-file <id>","Photo file ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let r={};if(t.givenName&&(r.givenName=t.givenName),t.familyName!==void 0&&(r.familyName=t.familyName),t.maidenName!==void 0&&(r.maidenName=t.maidenName),t.nickname!==void 0&&(r.nickname=t.nickname),t.gender&&(r.gender=t.gender.toUpperCase()),t.lifeStatus&&(r.lifeStatus=t.lifeStatus.toUpperCase()),t.birthDate&&(r.birthDate=t.birthDate),t.birthPlace!==void 0&&(r.birthPlace=t.birthPlace),t.deathDate&&(r.deathDate=t.deathDate),t.bio!==void 0&&(r.bio=t.bio),t.linkedUser&&(r.linkedUserId=t.linkedUser),t.photoFile&&(r.photoFileId=t.photoFile),t.tags&&(r.tags=u(t.tags)),!Object.keys(r).length)throw new p("No updates specified");let h=await a($,{id:e,input:r});c("Person updated"),s(t,h.colUpdatePerson);}catch(r){i(r);}}),n.command("remove").description("Delete a person").argument("<id>","Person ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let r=await a(P,{id:e});c(`Person deleted: ${r.colDeletePerson}`),s(t,{deleted:r.colDeletePerson});}catch(r){i(r);}});}function se(o){let n=o.command("relationships").description("Collabkin relationships between people");n.command("list").description("List relationships in a tree (optionally for one person)").option("--tree <id>","Filter by family tree ID").option("--person <id>","Filter by person ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await a(L,{treeId:e.tree,personId:e.person});s(e,t.colListRelationships,{headers:["ID","From","To","Type","Certainty"],rows:t.colListRelationships.map(r=>[d(r.id,12),d(r.fromPersonId,12),d(r.toPersonId,12),r.type,r.certainty])});}catch(t){i(t);}}),n.command("create").description("Create a relationship between two people").requiredOption("--tree <id>","Family tree ID").requiredOption("--from <id>","From person ID").requiredOption("--to <id>","To person ID").requiredOption("--type <t>","PARENT|CHILD|SPOUSE|PARTNER|SIBLING|GRANDPARENT|GRANDCHILD|GUARDIAN").option("--certainty <c>","CONFIRMED|PROBABLE|DISPUTED|UNVERIFIED").option("--start-date <iso>","Start date (ISO)").option("--end-date <iso>","End date (ISO)").option("--notes <s>","Notes").option("-f, --format <format>","Output format").action(async e=>{try{let t={treeId:e.tree,fromPersonId:e.from,toPersonId:e.to,type:e.type.toUpperCase()};e.certainty&&(t.certainty=e.certainty.toUpperCase()),e.startDate&&(t.startDate=e.startDate),e.endDate&&(t.endDate=e.endDate),e.notes&&(t.notes=e.notes);let r=await a(N,{input:t});c(`Relationship created: ${r.colCreateRelationship.type}`),s(e,r.colCreateRelationship);}catch(t){i(t);}}),n.command("remove").description("Delete a relationship").argument("<id>","Relationship ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let r=await a(F,{id:e});c(`Relationship deleted: ${r.colDeleteRelationship}`),s(t,{deleted:r.colDeleteRelationship});}catch(r){i(r);}});}function ae(o){let n=o.command("events").description("Collabkin timeline events");n.command("timeline").description("Show the family timeline (dated events) for a tree").requiredOption("--tree <id>","Family tree ID").option("--person <id>","Filter by person ID").option("--type <t>","Filter by event type").option("-f, --format <format>","Output format").action(async e=>{try{let t=await a(_,{treeId:e.tree,personId:e.person,type:e.type?e.type.toUpperCase():void 0});s(e,t.colTimeline,{headers:["ID","Title","Type","Date","Place","Approx"],rows:t.colTimeline.map(r=>[d(r.id,12),r.title,r.type,I(r.date),r.place??"-",r.isApproximate?"yes":"no"])});}catch(t){i(t);}}),n.command("create").description("Create a timeline event").requiredOption("--tree <id>","Family tree ID").requiredOption("--title <t>","Event title").requiredOption("--date <iso>","Event date (ISO)").option("--type <t>","BIRTH|DEATH|MARRIAGE|DIVORCE|EDUCATION|MILITARY|IMMIGRATION|RESIDENCE|MILESTONE|OTHER").option("--description <s>","Description").option("--place <s>","Place").option("--person <id>","Associated person ID").option("--approximate","Mark the date as approximate").option("-f, --format <format>","Output format").action(async e=>{try{let t={treeId:e.tree,title:e.title,date:e.date};e.type&&(t.type=e.type.toUpperCase()),e.description&&(t.description=e.description),e.place&&(t.place=e.place),e.person&&(t.personId=e.person),e.approximate&&(t.isApproximate=!0);let r=await a(U,{input:t});c(`Event created: ${r.colCreateEvent.title}`),s(e,r.colCreateEvent);}catch(t){i(t);}}),n.command("remove").description("Delete a timeline event").argument("<id>","Event ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let r=await a(q,{id:e});c(`Event deleted: ${r.colDeleteEvent}`),s(t,{deleted:r.colDeleteEvent});}catch(r){i(r);}});}function ce(o){let n=o.command("memories").description("Collabkin memories (media)");n.command("list").description("List memories").option("--tree <id>","Filter by family tree ID").option("--person <id>","Filter by person ID").option("--kind <k>","PHOTO|VIDEO|AUDIO|DOCUMENT|ARTIFACT").option("--limit <n>","Page size",m,50).option("--offset <n>","Offset",m,0).option("-f, --format <format>","Output format").action(async e=>{try{let t=await a(G,{treeId:e.tree,personId:e.person,kind:e.kind?e.kind.toUpperCase():void 0,pagination:{limit:e.limit,offset:e.offset}});s(e,t.colListMemories.items,{headers:["ID","Title","Kind","Place","Taken","Visibility"],rows:t.colListMemories.items.map(r=>[d(r.id,12),r.title,r.kind,r.place??"-",I(r.takenAt),r.visibility])});}catch(t){i(t);}}),n.command("get").description("Get a memory by id").argument("<id>","Memory ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let r=await a(W,{id:e});if(!r.colMemory)throw new p(`Memory ${e} not found`);s(t,r.colMemory);}catch(r){i(r);}}),n.command("create").description("Create a memory").requiredOption("--tree <id>","Family tree ID").requiredOption("--title <t>","Memory title").option("--kind <k>","PHOTO|VIDEO|AUDIO|DOCUMENT|ARTIFACT").option("--description <s>","Description").option("--place <s>","Place").option("--taken-at <iso>","Taken at (ISO)").option("--person <id>","Associated person ID").option("--file <id>","File ID (media blob)").option("--visibility <v>","TREE|STEWARDS|PRIVATE").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async e=>{try{let t={treeId:e.tree,title:e.title};e.kind&&(t.kind=e.kind.toUpperCase()),e.description&&(t.description=e.description),e.place&&(t.place=e.place),e.takenAt&&(t.takenAt=e.takenAt),e.person&&(t.personId=e.person),e.file&&(t.fileId=e.file),e.visibility&&(t.visibility=e.visibility.toUpperCase()),e.tags&&(t.tags=u(e.tags));let r=await a(H,{input:t});c(`Memory created: ${r.colCreateMemory.title}`),s(e,r.colCreateMemory);}catch(t){i(t);}}),n.command("update").description("Update a memory").argument("<id>","Memory ID").option("--title <t>","Memory title").option("--kind <k>","PHOTO|VIDEO|AUDIO|DOCUMENT|ARTIFACT").option("--description <s>","Description").option("--place <s>","Place").option("--taken-at <iso>","Taken at (ISO)").option("--person <id>","Associated person ID").option("--file <id>","File ID (media blob)").option("--visibility <v>","TREE|STEWARDS|PRIVATE").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let r={};if(t.title&&(r.title=t.title),t.kind&&(r.kind=t.kind.toUpperCase()),t.description!==void 0&&(r.description=t.description),t.place!==void 0&&(r.place=t.place),t.takenAt&&(r.takenAt=t.takenAt),t.person&&(r.personId=t.person),t.file&&(r.fileId=t.file),t.visibility&&(r.visibility=t.visibility.toUpperCase()),t.tags&&(r.tags=u(t.tags)),!Object.keys(r).length)throw new p("No updates specified");let h=await a(V,{id:e,input:r});c("Memory updated"),s(t,h.colUpdateMemory);}catch(r){i(r);}}),n.command("remove").description("Delete a memory").argument("<id>","Memory ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let r=await a(j,{id:e});c(`Memory deleted: ${r.colDeleteMemory}`),s(t,{deleted:r.colDeleteMemory});}catch(r){i(r);}});}function pe(o){let n=o.command("stories").description("Collabkin stories");n.command("list").description("List stories").option("--tree <id>","Filter by family tree ID").option("--person <id>","Filter by person ID").option("--limit <n>","Page size",m,50).option("--offset <n>","Offset",m,0).option("-f, --format <format>","Output format").action(async e=>{try{let t=await a(Y,{treeId:e.tree,personId:e.person,pagination:{limit:e.limit,offset:e.offset}});s(e,t.colListStories.items,{headers:["ID","Title","Format","Narrator","Visibility"],rows:t.colListStories.items.map(r=>[d(r.id,12),r.title,r.format,r.narrator??"-",r.visibility])});}catch(t){i(t);}}),n.command("get").description("Get a story by id").argument("<id>","Story ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let r=await a(B,{id:e});if(!r.colStory)throw new p(`Story ${e} not found`);s(t,r.colStory);}catch(r){i(r);}}),n.command("create").description("Create a story").requiredOption("--tree <id>","Family tree ID").requiredOption("--title <t>","Story title").option("--body <s>","Story body").option("--story-format <f>","WRITTEN|AUDIO|VIDEO").option("--narrator <s>","Narrator").option("--person <id>","Associated person ID").option("--recording-file <id>","Recording file ID").option("--visibility <v>","TREE|STEWARDS|PRIVATE").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async e=>{try{let t={treeId:e.tree,title:e.title};e.body&&(t.body=e.body),e.storyFormat&&(t.format=e.storyFormat.toUpperCase()),e.narrator&&(t.narrator=e.narrator),e.person&&(t.personId=e.person),e.recordingFile&&(t.recordingFileId=e.recordingFile),e.visibility&&(t.visibility=e.visibility.toUpperCase()),e.tags&&(t.tags=u(e.tags));let r=await a(z,{input:t});c(`Story created: ${r.colCreateStory.title}`),s(e,r.colCreateStory);}catch(t){i(t);}}),n.command("remove").description("Delete a story").argument("<id>","Story ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let r=await a(K,{id:e});c(`Story deleted: ${r.colDeleteStory}`),s(t,{deleted:r.colDeleteStory});}catch(r){i(r);}});}function de(o){let n=o.command("comments").description("Collabkin comments on memories & stories");n.command("list").description("List comments for a memory or a story").option("--memory <id>","Memory ID").option("--story <id>","Story ID").option("-f, --format <format>","Output format").action(async e=>{try{if(!e.memory&&!e.story)throw new p("Specify --memory or --story");let t=await a(J,{memoryId:e.memory,storyId:e.story});s(e,t.colListComments,{headers:["ID","Body","Memory","Story"],rows:t.colListComments.map(r=>[d(r.id,12),d(r.body,40),r.memoryId?d(r.memoryId,12):"-",r.storyId?d(r.storyId,12):"-"])});}catch(t){i(t);}}),n.command("add").description("Add a comment to a memory or a story").requiredOption("--body <text>","Comment body").option("--memory <id>","Memory ID").option("--story <id>","Story ID").option("-f, --format <format>","Output format").action(async e=>{try{if(!e.memory&&!e.story)throw new p("Specify --memory or --story");let t={body:e.body};e.memory&&(t.memoryId=e.memory),e.story&&(t.storyId=e.story);let r=await a(Q,{input:t});c("Comment added"),s(e,r.colAddComment);}catch(t){i(t);}}),n.command("remove").description("Delete a comment").argument("<id>","Comment ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let r=await a(X,{id:e});c(`Comment deleted: ${r.colDeleteComment}`),s(t,{deleted:r.colDeleteComment});}catch(r){i(r);}});}function le(o){let n=o.command("memberships").description("Collabkin family-tree memberships");n.command("list").description("List memberships for a tree").requiredOption("--tree <id>","Family tree ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await a(Z,{treeId:e.tree});s(e,t.colListMemberships,{headers:["ID","Member","Person","Role","Status"],rows:t.colListMemberships.map(r=>[d(r.id,12),d(r.memberUserId,12),r.personId?d(r.personId,12):"-",r.role,r.status])});}catch(t){i(t);}}),n.command("invite").description("Invite a member to a family tree").requiredOption("--tree <id>","Family tree ID").requiredOption("--member <id>","Member user ID").option("--person <id>","Linked person ID").option("--role <r>","OWNER|STEWARD|CONTRIBUTOR|VIEWER").option("-f, --format <format>","Output format").action(async e=>{try{let t={treeId:e.tree,memberUserId:e.member};e.person&&(t.personId=e.person),e.role&&(t.role=e.role.toUpperCase());let r=await a(ee,{input:t});c(`Member invited: ${r.colInviteMember.memberUserId}`),s(e,r.colInviteMember);}catch(t){i(t);}}),n.command("accept").description("Accept a membership invitation").argument("<id>","Membership ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let r=await a(te,{id:e});c(`Membership accepted: ${r.colAcceptMembership.status}`),s(t,r.colAcceptMembership);}catch(r){i(r);}}),n.command("remove").description("Remove a member from a family tree").argument("<id>","Membership ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let r=await a(re,{id:e});c(`Member removed: ${r.colRemoveMember}`),s(t,{removed:r.colRemoveMember});}catch(r){i(r);}});}function me(o){o.command("health").description("Collabkin service health check (public)").option("-f, --format <format>","Output format").action(async n=>{try{let e=await b(ne);c(e.colHealth),s(n,{health:e.colHealth});}catch(e){i(e);}});}var De={id:"collabkin",version:"1.0.0",displayName:"Collabkin",dependsOn:["auth","workspaces"],register(o,n){T(n);let e=o.command("collabkin").description("Collabkin collaborative family history");oe(e),ie(e),se(e),ae(e),ce(e),pe(e),de(e),le(e),me(e);}},Ir=De;module.exports=Ir;
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import {a,b as b$1,h as h$1,p,g,i,o as o$1,d}from'../../chunk-WXDQ3S5J.js';import {o}from'../../chunk-TCBALVP4.js';var D=`
|
|
2
|
+
query ColGetFamilyTree($id: ID!) {
|
|
3
|
+
colFamilyTree(id: $id) {
|
|
4
|
+
id name surname description status tags createdAt updatedAt workspaceId
|
|
5
|
+
coverFile { id }
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
`,h=`
|
|
9
|
+
query ColListFamilyTrees($pagination: PaginationInput, $status: ColTreeStatus) {
|
|
10
|
+
colListFamilyTrees(pagination: $pagination, status: $status) {
|
|
11
|
+
items { id name surname status tags createdAt }
|
|
12
|
+
pageInfo { cursor hasMore }
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`,b=`
|
|
16
|
+
mutation ColCreateFamilyTree($input: ColCreateFamilyTreeInput!) {
|
|
17
|
+
colCreateFamilyTree(input: $input) {
|
|
18
|
+
id name surname description status tags createdAt
|
|
19
|
+
coverFile { id }
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
`,T=`
|
|
23
|
+
mutation ColUpdateFamilyTree($id: ID!, $input: ColUpdateFamilyTreeInput!) {
|
|
24
|
+
colUpdateFamilyTree(id: $id, input: $input) {
|
|
25
|
+
id name surname description status tags updatedAt
|
|
26
|
+
coverFile { id }
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`,R=`
|
|
30
|
+
mutation ColArchiveFamilyTree($id: ID!) {
|
|
31
|
+
colArchiveFamilyTree(id: $id)
|
|
32
|
+
}
|
|
33
|
+
`,A=`
|
|
34
|
+
query ColGetPerson($id: ID!) {
|
|
35
|
+
colPerson(id: $id) {
|
|
36
|
+
id treeId givenName familyName maidenName nickname gender lifeStatus
|
|
37
|
+
birthDate birthPlace deathDate bio tags linkedUserId
|
|
38
|
+
photoFile { id }
|
|
39
|
+
createdAt updatedAt workspaceId
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
`,M=`
|
|
43
|
+
query ColListPeople($treeId: ID, $lifeStatus: ColLifeStatus, $pagination: PaginationInput) {
|
|
44
|
+
colListPeople(treeId: $treeId, lifeStatus: $lifeStatus, pagination: $pagination) {
|
|
45
|
+
items { id treeId givenName familyName gender lifeStatus birthDate createdAt }
|
|
46
|
+
pageInfo { cursor hasMore }
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
`,O=`
|
|
50
|
+
mutation ColCreatePerson($input: ColCreatePersonInput!) {
|
|
51
|
+
colCreatePerson(input: $input) {
|
|
52
|
+
id treeId givenName familyName gender lifeStatus birthDate tags createdAt
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
`,S=`
|
|
56
|
+
mutation ColUpdatePerson($id: ID!, $input: ColUpdatePersonInput!) {
|
|
57
|
+
colUpdatePerson(id: $id, input: $input) {
|
|
58
|
+
id treeId givenName familyName gender lifeStatus birthDate tags updatedAt
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
`,v=`
|
|
62
|
+
mutation ColDeletePerson($id: ID!) {
|
|
63
|
+
colDeletePerson(id: $id)
|
|
64
|
+
}
|
|
65
|
+
`,k=`
|
|
66
|
+
query ColListRelationships($treeId: ID, $personId: ID) {
|
|
67
|
+
colListRelationships(treeId: $treeId, personId: $personId) {
|
|
68
|
+
id treeId fromPersonId toPersonId type certainty startDate endDate notes
|
|
69
|
+
createdAt updatedAt workspaceId
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
`,w=`
|
|
73
|
+
mutation ColCreateRelationship($input: ColCreateRelationshipInput!) {
|
|
74
|
+
colCreateRelationship(input: $input) {
|
|
75
|
+
id treeId fromPersonId toPersonId type certainty startDate endDate notes createdAt
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
`,N=`
|
|
79
|
+
mutation ColDeleteRelationship($id: ID!) {
|
|
80
|
+
colDeleteRelationship(id: $id)
|
|
81
|
+
}
|
|
82
|
+
`,P=`
|
|
83
|
+
query ColTimeline($treeId: ID!, $personId: ID, $type: ColEventType) {
|
|
84
|
+
colTimeline(treeId: $treeId, personId: $personId, type: $type) {
|
|
85
|
+
id treeId personId title description type date place isApproximate
|
|
86
|
+
createdAt updatedAt workspaceId
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
`,L=`
|
|
90
|
+
mutation ColCreateEvent($input: ColCreateEventInput!) {
|
|
91
|
+
colCreateEvent(input: $input) {
|
|
92
|
+
id treeId personId title description type date place isApproximate createdAt
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
`,$=`
|
|
96
|
+
mutation ColDeleteEvent($id: ID!) {
|
|
97
|
+
colDeleteEvent(id: $id)
|
|
98
|
+
}
|
|
99
|
+
`,F=`
|
|
100
|
+
query ColGetMemory($id: ID!) {
|
|
101
|
+
colMemory(id: $id) {
|
|
102
|
+
id treeId personId title description kind place takenAt tags visibility
|
|
103
|
+
file { id }
|
|
104
|
+
comments { id body createdAt }
|
|
105
|
+
createdAt updatedAt workspaceId
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
`,U=`
|
|
109
|
+
query ColListMemories(
|
|
110
|
+
$treeId: ID
|
|
111
|
+
$personId: ID
|
|
112
|
+
$kind: ColMemoryKind
|
|
113
|
+
$pagination: PaginationInput
|
|
114
|
+
) {
|
|
115
|
+
colListMemories(treeId: $treeId, personId: $personId, kind: $kind, pagination: $pagination) {
|
|
116
|
+
items { id treeId title kind place takenAt visibility createdAt }
|
|
117
|
+
pageInfo { cursor hasMore }
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
`,x=`
|
|
121
|
+
mutation ColCreateMemory($input: ColCreateMemoryInput!) {
|
|
122
|
+
colCreateMemory(input: $input) {
|
|
123
|
+
id treeId personId title description kind place takenAt tags visibility createdAt
|
|
124
|
+
file { id }
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
`,_=`
|
|
128
|
+
mutation ColUpdateMemory($id: ID!, $input: ColUpdateMemoryInput!) {
|
|
129
|
+
colUpdateMemory(id: $id, input: $input) {
|
|
130
|
+
id treeId title description kind place takenAt tags visibility updatedAt
|
|
131
|
+
file { id }
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
`,H=`
|
|
135
|
+
mutation ColDeleteMemory($id: ID!) {
|
|
136
|
+
colDeleteMemory(id: $id)
|
|
137
|
+
}
|
|
138
|
+
`,q=`
|
|
139
|
+
query ColGetStory($id: ID!) {
|
|
140
|
+
colStory(id: $id) {
|
|
141
|
+
id treeId personId title body format narrator tags visibility
|
|
142
|
+
recordingFile { id }
|
|
143
|
+
comments { id body createdAt }
|
|
144
|
+
createdAt updatedAt workspaceId
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
`,G=`
|
|
148
|
+
query ColListStories($treeId: ID, $personId: ID, $pagination: PaginationInput) {
|
|
149
|
+
colListStories(treeId: $treeId, personId: $personId, pagination: $pagination) {
|
|
150
|
+
items { id treeId title format narrator visibility createdAt }
|
|
151
|
+
pageInfo { cursor hasMore }
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
`,V=`
|
|
155
|
+
mutation ColCreateStory($input: ColCreateStoryInput!) {
|
|
156
|
+
colCreateStory(input: $input) {
|
|
157
|
+
id treeId personId title body format narrator tags visibility createdAt
|
|
158
|
+
recordingFile { id }
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
`,Y=`
|
|
162
|
+
mutation ColDeleteStory($id: ID!) {
|
|
163
|
+
colDeleteStory(id: $id)
|
|
164
|
+
}
|
|
165
|
+
`,W=`
|
|
166
|
+
query ColListComments($memoryId: ID, $storyId: ID) {
|
|
167
|
+
colListComments(memoryId: $memoryId, storyId: $storyId) {
|
|
168
|
+
id body memoryId storyId createdAt updatedAt workspaceId
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
`,B=`
|
|
172
|
+
mutation ColAddComment($input: ColCreateCommentInput!) {
|
|
173
|
+
colAddComment(input: $input) {
|
|
174
|
+
id body memoryId storyId createdAt
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
`,K=`
|
|
178
|
+
mutation ColDeleteComment($id: ID!) {
|
|
179
|
+
colDeleteComment(id: $id)
|
|
180
|
+
}
|
|
181
|
+
`,j=`
|
|
182
|
+
query ColListMemberships($treeId: ID!) {
|
|
183
|
+
colListMemberships(treeId: $treeId) {
|
|
184
|
+
id treeId memberUserId personId role status invitedAt acceptedAt
|
|
185
|
+
invitedById createdAt updatedAt workspaceId
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
`,z=`
|
|
189
|
+
mutation ColInviteMember($input: ColInviteMemberInput!) {
|
|
190
|
+
colInviteMember(input: $input) {
|
|
191
|
+
id treeId memberUserId personId role status invitedAt
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
`,J=`
|
|
195
|
+
mutation ColAcceptMembership($id: ID!) {
|
|
196
|
+
colAcceptMembership(id: $id) {
|
|
197
|
+
id treeId memberUserId role status acceptedAt updatedAt
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
`,Q=`
|
|
201
|
+
mutation ColRemoveMember($id: ID!) {
|
|
202
|
+
colRemoveMember(id: $id)
|
|
203
|
+
}
|
|
204
|
+
`,X=`
|
|
205
|
+
query ColHealth {
|
|
206
|
+
colHealth
|
|
207
|
+
}
|
|
208
|
+
`;function c(m){let r=Number.parseInt(m,10);if(Number.isNaN(r))throw new o(`Expected an integer but got "${m}"`);return r}function u(m){return m.split(",").map(r=>r.trim()).filter(r=>r.length>0)}function Z(m){let r=m.command("trees").description("Collabkin family trees");r.command("list").description("List family trees").option("--status <s>","ACTIVE|ARCHIVED").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(h,{status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});h$1(t,e.colListFamilyTrees.items,{headers:["ID","Name","Surname","Status","Tags"],rows:e.colListFamilyTrees.items.map(i=>[p(i.id,12),i.name,i.surname??"-",i.status,(i.tags??[]).join(", ")])});}catch(e){g(e);}}),r.command("get").description("Get a family tree by id").argument("<id>","Family tree ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await b$1(D,{id:t});if(!i.colFamilyTree)throw new o(`Family tree ${t} not found`);h$1(e,i.colFamilyTree);}catch(i){g(i);}}),r.command("create").description("Create a family tree").requiredOption("--name <name>","Tree name").option("--surname <s>","Family surname").option("--description <s>","Description").option("--cover-file <id>","Cover file ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name};t.surname&&(e.surname=t.surname),t.description&&(e.description=t.description),t.coverFile&&(e.coverFileId=t.coverFile),t.tags&&(e.tags=u(t.tags));let i$1=await b$1(b,{input:e});i(`Family tree created: ${i$1.colCreateFamilyTree.name}`),h$1(t,i$1.colCreateFamilyTree);}catch(e){g(e);}}),r.command("update").description("Update a family tree").argument("<id>","Family tree ID").option("--name <name>","Tree name").option("--surname <s>","Family surname").option("--description <s>","Description").option("--cover-file <id>","Cover file ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i$1={};if(e.name&&(i$1.name=e.name),e.surname!==void 0&&(i$1.surname=e.surname),e.description!==void 0&&(i$1.description=e.description),e.coverFile&&(i$1.coverFileId=e.coverFile),e.tags&&(i$1.tags=u(e.tags)),!Object.keys(i$1).length)throw new o("No updates specified");let I=await b$1(T,{id:t,input:i$1});i("Family tree updated"),h$1(e,I.colUpdateFamilyTree);}catch(i){g(i);}}),r.command("archive").description("Archive a family tree").argument("<id>","Family tree ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i$1=await b$1(R,{id:t});i(`Family tree archived: ${i$1.colArchiveFamilyTree}`),h$1(e,{archived:i$1.colArchiveFamilyTree});}catch(i){g(i);}});}function tt(m){let r=m.command("people").description("Collabkin people");r.command("list").description("List people in a tree").option("--tree <id>","Filter by family tree ID").option("--life-status <s>","LIVING|DECEASED|UNKNOWN").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(M,{treeId:t.tree,lifeStatus:t.lifeStatus?t.lifeStatus.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});h$1(t,e.colListPeople.items,{headers:["ID","Given","Family","Gender","Life","Born"],rows:e.colListPeople.items.map(i=>[p(i.id,12),i.givenName,i.familyName??"-",i.gender,i.lifeStatus,o$1(i.birthDate)])});}catch(e){g(e);}}),r.command("get").description("Get a person by id").argument("<id>","Person ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await b$1(A,{id:t});if(!i.colPerson)throw new o(`Person ${t} not found`);h$1(e,i.colPerson);}catch(i){g(i);}}),r.command("create").description("Create a person").requiredOption("--tree <id>","Family tree ID").requiredOption("--given-name <name>","Given name").option("--family-name <name>","Family name").option("--maiden-name <name>","Maiden name").option("--nickname <name>","Nickname").option("--gender <g>","MALE|FEMALE|OTHER|UNKNOWN").option("--life-status <s>","LIVING|DECEASED|UNKNOWN").option("--birth-date <iso>","Birth date (ISO)").option("--birth-place <s>","Birth place").option("--death-date <iso>","Death date (ISO)").option("--bio <s>","Biography").option("--linked-user <id>","Linked user ID").option("--photo-file <id>","Photo file ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={treeId:t.tree,givenName:t.givenName};t.familyName&&(e.familyName=t.familyName),t.maidenName&&(e.maidenName=t.maidenName),t.nickname&&(e.nickname=t.nickname),t.gender&&(e.gender=t.gender.toUpperCase()),t.lifeStatus&&(e.lifeStatus=t.lifeStatus.toUpperCase()),t.birthDate&&(e.birthDate=t.birthDate),t.birthPlace&&(e.birthPlace=t.birthPlace),t.deathDate&&(e.deathDate=t.deathDate),t.bio&&(e.bio=t.bio),t.linkedUser&&(e.linkedUserId=t.linkedUser),t.photoFile&&(e.photoFileId=t.photoFile),t.tags&&(e.tags=u(t.tags));let i$1=await b$1(O,{input:e});i(`Person created: ${i$1.colCreatePerson.givenName}`),h$1(t,i$1.colCreatePerson);}catch(e){g(e);}}),r.command("update").description("Update a person").argument("<id>","Person ID").option("--given-name <name>","Given name").option("--family-name <name>","Family name").option("--maiden-name <name>","Maiden name").option("--nickname <name>","Nickname").option("--gender <g>","MALE|FEMALE|OTHER|UNKNOWN").option("--life-status <s>","LIVING|DECEASED|UNKNOWN").option("--birth-date <iso>","Birth date (ISO)").option("--birth-place <s>","Birth place").option("--death-date <iso>","Death date (ISO)").option("--bio <s>","Biography").option("--linked-user <id>","Linked user ID").option("--photo-file <id>","Photo file ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i$1={};if(e.givenName&&(i$1.givenName=e.givenName),e.familyName!==void 0&&(i$1.familyName=e.familyName),e.maidenName!==void 0&&(i$1.maidenName=e.maidenName),e.nickname!==void 0&&(i$1.nickname=e.nickname),e.gender&&(i$1.gender=e.gender.toUpperCase()),e.lifeStatus&&(i$1.lifeStatus=e.lifeStatus.toUpperCase()),e.birthDate&&(i$1.birthDate=e.birthDate),e.birthPlace!==void 0&&(i$1.birthPlace=e.birthPlace),e.deathDate&&(i$1.deathDate=e.deathDate),e.bio!==void 0&&(i$1.bio=e.bio),e.linkedUser&&(i$1.linkedUserId=e.linkedUser),e.photoFile&&(i$1.photoFileId=e.photoFile),e.tags&&(i$1.tags=u(e.tags)),!Object.keys(i$1).length)throw new o("No updates specified");let I=await b$1(S,{id:t,input:i$1});i("Person updated"),h$1(e,I.colUpdatePerson);}catch(i){g(i);}}),r.command("remove").description("Delete a person").argument("<id>","Person ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i$1=await b$1(v,{id:t});i(`Person deleted: ${i$1.colDeletePerson}`),h$1(e,{deleted:i$1.colDeletePerson});}catch(i){g(i);}});}function et(m){let r=m.command("relationships").description("Collabkin relationships between people");r.command("list").description("List relationships in a tree (optionally for one person)").option("--tree <id>","Filter by family tree ID").option("--person <id>","Filter by person ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(k,{treeId:t.tree,personId:t.person});h$1(t,e.colListRelationships,{headers:["ID","From","To","Type","Certainty"],rows:e.colListRelationships.map(i=>[p(i.id,12),p(i.fromPersonId,12),p(i.toPersonId,12),i.type,i.certainty])});}catch(e){g(e);}}),r.command("create").description("Create a relationship between two people").requiredOption("--tree <id>","Family tree ID").requiredOption("--from <id>","From person ID").requiredOption("--to <id>","To person ID").requiredOption("--type <t>","PARENT|CHILD|SPOUSE|PARTNER|SIBLING|GRANDPARENT|GRANDCHILD|GUARDIAN").option("--certainty <c>","CONFIRMED|PROBABLE|DISPUTED|UNVERIFIED").option("--start-date <iso>","Start date (ISO)").option("--end-date <iso>","End date (ISO)").option("--notes <s>","Notes").option("-f, --format <format>","Output format").action(async t=>{try{let e={treeId:t.tree,fromPersonId:t.from,toPersonId:t.to,type:t.type.toUpperCase()};t.certainty&&(e.certainty=t.certainty.toUpperCase()),t.startDate&&(e.startDate=t.startDate),t.endDate&&(e.endDate=t.endDate),t.notes&&(e.notes=t.notes);let i$1=await b$1(w,{input:e});i(`Relationship created: ${i$1.colCreateRelationship.type}`),h$1(t,i$1.colCreateRelationship);}catch(e){g(e);}}),r.command("remove").description("Delete a relationship").argument("<id>","Relationship ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i$1=await b$1(N,{id:t});i(`Relationship deleted: ${i$1.colDeleteRelationship}`),h$1(e,{deleted:i$1.colDeleteRelationship});}catch(i){g(i);}});}function it(m){let r=m.command("events").description("Collabkin timeline events");r.command("timeline").description("Show the family timeline (dated events) for a tree").requiredOption("--tree <id>","Family tree ID").option("--person <id>","Filter by person ID").option("--type <t>","Filter by event type").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(P,{treeId:t.tree,personId:t.person,type:t.type?t.type.toUpperCase():void 0});h$1(t,e.colTimeline,{headers:["ID","Title","Type","Date","Place","Approx"],rows:e.colTimeline.map(i=>[p(i.id,12),i.title,i.type,o$1(i.date),i.place??"-",i.isApproximate?"yes":"no"])});}catch(e){g(e);}}),r.command("create").description("Create a timeline event").requiredOption("--tree <id>","Family tree ID").requiredOption("--title <t>","Event title").requiredOption("--date <iso>","Event date (ISO)").option("--type <t>","BIRTH|DEATH|MARRIAGE|DIVORCE|EDUCATION|MILITARY|IMMIGRATION|RESIDENCE|MILESTONE|OTHER").option("--description <s>","Description").option("--place <s>","Place").option("--person <id>","Associated person ID").option("--approximate","Mark the date as approximate").option("-f, --format <format>","Output format").action(async t=>{try{let e={treeId:t.tree,title:t.title,date:t.date};t.type&&(e.type=t.type.toUpperCase()),t.description&&(e.description=t.description),t.place&&(e.place=t.place),t.person&&(e.personId=t.person),t.approximate&&(e.isApproximate=!0);let i$1=await b$1(L,{input:e});i(`Event created: ${i$1.colCreateEvent.title}`),h$1(t,i$1.colCreateEvent);}catch(e){g(e);}}),r.command("remove").description("Delete a timeline event").argument("<id>","Event ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i$1=await b$1($,{id:t});i(`Event deleted: ${i$1.colDeleteEvent}`),h$1(e,{deleted:i$1.colDeleteEvent});}catch(i){g(i);}});}function rt(m){let r=m.command("memories").description("Collabkin memories (media)");r.command("list").description("List memories").option("--tree <id>","Filter by family tree ID").option("--person <id>","Filter by person ID").option("--kind <k>","PHOTO|VIDEO|AUDIO|DOCUMENT|ARTIFACT").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(U,{treeId:t.tree,personId:t.person,kind:t.kind?t.kind.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});h$1(t,e.colListMemories.items,{headers:["ID","Title","Kind","Place","Taken","Visibility"],rows:e.colListMemories.items.map(i=>[p(i.id,12),i.title,i.kind,i.place??"-",o$1(i.takenAt),i.visibility])});}catch(e){g(e);}}),r.command("get").description("Get a memory by id").argument("<id>","Memory ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await b$1(F,{id:t});if(!i.colMemory)throw new o(`Memory ${t} not found`);h$1(e,i.colMemory);}catch(i){g(i);}}),r.command("create").description("Create a memory").requiredOption("--tree <id>","Family tree ID").requiredOption("--title <t>","Memory title").option("--kind <k>","PHOTO|VIDEO|AUDIO|DOCUMENT|ARTIFACT").option("--description <s>","Description").option("--place <s>","Place").option("--taken-at <iso>","Taken at (ISO)").option("--person <id>","Associated person ID").option("--file <id>","File ID (media blob)").option("--visibility <v>","TREE|STEWARDS|PRIVATE").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={treeId:t.tree,title:t.title};t.kind&&(e.kind=t.kind.toUpperCase()),t.description&&(e.description=t.description),t.place&&(e.place=t.place),t.takenAt&&(e.takenAt=t.takenAt),t.person&&(e.personId=t.person),t.file&&(e.fileId=t.file),t.visibility&&(e.visibility=t.visibility.toUpperCase()),t.tags&&(e.tags=u(t.tags));let i$1=await b$1(x,{input:e});i(`Memory created: ${i$1.colCreateMemory.title}`),h$1(t,i$1.colCreateMemory);}catch(e){g(e);}}),r.command("update").description("Update a memory").argument("<id>","Memory ID").option("--title <t>","Memory title").option("--kind <k>","PHOTO|VIDEO|AUDIO|DOCUMENT|ARTIFACT").option("--description <s>","Description").option("--place <s>","Place").option("--taken-at <iso>","Taken at (ISO)").option("--person <id>","Associated person ID").option("--file <id>","File ID (media blob)").option("--visibility <v>","TREE|STEWARDS|PRIVATE").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i$1={};if(e.title&&(i$1.title=e.title),e.kind&&(i$1.kind=e.kind.toUpperCase()),e.description!==void 0&&(i$1.description=e.description),e.place!==void 0&&(i$1.place=e.place),e.takenAt&&(i$1.takenAt=e.takenAt),e.person&&(i$1.personId=e.person),e.file&&(i$1.fileId=e.file),e.visibility&&(i$1.visibility=e.visibility.toUpperCase()),e.tags&&(i$1.tags=u(e.tags)),!Object.keys(i$1).length)throw new o("No updates specified");let I=await b$1(_,{id:t,input:i$1});i("Memory updated"),h$1(e,I.colUpdateMemory);}catch(i){g(i);}}),r.command("remove").description("Delete a memory").argument("<id>","Memory ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i$1=await b$1(H,{id:t});i(`Memory deleted: ${i$1.colDeleteMemory}`),h$1(e,{deleted:i$1.colDeleteMemory});}catch(i){g(i);}});}function ot(m){let r=m.command("stories").description("Collabkin stories");r.command("list").description("List stories").option("--tree <id>","Filter by family tree ID").option("--person <id>","Filter by person ID").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(G,{treeId:t.tree,personId:t.person,pagination:{limit:t.limit,offset:t.offset}});h$1(t,e.colListStories.items,{headers:["ID","Title","Format","Narrator","Visibility"],rows:e.colListStories.items.map(i=>[p(i.id,12),i.title,i.format,i.narrator??"-",i.visibility])});}catch(e){g(e);}}),r.command("get").description("Get a story by id").argument("<id>","Story ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await b$1(q,{id:t});if(!i.colStory)throw new o(`Story ${t} not found`);h$1(e,i.colStory);}catch(i){g(i);}}),r.command("create").description("Create a story").requiredOption("--tree <id>","Family tree ID").requiredOption("--title <t>","Story title").option("--body <s>","Story body").option("--story-format <f>","WRITTEN|AUDIO|VIDEO").option("--narrator <s>","Narrator").option("--person <id>","Associated person ID").option("--recording-file <id>","Recording file ID").option("--visibility <v>","TREE|STEWARDS|PRIVATE").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={treeId:t.tree,title:t.title};t.body&&(e.body=t.body),t.storyFormat&&(e.format=t.storyFormat.toUpperCase()),t.narrator&&(e.narrator=t.narrator),t.person&&(e.personId=t.person),t.recordingFile&&(e.recordingFileId=t.recordingFile),t.visibility&&(e.visibility=t.visibility.toUpperCase()),t.tags&&(e.tags=u(t.tags));let i$1=await b$1(V,{input:e});i(`Story created: ${i$1.colCreateStory.title}`),h$1(t,i$1.colCreateStory);}catch(e){g(e);}}),r.command("remove").description("Delete a story").argument("<id>","Story ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i$1=await b$1(Y,{id:t});i(`Story deleted: ${i$1.colDeleteStory}`),h$1(e,{deleted:i$1.colDeleteStory});}catch(i){g(i);}});}function nt(m){let r=m.command("comments").description("Collabkin comments on memories & stories");r.command("list").description("List comments for a memory or a story").option("--memory <id>","Memory ID").option("--story <id>","Story ID").option("-f, --format <format>","Output format").action(async t=>{try{if(!t.memory&&!t.story)throw new o("Specify --memory or --story");let e=await b$1(W,{memoryId:t.memory,storyId:t.story});h$1(t,e.colListComments,{headers:["ID","Body","Memory","Story"],rows:e.colListComments.map(i=>[p(i.id,12),p(i.body,40),i.memoryId?p(i.memoryId,12):"-",i.storyId?p(i.storyId,12):"-"])});}catch(e){g(e);}}),r.command("add").description("Add a comment to a memory or a story").requiredOption("--body <text>","Comment body").option("--memory <id>","Memory ID").option("--story <id>","Story ID").option("-f, --format <format>","Output format").action(async t=>{try{if(!t.memory&&!t.story)throw new o("Specify --memory or --story");let e={body:t.body};t.memory&&(e.memoryId=t.memory),t.story&&(e.storyId=t.story);let i$1=await b$1(B,{input:e});i("Comment added"),h$1(t,i$1.colAddComment);}catch(e){g(e);}}),r.command("remove").description("Delete a comment").argument("<id>","Comment ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i$1=await b$1(K,{id:t});i(`Comment deleted: ${i$1.colDeleteComment}`),h$1(e,{deleted:i$1.colDeleteComment});}catch(i){g(i);}});}function at(m){let r=m.command("memberships").description("Collabkin family-tree memberships");r.command("list").description("List memberships for a tree").requiredOption("--tree <id>","Family tree ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(j,{treeId:t.tree});h$1(t,e.colListMemberships,{headers:["ID","Member","Person","Role","Status"],rows:e.colListMemberships.map(i=>[p(i.id,12),p(i.memberUserId,12),i.personId?p(i.personId,12):"-",i.role,i.status])});}catch(e){g(e);}}),r.command("invite").description("Invite a member to a family tree").requiredOption("--tree <id>","Family tree ID").requiredOption("--member <id>","Member user ID").option("--person <id>","Linked person ID").option("--role <r>","OWNER|STEWARD|CONTRIBUTOR|VIEWER").option("-f, --format <format>","Output format").action(async t=>{try{let e={treeId:t.tree,memberUserId:t.member};t.person&&(e.personId=t.person),t.role&&(e.role=t.role.toUpperCase());let i$1=await b$1(z,{input:e});i(`Member invited: ${i$1.colInviteMember.memberUserId}`),h$1(t,i$1.colInviteMember);}catch(e){g(e);}}),r.command("accept").description("Accept a membership invitation").argument("<id>","Membership ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i$1=await b$1(J,{id:t});i(`Membership accepted: ${i$1.colAcceptMembership.status}`),h$1(e,i$1.colAcceptMembership);}catch(i){g(i);}}),r.command("remove").description("Remove a member from a family tree").argument("<id>","Membership ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i$1=await b$1(Q,{id:t});i(`Member removed: ${i$1.colRemoveMember}`),h$1(e,{removed:i$1.colRemoveMember});}catch(i){g(i);}});}function st(m){m.command("health").description("Collabkin service health check (public)").option("-f, --format <format>","Output format").action(async r=>{try{let t=await d(X);i(t.colHealth),h$1(r,{health:t.colHealth});}catch(t){g(t);}});}var mt={id:"collabkin",version:"1.0.0",displayName:"Collabkin",dependsOn:["auth","workspaces"],register(m,r){a(r);let t=m.command("collabkin").description("Collabkin collaborative family history");Z(t),tt(t),et(t),it(t),rt(t),ot(t),nt(t),at(t),st(t);}},Qt=mt;export{Qt as default};
|