@burdenoff/cli-sdk 2026.627.1 → 2026.627.2

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.
Files changed (29) hide show
  1. package/dist/modules/assethandler/index.cjs +255 -0
  2. package/dist/modules/assethandler/index.d.cts +7 -0
  3. package/dist/modules/assethandler/index.d.ts +7 -0
  4. package/dist/modules/assethandler/index.js +255 -0
  5. package/dist/modules/eventfullymanaged/index.cjs +247 -0
  6. package/dist/modules/eventfullymanaged/index.d.cts +7 -0
  7. package/dist/modules/eventfullymanaged/index.d.ts +7 -0
  8. package/dist/modules/eventfullymanaged/index.js +247 -0
  9. package/dist/modules/headshotmarketing/index.cjs +1083 -0
  10. package/dist/modules/headshotmarketing/index.d.cts +7 -0
  11. package/dist/modules/headshotmarketing/index.d.ts +7 -0
  12. package/dist/modules/headshotmarketing/index.js +1083 -0
  13. package/dist/modules/movethewheels/index.cjs +565 -0
  14. package/dist/modules/movethewheels/index.d.cts +7 -0
  15. package/dist/modules/movethewheels/index.d.ts +7 -0
  16. package/dist/modules/movethewheels/index.js +565 -0
  17. package/dist/modules/planmagnet/index.cjs +795 -0
  18. package/dist/modules/planmagnet/index.d.cts +7 -0
  19. package/dist/modules/planmagnet/index.d.ts +7 -0
  20. package/dist/modules/planmagnet/index.js +795 -0
  21. package/dist/modules/proserviceworld/index.cjs +193 -0
  22. package/dist/modules/proserviceworld/index.d.cts +7 -0
  23. package/dist/modules/proserviceworld/index.d.ts +7 -0
  24. package/dist/modules/proserviceworld/index.js +193 -0
  25. package/dist/modules/timecampus/index.cjs +444 -0
  26. package/dist/modules/timecampus/index.d.cts +7 -0
  27. package/dist/modules/timecampus/index.d.ts +7 -0
  28. package/dist/modules/timecampus/index.js +444 -0
  29. package/package.json +1 -1
@@ -0,0 +1,193 @@
1
+ 'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var p=class extends Error{exitCode;hint;constructor(r,t){super(r),this.name="CliUserError",this.exitCode=t?.exitCode??1,this.hint=t?.hint;}},y=class extends p{constructor(r,t){super(r,{exitCode:2,hint:t?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},w=class extends Error{cause;constructor(r,t){super(r),this.name="CliInternalError",this.cause=t;}};var h=null;function v(i){h=i;}function I(){if(!h)throw new w("vibecontrols module helpers used before setHelpersContext was called");return h}function wt(){let i=I();if(!i.auth.isAuthenticated())throw new y(`Authentication required. Run \`${i.productName} auth login\`.`)}async function a(i,r){return wt(),I().gql.workspace.request(i,r)}async function A(i,r){return I().gql.workspaceAuthOnly.request(i,r)}function o(i){let r=i instanceof Error?i.message:String(i);throw new p(r)}function s(i,r,t){I().output.formatAndOutput(i,r,t);}function d(i){I().output.printSuccess(i);}function b(i){return I().output.formatDate(i)}function m(i,r){return I().output.truncate(i,r)}var x=`
2
+ query PswClient($id: ID!) {
3
+ pswClient(id: $id) {
4
+ id name type status industry contactName contactEmail contactPhone
5
+ address notes tags relationshipOwnerId createdAt updatedAt workspaceId
6
+ }
7
+ }
8
+ `,P=`
9
+ query PswListClients($pagination: PaginationInput, $status: PswClientStatus) {
10
+ pswListClients(pagination: $pagination, status: $status) {
11
+ items {
12
+ id name type status industry contactName contactEmail
13
+ relationshipOwnerId createdAt
14
+ }
15
+ pageInfo { cursor hasMore }
16
+ }
17
+ }
18
+ `,D=`
19
+ mutation PswCreateClient($input: PswCreateClientInput!) {
20
+ pswCreateClient(input: $input) {
21
+ id name type status industry contactName contactEmail contactPhone
22
+ address notes tags relationshipOwnerId createdAt
23
+ }
24
+ }
25
+ `,O=`
26
+ mutation PswUpdateClient($id: ID!, $input: PswUpdateClientInput!) {
27
+ pswUpdateClient(id: $id, input: $input) {
28
+ id name type status industry contactName contactEmail contactPhone
29
+ address notes tags relationshipOwnerId updatedAt
30
+ }
31
+ }
32
+ `,S=`
33
+ mutation PswArchiveClient($id: ID!) {
34
+ pswArchiveClient(id: $id)
35
+ }
36
+ `,L=`
37
+ query PswEngagement($id: ID!) {
38
+ pswEngagement(id: $id) {
39
+ id clientId name description status feeArrangement feeAmount currency
40
+ startDate endDate practiceAreaId responsiblePartnerId tags
41
+ createdAt updatedAt workspaceId
42
+ }
43
+ }
44
+ `,R=`
45
+ query PswListEngagements(
46
+ $clientId: ID
47
+ $status: PswEngagementStatus
48
+ $pagination: PaginationInput
49
+ ) {
50
+ pswListEngagements(clientId: $clientId, status: $status, pagination: $pagination) {
51
+ items {
52
+ id clientId name status feeArrangement feeAmount currency
53
+ startDate endDate createdAt
54
+ }
55
+ pageInfo { cursor hasMore }
56
+ }
57
+ }
58
+ `,$=`
59
+ mutation PswCreateEngagement($input: PswCreateEngagementInput!) {
60
+ pswCreateEngagement(input: $input) {
61
+ id clientId name description status feeArrangement feeAmount currency
62
+ startDate endDate practiceAreaId responsiblePartnerId tags createdAt
63
+ }
64
+ }
65
+ `,N=`
66
+ mutation PswUpdateEngagement($id: ID!, $input: PswUpdateEngagementInput!) {
67
+ pswUpdateEngagement(id: $id, input: $input) {
68
+ id clientId name description status feeArrangement feeAmount currency
69
+ startDate endDate practiceAreaId responsiblePartnerId tags updatedAt
70
+ }
71
+ }
72
+ `,M=`
73
+ mutation PswTransitionEngagement($id: ID!, $status: PswEngagementStatus!) {
74
+ pswTransitionEngagement(id: $id, status: $status) {
75
+ id name status updatedAt
76
+ }
77
+ }
78
+ `,_=`
79
+ query PswMatter($id: ID!) {
80
+ pswMatter(id: $id) {
81
+ id clientId engagementId title reference description status priority
82
+ isPrivileged practiceAreaId leadPractitionerId dueDate closedAt tags
83
+ createdAt updatedAt workspaceId
84
+ }
85
+ }
86
+ `,q=`
87
+ query PswListMatters(
88
+ $clientId: ID
89
+ $engagementId: ID
90
+ $status: PswMatterStatus
91
+ $pagination: PaginationInput
92
+ ) {
93
+ pswListMatters(
94
+ clientId: $clientId
95
+ engagementId: $engagementId
96
+ status: $status
97
+ pagination: $pagination
98
+ ) {
99
+ items {
100
+ id clientId title reference status priority isPrivileged dueDate createdAt
101
+ }
102
+ pageInfo { cursor hasMore }
103
+ }
104
+ }
105
+ `,U=`
106
+ mutation PswCreateMatter($input: PswCreateMatterInput!) {
107
+ pswCreateMatter(input: $input) {
108
+ id clientId engagementId title reference description status priority
109
+ isPrivileged practiceAreaId leadPractitionerId dueDate tags createdAt
110
+ }
111
+ }
112
+ `,G=`
113
+ mutation PswUpdateMatter($id: ID!, $input: PswUpdateMatterInput!) {
114
+ pswUpdateMatter(id: $id, input: $input) {
115
+ id clientId engagementId title description status priority isPrivileged
116
+ practiceAreaId leadPractitionerId dueDate tags updatedAt
117
+ }
118
+ }
119
+ `,W=`
120
+ mutation PswCloseMatter($id: ID!) {
121
+ pswCloseMatter(id: $id) {
122
+ id title status closedAt updatedAt
123
+ }
124
+ }
125
+ `,j=`
126
+ query PswListInvoices(
127
+ $clientId: ID
128
+ $status: PswInvoiceStatus
129
+ $pagination: PaginationInput
130
+ ) {
131
+ pswListInvoices(clientId: $clientId, status: $status, pagination: $pagination) {
132
+ items {
133
+ id number clientId engagementId status issueDate dueDate
134
+ subtotal taxAmount total currency createdAt
135
+ }
136
+ pageInfo { cursor hasMore }
137
+ }
138
+ }
139
+ `,F=`
140
+ mutation PswCreateInvoice($input: PswCreateInvoiceInput!) {
141
+ pswCreateInvoice(input: $input) {
142
+ id number clientId engagementId status issueDate dueDate
143
+ subtotal taxAmount total currency lineItems notes createdAt
144
+ }
145
+ }
146
+ `,V=`
147
+ mutation PswMarkInvoicePaid($id: ID!) {
148
+ pswMarkInvoicePaid(id: $id) {
149
+ id number status total paidAt updatedAt
150
+ }
151
+ }
152
+ `,H=`
153
+ mutation PswLogTimeEntry($input: PswCreateTimeEntryInput!) {
154
+ pswLogTimeEntry(input: $input) {
155
+ id matterId engagementId practitionerId date minutes billable rate
156
+ narrative status createdAt
157
+ }
158
+ }
159
+ `,z=`
160
+ query PswListComplianceChecks(
161
+ $status: PswComplianceStatus
162
+ $subjectId: ID
163
+ $subjectType: String
164
+ $pagination: PaginationInput
165
+ ) {
166
+ pswListComplianceChecks(
167
+ status: $status
168
+ subjectId: $subjectId
169
+ subjectType: $subjectType
170
+ pagination: $pagination
171
+ ) {
172
+ id type status title subjectId subjectType reviewerId dueDate
173
+ resolvedAt details evidenceFileId createdAt updatedAt workspaceId
174
+ }
175
+ }
176
+ `,B=`
177
+ query PswListConflictChecks($clientId: ID, $pagination: PaginationInput) {
178
+ pswListConflictChecks(clientId: $clientId, pagination: $pagination) {
179
+ id clientId matterId status searchedParties findings waiverReason
180
+ clearedById resolvedAt createdAt updatedAt workspaceId
181
+ }
182
+ }
183
+ `,K=`
184
+ query PswListPracticeAreas($pagination: PaginationInput) {
185
+ pswListPracticeAreas(pagination: $pagination) {
186
+ id name code description isActive createdAt updatedAt workspaceId
187
+ }
188
+ }
189
+ `,J=`
190
+ query PswHealth {
191
+ pswHealth
192
+ }
193
+ `;function Y(i,r){try{return JSON.parse(r)}catch{throw new p(`--${i} must be valid JSON`)}}function u(i){let r=Number.parseInt(i,10);if(Number.isNaN(r))throw new p(`Expected an integer but got "${i}"`);return r}function f(i){let r=Number.parseFloat(i);if(Number.isNaN(r))throw new p(`Expected a number but got "${i}"`);return r}function C(i){return i.split(",").map(r=>r.trim()).filter(r=>r.length>0)}function g(i){let r={};return i.limit!==void 0&&(r.limit=i.limit),i.offset!==void 0&&(r.offset=i.offset),i.cursor!==void 0&&(r.cursor=i.cursor),Object.keys(r).length?r:void 0}function Q(i){let r=i.command("clients").description("ProServiceWorld clients");r.command("list").description("List clients").option("--status <s>","PROSPECT|ACTIVE|INACTIVE|ARCHIVED").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("--cursor <c>","Pagination cursor").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(P,{status:t.status?t.status.toUpperCase():void 0,pagination:g(t)});s(t,e.pswListClients.items,{headers:["ID","Name","Type","Status","Industry","Contact"],rows:e.pswListClients.items.map(n=>[m(n.id,12),n.name,n.type,n.status,n.industry??"-",n.contactName??"-"])});}catch(e){o(e);}}),r.command("get").description("Get a client by id").argument("<id>","Client ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(x,{id:t});if(!n.pswClient)throw new p(`Client ${t} not found`);s(e,n.pswClient);}catch(n){o(n);}}),r.command("create").description("Create a client").requiredOption("--name <name>","Client name").option("--type <t>","INDIVIDUAL|ORGANIZATION").option("--status <s>","PROSPECT|ACTIVE|INACTIVE|ARCHIVED").option("--industry <i>","Industry").option("--contact-name <n>","Primary contact name").option("--contact-email <e>","Primary contact email").option("--contact-phone <p>","Primary contact phone").option("--address <a>","Address").option("--notes <n>","Notes").option("--relationship-owner <id>","Relationship owner user ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name};t.type&&(e.type=t.type.toUpperCase()),t.status&&(e.status=t.status.toUpperCase()),t.industry&&(e.industry=t.industry),t.contactName&&(e.contactName=t.contactName),t.contactEmail&&(e.contactEmail=t.contactEmail),t.contactPhone&&(e.contactPhone=t.contactPhone),t.address&&(e.address=t.address),t.notes&&(e.notes=t.notes),t.relationshipOwner&&(e.relationshipOwnerId=t.relationshipOwner),t.tags&&(e.tags=C(t.tags));let n=await a(D,{input:e});d(`Client created: ${n.pswCreateClient.name}`),s(t,n.pswCreateClient);}catch(e){o(e);}}),r.command("update").description("Update a client").argument("<id>","Client ID").option("--name <name>","Client name").option("--type <t>","INDIVIDUAL|ORGANIZATION").option("--status <s>","PROSPECT|ACTIVE|INACTIVE|ARCHIVED").option("--industry <i>","Industry").option("--contact-name <n>","Primary contact name").option("--contact-email <e>","Primary contact email").option("--contact-phone <p>","Primary contact phone").option("--address <a>","Address").option("--notes <n>","Notes").option("--relationship-owner <id>","Relationship owner user ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.name&&(n.name=e.name),e.type&&(n.type=e.type.toUpperCase()),e.status&&(n.status=e.status.toUpperCase()),e.industry!==void 0&&(n.industry=e.industry),e.contactName!==void 0&&(n.contactName=e.contactName),e.contactEmail!==void 0&&(n.contactEmail=e.contactEmail),e.contactPhone!==void 0&&(n.contactPhone=e.contactPhone),e.address!==void 0&&(n.address=e.address),e.notes!==void 0&&(n.notes=e.notes),e.relationshipOwner&&(n.relationshipOwnerId=e.relationshipOwner),e.tags&&(n.tags=C(e.tags)),!Object.keys(n).length)throw new p("No updates specified");let E=await a(O,{id:t,input:n});d("Client updated"),s(e,E.pswUpdateClient);}catch(n){o(n);}}),r.command("archive").description("Archive a client").argument("<id>","Client ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(S,{id:t});d(n.pswArchiveClient?`Client ${t} archived`:`Client ${t} not archived`),s(e,{archived:n.pswArchiveClient});}catch(n){o(n);}});}function X(i){let r=i.command("engagements").description("ProServiceWorld engagements");r.command("list").description("List engagements").option("--client <id>","Filter by client ID").option("--status <s>","Engagement status").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("--cursor <c>","Pagination cursor").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(R,{clientId:t.client,status:t.status?t.status.toUpperCase():void 0,pagination:g(t)});s(t,e.pswListEngagements.items,{headers:["ID","Name","Status","Fee","Amount","Currency"],rows:e.pswListEngagements.items.map(n=>[m(n.id,12),n.name,n.status,n.feeArrangement??"-",n.feeAmount!=null?String(n.feeAmount):"-",n.currency??"-"])});}catch(e){o(e);}}),r.command("get").description("Get an engagement by id").argument("<id>","Engagement ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(L,{id:t});if(!n.pswEngagement)throw new p(`Engagement ${t} not found`);s(e,n.pswEngagement);}catch(n){o(n);}}),r.command("create").description("Create an engagement").requiredOption("--client <id>","Client ID").requiredOption("--name <name>","Engagement name").option("--description <s>","Description").option("--fee-arrangement <f>","FIXED|HOURLY|RETAINER|VALUE_BASED").option("--fee-amount <n>","Fee amount",f).option("--currency <c>","Currency code").option("--start-date <iso>","Start date (ISO)").option("--end-date <iso>","End date (ISO)").option("--practice-area <id>","Practice area ID").option("--responsible-partner <id>","Responsible partner user ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={clientId:t.client,name:t.name};t.description&&(e.description=t.description),t.feeArrangement&&(e.feeArrangement=t.feeArrangement.toUpperCase()),t.feeAmount!==void 0&&(e.feeAmount=t.feeAmount),t.currency&&(e.currency=t.currency),t.startDate&&(e.startDate=t.startDate),t.endDate&&(e.endDate=t.endDate),t.practiceArea&&(e.practiceAreaId=t.practiceArea),t.responsiblePartner&&(e.responsiblePartnerId=t.responsiblePartner),t.tags&&(e.tags=C(t.tags));let n=await a($,{input:e});d(`Engagement created: ${n.pswCreateEngagement.name}`),s(t,n.pswCreateEngagement);}catch(e){o(e);}}),r.command("update").description("Update an engagement").argument("<id>","Engagement ID").option("--name <name>","Engagement name").option("--description <s>","Description").option("--fee-arrangement <f>","FIXED|HOURLY|RETAINER|VALUE_BASED").option("--fee-amount <n>","Fee amount",f).option("--currency <c>","Currency code").option("--start-date <iso>","Start date (ISO)").option("--end-date <iso>","End date (ISO)").option("--practice-area <id>","Practice area ID").option("--responsible-partner <id>","Responsible partner user ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.name&&(n.name=e.name),e.description!==void 0&&(n.description=e.description),e.feeArrangement&&(n.feeArrangement=e.feeArrangement.toUpperCase()),e.feeAmount!==void 0&&(n.feeAmount=e.feeAmount),e.currency&&(n.currency=e.currency),e.startDate&&(n.startDate=e.startDate),e.endDate&&(n.endDate=e.endDate),e.practiceArea&&(n.practiceAreaId=e.practiceArea),e.responsiblePartner&&(n.responsiblePartnerId=e.responsiblePartner),e.tags&&(n.tags=C(e.tags)),!Object.keys(n).length)throw new p("No updates specified");let E=await a(N,{id:t,input:n});d("Engagement updated"),s(e,E.pswUpdateEngagement);}catch(n){o(n);}}),r.command("transition").description("Advance an engagement through its delivery lifecycle").argument("<id>","Engagement ID").requiredOption("--status <s>","PROPOSAL|ACCEPTED|IN_PROGRESS|REVIEW|DELIVERED|INVOICED|CLOSED|CANCELLED").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(M,{id:t,status:e.status.toUpperCase()});d(`Engagement transitioned to ${n.pswTransitionEngagement.status}`),s(e,n.pswTransitionEngagement);}catch(n){o(n);}});}function Z(i){let r=i.command("matters").description("ProServiceWorld matters");r.command("list").description("List matters").option("--client <id>","Filter by client ID").option("--engagement <id>","Filter by engagement ID").option("--status <s>","OPEN|ON_HOLD|CLOSED|ARCHIVED").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("--cursor <c>","Pagination cursor").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(q,{clientId:t.client,engagementId:t.engagement,status:t.status?t.status.toUpperCase():void 0,pagination:g(t)});s(t,e.pswListMatters.items,{headers:["ID","Title","Reference","Status","Priority","Privileged"],rows:e.pswListMatters.items.map(n=>[m(n.id,12),n.title,n.reference??"-",n.status,n.priority,n.isPrivileged?"yes":"no"])});}catch(e){o(e);}}),r.command("get").description("Get a matter by id").argument("<id>","Matter ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(_,{id:t});if(!n.pswMatter)throw new p(`Matter ${t} not found`);s(e,n.pswMatter);}catch(n){o(n);}}),r.command("create").description("Create a matter").requiredOption("--client <id>","Client ID").requiredOption("--title <t>","Matter title").option("--reference <r>","External reference").option("--description <s>","Description").option("--engagement <id>","Engagement ID").option("--practice-area <id>","Practice area ID").option("--lead-practitioner <id>","Lead practitioner user ID").option("--priority <p>","LOW|MEDIUM|HIGH|CRITICAL").option("--privileged","Mark as privileged").option("--due-date <iso>","Due date (ISO)").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={clientId:t.client,title:t.title};t.reference&&(e.reference=t.reference),t.description&&(e.description=t.description),t.engagement&&(e.engagementId=t.engagement),t.practiceArea&&(e.practiceAreaId=t.practiceArea),t.leadPractitioner&&(e.leadPractitionerId=t.leadPractitioner),t.priority&&(e.priority=t.priority.toUpperCase()),t.privileged&&(e.isPrivileged=!0),t.dueDate&&(e.dueDate=t.dueDate),t.tags&&(e.tags=C(t.tags));let n=await a(U,{input:e});d(`Matter created: ${n.pswCreateMatter.title}`),s(t,n.pswCreateMatter);}catch(e){o(e);}}),r.command("update").description("Update a matter").argument("<id>","Matter ID").option("--title <t>","Matter title").option("--description <s>","Description").option("--engagement <id>","Engagement ID").option("--practice-area <id>","Practice area ID").option("--lead-practitioner <id>","Lead practitioner user ID").option("--priority <p>","LOW|MEDIUM|HIGH|CRITICAL").option("--privileged <bool>","true|false",t=>t==="true").option("--due-date <iso>","Due date (ISO)").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.title&&(n.title=e.title),e.description!==void 0&&(n.description=e.description),e.engagement&&(n.engagementId=e.engagement),e.practiceArea&&(n.practiceAreaId=e.practiceArea),e.leadPractitioner&&(n.leadPractitionerId=e.leadPractitioner),e.priority&&(n.priority=e.priority.toUpperCase()),e.privileged!==void 0&&(n.isPrivileged=e.privileged),e.dueDate&&(n.dueDate=e.dueDate),e.tags&&(n.tags=C(e.tags)),!Object.keys(n).length)throw new p("No updates specified");let E=await a(G,{id:t,input:n});d("Matter updated"),s(e,E.pswUpdateMatter);}catch(n){o(n);}}),r.command("close").description("Close a matter").argument("<id>","Matter ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(W,{id:t});d(`Matter closed: ${n.pswCloseMatter.status}`),s(e,n.pswCloseMatter);}catch(n){o(n);}});}function tt(i){let r=i.command("invoices").description("ProServiceWorld invoices");r.command("list").description("List invoices").option("--client <id>","Filter by client ID").option("--status <s>","DRAFT|SENT|PAID|OVERDUE|CANCELLED").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("--cursor <c>","Pagination cursor").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(j,{clientId:t.client,status:t.status?t.status.toUpperCase():void 0,pagination:g(t)});s(t,e.pswListInvoices.items,{headers:["ID","Number","Status","Total","Currency"],rows:e.pswListInvoices.items.map(n=>[m(n.id,12),n.number,n.status,n.total!=null?String(n.total):"-",n.currency??"-"])});}catch(e){o(e);}}),r.command("create").description("Create an invoice").requiredOption("--client <id>","Client ID").requiredOption("--number <n>","Invoice number").option("--engagement <id>","Engagement ID").option("--currency <c>","Currency code").option("--issue-date <iso>","Issue date (ISO)").option("--due-date <iso>","Due date (ISO)").option("--subtotal <n>","Subtotal",f).option("--tax-amount <n>","Tax amount",f).option("--total <n>","Total",f).option("--line-items <json>","Line items JSON").option("--notes <s>","Notes").option("-f, --format <format>","Output format").action(async t=>{try{let e={clientId:t.client,number:t.number};t.engagement&&(e.engagementId=t.engagement),t.currency&&(e.currency=t.currency),t.issueDate&&(e.issueDate=t.issueDate),t.dueDate&&(e.dueDate=t.dueDate),t.subtotal!==void 0&&(e.subtotal=t.subtotal),t.taxAmount!==void 0&&(e.taxAmount=t.taxAmount),t.total!==void 0&&(e.total=t.total),t.lineItems&&(e.lineItems=Y("line-items",t.lineItems)),t.notes&&(e.notes=t.notes);let n=await a(F,{input:e});d(`Invoice created: ${n.pswCreateInvoice.number}`),s(t,n.pswCreateInvoice);}catch(e){o(e);}}),r.command("mark-paid").description("Mark an invoice as paid").argument("<id>","Invoice ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(V,{id:t});d(`Invoice ${n.pswMarkInvoicePaid.number} marked ${n.pswMarkInvoicePaid.status}`),s(e,n.pswMarkInvoicePaid);}catch(n){o(n);}});}function et(i){i.command("time-entries").description("ProServiceWorld time entries").command("log").description("Log a time entry").requiredOption("--date <iso>","Entry date (ISO)").requiredOption("--minutes <n>","Minutes worked",u).option("--matter <id>","Matter ID").option("--engagement <id>","Engagement ID").option("--rate <n>","Hourly rate",f).option("--narrative <s>","Narrative").option("--non-billable","Mark entry as non-billable").option("-f, --format <format>","Output format").action(async t=>{try{if(!t.matter&&!t.engagement)throw new p("Provide --matter or --engagement to log time against");let e={date:t.date,minutes:t.minutes,billable:!t.nonBillable};t.matter&&(e.matterId=t.matter),t.engagement&&(e.engagementId=t.engagement),t.rate!==void 0&&(e.rate=t.rate),t.narrative&&(e.narrative=t.narrative);let n=await a(H,{input:e});d(`Time entry logged: ${n.pswLogTimeEntry.minutes} minutes`),s(t,n.pswLogTimeEntry);}catch(e){o(e);}});}function nt(i){i.command("compliance").description("ProServiceWorld compliance checks").command("list").description("List compliance checks").option("--status <s>","PENDING|IN_REVIEW|PASSED|FAILED|WAIVED").option("--subject <id>","Filter by subject ID").option("--subject-type <t>","Filter by subject type").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("--cursor <c>","Pagination cursor").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(z,{status:t.status?t.status.toUpperCase():void 0,subjectId:t.subject,subjectType:t.subjectType,pagination:g(t)});s(t,e.pswListComplianceChecks,{headers:["ID","Title","Type","Status","Subject","Due"],rows:e.pswListComplianceChecks.map(n=>[m(n.id,12),n.title,n.type,n.status,m(n.subjectId,12),b(n.dueDate)])});}catch(e){o(e);}});}function rt(i){i.command("conflicts").description("ProServiceWorld conflict-of-interest checks").command("list").description("List conflict checks").option("--client <id>","Filter by client ID").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("--cursor <c>","Pagination cursor").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(B,{clientId:t.client,pagination:g(t)});s(t,e.pswListConflictChecks,{headers:["ID","Client","Matter","Status","Parties"],rows:e.pswListConflictChecks.map(n=>[m(n.id,12),m(n.clientId,12),n.matterId?m(n.matterId,12):"-",n.status,String(n.searchedParties.length)])});}catch(e){o(e);}});}function it(i){i.command("practice-areas").description("ProServiceWorld practice areas").command("list").description("List practice areas").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("--cursor <c>","Pagination cursor").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(K,{pagination:g(t)});s(t,e.pswListPracticeAreas,{headers:["ID","Name","Code","Active"],rows:e.pswListPracticeAreas.map(n=>[m(n.id,12),n.name,n.code??"-",n.isActive?"yes":"no"])});}catch(e){o(e);}});}function ot(i){i.command("health").description("ProServiceWorld service health check (public)").option("-f, --format <format>","Output format").action(async r=>{try{let t=await A(J);d(t.pswHealth),s(r,{health:t.pswHealth});}catch(t){o(t);}});}var It={id:"proserviceworld",version:"1.0.0",displayName:"ProServiceWorld",dependsOn:["auth","workspaces"],register(i,r){v(r);let t=i.command("proserviceworld").description("ProServiceWorld professional-services automation");Q(t),X(t),Z(t),tt(t),et(t),nt(t),rt(t),it(t),ot(t);}},dn=It;module.exports=dn;
@@ -0,0 +1,7 @@
1
+ import { C as CliModule } from '../../module-DxCuik6L.cjs';
2
+ import 'commander';
3
+ import 'graphql-request';
4
+
5
+ declare const proserviceworldModule: CliModule;
6
+
7
+ export { proserviceworldModule as default };
@@ -0,0 +1,7 @@
1
+ import { C as CliModule } from '../../module-DxCuik6L.js';
2
+ import 'commander';
3
+ import 'graphql-request';
4
+
5
+ declare const proserviceworldModule: CliModule;
6
+
7
+ export { proserviceworldModule as default };
@@ -0,0 +1,193 @@
1
+ import {a,b as b$1,h as h$1,p,g,i,o as o$1,d}from'../../chunk-WXDQ3S5J.js';import {o}from'../../chunk-TCBALVP4.js';var P=`
2
+ query PswClient($id: ID!) {
3
+ pswClient(id: $id) {
4
+ id name type status industry contactName contactEmail contactPhone
5
+ address notes tags relationshipOwnerId createdAt updatedAt workspaceId
6
+ }
7
+ }
8
+ `,D=`
9
+ query PswListClients($pagination: PaginationInput, $status: PswClientStatus) {
10
+ pswListClients(pagination: $pagination, status: $status) {
11
+ items {
12
+ id name type status industry contactName contactEmail
13
+ relationshipOwnerId createdAt
14
+ }
15
+ pageInfo { cursor hasMore }
16
+ }
17
+ }
18
+ `,h=`
19
+ mutation PswCreateClient($input: PswCreateClientInput!) {
20
+ pswCreateClient(input: $input) {
21
+ id name type status industry contactName contactEmail contactPhone
22
+ address notes tags relationshipOwnerId createdAt
23
+ }
24
+ }
25
+ `,b=`
26
+ mutation PswUpdateClient($id: ID!, $input: PswUpdateClientInput!) {
27
+ pswUpdateClient(id: $id, input: $input) {
28
+ id name type status industry contactName contactEmail contactPhone
29
+ address notes tags relationshipOwnerId updatedAt
30
+ }
31
+ }
32
+ `,T=`
33
+ mutation PswArchiveClient($id: ID!) {
34
+ pswArchiveClient(id: $id)
35
+ }
36
+ `,O=`
37
+ query PswEngagement($id: ID!) {
38
+ pswEngagement(id: $id) {
39
+ id clientId name description status feeArrangement feeAmount currency
40
+ startDate endDate practiceAreaId responsiblePartnerId tags
41
+ createdAt updatedAt workspaceId
42
+ }
43
+ }
44
+ `,v=`
45
+ query PswListEngagements(
46
+ $clientId: ID
47
+ $status: PswEngagementStatus
48
+ $pagination: PaginationInput
49
+ ) {
50
+ pswListEngagements(clientId: $clientId, status: $status, pagination: $pagination) {
51
+ items {
52
+ id clientId name status feeArrangement feeAmount currency
53
+ startDate endDate createdAt
54
+ }
55
+ pageInfo { cursor hasMore }
56
+ }
57
+ }
58
+ `,L=`
59
+ mutation PswCreateEngagement($input: PswCreateEngagementInput!) {
60
+ pswCreateEngagement(input: $input) {
61
+ id clientId name description status feeArrangement feeAmount currency
62
+ startDate endDate practiceAreaId responsiblePartnerId tags createdAt
63
+ }
64
+ }
65
+ `,N=`
66
+ mutation PswUpdateEngagement($id: ID!, $input: PswUpdateEngagementInput!) {
67
+ pswUpdateEngagement(id: $id, input: $input) {
68
+ id clientId name description status feeArrangement feeAmount currency
69
+ startDate endDate practiceAreaId responsiblePartnerId tags updatedAt
70
+ }
71
+ }
72
+ `,M=`
73
+ mutation PswTransitionEngagement($id: ID!, $status: PswEngagementStatus!) {
74
+ pswTransitionEngagement(id: $id, status: $status) {
75
+ id name status updatedAt
76
+ }
77
+ }
78
+ `,R=`
79
+ query PswMatter($id: ID!) {
80
+ pswMatter(id: $id) {
81
+ id clientId engagementId title reference description status priority
82
+ isPrivileged practiceAreaId leadPractitionerId dueDate closedAt tags
83
+ createdAt updatedAt workspaceId
84
+ }
85
+ }
86
+ `,S=`
87
+ query PswListMatters(
88
+ $clientId: ID
89
+ $engagementId: ID
90
+ $status: PswMatterStatus
91
+ $pagination: PaginationInput
92
+ ) {
93
+ pswListMatters(
94
+ clientId: $clientId
95
+ engagementId: $engagementId
96
+ status: $status
97
+ pagination: $pagination
98
+ ) {
99
+ items {
100
+ id clientId title reference status priority isPrivileged dueDate createdAt
101
+ }
102
+ pageInfo { cursor hasMore }
103
+ }
104
+ }
105
+ `,$=`
106
+ mutation PswCreateMatter($input: PswCreateMatterInput!) {
107
+ pswCreateMatter(input: $input) {
108
+ id clientId engagementId title reference description status priority
109
+ isPrivileged practiceAreaId leadPractitionerId dueDate tags createdAt
110
+ }
111
+ }
112
+ `,k=`
113
+ mutation PswUpdateMatter($id: ID!, $input: PswUpdateMatterInput!) {
114
+ pswUpdateMatter(id: $id, input: $input) {
115
+ id clientId engagementId title description status priority isPrivileged
116
+ practiceAreaId leadPractitionerId dueDate tags updatedAt
117
+ }
118
+ }
119
+ `,_=`
120
+ mutation PswCloseMatter($id: ID!) {
121
+ pswCloseMatter(id: $id) {
122
+ id title status closedAt updatedAt
123
+ }
124
+ }
125
+ `,U=`
126
+ query PswListInvoices(
127
+ $clientId: ID
128
+ $status: PswInvoiceStatus
129
+ $pagination: PaginationInput
130
+ ) {
131
+ pswListInvoices(clientId: $clientId, status: $status, pagination: $pagination) {
132
+ items {
133
+ id number clientId engagementId status issueDate dueDate
134
+ subtotal taxAmount total currency createdAt
135
+ }
136
+ pageInfo { cursor hasMore }
137
+ }
138
+ }
139
+ `,G=`
140
+ mutation PswCreateInvoice($input: PswCreateInvoiceInput!) {
141
+ pswCreateInvoice(input: $input) {
142
+ id number clientId engagementId status issueDate dueDate
143
+ subtotal taxAmount total currency lineItems notes createdAt
144
+ }
145
+ }
146
+ `,x=`
147
+ mutation PswMarkInvoicePaid($id: ID!) {
148
+ pswMarkInvoicePaid(id: $id) {
149
+ id number status total paidAt updatedAt
150
+ }
151
+ }
152
+ `,H=`
153
+ mutation PswLogTimeEntry($input: PswCreateTimeEntryInput!) {
154
+ pswLogTimeEntry(input: $input) {
155
+ id matterId engagementId practitionerId date minutes billable rate
156
+ narrative status createdAt
157
+ }
158
+ }
159
+ `,j=`
160
+ query PswListComplianceChecks(
161
+ $status: PswComplianceStatus
162
+ $subjectId: ID
163
+ $subjectType: String
164
+ $pagination: PaginationInput
165
+ ) {
166
+ pswListComplianceChecks(
167
+ status: $status
168
+ subjectId: $subjectId
169
+ subjectType: $subjectType
170
+ pagination: $pagination
171
+ ) {
172
+ id type status title subjectId subjectType reviewerId dueDate
173
+ resolvedAt details evidenceFileId createdAt updatedAt workspaceId
174
+ }
175
+ }
176
+ `,V=`
177
+ query PswListConflictChecks($clientId: ID, $pagination: PaginationInput) {
178
+ pswListConflictChecks(clientId: $clientId, pagination: $pagination) {
179
+ id clientId matterId status searchedParties findings waiverReason
180
+ clearedById resolvedAt createdAt updatedAt workspaceId
181
+ }
182
+ }
183
+ `,W=`
184
+ query PswListPracticeAreas($pagination: PaginationInput) {
185
+ pswListPracticeAreas(pagination: $pagination) {
186
+ id name code description isActive createdAt updatedAt workspaceId
187
+ }
188
+ }
189
+ `,F=`
190
+ query PswHealth {
191
+ pswHealth
192
+ }
193
+ `;function q(r,i){try{return JSON.parse(i)}catch{throw new o(`--${r} must be valid JSON`)}}function c(r){let i=Number.parseInt(r,10);if(Number.isNaN(i))throw new o(`Expected an integer but got "${r}"`);return i}function I(r){let i=Number.parseFloat(r);if(Number.isNaN(i))throw new o(`Expected a number but got "${r}"`);return i}function C(r){return r.split(",").map(i=>i.trim()).filter(i=>i.length>0)}function u(r){let i={};return r.limit!==void 0&&(i.limit=r.limit),r.offset!==void 0&&(i.offset=r.offset),r.cursor!==void 0&&(i.cursor=r.cursor),Object.keys(i).length?i:void 0}function z(r){let i$1=r.command("clients").description("ProServiceWorld clients");i$1.command("list").description("List clients").option("--status <s>","PROSPECT|ACTIVE|INACTIVE|ARCHIVED").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("--cursor <c>","Pagination cursor").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(D,{status:t.status?t.status.toUpperCase():void 0,pagination:u(t)});h$1(t,e.pswListClients.items,{headers:["ID","Name","Type","Status","Industry","Contact"],rows:e.pswListClients.items.map(n=>[p(n.id,12),n.name,n.type,n.status,n.industry??"-",n.contactName??"-"])});}catch(e){g(e);}}),i$1.command("get").description("Get a client by id").argument("<id>","Client ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(P,{id:t});if(!n.pswClient)throw new o(`Client ${t} not found`);h$1(e,n.pswClient);}catch(n){g(n);}}),i$1.command("create").description("Create a client").requiredOption("--name <name>","Client name").option("--type <t>","INDIVIDUAL|ORGANIZATION").option("--status <s>","PROSPECT|ACTIVE|INACTIVE|ARCHIVED").option("--industry <i>","Industry").option("--contact-name <n>","Primary contact name").option("--contact-email <e>","Primary contact email").option("--contact-phone <p>","Primary contact phone").option("--address <a>","Address").option("--notes <n>","Notes").option("--relationship-owner <id>","Relationship owner user ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name};t.type&&(e.type=t.type.toUpperCase()),t.status&&(e.status=t.status.toUpperCase()),t.industry&&(e.industry=t.industry),t.contactName&&(e.contactName=t.contactName),t.contactEmail&&(e.contactEmail=t.contactEmail),t.contactPhone&&(e.contactPhone=t.contactPhone),t.address&&(e.address=t.address),t.notes&&(e.notes=t.notes),t.relationshipOwner&&(e.relationshipOwnerId=t.relationshipOwner),t.tags&&(e.tags=C(t.tags));let n=await b$1(h,{input:e});i(`Client created: ${n.pswCreateClient.name}`),h$1(t,n.pswCreateClient);}catch(e){g(e);}}),i$1.command("update").description("Update a client").argument("<id>","Client ID").option("--name <name>","Client name").option("--type <t>","INDIVIDUAL|ORGANIZATION").option("--status <s>","PROSPECT|ACTIVE|INACTIVE|ARCHIVED").option("--industry <i>","Industry").option("--contact-name <n>","Primary contact name").option("--contact-email <e>","Primary contact email").option("--contact-phone <p>","Primary contact phone").option("--address <a>","Address").option("--notes <n>","Notes").option("--relationship-owner <id>","Relationship owner user ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.name&&(n.name=e.name),e.type&&(n.type=e.type.toUpperCase()),e.status&&(n.status=e.status.toUpperCase()),e.industry!==void 0&&(n.industry=e.industry),e.contactName!==void 0&&(n.contactName=e.contactName),e.contactEmail!==void 0&&(n.contactEmail=e.contactEmail),e.contactPhone!==void 0&&(n.contactPhone=e.contactPhone),e.address!==void 0&&(n.address=e.address),e.notes!==void 0&&(n.notes=e.notes),e.relationshipOwner&&(n.relationshipOwnerId=e.relationshipOwner),e.tags&&(n.tags=C(e.tags)),!Object.keys(n).length)throw new o("No updates specified");let w=await b$1(b,{id:t,input:n});i("Client updated"),h$1(e,w.pswUpdateClient);}catch(n){g(n);}}),i$1.command("archive").description("Archive a client").argument("<id>","Client ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(T,{id:t});i(n.pswArchiveClient?`Client ${t} archived`:`Client ${t} not archived`),h$1(e,{archived:n.pswArchiveClient});}catch(n){g(n);}});}function K(r){let i$1=r.command("engagements").description("ProServiceWorld engagements");i$1.command("list").description("List engagements").option("--client <id>","Filter by client ID").option("--status <s>","Engagement status").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("--cursor <c>","Pagination cursor").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(v,{clientId:t.client,status:t.status?t.status.toUpperCase():void 0,pagination:u(t)});h$1(t,e.pswListEngagements.items,{headers:["ID","Name","Status","Fee","Amount","Currency"],rows:e.pswListEngagements.items.map(n=>[p(n.id,12),n.name,n.status,n.feeArrangement??"-",n.feeAmount!=null?String(n.feeAmount):"-",n.currency??"-"])});}catch(e){g(e);}}),i$1.command("get").description("Get an engagement by id").argument("<id>","Engagement ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(O,{id:t});if(!n.pswEngagement)throw new o(`Engagement ${t} not found`);h$1(e,n.pswEngagement);}catch(n){g(n);}}),i$1.command("create").description("Create an engagement").requiredOption("--client <id>","Client ID").requiredOption("--name <name>","Engagement name").option("--description <s>","Description").option("--fee-arrangement <f>","FIXED|HOURLY|RETAINER|VALUE_BASED").option("--fee-amount <n>","Fee amount",I).option("--currency <c>","Currency code").option("--start-date <iso>","Start date (ISO)").option("--end-date <iso>","End date (ISO)").option("--practice-area <id>","Practice area ID").option("--responsible-partner <id>","Responsible partner user ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={clientId:t.client,name:t.name};t.description&&(e.description=t.description),t.feeArrangement&&(e.feeArrangement=t.feeArrangement.toUpperCase()),t.feeAmount!==void 0&&(e.feeAmount=t.feeAmount),t.currency&&(e.currency=t.currency),t.startDate&&(e.startDate=t.startDate),t.endDate&&(e.endDate=t.endDate),t.practiceArea&&(e.practiceAreaId=t.practiceArea),t.responsiblePartner&&(e.responsiblePartnerId=t.responsiblePartner),t.tags&&(e.tags=C(t.tags));let n=await b$1(L,{input:e});i(`Engagement created: ${n.pswCreateEngagement.name}`),h$1(t,n.pswCreateEngagement);}catch(e){g(e);}}),i$1.command("update").description("Update an engagement").argument("<id>","Engagement ID").option("--name <name>","Engagement name").option("--description <s>","Description").option("--fee-arrangement <f>","FIXED|HOURLY|RETAINER|VALUE_BASED").option("--fee-amount <n>","Fee amount",I).option("--currency <c>","Currency code").option("--start-date <iso>","Start date (ISO)").option("--end-date <iso>","End date (ISO)").option("--practice-area <id>","Practice area ID").option("--responsible-partner <id>","Responsible partner user ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.name&&(n.name=e.name),e.description!==void 0&&(n.description=e.description),e.feeArrangement&&(n.feeArrangement=e.feeArrangement.toUpperCase()),e.feeAmount!==void 0&&(n.feeAmount=e.feeAmount),e.currency&&(n.currency=e.currency),e.startDate&&(n.startDate=e.startDate),e.endDate&&(n.endDate=e.endDate),e.practiceArea&&(n.practiceAreaId=e.practiceArea),e.responsiblePartner&&(n.responsiblePartnerId=e.responsiblePartner),e.tags&&(n.tags=C(e.tags)),!Object.keys(n).length)throw new o("No updates specified");let w=await b$1(N,{id:t,input:n});i("Engagement updated"),h$1(e,w.pswUpdateEngagement);}catch(n){g(n);}}),i$1.command("transition").description("Advance an engagement through its delivery lifecycle").argument("<id>","Engagement ID").requiredOption("--status <s>","PROPOSAL|ACCEPTED|IN_PROGRESS|REVIEW|DELIVERED|INVOICED|CLOSED|CANCELLED").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(M,{id:t,status:e.status.toUpperCase()});i(`Engagement transitioned to ${n.pswTransitionEngagement.status}`),h$1(e,n.pswTransitionEngagement);}catch(n){g(n);}});}function B(r){let i$1=r.command("matters").description("ProServiceWorld matters");i$1.command("list").description("List matters").option("--client <id>","Filter by client ID").option("--engagement <id>","Filter by engagement ID").option("--status <s>","OPEN|ON_HOLD|CLOSED|ARCHIVED").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("--cursor <c>","Pagination cursor").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(S,{clientId:t.client,engagementId:t.engagement,status:t.status?t.status.toUpperCase():void 0,pagination:u(t)});h$1(t,e.pswListMatters.items,{headers:["ID","Title","Reference","Status","Priority","Privileged"],rows:e.pswListMatters.items.map(n=>[p(n.id,12),n.title,n.reference??"-",n.status,n.priority,n.isPrivileged?"yes":"no"])});}catch(e){g(e);}}),i$1.command("get").description("Get a matter by id").argument("<id>","Matter ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(R,{id:t});if(!n.pswMatter)throw new o(`Matter ${t} not found`);h$1(e,n.pswMatter);}catch(n){g(n);}}),i$1.command("create").description("Create a matter").requiredOption("--client <id>","Client ID").requiredOption("--title <t>","Matter title").option("--reference <r>","External reference").option("--description <s>","Description").option("--engagement <id>","Engagement ID").option("--practice-area <id>","Practice area ID").option("--lead-practitioner <id>","Lead practitioner user ID").option("--priority <p>","LOW|MEDIUM|HIGH|CRITICAL").option("--privileged","Mark as privileged").option("--due-date <iso>","Due date (ISO)").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={clientId:t.client,title:t.title};t.reference&&(e.reference=t.reference),t.description&&(e.description=t.description),t.engagement&&(e.engagementId=t.engagement),t.practiceArea&&(e.practiceAreaId=t.practiceArea),t.leadPractitioner&&(e.leadPractitionerId=t.leadPractitioner),t.priority&&(e.priority=t.priority.toUpperCase()),t.privileged&&(e.isPrivileged=!0),t.dueDate&&(e.dueDate=t.dueDate),t.tags&&(e.tags=C(t.tags));let n=await b$1($,{input:e});i(`Matter created: ${n.pswCreateMatter.title}`),h$1(t,n.pswCreateMatter);}catch(e){g(e);}}),i$1.command("update").description("Update a matter").argument("<id>","Matter ID").option("--title <t>","Matter title").option("--description <s>","Description").option("--engagement <id>","Engagement ID").option("--practice-area <id>","Practice area ID").option("--lead-practitioner <id>","Lead practitioner user ID").option("--priority <p>","LOW|MEDIUM|HIGH|CRITICAL").option("--privileged <bool>","true|false",t=>t==="true").option("--due-date <iso>","Due date (ISO)").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.title&&(n.title=e.title),e.description!==void 0&&(n.description=e.description),e.engagement&&(n.engagementId=e.engagement),e.practiceArea&&(n.practiceAreaId=e.practiceArea),e.leadPractitioner&&(n.leadPractitionerId=e.leadPractitioner),e.priority&&(n.priority=e.priority.toUpperCase()),e.privileged!==void 0&&(n.isPrivileged=e.privileged),e.dueDate&&(n.dueDate=e.dueDate),e.tags&&(n.tags=C(e.tags)),!Object.keys(n).length)throw new o("No updates specified");let w=await b$1(k,{id:t,input:n});i("Matter updated"),h$1(e,w.pswUpdateMatter);}catch(n){g(n);}}),i$1.command("close").description("Close a matter").argument("<id>","Matter ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(_,{id:t});i(`Matter closed: ${n.pswCloseMatter.status}`),h$1(e,n.pswCloseMatter);}catch(n){g(n);}});}function J(r){let i$1=r.command("invoices").description("ProServiceWorld invoices");i$1.command("list").description("List invoices").option("--client <id>","Filter by client ID").option("--status <s>","DRAFT|SENT|PAID|OVERDUE|CANCELLED").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("--cursor <c>","Pagination cursor").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(U,{clientId:t.client,status:t.status?t.status.toUpperCase():void 0,pagination:u(t)});h$1(t,e.pswListInvoices.items,{headers:["ID","Number","Status","Total","Currency"],rows:e.pswListInvoices.items.map(n=>[p(n.id,12),n.number,n.status,n.total!=null?String(n.total):"-",n.currency??"-"])});}catch(e){g(e);}}),i$1.command("create").description("Create an invoice").requiredOption("--client <id>","Client ID").requiredOption("--number <n>","Invoice number").option("--engagement <id>","Engagement ID").option("--currency <c>","Currency code").option("--issue-date <iso>","Issue date (ISO)").option("--due-date <iso>","Due date (ISO)").option("--subtotal <n>","Subtotal",I).option("--tax-amount <n>","Tax amount",I).option("--total <n>","Total",I).option("--line-items <json>","Line items JSON").option("--notes <s>","Notes").option("-f, --format <format>","Output format").action(async t=>{try{let e={clientId:t.client,number:t.number};t.engagement&&(e.engagementId=t.engagement),t.currency&&(e.currency=t.currency),t.issueDate&&(e.issueDate=t.issueDate),t.dueDate&&(e.dueDate=t.dueDate),t.subtotal!==void 0&&(e.subtotal=t.subtotal),t.taxAmount!==void 0&&(e.taxAmount=t.taxAmount),t.total!==void 0&&(e.total=t.total),t.lineItems&&(e.lineItems=q("line-items",t.lineItems)),t.notes&&(e.notes=t.notes);let n=await b$1(G,{input:e});i(`Invoice created: ${n.pswCreateInvoice.number}`),h$1(t,n.pswCreateInvoice);}catch(e){g(e);}}),i$1.command("mark-paid").description("Mark an invoice as paid").argument("<id>","Invoice ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(x,{id:t});i(`Invoice ${n.pswMarkInvoicePaid.number} marked ${n.pswMarkInvoicePaid.status}`),h$1(e,n.pswMarkInvoicePaid);}catch(n){g(n);}});}function Y(r){r.command("time-entries").description("ProServiceWorld time entries").command("log").description("Log a time entry").requiredOption("--date <iso>","Entry date (ISO)").requiredOption("--minutes <n>","Minutes worked",c).option("--matter <id>","Matter ID").option("--engagement <id>","Engagement ID").option("--rate <n>","Hourly rate",I).option("--narrative <s>","Narrative").option("--non-billable","Mark entry as non-billable").option("-f, --format <format>","Output format").action(async t=>{try{if(!t.matter&&!t.engagement)throw new o("Provide --matter or --engagement to log time against");let e={date:t.date,minutes:t.minutes,billable:!t.nonBillable};t.matter&&(e.matterId=t.matter),t.engagement&&(e.engagementId=t.engagement),t.rate!==void 0&&(e.rate=t.rate),t.narrative&&(e.narrative=t.narrative);let n=await b$1(H,{input:e});i(`Time entry logged: ${n.pswLogTimeEntry.minutes} minutes`),h$1(t,n.pswLogTimeEntry);}catch(e){g(e);}});}function X(r){r.command("compliance").description("ProServiceWorld compliance checks").command("list").description("List compliance checks").option("--status <s>","PENDING|IN_REVIEW|PASSED|FAILED|WAIVED").option("--subject <id>","Filter by subject ID").option("--subject-type <t>","Filter by subject type").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("--cursor <c>","Pagination cursor").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(j,{status:t.status?t.status.toUpperCase():void 0,subjectId:t.subject,subjectType:t.subjectType,pagination:u(t)});h$1(t,e.pswListComplianceChecks,{headers:["ID","Title","Type","Status","Subject","Due"],rows:e.pswListComplianceChecks.map(n=>[p(n.id,12),n.title,n.type,n.status,p(n.subjectId,12),o$1(n.dueDate)])});}catch(e){g(e);}});}function Z(r){r.command("conflicts").description("ProServiceWorld conflict-of-interest checks").command("list").description("List conflict checks").option("--client <id>","Filter by client ID").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("--cursor <c>","Pagination cursor").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(V,{clientId:t.client,pagination:u(t)});h$1(t,e.pswListConflictChecks,{headers:["ID","Client","Matter","Status","Parties"],rows:e.pswListConflictChecks.map(n=>[p(n.id,12),p(n.clientId,12),n.matterId?p(n.matterId,12):"-",n.status,String(n.searchedParties.length)])});}catch(e){g(e);}});}function Q(r){r.command("practice-areas").description("ProServiceWorld practice areas").command("list").description("List practice areas").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("--cursor <c>","Pagination cursor").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(W,{pagination:u(t)});h$1(t,e.pswListPracticeAreas,{headers:["ID","Name","Code","Active"],rows:e.pswListPracticeAreas.map(n=>[p(n.id,12),n.name,n.code??"-",n.isActive?"yes":"no"])});}catch(e){g(e);}});}function tt(r){r.command("health").description("ProServiceWorld service health check (public)").option("-f, --format <format>","Output format").action(async i$1=>{try{let t=await d(F);i(t.pswHealth),h$1(i$1,{health:t.pswHealth});}catch(t){g(t);}});}var et={id:"proserviceworld",version:"1.0.0",displayName:"ProServiceWorld",dependsOn:["auth","workspaces"],register(r,i){a(i);let t=r.command("proserviceworld").description("ProServiceWorld professional-services automation");z(t),K(t),B(t),J(t),Y(t),X(t),Z(t),Q(t),tt(t);}},Ft=et;export{Ft as default};