@burdenoff/microfe-subscriberbot 2026.706.1 → 2026.706.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.
Files changed (38) hide show
  1. package/dist/subscriberbot/SubscriberBotRoutes.js +14 -6
  2. package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
  3. package/dist/subscriberbot/components/Modal.js +51 -0
  4. package/dist/subscriberbot/components/Modal.js.map +1 -0
  5. package/dist/subscriberbot/components/index.js +7 -0
  6. package/dist/subscriberbot/components/viz.js +196 -0
  7. package/dist/subscriberbot/components/viz.js.map +1 -0
  8. package/dist/subscriberbot/hooks/useSubscriberBotApi.js +364 -161
  9. package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
  10. package/dist/subscriberbot/pages/AssetVaultPage.js +182 -0
  11. package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -0
  12. package/dist/subscriberbot/pages/DashboardPage.js +272 -199
  13. package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
  14. package/dist/subscriberbot/pages/InboxPage.js +682 -126
  15. package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
  16. package/dist/subscriberbot/pages/InsightsPage.js +220 -0
  17. package/dist/subscriberbot/pages/InsightsPage.js.map +1 -0
  18. package/dist/subscriberbot/pages/InvoicesPage.js +592 -81
  19. package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
  20. package/dist/subscriberbot/pages/WorkflowsPage.js +344 -169
  21. package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
  22. package/dist/subscriberbot/pages/agents/AgentDetailPage.js +401 -116
  23. package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
  24. package/dist/subscriberbot/pages/agents/AgentsListPage.js +185 -93
  25. package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
  26. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +735 -135
  27. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
  28. package/dist/subscriberbot/pages/providers/ProviderNewPage.js +217 -153
  29. package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
  30. package/dist/subscriberbot/pages/providers/ProvidersListPage.js +216 -111
  31. package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
  32. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +902 -250
  33. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
  34. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +242 -192
  35. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
  36. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +174 -131
  37. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
  38. package/package.json +1 -1
@@ -1,11 +1,12 @@
1
1
  import { useSubscriberBot as e } from "../context/SubscriberBotContext.js";
2
2
  import "../context/index.js";
3
- import { useMutation as t, useQuery as n, useQueryClient as r } from "@tanstack/react-query";
4
- import { graphqlFetch as i } from "@burdenoff/fe-libs/shared/graphql";
5
- import { clearGraphqlFetchResponseCache as a } from "@burdenoff/fe-libs/shared/graphql/fetch";
3
+ import { useCallback as t, useState as n } from "react";
4
+ import { useMutation as r, useQuery as i, useQueryClient as a } from "@tanstack/react-query";
5
+ import { graphqlFetch as o } from "@burdenoff/fe-libs/shared/graphql";
6
+ import { clearGraphqlFetchResponseCache as s } from "@burdenoff/fe-libs/shared/graphql/fetch";
6
7
  //#region src/subscriberbot/hooks/useSubscriberBotApi.ts
7
- var o = async (e, t, n) => {
8
- let r = await i({
8
+ var c = async (e, t, n) => {
9
+ let r = await o({
9
10
  gateway: "workspace",
10
11
  baseUrl: n,
11
12
  query: e,
@@ -14,8 +15,8 @@ var o = async (e, t, n) => {
14
15
  });
15
16
  if (r.errors?.length) throw Error(r.errors[0]?.message ?? "GraphQL request failed");
16
17
  if (!r.data) throw Error("GraphQL response did not include data");
17
- return /^\s*mutation\b/.test(e) && a(), r.data;
18
- }, s = {
18
+ return /^\s*mutation\b/.test(e) && s(), r.data;
19
+ }, l = {
19
20
  relationships: ["subscriberbot", "relationships"],
20
21
  relationship: (e) => [
21
22
  "subscriberbot",
@@ -43,15 +44,16 @@ var o = async (e, t, n) => {
43
44
  renewals: ["subscriberbot", "renewals"],
44
45
  assets: ["subscriberbot", "assets"],
45
46
  entitlements: ["subscriberbot", "entitlements"]
46
- }, c = "\n id name slug category status description industry region language websiteUrl\n logoFileId tags churnRiskScore vendorHealthScore workspaceId createdAt updatedAt\n", l = "\n id name description providerId amount currency interval features isActive\n workspaceId createdAt updatedAt\n", u = "\n id label kind status amount currency interval autoRenew discoverySource notes\n tags healthScore ownerId providerId planId startedAt renewsAt trialEndsAt\n cancelledAt workspaceId createdAt updatedAt\n", d = "\n id subject preview category categoryConfidence channelId relationshipId\n externalId actionRequired isRead receivedAt workspaceId createdAt updatedAt\n", f = "\n id number relationshipId status currency subtotal taxAmount total issueDate\n dueDate paidAt paymentInstrumentId workspaceId createdAt updatedAt\n", p = "\n id name description kind status ownerId lastRunAt workspaceId createdAt updatedAt\n", m = "\n id name description triggerEvent status runCount lastRunAt workspaceId\n createdAt updatedAt\n", h = (t = {}) => {
47
- let { apiGatewayUrl: r } = e();
48
- return n({
49
- queryKey: [...s.relationships, t],
50
- queryFn: async () => (await o(`query SubRelationships(
47
+ }, u = "\n id name slug category status description industry region language websiteUrl\n logoFileId tags churnRiskScore vendorHealthScore workspaceId createdAt updatedAt\n", d = "\n id name description providerId amount currency interval features isActive\n workspaceId createdAt updatedAt\n", f = "\n id label kind status amount currency interval autoRenew discoverySource notes\n tags healthScore ownerId providerId planId startedAt renewsAt trialEndsAt\n cancelledAt workspaceId createdAt updatedAt\n", p = "\n id subject preview category categoryConfidence channelId relationshipId\n externalId actionRequired isRead receivedAt workspaceId createdAt updatedAt\n", m = "\n id number relationshipId status currency subtotal taxAmount total issueDate\n dueDate paidAt paymentInstrumentId workspaceId createdAt updatedAt\n", h = "\n id name description kind status ownerId lastRunAt workspaceId createdAt updatedAt\n", g = "\n id name description triggerEvent status runCount lastRunAt workspaceId\n createdAt updatedAt\n", _ = "\n id name description type relationshipId quota used unit isActive\n workspaceId createdAt updatedAt\n", v = "\n id name type relationshipId secretRef expiresAt workspaceId createdAt\n updatedAt file { id }\n", y = "\n id label type status brand last4 expiryMonth expiryYear isDefault ownerId\n workspaceId createdAt updatedAt\n", b = "\n id label type status address ingestEnabled ownerId verifiedAt workspaceId\n createdAt updatedAt\n", x = "\n id name description action agentId isEnabled triggerCount lastTriggeredAt\n workspaceId createdAt updatedAt\n", S = (t = {}) => {
48
+ let { apiGatewayUrl: n } = e();
49
+ return i({
50
+ queryKey: [...l.relationships, t],
51
+ queryFn: async () => (await c(`query SubRelationships(
51
52
  $kind: SubRelationshipKind
52
53
  $status: SubRelationshipStatus
53
54
  $providerId: ID
54
55
  $ownerId: ID
56
+ $search: String
55
57
  $pagination: PaginationInput
56
58
  ) {
57
59
  subListRelationships(
@@ -59,10 +61,11 @@ var o = async (e, t, n) => {
59
61
  status: $status
60
62
  providerId: $providerId
61
63
  ownerId: $ownerId
64
+ search: $search
62
65
  pagination: $pagination
63
66
  ) {
64
67
  items {
65
- ${u}
68
+ ${f}
66
69
  provider { id name category status logoFileId }
67
70
  plan { id name amount currency interval }
68
71
  }
@@ -73,22 +76,23 @@ var o = async (e, t, n) => {
73
76
  status: t.status,
74
77
  providerId: t.providerId,
75
78
  ownerId: t.ownerId,
79
+ search: t.search,
76
80
  pagination: t.pagination ?? {
77
81
  limit: 50,
78
82
  offset: 0
79
83
  }
80
- }, r)).subListRelationships
84
+ }, n)).subListRelationships
81
85
  });
82
- }, g = (t) => {
83
- let { apiGatewayUrl: r } = e();
84
- return n({
85
- queryKey: s.relationship(t ?? ""),
86
+ }, C = (t) => {
87
+ let { apiGatewayUrl: n } = e();
88
+ return i({
89
+ queryKey: l.relationship(t ?? ""),
86
90
  enabled: !!t,
87
- queryFn: async () => (await o(`query SubRelationship($id: ID!) {
91
+ queryFn: async () => (await c(`query SubRelationship($id: ID!) {
88
92
  subRelationship(id: $id) {
89
- ${u}
90
- provider { ${c} }
91
- plan { ${l} }
93
+ ${f}
94
+ provider { ${u} }
95
+ plan { ${d} }
92
96
  entitlements {
93
97
  id name description type relationshipId quota used unit isActive
94
98
  workspaceId createdAt updatedAt
@@ -102,55 +106,143 @@ var o = async (e, t, n) => {
102
106
  notified workspaceId createdAt updatedAt
103
107
  }
104
108
  }
105
- }`, { id: t }, r)).subRelationship
106
- });
107
- }, _ = () => {
108
- let n = r(), { apiGatewayUrl: i } = e();
109
- return t({
110
- mutationFn: async (e) => (await o(`mutation SubCreateRelationship($input: SubCreateRelationshipInput!) {
111
- subCreateRelationship(input: $input) { ${u} }
112
- }`, { input: e }, i)).subCreateRelationship,
109
+ }`, { id: t }, n)).subRelationship
110
+ });
111
+ }, w = () => {
112
+ let t = a(), { apiGatewayUrl: n } = e();
113
+ return r({
114
+ mutationFn: async (e) => (await c(`mutation SubCreateRelationship($input: SubCreateRelationshipInput!) {
115
+ subCreateRelationship(input: $input) { ${f} }
116
+ }`, { input: e }, n)).subCreateRelationship,
113
117
  onSuccess: () => {
114
- n.invalidateQueries({ queryKey: s.relationships });
118
+ t.invalidateQueries({ queryKey: l.relationships });
115
119
  }
116
120
  });
117
- }, v = () => {
118
- let n = r(), { apiGatewayUrl: i } = e();
119
- return t({
120
- mutationFn: async ({ id: e, status: t }) => (await o(`mutation SubTransitionRelationship($id: ID!, $status: SubRelationshipStatus!) {
121
- subTransitionRelationship(id: $id, status: $status) { ${u} }
121
+ }, T = () => {
122
+ let t = a(), { apiGatewayUrl: n } = e();
123
+ return r({
124
+ mutationFn: async ({ id: e, status: t }) => (await c(`mutation SubTransitionRelationship($id: ID!, $status: SubRelationshipStatus!) {
125
+ subTransitionRelationship(id: $id, status: $status) { ${f} }
122
126
  }`, {
123
127
  id: e,
124
128
  status: t
125
- }, i)).subTransitionRelationship,
129
+ }, n)).subTransitionRelationship,
130
+ onSuccess: (e) => {
131
+ t.invalidateQueries({ queryKey: l.relationships }), t.invalidateQueries({ queryKey: l.relationship(e.id) });
132
+ }
133
+ });
134
+ }, E = () => {
135
+ let t = a(), { apiGatewayUrl: n } = e();
136
+ return r({
137
+ mutationFn: async (e) => (await c(`mutation SubCancelRelationship($id: ID!) {
138
+ subCancelRelationship(id: $id) { ${f} }
139
+ }`, { id: e }, n)).subCancelRelationship,
126
140
  onSuccess: (e) => {
127
- n.invalidateQueries({ queryKey: s.relationships }), n.invalidateQueries({ queryKey: s.relationship(e.id) });
141
+ t.invalidateQueries({ queryKey: l.relationships }), t.invalidateQueries({ queryKey: l.relationship(e.id) });
128
142
  }
129
143
  });
130
- }, y = () => {
131
- let n = r(), { apiGatewayUrl: i } = e();
132
- return t({
133
- mutationFn: async (e) => (await o(`mutation SubCancelRelationship($id: ID!) {
134
- subCancelRelationship(id: $id) { ${u} }
135
- }`, { id: e }, i)).subCancelRelationship,
144
+ }, D = () => {
145
+ let t = a(), { apiGatewayUrl: n } = e();
146
+ return r({
147
+ mutationFn: async ({ id: e, input: t }) => (await c(`mutation SubUpdateRelationship($id: ID!, $input: SubUpdateRelationshipInput!) {
148
+ subUpdateRelationship(id: $id, input: $input) { ${f} }
149
+ }`, {
150
+ id: e,
151
+ input: t
152
+ }, n)).subUpdateRelationship,
136
153
  onSuccess: (e) => {
137
- n.invalidateQueries({ queryKey: s.relationships }), n.invalidateQueries({ queryKey: s.relationship(e.id) });
154
+ t.invalidateQueries({ queryKey: l.relationships }), t.invalidateQueries({ queryKey: l.relationship(e.id) });
138
155
  }
139
156
  });
140
- }, b = (t = {}) => {
141
- let { apiGatewayUrl: r } = e();
142
- return n({
143
- queryKey: [...s.renewals, t],
144
- queryFn: async () => (await o("query SubRenewalEvents($relationshipId: ID, $upcomingOnly: Boolean) {\n subListRenewalEvents(relationshipId: $relationshipId, upcomingOnly: $upcomingOnly) {\n id relationshipId eventType occursAt amount currency detail notified\n workspaceId createdAt updatedAt\n }\n }", {
157
+ }, O = (t = {}) => {
158
+ let { apiGatewayUrl: n } = e();
159
+ return i({
160
+ queryKey: [...l.renewals, t],
161
+ queryFn: async () => (await c("query SubRenewalEvents($relationshipId: ID, $upcomingOnly: Boolean) {\n subListRenewalEvents(relationshipId: $relationshipId, upcomingOnly: $upcomingOnly) {\n id relationshipId eventType occursAt amount currency detail notified\n workspaceId createdAt updatedAt\n }\n }", {
145
162
  relationshipId: t.relationshipId,
146
163
  upcomingOnly: t.upcomingOnly
147
- }, r)).subListRenewalEvents
164
+ }, n)).subListRenewalEvents
165
+ });
166
+ }, k = () => {
167
+ let t = a(), { apiGatewayUrl: n } = e();
168
+ return r({
169
+ mutationFn: async (e) => (await c(`mutation SubCreateEntitlement($input: SubCreateEntitlementInput!) {
170
+ subCreateEntitlement(input: $input) { ${_} }
171
+ }`, { input: e }, n)).subCreateEntitlement,
172
+ onSuccess: (e) => {
173
+ t.invalidateQueries({ queryKey: l.entitlements }), t.invalidateQueries({ queryKey: l.relationship(e.relationshipId) });
174
+ }
148
175
  });
149
- }, x = (t = {}) => {
150
- let { apiGatewayUrl: r } = e();
151
- return n({
152
- queryKey: [...s.providers, t],
153
- queryFn: async () => (await o(`query SubProviders(
176
+ }, A = () => {
177
+ let { apiGatewayUrl: t } = e();
178
+ return i({
179
+ queryKey: [...l.assets, "all"],
180
+ queryFn: async () => (await c(`query SubAllAssets {
181
+ subListAssets { ${v} }
182
+ }`, {}, t)).subListAssets
183
+ });
184
+ }, j = () => {
185
+ let t = a(), { apiGatewayUrl: n } = e();
186
+ return r({
187
+ mutationFn: async (e) => (await c(`mutation SubCreateAsset($input: SubCreateAssetInput!) {
188
+ subCreateAsset(input: $input) { ${v} }
189
+ }`, { input: e }, n)).subCreateAsset,
190
+ onSuccess: (e) => {
191
+ t.invalidateQueries({ queryKey: l.assets }), t.invalidateQueries({ queryKey: l.relationship(e.relationshipId) });
192
+ }
193
+ });
194
+ }, M = "/SubscriberBot/Assets", N = () => {
195
+ let { apiGatewayUrl: r } = e(), [i, a] = n(0), [o, s] = n(!1);
196
+ return {
197
+ uploadFile: t(async (e) => {
198
+ s(!0), a(0);
199
+ try {
200
+ let t = (await c("mutation SubEnsureFolder($path: String!) {\n ensureFolderByPath(path: $path) { id }\n }", { path: M }, r)).ensureFolderByPath?.id;
201
+ if (!t) throw Error("Could not resolve the upload folder.");
202
+ let n = e.type || "application/octet-stream", i = e.name.lastIndexOf("."), o = i > -1 ? e.name.slice(i + 1) : "bin", s = await c("mutation SubInitiateUpload($input: InitiateUploadInput!) {\n initiateUpload(input: $input) {\n uploadUrl\n session { id }\n }\n }", { input: {
203
+ fileName: e.name,
204
+ extension: o,
205
+ mimeType: n,
206
+ fileSize: String(e.size),
207
+ folderId: t
208
+ } }, r), l = s.initiateUpload?.uploadUrl, u = s.initiateUpload?.session.id;
209
+ if (!l || !u) throw Error("The files service did not return an upload URL.");
210
+ await new Promise((t, r) => {
211
+ let i = new XMLHttpRequest();
212
+ i.open("PUT", l), i.setRequestHeader("Content-Type", n), i.upload.onprogress = (e) => {
213
+ e.lengthComputable && a(Math.round(e.loaded / e.total * 100));
214
+ }, i.onload = () => {
215
+ i.status >= 200 && i.status < 300 ? t() : r(/* @__PURE__ */ Error(`Upload to storage failed (${i.status}).`));
216
+ }, i.onerror = () => r(/* @__PURE__ */ Error("Upload to storage failed.")), i.send(e);
217
+ });
218
+ let d = await c("mutation SubCompleteUpload($input: CompleteUploadInput!) {\n completeUpload(input: $input) {\n fileId\n file { id name }\n }\n }", { input: {
219
+ sessionId: u,
220
+ fileSize: String(e.size),
221
+ folderId: t
222
+ } }, r), f = d.completeUpload?.file?.id ?? d.completeUpload?.fileId;
223
+ if (!f) throw Error("The upload could not be finalized.");
224
+ return {
225
+ fileId: f,
226
+ fileName: d.completeUpload?.file?.name ?? e.name
227
+ };
228
+ } finally {
229
+ s(!1);
230
+ }
231
+ }, [r]),
232
+ progress: i,
233
+ isUploading: o
234
+ };
235
+ }, P = () => {
236
+ let { apiGatewayUrl: n } = e();
237
+ return t(async (e) => (await c("query SubFileDownloadUrl($id: ID!, $expiresIn: Int) {\n getFileDownloadUrl(id: $id, expiresIn: $expiresIn)\n }", {
238
+ id: e,
239
+ expiresIn: 21600
240
+ }, n)).getFileDownloadUrl, [n]);
241
+ }, F = (t = {}) => {
242
+ let { apiGatewayUrl: n } = e();
243
+ return i({
244
+ queryKey: [...l.providers, t],
245
+ queryFn: async () => (await c(`query SubProviders(
154
246
  $category: SubProviderCategory
155
247
  $status: SubProviderStatus
156
248
  $search: String
@@ -162,7 +254,7 @@ var o = async (e, t, n) => {
162
254
  search: $search
163
255
  pagination: $pagination
164
256
  ) {
165
- items { ${c} }
257
+ items { ${u} }
166
258
  pageInfo { cursor hasMore }
167
259
  }
168
260
  }`, {
@@ -173,44 +265,75 @@ var o = async (e, t, n) => {
173
265
  limit: 50,
174
266
  offset: 0
175
267
  }
176
- }, r)).subListProviders
268
+ }, n)).subListProviders
177
269
  });
178
- }, S = (t) => {
179
- let { apiGatewayUrl: r } = e();
180
- return n({
181
- queryKey: s.provider(t ?? ""),
270
+ }, I = (t) => {
271
+ let { apiGatewayUrl: n } = e();
272
+ return i({
273
+ queryKey: l.provider(t ?? ""),
182
274
  enabled: !!t,
183
- queryFn: async () => (await o(`query SubProvider($id: ID!) {
275
+ queryFn: async () => (await c(`query SubProvider($id: ID!) {
184
276
  subProvider(id: $id) {
185
- ${c}
186
- plans { ${l} }
277
+ ${u}
278
+ plans { ${d} }
187
279
  }
188
- }`, { id: t }, r)).subProvider
189
- });
190
- }, C = () => {
191
- let n = r(), { apiGatewayUrl: i } = e();
192
- return t({
193
- mutationFn: async (e) => (await o(`mutation SubCreateProvider($input: SubCreateProviderInput!) {
194
- subCreateProvider(input: $input) { ${c} }
195
- }`, { input: e }, i)).subCreateProvider,
280
+ }`, { id: t }, n)).subProvider
281
+ });
282
+ }, L = () => {
283
+ let t = a(), { apiGatewayUrl: n } = e();
284
+ return r({
285
+ mutationFn: async (e) => (await c(`mutation SubCreateProvider($input: SubCreateProviderInput!) {
286
+ subCreateProvider(input: $input) { ${u} }
287
+ }`, { input: e }, n)).subCreateProvider,
288
+ onSuccess: () => {
289
+ t.invalidateQueries({ queryKey: l.providers });
290
+ }
291
+ });
292
+ }, R = () => {
293
+ let t = a(), { apiGatewayUrl: n } = e();
294
+ return r({
295
+ mutationFn: async ({ id: e, input: t }) => (await c(`mutation SubUpdateProvider($id: ID!, $input: SubUpdateProviderInput!) {
296
+ subUpdateProvider(id: $id, input: $input) { ${u} }
297
+ }`, {
298
+ id: e,
299
+ input: t
300
+ }, n)).subUpdateProvider,
301
+ onSuccess: (e) => {
302
+ t.invalidateQueries({ queryKey: l.providers }), t.invalidateQueries({ queryKey: l.provider(e.id) });
303
+ }
304
+ });
305
+ }, z = () => {
306
+ let t = a(), { apiGatewayUrl: n } = e();
307
+ return r({
308
+ mutationFn: async (e) => (await c("mutation SubArchiveProvider($id: ID!) {\n subArchiveProvider(id: $id)\n }", { id: e }, n)).subArchiveProvider,
196
309
  onSuccess: () => {
197
- n.invalidateQueries({ queryKey: s.providers });
310
+ t.invalidateQueries({ queryKey: l.providers });
198
311
  }
199
312
  });
200
- }, w = (t) => {
201
- let { apiGatewayUrl: r } = e();
202
- return n({
203
- queryKey: [...s.plans, t],
313
+ }, ee = (t) => {
314
+ let { apiGatewayUrl: n } = e();
315
+ return i({
316
+ queryKey: [...l.plans, t],
204
317
  enabled: !!t,
205
- queryFn: async () => (await o(`query SubPlans($providerId: ID) {
206
- subListPlans(providerId: $providerId) { ${l} }
207
- }`, { providerId: t }, r)).subListPlans
208
- });
209
- }, T = (t = {}) => {
210
- let { apiGatewayUrl: r } = e();
211
- return n({
212
- queryKey: [...s.inbox, t],
213
- queryFn: async () => (await o(`query SubInboxMessages(
318
+ queryFn: async () => (await c(`query SubPlans($providerId: ID) {
319
+ subListPlans(providerId: $providerId) { ${d} }
320
+ }`, { providerId: t }, n)).subListPlans
321
+ });
322
+ }, B = () => {
323
+ let t = a(), { apiGatewayUrl: n } = e();
324
+ return r({
325
+ mutationFn: async (e) => (await c(`mutation SubCreatePlan($input: SubCreatePlanInput!) {
326
+ subCreatePlan(input: $input) { ${d} }
327
+ }`, { input: e }, n)).subCreatePlan,
328
+ onSuccess: (e) => {
329
+ t.invalidateQueries({ queryKey: l.plans }), t.invalidateQueries({ queryKey: l.provider(e.providerId) });
330
+ }
331
+ });
332
+ }, V = (t = {}) => {
333
+ let { apiGatewayUrl: n } = e();
334
+ return i({
335
+ queryKey: [...l.inbox, t],
336
+ queryFn: async () => (await c(`query SubInboxMessages(
214
337
  $category: SubMessageCategory
215
338
  $channelId: ID
216
339
  $relationshipId: ID
@@ -224,7 +347,7 @@ var o = async (e, t, n) => {
224
347
  unreadOnly: $unreadOnly
225
348
  pagination: $pagination
226
349
  ) {
227
- items { ${d} }
350
+ items { ${p} }
228
351
  pageInfo { cursor hasMore }
229
352
  }
230
353
  }`, {
@@ -236,23 +359,33 @@ var o = async (e, t, n) => {
236
359
  limit: 50,
237
360
  offset: 0
238
361
  }
239
- }, r)).subListInboxMessages
362
+ }, n)).subListInboxMessages
240
363
  });
241
- }, E = () => {
242
- let n = r(), { apiGatewayUrl: i } = e();
243
- return t({
244
- mutationFn: async (e) => (await o(`mutation SubMarkMessageRead($id: ID!) {
245
- subMarkMessageRead(id: $id) { ${d} }
246
- }`, { id: e }, i)).subMarkMessageRead,
364
+ }, H = () => {
365
+ let t = a(), { apiGatewayUrl: n } = e();
366
+ return r({
367
+ mutationFn: async (e) => (await c(`mutation SubMarkMessageRead($id: ID!) {
368
+ subMarkMessageRead(id: $id) { ${p} }
369
+ }`, { id: e }, n)).subMarkMessageRead,
370
+ onSuccess: () => {
371
+ t.invalidateQueries({ queryKey: l.inbox });
372
+ }
373
+ });
374
+ }, U = () => {
375
+ let t = a(), { apiGatewayUrl: n } = e();
376
+ return r({
377
+ mutationFn: async (e) => (await c(`mutation SubIngestMessage($input: SubIngestMessageInput!) {
378
+ subIngestMessage(input: $input) { ${p} }
379
+ }`, { input: e }, n)).subIngestMessage,
247
380
  onSuccess: () => {
248
- n.invalidateQueries({ queryKey: s.inbox });
381
+ t.invalidateQueries({ queryKey: l.inbox });
249
382
  }
250
383
  });
251
- }, D = (t = {}) => {
252
- let { apiGatewayUrl: r } = e();
253
- return n({
254
- queryKey: [...s.invoices, t],
255
- queryFn: async () => (await o(`query SubInvoices(
384
+ }, W = (t = {}) => {
385
+ let { apiGatewayUrl: n } = e();
386
+ return i({
387
+ queryKey: [...l.invoices, t],
388
+ queryFn: async () => (await c(`query SubInvoices(
256
389
  $status: SubInvoiceStatus
257
390
  $relationshipId: ID
258
391
  $pagination: PaginationInput
@@ -262,7 +395,7 @@ var o = async (e, t, n) => {
262
395
  relationshipId: $relationshipId
263
396
  pagination: $pagination
264
397
  ) {
265
- items { ${f} }
398
+ items { ${m} }
266
399
  pageInfo { cursor hasMore }
267
400
  }
268
401
  }`, {
@@ -272,100 +405,170 @@ var o = async (e, t, n) => {
272
405
  limit: 50,
273
406
  offset: 0
274
407
  }
275
- }, r)).subListInvoices
276
- });
277
- }, O = () => {
278
- let n = r(), { apiGatewayUrl: i } = e();
279
- return t({
280
- mutationFn: async (e) => (await o(`mutation SubMarkInvoicePaid($id: ID!) {
281
- subMarkInvoicePaid(id: $id) { ${f} }
282
- }`, { id: e }, i)).subMarkInvoicePaid,
408
+ }, n)).subListInvoices
409
+ });
410
+ }, G = () => {
411
+ let t = a(), { apiGatewayUrl: n } = e();
412
+ return r({
413
+ mutationFn: async (e) => (await c(`mutation SubMarkInvoicePaid($id: ID!) {
414
+ subMarkInvoicePaid(id: $id) { ${m} }
415
+ }`, { id: e }, n)).subMarkInvoicePaid,
416
+ onSuccess: () => {
417
+ t.invalidateQueries({ queryKey: l.invoices });
418
+ }
419
+ });
420
+ }, K = () => {
421
+ let t = a(), { apiGatewayUrl: n } = e();
422
+ return r({
423
+ mutationFn: async (e) => (await c(`mutation SubCreateInvoice($input: SubCreateInvoiceInput!) {
424
+ subCreateInvoice(input: $input) { ${m} }
425
+ }`, { input: e }, n)).subCreateInvoice,
426
+ onSuccess: () => {
427
+ t.invalidateQueries({ queryKey: l.invoices });
428
+ }
429
+ });
430
+ }, q = (t) => {
431
+ let { apiGatewayUrl: n } = e();
432
+ return i({
433
+ queryKey: [...l.paymentInstruments, t],
434
+ queryFn: async () => (await c("query SubPaymentInstruments($ownerId: ID) {\n subListPaymentInstruments(ownerId: $ownerId) {\n id label type status brand last4 expiryMonth expiryYear isDefault\n ownerId workspaceId createdAt updatedAt\n }\n }", { ownerId: t }, n)).subListPaymentInstruments
435
+ });
436
+ }, J = () => {
437
+ let t = a(), { apiGatewayUrl: n } = e();
438
+ return r({
439
+ mutationFn: async (e) => (await c(`mutation SubCreatePaymentInstrument($input: SubCreatePaymentInstrumentInput!) {
440
+ subCreatePaymentInstrument(input: $input) { ${y} }
441
+ }`, { input: e }, n)).subCreatePaymentInstrument,
283
442
  onSuccess: () => {
284
- n.invalidateQueries({ queryKey: s.invoices });
443
+ t.invalidateQueries({ queryKey: l.paymentInstruments });
285
444
  }
286
445
  });
287
- }, k = (t = {}) => {
288
- let { apiGatewayUrl: r } = e();
289
- return n({
290
- queryKey: [...s.agents, t],
291
- queryFn: async () => (await o(`query SubAgents($kind: SubAgentKind, $status: SubAgentStatus, $ownerId: ID) {
446
+ }, Y = () => {
447
+ let t = a(), { apiGatewayUrl: n } = e();
448
+ return r({
449
+ mutationFn: async (e) => (await c("mutation SubRemovePaymentInstrument($id: ID!) {\n subRemovePaymentInstrument(id: $id)\n }", { id: e }, n)).subRemovePaymentInstrument,
450
+ onSuccess: () => {
451
+ t.invalidateQueries({ queryKey: l.paymentInstruments });
452
+ }
453
+ });
454
+ }, X = (t) => {
455
+ let { apiGatewayUrl: n } = e();
456
+ return i({
457
+ queryKey: [...l.channels, t],
458
+ queryFn: async () => (await c("query SubChannels($ownerId: ID) {\n subListChannels(ownerId: $ownerId) {\n id label type status address ingestEnabled ownerId verifiedAt\n workspaceId createdAt updatedAt\n }\n }", { ownerId: t }, n)).subListChannels
459
+ });
460
+ }, Z = () => {
461
+ let t = a(), { apiGatewayUrl: n } = e();
462
+ return r({
463
+ mutationFn: async (e) => (await c(`mutation SubCreateChannel($input: SubCreateChannelInput!) {
464
+ subCreateChannel(input: $input) { ${b} }
465
+ }`, { input: e }, n)).subCreateChannel,
466
+ onSuccess: () => {
467
+ t.invalidateQueries({ queryKey: l.channels });
468
+ }
469
+ });
470
+ }, Q = () => {
471
+ let t = a(), { apiGatewayUrl: n } = e();
472
+ return r({
473
+ mutationFn: async (e) => (await c(`mutation SubVerifyChannel($id: ID!) {
474
+ subVerifyChannel(id: $id) { ${b} }
475
+ }`, { id: e }, n)).subVerifyChannel,
476
+ onSuccess: () => {
477
+ t.invalidateQueries({ queryKey: l.channels });
478
+ }
479
+ });
480
+ }, $ = (t = {}) => {
481
+ let { apiGatewayUrl: n } = e();
482
+ return i({
483
+ queryKey: [...l.agents, t],
484
+ queryFn: async () => (await c(`query SubAgents($kind: SubAgentKind, $status: SubAgentStatus, $ownerId: ID) {
292
485
  subListAgents(kind: $kind, status: $status, ownerId: $ownerId) {
293
- ${p}
486
+ ${h}
294
487
  }
295
488
  }`, {
296
489
  kind: t.kind,
297
490
  status: t.status,
298
491
  ownerId: t.ownerId
299
- }, r)).subListAgents
492
+ }, n)).subListAgents
300
493
  });
301
- }, A = (t) => {
302
- let { apiGatewayUrl: r } = e();
303
- return n({
304
- queryKey: s.agent(t ?? ""),
494
+ }, te = (t) => {
495
+ let { apiGatewayUrl: n } = e();
496
+ return i({
497
+ queryKey: l.agent(t ?? ""),
305
498
  enabled: !!t,
306
- queryFn: async () => (await o(`query SubAgent($id: ID!) {
499
+ queryFn: async () => (await c(`query SubAgent($id: ID!) {
307
500
  subAgent(id: $id) {
308
- ${p}
501
+ ${h}
309
502
  policies {
310
503
  id name description action agentId isEnabled triggerCount
311
504
  lastTriggeredAt workspaceId createdAt updatedAt
312
505
  }
313
506
  }
314
- }`, { id: t }, r)).subAgent
507
+ }`, { id: t }, n)).subAgent
315
508
  });
316
- }, j = () => {
317
- let n = r(), { apiGatewayUrl: i } = e();
318
- return t({
319
- mutationFn: async (e) => (await o(`mutation SubCreateAgent($input: SubCreateAgentInput!) {
320
- subCreateAgent(input: $input) { ${p} }
321
- }`, { input: e }, i)).subCreateAgent,
509
+ }, ne = () => {
510
+ let t = a(), { apiGatewayUrl: n } = e();
511
+ return r({
512
+ mutationFn: async (e) => (await c(`mutation SubCreateAgent($input: SubCreateAgentInput!) {
513
+ subCreateAgent(input: $input) { ${h} }
514
+ }`, { input: e }, n)).subCreateAgent,
322
515
  onSuccess: () => {
323
- n.invalidateQueries({ queryKey: s.agents });
516
+ t.invalidateQueries({ queryKey: l.agents });
324
517
  }
325
518
  });
326
- }, M = () => {
327
- let n = r(), { apiGatewayUrl: i } = e();
328
- return t({
329
- mutationFn: async ({ id: e, status: t }) => (await o(`mutation SubSetAgentStatus($id: ID!, $status: SubAgentStatus!) {
330
- subSetAgentStatus(id: $id, status: $status) { ${p} }
519
+ }, re = () => {
520
+ let t = a(), { apiGatewayUrl: n } = e();
521
+ return r({
522
+ mutationFn: async ({ id: e, status: t }) => (await c(`mutation SubSetAgentStatus($id: ID!, $status: SubAgentStatus!) {
523
+ subSetAgentStatus(id: $id, status: $status) { ${h} }
331
524
  }`, {
332
525
  id: e,
333
526
  status: t
334
- }, i)).subSetAgentStatus,
527
+ }, n)).subSetAgentStatus,
335
528
  onSuccess: (e) => {
336
- n.invalidateQueries({ queryKey: s.agents }), n.invalidateQueries({ queryKey: s.agent(e.id) });
529
+ t.invalidateQueries({ queryKey: l.agents }), t.invalidateQueries({ queryKey: l.agent(e.id) });
337
530
  }
338
531
  });
339
- }, N = (t) => {
340
- let { apiGatewayUrl: r } = e();
341
- return n({
342
- queryKey: [...s.workflows, t],
343
- queryFn: async () => (await o(`query SubWorkflows($status: SubWorkflowStatus) {
344
- subListWorkflows(status: $status) { ${m} }
345
- }`, { status: t }, r)).subListWorkflows
532
+ }, ie = () => {
533
+ let t = a(), { apiGatewayUrl: n } = e();
534
+ return r({
535
+ mutationFn: async (e) => (await c(`mutation SubCreatePolicy($input: SubCreatePolicyInput!) {
536
+ subCreatePolicy(input: $input) { ${x} }
537
+ }`, { input: e }, n)).subCreatePolicy,
538
+ onSuccess: (e) => {
539
+ t.invalidateQueries({ queryKey: l.agents }), t.invalidateQueries({ queryKey: l.agent(e.agentId) });
540
+ }
346
541
  });
347
- }, P = () => {
348
- let n = r(), { apiGatewayUrl: i } = e();
349
- return t({
350
- mutationFn: async (e) => (await o(`mutation SubCreateWorkflow($input: SubCreateWorkflowInput!) {
351
- subCreateWorkflow(input: $input) { ${m} }
352
- }`, { input: e }, i)).subCreateWorkflow,
542
+ }, ae = (t) => {
543
+ let { apiGatewayUrl: n } = e();
544
+ return i({
545
+ queryKey: [...l.workflows, t],
546
+ queryFn: async () => (await c(`query SubWorkflows($status: SubWorkflowStatus) {
547
+ subListWorkflows(status: $status) { ${g} }
548
+ }`, { status: t }, n)).subListWorkflows
549
+ });
550
+ }, oe = () => {
551
+ let t = a(), { apiGatewayUrl: n } = e();
552
+ return r({
553
+ mutationFn: async (e) => (await c(`mutation SubCreateWorkflow($input: SubCreateWorkflowInput!) {
554
+ subCreateWorkflow(input: $input) { ${g} }
555
+ }`, { input: e }, n)).subCreateWorkflow,
353
556
  onSuccess: () => {
354
- n.invalidateQueries({ queryKey: s.workflows });
557
+ t.invalidateQueries({ queryKey: l.workflows });
355
558
  }
356
559
  });
357
- }, F = () => {
358
- let n = r(), { apiGatewayUrl: i } = e();
359
- return t({
360
- mutationFn: async (e) => (await o(`mutation SubActivateWorkflow($id: ID!) {
361
- subActivateWorkflow(id: $id) { ${m} }
362
- }`, { id: e }, i)).subActivateWorkflow,
560
+ }, se = () => {
561
+ let t = a(), { apiGatewayUrl: n } = e();
562
+ return r({
563
+ mutationFn: async (e) => (await c(`mutation SubActivateWorkflow($id: ID!) {
564
+ subActivateWorkflow(id: $id) { ${g} }
565
+ }`, { id: e }, n)).subActivateWorkflow,
363
566
  onSuccess: () => {
364
- n.invalidateQueries({ queryKey: s.workflows });
567
+ t.invalidateQueries({ queryKey: l.workflows });
365
568
  }
366
569
  });
367
570
  };
368
571
  //#endregion
369
- export { F as useActivateWorkflow, A as useAgent, k as useAgents, y as useCancelRelationship, j as useCreateAgent, C as useCreateProvider, _ as useCreateRelationship, P as useCreateWorkflow, T as useInboxMessages, D as useInvoices, O as useMarkInvoicePaid, E as useMarkMessageRead, w as usePlans, S as useProvider, x as useProviders, g as useRelationship, h as useRelationships, b as useRenewalEvents, M as useSetAgentStatus, v as useTransitionRelationship, N as useWorkflows };
572
+ export { se as useActivateWorkflow, te as useAgent, $ as useAgents, A as useAllAssets, z as useArchiveProvider, E as useCancelRelationship, X as useChannels, ne as useCreateAgent, j as useCreateAsset, Z as useCreateChannel, k as useCreateEntitlement, K as useCreateInvoice, J as useCreatePaymentInstrument, B as useCreatePlan, ie as useCreatePolicy, L as useCreateProvider, w as useCreateRelationship, oe as useCreateWorkflow, P as useFileDownloadUrl, V as useInboxMessages, U as useIngestMessage, W as useInvoices, G as useMarkInvoicePaid, H as useMarkMessageRead, q as usePaymentInstruments, ee as usePlans, I as useProvider, F as useProviders, C as useRelationship, S as useRelationships, Y as useRemovePaymentInstrument, O as useRenewalEvents, re as useSetAgentStatus, T as useTransitionRelationship, R as useUpdateProvider, D as useUpdateRelationship, N as useUploadFile, Q as useVerifyChannel, ae as useWorkflows };
370
573
 
371
574
  //# sourceMappingURL=useSubscriberBotApi.js.map