@burdenoff/cli-sdk 2026.1124.1 → 2026.1202.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-BGNPGKJM.js +1 -0
- package/dist/{chunk-ASSY2L5R.js → chunk-E6F56R4K.js} +3 -3
- package/dist/chunk-N7EXKGE2.js +34 -0
- package/dist/core/index.cjs +9 -9
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +1 -1
- package/dist/index.cjs +9 -9
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{module-BNVKV_pI.d.ts → module-DWSAfs3k.d.cts} +20 -19
- package/dist/{module-BNVKV_pI.d.cts → module-DWSAfs3k.d.ts} +20 -19
- package/dist/modules/adaptercloud/index.cjs +38 -38
- package/dist/modules/adaptercloud/index.d.cts +1 -1
- package/dist/modules/adaptercloud/index.d.ts +1 -1
- package/dist/modules/adaptercloud/index.js +2 -2
- package/dist/modules/artistrybase/index.cjs +50 -50
- package/dist/modules/artistrybase/index.d.cts +1 -1
- package/dist/modules/artistrybase/index.d.ts +1 -1
- package/dist/modules/artistrybase/index.js +2 -2
- package/dist/modules/assethandler/index.cjs +32 -32
- package/dist/modules/assethandler/index.d.cts +1 -1
- package/dist/modules/assethandler/index.d.ts +1 -1
- package/dist/modules/assethandler/index.js +2 -2
- package/dist/modules/atheletebridge/index.cjs +34 -34
- package/dist/modules/atheletebridge/index.d.cts +1 -1
- package/dist/modules/atheletebridge/index.d.ts +1 -1
- package/dist/modules/atheletebridge/index.js +2 -2
- package/dist/modules/auth/index.cjs +34 -34
- package/dist/modules/auth/index.d.cts +1 -1
- package/dist/modules/auth/index.d.ts +1 -1
- package/dist/modules/auth/index.js +4 -4
- package/dist/modules/billing/index.cjs +18 -18
- package/dist/modules/billing/index.d.cts +1 -1
- package/dist/modules/billing/index.d.ts +1 -1
- package/dist/modules/billing/index.js +2 -2
- package/dist/modules/brainyrich/index.cjs +45 -45
- package/dist/modules/brainyrich/index.d.cts +1 -1
- package/dist/modules/brainyrich/index.d.ts +1 -1
- package/dist/modules/brainyrich/index.js +2 -2
- package/dist/modules/buildmyiq/index.cjs +32 -32
- package/dist/modules/buildmyiq/index.d.cts +1 -1
- package/dist/modules/buildmyiq/index.d.ts +1 -1
- package/dist/modules/buildmyiq/index.js +2 -2
- package/dist/modules/channels/index.cjs +12 -12
- package/dist/modules/channels/index.d.cts +1 -1
- package/dist/modules/channels/index.d.ts +1 -1
- package/dist/modules/channels/index.js +2 -2
- package/dist/modules/collabkin/index.cjs +34 -34
- package/dist/modules/collabkin/index.d.cts +1 -1
- package/dist/modules/collabkin/index.d.ts +1 -1
- package/dist/modules/collabkin/index.js +2 -2
- package/dist/modules/comradecircle/index.cjs +41 -41
- package/dist/modules/comradecircle/index.d.cts +1 -1
- package/dist/modules/comradecircle/index.d.ts +1 -1
- package/dist/modules/comradecircle/index.js +2 -2
- package/dist/modules/conversations/index.cjs +32 -32
- package/dist/modules/conversations/index.d.cts +1 -1
- package/dist/modules/conversations/index.d.ts +1 -1
- package/dist/modules/conversations/index.js +2 -2
- package/dist/modules/coolandlovely/index.cjs +41 -41
- package/dist/modules/coolandlovely/index.d.cts +1 -1
- package/dist/modules/coolandlovely/index.d.ts +1 -1
- package/dist/modules/coolandlovely/index.js +2 -2
- package/dist/modules/cosmicintersection/index.cjs +43 -43
- package/dist/modules/cosmicintersection/index.d.cts +1 -1
- package/dist/modules/cosmicintersection/index.d.ts +1 -1
- package/dist/modules/cosmicintersection/index.js +2 -2
- package/dist/modules/crewfoundry/index.cjs +70 -70
- package/dist/modules/crewfoundry/index.d.cts +1 -1
- package/dist/modules/crewfoundry/index.d.ts +1 -1
- package/dist/modules/crewfoundry/index.js +2 -2
- package/dist/modules/devportal/index.cjs +23 -23
- package/dist/modules/devportal/index.d.cts +1 -1
- package/dist/modules/devportal/index.d.ts +1 -1
- package/dist/modules/devportal/index.js +2 -2
- package/dist/modules/ecoimpacthub/index.cjs +41 -41
- package/dist/modules/ecoimpacthub/index.d.cts +1 -1
- package/dist/modules/ecoimpacthub/index.d.ts +1 -1
- package/dist/modules/ecoimpacthub/index.js +2 -2
- package/dist/modules/eventfullymanaged/index.cjs +92 -92
- package/dist/modules/eventfullymanaged/index.d.cts +1 -1
- package/dist/modules/eventfullymanaged/index.d.ts +1 -1
- package/dist/modules/eventfullymanaged/index.js +2 -2
- package/dist/modules/export/index.cjs +14 -14
- package/dist/modules/export/index.d.cts +1 -1
- package/dist/modules/export/index.d.ts +1 -1
- package/dist/modules/export/index.js +2 -2
- package/dist/modules/files/index.cjs +11 -11
- package/dist/modules/files/index.d.cts +1 -1
- package/dist/modules/files/index.d.ts +1 -1
- package/dist/modules/files/index.js +2 -2
- package/dist/modules/fluidgrids/index.cjs +29 -29
- package/dist/modules/fluidgrids/index.d.cts +1 -1
- package/dist/modules/fluidgrids/index.d.ts +1 -1
- package/dist/modules/fluidgrids/index.js +3 -3
- package/dist/modules/ggnomad/index.cjs +21 -21
- package/dist/modules/ggnomad/index.d.cts +1 -1
- package/dist/modules/ggnomad/index.d.ts +1 -1
- package/dist/modules/ggnomad/index.js +2 -2
- package/dist/modules/govcitizenhub/index.cjs +35 -35
- package/dist/modules/govcitizenhub/index.d.cts +1 -1
- package/dist/modules/govcitizenhub/index.d.ts +1 -1
- package/dist/modules/govcitizenhub/index.js +2 -2
- package/dist/modules/groups/index.cjs +12 -12
- package/dist/modules/groups/index.d.cts +1 -1
- package/dist/modules/groups/index.d.ts +1 -1
- package/dist/modules/groups/index.js +2 -2
- package/dist/modules/headshotmarketing/index.cjs +165 -165
- package/dist/modules/headshotmarketing/index.d.cts +1 -1
- package/dist/modules/headshotmarketing/index.d.ts +1 -1
- package/dist/modules/headshotmarketing/index.js +2 -2
- package/dist/modules/health/index.d.cts +1 -1
- package/dist/modules/health/index.d.ts +1 -1
- package/dist/modules/hookmovies/index.cjs +43 -43
- package/dist/modules/hookmovies/index.d.cts +1 -1
- package/dist/modules/hookmovies/index.d.ts +1 -1
- package/dist/modules/hookmovies/index.js +2 -2
- package/dist/modules/housingvista/index.cjs +24 -24
- package/dist/modules/housingvista/index.d.cts +1 -1
- package/dist/modules/housingvista/index.d.ts +1 -1
- package/dist/modules/housingvista/index.js +2 -2
- package/dist/modules/integrations/index.cjs +27 -27
- package/dist/modules/integrations/index.d.cts +1 -1
- package/dist/modules/integrations/index.d.ts +1 -1
- package/dist/modules/integrations/index.js +2 -2
- package/dist/modules/intelwatchtower/index.cjs +37 -37
- package/dist/modules/intelwatchtower/index.d.cts +1 -1
- package/dist/modules/intelwatchtower/index.d.ts +1 -1
- package/dist/modules/intelwatchtower/index.js +2 -2
- package/dist/modules/kadaikodi/index.cjs +26 -26
- package/dist/modules/kadaikodi/index.d.cts +1 -1
- package/dist/modules/kadaikodi/index.d.ts +1 -1
- package/dist/modules/kadaikodi/index.js +2 -2
- package/dist/modules/labsofscience/index.cjs +44 -44
- package/dist/modules/labsofscience/index.d.cts +1 -1
- package/dist/modules/labsofscience/index.d.ts +1 -1
- package/dist/modules/labsofscience/index.js +2 -2
- package/dist/modules/manufacturedops/index.cjs +36 -36
- package/dist/modules/manufacturedops/index.d.cts +1 -1
- package/dist/modules/manufacturedops/index.d.ts +1 -1
- package/dist/modules/manufacturedops/index.js +2 -2
- package/dist/modules/movethewheels/index.cjs +78 -78
- package/dist/modules/movethewheels/index.d.cts +1 -1
- package/dist/modules/movethewheels/index.d.ts +1 -1
- package/dist/modules/movethewheels/index.js +2 -2
- package/dist/modules/mybodyshield/index.cjs +36 -36
- package/dist/modules/mybodyshield/index.d.cts +1 -1
- package/dist/modules/mybodyshield/index.d.ts +1 -1
- package/dist/modules/mybodyshield/index.js +2 -2
- package/dist/modules/notifications/index.cjs +5 -5
- package/dist/modules/notifications/index.d.cts +1 -1
- package/dist/modules/notifications/index.d.ts +1 -1
- package/dist/modules/notifications/index.js +1 -1
- package/dist/modules/organizations/index.cjs +5 -5
- package/dist/modules/organizations/index.d.cts +1 -1
- package/dist/modules/organizations/index.d.ts +1 -1
- package/dist/modules/organizations/index.js +1 -1
- package/dist/modules/planmagnet/index.cjs +272 -272
- package/dist/modules/planmagnet/index.d.cts +1 -1
- package/dist/modules/planmagnet/index.d.ts +1 -1
- package/dist/modules/planmagnet/index.js +2 -2
- package/dist/modules/products/index.cjs +19 -19
- package/dist/modules/products/index.d.cts +1 -1
- package/dist/modules/products/index.d.ts +1 -1
- package/dist/modules/products/index.js +2 -2
- package/dist/modules/proserviceworld/index.cjs +24 -24
- package/dist/modules/proserviceworld/index.d.cts +1 -1
- package/dist/modules/proserviceworld/index.d.ts +1 -1
- package/dist/modules/proserviceworld/index.js +2 -2
- package/dist/modules/rbac/index.cjs +8 -8
- package/dist/modules/rbac/index.d.cts +1 -1
- package/dist/modules/rbac/index.d.ts +1 -1
- package/dist/modules/rbac/index.js +2 -2
- package/dist/modules/sandbox/index.cjs +39 -39
- package/dist/modules/sandbox/index.d.cts +1 -1
- package/dist/modules/sandbox/index.d.ts +1 -1
- package/dist/modules/sandbox/index.js +1 -1
- package/dist/modules/scheduler/index.cjs +25 -25
- package/dist/modules/scheduler/index.d.cts +1 -1
- package/dist/modules/scheduler/index.d.ts +1 -1
- package/dist/modules/scheduler/index.js +2 -2
- package/dist/modules/security/index.cjs +14 -14
- package/dist/modules/security/index.d.cts +1 -1
- package/dist/modules/security/index.d.ts +1 -1
- package/dist/modules/security/index.js +2 -2
- package/dist/modules/semanticfed/index.cjs +44 -44
- package/dist/modules/semanticfed/index.d.cts +1 -1
- package/dist/modules/semanticfed/index.d.ts +1 -1
- package/dist/modules/semanticfed/index.js +1 -1
- package/dist/modules/semanticfed-sql/index.cjs +4 -4
- package/dist/modules/semanticfed-sql/index.d.cts +1 -1
- package/dist/modules/semanticfed-sql/index.d.ts +1 -1
- package/dist/modules/semanticfed-sql/index.js +1 -1
- package/dist/modules/store/index.cjs +21 -21
- package/dist/modules/store/index.d.cts +1 -1
- package/dist/modules/store/index.d.ts +1 -1
- package/dist/modules/store/index.js +2 -2
- package/dist/modules/subscriberbot/index.cjs +41 -41
- package/dist/modules/subscriberbot/index.d.cts +1 -1
- package/dist/modules/subscriberbot/index.d.ts +1 -1
- package/dist/modules/subscriberbot/index.js +2 -2
- package/dist/modules/support/index.cjs +8 -8
- package/dist/modules/support/index.d.cts +1 -1
- package/dist/modules/support/index.d.ts +1 -1
- package/dist/modules/support/index.js +2 -2
- package/dist/modules/tags/index.cjs +10 -10
- package/dist/modules/tags/index.d.cts +1 -1
- package/dist/modules/tags/index.d.ts +1 -1
- package/dist/modules/tags/index.js +2 -2
- package/dist/modules/technospam/index.cjs +44 -44
- package/dist/modules/technospam/index.d.cts +1 -1
- package/dist/modules/technospam/index.d.ts +1 -1
- package/dist/modules/technospam/index.js +2 -2
- package/dist/modules/theculturepost/index.cjs +32 -32
- package/dist/modules/theculturepost/index.d.cts +1 -1
- package/dist/modules/theculturepost/index.d.ts +1 -1
- package/dist/modules/theculturepost/index.js +2 -2
- package/dist/modules/theglobalfuel/index.cjs +30 -30
- package/dist/modules/theglobalfuel/index.d.cts +1 -1
- package/dist/modules/theglobalfuel/index.d.ts +1 -1
- package/dist/modules/theglobalfuel/index.js +2 -2
- package/dist/modules/timecampus/index.cjs +69 -69
- package/dist/modules/timecampus/index.d.cts +1 -1
- package/dist/modules/timecampus/index.d.ts +1 -1
- package/dist/modules/timecampus/index.js +4 -4
- package/dist/modules/tours/index.cjs +4 -4
- package/dist/modules/tours/index.d.cts +1 -1
- package/dist/modules/tours/index.d.ts +1 -1
- package/dist/modules/tours/index.js +2 -2
- package/dist/modules/vibecontrols/index.cjs +460 -460
- package/dist/modules/vibecontrols/index.d.cts +1 -1
- package/dist/modules/vibecontrols/index.d.ts +1 -1
- package/dist/modules/vibecontrols/index.js +5 -5
- package/dist/modules/workspaces/index.cjs +16 -16
- package/dist/modules/workspaces/index.d.cts +1 -1
- package/dist/modules/workspaces/index.d.ts +1 -1
- package/dist/modules/workspaces/index.js +2 -2
- package/package.json +6 -1
- package/dist/chunk-3ZVMC2AF.js +0 -1
- package/dist/chunk-ZT6KOG7N.js +0 -34
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var p=class extends Error{exitCode;hint;constructor(r,t){super(r),this.name="CliUserError",this.exitCode=t?.exitCode??1,this.hint=t?.hint;}},b=class extends p{constructor(r,t){super(r,{exitCode:2,hint:t?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},f=class extends Error{cause;constructor(r,t){super(r),this.name="CliInternalError",this.cause=t;}};function v(i){if(i instanceof b||i instanceof p)return i;let r=k(i)&&k(i.response)?i.response:void 0,t=r?.errors,e=Array.isArray(t)?t[0]:void 0,g=(k(e)&&k(e.extensions)?e.extensions:void 0)?.code,A=r?.status;return g==="UNAUTHENTICATED"||A===401?new b("Authentication required."):g==="FORBIDDEN"||A===403?new p("Permission denied."):g==="BAD_USER_INPUT"||g==="GRAPHQL_VALIDATION_FAILED"||A===400?new p("Invalid request. Check the command arguments."):g==="NOT_FOUND"||A===404?new p("Requested resource was not found."):g==="RATE_LIMITED"||g==="TOO_MANY_REQUESTS"||A===429?new p("Request limit reached. Try again later."):new f("The request could not be completed. Try again later.")}var E=class extends Error{response;constructor(r,t){super(r),this.name="GqlRequestError",this.response=t;}};function k(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}var S=null;function O(i){S=i;}function w(){if(!S)throw new f("vibecontrols module helpers used before setHelpersContext was called");return S}function Wt(){let i=w();if(!i.auth.isAuthenticated())throw new b("Authentication required.",{hint:`Run \`${i.productName} auth login\` to authenticate.`})}async function a(i,r){return Wt(),w().gql.workspace.request(i,r)}async function R(i,r){return w().gql.workspaceAuthOnly.request(i,r)}function o(i){throw i instanceof b||i instanceof p||i instanceof f?i:i instanceof E||i!==null&&typeof i=="object"&&"response"in i?v(i):new f("The command could not be completed. Try again later.")}function s(i,r,t){w().output.formatAndOutput(i,r,t);}function u(i){w().output.printSuccess(i);}function h(i){return w().output.formatDate(i)}function c(i,r){return w().output.truncate(i,r)}var L=`
|
|
2
2
|
query SubGetProvider($id: ID!) {
|
|
3
3
|
subProvider(id: $id) {
|
|
4
4
|
id name slug description category status industry language region
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
`,
|
|
12
|
+
`,P=`
|
|
13
13
|
query SubListProviders(
|
|
14
14
|
$category: SubProviderCategory
|
|
15
15
|
$search: String
|
|
@@ -29,25 +29,25 @@
|
|
|
29
29
|
pageInfo { cursor hasMore }
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
`,
|
|
32
|
+
`,D=`
|
|
33
33
|
mutation SubCreateProvider($input: SubCreateProviderInput!) {
|
|
34
34
|
subCreateProvider(input: $input) {
|
|
35
35
|
id name slug description category status industry language region
|
|
36
36
|
websiteUrl tags createdAt
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
`,$=`
|
|
40
40
|
mutation SubUpdateProvider($id: ID!, $input: SubUpdateProviderInput!) {
|
|
41
41
|
subUpdateProvider(id: $id, input: $input) {
|
|
42
42
|
id name slug description category status industry language region
|
|
43
43
|
websiteUrl tags churnRiskScore vendorHealthScore updatedAt
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
`,
|
|
46
|
+
`,N=`
|
|
47
47
|
mutation SubArchiveProvider($id: ID!) {
|
|
48
48
|
subArchiveProvider(id: $id)
|
|
49
49
|
}
|
|
50
|
-
`,
|
|
50
|
+
`,q=`
|
|
51
51
|
query SubListPlans($providerId: ID) {
|
|
52
52
|
subListPlans(providerId: $providerId) {
|
|
53
53
|
items {
|
|
@@ -57,14 +57,14 @@
|
|
|
57
57
|
pageInfo { cursor hasMore }
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
`,
|
|
60
|
+
`,_=`
|
|
61
61
|
mutation SubCreatePlan($input: SubCreatePlanInput!) {
|
|
62
62
|
subCreatePlan(input: $input) {
|
|
63
63
|
id providerId name description amount currency interval features
|
|
64
64
|
isActive createdAt
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
`,M=`
|
|
68
68
|
query SubGetRelationship($id: ID!) {
|
|
69
69
|
subRelationship(id: $id) {
|
|
70
70
|
id ownerId label kind status providerId planId amount currency interval
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
renewalEvents { id eventType occursAt amount currency notified }
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
`,
|
|
80
|
+
`,U=`
|
|
81
81
|
query SubListRelationships(
|
|
82
82
|
$kind: SubRelationshipKind
|
|
83
83
|
$ownerId: ID
|
|
@@ -99,33 +99,33 @@
|
|
|
99
99
|
pageInfo { cursor hasMore }
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
`,
|
|
102
|
+
`,W=`
|
|
103
103
|
mutation SubCreateRelationship($input: SubCreateRelationshipInput!) {
|
|
104
104
|
subCreateRelationship(input: $input) {
|
|
105
105
|
id ownerId label kind status providerId planId amount currency interval
|
|
106
106
|
autoRenew discoverySource startedAt renewsAt trialEndsAt tags createdAt
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
`,
|
|
109
|
+
`,F=`
|
|
110
110
|
mutation SubUpdateRelationship($id: ID!, $input: SubUpdateRelationshipInput!) {
|
|
111
111
|
subUpdateRelationship(id: $id, input: $input) {
|
|
112
112
|
id ownerId label kind status providerId planId amount currency interval
|
|
113
113
|
autoRenew healthScore notes tags renewsAt startedAt trialEndsAt updatedAt
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
`,
|
|
116
|
+
`,G=`
|
|
117
117
|
mutation SubCancelRelationship($id: ID!) {
|
|
118
118
|
subCancelRelationship(id: $id) {
|
|
119
119
|
id label status cancelledAt updatedAt
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
`,
|
|
122
|
+
`,H=`
|
|
123
123
|
mutation SubTransitionRelationship($id: ID!, $status: SubRelationshipStatus!) {
|
|
124
124
|
subTransitionRelationship(id: $id, status: $status) {
|
|
125
125
|
id label status updatedAt
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
`,
|
|
128
|
+
`,V=`
|
|
129
129
|
query SubListRenewalEvents($relationshipId: ID, $upcomingOnly: Boolean) {
|
|
130
130
|
subListRenewalEvents(relationshipId: $relationshipId, upcomingOnly: $upcomingOnly) {
|
|
131
131
|
items {
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
pageInfo { cursor hasMore }
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
-
`,
|
|
138
|
+
`,j=`
|
|
139
139
|
query SubListAssets($relationshipId: ID!) {
|
|
140
140
|
subListAssets(relationshipId: $relationshipId) {
|
|
141
141
|
items {
|
|
@@ -145,14 +145,14 @@
|
|
|
145
145
|
pageInfo { cursor hasMore }
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
`,
|
|
148
|
+
`,B=`
|
|
149
149
|
mutation SubCreateAsset($input: SubCreateAssetInput!) {
|
|
150
150
|
subCreateAsset(input: $input) {
|
|
151
151
|
id relationshipId name type secretRef expiresAt createdAt
|
|
152
152
|
file { id }
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
`,
|
|
155
|
+
`,Y=`
|
|
156
156
|
query SubListEntitlements($relationshipId: ID!) {
|
|
157
157
|
subListEntitlements(relationshipId: $relationshipId) {
|
|
158
158
|
items {
|
|
@@ -162,13 +162,13 @@
|
|
|
162
162
|
pageInfo { cursor hasMore }
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
`,
|
|
165
|
+
`,K=`
|
|
166
166
|
mutation SubCreateEntitlement($input: SubCreateEntitlementInput!) {
|
|
167
167
|
subCreateEntitlement(input: $input) {
|
|
168
168
|
id relationshipId name description type quota unit used isActive createdAt
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
|
-
`,
|
|
171
|
+
`,z=`
|
|
172
172
|
query SubListInvoices(
|
|
173
173
|
$relationshipId: ID
|
|
174
174
|
$status: SubInvoiceStatus
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
pageInfo { cursor hasMore }
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
`,
|
|
185
|
+
`,J=`
|
|
186
186
|
mutation SubCreateInvoice($input: SubCreateInvoiceInput!) {
|
|
187
187
|
subCreateInvoice(input: $input) {
|
|
188
188
|
id relationshipId number status currency subtotal taxAmount total
|
|
@@ -190,13 +190,13 @@
|
|
|
190
190
|
file { id }
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
`,
|
|
193
|
+
`,Q=`
|
|
194
194
|
mutation SubMarkInvoicePaid($id: ID!) {
|
|
195
195
|
subMarkInvoicePaid(id: $id) {
|
|
196
196
|
id number status total paidAt updatedAt
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
`,
|
|
199
|
+
`,X=`
|
|
200
200
|
query SubListPaymentInstruments($ownerId: ID) {
|
|
201
201
|
subListPaymentInstruments(ownerId: $ownerId) {
|
|
202
202
|
items {
|
|
@@ -206,18 +206,18 @@
|
|
|
206
206
|
pageInfo { cursor hasMore }
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
`,
|
|
209
|
+
`,Z=`
|
|
210
210
|
mutation SubCreatePaymentInstrument($input: SubCreatePaymentInstrumentInput!) {
|
|
211
211
|
subCreatePaymentInstrument(input: $input) {
|
|
212
212
|
id ownerId label type status brand last4 expiryMonth expiryYear
|
|
213
213
|
isDefault createdAt
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
`,
|
|
216
|
+
`,tt=`
|
|
217
217
|
mutation SubRemovePaymentInstrument($id: ID!) {
|
|
218
218
|
subRemovePaymentInstrument(id: $id)
|
|
219
219
|
}
|
|
220
|
-
`,
|
|
220
|
+
`,et=`
|
|
221
221
|
query SubListChannels($ownerId: ID) {
|
|
222
222
|
subListChannels(ownerId: $ownerId) {
|
|
223
223
|
items {
|
|
@@ -227,19 +227,19 @@
|
|
|
227
227
|
pageInfo { cursor hasMore }
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
|
-
`,
|
|
230
|
+
`,nt=`
|
|
231
231
|
mutation SubCreateChannel($input: SubCreateChannelInput!) {
|
|
232
232
|
subCreateChannel(input: $input) {
|
|
233
233
|
id ownerId type address label status ingestEnabled createdAt
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
`,
|
|
236
|
+
`,rt=`
|
|
237
237
|
mutation SubVerifyChannel($id: ID!) {
|
|
238
238
|
subVerifyChannel(id: $id) {
|
|
239
239
|
id type address status verifiedAt updatedAt
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
|
-
`,
|
|
242
|
+
`,it=`
|
|
243
243
|
query SubListInboxMessages(
|
|
244
244
|
$category: SubMessageCategory
|
|
245
245
|
$channelId: ID
|
|
@@ -261,20 +261,20 @@
|
|
|
261
261
|
pageInfo { cursor hasMore }
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
`,
|
|
264
|
+
`,ot=`
|
|
265
265
|
mutation SubIngestMessage($input: SubIngestMessageInput!) {
|
|
266
266
|
subIngestMessage(input: $input) {
|
|
267
267
|
id channelId relationshipId category categoryConfidence subject preview
|
|
268
268
|
externalId isRead actionRequired receivedAt createdAt
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
|
-
`,
|
|
271
|
+
`,st=`
|
|
272
272
|
mutation SubMarkMessageRead($id: ID!) {
|
|
273
273
|
subMarkMessageRead(id: $id) {
|
|
274
274
|
id subject category isRead updatedAt
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
|
-
`,
|
|
277
|
+
`,at=`
|
|
278
278
|
query SubGetAgent($id: ID!) {
|
|
279
279
|
subAgent(id: $id) {
|
|
280
280
|
id ownerId name description kind status config lastRunAt
|
|
@@ -284,26 +284,26 @@
|
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
`,
|
|
287
|
+
`,ut=`
|
|
288
288
|
query SubListAgents($kind: SubAgentKind, $ownerId: ID, $status: SubAgentStatus) {
|
|
289
289
|
subListAgents(kind: $kind, ownerId: $ownerId, status: $status) {
|
|
290
290
|
items { id ownerId name description kind status lastRunAt createdAt }
|
|
291
291
|
pageInfo { cursor hasMore }
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
|
-
`,
|
|
294
|
+
`,ct=`
|
|
295
295
|
mutation SubCreateAgent($input: SubCreateAgentInput!) {
|
|
296
296
|
subCreateAgent(input: $input) {
|
|
297
297
|
id ownerId name description kind status config createdAt
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
|
-
`,
|
|
300
|
+
`,dt=`
|
|
301
301
|
mutation SubSetAgentStatus($id: ID!, $status: SubAgentStatus!) {
|
|
302
302
|
subSetAgentStatus(id: $id, status: $status) {
|
|
303
303
|
id name kind status updatedAt
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
`,
|
|
306
|
+
`,pt=`
|
|
307
307
|
query SubListPolicies($agentId: ID) {
|
|
308
308
|
subListPolicies(agentId: $agentId) {
|
|
309
309
|
items {
|
|
@@ -313,14 +313,14 @@
|
|
|
313
313
|
pageInfo { cursor hasMore }
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
|
-
`,
|
|
316
|
+
`,lt=`
|
|
317
317
|
mutation SubCreatePolicy($input: SubCreatePolicyInput!) {
|
|
318
318
|
subCreatePolicy(input: $input) {
|
|
319
319
|
id agentId name description action condition isEnabled triggerCount
|
|
320
320
|
createdAt
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
|
-
`,
|
|
323
|
+
`,mt=`
|
|
324
324
|
query SubListWorkflows($status: SubWorkflowStatus) {
|
|
325
325
|
subListWorkflows(status: $status) {
|
|
326
326
|
items {
|
|
@@ -330,20 +330,20 @@
|
|
|
330
330
|
pageInfo { cursor hasMore }
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
|
-
`,
|
|
333
|
+
`,gt=`
|
|
334
334
|
mutation SubCreateWorkflow($input: SubCreateWorkflowInput!) {
|
|
335
335
|
subCreateWorkflow(input: $input) {
|
|
336
336
|
id name description triggerEvent steps status runCount createdAt
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
`,
|
|
339
|
+
`,ft=`
|
|
340
340
|
mutation SubActivateWorkflow($id: ID!) {
|
|
341
341
|
subActivateWorkflow(id: $id) {
|
|
342
342
|
id name status runCount lastRunAt updatedAt
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
|
-
`,
|
|
345
|
+
`,bt=`
|
|
346
346
|
query SubHealth {
|
|
347
347
|
subHealth
|
|
348
348
|
}
|
|
349
|
-
`;function y(i,r){try{return JSON.parse(r)}catch{throw new l(`--${i} must be valid JSON`)}}function p(i){let r=Number.parseInt(i,10);if(Number.isNaN(r))throw new l(`Expected an integer but got "${i}"`);return r}function f(i){let r=Number.parseFloat(i);if(Number.isNaN(r))throw new l(`Expected a number but got "${i}"`);return r}function b(i){return i.split(",").map(r=>r.trim()).filter(r=>r.length>0)}function mt(i){let r=i.command("providers").description("SubscriberBot provider registry (vendors / publishers / services)");r.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 a(x,{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}});s(t,e.subListProviders.items,{headers:["ID","Name","Category","Status","Region","Churn"],rows:e.subListProviders.items.map(n=>[c(n.id,12),n.name,n.category,n.status,n.region??"-",n.churnRiskScore!=null?String(n.churnRiskScore):"-"])});}catch(e){o(e);}}),r.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 a(R,{id:t});if(!n.subProvider)throw new l(`Provider ${t} not found`);s(e,n.subProvider);}catch(n){o(n);}}),r.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=b(t.tags));let n=await a(T,{input:e});u(`Provider created: ${n.subCreateProvider.name}`),s(t,n.subCreateProvider);}catch(e){o(e);}}),r.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=b(e.tags)),!Object.keys(n).length)throw new l("No updates specified");let C=await a(O,{id:t,input:n});u("Provider updated"),s(e,C.subUpdateProvider);}catch(n){o(n);}}),r.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 a(L,{id:t});u(`Provider ${t} archived`),s(e,{archived:n.subArchiveProvider});}catch(n){o(n);}});}function gt(i){let r=i.command("plans").description("SubscriberBot provider plans");r.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 a(P,{providerId:t.provider});s(t,e.subListPlans.items,{headers:["ID","Name","Amount","Currency","Interval","Active"],rows:e.subListPlans.items.map(n=>[c(n.id,12),n.name,String(n.amount),n.currency,n.interval,n.isActive?"yes":"no"])});}catch(e){o(e);}}),r.command("create").description("Create a plan for a provider").requiredOption("--provider <id>","Provider ID").requiredOption("--name <name>","Plan name").option("--amount <n>","Amount",f).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=b(t.features));let n=await a(D,{input:e});u(`Plan created: ${n.subCreatePlan.name}`),s(t,n.subCreatePlan);}catch(e){o(e);}});}function ft(i){let r=i.command("relationships").description("SubscriberBot subscriptions, memberships & recurring relationships");r.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 a(N,{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}});s(t,e.subListRelationships.items,{headers:["ID","Label","Kind","Status","Amount","Renews"],rows:e.subListRelationships.items.map(n=>[c(n.id,12),n.label,n.kind,n.status,`${n.amount} ${n.currency}`,g(n.renewsAt)])});}catch(e){o(e);}}),r.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 a($,{id:t});if(!n.subRelationship)throw new l(`Relationship ${t} not found`);s(e,n.subRelationship);}catch(n){o(n);}}),r.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",f).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=b(t.tags)),t.startedAt&&(e.startedAt=t.startedAt),t.renewsAt&&(e.renewsAt=t.renewsAt),t.trialEndsAt&&(e.trialEndsAt=t.trialEndsAt);let n=await a(q,{input:e});u(`Relationship created: ${n.subCreateRelationship.label}`),s(t,n.subCreateRelationship);}catch(e){o(e);}}),r.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",f).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=b(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 l("No updates specified");let C=await a(_,{id:t,input:n});u("Relationship updated"),s(e,C.subUpdateRelationship);}catch(n){o(n);}}),r.command("cancel").description("Cancel a relationship").argument("<id>","Relationship ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(M,{id:t});u(`Relationship cancelled: ${n.subCancelRelationship.label}`),s(e,n.subCancelRelationship);}catch(n){o(n);}}),r.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 a(U,{id:t,status:e.status.toUpperCase()});u(`Relationship status set to ${n.subTransitionRelationship.status}`),s(e,n.subTransitionRelationship);}catch(n){o(n);}}),r.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 a(W,{relationshipId:t.relationship,upcomingOnly:t.upcomingOnly?!0:void 0});s(t,e.subListRenewalEvents.items,{headers:["ID","Relationship","Type","Amount","Occurs","Notified"],rows:e.subListRenewalEvents.items.map(n=>[c(n.id,12),c(n.relationshipId,12),n.eventType,n.amount!=null?`${n.amount} ${n.currency??""}`.trim():"-",g(n.occursAt),n.notified?"yes":"no"])});}catch(e){o(e);}});}function bt(i){let r=i.command("assets").description("SubscriberBot relationship assets (contracts, licenses, credentials, \u2026)");r.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 a(F,{relationshipId:t.relationship});s(t,e.subListAssets.items,{headers:["ID","Name","Type","Secret","Expires"],rows:e.subListAssets.items.map(n=>[c(n.id,12),n.name,n.type,n.secretRef?"yes":"no",g(n.expiresAt)])});}catch(e){o(e);}}),r.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 a(G,{input:e});u(`Asset created: ${n.subCreateAsset.name}`),s(t,n.subCreateAsset);}catch(e){o(e);}});}function ht(i){let r=i.command("entitlements").description("SubscriberBot relationship entitlements (seats, quotas, features, \u2026)");r.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 a(H,{relationshipId:t.relationship});s(t,e.subListEntitlements.items,{headers:["ID","Name","Type","Used","Quota","Active"],rows:e.subListEntitlements.items.map(n=>[c(n.id,12),n.name,n.type,String(n.used),n.quota!=null?String(n.quota):"-",n.isActive?"yes":"no"])});}catch(e){o(e);}}),r.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 a(V,{input:e});u(`Entitlement created: ${n.subCreateEntitlement.name}`),s(t,n.subCreateEntitlement);}catch(e){o(e);}});}function It(i){let r=i.command("invoices").description("SubscriberBot invoices");r.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 a(j,{relationshipId:t.relationship,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});s(t,e.subListInvoices.items,{headers:["ID","Number","Status","Total","Currency","Due"],rows:e.subListInvoices.items.map(n=>[c(n.id,12),n.number??"-",n.status,String(n.total),n.currency,g(n.dueDate)])});}catch(e){o(e);}}),r.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",f).option("--tax-amount <n>","Tax amount",f).option("--total <n>","Total",f).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 a(B,{input:e});u(`Invoice created: ${n.subCreateInvoice.number??n.subCreateInvoice.id}`),s(t,n.subCreateInvoice);}catch(e){o(e);}}),r.command("mark-paid").description("Mark an invoice as paid").argument("<id>","Invoice ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(Y,{id:t});u(`Invoice marked paid: ${n.subMarkInvoicePaid.number??n.subMarkInvoicePaid.id}`),s(e,n.subMarkInvoicePaid);}catch(n){o(n);}});}function yt(i){let r=i.command("payment-instruments").description("SubscriberBot payment instruments (cards, wallets, bank accounts, \u2026)");r.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 a(K,{ownerId:t.owner});s(t,e.subListPaymentInstruments.items,{headers:["ID","Label","Type","Status","Brand","Last4","Default"],rows:e.subListPaymentInstruments.items.map(n=>[c(n.id,12),n.label,n.type,n.status,n.brand??"-",n.last4??"-",n.isDefault?"yes":"no"])});}catch(e){o(e);}}),r.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 a(z,{input:e});u(`Payment instrument added: ${n.subCreatePaymentInstrument.label}`),s(t,n.subCreatePaymentInstrument);}catch(e){o(e);}}),r.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 a(J,{id:t});u(`Payment instrument ${t} removed`),s(e,{removed:n.subRemovePaymentInstrument});}catch(n){o(n);}});}function wt(i){let r=i.command("channels").description("SubscriberBot communication channels (email, sms, slack, webhook, \u2026)");r.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 a(Q,{ownerId:t.owner});s(t,e.subListChannels.items,{headers:["ID","Type","Address","Label","Status","Ingest"],rows:e.subListChannels.items.map(n=>[c(n.id,12),n.type,n.address,n.label??"-",n.status,n.ingestEnabled?"yes":"no"])});}catch(e){o(e);}}),r.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 a(X,{input:e});u(`Channel created: ${n.subCreateChannel.address}`),s(t,n.subCreateChannel);}catch(e){o(e);}}),r.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 a(Z,{id:t});u(`Channel verified: ${n.subVerifyChannel.address}`),s(e,n.subVerifyChannel);}catch(n){o(n);}});}function Ct(i){let r=i.command("inbox").description("SubscriberBot universal inbox (merged subscription communications)");r.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 a(tt,{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}});s(t,e.subListInboxMessages.items,{headers:["ID","Subject","Category","Read","Action","Received"],rows:e.subListInboxMessages.items.map(n=>[c(n.id,12),c(n.subject??"-",30),n.category,n.isRead?"yes":"no",n.actionRequired?"yes":"no",g(n.receivedAt)])});}catch(e){o(e);}}),r.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 a(et,{input:e});u(`Message ingested: ${n.subIngestMessage.id}`),s(t,n.subIngestMessage);}catch(e){o(e);}}),r.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 a(nt,{id:t});u(`Message ${t} marked read`),s(e,n.subMarkMessageRead);}catch(n){o(n);}});}function At(i){let r=i.command("agents").description("SubscriberBot AI agents & their automation policies");r.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 a(it,{kind:t.kind?t.kind.toUpperCase():void 0,ownerId:t.owner,status:t.status?t.status.toUpperCase():void 0});s(t,e.subListAgents.items,{headers:["ID","Name","Kind","Status","Description"],rows:e.subListAgents.items.map(n=>[c(n.id,12),n.name,n.kind,n.status,c(n.description??"-",30)])});}catch(e){o(e);}}),r.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 a(rt,{id:t});if(!n.subAgent)throw new l(`Agent ${t} not found`);s(e,n.subAgent);}catch(n){o(n);}}),r.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 a(ot,{input:e});u(`Agent created: ${n.subCreateAgent.name}`),s(t,n.subCreateAgent);}catch(e){o(e);}}),r.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 a(st,{id:t,status:e.status.toUpperCase()});u(`Agent status set to ${n.subSetAgentStatus.status}`),s(e,n.subSetAgentStatus);}catch(n){o(n);}}),r.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 a(at,{agentId:t.agent});s(t,e.subListPolicies.items,{headers:["ID","Name","Action","Enabled","Triggers"],rows:e.subListPolicies.items.map(n=>[c(n.id,12),n.name,n.action,n.isEnabled?"yes":"no",String(n.triggerCount??0)])});}catch(e){o(e);}}),r.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 a(ut,{input:e});u(`Policy created: ${n.subCreatePolicy.name}`),s(t,n.subCreatePolicy);}catch(e){o(e);}});}function kt(i){let r=i.command("workflows").description("SubscriberBot automation workflows");r.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 a(ct,{status:t.status?t.status.toUpperCase():void 0});s(t,e.subListWorkflows.items,{headers:["ID","Name","Trigger","Status","Runs"],rows:e.subListWorkflows.items.map(n=>[c(n.id,12),n.name,n.triggerEvent,n.status,String(n.runCount??0)])});}catch(e){o(e);}}),r.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 a(dt,{input:e});u(`Workflow created: ${n.subCreateWorkflow.name}`),s(t,n.subCreateWorkflow);}catch(e){o(e);}}),r.command("activate").description("Activate a workflow").argument("<id>","Workflow ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(pt,{id:t});u(`Workflow activated: ${n.subActivateWorkflow.name}`),s(e,n.subActivateWorkflow);}catch(n){o(n);}});}function vt(i){i.command("health").description("SubscriberBot service health check (public)").option("-f, --format <format>","Output format").action(async r=>{try{let t=await k(lt);u(t.subHealth),s(r,{health:t.subHealth});}catch(t){o(t);}});}var _t={id:"subscriberbot",version:"1.0.0",displayName:"SubscriberBot",dependsOn:["auth","workspaces"],register(i,r){S(r);let t=i.command("subscriberbot").description("SubscriberBot universal subscription & relationship management");mt(t),gt(t),ft(t),bt(t),ht(t),It(t),yt(t),wt(t),Ct(t),At(t),kt(t),vt(t);}},Vn=_t;module.exports=Vn;
|
|
349
|
+
`;function C(i,r){try{return JSON.parse(r)}catch{throw new p(`--${i} must be valid JSON`)}}function l(i){let r=Number.parseInt(i,10);if(Number.isNaN(r))throw new p(`Expected an integer but got "${i}"`);return r}function I(i){let r=Number.parseFloat(i);if(Number.isNaN(r))throw new p(`Expected a number but got "${i}"`);return r}function y(i){return i.split(",").map(r=>r.trim()).filter(r=>r.length>0)}function ht(i){let r=i.command("providers").description("SubscriberBot provider registry (vendors / publishers / services)");r.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",l,50).option("--offset <n>","Offset",l,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(P,{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}});s(t,e.subListProviders.items,{headers:["ID","Name","Category","Status","Region","Churn"],rows:e.subListProviders.items.map(n=>[c(n.id,12),n.name,n.category,n.status,n.region??"-",n.churnRiskScore!=null?String(n.churnRiskScore):"-"])});}catch(e){o(e);}}),r.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 a(L,{id:t});if(!n.subProvider)throw new p(`Provider ${t} not found`);s(e,n.subProvider);}catch(n){o(n);}}),r.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=y(t.tags));let n=await a(D,{input:e});u(`Provider created: ${n.subCreateProvider.name}`),s(t,n.subCreateProvider);}catch(e){o(e);}}),r.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",l).option("--vendor-health-score <n>","Vendor health score",l).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=y(e.tags)),!Object.keys(n).length)throw new p("No updates specified");let g=await a($,{id:t,input:n});u("Provider updated"),s(e,g.subUpdateProvider);}catch(n){o(n);}}),r.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 a(N,{id:t});u(`Provider ${t} archived`),s(e,{archived:n.subArchiveProvider});}catch(n){o(n);}});}function It(i){let r=i.command("plans").description("SubscriberBot provider plans");r.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 a(q,{providerId:t.provider});s(t,e.subListPlans.items,{headers:["ID","Name","Amount","Currency","Interval","Active"],rows:e.subListPlans.items.map(n=>[c(n.id,12),n.name,String(n.amount),n.currency,n.interval,n.isActive?"yes":"no"])});}catch(e){o(e);}}),r.command("create").description("Create a plan for a provider").requiredOption("--provider <id>","Provider ID").requiredOption("--name <name>","Plan name").option("--amount <n>","Amount",I).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=y(t.features));let n=await a(_,{input:e});u(`Plan created: ${n.subCreatePlan.name}`),s(t,n.subCreatePlan);}catch(e){o(e);}});}function yt(i){let r=i.command("relationships").description("SubscriberBot subscriptions, memberships & recurring relationships");r.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",l,50).option("--offset <n>","Offset",l,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(U,{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}});s(t,e.subListRelationships.items,{headers:["ID","Label","Kind","Status","Amount","Renews"],rows:e.subListRelationships.items.map(n=>[c(n.id,12),n.label,n.kind,n.status,`${n.amount} ${n.currency}`,h(n.renewsAt)])});}catch(e){o(e);}}),r.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 a(M,{id:t});if(!n.subRelationship)throw new p(`Relationship ${t} not found`);s(e,n.subRelationship);}catch(n){o(n);}}),r.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",I).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=y(t.tags)),t.startedAt&&(e.startedAt=t.startedAt),t.renewsAt&&(e.renewsAt=t.renewsAt),t.trialEndsAt&&(e.trialEndsAt=t.trialEndsAt);let n=await a(W,{input:e});u(`Relationship created: ${n.subCreateRelationship.label}`),s(t,n.subCreateRelationship);}catch(e){o(e);}}),r.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",I).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",l).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=y(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 p("No updates specified");let g=await a(F,{id:t,input:n});u("Relationship updated"),s(e,g.subUpdateRelationship);}catch(n){o(n);}}),r.command("cancel").description("Cancel a relationship").argument("<id>","Relationship ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(G,{id:t});u(`Relationship cancelled: ${n.subCancelRelationship.label}`),s(e,n.subCancelRelationship);}catch(n){o(n);}}),r.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 a(H,{id:t,status:e.status.toUpperCase()});u(`Relationship status set to ${n.subTransitionRelationship.status}`),s(e,n.subTransitionRelationship);}catch(n){o(n);}}),r.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 a(V,{relationshipId:t.relationship,upcomingOnly:t.upcomingOnly?!0:void 0});s(t,e.subListRenewalEvents.items,{headers:["ID","Relationship","Type","Amount","Occurs","Notified"],rows:e.subListRenewalEvents.items.map(n=>[c(n.id,12),c(n.relationshipId,12),n.eventType,n.amount!=null?`${n.amount} ${n.currency??""}`.trim():"-",h(n.occursAt),n.notified?"yes":"no"])});}catch(e){o(e);}});}function wt(i){let r=i.command("assets").description("SubscriberBot relationship assets (contracts, licenses, credentials, \u2026)");r.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 a(j,{relationshipId:t.relationship});s(t,e.subListAssets.items,{headers:["ID","Name","Type","Secret","Expires"],rows:e.subListAssets.items.map(n=>[c(n.id,12),n.name,n.type,n.secretRef?"yes":"no",h(n.expiresAt)])});}catch(e){o(e);}}),r.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 a(B,{input:e});u(`Asset created: ${n.subCreateAsset.name}`),s(t,n.subCreateAsset);}catch(e){o(e);}});}function Ct(i){let r=i.command("entitlements").description("SubscriberBot relationship entitlements (seats, quotas, features, \u2026)");r.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 a(Y,{relationshipId:t.relationship});s(t,e.subListEntitlements.items,{headers:["ID","Name","Type","Used","Quota","Active"],rows:e.subListEntitlements.items.map(n=>[c(n.id,12),n.name,n.type,String(n.used),n.quota!=null?String(n.quota):"-",n.isActive?"yes":"no"])});}catch(e){o(e);}}),r.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",l).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 a(K,{input:e});u(`Entitlement created: ${n.subCreateEntitlement.name}`),s(t,n.subCreateEntitlement);}catch(e){o(e);}});}function At(i){let r=i.command("invoices").description("SubscriberBot invoices");r.command("list").description("List invoices").option("--relationship <id>","Filter by relationship ID").option("--status <s>","Filter by invoice status").option("--limit <n>","Page size",l,50).option("--offset <n>","Offset",l,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(z,{relationshipId:t.relationship,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});s(t,e.subListInvoices.items,{headers:["ID","Number","Status","Total","Currency","Due"],rows:e.subListInvoices.items.map(n=>[c(n.id,12),n.number??"-",n.status,String(n.total),n.currency,h(n.dueDate)])});}catch(e){o(e);}}),r.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",I).option("--tax-amount <n>","Tax amount",I).option("--total <n>","Total",I).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=C("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 a(J,{input:e});u(`Invoice created: ${n.subCreateInvoice.number??n.subCreateInvoice.id}`),s(t,n.subCreateInvoice);}catch(e){o(e);}}),r.command("mark-paid").description("Mark an invoice as paid").argument("<id>","Invoice ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(Q,{id:t});u(`Invoice marked paid: ${n.subMarkInvoicePaid.number??n.subMarkInvoicePaid.id}`),s(e,n.subMarkInvoicePaid);}catch(n){o(n);}});}function Et(i){let r=i.command("payment-instruments").description("SubscriberBot payment instruments (cards, wallets, bank accounts, \u2026)");r.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 a(X,{ownerId:t.owner});s(t,e.subListPaymentInstruments.items,{headers:["ID","Label","Type","Status","Brand","Last4","Default"],rows:e.subListPaymentInstruments.items.map(n=>[c(n.id,12),n.label,n.type,n.status,n.brand??"-",n.last4??"-",n.isDefault?"yes":"no"])});}catch(e){o(e);}}),r.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",l).option("--expiry-year <n>","Expiry year",l).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 a(Z,{input:e});u(`Payment instrument added: ${n.subCreatePaymentInstrument.label}`),s(t,n.subCreatePaymentInstrument);}catch(e){o(e);}}),r.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 a(tt,{id:t});u(`Payment instrument ${t} removed`),s(e,{removed:n.subRemovePaymentInstrument});}catch(n){o(n);}});}function kt(i){let r=i.command("channels").description("SubscriberBot communication channels (email, sms, slack, webhook, \u2026)");r.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 a(et,{ownerId:t.owner});s(t,e.subListChannels.items,{headers:["ID","Type","Address","Label","Status","Ingest"],rows:e.subListChannels.items.map(n=>[c(n.id,12),n.type,n.address,n.label??"-",n.status,n.ingestEnabled?"yes":"no"])});}catch(e){o(e);}}),r.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 a(nt,{input:e});u(`Channel created: ${n.subCreateChannel.address}`),s(t,n.subCreateChannel);}catch(e){o(e);}}),r.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 a(rt,{id:t});u(`Channel verified: ${n.subVerifyChannel.address}`),s(e,n.subVerifyChannel);}catch(n){o(n);}});}function vt(i){let r=i.command("inbox").description("SubscriberBot universal inbox (merged subscription communications)");r.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",l,50).option("--offset <n>","Offset",l,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(it,{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}});s(t,e.subListInboxMessages.items,{headers:["ID","Subject","Category","Read","Action","Received"],rows:e.subListInboxMessages.items.map(n=>[c(n.id,12),c(n.subject??"-",30),n.category,n.isRead?"yes":"no",n.actionRequired?"yes":"no",h(n.receivedAt)])});}catch(e){o(e);}}),r.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)",l).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 a(ot,{input:e});u(`Message ingested: ${n.subIngestMessage.id}`),s(t,n.subIngestMessage);}catch(e){o(e);}}),r.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 a(st,{id:t});u(`Message ${t} marked read`),s(e,n.subMarkMessageRead);}catch(n){o(n);}});}function St(i){let r=i.command("agents").description("SubscriberBot AI agents & their automation policies");r.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 a(ut,{kind:t.kind?t.kind.toUpperCase():void 0,ownerId:t.owner,status:t.status?t.status.toUpperCase():void 0});s(t,e.subListAgents.items,{headers:["ID","Name","Kind","Status","Description"],rows:e.subListAgents.items.map(n=>[c(n.id,12),n.name,n.kind,n.status,c(n.description??"-",30)])});}catch(e){o(e);}}),r.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 a(at,{id:t});if(!n.subAgent)throw new p(`Agent ${t} not found`);s(e,n.subAgent);}catch(n){o(n);}}),r.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=C("config",t.config));let n=await a(ct,{input:e});u(`Agent created: ${n.subCreateAgent.name}`),s(t,n.subCreateAgent);}catch(e){o(e);}}),r.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 a(dt,{id:t,status:e.status.toUpperCase()});u(`Agent status set to ${n.subSetAgentStatus.status}`),s(e,n.subSetAgentStatus);}catch(n){o(n);}}),r.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 a(pt,{agentId:t.agent});s(t,e.subListPolicies.items,{headers:["ID","Name","Action","Enabled","Triggers"],rows:e.subListPolicies.items.map(n=>[c(n.id,12),n.name,n.action,n.isEnabled?"yes":"no",String(n.triggerCount??0)])});}catch(e){o(e);}}),r.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=C("condition",t.condition));let n=await a(lt,{input:e});u(`Policy created: ${n.subCreatePolicy.name}`),s(t,n.subCreatePolicy);}catch(e){o(e);}});}function Rt(i){let r=i.command("workflows").description("SubscriberBot automation workflows");r.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 a(mt,{status:t.status?t.status.toUpperCase():void 0});s(t,e.subListWorkflows.items,{headers:["ID","Name","Trigger","Status","Runs"],rows:e.subListWorkflows.items.map(n=>[c(n.id,12),n.name,n.triggerEvent,n.status,String(n.runCount??0)])});}catch(e){o(e);}}),r.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=C("steps",t.steps));let n=await a(gt,{input:e});u(`Workflow created: ${n.subCreateWorkflow.name}`),s(t,n.subCreateWorkflow);}catch(e){o(e);}}),r.command("activate").description("Activate a workflow").argument("<id>","Workflow ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(ft,{id:t});u(`Workflow activated: ${n.subActivateWorkflow.name}`),s(e,n.subActivateWorkflow);}catch(n){o(n);}});}function xt(i){i.command("health").description("SubscriberBot service health check (public)").option("-f, --format <format>","Output format").action(async r=>{try{let t=await R(bt);u(t.subHealth),s(r,{health:t.subHealth});}catch(t){o(t);}});}var Ft={id:"subscriberbot",version:"1.0.0",displayName:"SubscriberBot",dependsOn:["auth","workspaces"],register(i,r){O(r);let t=i.command("subscriberbot").description("SubscriberBot universal subscription & relationship management");ht(t),It(t),yt(t),wt(t),Ct(t),At(t),Et(t),kt(t),vt(t),St(t),Rt(t),xt(t);}},Kn=Ft;module.exports=Kn;
|