@burdenoff/cli-sdk 2026.1108.1 → 2026.1109.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/{chunk-N5KCAJXG.js → chunk-6HSWVWQW.js} +3 -3
- package/dist/chunk-MT2F54AC.js +34 -0
- package/dist/chunk-WTNQ5PEC.js +1 -0
- package/dist/core/index.cjs +8 -8
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{module-BwJmqefL.d.ts → module-CLaW1ycq.d.cts} +17 -1
- package/dist/{module-BwJmqefL.d.cts → module-CLaW1ycq.d.ts} +17 -1
- package/dist/modules/adaptercloud/index.cjs +8 -8
- package/dist/modules/adaptercloud/index.d.cts +1 -1
- package/dist/modules/adaptercloud/index.d.ts +1 -1
- package/dist/modules/adaptercloud/index.js +2 -2
- package/dist/modules/artistrybase/index.cjs +10 -10
- package/dist/modules/artistrybase/index.d.cts +1 -1
- package/dist/modules/artistrybase/index.d.ts +1 -1
- package/dist/modules/artistrybase/index.js +2 -2
- package/dist/modules/assethandler/index.cjs +6 -6
- package/dist/modules/assethandler/index.d.cts +1 -1
- package/dist/modules/assethandler/index.d.ts +1 -1
- package/dist/modules/assethandler/index.js +2 -2
- package/dist/modules/atheletebridge/index.cjs +8 -8
- package/dist/modules/atheletebridge/index.d.cts +1 -1
- package/dist/modules/atheletebridge/index.d.ts +1 -1
- package/dist/modules/atheletebridge/index.js +2 -2
- package/dist/modules/auth/index.cjs +5 -5
- package/dist/modules/auth/index.d.cts +1 -1
- package/dist/modules/auth/index.d.ts +1 -1
- package/dist/modules/auth/index.js +4 -4
- package/dist/modules/billing/index.cjs +5 -5
- package/dist/modules/billing/index.d.cts +1 -1
- package/dist/modules/billing/index.d.ts +1 -1
- package/dist/modules/billing/index.js +2 -2
- package/dist/modules/brainyrich/index.cjs +10 -10
- package/dist/modules/brainyrich/index.d.cts +1 -1
- package/dist/modules/brainyrich/index.d.ts +1 -1
- package/dist/modules/brainyrich/index.js +2 -2
- package/dist/modules/buildmyiq/index.cjs +6 -6
- package/dist/modules/buildmyiq/index.d.cts +1 -1
- package/dist/modules/buildmyiq/index.d.ts +1 -1
- package/dist/modules/buildmyiq/index.js +2 -2
- package/dist/modules/channels/index.cjs +11 -11
- package/dist/modules/channels/index.d.cts +1 -1
- package/dist/modules/channels/index.d.ts +1 -1
- package/dist/modules/channels/index.js +2 -2
- package/dist/modules/collabkin/index.cjs +7 -7
- package/dist/modules/collabkin/index.d.cts +1 -1
- package/dist/modules/collabkin/index.d.ts +1 -1
- package/dist/modules/collabkin/index.js +2 -2
- package/dist/modules/comradecircle/index.cjs +8 -8
- package/dist/modules/comradecircle/index.d.cts +1 -1
- package/dist/modules/comradecircle/index.d.ts +1 -1
- package/dist/modules/comradecircle/index.js +2 -2
- package/dist/modules/conversations/index.cjs +9 -9
- package/dist/modules/conversations/index.d.cts +1 -1
- package/dist/modules/conversations/index.d.ts +1 -1
- package/dist/modules/conversations/index.js +2 -2
- package/dist/modules/coolandlovely/index.cjs +7 -7
- package/dist/modules/coolandlovely/index.d.cts +1 -1
- package/dist/modules/coolandlovely/index.d.ts +1 -1
- package/dist/modules/coolandlovely/index.js +2 -2
- package/dist/modules/cosmicintersection/index.cjs +4 -4
- package/dist/modules/cosmicintersection/index.d.cts +1 -1
- package/dist/modules/cosmicintersection/index.d.ts +1 -1
- package/dist/modules/cosmicintersection/index.js +2 -2
- package/dist/modules/crewfoundry/index.cjs +19 -19
- package/dist/modules/crewfoundry/index.d.cts +1 -1
- package/dist/modules/crewfoundry/index.d.ts +1 -1
- package/dist/modules/crewfoundry/index.js +2 -2
- package/dist/modules/devportal/index.cjs +5 -5
- package/dist/modules/devportal/index.d.cts +1 -1
- package/dist/modules/devportal/index.d.ts +1 -1
- package/dist/modules/devportal/index.js +2 -2
- package/dist/modules/ecoimpacthub/index.cjs +7 -7
- package/dist/modules/ecoimpacthub/index.d.cts +1 -1
- package/dist/modules/ecoimpacthub/index.d.ts +1 -1
- package/dist/modules/ecoimpacthub/index.js +2 -2
- package/dist/modules/eventfullymanaged/index.cjs +24 -24
- package/dist/modules/eventfullymanaged/index.d.cts +1 -1
- package/dist/modules/eventfullymanaged/index.d.ts +1 -1
- package/dist/modules/eventfullymanaged/index.js +2 -2
- package/dist/modules/export/index.cjs +9 -9
- package/dist/modules/export/index.d.cts +1 -1
- package/dist/modules/export/index.d.ts +1 -1
- package/dist/modules/export/index.js +2 -2
- package/dist/modules/files/index.cjs +4 -4
- package/dist/modules/files/index.d.cts +1 -1
- package/dist/modules/files/index.d.ts +1 -1
- package/dist/modules/files/index.js +2 -2
- package/dist/modules/fluidgrids/index.cjs +8 -8
- package/dist/modules/fluidgrids/index.d.cts +1 -1
- package/dist/modules/fluidgrids/index.d.ts +1 -1
- package/dist/modules/fluidgrids/index.js +3 -3
- package/dist/modules/ggnomad/index.cjs +7 -7
- package/dist/modules/ggnomad/index.d.cts +1 -1
- package/dist/modules/ggnomad/index.d.ts +1 -1
- package/dist/modules/ggnomad/index.js +2 -2
- package/dist/modules/govcitizenhub/index.cjs +4 -4
- package/dist/modules/govcitizenhub/index.d.cts +1 -1
- package/dist/modules/govcitizenhub/index.d.ts +1 -1
- package/dist/modules/govcitizenhub/index.js +2 -2
- package/dist/modules/groups/index.cjs +8 -8
- package/dist/modules/groups/index.d.cts +1 -1
- package/dist/modules/groups/index.d.ts +1 -1
- package/dist/modules/groups/index.js +2 -2
- package/dist/modules/headshotmarketing/index.cjs +1 -1
- package/dist/modules/headshotmarketing/index.d.cts +1 -1
- package/dist/modules/headshotmarketing/index.d.ts +1 -1
- package/dist/modules/headshotmarketing/index.js +2 -2
- package/dist/modules/health/index.d.cts +1 -1
- package/dist/modules/health/index.d.ts +1 -1
- package/dist/modules/hookmovies/index.cjs +10 -10
- package/dist/modules/hookmovies/index.d.cts +1 -1
- package/dist/modules/hookmovies/index.d.ts +1 -1
- package/dist/modules/hookmovies/index.js +2 -2
- package/dist/modules/housingvista/index.cjs +8 -8
- package/dist/modules/housingvista/index.d.cts +1 -1
- package/dist/modules/housingvista/index.d.ts +1 -1
- package/dist/modules/housingvista/index.js +2 -2
- package/dist/modules/integrations/index.cjs +7 -7
- package/dist/modules/integrations/index.d.cts +1 -1
- package/dist/modules/integrations/index.d.ts +1 -1
- package/dist/modules/integrations/index.js +2 -2
- package/dist/modules/intelwatchtower/index.cjs +7 -7
- package/dist/modules/intelwatchtower/index.d.cts +1 -1
- package/dist/modules/intelwatchtower/index.d.ts +1 -1
- package/dist/modules/intelwatchtower/index.js +2 -2
- package/dist/modules/kadaikodi/index.cjs +6 -6
- package/dist/modules/kadaikodi/index.d.cts +1 -1
- package/dist/modules/kadaikodi/index.d.ts +1 -1
- package/dist/modules/kadaikodi/index.js +2 -2
- package/dist/modules/labsofscience/index.cjs +4 -4
- package/dist/modules/labsofscience/index.d.cts +1 -1
- package/dist/modules/labsofscience/index.d.ts +1 -1
- package/dist/modules/labsofscience/index.js +2 -2
- package/dist/modules/manufacturedops/index.cjs +3 -3
- package/dist/modules/manufacturedops/index.d.cts +1 -1
- package/dist/modules/manufacturedops/index.d.ts +1 -1
- package/dist/modules/manufacturedops/index.js +2 -2
- package/dist/modules/movethewheels/index.cjs +8 -8
- package/dist/modules/movethewheels/index.d.cts +1 -1
- package/dist/modules/movethewheels/index.d.ts +1 -1
- package/dist/modules/movethewheels/index.js +2 -2
- package/dist/modules/mybodyshield/index.cjs +5 -5
- package/dist/modules/mybodyshield/index.d.cts +1 -1
- package/dist/modules/mybodyshield/index.d.ts +1 -1
- package/dist/modules/mybodyshield/index.js +2 -2
- package/dist/modules/notifications/index.cjs +2 -2
- package/dist/modules/notifications/index.d.cts +1 -1
- package/dist/modules/notifications/index.d.ts +1 -1
- package/dist/modules/notifications/index.js +1 -1
- package/dist/modules/organizations/index.cjs +5 -5
- package/dist/modules/organizations/index.d.cts +1 -1
- package/dist/modules/organizations/index.d.ts +1 -1
- package/dist/modules/organizations/index.js +1 -1
- package/dist/modules/planmagnet/index.cjs +17 -17
- package/dist/modules/planmagnet/index.d.cts +1 -1
- package/dist/modules/planmagnet/index.d.ts +1 -1
- package/dist/modules/planmagnet/index.js +2 -2
- package/dist/modules/products/index.cjs +5 -5
- package/dist/modules/products/index.d.cts +1 -1
- package/dist/modules/products/index.d.ts +1 -1
- package/dist/modules/products/index.js +2 -2
- package/dist/modules/proserviceworld/index.cjs +6 -6
- package/dist/modules/proserviceworld/index.d.cts +1 -1
- package/dist/modules/proserviceworld/index.d.ts +1 -1
- package/dist/modules/proserviceworld/index.js +2 -2
- package/dist/modules/rbac/index.cjs +4 -4
- package/dist/modules/rbac/index.d.cts +1 -1
- package/dist/modules/rbac/index.d.ts +1 -1
- package/dist/modules/rbac/index.js +2 -2
- package/dist/modules/sandbox/index.cjs +11 -11
- package/dist/modules/sandbox/index.d.cts +1 -1
- package/dist/modules/sandbox/index.d.ts +1 -1
- package/dist/modules/sandbox/index.js +1 -1
- package/dist/modules/scheduler/index.cjs +14 -14
- package/dist/modules/scheduler/index.d.cts +1 -1
- package/dist/modules/scheduler/index.d.ts +1 -1
- package/dist/modules/scheduler/index.js +2 -2
- package/dist/modules/security/index.cjs +9 -9
- package/dist/modules/security/index.d.cts +1 -1
- package/dist/modules/security/index.d.ts +1 -1
- package/dist/modules/security/index.js +2 -2
- package/dist/modules/semanticfed/index.cjs +8 -8
- package/dist/modules/semanticfed/index.d.cts +1 -1
- package/dist/modules/semanticfed/index.d.ts +1 -1
- package/dist/modules/semanticfed/index.js +1 -1
- package/dist/modules/semanticfed-sql/index.cjs +4 -4
- package/dist/modules/semanticfed-sql/index.d.cts +1 -1
- package/dist/modules/semanticfed-sql/index.d.ts +1 -1
- package/dist/modules/semanticfed-sql/index.js +1 -1
- package/dist/modules/store/index.cjs +7 -7
- package/dist/modules/store/index.d.cts +1 -1
- package/dist/modules/store/index.d.ts +1 -1
- package/dist/modules/store/index.js +2 -2
- package/dist/modules/subscriberbot/index.cjs +1 -1
- package/dist/modules/subscriberbot/index.d.cts +1 -1
- package/dist/modules/subscriberbot/index.d.ts +1 -1
- package/dist/modules/subscriberbot/index.js +2 -2
- package/dist/modules/support/index.cjs +2 -2
- package/dist/modules/support/index.d.cts +1 -1
- package/dist/modules/support/index.d.ts +1 -1
- package/dist/modules/support/index.js +2 -2
- package/dist/modules/tags/index.cjs +7 -7
- package/dist/modules/tags/index.d.cts +1 -1
- package/dist/modules/tags/index.d.ts +1 -1
- package/dist/modules/tags/index.js +2 -2
- package/dist/modules/technospam/index.cjs +4 -4
- package/dist/modules/technospam/index.d.cts +1 -1
- package/dist/modules/technospam/index.d.ts +1 -1
- package/dist/modules/technospam/index.js +2 -2
- package/dist/modules/theculturepost/index.cjs +10 -10
- package/dist/modules/theculturepost/index.d.cts +1 -1
- package/dist/modules/theculturepost/index.d.ts +1 -1
- package/dist/modules/theculturepost/index.js +2 -2
- package/dist/modules/theglobalfuel/index.cjs +7 -7
- package/dist/modules/theglobalfuel/index.d.cts +1 -1
- package/dist/modules/theglobalfuel/index.d.ts +1 -1
- package/dist/modules/theglobalfuel/index.js +2 -2
- package/dist/modules/timecampus/index.cjs +8 -8
- package/dist/modules/timecampus/index.d.cts +1 -1
- package/dist/modules/timecampus/index.d.ts +1 -1
- package/dist/modules/timecampus/index.js +2 -2
- package/dist/modules/tours/index.cjs +3 -3
- package/dist/modules/tours/index.d.cts +1 -1
- package/dist/modules/tours/index.d.ts +1 -1
- package/dist/modules/tours/index.js +2 -2
- package/dist/modules/vibecontrols/index.cjs +27 -27
- package/dist/modules/vibecontrols/index.d.cts +1 -1
- package/dist/modules/vibecontrols/index.d.ts +1 -1
- package/dist/modules/vibecontrols/index.js +5 -5
- package/dist/modules/workspaces/index.cjs +6 -6
- package/dist/modules/workspaces/index.d.cts +1 -1
- package/dist/modules/workspaces/index.d.ts +1 -1
- package/dist/modules/workspaces/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-2OISIPE6.js +0 -34
- package/dist/chunk-VL67DTWH.js +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var c=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 c{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 k(){if(!S)throw new C("vibecontrols module helpers used before setHelpersContext was called");return S}function Re(){let i=k();if(!i.auth.isAuthenticated())throw new h("Authentication required.",{hint:`Run \`${i.productName} auth login\` to authenticate.`})}async function u(i,o){return Re(),k().gql.workspace.request(i,o)}async function O(i,o){return k().gql.workspaceAuthOnly.request(i,o)}function a(i){let o=i instanceof Error?i.message:String(i);throw new c(o)}function p(i,o,n){k().output.formatAndOutput(i,o,n);}function l(i){k().output.printSuccess(i);}function m(i,o){return k().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
|
+
`,R=`
|
|
14
14
|
id title content author authorRole category priority isPinned tags viewCount
|
|
15
15
|
createdAt workspaceId
|
|
16
16
|
`,W=`
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
status workspaceId
|
|
32
32
|
`,V=`
|
|
33
33
|
id name category contactPerson email phone contractValue rating status workspaceId
|
|
34
|
-
`,
|
|
34
|
+
`,A=`
|
|
35
35
|
query CrewfoundryBootstrap {
|
|
36
36
|
crewfoundryBootstrap {
|
|
37
37
|
employees { ${b} }
|
|
38
|
-
candidates { ${
|
|
39
|
-
jobPostings { ${
|
|
38
|
+
candidates { ${x} }
|
|
39
|
+
jobPostings { ${v} }
|
|
40
40
|
leaveRequests { ${T} }
|
|
41
|
-
announcements { ${
|
|
41
|
+
announcements { ${R} }
|
|
42
42
|
clients { ${W} }
|
|
43
43
|
departments { ${j} }
|
|
44
44
|
interviews { ${B} }
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
}
|
|
55
55
|
`,L=`
|
|
56
56
|
query CrewfoundryListCandidates {
|
|
57
|
-
crewfoundryBootstrap { candidates { ${
|
|
57
|
+
crewfoundryBootstrap { candidates { ${x} } }
|
|
58
58
|
}
|
|
59
59
|
`,N=`
|
|
60
60
|
query CrewfoundryListJobPostings {
|
|
61
|
-
crewfoundryBootstrap { jobPostings { ${
|
|
61
|
+
crewfoundryBootstrap { jobPostings { ${v} } }
|
|
62
62
|
}
|
|
63
63
|
`,q=`
|
|
64
64
|
query CrewfoundryListLeaveRequests {
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
}
|
|
67
67
|
`,P=`
|
|
68
68
|
query CrewfoundryListAnnouncements {
|
|
69
|
-
crewfoundryBootstrap { announcements { ${
|
|
69
|
+
crewfoundryBootstrap { announcements { ${R} } }
|
|
70
70
|
}
|
|
71
71
|
`,H=`
|
|
72
72
|
query CrewfoundryListClients {
|
|
@@ -110,19 +110,19 @@
|
|
|
110
110
|
}
|
|
111
111
|
`,re=`
|
|
112
112
|
mutation CrewfoundryCreateCandidate($input: CreateCrewCandidateInput!) {
|
|
113
|
-
createCrewCandidate(input: $input) { ${
|
|
113
|
+
createCrewCandidate(input: $input) { ${x} }
|
|
114
114
|
}
|
|
115
115
|
`,oe=`
|
|
116
116
|
mutation CrewfoundryUpdateCandidate($id: ID!, $input: UpdateCrewCandidateInput!) {
|
|
117
|
-
updateCrewCandidate(id: $id, input: $input) { ${
|
|
117
|
+
updateCrewCandidate(id: $id, input: $input) { ${x} }
|
|
118
118
|
}
|
|
119
119
|
`,ie=`
|
|
120
120
|
mutation CrewfoundryCreateJobPosting($input: CreateCrewJobPostingInput!) {
|
|
121
|
-
createCrewJobPosting(input: $input) { ${
|
|
121
|
+
createCrewJobPosting(input: $input) { ${v} }
|
|
122
122
|
}
|
|
123
123
|
`,se=`
|
|
124
124
|
mutation CrewfoundryUpdateJobPosting($id: ID!, $input: UpdateCrewJobPostingInput!) {
|
|
125
|
-
updateCrewJobPosting(id: $id, input: $input) { ${
|
|
125
|
+
updateCrewJobPosting(id: $id, input: $input) { ${v} }
|
|
126
126
|
}
|
|
127
127
|
`,ae=`
|
|
128
128
|
mutation CrewfoundryCreateLeaveRequest($input: CreateCrewLeaveRequestInput!) {
|
|
@@ -132,12 +132,12 @@
|
|
|
132
132
|
mutation CrewfoundryUpdateLeaveRequest($id: ID!, $input: UpdateCrewLeaveRequestInput!) {
|
|
133
133
|
updateCrewLeaveRequest(id: $id, input: $input) { ${T} }
|
|
134
134
|
}
|
|
135
|
-
`,
|
|
135
|
+
`,ue=`
|
|
136
136
|
mutation CrewfoundryCreateAnnouncement($input: CreateCrewAnnouncementInput!) {
|
|
137
|
-
createCrewAnnouncement(input: $input) { ${
|
|
137
|
+
createCrewAnnouncement(input: $input) { ${R} }
|
|
138
138
|
}
|
|
139
|
-
`,
|
|
139
|
+
`,ce=`
|
|
140
140
|
query CrewfoundryHealth {
|
|
141
141
|
_empty
|
|
142
142
|
}
|
|
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(Q,"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(K,"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;
|
|
143
|
+
`;function y(i){let o=Number.parseInt(i,10);if(Number.isNaN(o))throw new c(`Expected an integer but got "${i}"`);return o}function g(i){let o=Number.parseFloat(i);if(Number.isNaN(o))throw new c(`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 u(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 u(D)).crewfoundryBootstrap.employees.find(f=>f.id===n);if(!r)throw new c(`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 u(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 c("No updates specified");let r=await u(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 u(ne,{id:n});if(!e.removeCrewEmployee)throw new c(`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 u(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 u(L)).crewfoundryBootstrap.candidates.find(f=>f.id===n);if(!r)throw new c(`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 u(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 c("No updates specified");let r=await u(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 u(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 u(N)).crewfoundryBootstrap.jobPostings.find(f=>f.id===n);if(!r)throw new c(`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 u(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 c("No updates specified");let r=await u(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 u(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 u(q)).crewfoundryBootstrap.leaveRequests.find(f=>f.id===n);if(!r)throw new c(`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 u(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 c("No updates specified");let r=await u(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 u(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 u(P)).crewfoundryBootstrap.announcements.find(f=>f.id===n);if(!r)throw new c(`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 u(ue,{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 u(t)).crewfoundryBootstrap[e];p(r,_,{headers:f.headers,rows:_.map(f.row)});}catch(I){a(I);}};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(Q,"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(K,"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 u(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 u(A)).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,I])=>[f,String(I)])});}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(ce))._empty??"ok";l(`crewfoundry: ${e}`),p(n,{health:e});}catch(t){a(t);}});}var Ae={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);}},Cn=Ae;module.exports=Cn;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$1,b as b$1,i,r,h as h$1,k as k$1,d}from'../../chunk-
|
|
1
|
+
import {a as a$1,b as b$1,i,r,h as h$1,k as k$1,d}from'../../chunk-WTNQ5PEC.js';import {q}from'../../chunk-MT2F54AC.js';var S=`
|
|
2
2
|
id firstName lastName email phone position department location type status
|
|
3
3
|
salary performanceScore managerId avatar startDate workspaceId
|
|
4
4
|
`,N=`
|
|
@@ -140,4 +140,4 @@ import {a as a$1,b as b$1,i,r,h as h$1,k as k$1,d}from'../../chunk-VL67DTWH.js';
|
|
|
140
140
|
query CrewfoundryHealth {
|
|
141
141
|
_empty
|
|
142
142
|
}
|
|
143
|
-
`;function y(m){let o$1=Number.parseInt(m,10);if(Number.isNaN(o$1))throw new o(`Expected an integer but got "${m}"`);return o$1}function f(m){let o$1=Number.parseFloat(m);if(Number.isNaN(o$1))throw new o(`Expected a number but got "${m}"`);return o$1}function g(m){return m.split(",").map(o=>o.trim()).filter(o=>o.length>0)}function st(m){let o$1=m.command("employees").description("Crewfoundry employees");o$1.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 t=(await b$1(h)).crewfoundryBootstrap.employees;n.department&&(t=t.filter(r=>r.department===n.department)),n.status&&(t=t.filter(r=>r.status===n.status)),i(n,t,{headers:["ID","Name","Email","Department","Position","Status"],rows:t.map(r$1=>[r(r$1.id,12),`${r$1.firstName} ${r$1.lastName}`,r$1.email,r$1.department,r$1.position,r$1.status])});}catch(e){h$1(e);}}),o$1.command("get").description("Get an employee by id").argument("<id>","Employee ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let r=(await b$1(h)).crewfoundryBootstrap.employees.find(l=>l.id===n);if(!r)throw new o(`Employee ${n} not found`);i(e,r);}catch(t){h$1(t);}}),o$1.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",f).option("--type <s>","Employment type (e.g. full-time)","full-time").option("--status <s>","Status","active").option("--performance-score <n>","Performance score",f,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 e={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&&(e.managerId=n.managerId),n.avatar&&(e.avatar=n.avatar);let t=await b$1(Q,{input:e});k$1(`Employee created: ${t.createCrewEmployee.firstName} ${t.createCrewEmployee.lastName}`),i(n,t.createCrewEmployee);}catch(e){h$1(e);}}),o$1.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",f).option("--type <s>","Employment type").option("--status <s>","Status").option("--performance-score <n>","Performance score",f).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,e)=>{try{let t={};if(e.firstName&&(t.firstName=e.firstName),e.lastName&&(t.lastName=e.lastName),e.email&&(t.email=e.email),e.phone&&(t.phone=e.phone),e.position&&(t.position=e.position),e.department&&(t.department=e.department),e.location&&(t.location=e.location),e.salary!==void 0&&(t.salary=e.salary),e.type&&(t.type=e.type),e.status&&(t.status=e.status),e.performanceScore!==void 0&&(t.performanceScore=e.performanceScore),e.managerId&&(t.managerId=e.managerId),e.avatar&&(t.avatar=e.avatar),e.startDate&&(t.startDate=e.startDate),!Object.keys(t).length)throw new o("No updates specified");let r=await b$1(K,{id:n,input:t});k$1("Employee updated"),i(e,r.updateCrewEmployee);}catch(t){h$1(t);}}),o$1.command("remove").description("Remove an employee").argument("<id>","Employee ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await b$1(z,{id:n});if(!t.removeCrewEmployee)throw new o(`Employee ${n} could not be removed`);k$1(`Employee ${n} removed`),i(e,{removed:t.removeCrewEmployee});}catch(t){h$1(t);}});}function it(m){let o$1=m.command("candidates").description("Crewfoundry recruiting candidates");o$1.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 t=(await b$1(b)).crewfoundryBootstrap.candidates;n.status&&(t=t.filter(r=>r.status===n.status)),n.position&&(t=t.filter(r=>r.position===n.position)),i(n,t,{headers:["ID","Name","Position","Source","Status","Rating"],rows:t.map(r$1=>[r(r$1.id,12),`${r$1.firstName} ${r$1.lastName}`,r$1.position,r$1.source,r$1.status,String(r$1.rating)])});}catch(e){h$1(e);}}),o$1.command("get").description("Get a candidate by id").argument("<id>","Candidate ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let r=(await b$1(b)).crewfoundryBootstrap.candidates.find(l=>l.id===n);if(!r)throw new o(`Candidate ${n} not found`);i(e,r);}catch(t){h$1(t);}}),o$1.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",f,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 e={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?g(n.skills):[],appliedDate:n.appliedDate??new Date().toISOString()};n.currentCompany&&(e.currentCompany=n.currentCompany),n.resumeUrl&&(e.resumeUrl=n.resumeUrl),n.notes&&(e.notes=n.notes);let t=await b$1(X,{input:e});k$1(`Candidate created: ${t.createCrewCandidate.firstName} ${t.createCrewCandidate.lastName}`),i(n,t.createCrewCandidate);}catch(e){h$1(e);}}),o$1.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",f).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,e)=>{try{let t={};if(e.firstName&&(t.firstName=e.firstName),e.lastName&&(t.lastName=e.lastName),e.email&&(t.email=e.email),e.phone&&(t.phone=e.phone),e.position&&(t.position=e.position),e.source&&(t.source=e.source),e.experience!==void 0&&(t.experience=e.experience),e.rating!==void 0&&(t.rating=e.rating),e.status&&(t.status=e.status),e.currentCompany&&(t.currentCompany=e.currentCompany),e.skills&&(t.skills=g(e.skills)),e.resumeUrl&&(t.resumeUrl=e.resumeUrl),e.notes&&(t.notes=e.notes),e.appliedDate&&(t.appliedDate=e.appliedDate),!Object.keys(t).length)throw new o("No updates specified");let r=await b$1(Z,{id:n,input:t});k$1("Candidate updated"),i(e,r.updateCrewCandidate);}catch(t){h$1(t);}});}function pt(m){let o$1=m.command("job-postings").description("Crewfoundry job postings");o$1.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 t=(await b$1(T)).crewfoundryBootstrap.jobPostings;n.department&&(t=t.filter(r=>r.department===n.department)),n.status&&(t=t.filter(r=>r.status===n.status)),i(n,t,{headers:["ID","Title","Department","Type","Applicants","Status"],rows:t.map(r$1=>[r(r$1.id,12),r$1.title,r$1.department,r$1.type,String(r$1.applicants),r$1.status])});}catch(e){h$1(e);}}),o$1.command("get").description("Get a job posting by id").argument("<id>","Job posting ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let r=(await b$1(T)).crewfoundryBootstrap.jobPostings.find(l=>l.id===n);if(!r)throw new o(`Job posting ${n} not found`);i(e,r);}catch(t){h$1(t);}}),o$1.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",f,0).option("--salary-max <n>","Maximum salary",f,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 e={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?g(n.requirements):[],benefits:n.benefits?g(n.benefits):[],postedDate:n.postedDate??new Date().toISOString()};n.deadline&&(e.deadline=n.deadline);let t=await b$1(tt,{input:e});k$1(`Job posting created: ${t.createCrewJobPosting.title}`),i(n,t.createCrewJobPosting);}catch(e){h$1(e);}}),o$1.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",f).option("--salary-max <n>","Maximum salary",f).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,e)=>{try{let t={};if(e.title&&(t.title=e.title),e.department&&(t.department=e.department),e.description&&(t.description=e.description),e.experienceLevel&&(t.experienceLevel=e.experienceLevel),e.location&&(t.location=e.location),e.type&&(t.type=e.type),e.applicants!==void 0&&(t.applicants=e.applicants),e.salaryMin!==void 0&&(t.salaryMin=e.salaryMin),e.salaryMax!==void 0&&(t.salaryMax=e.salaryMax),e.status&&(t.status=e.status),e.requirements&&(t.requirements=g(e.requirements)),e.benefits&&(t.benefits=g(e.benefits)),e.postedDate&&(t.postedDate=e.postedDate),e.deadline&&(t.deadline=e.deadline),!Object.keys(t).length)throw new o("No updates specified");let r=await b$1(et,{id:n,input:t});k$1("Job posting updated"),i(e,r.updateCrewJobPosting);}catch(t){h$1(t);}});}function mt(m){let o$1=m.command("leave-requests").description("Crewfoundry leave requests");o$1.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 t=(await b$1(_)).crewfoundryBootstrap.leaveRequests;n.employee&&(t=t.filter(r=>r.employeeId===n.employee)),n.status&&(t=t.filter(r=>r.status===n.status)),i(n,t,{headers:["ID","Employee","Type","Days","Status"],rows:t.map(r$1=>[r(r$1.id,12),r$1.employeeName,r$1.type,String(r$1.days),r$1.status])});}catch(e){h$1(e);}}),o$1.command("get").description("Get a leave request by id").argument("<id>","Leave request ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let r=(await b$1(_)).crewfoundryBootstrap.leaveRequests.find(l=>l.id===n);if(!r)throw new o(`Leave request ${n} not found`);i(e,r);}catch(t){h$1(t);}}),o$1.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 e={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&&(e.approverName=n.approverName);let t=await b$1(nt,{input:e});k$1(`Leave request created for ${t.createCrewLeaveRequest.employeeName}`),i(n,t.createCrewLeaveRequest);}catch(e){h$1(e);}}),o$1.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,e)=>{try{let t={};if(e.employeeId&&(t.employeeId=e.employeeId),e.employeeName&&(t.employeeName=e.employeeName),e.department&&(t.department=e.department),e.type&&(t.type=e.type),e.reason&&(t.reason=e.reason),e.startDate&&(t.startDate=e.startDate),e.endDate&&(t.endDate=e.endDate),e.days!==void 0&&(t.days=e.days),e.status&&(t.status=e.status),e.approverName&&(t.approverName=e.approverName),!Object.keys(t).length)throw new o("No updates specified");let r=await b$1(rt,{id:n,input:t});k$1("Leave request updated"),i(e,r.updateCrewLeaveRequest);}catch(t){h$1(t);}});}function dt(m){let o$1=m.command("announcements").description("Crewfoundry announcements");o$1.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 t=(await b$1(A)).crewfoundryBootstrap.announcements;n.category&&(t=t.filter(r=>r.category===n.category)),n.pinnedOnly&&(t=t.filter(r=>r.isPinned)),i(n,t,{headers:["ID","Title","Author","Category","Priority","Pinned"],rows:t.map(r$1=>[r(r$1.id,12),r$1.title,r$1.author,r$1.category,r$1.priority,r$1.isPinned?"yes":"no"])});}catch(e){h$1(e);}}),o$1.command("get").description("Get an announcement by id").argument("<id>","Announcement ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let r=(await b$1(A)).crewfoundryBootstrap.announcements.find(l=>l.id===n);if(!r)throw new o(`Announcement ${n} not found`);i(e,r);}catch(t){h$1(t);}}),o$1.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 e={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?g(n.tags):[],createdAt:n.createdAt??new Date().toISOString()},t=await b$1(ot,{input:e});k$1(`Announcement created: ${t.createCrewAnnouncement.title}`),i(n,t.createCrewAnnouncement);}catch(e){h$1(e);}});}function a(m){return m==null?"-":String(m)}function ct(m){let o=m.command("directory").description("Crewfoundry read-only collections (clients, projects, teams, finance, learning)"),n=async(e,t,r,l)=>{try{let q=(await b$1(e)).crewfoundryBootstrap[t];i(r,q,{headers:l.headers,rows:q.map(l.row)});}catch(I){h$1(I);}};o.command("clients").description("List clients").option("-f, --format <format>","Output format").action(e=>n(J,"clients",e,{headers:["ID","Name","Industry","Status","Projects","Revenue"],row:t=>[r(t.id,12),a(t.name),a(t.industry),a(t.status),a(t.projects),a(t.revenue)]})),o.command("departments").description("List departments").option("-f, --format <format>","Output format").action(e=>n(W,"departments",e,{headers:["ID","Name","Head","Employees","Budget","Status"],row:t=>[r(t.id,12),a(t.name),a(t.headName),a(t.employeeCount),a(t.budget),a(t.status)]})),o.command("interviews").description("List interviews").option("-f, --format <format>","Output format").action(e=>n(F,"interviews",e,{headers:["ID","Candidate","Position","Type","Status","Interviewer"],row:t=>[r(t.id,12),a(t.candidateName),a(t.position),a(t.type),a(t.status),a(t.interviewerName)]})),o.command("projects").description("List projects").option("-f, --format <format>","Output format").action(e=>n(V,"projects",e,{headers:["ID","Name","Status","Priority","Progress","Budget"],row:t=>[r(t.id,12),a(t.name),a(t.status),a(t.priority),a(t.progress),a(t.budget)]})),o.command("teams").description("List teams").option("-f, --format <format>","Output format").action(e=>n(G,"teams",e,{headers:["ID","Name","Department","Lead","Members","Status"],row:t=>[r(t.id,12),a(t.name),a(t.department),a(t.leadName),a(t.memberCount),a(t.status)]})),o.command("time-entries").description("List time entries").option("-f, --format <format>","Output format").action(e=>n(Y,"timeEntries",e,{headers:["ID","Employee","Date","Hours","Overtime","Status"],row:t=>[r(t.id,12),a(t.employeeName),a(t.date),a(t.totalHours),a(t.overtime),a(t.status)]})),o.command("vendors").description("List vendors").option("-f, --format <format>","Output format").action(e=>n(H,"vendors",e,{headers:["ID","Name","Category","Contract Value","Rating","Status"],row:t=>[r(t.id,12),a(t.name),a(t.category),a(t.contractValue),a(t.rating),a(t.status)]}));}function ut(m){let o=m.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 e=await b$1(L);i(n,e.crewfoundryBootstrap);}catch(e){h$1(e);}}),o.command("summary").description("Per-collection counts derived from the bootstrap snapshot").option("-f, --format <format>","Output format").action(async n=>{try{let t=(await b$1(L)).crewfoundryBootstrap,r={employees:t.employees.length,candidates:t.candidates.length,jobPostings:t.jobPostings.length,leaveRequests:t.leaveRequests.length,announcements:t.announcements.length,clients:t.clients.length,departments:t.departments.length,interviews:t.interviews.length,projects:t.projects.length,teams:t.teams.length,timeEntries:t.timeEntries.length,vendors:t.vendors.length};i(n,r,{headers:["Collection","Count"],rows:Object.entries(r).map(([l,I])=>[l,String(I)])});}catch(e){h$1(e);}}),m.command("health").description("Crewfoundry service health check (public)").option("-f, --format <format>","Output format").action(async n=>{try{let t=(await d(at))._empty??"ok";k$1(`crewfoundry: ${t}`),i(n,{health:t});}catch(e){h$1(e);}});}var lt={id:"crewfoundry",version:"1.0.0",displayName:"Crewfoundry",dependsOn:["auth","workspaces"],register(m,o){a$1(o);let n=m.command("crewfoundry").description("Crewfoundry workforce & HR operations");st(n),it(n),pt(n),mt(n),dt(n),ct(n),ut(n);}},Qt=lt;export{Qt as default};
|
|
143
|
+
`;function y(m){let o=Number.parseInt(m,10);if(Number.isNaN(o))throw new q(`Expected an integer but got "${m}"`);return o}function f(m){let o=Number.parseFloat(m);if(Number.isNaN(o))throw new q(`Expected a number but got "${m}"`);return o}function g(m){return m.split(",").map(o=>o.trim()).filter(o=>o.length>0)}function st(m){let o=m.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 t=(await b$1(h)).crewfoundryBootstrap.employees;n.department&&(t=t.filter(r=>r.department===n.department)),n.status&&(t=t.filter(r=>r.status===n.status)),i(n,t,{headers:["ID","Name","Email","Department","Position","Status"],rows:t.map(r$1=>[r(r$1.id,12),`${r$1.firstName} ${r$1.lastName}`,r$1.email,r$1.department,r$1.position,r$1.status])});}catch(e){h$1(e);}}),o.command("get").description("Get an employee by id").argument("<id>","Employee ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let r=(await b$1(h)).crewfoundryBootstrap.employees.find(l=>l.id===n);if(!r)throw new q(`Employee ${n} not found`);i(e,r);}catch(t){h$1(t);}}),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",f).option("--type <s>","Employment type (e.g. full-time)","full-time").option("--status <s>","Status","active").option("--performance-score <n>","Performance score",f,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 e={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&&(e.managerId=n.managerId),n.avatar&&(e.avatar=n.avatar);let t=await b$1(Q,{input:e});k$1(`Employee created: ${t.createCrewEmployee.firstName} ${t.createCrewEmployee.lastName}`),i(n,t.createCrewEmployee);}catch(e){h$1(e);}}),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",f).option("--type <s>","Employment type").option("--status <s>","Status").option("--performance-score <n>","Performance score",f).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,e)=>{try{let t={};if(e.firstName&&(t.firstName=e.firstName),e.lastName&&(t.lastName=e.lastName),e.email&&(t.email=e.email),e.phone&&(t.phone=e.phone),e.position&&(t.position=e.position),e.department&&(t.department=e.department),e.location&&(t.location=e.location),e.salary!==void 0&&(t.salary=e.salary),e.type&&(t.type=e.type),e.status&&(t.status=e.status),e.performanceScore!==void 0&&(t.performanceScore=e.performanceScore),e.managerId&&(t.managerId=e.managerId),e.avatar&&(t.avatar=e.avatar),e.startDate&&(t.startDate=e.startDate),!Object.keys(t).length)throw new q("No updates specified");let r=await b$1(K,{id:n,input:t});k$1("Employee updated"),i(e,r.updateCrewEmployee);}catch(t){h$1(t);}}),o.command("remove").description("Remove an employee").argument("<id>","Employee ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await b$1(z,{id:n});if(!t.removeCrewEmployee)throw new q(`Employee ${n} could not be removed`);k$1(`Employee ${n} removed`),i(e,{removed:t.removeCrewEmployee});}catch(t){h$1(t);}});}function it(m){let o=m.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 t=(await b$1(b)).crewfoundryBootstrap.candidates;n.status&&(t=t.filter(r=>r.status===n.status)),n.position&&(t=t.filter(r=>r.position===n.position)),i(n,t,{headers:["ID","Name","Position","Source","Status","Rating"],rows:t.map(r$1=>[r(r$1.id,12),`${r$1.firstName} ${r$1.lastName}`,r$1.position,r$1.source,r$1.status,String(r$1.rating)])});}catch(e){h$1(e);}}),o.command("get").description("Get a candidate by id").argument("<id>","Candidate ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let r=(await b$1(b)).crewfoundryBootstrap.candidates.find(l=>l.id===n);if(!r)throw new q(`Candidate ${n} not found`);i(e,r);}catch(t){h$1(t);}}),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",f,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 e={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?g(n.skills):[],appliedDate:n.appliedDate??new Date().toISOString()};n.currentCompany&&(e.currentCompany=n.currentCompany),n.resumeUrl&&(e.resumeUrl=n.resumeUrl),n.notes&&(e.notes=n.notes);let t=await b$1(X,{input:e});k$1(`Candidate created: ${t.createCrewCandidate.firstName} ${t.createCrewCandidate.lastName}`),i(n,t.createCrewCandidate);}catch(e){h$1(e);}}),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",f).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,e)=>{try{let t={};if(e.firstName&&(t.firstName=e.firstName),e.lastName&&(t.lastName=e.lastName),e.email&&(t.email=e.email),e.phone&&(t.phone=e.phone),e.position&&(t.position=e.position),e.source&&(t.source=e.source),e.experience!==void 0&&(t.experience=e.experience),e.rating!==void 0&&(t.rating=e.rating),e.status&&(t.status=e.status),e.currentCompany&&(t.currentCompany=e.currentCompany),e.skills&&(t.skills=g(e.skills)),e.resumeUrl&&(t.resumeUrl=e.resumeUrl),e.notes&&(t.notes=e.notes),e.appliedDate&&(t.appliedDate=e.appliedDate),!Object.keys(t).length)throw new q("No updates specified");let r=await b$1(Z,{id:n,input:t});k$1("Candidate updated"),i(e,r.updateCrewCandidate);}catch(t){h$1(t);}});}function pt(m){let o=m.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 t=(await b$1(T)).crewfoundryBootstrap.jobPostings;n.department&&(t=t.filter(r=>r.department===n.department)),n.status&&(t=t.filter(r=>r.status===n.status)),i(n,t,{headers:["ID","Title","Department","Type","Applicants","Status"],rows:t.map(r$1=>[r(r$1.id,12),r$1.title,r$1.department,r$1.type,String(r$1.applicants),r$1.status])});}catch(e){h$1(e);}}),o.command("get").description("Get a job posting by id").argument("<id>","Job posting ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let r=(await b$1(T)).crewfoundryBootstrap.jobPostings.find(l=>l.id===n);if(!r)throw new q(`Job posting ${n} not found`);i(e,r);}catch(t){h$1(t);}}),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",f,0).option("--salary-max <n>","Maximum salary",f,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 e={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?g(n.requirements):[],benefits:n.benefits?g(n.benefits):[],postedDate:n.postedDate??new Date().toISOString()};n.deadline&&(e.deadline=n.deadline);let t=await b$1(tt,{input:e});k$1(`Job posting created: ${t.createCrewJobPosting.title}`),i(n,t.createCrewJobPosting);}catch(e){h$1(e);}}),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",f).option("--salary-max <n>","Maximum salary",f).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,e)=>{try{let t={};if(e.title&&(t.title=e.title),e.department&&(t.department=e.department),e.description&&(t.description=e.description),e.experienceLevel&&(t.experienceLevel=e.experienceLevel),e.location&&(t.location=e.location),e.type&&(t.type=e.type),e.applicants!==void 0&&(t.applicants=e.applicants),e.salaryMin!==void 0&&(t.salaryMin=e.salaryMin),e.salaryMax!==void 0&&(t.salaryMax=e.salaryMax),e.status&&(t.status=e.status),e.requirements&&(t.requirements=g(e.requirements)),e.benefits&&(t.benefits=g(e.benefits)),e.postedDate&&(t.postedDate=e.postedDate),e.deadline&&(t.deadline=e.deadline),!Object.keys(t).length)throw new q("No updates specified");let r=await b$1(et,{id:n,input:t});k$1("Job posting updated"),i(e,r.updateCrewJobPosting);}catch(t){h$1(t);}});}function mt(m){let o=m.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 t=(await b$1(_)).crewfoundryBootstrap.leaveRequests;n.employee&&(t=t.filter(r=>r.employeeId===n.employee)),n.status&&(t=t.filter(r=>r.status===n.status)),i(n,t,{headers:["ID","Employee","Type","Days","Status"],rows:t.map(r$1=>[r(r$1.id,12),r$1.employeeName,r$1.type,String(r$1.days),r$1.status])});}catch(e){h$1(e);}}),o.command("get").description("Get a leave request by id").argument("<id>","Leave request ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let r=(await b$1(_)).crewfoundryBootstrap.leaveRequests.find(l=>l.id===n);if(!r)throw new q(`Leave request ${n} not found`);i(e,r);}catch(t){h$1(t);}}),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 e={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&&(e.approverName=n.approverName);let t=await b$1(nt,{input:e});k$1(`Leave request created for ${t.createCrewLeaveRequest.employeeName}`),i(n,t.createCrewLeaveRequest);}catch(e){h$1(e);}}),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,e)=>{try{let t={};if(e.employeeId&&(t.employeeId=e.employeeId),e.employeeName&&(t.employeeName=e.employeeName),e.department&&(t.department=e.department),e.type&&(t.type=e.type),e.reason&&(t.reason=e.reason),e.startDate&&(t.startDate=e.startDate),e.endDate&&(t.endDate=e.endDate),e.days!==void 0&&(t.days=e.days),e.status&&(t.status=e.status),e.approverName&&(t.approverName=e.approverName),!Object.keys(t).length)throw new q("No updates specified");let r=await b$1(rt,{id:n,input:t});k$1("Leave request updated"),i(e,r.updateCrewLeaveRequest);}catch(t){h$1(t);}});}function dt(m){let o=m.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 t=(await b$1(A)).crewfoundryBootstrap.announcements;n.category&&(t=t.filter(r=>r.category===n.category)),n.pinnedOnly&&(t=t.filter(r=>r.isPinned)),i(n,t,{headers:["ID","Title","Author","Category","Priority","Pinned"],rows:t.map(r$1=>[r(r$1.id,12),r$1.title,r$1.author,r$1.category,r$1.priority,r$1.isPinned?"yes":"no"])});}catch(e){h$1(e);}}),o.command("get").description("Get an announcement by id").argument("<id>","Announcement ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let r=(await b$1(A)).crewfoundryBootstrap.announcements.find(l=>l.id===n);if(!r)throw new q(`Announcement ${n} not found`);i(e,r);}catch(t){h$1(t);}}),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 e={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?g(n.tags):[],createdAt:n.createdAt??new Date().toISOString()},t=await b$1(ot,{input:e});k$1(`Announcement created: ${t.createCrewAnnouncement.title}`),i(n,t.createCrewAnnouncement);}catch(e){h$1(e);}});}function a(m){return m==null?"-":String(m)}function ct(m){let o=m.command("directory").description("Crewfoundry read-only collections (clients, projects, teams, finance, learning)"),n=async(e,t,r,l)=>{try{let q=(await b$1(e)).crewfoundryBootstrap[t];i(r,q,{headers:l.headers,rows:q.map(l.row)});}catch(I){h$1(I);}};o.command("clients").description("List clients").option("-f, --format <format>","Output format").action(e=>n(J,"clients",e,{headers:["ID","Name","Industry","Status","Projects","Revenue"],row:t=>[r(t.id,12),a(t.name),a(t.industry),a(t.status),a(t.projects),a(t.revenue)]})),o.command("departments").description("List departments").option("-f, --format <format>","Output format").action(e=>n(W,"departments",e,{headers:["ID","Name","Head","Employees","Budget","Status"],row:t=>[r(t.id,12),a(t.name),a(t.headName),a(t.employeeCount),a(t.budget),a(t.status)]})),o.command("interviews").description("List interviews").option("-f, --format <format>","Output format").action(e=>n(F,"interviews",e,{headers:["ID","Candidate","Position","Type","Status","Interviewer"],row:t=>[r(t.id,12),a(t.candidateName),a(t.position),a(t.type),a(t.status),a(t.interviewerName)]})),o.command("projects").description("List projects").option("-f, --format <format>","Output format").action(e=>n(V,"projects",e,{headers:["ID","Name","Status","Priority","Progress","Budget"],row:t=>[r(t.id,12),a(t.name),a(t.status),a(t.priority),a(t.progress),a(t.budget)]})),o.command("teams").description("List teams").option("-f, --format <format>","Output format").action(e=>n(G,"teams",e,{headers:["ID","Name","Department","Lead","Members","Status"],row:t=>[r(t.id,12),a(t.name),a(t.department),a(t.leadName),a(t.memberCount),a(t.status)]})),o.command("time-entries").description("List time entries").option("-f, --format <format>","Output format").action(e=>n(Y,"timeEntries",e,{headers:["ID","Employee","Date","Hours","Overtime","Status"],row:t=>[r(t.id,12),a(t.employeeName),a(t.date),a(t.totalHours),a(t.overtime),a(t.status)]})),o.command("vendors").description("List vendors").option("-f, --format <format>","Output format").action(e=>n(H,"vendors",e,{headers:["ID","Name","Category","Contract Value","Rating","Status"],row:t=>[r(t.id,12),a(t.name),a(t.category),a(t.contractValue),a(t.rating),a(t.status)]}));}function ut(m){let o=m.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 e=await b$1(L);i(n,e.crewfoundryBootstrap);}catch(e){h$1(e);}}),o.command("summary").description("Per-collection counts derived from the bootstrap snapshot").option("-f, --format <format>","Output format").action(async n=>{try{let t=(await b$1(L)).crewfoundryBootstrap,r={employees:t.employees.length,candidates:t.candidates.length,jobPostings:t.jobPostings.length,leaveRequests:t.leaveRequests.length,announcements:t.announcements.length,clients:t.clients.length,departments:t.departments.length,interviews:t.interviews.length,projects:t.projects.length,teams:t.teams.length,timeEntries:t.timeEntries.length,vendors:t.vendors.length};i(n,r,{headers:["Collection","Count"],rows:Object.entries(r).map(([l,I])=>[l,String(I)])});}catch(e){h$1(e);}}),m.command("health").description("Crewfoundry service health check (public)").option("-f, --format <format>","Output format").action(async n=>{try{let t=(await d(at))._empty??"ok";k$1(`crewfoundry: ${t}`),i(n,{health:t});}catch(e){h$1(e);}});}var lt={id:"crewfoundry",version:"1.0.0",displayName:"Crewfoundry",dependsOn:["auth","workspaces"],register(m,o){a$1(o);let n=m.command("crewfoundry").description("Crewfoundry workforce & HR operations");st(n),it(n),pt(n),mt(n),dt(n),ct(n),ut(n);}},Qt=lt;export{Qt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var l=class extends Error{exitCode;hint;constructor(a,d){super(a),this.name="CliUserError",this.exitCode=d?.exitCode??1,this.hint=d?.hint;}};var m=class extends Error{cause;constructor(a,d){super(a),this.name="CliInternalError",this.cause=d;}};var C=null;function
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var l=class extends Error{exitCode;hint;constructor(a,d){super(a),this.name="CliUserError",this.exitCode=d?.exitCode??1,this.hint=d?.hint;}};var m=class extends Error{cause;constructor(a,d){super(a),this.name="CliInternalError",this.cause=d;}};var C=null;function T(s){C=s;}function A(){if(!C)throw new m("vibecontrols module helpers used before setHelpersContext was called");return C}async function r(s,a){return A().gql.global.request(s,a)}function i(s){let a=s instanceof Error?s.message:String(s);throw new l(a)}function c(s,a,d){A().output.formatAndOutput(s,a,d);}function u(s){A().output.printSuccess(s);}function y(s){return A().output.formatStatus(s)}function w(s,a){return A().output.truncate(s,a)}var E=`
|
|
2
2
|
query ListDeveloperOrganizations($limit: Int, $offset: Int) {
|
|
3
3
|
developerOrganizations(limit: $limit, offset: $offset) {
|
|
4
4
|
edges { node { id name slug tier isVerified totalApps publishedApps } }
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
mutation DeleteApplication($id: ID!) {
|
|
72
72
|
deleteApplication(id: $id)
|
|
73
73
|
}
|
|
74
|
-
`,
|
|
74
|
+
`,G=`
|
|
75
75
|
query ApplicationVersions($applicationId: ID!) {
|
|
76
76
|
application(id: $applicationId) {
|
|
77
77
|
id
|
|
@@ -81,13 +81,13 @@
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
`,
|
|
84
|
+
`,U=`
|
|
85
85
|
mutation CreateApplicationVersion($applicationId: ID!, $input: CreateApplicationVersionInput!) {
|
|
86
86
|
createApplicationVersion(applicationId: $applicationId, input: $input) {
|
|
87
87
|
id version status publishedAt
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
`,
|
|
90
|
+
`,W=`
|
|
91
91
|
query ListDevportalWebhooks($applicationId: ID!) {
|
|
92
92
|
webhooks(applicationId: $applicationId) {
|
|
93
93
|
id name url events isActive status failureCount
|
|
@@ -136,4 +136,4 @@
|
|
|
136
136
|
id status reviewStatus reviewNotes
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
`;function K(s){let a=s.command("devportal").description("Developer portal: orgs, apps, webhooks, revenue"),d=a.command("orgs").description("Publisher organizations");d.command("list").description("List devportal organizations").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let n=(await r(E,{limit:e.limit,offset:0})).developerOrganizations.edges.map(o=>o.node);c(e,n,{headers:["ID","Name","Slug","Tier","Verified","Apps"],rows:n.map(o=>[w(o.id,12),o.name,o.slug??"-",o.tier??"-",String(!!o.isVerified),String(o.totalApps??0)])});}catch(t){i(t);}}),d.command("get").description("Get an organization").argument("<id>").option("-f, --format <format>").action(async(e,t)=>{try{let n=await r(O,{id:e});if(!n.developerOrganization)throw new l(`Organization ${e} not found`);c(t,n.developerOrganization);}catch(n){i(n);}}),d.command("create").description("Create a publisher organization").requiredOption("--name <s>").option("--slug <s>","Unique slug (derived from the name when omitted)").option("--description <s>").option("--contact-email <email>").option("--website <url>").option("-f, --format <format>").action(async e=>{try{let t={name:e.name,slug:e.slug,description:e.description,contactEmail:e.contactEmail,websiteUrl:e.website},n=await r(S,{input:t});u(`Organization created: ${n.createDeveloperOrganization.name}`),c(e,n.createDeveloperOrganization);}catch(t){i(t);}}),d.command("update").description("Update an organization").argument("<id>").option("--name <s>").option("--description <s>").option("-f, --format <format>").action(async(e,t)=>{try{let n={};if(t.name&&(n.name=t.name),t.description!==void 0&&(n.description=t.description),!Object.keys(n).length)throw new l("No updates specified");let o=await r(R,{id:e,input:n});u("Organization updated"),c(t,o.updateDeveloperOrganization);}catch(n){i(n);}}),d.command("delete").description("Delete an organization").argument("<id>").action(async e=>{try{await r(D,{id:e}),u("Organization deleted");}catch(t){i(t);}});let g=a.command("apps").description("Applications");g.command("list").description("List applications").option("--organization <id>").option("--status <s>","DRAFT|SUBMITTED|IN_REVIEW|APPROVED|PUBLISHED|REJECTED|SUSPENDED").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let n=(await r(P,{organizationId:e.organization,status:e.status?.toUpperCase(),limit:e.limit})).applications.edges.map(o=>o.node);c(e,n,{headers:["ID","Name","Status","Installs","Rating"],rows:n.map(o=>[w(o.id,12),o.name,
|
|
139
|
+
`;function K(s){let a=s.command("devportal").description("Developer portal: orgs, apps, webhooks, revenue"),d=a.command("orgs").description("Publisher organizations");d.command("list").description("List devportal organizations").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let n=(await r(E,{limit:e.limit,offset:0})).developerOrganizations.edges.map(o=>o.node);c(e,n,{headers:["ID","Name","Slug","Tier","Verified","Apps"],rows:n.map(o=>[w(o.id,12),o.name,o.slug??"-",o.tier??"-",String(!!o.isVerified),String(o.totalApps??0)])});}catch(t){i(t);}}),d.command("get").description("Get an organization").argument("<id>").option("-f, --format <format>").action(async(e,t)=>{try{let n=await r(O,{id:e});if(!n.developerOrganization)throw new l(`Organization ${e} not found`);c(t,n.developerOrganization);}catch(n){i(n);}}),d.command("create").description("Create a publisher organization").requiredOption("--name <s>").option("--slug <s>","Unique slug (derived from the name when omitted)").option("--description <s>").option("--contact-email <email>").option("--website <url>").option("-f, --format <format>").action(async e=>{try{let t={name:e.name,slug:e.slug,description:e.description,contactEmail:e.contactEmail,websiteUrl:e.website},n=await r(S,{input:t});u(`Organization created: ${n.createDeveloperOrganization.name}`),c(e,n.createDeveloperOrganization);}catch(t){i(t);}}),d.command("update").description("Update an organization").argument("<id>").option("--name <s>").option("--description <s>").option("-f, --format <format>").action(async(e,t)=>{try{let n={};if(t.name&&(n.name=t.name),t.description!==void 0&&(n.description=t.description),!Object.keys(n).length)throw new l("No updates specified");let o=await r(R,{id:e,input:n});u("Organization updated"),c(t,o.updateDeveloperOrganization);}catch(n){i(n);}}),d.command("delete").description("Delete an organization").argument("<id>").action(async e=>{try{await r(D,{id:e}),u("Organization deleted");}catch(t){i(t);}});let g=a.command("apps").description("Applications");g.command("list").description("List applications").option("--organization <id>").option("--status <s>","DRAFT|SUBMITTED|IN_REVIEW|APPROVED|PUBLISHED|REJECTED|SUSPENDED").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let n=(await r(P,{organizationId:e.organization,status:e.status?.toUpperCase(),limit:e.limit})).applications.edges.map(o=>o.node);c(e,n,{headers:["ID","Name","Status","Installs","Rating"],rows:n.map(o=>[w(o.id,12),o.name,y(o.status),String(o.installCount??0),String(o.averageRating??"-")])});}catch(t){i(t);}}),g.command("get").description("Get an application").argument("<id>").option("-f, --format <format>").action(async(e,t)=>{try{let n=await r($,{id:e});if(!n.application)throw new l(`Application ${e} not found`);c(t,n.application);}catch(n){i(n);}}),g.command("create").description("Create an application").requiredOption("--name <s>").requiredOption("--organization <id>").option("--type <t>","API_INTEGRATION|WEB_APP|MOBILE_APP","API_INTEGRATION").option("--description <s>").option("-f, --format <format>").action(async e=>{try{let t={name:e.name,developerOrganizationId:e.organization,appType:(e.type??"API_INTEGRATION").toUpperCase(),description:e.description},n=await r(L,{input:t});u(`Application created: ${n.createApplication.name}`),c(e,n.createApplication);}catch(t){i(t);}}),g.command("update").description("Update an application").argument("<id>").option("--description <s>").option("--pricing <p>","FREE|PAID_ONETIME|SUBSCRIPTION").option("--docs-url <url>").option("-f, --format <format>").action(async(e,t)=>{try{let n={};if(t.description!==void 0&&(n.description=t.description),t.pricing&&(n.pricingType=t.pricing.toUpperCase()),t.docsUrl&&(n.documentationUrl=t.docsUrl),!Object.keys(n).length)throw new l("No updates specified");let o=await r(N,{id:e,input:n});u("Application updated"),c(t,o.updateApplication);}catch(n){i(n);}}),g.command("submit-review").description("Submit an application for review").argument("<id>").option("--notes <s>").action(async(e,t)=>{try{await r(_,{id:e,notes:t.notes}),u("Submitted for review");}catch(n){i(n);}}),g.command("publish").description("Publish an application").argument("<id>").action(async e=>{try{await r(q,{id:e}),u("Application published");}catch(t){i(t);}}),g.command("delete").description("Delete an application").argument("<id>").action(async e=>{try{await r(z,{id:e}),u("Application deleted");}catch(t){i(t);}});let k=g.command("versions").description("Application versions");k.command("list").description("List versions for an application").argument("<applicationId>").option("-f, --format <format>").action(async(e,t)=>{try{let o=(await r(G,{applicationId:e})).application?.versions.edges.map(f=>f.node)??[];c(t,o,{headers:["ID","Version","Status","Latest","Stable"],rows:o.map(f=>[w(f.id,12),f.version,y(f.status),String(!!f.isLatest),String(!!f.isStable)])});}catch(n){i(n);}}),k.command("create").description("Create an application version").requiredOption("--application <id>").requiredOption("--version <v>").option("--notes <s>").option("--package <url>","Package URL").option("-f, --format <format>").action(async e=>{try{let t={version:e.version,releaseNotes:e.notes,packageUrl:e.package},n=await r(U,{applicationId:e.application,input:t});u(`Version created: ${n.createApplicationVersion.version}`),c(e,n.createApplicationVersion);}catch(t){i(t);}});let I=g.command("webhooks").description("Application webhooks");I.command("list").description("List webhooks for an application").argument("<applicationId>").option("-f, --format <format>").action(async(e,t)=>{try{let n=await r(W,{applicationId:e});c(t,n.webhooks,{headers:["ID","Name","URL","Active","Failures"],rows:n.webhooks.map(o=>[w(o.id,12),o.name,w(o.url,40),String(!!o.isActive),String(o.failureCount??0)])});}catch(n){i(n);}}),I.command("add").description("Add a webhook to an application").requiredOption("--application <id>").requiredOption("--name <s>").requiredOption("--url <url>").requiredOption("--events <s>","Comma-separated event names").option("--max-retries <n>","",e=>parseInt(e,10),5).option("-f, --format <format>").action(async e=>{try{let t={name:e.name,url:e.url,events:e.events.split(",").map(o=>o.trim()).filter(Boolean),retryEnabled:!0,maxRetries:e.maxRetries},n=await r(V,{applicationId:e.application,input:t});u("Webhook created. Store the signing secret now: it is shown only once."),c(e,n.createWebhook);}catch(t){i(t);}}),I.command("remove").description("Remove a webhook").argument("<id>").action(async e=>{try{await r(F,{id:e}),u("Webhook removed");}catch(t){i(t);}}),g.command("analytics").description("Application analytics for a period").requiredOption("--application <id>").option("--period <p>","LAST_7_DAYS|LAST_30_DAYS|CUSTOM","LAST_30_DAYS").option("--from <iso>").option("--to <iso>").option("-f, --format <format>").action(async e=>{try{let t=await r(j,{applicationId:e.application,period:(e.period??"LAST_30_DAYS").toUpperCase(),startDate:e.from,endDate:e.to});c(e,t.applicationAnalytics);}catch(t){i(t);}}),a.command("revenue").description("Revenue for an organization").requiredOption("--organization <id>").option("--period <p>","LAST_7_DAYS|LAST_30_DAYS|YTD","LAST_30_DAYS").option("-f, --format <format>").action(async e=>{try{let t=await r(M,{organizationId:e.organization,period:(e.period??"LAST_30_DAYS").toUpperCase()});c(e,t.developerOrgRevenueSummary);}catch(t){i(t);}});let h=a.command("admin").description("Admin operations").command("reviews").description("Application review queue");h.command("list").description("List applications pending review").option("--status <s>","SUBMITTED|IN_REVIEW","SUBMITTED").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t=await r(B,{status:(e.status??"SUBMITTED").toUpperCase(),limit:e.limit});c(e,t.applications.edges.map(n=>n.node));}catch(t){i(t);}}),h.command("approve").description("Approve an application").argument("<applicationId>").option("--notes <s>").action(async(e,t)=>{try{await r(H,{id:e,notes:t.notes}),u("Application approved");}catch(n){i(n);}}),h.command("reject").description("Reject an application").argument("<applicationId>").requiredOption("--notes <s>","Reason for rejection").action(async(e,t)=>{try{await r(Y,{id:e,notes:t.notes}),u("Application rejected");}catch(n){i(n);}});}var ce={id:"devportal",version:"1.0.0",displayName:"Developer Portal",dependsOn:["auth"],register(s,a){T(a),K(s);}},kt=ce;module.exports=kt;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a,c,i,r,h as h$1,k as k$1,p}from'../../chunk-
|
|
1
|
+
import {a,c,i,r,h as h$1,k as k$1,p}from'../../chunk-WTNQ5PEC.js';import {q as q$1}from'../../chunk-MT2F54AC.js';var R=`
|
|
2
2
|
query ListDeveloperOrganizations($limit: Int, $offset: Int) {
|
|
3
3
|
developerOrganizations(limit: $limit, offset: $offset) {
|
|
4
4
|
edges { node { id name slug tier isVerified totalApps publishedApps } }
|
|
@@ -136,4 +136,4 @@ import {a,c,i,r,h as h$1,k as k$1,p}from'../../chunk-VL67DTWH.js';import {o}from
|
|
|
136
136
|
id status reviewStatus reviewNotes
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
`;function M(g){let d=g.command("devportal").description("Developer portal: orgs, apps, webhooks, revenue"),m=d.command("orgs").description("Publisher organizations");m.command("list").description("List devportal organizations").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let e=(await c(R,{limit:t.limit,offset:0})).developerOrganizations.edges.map(n=>n.node);i(t,e,{headers:["ID","Name","Slug","Tier","Verified","Apps"],rows:e.map(n=>[r(n.id,12),n.name,n.slug??"-",n.tier??"-",String(!!n.isVerified),String(n.totalApps??0)])});}catch(i){h$1(i);}}),m.command("get").description("Get an organization").argument("<id>").option("-f, --format <format>").action(async(t,i$1)=>{try{let e=await c(w,{id:t});if(!e.developerOrganization)throw new
|
|
139
|
+
`;function M(g){let d=g.command("devportal").description("Developer portal: orgs, apps, webhooks, revenue"),m=d.command("orgs").description("Publisher organizations");m.command("list").description("List devportal organizations").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let e=(await c(R,{limit:t.limit,offset:0})).developerOrganizations.edges.map(n=>n.node);i(t,e,{headers:["ID","Name","Slug","Tier","Verified","Apps"],rows:e.map(n=>[r(n.id,12),n.name,n.slug??"-",n.tier??"-",String(!!n.isVerified),String(n.totalApps??0)])});}catch(i){h$1(i);}}),m.command("get").description("Get an organization").argument("<id>").option("-f, --format <format>").action(async(t,i$1)=>{try{let e=await c(w,{id:t});if(!e.developerOrganization)throw new q$1(`Organization ${t} not found`);i(i$1,e.developerOrganization);}catch(e){h$1(e);}}),m.command("create").description("Create a publisher organization").requiredOption("--name <s>").option("--slug <s>","Unique slug (derived from the name when omitted)").option("--description <s>").option("--contact-email <email>").option("--website <url>").option("-f, --format <format>").action(async t=>{try{let i$1={name:t.name,slug:t.slug,description:t.description,contactEmail:t.contactEmail,websiteUrl:t.website},e=await c(D,{input:i$1});k$1(`Organization created: ${e.createDeveloperOrganization.name}`),i(t,e.createDeveloperOrganization);}catch(i){h$1(i);}}),m.command("update").description("Update an organization").argument("<id>").option("--name <s>").option("--description <s>").option("-f, --format <format>").action(async(t,i$1)=>{try{let e={};if(i$1.name&&(e.name=i$1.name),i$1.description!==void 0&&(e.description=i$1.description),!Object.keys(e).length)throw new q$1("No updates specified");let n=await c(S,{id:t,input:e});k$1("Organization updated"),i(i$1,n.updateDeveloperOrganization);}catch(e){h$1(e);}}),m.command("delete").description("Delete an organization").argument("<id>").action(async t=>{try{await c(C,{id:t}),k$1("Organization deleted");}catch(i){h$1(i);}});let p$1=d.command("apps").description("Applications");p$1.command("list").description("List applications").option("--organization <id>").option("--status <s>","DRAFT|SUBMITTED|IN_REVIEW|APPROVED|PUBLISHED|REJECTED|SUSPENDED").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let e=(await c(y,{organizationId:t.organization,status:t.status?.toUpperCase(),limit:t.limit})).applications.edges.map(n=>n.node);i(t,e,{headers:["ID","Name","Status","Installs","Rating"],rows:e.map(n=>[r(n.id,12),n.name,p(n.status),String(n.installCount??0),String(n.averageRating??"-")])});}catch(i){h$1(i);}}),p$1.command("get").description("Get an application").argument("<id>").option("-f, --format <format>").action(async(t,i$1)=>{try{let e=await c(P,{id:t});if(!e.application)throw new q$1(`Application ${t} not found`);i(i$1,e.application);}catch(e){h$1(e);}}),p$1.command("create").description("Create an application").requiredOption("--name <s>").requiredOption("--organization <id>").option("--type <t>","API_INTEGRATION|WEB_APP|MOBILE_APP","API_INTEGRATION").option("--description <s>").option("-f, --format <format>").action(async t=>{try{let i$1={name:t.name,developerOrganizationId:t.organization,appType:(t.type??"API_INTEGRATION").toUpperCase(),description:t.description},e=await c(h,{input:i$1});k$1(`Application created: ${e.createApplication.name}`),i(t,e.createApplication);}catch(i){h$1(i);}}),p$1.command("update").description("Update an application").argument("<id>").option("--description <s>").option("--pricing <p>","FREE|PAID_ONETIME|SUBSCRIPTION").option("--docs-url <url>").option("-f, --format <format>").action(async(t,i$1)=>{try{let e={};if(i$1.description!==void 0&&(e.description=i$1.description),i$1.pricing&&(e.pricingType=i$1.pricing.toUpperCase()),i$1.docsUrl&&(e.documentationUrl=i$1.docsUrl),!Object.keys(e).length)throw new q$1("No updates specified");let n=await c(N,{id:t,input:e});k$1("Application updated"),i(i$1,n.updateApplication);}catch(e){h$1(e);}}),p$1.command("submit-review").description("Submit an application for review").argument("<id>").option("--notes <s>").action(async(t,i)=>{try{await c($,{id:t,notes:i.notes}),k$1("Submitted for review");}catch(e){h$1(e);}}),p$1.command("publish").description("Publish an application").argument("<id>").action(async t=>{try{await c(b,{id:t}),k$1("Application published");}catch(i){h$1(i);}}),p$1.command("delete").description("Delete an application").argument("<id>").action(async t=>{try{await c(_,{id:t}),k$1("Application deleted");}catch(i){h$1(i);}});let O=p$1.command("versions").description("Application versions");O.command("list").description("List versions for an application").argument("<applicationId>").option("-f, --format <format>").action(async(t,i$1)=>{try{let n=(await c(L,{applicationId:t})).application?.versions.edges.map(c=>c.node)??[];i(i$1,n,{headers:["ID","Version","Status","Latest","Stable"],rows:n.map(c=>[r(c.id,12),c.version,p(c.status),String(!!c.isLatest),String(!!c.isStable)])});}catch(e){h$1(e);}}),O.command("create").description("Create an application version").requiredOption("--application <id>").requiredOption("--version <v>").option("--notes <s>").option("--package <url>","Package URL").option("-f, --format <format>").action(async t=>{try{let i$1={version:t.version,releaseNotes:t.notes,packageUrl:t.package},e=await c(z,{applicationId:t.application,input:i$1});k$1(`Version created: ${e.createApplicationVersion.version}`),i(t,e.createApplicationVersion);}catch(i){h$1(i);}});let A=p$1.command("webhooks").description("Application webhooks");A.command("list").description("List webhooks for an application").argument("<applicationId>").option("-f, --format <format>").action(async(t,i$1)=>{try{let e=await c(k,{applicationId:t});i(i$1,e.webhooks,{headers:["ID","Name","URL","Active","Failures"],rows:e.webhooks.map(n=>[r(n.id,12),n.name,r(n.url,40),String(!!n.isActive),String(n.failureCount??0)])});}catch(e){h$1(e);}}),A.command("add").description("Add a webhook to an application").requiredOption("--application <id>").requiredOption("--name <s>").requiredOption("--url <url>").requiredOption("--events <s>","Comma-separated event names").option("--max-retries <n>","",t=>parseInt(t,10),5).option("-f, --format <format>").action(async t=>{try{let i$1={name:t.name,url:t.url,events:t.events.split(",").map(n=>n.trim()).filter(Boolean),retryEnabled:!0,maxRetries:t.maxRetries},e=await c(U,{applicationId:t.application,input:i$1});k$1("Webhook created. Store the signing secret now: it is shown only once."),i(t,e.createWebhook);}catch(i){h$1(i);}}),A.command("remove").description("Remove a webhook").argument("<id>").action(async t=>{try{await c(x,{id:t}),k$1("Webhook removed");}catch(i){h$1(i);}}),p$1.command("analytics").description("Application analytics for a period").requiredOption("--application <id>").option("--period <p>","LAST_7_DAYS|LAST_30_DAYS|CUSTOM","LAST_30_DAYS").option("--from <iso>").option("--to <iso>").option("-f, --format <format>").action(async t=>{try{let i$1=await c(V,{applicationId:t.application,period:(t.period??"LAST_30_DAYS").toUpperCase(),startDate:t.from,endDate:t.to});i(t,i$1.applicationAnalytics);}catch(i){h$1(i);}}),d.command("revenue").description("Revenue for an organization").requiredOption("--organization <id>").option("--period <p>","LAST_7_DAYS|LAST_30_DAYS|YTD","LAST_30_DAYS").option("-f, --format <format>").action(async t=>{try{let i$1=await c(W,{organizationId:t.organization,period:(t.period??"LAST_30_DAYS").toUpperCase()});i(t,i$1.developerOrgRevenueSummary);}catch(i){h$1(i);}});let I=d.command("admin").description("Admin operations").command("reviews").description("Application review queue");I.command("list").description("List applications pending review").option("--status <s>","SUBMITTED|IN_REVIEW","SUBMITTED").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let i$1=await c(G,{status:(t.status??"SUBMITTED").toUpperCase(),limit:t.limit});i(t,i$1.applications.edges.map(e=>e.node));}catch(i){h$1(i);}}),I.command("approve").description("Approve an application").argument("<applicationId>").option("--notes <s>").action(async(t,i)=>{try{await c(B,{id:t,notes:i.notes}),k$1("Application approved");}catch(e){h$1(e);}}),I.command("reject").description("Reject an application").argument("<applicationId>").requiredOption("--notes <s>","Reason for rejection").action(async(t,i)=>{try{await c(q,{id:t,notes:i.notes}),k$1("Application rejected");}catch(e){h$1(e);}});}var Y={id:"devportal",version:"1.0.0",displayName:"Developer Portal",dependsOn:["auth"],register(g,d){a(d),M(g);}},it=Y;export{it as default};
|