@burdenoff/cli-sdk 2026.1102.2 → 2026.1102.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/modules/adaptercloud/index.cjs +6 -3
- package/dist/modules/adaptercloud/index.js +6 -3
- package/dist/modules/atheletebridge/index.cjs +33 -19
- package/dist/modules/atheletebridge/index.js +32 -18
- package/dist/modules/buildmyiq/index.cjs +64 -67
- package/dist/modules/buildmyiq/index.js +60 -63
- package/dist/modules/comradecircle/index.cjs +23 -15
- package/dist/modules/comradecircle/index.js +19 -11
- package/dist/modules/coolandlovely/index.cjs +27 -14
- package/dist/modules/coolandlovely/index.js +29 -16
- package/dist/modules/ecoimpacthub/index.cjs +19 -9
- package/dist/modules/ecoimpacthub/index.js +19 -9
- package/dist/modules/eventfullymanaged/index.cjs +77 -77
- package/dist/modules/eventfullymanaged/index.js +78 -78
- package/dist/modules/govcitizenhub/index.cjs +7 -4
- package/dist/modules/govcitizenhub/index.js +7 -4
- package/dist/modules/intelwatchtower/index.cjs +24 -12
- package/dist/modules/intelwatchtower/index.js +24 -12
- package/dist/modules/labsofscience/index.cjs +8 -4
- package/dist/modules/labsofscience/index.js +8 -4
- package/dist/modules/manufacturedops/index.cjs +35 -22
- package/dist/modules/manufacturedops/index.js +34 -21
- package/dist/modules/planmagnet/index.cjs +21 -21
- package/dist/modules/planmagnet/index.js +32 -32
- package/dist/modules/proserviceworld/index.cjs +17 -12
- package/dist/modules/proserviceworld/index.js +17 -12
- package/dist/modules/subscriberbot/index.cjs +43 -19
- package/dist/modules/subscriberbot/index.js +46 -22
- package/dist/modules/technospam/index.cjs +17 -8
- package/dist/modules/technospam/index.js +17 -8
- package/dist/modules/theculturepost/index.cjs +27 -22
- package/dist/modules/theculturepost/index.js +31 -26
- package/dist/modules/theglobalfuel/index.cjs +65 -60
- package/dist/modules/theglobalfuel/index.js +65 -60
- package/package.json +1 -1
|
@@ -50,8 +50,11 @@ import {a,b as b$1,i,r,h,k as k$1,q as q$1,d}from'../../chunk-O6UCQ5IT.js';impor
|
|
|
50
50
|
`,k=`
|
|
51
51
|
query SubListPlans($providerId: ID) {
|
|
52
52
|
subListPlans(providerId: $providerId) {
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
items {
|
|
54
|
+
id providerId name description amount currency interval features isActive createdAt
|
|
55
|
+
updatedAt workspaceId
|
|
56
|
+
}
|
|
57
|
+
pageInfo { cursor hasMore }
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
60
|
`,O=`
|
|
@@ -125,30 +128,38 @@ import {a,b as b$1,i,r,h,k as k$1,q as q$1,d}from'../../chunk-O6UCQ5IT.js';impor
|
|
|
125
128
|
`,N=`
|
|
126
129
|
query SubListRenewalEvents($relationshipId: ID, $upcomingOnly: Boolean) {
|
|
127
130
|
subListRenewalEvents(relationshipId: $relationshipId, upcomingOnly: $upcomingOnly) {
|
|
128
|
-
|
|
129
|
-
|
|
131
|
+
items {
|
|
132
|
+
id relationshipId eventType detail amount currency occursAt notified createdAt
|
|
133
|
+
updatedAt workspaceId
|
|
134
|
+
}
|
|
135
|
+
pageInfo { cursor hasMore }
|
|
130
136
|
}
|
|
131
137
|
}
|
|
132
|
-
`,
|
|
138
|
+
`,M=`
|
|
133
139
|
query SubListAssets($relationshipId: ID!) {
|
|
134
140
|
subListAssets(relationshipId: $relationshipId) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
141
|
+
items {
|
|
142
|
+
id relationshipId name type secretRef expiresAt createdAt updatedAt workspaceId
|
|
143
|
+
file { id }
|
|
144
|
+
}
|
|
145
|
+
pageInfo { cursor hasMore }
|
|
138
146
|
}
|
|
139
147
|
}
|
|
140
|
-
`,
|
|
148
|
+
`,_=`
|
|
141
149
|
mutation SubCreateAsset($input: SubCreateAssetInput!) {
|
|
142
150
|
subCreateAsset(input: $input) {
|
|
143
151
|
id relationshipId name type secretRef expiresAt createdAt
|
|
144
152
|
file { id }
|
|
145
153
|
}
|
|
146
154
|
}
|
|
147
|
-
`,
|
|
155
|
+
`,U=`
|
|
148
156
|
query SubListEntitlements($relationshipId: ID!) {
|
|
149
157
|
subListEntitlements(relationshipId: $relationshipId) {
|
|
150
|
-
|
|
151
|
-
|
|
158
|
+
items {
|
|
159
|
+
id relationshipId name description type quota unit used isActive createdAt updatedAt
|
|
160
|
+
workspaceId
|
|
161
|
+
}
|
|
162
|
+
pageInfo { cursor hasMore }
|
|
152
163
|
}
|
|
153
164
|
}
|
|
154
165
|
`,q=`
|
|
@@ -188,8 +199,11 @@ import {a,b as b$1,i,r,h,k as k$1,q as q$1,d}from'../../chunk-O6UCQ5IT.js';impor
|
|
|
188
199
|
`,V=`
|
|
189
200
|
query SubListPaymentInstruments($ownerId: ID) {
|
|
190
201
|
subListPaymentInstruments(ownerId: $ownerId) {
|
|
191
|
-
|
|
192
|
-
|
|
202
|
+
items {
|
|
203
|
+
id ownerId label type status brand last4 expiryMonth expiryYear isDefault createdAt
|
|
204
|
+
updatedAt workspaceId
|
|
205
|
+
}
|
|
206
|
+
pageInfo { cursor hasMore }
|
|
193
207
|
}
|
|
194
208
|
}
|
|
195
209
|
`,G=`
|
|
@@ -206,8 +220,11 @@ import {a,b as b$1,i,r,h,k as k$1,q as q$1,d}from'../../chunk-O6UCQ5IT.js';impor
|
|
|
206
220
|
`,Y=`
|
|
207
221
|
query SubListChannels($ownerId: ID) {
|
|
208
222
|
subListChannels(ownerId: $ownerId) {
|
|
209
|
-
|
|
210
|
-
|
|
223
|
+
items {
|
|
224
|
+
id ownerId type address label status ingestEnabled verifiedAt createdAt updatedAt
|
|
225
|
+
workspaceId
|
|
226
|
+
}
|
|
227
|
+
pageInfo { cursor hasMore }
|
|
211
228
|
}
|
|
212
229
|
}
|
|
213
230
|
`,j=`
|
|
@@ -270,7 +287,8 @@ import {a,b as b$1,i,r,h,k as k$1,q as q$1,d}from'../../chunk-O6UCQ5IT.js';impor
|
|
|
270
287
|
`,Z=`
|
|
271
288
|
query SubListAgents($kind: SubAgentKind, $ownerId: ID, $status: SubAgentStatus) {
|
|
272
289
|
subListAgents(kind: $kind, ownerId: $ownerId, status: $status) {
|
|
273
|
-
id ownerId name description kind status lastRunAt createdAt
|
|
290
|
+
items { id ownerId name description kind status lastRunAt createdAt }
|
|
291
|
+
pageInfo { cursor hasMore }
|
|
274
292
|
}
|
|
275
293
|
}
|
|
276
294
|
`,tt=`
|
|
@@ -288,8 +306,11 @@ import {a,b as b$1,i,r,h,k as k$1,q as q$1,d}from'../../chunk-O6UCQ5IT.js';impor
|
|
|
288
306
|
`,nt=`
|
|
289
307
|
query SubListPolicies($agentId: ID) {
|
|
290
308
|
subListPolicies(agentId: $agentId) {
|
|
291
|
-
|
|
292
|
-
|
|
309
|
+
items {
|
|
310
|
+
id agentId name description action condition isEnabled triggerCount lastTriggeredAt
|
|
311
|
+
createdAt updatedAt workspaceId
|
|
312
|
+
}
|
|
313
|
+
pageInfo { cursor hasMore }
|
|
293
314
|
}
|
|
294
315
|
}
|
|
295
316
|
`,it=`
|
|
@@ -302,8 +323,11 @@ import {a,b as b$1,i,r,h,k as k$1,q as q$1,d}from'../../chunk-O6UCQ5IT.js';impor
|
|
|
302
323
|
`,rt=`
|
|
303
324
|
query SubListWorkflows($status: SubWorkflowStatus) {
|
|
304
325
|
subListWorkflows(status: $status) {
|
|
305
|
-
|
|
306
|
-
|
|
326
|
+
items {
|
|
327
|
+
id name description triggerEvent status runCount lastRunAt createdAt updatedAt
|
|
328
|
+
workspaceId
|
|
329
|
+
}
|
|
330
|
+
pageInfo { cursor hasMore }
|
|
307
331
|
}
|
|
308
332
|
}
|
|
309
333
|
`,st=`
|
|
@@ -322,4 +346,4 @@ import {a,b as b$1,i,r,h,k as k$1,q as q$1,d}from'../../chunk-O6UCQ5IT.js';impor
|
|
|
322
346
|
query SubHealth {
|
|
323
347
|
subHealth
|
|
324
348
|
}
|
|
325
|
-
`;function y(d,i){try{return JSON.parse(i)}catch{throw new o(`--${d} must be valid JSON`)}}function p(d){let i=Number.parseInt(d,10);if(Number.isNaN(i))throw new o(`Expected an integer but got "${d}"`);return i}function b(d){let i=Number.parseFloat(d);if(Number.isNaN(i))throw new o(`Expected a number but got "${d}"`);return i}function I(d){return d.split(",").map(i=>i.trim()).filter(i=>i.length>0)}function dt(d){let i$1=d.command("providers").description("SubscriberBot provider registry (vendors / publishers / services)");i$1.command("list").description("List / search providers in the registry").option("--category <c>","Filter by provider category").option("--status <s>","Filter by provider status").option("--search <q>","Free-text search").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(R,{category:t.category?t.category.toUpperCase():void 0,status:t.status?t.status.toUpperCase():void 0,search:t.search,pagination:{limit:t.limit,offset:t.offset}});i(t,e.subListProviders.items,{headers:["ID","Name","Category","Status","Region","Churn"],rows:e.subListProviders.items.map(n=>[r(n.id,12),n.name,n.category,n.status,n.region??"-",n.churnRiskScore!=null?String(n.churnRiskScore):"-"])});}catch(e){h(e);}}),i$1.command("get").description("Get a provider by id").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(C,{id:t});if(!n.subProvider)throw new o(`Provider ${t} not found`);i(e,n.subProvider);}catch(n){h(n);}}),i$1.command("create").description("Create a provider").requiredOption("--name <name>","Provider name").option("--category <c>","Provider category","OTHER").option("--status <s>","Provider status","UNVERIFIED").option("--slug <slug>","URL slug").option("--description <s>","Description").option("--industry <s>","Industry").option("--language <s>","Language").option("--region <s>","Region").option("--website-url <url>","Website URL").option("--logo-file-id <id>","Logo file ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,category:(t.category??"OTHER").toUpperCase(),status:(t.status??"UNVERIFIED").toUpperCase()};t.slug&&(e.slug=t.slug),t.description&&(e.description=t.description),t.industry&&(e.industry=t.industry),t.language&&(e.language=t.language),t.region&&(e.region=t.region),t.websiteUrl&&(e.websiteUrl=t.websiteUrl),t.logoFileId&&(e.logoFileId=t.logoFileId),t.tags&&(e.tags=I(t.tags));let n=await b$1(S,{input:e});k$1(`Provider created: ${n.subCreateProvider.name}`),i(t,n.subCreateProvider);}catch(e){h(e);}}),i$1.command("update").description("Update a provider").argument("<id>","Provider ID").option("--name <name>","Provider name").option("--category <c>","Provider category").option("--status <s>","Provider status").option("--slug <slug>","URL slug").option("--description <s>","Description").option("--industry <s>","Industry").option("--language <s>","Language").option("--region <s>","Region").option("--website-url <url>","Website URL").option("--logo-file-id <id>","Logo file ID").option("--churn-risk-score <n>","Churn risk score",p).option("--vendor-health-score <n>","Vendor health score",p).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.category&&(n.category=e.category.toUpperCase()),e.status&&(n.status=e.status.toUpperCase()),e.slug&&(n.slug=e.slug),e.description!==void 0&&(n.description=e.description),e.industry&&(n.industry=e.industry),e.language&&(n.language=e.language),e.region&&(n.region=e.region),e.websiteUrl&&(n.websiteUrl=e.websiteUrl),e.logoFileId&&(n.logoFileId=e.logoFileId),e.churnRiskScore!==void 0&&(n.churnRiskScore=e.churnRiskScore),e.vendorHealthScore!==void 0&&(n.vendorHealthScore=e.vendorHealthScore),e.tags&&(n.tags=I(e.tags)),!Object.keys(n).length)throw new o("No updates specified");let h=await b$1(v,{id:t,input:n});k$1("Provider updated"),i(e,h.subUpdateProvider);}catch(n){h(n);}}),i$1.command("archive").description("Archive (soft-delete) a provider").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(E,{id:t});k$1(`Provider ${t} archived`),i(e,{archived:n.subArchiveProvider});}catch(n){h(n);}});}function ut(d){let i$1=d.command("plans").description("SubscriberBot provider plans");i$1.command("list").description("List plans (optionally filtered by provider)").option("--provider <id>","Filter by provider ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(k,{providerId:t.provider});i(t,e.subListPlans,{headers:["ID","Name","Amount","Currency","Interval","Active"],rows:e.subListPlans.map(n=>[r(n.id,12),n.name,String(n.amount),n.currency,n.interval,n.isActive?"yes":"no"])});}catch(e){h(e);}}),i$1.command("create").description("Create a plan for a provider").requiredOption("--provider <id>","Provider ID").requiredOption("--name <name>","Plan name").option("--amount <n>","Amount",b).option("--currency <c>","Currency code").option("--interval <i>","Billing interval","MONTHLY").option("--description <s>","Description").option("--features <csv>","Comma-separated feature list").option("-f, --format <format>","Output format").action(async t=>{try{let e={providerId:t.provider,name:t.name,interval:(t.interval??"MONTHLY").toUpperCase()};t.amount!==void 0&&(e.amount=t.amount),t.currency&&(e.currency=t.currency),t.description&&(e.description=t.description),t.features&&(e.features=I(t.features));let n=await b$1(O,{input:e});k$1(`Plan created: ${n.subCreatePlan.name}`),i(t,n.subCreatePlan);}catch(e){h(e);}});}function pt(d){let i$1=d.command("relationships").description("SubscriberBot subscriptions, memberships & recurring relationships");i$1.command("list").description("List relationships").option("--kind <k>","Filter by relationship kind").option("--owner <id>","Filter by owner ID").option("--provider <id>","Filter by provider ID").option("--status <s>","Filter by relationship status").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(T,{kind:t.kind?t.kind.toUpperCase():void 0,ownerId:t.owner,providerId:t.provider,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});i(t,e.subListRelationships.items,{headers:["ID","Label","Kind","Status","Amount","Renews"],rows:e.subListRelationships.items.map(n=>[r(n.id,12),n.label,n.kind,n.status,`${n.amount} ${n.currency}`,q$1(n.renewsAt)])});}catch(e){h(e);}}),i$1.command("get").description("Get a relationship by id").argument("<id>","Relationship ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(L,{id:t});if(!n.subRelationship)throw new o(`Relationship ${t} not found`);i(e,n.subRelationship);}catch(n){h(n);}}),i$1.command("create").description("Create a relationship (subscription / membership / \u2026)").requiredOption("--label <label>","Human-readable label").option("--kind <k>","Relationship kind","SUBSCRIPTION").option("--status <s>","Relationship status","ACTIVE").option("--owner <id>","Owner ID").option("--provider <id>","Provider ID").option("--plan <id>","Plan ID").option("--amount <n>","Amount",b).option("--currency <c>","Currency code").option("--interval <i>","Billing interval","MONTHLY").option("--discovery-source <s>","Discovery source","MANUAL").option("--no-auto-renew","Disable auto-renew").option("--notes <s>","Notes").option("--tags <csv>","Comma-separated tags").option("--started-at <iso>","Started at (ISO date)").option("--renews-at <iso>","Renews at (ISO date)").option("--trial-ends-at <iso>","Trial end (ISO date)").option("-f, --format <format>","Output format").action(async t=>{try{let e={label:t.label,kind:(t.kind??"SUBSCRIPTION").toUpperCase(),status:(t.status??"ACTIVE").toUpperCase(),interval:(t.interval??"MONTHLY").toUpperCase(),discoverySource:(t.discoverySource??"MANUAL").toUpperCase(),autoRenew:t.autoRenew!==!1};t.owner&&(e.ownerId=t.owner),t.provider&&(e.providerId=t.provider),t.plan&&(e.planId=t.plan),t.amount!==void 0&&(e.amount=t.amount),t.currency&&(e.currency=t.currency),t.notes&&(e.notes=t.notes),t.tags&&(e.tags=I(t.tags)),t.startedAt&&(e.startedAt=t.startedAt),t.renewsAt&&(e.renewsAt=t.renewsAt),t.trialEndsAt&&(e.trialEndsAt=t.trialEndsAt);let n=await b$1(P,{input:e});k$1(`Relationship created: ${n.subCreateRelationship.label}`),i(t,n.subCreateRelationship);}catch(e){h(e);}}),i$1.command("update").description("Update a relationship").argument("<id>","Relationship ID").option("--label <label>","Label").option("--kind <k>","Relationship kind").option("--provider <id>","Provider ID").option("--plan <id>","Plan ID").option("--amount <n>","Amount",b).option("--currency <c>","Currency code").option("--interval <i>","Billing interval").option("--auto-renew <bool>","true|false",t=>t==="true").option("--health-score <n>","Health score",p).option("--notes <s>","Notes").option("--tags <csv>","Comma-separated tags").option("--started-at <iso>","Started at (ISO date)").option("--renews-at <iso>","Renews at (ISO date)").option("--trial-ends-at <iso>","Trial end (ISO date)").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.label&&(n.label=e.label),e.kind&&(n.kind=e.kind.toUpperCase()),e.provider&&(n.providerId=e.provider),e.plan&&(n.planId=e.plan),e.amount!==void 0&&(n.amount=e.amount),e.currency&&(n.currency=e.currency),e.interval&&(n.interval=e.interval.toUpperCase()),e.autoRenew!==void 0&&(n.autoRenew=e.autoRenew),e.healthScore!==void 0&&(n.healthScore=e.healthScore),e.notes!==void 0&&(n.notes=e.notes),e.tags&&(n.tags=I(e.tags)),e.startedAt&&(n.startedAt=e.startedAt),e.renewsAt&&(n.renewsAt=e.renewsAt),e.trialEndsAt&&(n.trialEndsAt=e.trialEndsAt),!Object.keys(n).length)throw new o("No updates specified");let h=await b$1(D,{id:t,input:n});k$1("Relationship updated"),i(e,h.subUpdateRelationship);}catch(n){h(n);}}),i$1.command("cancel").description("Cancel a relationship").argument("<id>","Relationship ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1($,{id:t});k$1(`Relationship cancelled: ${n.subCancelRelationship.label}`),i(e,n.subCancelRelationship);}catch(n){h(n);}}),i$1.command("transition").description("Advance a relationship through its lifecycle").argument("<id>","Relationship ID").requiredOption("--status <s>","ACTIVE|TRIAL|PAST_DUE|PAUSED|CANCELLED|EXPIRED|LAPSED").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(x,{id:t,status:e.status.toUpperCase()});k$1(`Relationship status set to ${n.subTransitionRelationship.status}`),i(e,n.subTransitionRelationship);}catch(n){h(n);}}),i$1.command("renewals").description("List renewal events").option("--relationship <id>","Filter by relationship ID").option("--upcoming-only","Only upcoming events").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(N,{relationshipId:t.relationship,upcomingOnly:t.upcomingOnly?!0:void 0});i(t,e.subListRenewalEvents,{headers:["ID","Relationship","Type","Amount","Occurs","Notified"],rows:e.subListRenewalEvents.map(n=>[r(n.id,12),r(n.relationshipId,12),n.eventType,n.amount!=null?`${n.amount} ${n.currency??""}`.trim():"-",q$1(n.occursAt),n.notified?"yes":"no"])});}catch(e){h(e);}});}function ct(d){let i$1=d.command("assets").description("SubscriberBot relationship assets (contracts, licenses, credentials, \u2026)");i$1.command("list").description("List assets for a relationship").requiredOption("--relationship <id>","Relationship ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(_,{relationshipId:t.relationship});i(t,e.subListAssets,{headers:["ID","Name","Type","Secret","Expires"],rows:e.subListAssets.map(n=>[r(n.id,12),n.name,n.type,n.secretRef?"yes":"no",q$1(n.expiresAt)])});}catch(e){h(e);}}),i$1.command("create").description("Create an asset on a relationship").requiredOption("--relationship <id>","Relationship ID").requiredOption("--name <name>","Asset name").option("--type <t>","Asset type","RECEIPT").option("--file-id <id>","Referenced file ID (blob lives in wspace-files-svc)").option("--secret-ref <ref>","Secret reference").option("--expires-at <iso>","Expiry (ISO date)").option("-f, --format <format>","Output format").action(async t=>{try{let e={relationshipId:t.relationship,name:t.name,type:(t.type??"RECEIPT").toUpperCase()};t.fileId&&(e.fileId=t.fileId),t.secretRef&&(e.secretRef=t.secretRef),t.expiresAt&&(e.expiresAt=t.expiresAt);let n=await b$1(U,{input:e});k$1(`Asset created: ${n.subCreateAsset.name}`),i(t,n.subCreateAsset);}catch(e){h(e);}});}function mt(d){let i$1=d.command("entitlements").description("SubscriberBot relationship entitlements (seats, quotas, features, \u2026)");i$1.command("list").description("List entitlements for a relationship").requiredOption("--relationship <id>","Relationship ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(M,{relationshipId:t.relationship});i(t,e.subListEntitlements,{headers:["ID","Name","Type","Used","Quota","Active"],rows:e.subListEntitlements.map(n=>[r(n.id,12),n.name,n.type,String(n.used),n.quota!=null?String(n.quota):"-",n.isActive?"yes":"no"])});}catch(e){h(e);}}),i$1.command("create").description("Create an entitlement on a relationship").requiredOption("--relationship <id>","Relationship ID").requiredOption("--name <name>","Entitlement name").option("--type <t>","Entitlement type","FEATURE_ACCESS").option("--description <s>","Description").option("--quota <n>","Quota",p).option("--unit <u>","Quota unit").option("-f, --format <format>","Output format").action(async t=>{try{let e={relationshipId:t.relationship,name:t.name,type:(t.type??"FEATURE_ACCESS").toUpperCase()};t.description&&(e.description=t.description),t.quota!==void 0&&(e.quota=t.quota),t.unit&&(e.unit=t.unit);let n=await b$1(q,{input:e});k$1(`Entitlement created: ${n.subCreateEntitlement.name}`),i(t,n.subCreateEntitlement);}catch(e){h(e);}});}function lt(d){let i$1=d.command("invoices").description("SubscriberBot invoices");i$1.command("list").description("List invoices").option("--relationship <id>","Filter by relationship ID").option("--status <s>","Filter by invoice status").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(W,{relationshipId:t.relationship,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});i(t,e.subListInvoices.items,{headers:["ID","Number","Status","Total","Currency","Due"],rows:e.subListInvoices.items.map(n=>[r(n.id,12),n.number??"-",n.status,String(n.total),n.currency,q$1(n.dueDate)])});}catch(e){h(e);}}),i$1.command("create").description("Create an invoice on a relationship").requiredOption("--relationship <id>","Relationship ID").option("--number <n>","Invoice number").option("--status <s>","Invoice status","ISSUED").option("--currency <c>","Currency code").option("--subtotal <n>","Subtotal",b).option("--tax-amount <n>","Tax amount",b).option("--total <n>","Total",b).option("--line-items <json>","Line items JSON").option("--issue-date <iso>","Issue date (ISO date)").option("--due-date <iso>","Due date (ISO date)").option("--payment-instrument <id>","Payment instrument ID").option("--file-id <id>","Referenced file ID (invoice PDF in wspace-files-svc)").option("-f, --format <format>","Output format").action(async t=>{try{let e={relationshipId:t.relationship,status:(t.status??"ISSUED").toUpperCase()};t.number&&(e.number=t.number),t.currency&&(e.currency=t.currency),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.issueDate&&(e.issueDate=t.issueDate),t.dueDate&&(e.dueDate=t.dueDate),t.paymentInstrument&&(e.paymentInstrumentId=t.paymentInstrument),t.fileId&&(e.fileId=t.fileId);let n=await b$1(H,{input:e});k$1(`Invoice created: ${n.subCreateInvoice.number??n.subCreateInvoice.id}`),i(t,n.subCreateInvoice);}catch(e){h(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(F,{id:t});k$1(`Invoice marked paid: ${n.subMarkInvoicePaid.number??n.subMarkInvoicePaid.id}`),i(e,n.subMarkInvoicePaid);}catch(n){h(n);}});}function gt(d){let i$1=d.command("payment-instruments").description("SubscriberBot payment instruments (cards, wallets, bank accounts, \u2026)");i$1.command("list").description("List payment instruments").option("--owner <id>","Filter by owner ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(V,{ownerId:t.owner});i(t,e.subListPaymentInstruments,{headers:["ID","Label","Type","Status","Brand","Last4","Default"],rows:e.subListPaymentInstruments.map(n=>[r(n.id,12),n.label,n.type,n.status,n.brand??"-",n.last4??"-",n.isDefault?"yes":"no"])});}catch(e){h(e);}}),i$1.command("create").description("Add a payment instrument").requiredOption("--label <label>","Label").option("--type <t>","Payment instrument type","CARD").option("--owner <id>","Owner ID").option("--brand <b>","Card/instrument brand").option("--last4 <n>","Last 4 digits").option("--expiry-month <n>","Expiry month",p).option("--expiry-year <n>","Expiry year",p).option("--processor-token <t>","Processor token").option("--default","Mark as default").option("-f, --format <format>","Output format").action(async t=>{try{let e={label:t.label,type:(t.type??"CARD").toUpperCase(),isDefault:t.default===!0};t.owner&&(e.ownerId=t.owner),t.brand&&(e.brand=t.brand),t.last4&&(e.last4=t.last4),t.expiryMonth!==void 0&&(e.expiryMonth=t.expiryMonth),t.expiryYear!==void 0&&(e.expiryYear=t.expiryYear),t.processorToken&&(e.processorToken=t.processorToken);let n=await b$1(G,{input:e});k$1(`Payment instrument added: ${n.subCreatePaymentInstrument.label}`),i(t,n.subCreatePaymentInstrument);}catch(e){h(e);}}),i$1.command("remove").description("Remove a payment instrument").argument("<id>","Payment instrument ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(B,{id:t});k$1(`Payment instrument ${t} removed`),i(e,{removed:n.subRemovePaymentInstrument});}catch(n){h(n);}});}function ft(d){let i$1=d.command("channels").description("SubscriberBot communication channels (email, sms, slack, webhook, \u2026)");i$1.command("list").description("List communication channels").option("--owner <id>","Filter by owner ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(Y,{ownerId:t.owner});i(t,e.subListChannels,{headers:["ID","Type","Address","Label","Status","Ingest"],rows:e.subListChannels.map(n=>[r(n.id,12),n.type,n.address,n.label??"-",n.status,n.ingestEnabled?"yes":"no"])});}catch(e){h(e);}}),i$1.command("create").description("Create a communication channel").requiredOption("--address <addr>","Channel address (email, phone, webhook URL, \u2026)").option("--type <t>","Channel type","EMAIL").option("--owner <id>","Owner ID").option("--label <label>","Label").option("--no-ingest","Disable message ingestion").option("-f, --format <format>","Output format").action(async t=>{try{let e={address:t.address,type:(t.type??"EMAIL").toUpperCase(),ingestEnabled:t.ingest!==!1};t.owner&&(e.ownerId=t.owner),t.label&&(e.label=t.label);let n=await b$1(j,{input:e});k$1(`Channel created: ${n.subCreateChannel.address}`),i(t,n.subCreateChannel);}catch(e){h(e);}}),i$1.command("verify").description("Mark a channel as verified").argument("<id>","Channel ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(K,{id:t});k$1(`Channel verified: ${n.subVerifyChannel.address}`),i(e,n.subVerifyChannel);}catch(n){h(n);}});}function bt(d){let i$1=d.command("inbox").description("SubscriberBot universal inbox (merged subscription communications)");i$1.command("list").description("List inbox messages").option("--category <c>","Filter by message category").option("--channel <id>","Filter by channel ID").option("--relationship <id>","Filter by relationship ID").option("--unread-only","Only unread messages").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(J,{category:t.category?t.category.toUpperCase():void 0,channelId:t.channel,relationshipId:t.relationship,unreadOnly:t.unreadOnly?!0:void 0,pagination:{limit:t.limit,offset:t.offset}});i(t,e.subListInboxMessages.items,{headers:["ID","Subject","Category","Read","Action","Received"],rows:e.subListInboxMessages.items.map(n=>[r(n.id,12),r(n.subject??"-",30),n.category,n.isRead?"yes":"no",n.actionRequired?"yes":"no",q$1(n.receivedAt)])});}catch(e){h(e);}}),i$1.command("ingest").description("Ingest a message into the universal inbox").requiredOption("--channel <id>","Channel ID").requiredOption("--received-at <iso>","Received at (ISO date)").option("--category <c>","Message category","OTHER").option("--relationship <id>","Relationship ID").option("--subject <s>","Subject").option("--preview <s>","Preview text").option("--external-id <id>","External message ID").option("--category-confidence <n>","Category confidence (0-100)",p).option("--action-required","Flag as action required").option("-f, --format <format>","Output format").action(async t=>{try{let e={channelId:t.channel,receivedAt:t.receivedAt,category:(t.category??"OTHER").toUpperCase(),actionRequired:t.actionRequired===!0};t.relationship&&(e.relationshipId=t.relationship),t.subject&&(e.subject=t.subject),t.preview&&(e.preview=t.preview),t.externalId&&(e.externalId=t.externalId),t.categoryConfidence!==void 0&&(e.categoryConfidence=t.categoryConfidence);let n=await b$1(z,{input:e});k$1(`Message ingested: ${n.subIngestMessage.id}`),i(t,n.subIngestMessage);}catch(e){h(e);}}),i$1.command("mark-read").description("Mark a message as read").argument("<id>","Message ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(Q,{id:t});k$1(`Message ${t} marked read`),i(e,n.subMarkMessageRead);}catch(n){h(n);}});}function It(d){let i$1=d.command("agents").description("SubscriberBot AI agents & their automation policies");i$1.command("list").description("List AI agents").option("--kind <k>","Filter by agent kind").option("--owner <id>","Filter by owner ID").option("--status <s>","Filter by agent status").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(Z,{kind:t.kind?t.kind.toUpperCase():void 0,ownerId:t.owner,status:t.status?t.status.toUpperCase():void 0});i(t,e.subListAgents,{headers:["ID","Name","Kind","Status","Description"],rows:e.subListAgents.map(n=>[r(n.id,12),n.name,n.kind,n.status,r(n.description??"-",30)])});}catch(e){h(e);}}),i$1.command("get").description("Get an agent by id").argument("<id>","Agent ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(X,{id:t});if(!n.subAgent)throw new o(`Agent ${t} not found`);i(e,n.subAgent);}catch(n){h(n);}}),i$1.command("create").description("Create an AI agent").requiredOption("--name <name>","Agent name").option("--kind <k>","Agent kind","DISCOVERY").option("--status <s>","Agent status","SUGGEST_ONLY").option("--owner <id>","Owner ID").option("--description <s>","Description").option("--config <json>","Agent config JSON").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,kind:(t.kind??"DISCOVERY").toUpperCase(),status:(t.status??"SUGGEST_ONLY").toUpperCase()};t.owner&&(e.ownerId=t.owner),t.description&&(e.description=t.description),t.config&&(e.config=y("config",t.config));let n=await b$1(tt,{input:e});k$1(`Agent created: ${n.subCreateAgent.name}`),i(t,n.subCreateAgent);}catch(e){h(e);}}),i$1.command("set-status").description("Change an agent's operating posture").argument("<id>","Agent ID").requiredOption("--status <s>","DISABLED|SUGGEST_ONLY|AUTONOMOUS").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(et,{id:t,status:e.status.toUpperCase()});k$1(`Agent status set to ${n.subSetAgentStatus.status}`),i(e,n.subSetAgentStatus);}catch(n){h(n);}}),i$1.command("list-policies").description("List policies (optionally filtered by agent)").option("--agent <id>","Filter by agent ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(nt,{agentId:t.agent});i(t,e.subListPolicies,{headers:["ID","Name","Action","Enabled","Triggers"],rows:e.subListPolicies.map(n=>[r(n.id,12),n.name,n.action,n.isEnabled?"yes":"no",String(n.triggerCount??0)])});}catch(e){h(e);}}),i$1.command("create-policy").description("Create an automation policy for an agent").requiredOption("--agent <id>","Agent ID").requiredOption("--name <name>","Policy name").option("--action <a>","Policy action","ALERT").option("--description <s>","Description").option("--condition <json>","Condition JSON").option("--no-enabled","Create disabled").option("-f, --format <format>","Output format").action(async t=>{try{let e={agentId:t.agent,name:t.name,action:(t.action??"ALERT").toUpperCase(),isEnabled:t.enabled!==!1};t.description&&(e.description=t.description),t.condition&&(e.condition=y("condition",t.condition));let n=await b$1(it,{input:e});k$1(`Policy created: ${n.subCreatePolicy.name}`),i(t,n.subCreatePolicy);}catch(e){h(e);}});}function yt(d){let i$1=d.command("workflows").description("SubscriberBot automation workflows");i$1.command("list").description("List workflows").option("--status <s>","Filter by workflow status").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(rt,{status:t.status?t.status.toUpperCase():void 0});i(t,e.subListWorkflows,{headers:["ID","Name","Trigger","Status","Runs"],rows:e.subListWorkflows.map(n=>[r(n.id,12),n.name,n.triggerEvent,n.status,String(n.runCount??0)])});}catch(e){h(e);}}),i$1.command("create").description("Create a workflow").requiredOption("--name <name>","Workflow name").requiredOption("--trigger-event <e>","Trigger event").option("--description <s>","Description").option("--steps <json>","Steps JSON").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,triggerEvent:t.triggerEvent};t.description&&(e.description=t.description),t.steps&&(e.steps=y("steps",t.steps));let n=await b$1(st,{input:e});k$1(`Workflow created: ${n.subCreateWorkflow.name}`),i(t,n.subCreateWorkflow);}catch(e){h(e);}}),i$1.command("activate").description("Activate a workflow").argument("<id>","Workflow ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(ot,{id:t});k$1(`Workflow activated: ${n.subActivateWorkflow.name}`),i(e,n.subActivateWorkflow);}catch(n){h(n);}});}function ht(d$1){d$1.command("health").description("SubscriberBot service health check (public)").option("-f, --format <format>","Output format").action(async i$1=>{try{let t=await d(at);k$1(t.subHealth),i(i$1,{health:t.subHealth});}catch(t){h(t);}});}var At={id:"subscriberbot",version:"1.0.0",displayName:"SubscriberBot",dependsOn:["auth","workspaces"],register(d,i){a(i);let t=d.command("subscriberbot").description("SubscriberBot universal subscription & relationship management");dt(t),ut(t),pt(t),ct(t),mt(t),lt(t),gt(t),ft(t),bt(t),It(t),yt(t),ht(t);}},we=At;export{we as default};
|
|
349
|
+
`;function y(u,i){try{return JSON.parse(i)}catch{throw new o(`--${u} must be valid JSON`)}}function p(u){let i=Number.parseInt(u,10);if(Number.isNaN(i))throw new o(`Expected an integer but got "${u}"`);return i}function b(u){let i=Number.parseFloat(u);if(Number.isNaN(i))throw new o(`Expected a number but got "${u}"`);return i}function I(u){return u.split(",").map(i=>i.trim()).filter(i=>i.length>0)}function ut(u){let i$1=u.command("providers").description("SubscriberBot provider registry (vendors / publishers / services)");i$1.command("list").description("List / search providers in the registry").option("--category <c>","Filter by provider category").option("--status <s>","Filter by provider status").option("--search <q>","Free-text search").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(R,{category:t.category?t.category.toUpperCase():void 0,status:t.status?t.status.toUpperCase():void 0,search:t.search,pagination:{limit:t.limit,offset:t.offset}});i(t,e.subListProviders.items,{headers:["ID","Name","Category","Status","Region","Churn"],rows:e.subListProviders.items.map(n=>[r(n.id,12),n.name,n.category,n.status,n.region??"-",n.churnRiskScore!=null?String(n.churnRiskScore):"-"])});}catch(e){h(e);}}),i$1.command("get").description("Get a provider by id").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(C,{id:t});if(!n.subProvider)throw new o(`Provider ${t} not found`);i(e,n.subProvider);}catch(n){h(n);}}),i$1.command("create").description("Create a provider").requiredOption("--name <name>","Provider name").option("--category <c>","Provider category","OTHER").option("--status <s>","Provider status","UNVERIFIED").option("--slug <slug>","URL slug").option("--description <s>","Description").option("--industry <s>","Industry").option("--language <s>","Language").option("--region <s>","Region").option("--website-url <url>","Website URL").option("--logo-file-id <id>","Logo file ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,category:(t.category??"OTHER").toUpperCase(),status:(t.status??"UNVERIFIED").toUpperCase()};t.slug&&(e.slug=t.slug),t.description&&(e.description=t.description),t.industry&&(e.industry=t.industry),t.language&&(e.language=t.language),t.region&&(e.region=t.region),t.websiteUrl&&(e.websiteUrl=t.websiteUrl),t.logoFileId&&(e.logoFileId=t.logoFileId),t.tags&&(e.tags=I(t.tags));let n=await b$1(S,{input:e});k$1(`Provider created: ${n.subCreateProvider.name}`),i(t,n.subCreateProvider);}catch(e){h(e);}}),i$1.command("update").description("Update a provider").argument("<id>","Provider ID").option("--name <name>","Provider name").option("--category <c>","Provider category").option("--status <s>","Provider status").option("--slug <slug>","URL slug").option("--description <s>","Description").option("--industry <s>","Industry").option("--language <s>","Language").option("--region <s>","Region").option("--website-url <url>","Website URL").option("--logo-file-id <id>","Logo file ID").option("--churn-risk-score <n>","Churn risk score",p).option("--vendor-health-score <n>","Vendor health score",p).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.category&&(n.category=e.category.toUpperCase()),e.status&&(n.status=e.status.toUpperCase()),e.slug&&(n.slug=e.slug),e.description!==void 0&&(n.description=e.description),e.industry&&(n.industry=e.industry),e.language&&(n.language=e.language),e.region&&(n.region=e.region),e.websiteUrl&&(n.websiteUrl=e.websiteUrl),e.logoFileId&&(n.logoFileId=e.logoFileId),e.churnRiskScore!==void 0&&(n.churnRiskScore=e.churnRiskScore),e.vendorHealthScore!==void 0&&(n.vendorHealthScore=e.vendorHealthScore),e.tags&&(n.tags=I(e.tags)),!Object.keys(n).length)throw new o("No updates specified");let h=await b$1(v,{id:t,input:n});k$1("Provider updated"),i(e,h.subUpdateProvider);}catch(n){h(n);}}),i$1.command("archive").description("Archive (soft-delete) a provider").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(E,{id:t});k$1(`Provider ${t} archived`),i(e,{archived:n.subArchiveProvider});}catch(n){h(n);}});}function dt(u){let i$1=u.command("plans").description("SubscriberBot provider plans");i$1.command("list").description("List plans (optionally filtered by provider)").option("--provider <id>","Filter by provider ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(k,{providerId:t.provider});i(t,e.subListPlans.items,{headers:["ID","Name","Amount","Currency","Interval","Active"],rows:e.subListPlans.items.map(n=>[r(n.id,12),n.name,String(n.amount),n.currency,n.interval,n.isActive?"yes":"no"])});}catch(e){h(e);}}),i$1.command("create").description("Create a plan for a provider").requiredOption("--provider <id>","Provider ID").requiredOption("--name <name>","Plan name").option("--amount <n>","Amount",b).option("--currency <c>","Currency code").option("--interval <i>","Billing interval","MONTHLY").option("--description <s>","Description").option("--features <csv>","Comma-separated feature list").option("-f, --format <format>","Output format").action(async t=>{try{let e={providerId:t.provider,name:t.name,interval:(t.interval??"MONTHLY").toUpperCase()};t.amount!==void 0&&(e.amount=t.amount),t.currency&&(e.currency=t.currency),t.description&&(e.description=t.description),t.features&&(e.features=I(t.features));let n=await b$1(O,{input:e});k$1(`Plan created: ${n.subCreatePlan.name}`),i(t,n.subCreatePlan);}catch(e){h(e);}});}function pt(u){let i$1=u.command("relationships").description("SubscriberBot subscriptions, memberships & recurring relationships");i$1.command("list").description("List relationships").option("--kind <k>","Filter by relationship kind").option("--owner <id>","Filter by owner ID").option("--provider <id>","Filter by provider ID").option("--status <s>","Filter by relationship status").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(T,{kind:t.kind?t.kind.toUpperCase():void 0,ownerId:t.owner,providerId:t.provider,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});i(t,e.subListRelationships.items,{headers:["ID","Label","Kind","Status","Amount","Renews"],rows:e.subListRelationships.items.map(n=>[r(n.id,12),n.label,n.kind,n.status,`${n.amount} ${n.currency}`,q$1(n.renewsAt)])});}catch(e){h(e);}}),i$1.command("get").description("Get a relationship by id").argument("<id>","Relationship ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(L,{id:t});if(!n.subRelationship)throw new o(`Relationship ${t} not found`);i(e,n.subRelationship);}catch(n){h(n);}}),i$1.command("create").description("Create a relationship (subscription / membership / \u2026)").requiredOption("--label <label>","Human-readable label").option("--kind <k>","Relationship kind","SUBSCRIPTION").option("--status <s>","Relationship status","ACTIVE").option("--owner <id>","Owner ID").option("--provider <id>","Provider ID").option("--plan <id>","Plan ID").option("--amount <n>","Amount",b).option("--currency <c>","Currency code").option("--interval <i>","Billing interval","MONTHLY").option("--discovery-source <s>","Discovery source","MANUAL").option("--no-auto-renew","Disable auto-renew").option("--notes <s>","Notes").option("--tags <csv>","Comma-separated tags").option("--started-at <iso>","Started at (ISO date)").option("--renews-at <iso>","Renews at (ISO date)").option("--trial-ends-at <iso>","Trial end (ISO date)").option("-f, --format <format>","Output format").action(async t=>{try{let e={label:t.label,kind:(t.kind??"SUBSCRIPTION").toUpperCase(),status:(t.status??"ACTIVE").toUpperCase(),interval:(t.interval??"MONTHLY").toUpperCase(),discoverySource:(t.discoverySource??"MANUAL").toUpperCase(),autoRenew:t.autoRenew!==!1};t.owner&&(e.ownerId=t.owner),t.provider&&(e.providerId=t.provider),t.plan&&(e.planId=t.plan),t.amount!==void 0&&(e.amount=t.amount),t.currency&&(e.currency=t.currency),t.notes&&(e.notes=t.notes),t.tags&&(e.tags=I(t.tags)),t.startedAt&&(e.startedAt=t.startedAt),t.renewsAt&&(e.renewsAt=t.renewsAt),t.trialEndsAt&&(e.trialEndsAt=t.trialEndsAt);let n=await b$1(P,{input:e});k$1(`Relationship created: ${n.subCreateRelationship.label}`),i(t,n.subCreateRelationship);}catch(e){h(e);}}),i$1.command("update").description("Update a relationship").argument("<id>","Relationship ID").option("--label <label>","Label").option("--kind <k>","Relationship kind").option("--provider <id>","Provider ID").option("--plan <id>","Plan ID").option("--amount <n>","Amount",b).option("--currency <c>","Currency code").option("--interval <i>","Billing interval").option("--auto-renew <bool>","true|false",t=>t==="true").option("--health-score <n>","Health score",p).option("--notes <s>","Notes").option("--tags <csv>","Comma-separated tags").option("--started-at <iso>","Started at (ISO date)").option("--renews-at <iso>","Renews at (ISO date)").option("--trial-ends-at <iso>","Trial end (ISO date)").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.label&&(n.label=e.label),e.kind&&(n.kind=e.kind.toUpperCase()),e.provider&&(n.providerId=e.provider),e.plan&&(n.planId=e.plan),e.amount!==void 0&&(n.amount=e.amount),e.currency&&(n.currency=e.currency),e.interval&&(n.interval=e.interval.toUpperCase()),e.autoRenew!==void 0&&(n.autoRenew=e.autoRenew),e.healthScore!==void 0&&(n.healthScore=e.healthScore),e.notes!==void 0&&(n.notes=e.notes),e.tags&&(n.tags=I(e.tags)),e.startedAt&&(n.startedAt=e.startedAt),e.renewsAt&&(n.renewsAt=e.renewsAt),e.trialEndsAt&&(n.trialEndsAt=e.trialEndsAt),!Object.keys(n).length)throw new o("No updates specified");let h=await b$1(D,{id:t,input:n});k$1("Relationship updated"),i(e,h.subUpdateRelationship);}catch(n){h(n);}}),i$1.command("cancel").description("Cancel a relationship").argument("<id>","Relationship ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1($,{id:t});k$1(`Relationship cancelled: ${n.subCancelRelationship.label}`),i(e,n.subCancelRelationship);}catch(n){h(n);}}),i$1.command("transition").description("Advance a relationship through its lifecycle").argument("<id>","Relationship ID").requiredOption("--status <s>","ACTIVE|TRIAL|PAST_DUE|PAUSED|CANCELLED|EXPIRED|LAPSED").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(x,{id:t,status:e.status.toUpperCase()});k$1(`Relationship status set to ${n.subTransitionRelationship.status}`),i(e,n.subTransitionRelationship);}catch(n){h(n);}}),i$1.command("renewals").description("List renewal events").option("--relationship <id>","Filter by relationship ID").option("--upcoming-only","Only upcoming events").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(N,{relationshipId:t.relationship,upcomingOnly:t.upcomingOnly?!0:void 0});i(t,e.subListRenewalEvents.items,{headers:["ID","Relationship","Type","Amount","Occurs","Notified"],rows:e.subListRenewalEvents.items.map(n=>[r(n.id,12),r(n.relationshipId,12),n.eventType,n.amount!=null?`${n.amount} ${n.currency??""}`.trim():"-",q$1(n.occursAt),n.notified?"yes":"no"])});}catch(e){h(e);}});}function ct(u){let i$1=u.command("assets").description("SubscriberBot relationship assets (contracts, licenses, credentials, \u2026)");i$1.command("list").description("List assets for a relationship").requiredOption("--relationship <id>","Relationship ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(M,{relationshipId:t.relationship});i(t,e.subListAssets.items,{headers:["ID","Name","Type","Secret","Expires"],rows:e.subListAssets.items.map(n=>[r(n.id,12),n.name,n.type,n.secretRef?"yes":"no",q$1(n.expiresAt)])});}catch(e){h(e);}}),i$1.command("create").description("Create an asset on a relationship").requiredOption("--relationship <id>","Relationship ID").requiredOption("--name <name>","Asset name").option("--type <t>","Asset type","RECEIPT").option("--file-id <id>","Referenced file ID (blob lives in wspace-files-svc)").option("--secret-ref <ref>","Secret reference").option("--expires-at <iso>","Expiry (ISO date)").option("-f, --format <format>","Output format").action(async t=>{try{let e={relationshipId:t.relationship,name:t.name,type:(t.type??"RECEIPT").toUpperCase()};t.fileId&&(e.fileId=t.fileId),t.secretRef&&(e.secretRef=t.secretRef),t.expiresAt&&(e.expiresAt=t.expiresAt);let n=await b$1(_,{input:e});k$1(`Asset created: ${n.subCreateAsset.name}`),i(t,n.subCreateAsset);}catch(e){h(e);}});}function mt(u){let i$1=u.command("entitlements").description("SubscriberBot relationship entitlements (seats, quotas, features, \u2026)");i$1.command("list").description("List entitlements for a relationship").requiredOption("--relationship <id>","Relationship ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(U,{relationshipId:t.relationship});i(t,e.subListEntitlements.items,{headers:["ID","Name","Type","Used","Quota","Active"],rows:e.subListEntitlements.items.map(n=>[r(n.id,12),n.name,n.type,String(n.used),n.quota!=null?String(n.quota):"-",n.isActive?"yes":"no"])});}catch(e){h(e);}}),i$1.command("create").description("Create an entitlement on a relationship").requiredOption("--relationship <id>","Relationship ID").requiredOption("--name <name>","Entitlement name").option("--type <t>","Entitlement type","FEATURE_ACCESS").option("--description <s>","Description").option("--quota <n>","Quota",p).option("--unit <u>","Quota unit").option("-f, --format <format>","Output format").action(async t=>{try{let e={relationshipId:t.relationship,name:t.name,type:(t.type??"FEATURE_ACCESS").toUpperCase()};t.description&&(e.description=t.description),t.quota!==void 0&&(e.quota=t.quota),t.unit&&(e.unit=t.unit);let n=await b$1(q,{input:e});k$1(`Entitlement created: ${n.subCreateEntitlement.name}`),i(t,n.subCreateEntitlement);}catch(e){h(e);}});}function lt(u){let i$1=u.command("invoices").description("SubscriberBot invoices");i$1.command("list").description("List invoices").option("--relationship <id>","Filter by relationship ID").option("--status <s>","Filter by invoice status").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(W,{relationshipId:t.relationship,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});i(t,e.subListInvoices.items,{headers:["ID","Number","Status","Total","Currency","Due"],rows:e.subListInvoices.items.map(n=>[r(n.id,12),n.number??"-",n.status,String(n.total),n.currency,q$1(n.dueDate)])});}catch(e){h(e);}}),i$1.command("create").description("Create an invoice on a relationship").requiredOption("--relationship <id>","Relationship ID").option("--number <n>","Invoice number").option("--status <s>","Invoice status","ISSUED").option("--currency <c>","Currency code").option("--subtotal <n>","Subtotal",b).option("--tax-amount <n>","Tax amount",b).option("--total <n>","Total",b).option("--line-items <json>","Line items JSON").option("--issue-date <iso>","Issue date (ISO date)").option("--due-date <iso>","Due date (ISO date)").option("--payment-instrument <id>","Payment instrument ID").option("--file-id <id>","Referenced file ID (invoice PDF in wspace-files-svc)").option("-f, --format <format>","Output format").action(async t=>{try{let e={relationshipId:t.relationship,status:(t.status??"ISSUED").toUpperCase()};t.number&&(e.number=t.number),t.currency&&(e.currency=t.currency),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.issueDate&&(e.issueDate=t.issueDate),t.dueDate&&(e.dueDate=t.dueDate),t.paymentInstrument&&(e.paymentInstrumentId=t.paymentInstrument),t.fileId&&(e.fileId=t.fileId);let n=await b$1(H,{input:e});k$1(`Invoice created: ${n.subCreateInvoice.number??n.subCreateInvoice.id}`),i(t,n.subCreateInvoice);}catch(e){h(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(F,{id:t});k$1(`Invoice marked paid: ${n.subMarkInvoicePaid.number??n.subMarkInvoicePaid.id}`),i(e,n.subMarkInvoicePaid);}catch(n){h(n);}});}function gt(u){let i$1=u.command("payment-instruments").description("SubscriberBot payment instruments (cards, wallets, bank accounts, \u2026)");i$1.command("list").description("List payment instruments").option("--owner <id>","Filter by owner ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(V,{ownerId:t.owner});i(t,e.subListPaymentInstruments.items,{headers:["ID","Label","Type","Status","Brand","Last4","Default"],rows:e.subListPaymentInstruments.items.map(n=>[r(n.id,12),n.label,n.type,n.status,n.brand??"-",n.last4??"-",n.isDefault?"yes":"no"])});}catch(e){h(e);}}),i$1.command("create").description("Add a payment instrument").requiredOption("--label <label>","Label").option("--type <t>","Payment instrument type","CARD").option("--owner <id>","Owner ID").option("--brand <b>","Card/instrument brand").option("--last4 <n>","Last 4 digits").option("--expiry-month <n>","Expiry month",p).option("--expiry-year <n>","Expiry year",p).option("--processor-token <t>","Processor token").option("--default","Mark as default").option("-f, --format <format>","Output format").action(async t=>{try{let e={label:t.label,type:(t.type??"CARD").toUpperCase(),isDefault:t.default===!0};t.owner&&(e.ownerId=t.owner),t.brand&&(e.brand=t.brand),t.last4&&(e.last4=t.last4),t.expiryMonth!==void 0&&(e.expiryMonth=t.expiryMonth),t.expiryYear!==void 0&&(e.expiryYear=t.expiryYear),t.processorToken&&(e.processorToken=t.processorToken);let n=await b$1(G,{input:e});k$1(`Payment instrument added: ${n.subCreatePaymentInstrument.label}`),i(t,n.subCreatePaymentInstrument);}catch(e){h(e);}}),i$1.command("remove").description("Remove a payment instrument").argument("<id>","Payment instrument ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(B,{id:t});k$1(`Payment instrument ${t} removed`),i(e,{removed:n.subRemovePaymentInstrument});}catch(n){h(n);}});}function ft(u){let i$1=u.command("channels").description("SubscriberBot communication channels (email, sms, slack, webhook, \u2026)");i$1.command("list").description("List communication channels").option("--owner <id>","Filter by owner ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(Y,{ownerId:t.owner});i(t,e.subListChannels.items,{headers:["ID","Type","Address","Label","Status","Ingest"],rows:e.subListChannels.items.map(n=>[r(n.id,12),n.type,n.address,n.label??"-",n.status,n.ingestEnabled?"yes":"no"])});}catch(e){h(e);}}),i$1.command("create").description("Create a communication channel").requiredOption("--address <addr>","Channel address (email, phone, webhook URL, \u2026)").option("--type <t>","Channel type","EMAIL").option("--owner <id>","Owner ID").option("--label <label>","Label").option("--no-ingest","Disable message ingestion").option("-f, --format <format>","Output format").action(async t=>{try{let e={address:t.address,type:(t.type??"EMAIL").toUpperCase(),ingestEnabled:t.ingest!==!1};t.owner&&(e.ownerId=t.owner),t.label&&(e.label=t.label);let n=await b$1(j,{input:e});k$1(`Channel created: ${n.subCreateChannel.address}`),i(t,n.subCreateChannel);}catch(e){h(e);}}),i$1.command("verify").description("Mark a channel as verified").argument("<id>","Channel ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(K,{id:t});k$1(`Channel verified: ${n.subVerifyChannel.address}`),i(e,n.subVerifyChannel);}catch(n){h(n);}});}function bt(u){let i$1=u.command("inbox").description("SubscriberBot universal inbox (merged subscription communications)");i$1.command("list").description("List inbox messages").option("--category <c>","Filter by message category").option("--channel <id>","Filter by channel ID").option("--relationship <id>","Filter by relationship ID").option("--unread-only","Only unread messages").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(J,{category:t.category?t.category.toUpperCase():void 0,channelId:t.channel,relationshipId:t.relationship,unreadOnly:t.unreadOnly?!0:void 0,pagination:{limit:t.limit,offset:t.offset}});i(t,e.subListInboxMessages.items,{headers:["ID","Subject","Category","Read","Action","Received"],rows:e.subListInboxMessages.items.map(n=>[r(n.id,12),r(n.subject??"-",30),n.category,n.isRead?"yes":"no",n.actionRequired?"yes":"no",q$1(n.receivedAt)])});}catch(e){h(e);}}),i$1.command("ingest").description("Ingest a message into the universal inbox").requiredOption("--channel <id>","Channel ID").requiredOption("--received-at <iso>","Received at (ISO date)").option("--category <c>","Message category","OTHER").option("--relationship <id>","Relationship ID").option("--subject <s>","Subject").option("--preview <s>","Preview text").option("--external-id <id>","External message ID").option("--category-confidence <n>","Category confidence (0-100)",p).option("--action-required","Flag as action required").option("-f, --format <format>","Output format").action(async t=>{try{let e={channelId:t.channel,receivedAt:t.receivedAt,category:(t.category??"OTHER").toUpperCase(),actionRequired:t.actionRequired===!0};t.relationship&&(e.relationshipId=t.relationship),t.subject&&(e.subject=t.subject),t.preview&&(e.preview=t.preview),t.externalId&&(e.externalId=t.externalId),t.categoryConfidence!==void 0&&(e.categoryConfidence=t.categoryConfidence);let n=await b$1(z,{input:e});k$1(`Message ingested: ${n.subIngestMessage.id}`),i(t,n.subIngestMessage);}catch(e){h(e);}}),i$1.command("mark-read").description("Mark a message as read").argument("<id>","Message ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(Q,{id:t});k$1(`Message ${t} marked read`),i(e,n.subMarkMessageRead);}catch(n){h(n);}});}function It(u){let i$1=u.command("agents").description("SubscriberBot AI agents & their automation policies");i$1.command("list").description("List AI agents").option("--kind <k>","Filter by agent kind").option("--owner <id>","Filter by owner ID").option("--status <s>","Filter by agent status").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(Z,{kind:t.kind?t.kind.toUpperCase():void 0,ownerId:t.owner,status:t.status?t.status.toUpperCase():void 0});i(t,e.subListAgents.items,{headers:["ID","Name","Kind","Status","Description"],rows:e.subListAgents.items.map(n=>[r(n.id,12),n.name,n.kind,n.status,r(n.description??"-",30)])});}catch(e){h(e);}}),i$1.command("get").description("Get an agent by id").argument("<id>","Agent ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(X,{id:t});if(!n.subAgent)throw new o(`Agent ${t} not found`);i(e,n.subAgent);}catch(n){h(n);}}),i$1.command("create").description("Create an AI agent").requiredOption("--name <name>","Agent name").option("--kind <k>","Agent kind","DISCOVERY").option("--status <s>","Agent status","SUGGEST_ONLY").option("--owner <id>","Owner ID").option("--description <s>","Description").option("--config <json>","Agent config JSON").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,kind:(t.kind??"DISCOVERY").toUpperCase(),status:(t.status??"SUGGEST_ONLY").toUpperCase()};t.owner&&(e.ownerId=t.owner),t.description&&(e.description=t.description),t.config&&(e.config=y("config",t.config));let n=await b$1(tt,{input:e});k$1(`Agent created: ${n.subCreateAgent.name}`),i(t,n.subCreateAgent);}catch(e){h(e);}}),i$1.command("set-status").description("Change an agent's operating posture").argument("<id>","Agent ID").requiredOption("--status <s>","DISABLED|SUGGEST_ONLY|AUTONOMOUS").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(et,{id:t,status:e.status.toUpperCase()});k$1(`Agent status set to ${n.subSetAgentStatus.status}`),i(e,n.subSetAgentStatus);}catch(n){h(n);}}),i$1.command("list-policies").description("List policies (optionally filtered by agent)").option("--agent <id>","Filter by agent ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(nt,{agentId:t.agent});i(t,e.subListPolicies.items,{headers:["ID","Name","Action","Enabled","Triggers"],rows:e.subListPolicies.items.map(n=>[r(n.id,12),n.name,n.action,n.isEnabled?"yes":"no",String(n.triggerCount??0)])});}catch(e){h(e);}}),i$1.command("create-policy").description("Create an automation policy for an agent").requiredOption("--agent <id>","Agent ID").requiredOption("--name <name>","Policy name").option("--action <a>","Policy action","ALERT").option("--description <s>","Description").option("--condition <json>","Condition JSON").option("--no-enabled","Create disabled").option("-f, --format <format>","Output format").action(async t=>{try{let e={agentId:t.agent,name:t.name,action:(t.action??"ALERT").toUpperCase(),isEnabled:t.enabled!==!1};t.description&&(e.description=t.description),t.condition&&(e.condition=y("condition",t.condition));let n=await b$1(it,{input:e});k$1(`Policy created: ${n.subCreatePolicy.name}`),i(t,n.subCreatePolicy);}catch(e){h(e);}});}function yt(u){let i$1=u.command("workflows").description("SubscriberBot automation workflows");i$1.command("list").description("List workflows").option("--status <s>","Filter by workflow status").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(rt,{status:t.status?t.status.toUpperCase():void 0});i(t,e.subListWorkflows.items,{headers:["ID","Name","Trigger","Status","Runs"],rows:e.subListWorkflows.items.map(n=>[r(n.id,12),n.name,n.triggerEvent,n.status,String(n.runCount??0)])});}catch(e){h(e);}}),i$1.command("create").description("Create a workflow").requiredOption("--name <name>","Workflow name").requiredOption("--trigger-event <e>","Trigger event").option("--description <s>","Description").option("--steps <json>","Steps JSON").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,triggerEvent:t.triggerEvent};t.description&&(e.description=t.description),t.steps&&(e.steps=y("steps",t.steps));let n=await b$1(st,{input:e});k$1(`Workflow created: ${n.subCreateWorkflow.name}`),i(t,n.subCreateWorkflow);}catch(e){h(e);}}),i$1.command("activate").description("Activate a workflow").argument("<id>","Workflow ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(ot,{id:t});k$1(`Workflow activated: ${n.subActivateWorkflow.name}`),i(e,n.subActivateWorkflow);}catch(n){h(n);}});}function ht(u){u.command("health").description("SubscriberBot service health check (public)").option("-f, --format <format>","Output format").action(async i$1=>{try{let t=await d(at);k$1(t.subHealth),i(i$1,{health:t.subHealth});}catch(t){h(t);}});}var At={id:"subscriberbot",version:"1.0.0",displayName:"SubscriberBot",dependsOn:["auth","workspaces"],register(u,i){a(i);let t=u.command("subscriberbot").description("SubscriberBot universal subscription & relationship management");ut(t),dt(t),pt(t),ct(t),mt(t),lt(t),gt(t),ft(t),bt(t),It(t),yt(t),ht(t);}},we=At;export{we as default};
|
|
@@ -48,9 +48,12 @@
|
|
|
48
48
|
`,P=`
|
|
49
49
|
query TecListLessons($courseId: ID!) {
|
|
50
50
|
tecListLessons(courseId: $courseId) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
items {
|
|
52
|
+
id courseId title kind position estimatedMinutes isPreview content
|
|
53
|
+
file { id }
|
|
54
|
+
createdAt updatedAt workspaceId
|
|
55
|
+
}
|
|
56
|
+
pageInfo { cursor hasMore }
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
59
|
`,L=`
|
|
@@ -134,8 +137,11 @@
|
|
|
134
137
|
`,G=`
|
|
135
138
|
query TecListSessions($mentorId: ID, $menteeId: ID, $status: TecSessionStatus) {
|
|
136
139
|
tecListSessions(mentorId: $mentorId, menteeId: $menteeId, status: $status) {
|
|
137
|
-
|
|
138
|
-
|
|
140
|
+
items {
|
|
141
|
+
id mentorId menteeId topic agenda status scheduledAt durationMinutes meetingUrl rating
|
|
142
|
+
feedback completedAt cancelledAt createdAt workspaceId
|
|
143
|
+
}
|
|
144
|
+
pageInfo { cursor hasMore }
|
|
139
145
|
}
|
|
140
146
|
}
|
|
141
147
|
`,j=`
|
|
@@ -202,8 +208,11 @@
|
|
|
202
208
|
`,X=`
|
|
203
209
|
query TecListTeams($hackathonId: ID!) {
|
|
204
210
|
tecListTeams(hackathonId: $hackathonId) {
|
|
205
|
-
|
|
206
|
-
|
|
211
|
+
items {
|
|
212
|
+
id hackathonId name captainId memberIds status score projectName projectUrl repoUrl
|
|
213
|
+
pitch submittedAt createdAt updatedAt workspaceId
|
|
214
|
+
}
|
|
215
|
+
pageInfo { cursor hasMore }
|
|
207
216
|
}
|
|
208
217
|
}
|
|
209
218
|
`,Z=`
|
|
@@ -322,4 +331,4 @@
|
|
|
322
331
|
query TecHealth {
|
|
323
332
|
tecHealth
|
|
324
333
|
}
|
|
325
|
-
`;function c(a){let r=Number.parseInt(a,10);if(Number.isNaN(r))throw new m(`Expected an integer but got "${a}"`);return r}function l(a){return a.split(",").map(r=>r.trim()).filter(r=>r.length>0)}function ft(a){let r=a.command("courses").description("Technospam courses");r.command("list").description("List courses").option("--level <l>","BEGINNER|INTERMEDIATE|ADVANCED|EXPERT").option("--status <s>","DRAFT|PUBLISHED|ARCHIVED").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(A,{level:e.level?e.level.toUpperCase():void 0,status:e.status?e.status.toUpperCase():void 0,pagination:{limit:e.limit,offset:e.offset}});i(e,t.tecListCourses.items,{headers:["ID","Title","Level","Status","Minutes"],rows:t.tecListCourses.items.map(n=>[d(n.id,12),n.title,n.level,n.status,String(n.estimatedMinutes??0)])});}catch(t){o(t);}}),r.command("get").description("Get a course by id").argument("<id>","Course ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(S,{id:e});if(!n.tecCourse)throw new m(`Course ${e} not found`);i(t,n.tecCourse);}catch(n){o(n);}}),r.command("create").description("Create a course").requiredOption("--title <t>","Course title").requiredOption("--slug <slug>","URL slug").option("--topic <t>","Topic").option("--summary <s>","Summary").option("--level <l>","BEGINNER|INTERMEDIATE|ADVANCED|EXPERT","BEGINNER").option("--estimated-minutes <n>","Estimated minutes",c).option("--instructor-id <id>","Instructor user ID").option("--cover-file-id <id>","Cover image File ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async e=>{try{let t={title:e.title,slug:e.slug,level:(e.level??"BEGINNER").toUpperCase()};e.topic&&(t.topic=e.topic),e.summary&&(t.summary=e.summary),e.estimatedMinutes!==void 0&&(t.estimatedMinutes=e.estimatedMinutes),e.instructorId&&(t.instructorId=e.instructorId),e.coverFileId&&(t.coverFileId=e.coverFileId),e.tags&&(t.tags=l(e.tags));let n=await s(x,{input:t});u(`Course created: ${n.tecCreateCourse.title}`),i(e,n.tecCreateCourse);}catch(t){o(t);}}),r.command("update").description("Update a course").argument("<id>","Course ID").option("--title <t>","Course title").option("--topic <t>","Topic").option("--summary <s>","Summary").option("--level <l>","BEGINNER|INTERMEDIATE|ADVANCED|EXPERT").option("--estimated-minutes <n>","Estimated minutes",c).option("--instructor-id <id>","Instructor user ID").option("--cover-file-id <id>","Cover image File ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.title&&(n.title=t.title),t.topic!==void 0&&(n.topic=t.topic),t.summary!==void 0&&(n.summary=t.summary),t.level&&(n.level=t.level.toUpperCase()),t.estimatedMinutes!==void 0&&(n.estimatedMinutes=t.estimatedMinutes),t.instructorId&&(n.instructorId=t.instructorId),t.coverFileId&&(n.coverFileId=t.coverFileId),t.tags&&(n.tags=l(t.tags)),!Object.keys(n).length)throw new m("No updates specified");let g=await s(O,{id:e,input:n});u("Course updated"),i(t,g.tecUpdateCourse);}catch(n){o(n);}}),r.command("publish").description("Publish a course (DRAFT -> PUBLISHED)").argument("<id>","Course ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(R,{id:e});u(`Course published: ${n.tecPublishCourse.title}`),i(t,n.tecPublishCourse);}catch(n){o(n);}}),r.command("archive").description("Archive a course").argument("<id>","Course ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(v,{id:e});u(n.tecArchiveCourse?"Course archived":"Course not archived"),i(t,{archived:n.tecArchiveCourse});}catch(n){o(n);}});}function gt(a){let r=a.command("lessons").description("Technospam course lessons");r.command("list").description("List lessons for a course").requiredOption("--course <id>","Course ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(P,{courseId:e.course});i(e,t.tecListLessons,{headers:["ID","Title","Kind","Position","Minutes","Preview"],rows:t.tecListLessons.map(n=>[d(n.id,12),n.title,n.kind,String(n.position),String(n.estimatedMinutes??0),n.isPreview?"yes":"no"])});}catch(t){o(t);}}),r.command("create").description("Create a lesson").requiredOption("--course <id>","Course ID").requiredOption("--title <t>","Lesson title").option("--kind <k>","ARTICLE|VIDEO|QUIZ|INTERACTIVE|PROJECT","ARTICLE").option("--content <s>","Lesson content").option("--position <n>","Order position",c).option("--estimated-minutes <n>","Estimated minutes",c).option("--file-id <id>","Attachment / video File ID").option("--preview","Mark as a free preview lesson").option("-f, --format <format>","Output format").action(async e=>{try{let t={courseId:e.course,title:e.title,kind:(e.kind??"ARTICLE").toUpperCase()};e.content&&(t.content=e.content),e.position!==void 0&&(t.position=e.position),e.estimatedMinutes!==void 0&&(t.estimatedMinutes=e.estimatedMinutes),e.fileId&&(t.fileId=e.fileId),e.preview&&(t.isPreview=!0);let n=await s(L,{input:t});u(`Lesson created: ${n.tecCreateLesson.title}`),i(e,n.tecCreateLesson);}catch(t){o(t);}}),r.command("update").description("Update a lesson").argument("<id>","Lesson ID").option("--title <t>","Lesson title").option("--kind <k>","ARTICLE|VIDEO|QUIZ|INTERACTIVE|PROJECT").option("--content <s>","Lesson content").option("--position <n>","Order position",c).option("--estimated-minutes <n>","Estimated minutes",c).option("--file-id <id>","Attachment / video File ID").option("--preview <bool>","true|false",e=>e==="true").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.title&&(n.title=t.title),t.kind&&(n.kind=t.kind.toUpperCase()),t.content!==void 0&&(n.content=t.content),t.position!==void 0&&(n.position=t.position),t.estimatedMinutes!==void 0&&(n.estimatedMinutes=t.estimatedMinutes),t.fileId&&(n.fileId=t.fileId),t.preview!==void 0&&(n.isPreview=t.preview),!Object.keys(n).length)throw new m("No updates specified");let g=await s($,{id:e,input:n});u("Lesson updated"),i(t,g.tecUpdateLesson);}catch(n){o(n);}});}function ht(a){let r=a.command("enrollments").description("Technospam course enrollments");r.command("list").description("List enrollments").option("--course <id>","Filter by course ID").option("--learner <id>","Filter by learner ID").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(D,{courseId:e.course,learnerId:e.learner,pagination:{limit:e.limit,offset:e.offset}});i(e,t.tecListEnrollments.items,{headers:["ID","Course","Learner","Status","Progress %","Lessons"],rows:t.tecListEnrollments.items.map(n=>[d(n.id,12),d(n.courseId,12),d(n.learnerId,12),n.status,String(n.progressPct),String(n.lessonsCompleted)])});}catch(t){o(t);}}),r.command("enroll").description("Enroll the calling user in a course").requiredOption("--course <id>","Course ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(M,{input:{courseId:e.course}});u(`Enrolled in course ${t.tecEnroll.courseId}`),i(e,t.tecEnroll);}catch(t){o(t);}}),r.command("update-progress").description("Update a learner's enrollment progress (auto-completes at 100%)").requiredOption("--enrollment <id>","Enrollment ID").requiredOption("--progress-pct <n>","Progress percent (0-100)",c).option("--lessons-completed <n>","Lessons completed count",c).option("-f, --format <format>","Output format").action(async e=>{try{let t={enrollmentId:e.enrollment,progressPct:e.progressPct};e.lessonsCompleted!==void 0&&(t.lessonsCompleted=e.lessonsCompleted);let n=await s(N,{input:t});u(`Progress updated to ${n.tecUpdateProgress.progressPct}%`),i(e,n.tecUpdateProgress);}catch(t){o(t);}});}function It(a){let r=a.command("mentors").description("Technospam mentors");r.command("list").description("List mentors").option("--status <s>","PENDING|ACTIVE|PAUSED|INACTIVE").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(_,{status:e.status?e.status.toUpperCase():void 0,pagination:{limit:e.limit,offset:e.offset}});i(e,t.tecListMentors.items,{headers:["ID","Headline","Status","Rate","Rating","Accepting"],rows:t.tecListMentors.items.map(n=>[d(n.id,12),d(n.headline,30),n.status,String(n.hourlyRate??0),String(n.ratingAvg??0),n.isAcceptingMentees?"yes":"no"])});}catch(t){o(t);}}),r.command("get").description("Get a mentor by id").argument("<id>","Mentor ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(U,{id:e});if(!n.tecMentor)throw new m(`Mentor ${e} not found`);i(t,n.tecMentor);}catch(n){o(n);}}),r.command("become").description("Create the calling user's mentor profile").requiredOption("--headline <h>","Mentor headline").option("--bio <s>","Bio").option("--expertise <csv>","Comma-separated areas of expertise").option("--hourly-rate <n>","Hourly rate",c).option("--currency <c>","Currency code").option("-f, --format <format>","Output format").action(async e=>{try{let t={headline:e.headline};e.bio&&(t.bio=e.bio),e.expertise&&(t.expertise=l(e.expertise)),e.hourlyRate!==void 0&&(t.hourlyRate=e.hourlyRate),e.currency&&(t.currency=e.currency);let n=await s(q,{input:t});u(`Mentor profile created: ${n.tecBecomeMentor.headline}`),i(e,n.tecBecomeMentor);}catch(t){o(t);}}),r.command("update").description("Update a mentor profile").argument("<id>","Mentor ID").option("--headline <h>","Mentor headline").option("--bio <s>","Bio").option("--expertise <csv>","Comma-separated areas of expertise").option("--hourly-rate <n>","Hourly rate",c).option("--currency <c>","Currency code").option("--accepting <bool>","true|false (accepting mentees)",e=>e==="true").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.headline&&(n.headline=t.headline),t.bio!==void 0&&(n.bio=t.bio),t.expertise&&(n.expertise=l(t.expertise)),t.hourlyRate!==void 0&&(n.hourlyRate=t.hourlyRate),t.currency&&(n.currency=t.currency),t.accepting!==void 0&&(n.isAcceptingMentees=t.accepting),!Object.keys(n).length)throw new m("No updates specified");let g=await s(H,{id:e,input:n});u("Mentor updated"),i(t,g.tecUpdateMentor);}catch(n){o(n);}}),r.command("approve").description("Approve a pending mentor profile (PENDING -> ACTIVE)").argument("<id>","Mentor ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(F,{id:e});u(`Mentor approved: ${n.tecApproveMentor.status}`),i(t,n.tecApproveMentor);}catch(n){o(n);}});}function Ct(a){let r=a.command("sessions").description("Technospam mentorship sessions");r.command("list").description("List mentorship sessions").option("--mentor <id>","Filter by mentor ID").option("--mentee <id>","Filter by mentee ID").option("--status <s>","REQUESTED|CONFIRMED|COMPLETED|CANCELLED|NO_SHOW").option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(G,{mentorId:e.mentor,menteeId:e.mentee,status:e.status?e.status.toUpperCase():void 0});i(e,t.tecListSessions,{headers:["ID","Mentor","Mentee","Topic","Status","Scheduled"],rows:t.tecListSessions.map(n=>[d(n.id,12),d(n.mentorId,12),d(n.menteeId,12),d(n.topic,24),n.status,b(n.scheduledAt)])});}catch(t){o(t);}}),r.command("book").description("Book a 1:1 session with a mentor as the calling mentee").requiredOption("--mentor <id>","Mentor ID").requiredOption("--topic <t>","Session topic").requiredOption("--scheduled-at <iso>","Scheduled time (ISO date)").option("--agenda <s>","Agenda").option("--duration-minutes <n>","Duration (minutes)",c).option("-f, --format <format>","Output format").action(async e=>{try{let t={mentorId:e.mentor,topic:e.topic,scheduledAt:e.scheduledAt};e.agenda&&(t.agenda=e.agenda),e.durationMinutes!==void 0&&(t.durationMinutes=e.durationMinutes);let n=await s(j,{input:t});u(`Session booked: ${n.tecBookSession.topic}`),i(e,n.tecBookSession);}catch(t){o(t);}}),r.command("confirm").description("Confirm a requested session").argument("<id>","Session ID").option("--meeting-url <url>","Meeting URL").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(B,{id:e,meetingUrl:t.meetingUrl});u("Session confirmed"),i(t,n.tecConfirmSession);}catch(n){o(n);}}),r.command("cancel").description("Cancel a session").argument("<id>","Session ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(z,{id:e});u("Session cancelled"),i(t,n.tecCancelSession);}catch(n){o(n);}}),r.command("complete").description("Complete a session with optional rating and feedback").argument("<id>","Session ID").option("--rating <n>","Rating (1-5)",c).option("--feedback <s>","Feedback").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(W,{id:e,rating:t.rating,feedback:t.feedback});u("Session completed"),i(t,n.tecCompleteSession);}catch(n){o(n);}});}function bt(a){let r=a.command("hackathons").description("Technospam hackathons");r.command("list").description("List hackathons").option("--status <s>","DRAFT|REGISTRATION_OPEN|IN_PROGRESS|JUDGING|COMPLETED|CANCELLED").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(K,{status:e.status?e.status.toUpperCase():void 0,pagination:{limit:e.limit,offset:e.offset}});i(e,t.tecListHackathons.items,{headers:["ID","Title","Status","Start","Prize"],rows:t.tecListHackathons.items.map(n=>[d(n.id,12),n.title,n.status,b(n.startAt),String(n.prizePool??0)])});}catch(t){o(t);}}),r.command("get").description("Get a hackathon by id").argument("<id>","Hackathon ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(V,{id:e});if(!n.tecHackathon)throw new m(`Hackathon ${e} not found`);i(t,n.tecHackathon);}catch(n){o(n);}}),r.command("create").description("Create a hackathon").requiredOption("--title <t>","Hackathon title").requiredOption("--slug <slug>","URL slug").requiredOption("--start-at <iso>","Start time (ISO date)").requiredOption("--end-at <iso>","End time (ISO date)").option("--theme <t>","Theme").option("--description <s>","Description").option("--submission-deadline <iso>","Submission deadline (ISO date)").option("--max-team-size <n>","Max team size",c).option("--prize-pool <n>","Prize pool",c).option("--currency <c>","Currency code").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async e=>{try{let t={title:e.title,slug:e.slug,startAt:e.startAt,endAt:e.endAt};e.theme&&(t.theme=e.theme),e.description&&(t.description=e.description),e.submissionDeadline&&(t.submissionDeadline=e.submissionDeadline),e.maxTeamSize!==void 0&&(t.maxTeamSize=e.maxTeamSize),e.prizePool!==void 0&&(t.prizePool=e.prizePool),e.currency&&(t.currency=e.currency),e.tags&&(t.tags=l(e.tags));let n=await s(J,{input:t});u(`Hackathon created: ${n.tecCreateHackathon.title}`),i(e,n.tecCreateHackathon);}catch(t){o(t);}}),r.command("update").description("Update a hackathon").argument("<id>","Hackathon ID").option("--title <t>","Hackathon title").option("--theme <t>","Theme").option("--description <s>","Description").option("--start-at <iso>","Start time (ISO date)").option("--end-at <iso>","End time (ISO date)").option("--submission-deadline <iso>","Submission deadline (ISO date)").option("--max-team-size <n>","Max team size",c).option("--prize-pool <n>","Prize pool",c).option("--currency <c>","Currency code").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.title&&(n.title=t.title),t.theme!==void 0&&(n.theme=t.theme),t.description!==void 0&&(n.description=t.description),t.startAt&&(n.startAt=t.startAt),t.endAt&&(n.endAt=t.endAt),t.submissionDeadline&&(n.submissionDeadline=t.submissionDeadline),t.maxTeamSize!==void 0&&(n.maxTeamSize=t.maxTeamSize),t.prizePool!==void 0&&(n.prizePool=t.prizePool),t.currency&&(n.currency=t.currency),t.tags&&(n.tags=l(t.tags)),!Object.keys(n).length)throw new m("No updates specified");let g=await s(Y,{id:e,input:n});u("Hackathon updated"),i(t,g.tecUpdateHackathon);}catch(n){o(n);}}),r.command("open-registration").description("Open registration for a hackathon (DRAFT -> REGISTRATION_OPEN)").argument("<id>","Hackathon ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(Q,{id:e});u(`Registration open: ${n.tecOpenRegistration.status}`),i(t,n.tecOpenRegistration);}catch(n){o(n);}});}function wt(a){let r=a.command("teams").description("Technospam hackathon teams");r.command("list").description("List teams for a hackathon").requiredOption("--hackathon <id>","Hackathon ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(X,{hackathonId:e.hackathon});i(e,t.tecListTeams,{headers:["ID","Name","Captain","Status","Score"],rows:t.tecListTeams.map(n=>[d(n.id,12),n.name,d(n.captainId,12),n.status,String(n.score??0)])});}catch(t){o(t);}}),r.command("register").description("Register a team for a hackathon with the calling user as captain").requiredOption("--hackathon <id>","Hackathon ID").requiredOption("--name <name>","Team name").option("--members <csv>","Comma-separated member user IDs").option("-f, --format <format>","Output format").action(async e=>{try{let t={hackathonId:e.hackathon,name:e.name};e.members&&(t.memberIds=l(e.members));let n=await s(Z,{input:t});u(`Team registered: ${n.tecRegisterTeam.name}`),i(e,n.tecRegisterTeam);}catch(t){o(t);}}),r.command("submit-project").description("Submit a team's project for judging").requiredOption("--team <id>","Team ID").requiredOption("--project-name <n>","Project name").option("--project-url <url>","Project URL").option("--repo-url <url>","Repository URL").option("--pitch <s>","Pitch").option("-f, --format <format>","Output format").action(async e=>{try{let t={teamId:e.team,projectName:e.projectName};e.projectUrl&&(t.projectUrl=e.projectUrl),e.repoUrl&&(t.repoUrl=e.repoUrl),e.pitch&&(t.pitch=e.pitch);let n=await s(tt,{input:t});u(`Project submitted: ${n.tecSubmitProject.status}`),i(e,n.tecSubmitProject);}catch(t){o(t);}}),r.command("score").description("Record a judge score for a team and optionally mark it WINNER").argument("<id>","Team ID").requiredOption("--score <n>","Score",c).option("--winner","Mark the team as winner").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(et,{id:e,score:t.score,winner:t.winner??void 0});u(`Team scored: ${n.tecScoreTeam.score}`),i(t,n.tecScoreTeam);}catch(n){o(n);}});}function Tt(a){let r=a.command("problems").description("Technospam practice problems");r.command("list").description("List problems").option("--difficulty <d>","EASY|MEDIUM|HARD").option("--status <s>","DRAFT|PUBLISHED|ARCHIVED").option("--topic <t>","Filter by topic").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(rt,{difficulty:e.difficulty?e.difficulty.toUpperCase():void 0,status:e.status?e.status.toUpperCase():void 0,topic:e.topic,pagination:{limit:e.limit,offset:e.offset}});i(e,t.tecListProblems.items,{headers:["ID","Title","Difficulty","Status","Points"],rows:t.tecListProblems.items.map(n=>[d(n.id,12),n.title,n.difficulty,n.status,String(n.points??0)])});}catch(t){o(t);}}),r.command("get").description("Get a problem by id").argument("<id>","Problem ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(nt,{id:e});if(!n.tecProblem)throw new m(`Problem ${e} not found`);i(t,n.tecProblem);}catch(n){o(n);}}),r.command("create").description("Create a problem").requiredOption("--title <t>","Problem title").requiredOption("--slug <slug>","URL slug").option("--topic <t>","Topic").option("--statement <s>","Problem statement").option("--difficulty <d>","EASY|MEDIUM|HARD","EASY").option("--points <n>","Points",c).option("--languages <csv>","Comma-separated allowed languages").option("--starter-code <s>","Starter code").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async e=>{try{let t={title:e.title,slug:e.slug,difficulty:(e.difficulty??"EASY").toUpperCase()};e.topic&&(t.topic=e.topic),e.statement&&(t.statement=e.statement),e.points!==void 0&&(t.points=e.points),e.languages&&(t.languages=l(e.languages)),e.starterCode&&(t.starterCode=e.starterCode),e.tags&&(t.tags=l(e.tags));let n=await s(ot,{input:t});u(`Problem created: ${n.tecCreateProblem.title}`),i(e,n.tecCreateProblem);}catch(t){o(t);}}),r.command("update").description("Update a problem").argument("<id>","Problem ID").option("--title <t>","Problem title").option("--topic <t>","Topic").option("--statement <s>","Problem statement").option("--difficulty <d>","EASY|MEDIUM|HARD").option("--points <n>","Points",c).option("--languages <csv>","Comma-separated allowed languages").option("--starter-code <s>","Starter code").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.title&&(n.title=t.title),t.topic!==void 0&&(n.topic=t.topic),t.statement!==void 0&&(n.statement=t.statement),t.difficulty&&(n.difficulty=t.difficulty.toUpperCase()),t.points!==void 0&&(n.points=t.points),t.languages&&(n.languages=l(t.languages)),t.starterCode!==void 0&&(n.starterCode=t.starterCode),t.tags&&(n.tags=l(t.tags)),!Object.keys(n).length)throw new m("No updates specified");let g=await s(it,{id:e,input:n});u("Problem updated"),i(t,g.tecUpdateProblem);}catch(n){o(n);}}),r.command("publish").description("Publish a problem (DRAFT -> PUBLISHED)").argument("<id>","Problem ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(st,{id:e});u(`Problem published: ${n.tecPublishProblem.title}`),i(t,n.tecPublishProblem);}catch(n){o(n);}});}function yt(a){let r=a.command("submissions").description("Technospam problem submissions");r.command("list").description("List submissions").option("--problem <id>","Filter by problem ID").option("--learner <id>","Filter by learner ID").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(at,{problemId:e.problem,learnerId:e.learner,pagination:{limit:e.limit,offset:e.offset}});i(e,t.tecListSubmissions.items,{headers:["ID","Problem","Learner","Language","Verdict","Points"],rows:t.tecListSubmissions.items.map(n=>[d(n.id,12),d(n.problemId,12),d(n.learnerId,12),n.language,n.verdict,String(n.pointsAwarded??0)])});}catch(t){o(t);}}),r.command("submit").description("Submit a solution to a problem").requiredOption("--problem <id>","Problem ID").requiredOption("--language <l>","Language").requiredOption("--code <c>","Solution code").option("-f, --format <format>","Output format").action(async e=>{try{let t={problemId:e.problem,language:e.language,code:e.code},n=await s(ct,{input:t});u(`Solution submitted: ${n.tecSubmitSolution.verdict}`),i(e,n.tecSubmitSolution);}catch(t){o(t);}}),r.command("grade").description("Record the grader verdict for a submission").argument("<id>","Submission ID").requiredOption("--verdict <v>","PENDING|ACCEPTED|WRONG_ANSWER|TIME_LIMIT_EXCEEDED|RUNTIME_ERROR|COMPILE_ERROR").option("--runtime-ms <n>","Runtime in milliseconds",c).option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(ut,{id:e,verdict:t.verdict.toUpperCase(),runtimeMs:t.runtimeMs});u(`Submission graded: ${n.tecGradeSubmission.verdict}`),i(t,n.tecGradeSubmission);}catch(n){o(n);}});}function Et(a){let r=a.command("certificates").description("Technospam completion certificates");r.command("list").description("List certificates").option("--course <id>","Filter by course ID").option("--learner <id>","Filter by learner ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(dt,{courseId:e.course,learnerId:e.learner});i(e,t.tecListCertificates,{headers:["ID","Serial","Course","Learner","Score","Status"],rows:t.tecListCertificates.map(n=>[d(n.id,12),n.serial,d(n.courseId,12),d(n.learnerId,12),String(n.score),n.status])});}catch(t){o(t);}}),r.command("issue").description("Issue a verifiable completion certificate for a learner on a course").requiredOption("--course <id>","Course ID").requiredOption("--learner <id>","Learner ID").requiredOption("--score <n>","Score",c).option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(pt,{courseId:e.course,learnerId:e.learner,score:e.score});u(`Certificate issued: ${t.tecIssueCertificate.serial}`),i(e,t.tecIssueCertificate);}catch(t){o(t);}}),r.command("revoke").description("Revoke a certificate").argument("<id>","Certificate ID").option("--reason <s>","Revocation reason").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(mt,{id:e,reason:t.reason});u(`Certificate revoked: ${n.tecRevokeCertificate.status}`),i(t,n.tecRevokeCertificate);}catch(n){o(n);}});}function kt(a){a.command("health").description("Technospam service health check (public)").option("-f, --format <format>","Output format").action(async r=>{try{let e=await T(lt);u(e.tecHealth),i(r,{health:e.tecHealth});}catch(e){o(e);}});}var Ut={id:"technospam",version:"1.0.0",displayName:"Technospam",dependsOn:["auth","workspaces"],register(a,r){k(r);let e=a.command("technospam").description("Technospam developer-education platform");ft(e),gt(e),ht(e),It(e),Ct(e),bt(e),wt(e),Tt(e),yt(e),Et(e),kt(e);}},_n=Ut;module.exports=_n;
|
|
334
|
+
`;function c(a){let r=Number.parseInt(a,10);if(Number.isNaN(r))throw new m(`Expected an integer but got "${a}"`);return r}function l(a){return a.split(",").map(r=>r.trim()).filter(r=>r.length>0)}function ft(a){let r=a.command("courses").description("Technospam courses");r.command("list").description("List courses").option("--level <l>","BEGINNER|INTERMEDIATE|ADVANCED|EXPERT").option("--status <s>","DRAFT|PUBLISHED|ARCHIVED").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(A,{level:e.level?e.level.toUpperCase():void 0,status:e.status?e.status.toUpperCase():void 0,pagination:{limit:e.limit,offset:e.offset}});i(e,t.tecListCourses.items,{headers:["ID","Title","Level","Status","Minutes"],rows:t.tecListCourses.items.map(n=>[d(n.id,12),n.title,n.level,n.status,String(n.estimatedMinutes??0)])});}catch(t){o(t);}}),r.command("get").description("Get a course by id").argument("<id>","Course ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(S,{id:e});if(!n.tecCourse)throw new m(`Course ${e} not found`);i(t,n.tecCourse);}catch(n){o(n);}}),r.command("create").description("Create a course").requiredOption("--title <t>","Course title").requiredOption("--slug <slug>","URL slug").option("--topic <t>","Topic").option("--summary <s>","Summary").option("--level <l>","BEGINNER|INTERMEDIATE|ADVANCED|EXPERT","BEGINNER").option("--estimated-minutes <n>","Estimated minutes",c).option("--instructor-id <id>","Instructor user ID").option("--cover-file-id <id>","Cover image File ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async e=>{try{let t={title:e.title,slug:e.slug,level:(e.level??"BEGINNER").toUpperCase()};e.topic&&(t.topic=e.topic),e.summary&&(t.summary=e.summary),e.estimatedMinutes!==void 0&&(t.estimatedMinutes=e.estimatedMinutes),e.instructorId&&(t.instructorId=e.instructorId),e.coverFileId&&(t.coverFileId=e.coverFileId),e.tags&&(t.tags=l(e.tags));let n=await s(x,{input:t});u(`Course created: ${n.tecCreateCourse.title}`),i(e,n.tecCreateCourse);}catch(t){o(t);}}),r.command("update").description("Update a course").argument("<id>","Course ID").option("--title <t>","Course title").option("--topic <t>","Topic").option("--summary <s>","Summary").option("--level <l>","BEGINNER|INTERMEDIATE|ADVANCED|EXPERT").option("--estimated-minutes <n>","Estimated minutes",c).option("--instructor-id <id>","Instructor user ID").option("--cover-file-id <id>","Cover image File ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.title&&(n.title=t.title),t.topic!==void 0&&(n.topic=t.topic),t.summary!==void 0&&(n.summary=t.summary),t.level&&(n.level=t.level.toUpperCase()),t.estimatedMinutes!==void 0&&(n.estimatedMinutes=t.estimatedMinutes),t.instructorId&&(n.instructorId=t.instructorId),t.coverFileId&&(n.coverFileId=t.coverFileId),t.tags&&(n.tags=l(t.tags)),!Object.keys(n).length)throw new m("No updates specified");let g=await s(O,{id:e,input:n});u("Course updated"),i(t,g.tecUpdateCourse);}catch(n){o(n);}}),r.command("publish").description("Publish a course (DRAFT -> PUBLISHED)").argument("<id>","Course ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(R,{id:e});u(`Course published: ${n.tecPublishCourse.title}`),i(t,n.tecPublishCourse);}catch(n){o(n);}}),r.command("archive").description("Archive a course").argument("<id>","Course ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(v,{id:e});u(n.tecArchiveCourse?"Course archived":"Course not archived"),i(t,{archived:n.tecArchiveCourse});}catch(n){o(n);}});}function gt(a){let r=a.command("lessons").description("Technospam course lessons");r.command("list").description("List lessons for a course").requiredOption("--course <id>","Course ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(P,{courseId:e.course});i(e,t.tecListLessons.items,{headers:["ID","Title","Kind","Position","Minutes","Preview"],rows:t.tecListLessons.items.map(n=>[d(n.id,12),n.title,n.kind,String(n.position),String(n.estimatedMinutes??0),n.isPreview?"yes":"no"])});}catch(t){o(t);}}),r.command("create").description("Create a lesson").requiredOption("--course <id>","Course ID").requiredOption("--title <t>","Lesson title").option("--kind <k>","ARTICLE|VIDEO|QUIZ|INTERACTIVE|PROJECT","ARTICLE").option("--content <s>","Lesson content").option("--position <n>","Order position",c).option("--estimated-minutes <n>","Estimated minutes",c).option("--file-id <id>","Attachment / video File ID").option("--preview","Mark as a free preview lesson").option("-f, --format <format>","Output format").action(async e=>{try{let t={courseId:e.course,title:e.title,kind:(e.kind??"ARTICLE").toUpperCase()};e.content&&(t.content=e.content),e.position!==void 0&&(t.position=e.position),e.estimatedMinutes!==void 0&&(t.estimatedMinutes=e.estimatedMinutes),e.fileId&&(t.fileId=e.fileId),e.preview&&(t.isPreview=!0);let n=await s(L,{input:t});u(`Lesson created: ${n.tecCreateLesson.title}`),i(e,n.tecCreateLesson);}catch(t){o(t);}}),r.command("update").description("Update a lesson").argument("<id>","Lesson ID").option("--title <t>","Lesson title").option("--kind <k>","ARTICLE|VIDEO|QUIZ|INTERACTIVE|PROJECT").option("--content <s>","Lesson content").option("--position <n>","Order position",c).option("--estimated-minutes <n>","Estimated minutes",c).option("--file-id <id>","Attachment / video File ID").option("--preview <bool>","true|false",e=>e==="true").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.title&&(n.title=t.title),t.kind&&(n.kind=t.kind.toUpperCase()),t.content!==void 0&&(n.content=t.content),t.position!==void 0&&(n.position=t.position),t.estimatedMinutes!==void 0&&(n.estimatedMinutes=t.estimatedMinutes),t.fileId&&(n.fileId=t.fileId),t.preview!==void 0&&(n.isPreview=t.preview),!Object.keys(n).length)throw new m("No updates specified");let g=await s($,{id:e,input:n});u("Lesson updated"),i(t,g.tecUpdateLesson);}catch(n){o(n);}});}function ht(a){let r=a.command("enrollments").description("Technospam course enrollments");r.command("list").description("List enrollments").option("--course <id>","Filter by course ID").option("--learner <id>","Filter by learner ID").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(D,{courseId:e.course,learnerId:e.learner,pagination:{limit:e.limit,offset:e.offset}});i(e,t.tecListEnrollments.items,{headers:["ID","Course","Learner","Status","Progress %","Lessons"],rows:t.tecListEnrollments.items.map(n=>[d(n.id,12),d(n.courseId,12),d(n.learnerId,12),n.status,String(n.progressPct),String(n.lessonsCompleted)])});}catch(t){o(t);}}),r.command("enroll").description("Enroll the calling user in a course").requiredOption("--course <id>","Course ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(M,{input:{courseId:e.course}});u(`Enrolled in course ${t.tecEnroll.courseId}`),i(e,t.tecEnroll);}catch(t){o(t);}}),r.command("update-progress").description("Update a learner's enrollment progress (auto-completes at 100%)").requiredOption("--enrollment <id>","Enrollment ID").requiredOption("--progress-pct <n>","Progress percent (0-100)",c).option("--lessons-completed <n>","Lessons completed count",c).option("-f, --format <format>","Output format").action(async e=>{try{let t={enrollmentId:e.enrollment,progressPct:e.progressPct};e.lessonsCompleted!==void 0&&(t.lessonsCompleted=e.lessonsCompleted);let n=await s(N,{input:t});u(`Progress updated to ${n.tecUpdateProgress.progressPct}%`),i(e,n.tecUpdateProgress);}catch(t){o(t);}});}function It(a){let r=a.command("mentors").description("Technospam mentors");r.command("list").description("List mentors").option("--status <s>","PENDING|ACTIVE|PAUSED|INACTIVE").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(_,{status:e.status?e.status.toUpperCase():void 0,pagination:{limit:e.limit,offset:e.offset}});i(e,t.tecListMentors.items,{headers:["ID","Headline","Status","Rate","Rating","Accepting"],rows:t.tecListMentors.items.map(n=>[d(n.id,12),d(n.headline,30),n.status,String(n.hourlyRate??0),String(n.ratingAvg??0),n.isAcceptingMentees?"yes":"no"])});}catch(t){o(t);}}),r.command("get").description("Get a mentor by id").argument("<id>","Mentor ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(U,{id:e});if(!n.tecMentor)throw new m(`Mentor ${e} not found`);i(t,n.tecMentor);}catch(n){o(n);}}),r.command("become").description("Create the calling user's mentor profile").requiredOption("--headline <h>","Mentor headline").option("--bio <s>","Bio").option("--expertise <csv>","Comma-separated areas of expertise").option("--hourly-rate <n>","Hourly rate",c).option("--currency <c>","Currency code").option("-f, --format <format>","Output format").action(async e=>{try{let t={headline:e.headline};e.bio&&(t.bio=e.bio),e.expertise&&(t.expertise=l(e.expertise)),e.hourlyRate!==void 0&&(t.hourlyRate=e.hourlyRate),e.currency&&(t.currency=e.currency);let n=await s(q,{input:t});u(`Mentor profile created: ${n.tecBecomeMentor.headline}`),i(e,n.tecBecomeMentor);}catch(t){o(t);}}),r.command("update").description("Update a mentor profile").argument("<id>","Mentor ID").option("--headline <h>","Mentor headline").option("--bio <s>","Bio").option("--expertise <csv>","Comma-separated areas of expertise").option("--hourly-rate <n>","Hourly rate",c).option("--currency <c>","Currency code").option("--accepting <bool>","true|false (accepting mentees)",e=>e==="true").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.headline&&(n.headline=t.headline),t.bio!==void 0&&(n.bio=t.bio),t.expertise&&(n.expertise=l(t.expertise)),t.hourlyRate!==void 0&&(n.hourlyRate=t.hourlyRate),t.currency&&(n.currency=t.currency),t.accepting!==void 0&&(n.isAcceptingMentees=t.accepting),!Object.keys(n).length)throw new m("No updates specified");let g=await s(H,{id:e,input:n});u("Mentor updated"),i(t,g.tecUpdateMentor);}catch(n){o(n);}}),r.command("approve").description("Approve a pending mentor profile (PENDING -> ACTIVE)").argument("<id>","Mentor ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(F,{id:e});u(`Mentor approved: ${n.tecApproveMentor.status}`),i(t,n.tecApproveMentor);}catch(n){o(n);}});}function Ct(a){let r=a.command("sessions").description("Technospam mentorship sessions");r.command("list").description("List mentorship sessions").option("--mentor <id>","Filter by mentor ID").option("--mentee <id>","Filter by mentee ID").option("--status <s>","REQUESTED|CONFIRMED|COMPLETED|CANCELLED|NO_SHOW").option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(G,{mentorId:e.mentor,menteeId:e.mentee,status:e.status?e.status.toUpperCase():void 0});i(e,t.tecListSessions.items,{headers:["ID","Mentor","Mentee","Topic","Status","Scheduled"],rows:t.tecListSessions.items.map(n=>[d(n.id,12),d(n.mentorId,12),d(n.menteeId,12),d(n.topic,24),n.status,b(n.scheduledAt)])});}catch(t){o(t);}}),r.command("book").description("Book a 1:1 session with a mentor as the calling mentee").requiredOption("--mentor <id>","Mentor ID").requiredOption("--topic <t>","Session topic").requiredOption("--scheduled-at <iso>","Scheduled time (ISO date)").option("--agenda <s>","Agenda").option("--duration-minutes <n>","Duration (minutes)",c).option("-f, --format <format>","Output format").action(async e=>{try{let t={mentorId:e.mentor,topic:e.topic,scheduledAt:e.scheduledAt};e.agenda&&(t.agenda=e.agenda),e.durationMinutes!==void 0&&(t.durationMinutes=e.durationMinutes);let n=await s(j,{input:t});u(`Session booked: ${n.tecBookSession.topic}`),i(e,n.tecBookSession);}catch(t){o(t);}}),r.command("confirm").description("Confirm a requested session").argument("<id>","Session ID").option("--meeting-url <url>","Meeting URL").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(B,{id:e,meetingUrl:t.meetingUrl});u("Session confirmed"),i(t,n.tecConfirmSession);}catch(n){o(n);}}),r.command("cancel").description("Cancel a session").argument("<id>","Session ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(z,{id:e});u("Session cancelled"),i(t,n.tecCancelSession);}catch(n){o(n);}}),r.command("complete").description("Complete a session with optional rating and feedback").argument("<id>","Session ID").option("--rating <n>","Rating (1-5)",c).option("--feedback <s>","Feedback").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(W,{id:e,rating:t.rating,feedback:t.feedback});u("Session completed"),i(t,n.tecCompleteSession);}catch(n){o(n);}});}function bt(a){let r=a.command("hackathons").description("Technospam hackathons");r.command("list").description("List hackathons").option("--status <s>","DRAFT|REGISTRATION_OPEN|IN_PROGRESS|JUDGING|COMPLETED|CANCELLED").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(K,{status:e.status?e.status.toUpperCase():void 0,pagination:{limit:e.limit,offset:e.offset}});i(e,t.tecListHackathons.items,{headers:["ID","Title","Status","Start","Prize"],rows:t.tecListHackathons.items.map(n=>[d(n.id,12),n.title,n.status,b(n.startAt),String(n.prizePool??0)])});}catch(t){o(t);}}),r.command("get").description("Get a hackathon by id").argument("<id>","Hackathon ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(V,{id:e});if(!n.tecHackathon)throw new m(`Hackathon ${e} not found`);i(t,n.tecHackathon);}catch(n){o(n);}}),r.command("create").description("Create a hackathon").requiredOption("--title <t>","Hackathon title").requiredOption("--slug <slug>","URL slug").requiredOption("--start-at <iso>","Start time (ISO date)").requiredOption("--end-at <iso>","End time (ISO date)").option("--theme <t>","Theme").option("--description <s>","Description").option("--submission-deadline <iso>","Submission deadline (ISO date)").option("--max-team-size <n>","Max team size",c).option("--prize-pool <n>","Prize pool",c).option("--currency <c>","Currency code").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async e=>{try{let t={title:e.title,slug:e.slug,startAt:e.startAt,endAt:e.endAt};e.theme&&(t.theme=e.theme),e.description&&(t.description=e.description),e.submissionDeadline&&(t.submissionDeadline=e.submissionDeadline),e.maxTeamSize!==void 0&&(t.maxTeamSize=e.maxTeamSize),e.prizePool!==void 0&&(t.prizePool=e.prizePool),e.currency&&(t.currency=e.currency),e.tags&&(t.tags=l(e.tags));let n=await s(J,{input:t});u(`Hackathon created: ${n.tecCreateHackathon.title}`),i(e,n.tecCreateHackathon);}catch(t){o(t);}}),r.command("update").description("Update a hackathon").argument("<id>","Hackathon ID").option("--title <t>","Hackathon title").option("--theme <t>","Theme").option("--description <s>","Description").option("--start-at <iso>","Start time (ISO date)").option("--end-at <iso>","End time (ISO date)").option("--submission-deadline <iso>","Submission deadline (ISO date)").option("--max-team-size <n>","Max team size",c).option("--prize-pool <n>","Prize pool",c).option("--currency <c>","Currency code").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.title&&(n.title=t.title),t.theme!==void 0&&(n.theme=t.theme),t.description!==void 0&&(n.description=t.description),t.startAt&&(n.startAt=t.startAt),t.endAt&&(n.endAt=t.endAt),t.submissionDeadline&&(n.submissionDeadline=t.submissionDeadline),t.maxTeamSize!==void 0&&(n.maxTeamSize=t.maxTeamSize),t.prizePool!==void 0&&(n.prizePool=t.prizePool),t.currency&&(n.currency=t.currency),t.tags&&(n.tags=l(t.tags)),!Object.keys(n).length)throw new m("No updates specified");let g=await s(Y,{id:e,input:n});u("Hackathon updated"),i(t,g.tecUpdateHackathon);}catch(n){o(n);}}),r.command("open-registration").description("Open registration for a hackathon (DRAFT -> REGISTRATION_OPEN)").argument("<id>","Hackathon ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(Q,{id:e});u(`Registration open: ${n.tecOpenRegistration.status}`),i(t,n.tecOpenRegistration);}catch(n){o(n);}});}function wt(a){let r=a.command("teams").description("Technospam hackathon teams");r.command("list").description("List teams for a hackathon").requiredOption("--hackathon <id>","Hackathon ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(X,{hackathonId:e.hackathon});i(e,t.tecListTeams.items,{headers:["ID","Name","Captain","Status","Score"],rows:t.tecListTeams.items.map(n=>[d(n.id,12),n.name,d(n.captainId,12),n.status,String(n.score??0)])});}catch(t){o(t);}}),r.command("register").description("Register a team for a hackathon with the calling user as captain").requiredOption("--hackathon <id>","Hackathon ID").requiredOption("--name <name>","Team name").option("--members <csv>","Comma-separated member user IDs").option("-f, --format <format>","Output format").action(async e=>{try{let t={hackathonId:e.hackathon,name:e.name};e.members&&(t.memberIds=l(e.members));let n=await s(Z,{input:t});u(`Team registered: ${n.tecRegisterTeam.name}`),i(e,n.tecRegisterTeam);}catch(t){o(t);}}),r.command("submit-project").description("Submit a team's project for judging").requiredOption("--team <id>","Team ID").requiredOption("--project-name <n>","Project name").option("--project-url <url>","Project URL").option("--repo-url <url>","Repository URL").option("--pitch <s>","Pitch").option("-f, --format <format>","Output format").action(async e=>{try{let t={teamId:e.team,projectName:e.projectName};e.projectUrl&&(t.projectUrl=e.projectUrl),e.repoUrl&&(t.repoUrl=e.repoUrl),e.pitch&&(t.pitch=e.pitch);let n=await s(tt,{input:t});u(`Project submitted: ${n.tecSubmitProject.status}`),i(e,n.tecSubmitProject);}catch(t){o(t);}}),r.command("score").description("Record a judge score for a team and optionally mark it WINNER").argument("<id>","Team ID").requiredOption("--score <n>","Score",c).option("--winner","Mark the team as winner").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(et,{id:e,score:t.score,winner:t.winner??void 0});u(`Team scored: ${n.tecScoreTeam.score}`),i(t,n.tecScoreTeam);}catch(n){o(n);}});}function Tt(a){let r=a.command("problems").description("Technospam practice problems");r.command("list").description("List problems").option("--difficulty <d>","EASY|MEDIUM|HARD").option("--status <s>","DRAFT|PUBLISHED|ARCHIVED").option("--topic <t>","Filter by topic").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(rt,{difficulty:e.difficulty?e.difficulty.toUpperCase():void 0,status:e.status?e.status.toUpperCase():void 0,topic:e.topic,pagination:{limit:e.limit,offset:e.offset}});i(e,t.tecListProblems.items,{headers:["ID","Title","Difficulty","Status","Points"],rows:t.tecListProblems.items.map(n=>[d(n.id,12),n.title,n.difficulty,n.status,String(n.points??0)])});}catch(t){o(t);}}),r.command("get").description("Get a problem by id").argument("<id>","Problem ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(nt,{id:e});if(!n.tecProblem)throw new m(`Problem ${e} not found`);i(t,n.tecProblem);}catch(n){o(n);}}),r.command("create").description("Create a problem").requiredOption("--title <t>","Problem title").requiredOption("--slug <slug>","URL slug").option("--topic <t>","Topic").option("--statement <s>","Problem statement").option("--difficulty <d>","EASY|MEDIUM|HARD","EASY").option("--points <n>","Points",c).option("--languages <csv>","Comma-separated allowed languages").option("--starter-code <s>","Starter code").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async e=>{try{let t={title:e.title,slug:e.slug,difficulty:(e.difficulty??"EASY").toUpperCase()};e.topic&&(t.topic=e.topic),e.statement&&(t.statement=e.statement),e.points!==void 0&&(t.points=e.points),e.languages&&(t.languages=l(e.languages)),e.starterCode&&(t.starterCode=e.starterCode),e.tags&&(t.tags=l(e.tags));let n=await s(ot,{input:t});u(`Problem created: ${n.tecCreateProblem.title}`),i(e,n.tecCreateProblem);}catch(t){o(t);}}),r.command("update").description("Update a problem").argument("<id>","Problem ID").option("--title <t>","Problem title").option("--topic <t>","Topic").option("--statement <s>","Problem statement").option("--difficulty <d>","EASY|MEDIUM|HARD").option("--points <n>","Points",c).option("--languages <csv>","Comma-separated allowed languages").option("--starter-code <s>","Starter code").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.title&&(n.title=t.title),t.topic!==void 0&&(n.topic=t.topic),t.statement!==void 0&&(n.statement=t.statement),t.difficulty&&(n.difficulty=t.difficulty.toUpperCase()),t.points!==void 0&&(n.points=t.points),t.languages&&(n.languages=l(t.languages)),t.starterCode!==void 0&&(n.starterCode=t.starterCode),t.tags&&(n.tags=l(t.tags)),!Object.keys(n).length)throw new m("No updates specified");let g=await s(it,{id:e,input:n});u("Problem updated"),i(t,g.tecUpdateProblem);}catch(n){o(n);}}),r.command("publish").description("Publish a problem (DRAFT -> PUBLISHED)").argument("<id>","Problem ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(st,{id:e});u(`Problem published: ${n.tecPublishProblem.title}`),i(t,n.tecPublishProblem);}catch(n){o(n);}});}function yt(a){let r=a.command("submissions").description("Technospam problem submissions");r.command("list").description("List submissions").option("--problem <id>","Filter by problem ID").option("--learner <id>","Filter by learner ID").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(at,{problemId:e.problem,learnerId:e.learner,pagination:{limit:e.limit,offset:e.offset}});i(e,t.tecListSubmissions.items,{headers:["ID","Problem","Learner","Language","Verdict","Points"],rows:t.tecListSubmissions.items.map(n=>[d(n.id,12),d(n.problemId,12),d(n.learnerId,12),n.language,n.verdict,String(n.pointsAwarded??0)])});}catch(t){o(t);}}),r.command("submit").description("Submit a solution to a problem").requiredOption("--problem <id>","Problem ID").requiredOption("--language <l>","Language").requiredOption("--code <c>","Solution code").option("-f, --format <format>","Output format").action(async e=>{try{let t={problemId:e.problem,language:e.language,code:e.code},n=await s(ct,{input:t});u(`Solution submitted: ${n.tecSubmitSolution.verdict}`),i(e,n.tecSubmitSolution);}catch(t){o(t);}}),r.command("grade").description("Record the grader verdict for a submission").argument("<id>","Submission ID").requiredOption("--verdict <v>","PENDING|ACCEPTED|WRONG_ANSWER|TIME_LIMIT_EXCEEDED|RUNTIME_ERROR|COMPILE_ERROR").option("--runtime-ms <n>","Runtime in milliseconds",c).option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(ut,{id:e,verdict:t.verdict.toUpperCase(),runtimeMs:t.runtimeMs});u(`Submission graded: ${n.tecGradeSubmission.verdict}`),i(t,n.tecGradeSubmission);}catch(n){o(n);}});}function Et(a){let r=a.command("certificates").description("Technospam completion certificates");r.command("list").description("List certificates").option("--course <id>","Filter by course ID").option("--learner <id>","Filter by learner ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(dt,{courseId:e.course,learnerId:e.learner});i(e,t.tecListCertificates,{headers:["ID","Serial","Course","Learner","Score","Status"],rows:t.tecListCertificates.map(n=>[d(n.id,12),n.serial,d(n.courseId,12),d(n.learnerId,12),String(n.score),n.status])});}catch(t){o(t);}}),r.command("issue").description("Issue a verifiable completion certificate for a learner on a course").requiredOption("--course <id>","Course ID").requiredOption("--learner <id>","Learner ID").requiredOption("--score <n>","Score",c).option("-f, --format <format>","Output format").action(async e=>{try{let t=await s(pt,{courseId:e.course,learnerId:e.learner,score:e.score});u(`Certificate issued: ${t.tecIssueCertificate.serial}`),i(e,t.tecIssueCertificate);}catch(t){o(t);}}),r.command("revoke").description("Revoke a certificate").argument("<id>","Certificate ID").option("--reason <s>","Revocation reason").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await s(mt,{id:e,reason:t.reason});u(`Certificate revoked: ${n.tecRevokeCertificate.status}`),i(t,n.tecRevokeCertificate);}catch(n){o(n);}});}function kt(a){a.command("health").description("Technospam service health check (public)").option("-f, --format <format>","Output format").action(async r=>{try{let e=await T(lt);u(e.tecHealth),i(r,{health:e.tecHealth});}catch(e){o(e);}});}var Ut={id:"technospam",version:"1.0.0",displayName:"Technospam",dependsOn:["auth","workspaces"],register(a,r){k(r);let e=a.command("technospam").description("Technospam developer-education platform");ft(e),gt(e),ht(e),It(e),Ct(e),bt(e),wt(e),Tt(e),yt(e),Et(e),kt(e);}},_n=Ut;module.exports=_n;
|