@burdenoff/cli-sdk 2026.1102.3 → 2026.1107.1
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/assethandler/index.cjs +22 -57
- package/dist/modules/assethandler/index.js +27 -62
- package/dist/modules/crewfoundry/index.cjs +63 -116
- package/dist/modules/crewfoundry/index.js +62 -115
- package/dist/modules/headshotmarketing/index.cjs +92 -261
- package/dist/modules/headshotmarketing/index.js +94 -263
- package/dist/modules/hookmovies/index.cjs +17 -6
- package/dist/modules/hookmovies/index.js +20 -9
- package/dist/modules/housingvista/index.cjs +31 -24
- package/dist/modules/housingvista/index.js +26 -19
- package/dist/modules/kadaikodi/index.cjs +56 -90
- package/dist/modules/kadaikodi/index.js +60 -94
- package/dist/modules/movethewheels/index.cjs +103 -231
- package/dist/modules/movethewheels/index.js +103 -231
- package/dist/modules/technospam/index.cjs +82 -64
- package/dist/modules/technospam/index.js +82 -64
- package/dist/modules/timecampus/index.cjs +31 -85
- package/dist/modules/timecampus/index.js +32 -86
- package/package.json +1 -1
|
@@ -1,196 +1,143 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var u=class extends Error{exitCode;hint;constructor(o,n){super(o),this.name="CliUserError",this.exitCode=n?.exitCode??1,this.hint=n?.hint;}},h=class extends u{constructor(o,n){super(o,{exitCode:2,hint:n?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var u=class extends Error{exitCode;hint;constructor(o,n){super(o),this.name="CliUserError",this.exitCode=n?.exitCode??1,this.hint=n?.hint;}},h=class extends u{constructor(o,n){super(o,{exitCode:2,hint:n?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},C=class extends Error{cause;constructor(o,n){super(o),this.name="CliInternalError",this.cause=n;}};var S=null;function U(i){S=i;}function I(){if(!S)throw new C("vibecontrols module helpers used before setHelpersContext was called");return S}function Ae(){let i=I();if(!i.auth.isAuthenticated())throw new h("Authentication required.",{hint:`Run \`${i.productName} auth login\` to authenticate.`})}async function c(i,o){return Ae(),I().gql.workspace.request(i,o)}async function O(i,o){return I().gql.workspaceAuthOnly.request(i,o)}function a(i){let o=i instanceof Error?i.message:String(i);throw new u(o)}function p(i,o,n){I().output.formatAndOutput(i,o,n);}function l(i){I().output.printSuccess(i);}function m(i,o){return I().output.truncate(i,o)}var b=`
|
|
2
2
|
id firstName lastName email phone position department location type status
|
|
3
3
|
salary performanceScore managerId avatar startDate workspaceId
|
|
4
|
-
`,
|
|
4
|
+
`,x=`
|
|
5
5
|
id firstName lastName email phone position experience currentCompany skills
|
|
6
6
|
source status rating resumeUrl notes appliedDate workspaceId
|
|
7
|
-
`,
|
|
7
|
+
`,v=`
|
|
8
8
|
id title department description type experienceLevel location requirements
|
|
9
9
|
benefits salaryMin salaryMax applicants status postedDate deadline workspaceId
|
|
10
|
-
`,
|
|
10
|
+
`,T=`
|
|
11
11
|
id employeeId employeeName department type reason startDate endDate days
|
|
12
12
|
status approverName workspaceId
|
|
13
|
-
`,
|
|
13
|
+
`,A=`
|
|
14
14
|
id title content author authorRole category priority isPinned tags viewCount
|
|
15
15
|
createdAt workspaceId
|
|
16
|
-
`,U=`
|
|
17
|
-
id title message type category read actionUrl createdAt workspaceId
|
|
18
16
|
`,W=`
|
|
19
17
|
id name contactPerson email phone industry status projects revenue since workspaceId
|
|
20
|
-
`,B=`
|
|
21
|
-
id title description category level instructor duration modules enrolled
|
|
22
|
-
completed rating skills status thumbnail workspaceId
|
|
23
18
|
`,j=`
|
|
24
19
|
id name headId headName employeeCount budget location status workspaceId
|
|
25
|
-
`,
|
|
20
|
+
`,B=`
|
|
26
21
|
id candidateId candidateName position type interviewerName date time status
|
|
27
22
|
rating feedback workspaceId
|
|
28
|
-
`,
|
|
29
|
-
id number clientName amount status issueDate dueDate items workspaceId
|
|
30
|
-
`,V=`
|
|
31
|
-
id title description level duration courses enrolled completionRate workspaceId
|
|
32
|
-
`,H=`
|
|
33
|
-
id title description category provider price priceType deliveryTime rating
|
|
34
|
-
reviews skills status workspaceId
|
|
35
|
-
`,Y=`
|
|
36
|
-
id employeeId employeeName department period grossPay deductions netPay
|
|
37
|
-
status paymentMethod payDate workspaceId
|
|
38
|
-
`,K=`
|
|
23
|
+
`,F=`
|
|
39
24
|
id name description status priority progress budget spent startDate endDate
|
|
40
25
|
managerId managerName teamId teamName tasks completedTasks workspaceId
|
|
41
|
-
`,
|
|
26
|
+
`,J=`
|
|
42
27
|
id name description department leadId leadName memberCount members
|
|
43
28
|
projectCount status createdAt workspaceId
|
|
44
|
-
`,
|
|
29
|
+
`,G=`
|
|
45
30
|
id employeeId employeeName date clockIn clockOut totalHours overtime project
|
|
46
31
|
status workspaceId
|
|
47
|
-
`,
|
|
32
|
+
`,V=`
|
|
48
33
|
id name category contactPerson email phone contractValue rating status workspaceId
|
|
49
|
-
`,
|
|
34
|
+
`,R=`
|
|
50
35
|
query CrewfoundryBootstrap {
|
|
51
36
|
crewfoundryBootstrap {
|
|
52
|
-
employees { ${
|
|
53
|
-
candidates { ${
|
|
54
|
-
jobPostings { ${
|
|
55
|
-
leaveRequests { ${
|
|
56
|
-
announcements { ${
|
|
57
|
-
notifications { ${U} }
|
|
37
|
+
employees { ${b} }
|
|
38
|
+
candidates { ${x} }
|
|
39
|
+
jobPostings { ${v} }
|
|
40
|
+
leaveRequests { ${T} }
|
|
41
|
+
announcements { ${A} }
|
|
58
42
|
clients { ${W} }
|
|
59
|
-
courses { ${B} }
|
|
60
43
|
departments { ${j} }
|
|
61
|
-
interviews { ${
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
projects { ${K} }
|
|
67
|
-
teams { ${z} }
|
|
68
|
-
timeEntries { ${Q} }
|
|
69
|
-
vendors { ${X} }
|
|
44
|
+
interviews { ${B} }
|
|
45
|
+
projects { ${F} }
|
|
46
|
+
teams { ${J} }
|
|
47
|
+
timeEntries { ${G} }
|
|
48
|
+
vendors { ${V} }
|
|
70
49
|
}
|
|
71
50
|
}
|
|
72
|
-
`,
|
|
51
|
+
`,D=`
|
|
73
52
|
query CrewfoundryListEmployees {
|
|
74
|
-
crewfoundryBootstrap { employees { ${
|
|
53
|
+
crewfoundryBootstrap { employees { ${b} } }
|
|
75
54
|
}
|
|
76
|
-
`,
|
|
55
|
+
`,L=`
|
|
77
56
|
query CrewfoundryListCandidates {
|
|
78
|
-
crewfoundryBootstrap { candidates { ${
|
|
57
|
+
crewfoundryBootstrap { candidates { ${x} } }
|
|
79
58
|
}
|
|
80
|
-
`,
|
|
59
|
+
`,N=`
|
|
81
60
|
query CrewfoundryListJobPostings {
|
|
82
|
-
crewfoundryBootstrap { jobPostings { ${
|
|
61
|
+
crewfoundryBootstrap { jobPostings { ${v} } }
|
|
83
62
|
}
|
|
84
|
-
`,
|
|
63
|
+
`,q=`
|
|
85
64
|
query CrewfoundryListLeaveRequests {
|
|
86
|
-
crewfoundryBootstrap { leaveRequests { ${
|
|
65
|
+
crewfoundryBootstrap { leaveRequests { ${T} } }
|
|
87
66
|
}
|
|
88
67
|
`,P=`
|
|
89
68
|
query CrewfoundryListAnnouncements {
|
|
90
|
-
crewfoundryBootstrap { announcements { ${
|
|
91
|
-
}
|
|
92
|
-
`,Z=`
|
|
93
|
-
query CrewfoundryListNotifications {
|
|
94
|
-
crewfoundryBootstrap { notifications { ${U} } }
|
|
69
|
+
crewfoundryBootstrap { announcements { ${A} } }
|
|
95
70
|
}
|
|
96
|
-
`,
|
|
71
|
+
`,H=`
|
|
97
72
|
query CrewfoundryListClients {
|
|
98
73
|
crewfoundryBootstrap { clients { ${W} } }
|
|
99
74
|
}
|
|
100
|
-
`,
|
|
101
|
-
query CrewfoundryListCourses {
|
|
102
|
-
crewfoundryBootstrap { courses { ${B} } }
|
|
103
|
-
}
|
|
104
|
-
`,ne=`
|
|
75
|
+
`,Y=`
|
|
105
76
|
query CrewfoundryListDepartments {
|
|
106
77
|
crewfoundryBootstrap { departments { ${j} } }
|
|
107
78
|
}
|
|
108
|
-
`,
|
|
79
|
+
`,z=`
|
|
109
80
|
query CrewfoundryListInterviews {
|
|
110
|
-
crewfoundryBootstrap { interviews { ${
|
|
111
|
-
}
|
|
112
|
-
`,oe=`
|
|
113
|
-
query CrewfoundryListInvoices {
|
|
114
|
-
crewfoundryBootstrap { invoices { ${J} } }
|
|
115
|
-
}
|
|
116
|
-
`,ie=`
|
|
117
|
-
query CrewfoundryListLearningPaths {
|
|
118
|
-
crewfoundryBootstrap { learningPaths { ${V} } }
|
|
81
|
+
crewfoundryBootstrap { interviews { ${B} } }
|
|
119
82
|
}
|
|
120
|
-
`,
|
|
121
|
-
query CrewfoundryListMarketplaceServices {
|
|
122
|
-
crewfoundryBootstrap { marketplaceServices { ${H} } }
|
|
123
|
-
}
|
|
124
|
-
`,ae=`
|
|
125
|
-
query CrewfoundryListPayrollRecords {
|
|
126
|
-
crewfoundryBootstrap { payrollRecords { ${Y} } }
|
|
127
|
-
}
|
|
128
|
-
`,pe=`
|
|
83
|
+
`,K=`
|
|
129
84
|
query CrewfoundryListProjects {
|
|
130
|
-
crewfoundryBootstrap { projects { ${
|
|
85
|
+
crewfoundryBootstrap { projects { ${F} } }
|
|
131
86
|
}
|
|
132
|
-
`,
|
|
87
|
+
`,Q=`
|
|
133
88
|
query CrewfoundryListTeams {
|
|
134
|
-
crewfoundryBootstrap { teams { ${
|
|
89
|
+
crewfoundryBootstrap { teams { ${J} } }
|
|
135
90
|
}
|
|
136
|
-
`,
|
|
91
|
+
`,X=`
|
|
137
92
|
query CrewfoundryListTimeEntries {
|
|
138
|
-
crewfoundryBootstrap { timeEntries { ${
|
|
93
|
+
crewfoundryBootstrap { timeEntries { ${G} } }
|
|
139
94
|
}
|
|
140
|
-
`,
|
|
95
|
+
`,Z=`
|
|
141
96
|
query CrewfoundryListVendors {
|
|
142
|
-
crewfoundryBootstrap { vendors { ${
|
|
97
|
+
crewfoundryBootstrap { vendors { ${V} } }
|
|
143
98
|
}
|
|
144
|
-
`,
|
|
99
|
+
`,ee=`
|
|
145
100
|
mutation CrewfoundryCreateEmployee($input: CreateCrewEmployeeInput!) {
|
|
146
|
-
createCrewEmployee(input: $input) { ${
|
|
101
|
+
createCrewEmployee(input: $input) { ${b} }
|
|
147
102
|
}
|
|
148
|
-
`,
|
|
103
|
+
`,te=`
|
|
149
104
|
mutation CrewfoundryUpdateEmployee($id: ID!, $input: UpdateCrewEmployeeInput!) {
|
|
150
|
-
updateCrewEmployee(id: $id, input: $input) { ${
|
|
105
|
+
updateCrewEmployee(id: $id, input: $input) { ${b} }
|
|
151
106
|
}
|
|
152
|
-
`,
|
|
107
|
+
`,ne=`
|
|
153
108
|
mutation CrewfoundryRemoveEmployee($id: ID!) {
|
|
154
109
|
removeCrewEmployee(id: $id)
|
|
155
110
|
}
|
|
156
|
-
`,
|
|
111
|
+
`,re=`
|
|
157
112
|
mutation CrewfoundryCreateCandidate($input: CreateCrewCandidateInput!) {
|
|
158
|
-
createCrewCandidate(input: $input) { ${
|
|
113
|
+
createCrewCandidate(input: $input) { ${x} }
|
|
159
114
|
}
|
|
160
|
-
`,
|
|
115
|
+
`,oe=`
|
|
161
116
|
mutation CrewfoundryUpdateCandidate($id: ID!, $input: UpdateCrewCandidateInput!) {
|
|
162
|
-
updateCrewCandidate(id: $id, input: $input) { ${
|
|
117
|
+
updateCrewCandidate(id: $id, input: $input) { ${x} }
|
|
163
118
|
}
|
|
164
|
-
`,
|
|
119
|
+
`,ie=`
|
|
165
120
|
mutation CrewfoundryCreateJobPosting($input: CreateCrewJobPostingInput!) {
|
|
166
|
-
createCrewJobPosting(input: $input) { ${
|
|
121
|
+
createCrewJobPosting(input: $input) { ${v} }
|
|
167
122
|
}
|
|
168
|
-
`,
|
|
123
|
+
`,se=`
|
|
169
124
|
mutation CrewfoundryUpdateJobPosting($id: ID!, $input: UpdateCrewJobPostingInput!) {
|
|
170
|
-
updateCrewJobPosting(id: $id, input: $input) { ${
|
|
125
|
+
updateCrewJobPosting(id: $id, input: $input) { ${v} }
|
|
171
126
|
}
|
|
172
|
-
`,
|
|
127
|
+
`,ae=`
|
|
173
128
|
mutation CrewfoundryCreateLeaveRequest($input: CreateCrewLeaveRequestInput!) {
|
|
174
|
-
createCrewLeaveRequest(input: $input) { ${
|
|
129
|
+
createCrewLeaveRequest(input: $input) { ${T} }
|
|
175
130
|
}
|
|
176
|
-
`,
|
|
131
|
+
`,pe=`
|
|
177
132
|
mutation CrewfoundryUpdateLeaveRequest($id: ID!, $input: UpdateCrewLeaveRequestInput!) {
|
|
178
|
-
updateCrewLeaveRequest(id: $id, input: $input) { ${
|
|
133
|
+
updateCrewLeaveRequest(id: $id, input: $input) { ${T} }
|
|
179
134
|
}
|
|
180
|
-
`,
|
|
135
|
+
`,ce=`
|
|
181
136
|
mutation CrewfoundryCreateAnnouncement($input: CreateCrewAnnouncementInput!) {
|
|
182
|
-
createCrewAnnouncement(input: $input) { ${
|
|
183
|
-
}
|
|
184
|
-
`,ke=`
|
|
185
|
-
mutation CrewfoundryMarkNotificationRead($id: ID!) {
|
|
186
|
-
markCrewNotificationRead(id: $id)
|
|
137
|
+
createCrewAnnouncement(input: $input) { ${A} }
|
|
187
138
|
}
|
|
188
|
-
`,
|
|
189
|
-
mutation CrewfoundryMarkAllNotificationsRead {
|
|
190
|
-
markAllCrewNotificationsRead
|
|
191
|
-
}
|
|
192
|
-
`,Te=`
|
|
139
|
+
`,ue=`
|
|
193
140
|
query CrewfoundryHealth {
|
|
194
141
|
_empty
|
|
195
142
|
}
|
|
196
|
-
`;function y(s){let o=Number.parseInt(s,10);if(Number.isNaN(o))throw new u(`Expected an integer but got "${s}"`);return o}function g(s){let o=Number.parseFloat(s);if(Number.isNaN(o))throw new u(`Expected a number but got "${s}"`);return o}function w(s){return s.split(",").map(o=>o.trim()).filter(o=>o.length>0)}function Se(s){let o=s.command("employees").description("Crewfoundry employees");o.command("list").description("List employees").option("--department <d>","Filter by department").option("--status <s>","Filter by status").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await c(L)).crewfoundryBootstrap.employees;n.department&&(e=e.filter(r=>r.department===n.department)),n.status&&(e=e.filter(r=>r.status===n.status)),p(n,e,{headers:["ID","Name","Email","Department","Position","Status"],rows:e.map(r=>[d(r.id,12),`${r.firstName} ${r.lastName}`,r.email,r.department,r.position,r.status])});}catch(t){a(t);}}),o.command("get").description("Get an employee by id").argument("<id>","Employee ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let r=(await c(L)).crewfoundryBootstrap.employees.find(f=>f.id===n);if(!r)throw new u(`Employee ${n} not found`);p(t,r);}catch(e){a(e);}}),o.command("create").description("Create an employee").requiredOption("--first-name <s>","First name").requiredOption("--last-name <s>","Last name").requiredOption("--email <s>","Email").requiredOption("--phone <s>","Phone").requiredOption("--position <s>","Position").requiredOption("--department <s>","Department").requiredOption("--location <s>","Location").requiredOption("--salary <n>","Salary",g).option("--type <s>","Employment type (e.g. full-time)","full-time").option("--status <s>","Status","active").option("--performance-score <n>","Performance score",g,0).option("--manager-id <id>","Manager ID").option("--avatar <url>","Avatar URL").option("--start-date <iso>","Start date (ISO)").option("-f, --format <format>","Output format").action(async n=>{try{let t={firstName:n.firstName,lastName:n.lastName,email:n.email,phone:n.phone,position:n.position,department:n.department,location:n.location,salary:n.salary,type:n.type??"full-time",status:n.status??"active",performanceScore:n.performanceScore??0,startDate:n.startDate??new Date().toISOString()};n.managerId&&(t.managerId=n.managerId),n.avatar&&(t.avatar=n.avatar);let e=await c(me,{input:t});l(`Employee created: ${e.createCrewEmployee.firstName} ${e.createCrewEmployee.lastName}`),p(n,e.createCrewEmployee);}catch(t){a(t);}}),o.command("update").description("Update an employee").argument("<id>","Employee ID").option("--first-name <s>","First name").option("--last-name <s>","Last name").option("--email <s>","Email").option("--phone <s>","Phone").option("--position <s>","Position").option("--department <s>","Department").option("--location <s>","Location").option("--salary <n>","Salary",g).option("--type <s>","Employment type").option("--status <s>","Status").option("--performance-score <n>","Performance score",g).option("--manager-id <id>","Manager ID").option("--avatar <url>","Avatar URL").option("--start-date <iso>","Start date (ISO)").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={};if(t.firstName&&(e.firstName=t.firstName),t.lastName&&(e.lastName=t.lastName),t.email&&(e.email=t.email),t.phone&&(e.phone=t.phone),t.position&&(e.position=t.position),t.department&&(e.department=t.department),t.location&&(e.location=t.location),t.salary!==void 0&&(e.salary=t.salary),t.type&&(e.type=t.type),t.status&&(e.status=t.status),t.performanceScore!==void 0&&(e.performanceScore=t.performanceScore),t.managerId&&(e.managerId=t.managerId),t.avatar&&(e.avatar=t.avatar),t.startDate&&(e.startDate=t.startDate),!Object.keys(e).length)throw new u("No updates specified");let r=await c(le,{id:n,input:e});l("Employee updated"),p(t,r.updateCrewEmployee);}catch(e){a(e);}}),o.command("remove").description("Remove an employee").argument("<id>","Employee ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await c(fe,{id:n});if(!e.removeCrewEmployee)throw new u(`Employee ${n} could not be removed`);l(`Employee ${n} removed`),p(t,{removed:e.removeCrewEmployee});}catch(e){a(e);}});}function be(s){let o=s.command("candidates").description("Crewfoundry recruiting candidates");o.command("list").description("List candidates").option("--status <s>","Filter by status").option("--position <p>","Filter by position").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await c(N)).crewfoundryBootstrap.candidates;n.status&&(e=e.filter(r=>r.status===n.status)),n.position&&(e=e.filter(r=>r.position===n.position)),p(n,e,{headers:["ID","Name","Position","Source","Status","Rating"],rows:e.map(r=>[d(r.id,12),`${r.firstName} ${r.lastName}`,r.position,r.source,r.status,String(r.rating)])});}catch(t){a(t);}}),o.command("get").description("Get a candidate by id").argument("<id>","Candidate ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let r=(await c(N)).crewfoundryBootstrap.candidates.find(f=>f.id===n);if(!r)throw new u(`Candidate ${n} not found`);p(t,r);}catch(e){a(e);}}),o.command("create").description("Create a candidate").requiredOption("--first-name <s>","First name").requiredOption("--last-name <s>","Last name").requiredOption("--email <s>","Email").requiredOption("--phone <s>","Phone").requiredOption("--position <s>","Position").requiredOption("--source <s>","Source").option("--experience <n>","Years of experience",y,0).option("--rating <n>","Rating",g,0).option("--status <s>","Status","new").option("--current-company <s>","Current company").option("--skills <csv>","Comma-separated skills").option("--resume-url <url>","Resume URL").option("--notes <s>","Notes").option("--applied-date <iso>","Applied date (ISO)").option("-f, --format <format>","Output format").action(async n=>{try{let t={firstName:n.firstName,lastName:n.lastName,email:n.email,phone:n.phone,position:n.position,source:n.source,experience:n.experience??0,rating:n.rating??0,status:n.status??"new",skills:n.skills?w(n.skills):[],appliedDate:n.appliedDate??new Date().toISOString()};n.currentCompany&&(t.currentCompany=n.currentCompany),n.resumeUrl&&(t.resumeUrl=n.resumeUrl),n.notes&&(t.notes=n.notes);let e=await c(ge,{input:t});l(`Candidate created: ${e.createCrewCandidate.firstName} ${e.createCrewCandidate.lastName}`),p(n,e.createCrewCandidate);}catch(t){a(t);}}),o.command("update").description("Update a candidate").argument("<id>","Candidate ID").option("--first-name <s>","First name").option("--last-name <s>","Last name").option("--email <s>","Email").option("--phone <s>","Phone").option("--position <s>","Position").option("--source <s>","Source").option("--experience <n>","Years of experience",y).option("--rating <n>","Rating",g).option("--status <s>","Status").option("--current-company <s>","Current company").option("--skills <csv>","Comma-separated skills").option("--resume-url <url>","Resume URL").option("--notes <s>","Notes").option("--applied-date <iso>","Applied date (ISO)").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={};if(t.firstName&&(e.firstName=t.firstName),t.lastName&&(e.lastName=t.lastName),t.email&&(e.email=t.email),t.phone&&(e.phone=t.phone),t.position&&(e.position=t.position),t.source&&(e.source=t.source),t.experience!==void 0&&(e.experience=t.experience),t.rating!==void 0&&(e.rating=t.rating),t.status&&(e.status=t.status),t.currentCompany&&(e.currentCompany=t.currentCompany),t.skills&&(e.skills=w(t.skills)),t.resumeUrl&&(e.resumeUrl=t.resumeUrl),t.notes&&(e.notes=t.notes),t.appliedDate&&(e.appliedDate=t.appliedDate),!Object.keys(e).length)throw new u("No updates specified");let r=await c(ye,{id:n,input:e});l("Candidate updated"),p(t,r.updateCrewCandidate);}catch(e){a(e);}});}function xe(s){let o=s.command("job-postings").description("Crewfoundry job postings");o.command("list").description("List job postings").option("--department <d>","Filter by department").option("--status <s>","Filter by status").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await c(D)).crewfoundryBootstrap.jobPostings;n.department&&(e=e.filter(r=>r.department===n.department)),n.status&&(e=e.filter(r=>r.status===n.status)),p(n,e,{headers:["ID","Title","Department","Type","Applicants","Status"],rows:e.map(r=>[d(r.id,12),r.title,r.department,r.type,String(r.applicants),r.status])});}catch(t){a(t);}}),o.command("get").description("Get a job posting by id").argument("<id>","Job posting ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let r=(await c(D)).crewfoundryBootstrap.jobPostings.find(f=>f.id===n);if(!r)throw new u(`Job posting ${n} not found`);p(t,r);}catch(e){a(e);}}),o.command("create").description("Create a job posting").requiredOption("--title <s>","Title").requiredOption("--department <s>","Department").requiredOption("--description <s>","Description").requiredOption("--experience-level <s>","Experience level").requiredOption("--location <s>","Location").requiredOption("--type <s>","Employment type (e.g. full-time)").option("--applicants <n>","Applicant count",y,0).option("--salary-min <n>","Minimum salary",g,0).option("--salary-max <n>","Maximum salary",g,0).option("--status <s>","Status","open").option("--requirements <csv>","Comma-separated requirements").option("--benefits <csv>","Comma-separated benefits").option("--posted-date <iso>","Posted date (ISO)").option("--deadline <iso>","Deadline (ISO)").option("-f, --format <format>","Output format").action(async n=>{try{let t={title:n.title,department:n.department,description:n.description,experienceLevel:n.experienceLevel,location:n.location,type:n.type,applicants:n.applicants??0,salaryMin:n.salaryMin??0,salaryMax:n.salaryMax??0,status:n.status??"open",requirements:n.requirements?w(n.requirements):[],benefits:n.benefits?w(n.benefits):[],postedDate:n.postedDate??new Date().toISOString()};n.deadline&&(t.deadline=n.deadline);let e=await c(we,{input:t});l(`Job posting created: ${e.createCrewJobPosting.title}`),p(n,e.createCrewJobPosting);}catch(t){a(t);}}),o.command("update").description("Update a job posting").argument("<id>","Job posting ID").option("--title <s>","Title").option("--department <s>","Department").option("--description <s>","Description").option("--experience-level <s>","Experience level").option("--location <s>","Location").option("--type <s>","Employment type").option("--applicants <n>","Applicant count",y).option("--salary-min <n>","Minimum salary",g).option("--salary-max <n>","Maximum salary",g).option("--status <s>","Status").option("--requirements <csv>","Comma-separated requirements").option("--benefits <csv>","Comma-separated benefits").option("--posted-date <iso>","Posted date (ISO)").option("--deadline <iso>","Deadline (ISO)").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={};if(t.title&&(e.title=t.title),t.department&&(e.department=t.department),t.description&&(e.description=t.description),t.experienceLevel&&(e.experienceLevel=t.experienceLevel),t.location&&(e.location=t.location),t.type&&(e.type=t.type),t.applicants!==void 0&&(e.applicants=t.applicants),t.salaryMin!==void 0&&(e.salaryMin=t.salaryMin),t.salaryMax!==void 0&&(e.salaryMax=t.salaryMax),t.status&&(e.status=t.status),t.requirements&&(e.requirements=w(t.requirements)),t.benefits&&(e.benefits=w(t.benefits)),t.postedDate&&(e.postedDate=t.postedDate),t.deadline&&(e.deadline=t.deadline),!Object.keys(e).length)throw new u("No updates specified");let r=await c(Ce,{id:n,input:e});l("Job posting updated"),p(t,r.updateCrewJobPosting);}catch(e){a(e);}});}function Oe(s){let o=s.command("leave-requests").description("Crewfoundry leave requests");o.command("list").description("List leave requests").option("--employee <id>","Filter by employee ID").option("--status <s>","Filter by status").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await c(_)).crewfoundryBootstrap.leaveRequests;n.employee&&(e=e.filter(r=>r.employeeId===n.employee)),n.status&&(e=e.filter(r=>r.status===n.status)),p(n,e,{headers:["ID","Employee","Type","Days","Status"],rows:e.map(r=>[d(r.id,12),r.employeeName,r.type,String(r.days),r.status])});}catch(t){a(t);}}),o.command("get").description("Get a leave request by id").argument("<id>","Leave request ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let r=(await c(_)).crewfoundryBootstrap.leaveRequests.find(f=>f.id===n);if(!r)throw new u(`Leave request ${n} not found`);p(t,r);}catch(e){a(e);}}),o.command("create").description("Create a leave request").requiredOption("--employee-id <id>","Employee ID").requiredOption("--employee-name <s>","Employee name").requiredOption("--department <s>","Department").requiredOption("--type <s>","Leave type").requiredOption("--reason <s>","Reason").requiredOption("--start-date <iso>","Start date (ISO)").requiredOption("--end-date <iso>","End date (ISO)").option("--days <n>","Number of days",y,1).option("--status <s>","Status","pending").option("--approver-name <s>","Approver name").option("-f, --format <format>","Output format").action(async n=>{try{let t={employeeId:n.employeeId,employeeName:n.employeeName,department:n.department,type:n.type,reason:n.reason,startDate:n.startDate,endDate:n.endDate,days:n.days??1,status:n.status??"pending"};n.approverName&&(t.approverName=n.approverName);let e=await c(Ee,{input:t});l(`Leave request created for ${e.createCrewLeaveRequest.employeeName}`),p(n,e.createCrewLeaveRequest);}catch(t){a(t);}}),o.command("update").description("Update a leave request").argument("<id>","Leave request ID").option("--employee-id <id>","Employee ID").option("--employee-name <s>","Employee name").option("--department <s>","Department").option("--type <s>","Leave type").option("--reason <s>","Reason").option("--start-date <iso>","Start date (ISO)").option("--end-date <iso>","End date (ISO)").option("--days <n>","Number of days",y).option("--status <s>","Status").option("--approver-name <s>","Approver name").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={};if(t.employeeId&&(e.employeeId=t.employeeId),t.employeeName&&(e.employeeName=t.employeeName),t.department&&(e.department=t.department),t.type&&(e.type=t.type),t.reason&&(e.reason=t.reason),t.startDate&&(e.startDate=t.startDate),t.endDate&&(e.endDate=t.endDate),t.days!==void 0&&(e.days=t.days),t.status&&(e.status=t.status),t.approverName&&(e.approverName=t.approverName),!Object.keys(e).length)throw new u("No updates specified");let r=await c(he,{id:n,input:e});l("Leave request updated"),p(t,r.updateCrewLeaveRequest);}catch(e){a(e);}});}function Re(s){let o=s.command("announcements").description("Crewfoundry announcements");o.command("list").description("List announcements").option("--category <c>","Filter by category").option("--pinned-only","Only pinned announcements").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await c(P)).crewfoundryBootstrap.announcements;n.category&&(e=e.filter(r=>r.category===n.category)),n.pinnedOnly&&(e=e.filter(r=>r.isPinned)),p(n,e,{headers:["ID","Title","Author","Category","Priority","Pinned"],rows:e.map(r=>[d(r.id,12),r.title,r.author,r.category,r.priority,r.isPinned?"yes":"no"])});}catch(t){a(t);}}),o.command("get").description("Get an announcement by id").argument("<id>","Announcement ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let r=(await c(P)).crewfoundryBootstrap.announcements.find(f=>f.id===n);if(!r)throw new u(`Announcement ${n} not found`);p(t,r);}catch(e){a(e);}}),o.command("create").description("Create an announcement").requiredOption("--title <s>","Title").requiredOption("--content <s>","Content").requiredOption("--author <s>","Author").requiredOption("--author-role <s>","Author role").requiredOption("--category <s>","Category").requiredOption("--priority <s>","Priority").option("--pinned","Pin the announcement").option("--view-count <n>","Initial view count",y,0).option("--tags <csv>","Comma-separated tags").option("--created-at <iso>","Created at (ISO)").option("-f, --format <format>","Output format").action(async n=>{try{let t={title:n.title,content:n.content,author:n.author,authorRole:n.authorRole,category:n.category,priority:n.priority,isPinned:n.pinned??!1,viewCount:n.viewCount??0,tags:n.tags?w(n.tags):[],createdAt:n.createdAt??new Date().toISOString()},e=await c(Ie,{input:t});l(`Announcement created: ${e.createCrewAnnouncement.title}`),p(n,e.createCrewAnnouncement);}catch(t){a(t);}});}function Ae(s){let o=s.command("notifications").description("Crewfoundry notifications");o.command("list").description("List notifications").option("--category <c>","Filter by category").option("--unread-only","Only unread notifications").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await c(Z)).crewfoundryBootstrap.notifications;n.category&&(e=e.filter(r=>r.category===n.category)),n.unreadOnly&&(e=e.filter(r=>!r.read)),p(n,e,{headers:["ID","Title","Type","Category","Read"],rows:e.map(r=>[d(r.id,12),r.title,r.type,r.category,r.read?"yes":"no"])});}catch(t){a(t);}}),o.command("mark-read").description("Mark a notification as read").argument("<id>","Notification ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await c(ke,{id:n});if(!e.markCrewNotificationRead)throw new u(`Notification ${n} could not be marked read`);l(`Notification ${n} marked read`),p(t,{read:e.markCrewNotificationRead});}catch(e){a(e);}}),o.command("mark-all-read").description("Mark all notifications as read").option("-f, --format <format>","Output format").action(async n=>{try{let t=await c(ve);l("All notifications marked read"),p(n,{read:t.markAllCrewNotificationsRead});}catch(t){a(t);}});}function i(s){return s==null?"-":String(s)}function Le(s){let o=s.command("directory").description("Crewfoundry read-only collections (clients, projects, teams, finance, learning)"),n=async(t,e,r,f)=>{try{let q=(await c(t)).crewfoundryBootstrap[e];p(r,q,{headers:f.headers,rows:q.map(f.row)});}catch(k){a(k);}};o.command("clients").description("List clients").option("-f, --format <format>","Output format").action(t=>n(ee,"clients",t,{headers:["ID","Name","Industry","Status","Projects","Revenue"],row:e=>[d(e.id,12),i(e.name),i(e.industry),i(e.status),i(e.projects),i(e.revenue)]})),o.command("courses").description("List training courses").option("-f, --format <format>","Output format").action(t=>n(te,"courses",t,{headers:["ID","Title","Category","Level","Enrolled","Status"],row:e=>[d(e.id,12),i(e.title),i(e.category),i(e.level),i(e.enrolled),i(e.status)]})),o.command("departments").description("List departments").option("-f, --format <format>","Output format").action(t=>n(ne,"departments",t,{headers:["ID","Name","Head","Employees","Budget","Status"],row:e=>[d(e.id,12),i(e.name),i(e.headName),i(e.employeeCount),i(e.budget),i(e.status)]})),o.command("interviews").description("List interviews").option("-f, --format <format>","Output format").action(t=>n(re,"interviews",t,{headers:["ID","Candidate","Position","Type","Status","Interviewer"],row:e=>[d(e.id,12),i(e.candidateName),i(e.position),i(e.type),i(e.status),i(e.interviewerName)]})),o.command("invoices").description("List invoices").option("-f, --format <format>","Output format").action(t=>n(oe,"invoices",t,{headers:["ID","Number","Client","Amount","Status"],row:e=>[d(e.id,12),i(e.number),i(e.clientName),i(e.amount),i(e.status)]})),o.command("learning-paths").description("List learning paths").option("-f, --format <format>","Output format").action(t=>n(ie,"learningPaths",t,{headers:["ID","Title","Level","Enrolled","Completion %"],row:e=>[d(e.id,12),i(e.title),i(e.level),i(e.enrolled),i(e.completionRate)]})),o.command("marketplace-services").description("List marketplace services").option("-f, --format <format>","Output format").action(t=>n(se,"marketplaceServices",t,{headers:["ID","Title","Category","Provider","Price","Rating"],row:e=>[d(e.id,12),i(e.title),i(e.category),i(e.provider),i(e.price),i(e.rating)]})),o.command("payroll").description("List payroll records").option("-f, --format <format>","Output format").action(t=>n(ae,"payrollRecords",t,{headers:["ID","Employee","Period","Gross","Net","Status"],row:e=>[d(e.id,12),i(e.employeeName),i(e.period),i(e.grossPay),i(e.netPay),i(e.status)]})),o.command("projects").description("List projects").option("-f, --format <format>","Output format").action(t=>n(pe,"projects",t,{headers:["ID","Name","Status","Priority","Progress","Budget"],row:e=>[d(e.id,12),i(e.name),i(e.status),i(e.priority),i(e.progress),i(e.budget)]})),o.command("teams").description("List teams").option("-f, --format <format>","Output format").action(t=>n(ce,"teams",t,{headers:["ID","Name","Department","Lead","Members","Status"],row:e=>[d(e.id,12),i(e.name),i(e.department),i(e.leadName),i(e.memberCount),i(e.status)]})),o.command("time-entries").description("List time entries").option("-f, --format <format>","Output format").action(t=>n(ue,"timeEntries",t,{headers:["ID","Employee","Date","Hours","Overtime","Status"],row:e=>[d(e.id,12),i(e.employeeName),i(e.date),i(e.totalHours),i(e.overtime),i(e.status)]})),o.command("vendors").description("List vendors").option("-f, --format <format>","Output format").action(t=>n(de,"vendors",t,{headers:["ID","Name","Category","Contract Value","Rating","Status"],row:e=>[d(e.id,12),i(e.name),i(e.category),i(e.contractValue),i(e.rating),i(e.status)]}));}function Ne(s){let o=s.command("analytics").description("Crewfoundry analytics & bootstrap");o.command("bootstrap").description("Fetch the full Crewfoundry workspace snapshot (all collections)").option("-f, --format <format>","Output format").action(async n=>{try{let t=await c(A);p(n,t.crewfoundryBootstrap);}catch(t){a(t);}}),o.command("summary").description("Per-collection counts derived from the bootstrap snapshot").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await c(A)).crewfoundryBootstrap,r={employees:e.employees.length,candidates:e.candidates.length,jobPostings:e.jobPostings.length,leaveRequests:e.leaveRequests.length,announcements:e.announcements.length,notifications:e.notifications.length,clients:e.clients.length,courses:e.courses.length,departments:e.departments.length,interviews:e.interviews.length,invoices:e.invoices.length,learningPaths:e.learningPaths.length,marketplaceServices:e.marketplaceServices.length,payrollRecords:e.payrollRecords.length,projects:e.projects.length,teams:e.teams.length,timeEntries:e.timeEntries.length,vendors:e.vendors.length};p(n,r,{headers:["Collection","Count"],rows:Object.entries(r).map(([f,k])=>[f,String(k)])});}catch(t){a(t);}}),s.command("health").description("Crewfoundry service health check (public)").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await O(Te))._empty??"ok";l(`crewfoundry: ${e}`),p(n,{health:e});}catch(t){a(t);}});}var Je={id:"crewfoundry",version:"1.0.0",displayName:"Crewfoundry",dependsOn:["auth","workspaces"],register(s,o){F(o);let n=s.command("crewfoundry").description("Crewfoundry workforce & HR operations");Se(n),be(n),xe(n),Oe(n),Re(n),Ae(n),Le(n),Ne(n);}},Pn=Je;module.exports=Pn;
|
|
143
|
+
`;function y(i){let o=Number.parseInt(i,10);if(Number.isNaN(o))throw new u(`Expected an integer but got "${i}"`);return o}function g(i){let o=Number.parseFloat(i);if(Number.isNaN(o))throw new u(`Expected a number but got "${i}"`);return o}function w(i){return i.split(",").map(o=>o.trim()).filter(o=>o.length>0)}function de(i){let o=i.command("employees").description("Crewfoundry employees");o.command("list").description("List employees").option("--department <d>","Filter by department").option("--status <s>","Filter by status").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await c(D)).crewfoundryBootstrap.employees;n.department&&(e=e.filter(r=>r.department===n.department)),n.status&&(e=e.filter(r=>r.status===n.status)),p(n,e,{headers:["ID","Name","Email","Department","Position","Status"],rows:e.map(r=>[m(r.id,12),`${r.firstName} ${r.lastName}`,r.email,r.department,r.position,r.status])});}catch(t){a(t);}}),o.command("get").description("Get an employee by id").argument("<id>","Employee ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let r=(await c(D)).crewfoundryBootstrap.employees.find(f=>f.id===n);if(!r)throw new u(`Employee ${n} not found`);p(t,r);}catch(e){a(e);}}),o.command("create").description("Create an employee").requiredOption("--first-name <s>","First name").requiredOption("--last-name <s>","Last name").requiredOption("--email <s>","Email").requiredOption("--phone <s>","Phone").requiredOption("--position <s>","Position").requiredOption("--department <s>","Department").requiredOption("--location <s>","Location").requiredOption("--salary <n>","Salary",g).option("--type <s>","Employment type (e.g. full-time)","full-time").option("--status <s>","Status","active").option("--performance-score <n>","Performance score",g,0).option("--manager-id <id>","Manager ID").option("--avatar <url>","Avatar URL").option("--start-date <iso>","Start date (ISO)").option("-f, --format <format>","Output format").action(async n=>{try{let t={firstName:n.firstName,lastName:n.lastName,email:n.email,phone:n.phone,position:n.position,department:n.department,location:n.location,salary:n.salary,type:n.type??"full-time",status:n.status??"active",performanceScore:n.performanceScore??0,startDate:n.startDate??new Date().toISOString()};n.managerId&&(t.managerId=n.managerId),n.avatar&&(t.avatar=n.avatar);let e=await c(ee,{input:t});l(`Employee created: ${e.createCrewEmployee.firstName} ${e.createCrewEmployee.lastName}`),p(n,e.createCrewEmployee);}catch(t){a(t);}}),o.command("update").description("Update an employee").argument("<id>","Employee ID").option("--first-name <s>","First name").option("--last-name <s>","Last name").option("--email <s>","Email").option("--phone <s>","Phone").option("--position <s>","Position").option("--department <s>","Department").option("--location <s>","Location").option("--salary <n>","Salary",g).option("--type <s>","Employment type").option("--status <s>","Status").option("--performance-score <n>","Performance score",g).option("--manager-id <id>","Manager ID").option("--avatar <url>","Avatar URL").option("--start-date <iso>","Start date (ISO)").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={};if(t.firstName&&(e.firstName=t.firstName),t.lastName&&(e.lastName=t.lastName),t.email&&(e.email=t.email),t.phone&&(e.phone=t.phone),t.position&&(e.position=t.position),t.department&&(e.department=t.department),t.location&&(e.location=t.location),t.salary!==void 0&&(e.salary=t.salary),t.type&&(e.type=t.type),t.status&&(e.status=t.status),t.performanceScore!==void 0&&(e.performanceScore=t.performanceScore),t.managerId&&(e.managerId=t.managerId),t.avatar&&(e.avatar=t.avatar),t.startDate&&(e.startDate=t.startDate),!Object.keys(e).length)throw new u("No updates specified");let r=await c(te,{id:n,input:e});l("Employee updated"),p(t,r.updateCrewEmployee);}catch(e){a(e);}}),o.command("remove").description("Remove an employee").argument("<id>","Employee ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await c(ne,{id:n});if(!e.removeCrewEmployee)throw new u(`Employee ${n} could not be removed`);l(`Employee ${n} removed`),p(t,{removed:e.removeCrewEmployee});}catch(e){a(e);}});}function me(i){let o=i.command("candidates").description("Crewfoundry recruiting candidates");o.command("list").description("List candidates").option("--status <s>","Filter by status").option("--position <p>","Filter by position").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await c(L)).crewfoundryBootstrap.candidates;n.status&&(e=e.filter(r=>r.status===n.status)),n.position&&(e=e.filter(r=>r.position===n.position)),p(n,e,{headers:["ID","Name","Position","Source","Status","Rating"],rows:e.map(r=>[m(r.id,12),`${r.firstName} ${r.lastName}`,r.position,r.source,r.status,String(r.rating)])});}catch(t){a(t);}}),o.command("get").description("Get a candidate by id").argument("<id>","Candidate ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let r=(await c(L)).crewfoundryBootstrap.candidates.find(f=>f.id===n);if(!r)throw new u(`Candidate ${n} not found`);p(t,r);}catch(e){a(e);}}),o.command("create").description("Create a candidate").requiredOption("--first-name <s>","First name").requiredOption("--last-name <s>","Last name").requiredOption("--email <s>","Email").requiredOption("--phone <s>","Phone").requiredOption("--position <s>","Position").requiredOption("--source <s>","Source").option("--experience <n>","Years of experience",y,0).option("--rating <n>","Rating",g,0).option("--status <s>","Status","new").option("--current-company <s>","Current company").option("--skills <csv>","Comma-separated skills").option("--resume-url <url>","Resume URL").option("--notes <s>","Notes").option("--applied-date <iso>","Applied date (ISO)").option("-f, --format <format>","Output format").action(async n=>{try{let t={firstName:n.firstName,lastName:n.lastName,email:n.email,phone:n.phone,position:n.position,source:n.source,experience:n.experience??0,rating:n.rating??0,status:n.status??"new",skills:n.skills?w(n.skills):[],appliedDate:n.appliedDate??new Date().toISOString()};n.currentCompany&&(t.currentCompany=n.currentCompany),n.resumeUrl&&(t.resumeUrl=n.resumeUrl),n.notes&&(t.notes=n.notes);let e=await c(re,{input:t});l(`Candidate created: ${e.createCrewCandidate.firstName} ${e.createCrewCandidate.lastName}`),p(n,e.createCrewCandidate);}catch(t){a(t);}}),o.command("update").description("Update a candidate").argument("<id>","Candidate ID").option("--first-name <s>","First name").option("--last-name <s>","Last name").option("--email <s>","Email").option("--phone <s>","Phone").option("--position <s>","Position").option("--source <s>","Source").option("--experience <n>","Years of experience",y).option("--rating <n>","Rating",g).option("--status <s>","Status").option("--current-company <s>","Current company").option("--skills <csv>","Comma-separated skills").option("--resume-url <url>","Resume URL").option("--notes <s>","Notes").option("--applied-date <iso>","Applied date (ISO)").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={};if(t.firstName&&(e.firstName=t.firstName),t.lastName&&(e.lastName=t.lastName),t.email&&(e.email=t.email),t.phone&&(e.phone=t.phone),t.position&&(e.position=t.position),t.source&&(e.source=t.source),t.experience!==void 0&&(e.experience=t.experience),t.rating!==void 0&&(e.rating=t.rating),t.status&&(e.status=t.status),t.currentCompany&&(e.currentCompany=t.currentCompany),t.skills&&(e.skills=w(t.skills)),t.resumeUrl&&(e.resumeUrl=t.resumeUrl),t.notes&&(e.notes=t.notes),t.appliedDate&&(e.appliedDate=t.appliedDate),!Object.keys(e).length)throw new u("No updates specified");let r=await c(oe,{id:n,input:e});l("Candidate updated"),p(t,r.updateCrewCandidate);}catch(e){a(e);}});}function le(i){let o=i.command("job-postings").description("Crewfoundry job postings");o.command("list").description("List job postings").option("--department <d>","Filter by department").option("--status <s>","Filter by status").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await c(N)).crewfoundryBootstrap.jobPostings;n.department&&(e=e.filter(r=>r.department===n.department)),n.status&&(e=e.filter(r=>r.status===n.status)),p(n,e,{headers:["ID","Title","Department","Type","Applicants","Status"],rows:e.map(r=>[m(r.id,12),r.title,r.department,r.type,String(r.applicants),r.status])});}catch(t){a(t);}}),o.command("get").description("Get a job posting by id").argument("<id>","Job posting ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let r=(await c(N)).crewfoundryBootstrap.jobPostings.find(f=>f.id===n);if(!r)throw new u(`Job posting ${n} not found`);p(t,r);}catch(e){a(e);}}),o.command("create").description("Create a job posting").requiredOption("--title <s>","Title").requiredOption("--department <s>","Department").requiredOption("--description <s>","Description").requiredOption("--experience-level <s>","Experience level").requiredOption("--location <s>","Location").requiredOption("--type <s>","Employment type (e.g. full-time)").option("--applicants <n>","Applicant count",y,0).option("--salary-min <n>","Minimum salary",g,0).option("--salary-max <n>","Maximum salary",g,0).option("--status <s>","Status","open").option("--requirements <csv>","Comma-separated requirements").option("--benefits <csv>","Comma-separated benefits").option("--posted-date <iso>","Posted date (ISO)").option("--deadline <iso>","Deadline (ISO)").option("-f, --format <format>","Output format").action(async n=>{try{let t={title:n.title,department:n.department,description:n.description,experienceLevel:n.experienceLevel,location:n.location,type:n.type,applicants:n.applicants??0,salaryMin:n.salaryMin??0,salaryMax:n.salaryMax??0,status:n.status??"open",requirements:n.requirements?w(n.requirements):[],benefits:n.benefits?w(n.benefits):[],postedDate:n.postedDate??new Date().toISOString()};n.deadline&&(t.deadline=n.deadline);let e=await c(ie,{input:t});l(`Job posting created: ${e.createCrewJobPosting.title}`),p(n,e.createCrewJobPosting);}catch(t){a(t);}}),o.command("update").description("Update a job posting").argument("<id>","Job posting ID").option("--title <s>","Title").option("--department <s>","Department").option("--description <s>","Description").option("--experience-level <s>","Experience level").option("--location <s>","Location").option("--type <s>","Employment type").option("--applicants <n>","Applicant count",y).option("--salary-min <n>","Minimum salary",g).option("--salary-max <n>","Maximum salary",g).option("--status <s>","Status").option("--requirements <csv>","Comma-separated requirements").option("--benefits <csv>","Comma-separated benefits").option("--posted-date <iso>","Posted date (ISO)").option("--deadline <iso>","Deadline (ISO)").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={};if(t.title&&(e.title=t.title),t.department&&(e.department=t.department),t.description&&(e.description=t.description),t.experienceLevel&&(e.experienceLevel=t.experienceLevel),t.location&&(e.location=t.location),t.type&&(e.type=t.type),t.applicants!==void 0&&(e.applicants=t.applicants),t.salaryMin!==void 0&&(e.salaryMin=t.salaryMin),t.salaryMax!==void 0&&(e.salaryMax=t.salaryMax),t.status&&(e.status=t.status),t.requirements&&(e.requirements=w(t.requirements)),t.benefits&&(e.benefits=w(t.benefits)),t.postedDate&&(e.postedDate=t.postedDate),t.deadline&&(e.deadline=t.deadline),!Object.keys(e).length)throw new u("No updates specified");let r=await c(se,{id:n,input:e});l("Job posting updated"),p(t,r.updateCrewJobPosting);}catch(e){a(e);}});}function fe(i){let o=i.command("leave-requests").description("Crewfoundry leave requests");o.command("list").description("List leave requests").option("--employee <id>","Filter by employee ID").option("--status <s>","Filter by status").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await c(q)).crewfoundryBootstrap.leaveRequests;n.employee&&(e=e.filter(r=>r.employeeId===n.employee)),n.status&&(e=e.filter(r=>r.status===n.status)),p(n,e,{headers:["ID","Employee","Type","Days","Status"],rows:e.map(r=>[m(r.id,12),r.employeeName,r.type,String(r.days),r.status])});}catch(t){a(t);}}),o.command("get").description("Get a leave request by id").argument("<id>","Leave request ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let r=(await c(q)).crewfoundryBootstrap.leaveRequests.find(f=>f.id===n);if(!r)throw new u(`Leave request ${n} not found`);p(t,r);}catch(e){a(e);}}),o.command("create").description("Create a leave request").requiredOption("--employee-id <id>","Employee ID").requiredOption("--employee-name <s>","Employee name").requiredOption("--department <s>","Department").requiredOption("--type <s>","Leave type").requiredOption("--reason <s>","Reason").requiredOption("--start-date <iso>","Start date (ISO)").requiredOption("--end-date <iso>","End date (ISO)").option("--days <n>","Number of days",y,1).option("--status <s>","Status","pending").option("--approver-name <s>","Approver name").option("-f, --format <format>","Output format").action(async n=>{try{let t={employeeId:n.employeeId,employeeName:n.employeeName,department:n.department,type:n.type,reason:n.reason,startDate:n.startDate,endDate:n.endDate,days:n.days??1,status:n.status??"pending"};n.approverName&&(t.approverName=n.approverName);let e=await c(ae,{input:t});l(`Leave request created for ${e.createCrewLeaveRequest.employeeName}`),p(n,e.createCrewLeaveRequest);}catch(t){a(t);}}),o.command("update").description("Update a leave request").argument("<id>","Leave request ID").option("--employee-id <id>","Employee ID").option("--employee-name <s>","Employee name").option("--department <s>","Department").option("--type <s>","Leave type").option("--reason <s>","Reason").option("--start-date <iso>","Start date (ISO)").option("--end-date <iso>","End date (ISO)").option("--days <n>","Number of days",y).option("--status <s>","Status").option("--approver-name <s>","Approver name").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={};if(t.employeeId&&(e.employeeId=t.employeeId),t.employeeName&&(e.employeeName=t.employeeName),t.department&&(e.department=t.department),t.type&&(e.type=t.type),t.reason&&(e.reason=t.reason),t.startDate&&(e.startDate=t.startDate),t.endDate&&(e.endDate=t.endDate),t.days!==void 0&&(e.days=t.days),t.status&&(e.status=t.status),t.approverName&&(e.approverName=t.approverName),!Object.keys(e).length)throw new u("No updates specified");let r=await c(pe,{id:n,input:e});l("Leave request updated"),p(t,r.updateCrewLeaveRequest);}catch(e){a(e);}});}function ge(i){let o=i.command("announcements").description("Crewfoundry announcements");o.command("list").description("List announcements").option("--category <c>","Filter by category").option("--pinned-only","Only pinned announcements").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await c(P)).crewfoundryBootstrap.announcements;n.category&&(e=e.filter(r=>r.category===n.category)),n.pinnedOnly&&(e=e.filter(r=>r.isPinned)),p(n,e,{headers:["ID","Title","Author","Category","Priority","Pinned"],rows:e.map(r=>[m(r.id,12),r.title,r.author,r.category,r.priority,r.isPinned?"yes":"no"])});}catch(t){a(t);}}),o.command("get").description("Get an announcement by id").argument("<id>","Announcement ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let r=(await c(P)).crewfoundryBootstrap.announcements.find(f=>f.id===n);if(!r)throw new u(`Announcement ${n} not found`);p(t,r);}catch(e){a(e);}}),o.command("create").description("Create an announcement").requiredOption("--title <s>","Title").requiredOption("--content <s>","Content").requiredOption("--author <s>","Author").requiredOption("--author-role <s>","Author role").requiredOption("--category <s>","Category").requiredOption("--priority <s>","Priority").option("--pinned","Pin the announcement").option("--view-count <n>","Initial view count",y,0).option("--tags <csv>","Comma-separated tags").option("--created-at <iso>","Created at (ISO)").option("-f, --format <format>","Output format").action(async n=>{try{let t={title:n.title,content:n.content,author:n.author,authorRole:n.authorRole,category:n.category,priority:n.priority,isPinned:n.pinned??!1,viewCount:n.viewCount??0,tags:n.tags?w(n.tags):[],createdAt:n.createdAt??new Date().toISOString()},e=await c(ce,{input:t});l(`Announcement created: ${e.createCrewAnnouncement.title}`),p(n,e.createCrewAnnouncement);}catch(t){a(t);}});}function s(i){return i==null?"-":String(i)}function ye(i){let o=i.command("directory").description("Crewfoundry read-only collections (clients, projects, teams, finance, learning)"),n=async(t,e,r,f)=>{try{let _=(await c(t)).crewfoundryBootstrap[e];p(r,_,{headers:f.headers,rows:_.map(f.row)});}catch(k){a(k);}};o.command("clients").description("List clients").option("-f, --format <format>","Output format").action(t=>n(H,"clients",t,{headers:["ID","Name","Industry","Status","Projects","Revenue"],row:e=>[m(e.id,12),s(e.name),s(e.industry),s(e.status),s(e.projects),s(e.revenue)]})),o.command("departments").description("List departments").option("-f, --format <format>","Output format").action(t=>n(Y,"departments",t,{headers:["ID","Name","Head","Employees","Budget","Status"],row:e=>[m(e.id,12),s(e.name),s(e.headName),s(e.employeeCount),s(e.budget),s(e.status)]})),o.command("interviews").description("List interviews").option("-f, --format <format>","Output format").action(t=>n(z,"interviews",t,{headers:["ID","Candidate","Position","Type","Status","Interviewer"],row:e=>[m(e.id,12),s(e.candidateName),s(e.position),s(e.type),s(e.status),s(e.interviewerName)]})),o.command("projects").description("List projects").option("-f, --format <format>","Output format").action(t=>n(K,"projects",t,{headers:["ID","Name","Status","Priority","Progress","Budget"],row:e=>[m(e.id,12),s(e.name),s(e.status),s(e.priority),s(e.progress),s(e.budget)]})),o.command("teams").description("List teams").option("-f, --format <format>","Output format").action(t=>n(Q,"teams",t,{headers:["ID","Name","Department","Lead","Members","Status"],row:e=>[m(e.id,12),s(e.name),s(e.department),s(e.leadName),s(e.memberCount),s(e.status)]})),o.command("time-entries").description("List time entries").option("-f, --format <format>","Output format").action(t=>n(X,"timeEntries",t,{headers:["ID","Employee","Date","Hours","Overtime","Status"],row:e=>[m(e.id,12),s(e.employeeName),s(e.date),s(e.totalHours),s(e.overtime),s(e.status)]})),o.command("vendors").description("List vendors").option("-f, --format <format>","Output format").action(t=>n(Z,"vendors",t,{headers:["ID","Name","Category","Contract Value","Rating","Status"],row:e=>[m(e.id,12),s(e.name),s(e.category),s(e.contractValue),s(e.rating),s(e.status)]}));}function we(i){let o=i.command("analytics").description("Crewfoundry analytics & bootstrap");o.command("bootstrap").description("Fetch the full Crewfoundry workspace snapshot (all collections)").option("-f, --format <format>","Output format").action(async n=>{try{let t=await c(R);p(n,t.crewfoundryBootstrap);}catch(t){a(t);}}),o.command("summary").description("Per-collection counts derived from the bootstrap snapshot").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await c(R)).crewfoundryBootstrap,r={employees:e.employees.length,candidates:e.candidates.length,jobPostings:e.jobPostings.length,leaveRequests:e.leaveRequests.length,announcements:e.announcements.length,clients:e.clients.length,departments:e.departments.length,interviews:e.interviews.length,projects:e.projects.length,teams:e.teams.length,timeEntries:e.timeEntries.length,vendors:e.vendors.length};p(n,r,{headers:["Collection","Count"],rows:Object.entries(r).map(([f,k])=>[f,String(k)])});}catch(t){a(t);}}),i.command("health").description("Crewfoundry service health check (public)").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await O(ue))._empty??"ok";l(`crewfoundry: ${e}`),p(n,{health:e});}catch(t){a(t);}});}var Re={id:"crewfoundry",version:"1.0.0",displayName:"Crewfoundry",dependsOn:["auth","workspaces"],register(i,o){U(o);let n=i.command("crewfoundry").description("Crewfoundry workforce & HR operations");de(n),me(n),le(n),fe(n),ge(n),ye(n),we(n);}},yn=Re;module.exports=yn;
|