@burdenoff/microfe-subscriberbot 2026.706.1 → 2026.706.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/dist/subscriberbot/components/Modal.js +51 -0
  2. package/dist/subscriberbot/components/Modal.js.map +1 -0
  3. package/dist/subscriberbot/hooks/useSubscriberBotApi.js +358 -163
  4. package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
  5. package/dist/subscriberbot/pages/InboxPage.js +339 -66
  6. package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
  7. package/dist/subscriberbot/pages/InvoicesPage.js +496 -73
  8. package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
  9. package/dist/subscriberbot/pages/WorkflowsPage.js +136 -150
  10. package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
  11. package/dist/subscriberbot/pages/agents/AgentDetailPage.js +197 -58
  12. package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
  13. package/dist/subscriberbot/pages/agents/AgentsListPage.js +2 -0
  14. package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
  15. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +538 -71
  16. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
  17. package/dist/subscriberbot/pages/providers/ProvidersListPage.js +2 -0
  18. package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
  19. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +664 -126
  20. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
  21. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +18 -16
  22. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
  23. 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,135 @@ 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,
126
130
  onSuccess: (e) => {
127
- n.invalidateQueries({ queryKey: s.relationships }), n.invalidateQueries({ queryKey: s.relationship(e.id) });
131
+ t.invalidateQueries({ queryKey: l.relationships }), t.invalidateQueries({ queryKey: l.relationship(e.id) });
128
132
  }
129
133
  });
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,
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,
136
140
  onSuccess: (e) => {
137
- 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) });
138
142
  }
139
143
  });
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 }", {
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,
153
+ onSuccess: (e) => {
154
+ t.invalidateQueries({ queryKey: l.relationships }), t.invalidateQueries({ queryKey: l.relationship(e.id) });
155
+ }
156
+ });
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
+ }
175
+ });
176
+ }, A = () => {
177
+ let t = a(), { apiGatewayUrl: n } = e();
178
+ return r({
179
+ mutationFn: async (e) => (await c(`mutation SubCreateAsset($input: SubCreateAssetInput!) {
180
+ subCreateAsset(input: $input) { ${v} }
181
+ }`, { input: e }, n)).subCreateAsset,
182
+ onSuccess: (e) => {
183
+ t.invalidateQueries({ queryKey: l.assets }), t.invalidateQueries({ queryKey: l.relationship(e.relationshipId) });
184
+ }
148
185
  });
149
- }, x = (t = {}) => {
150
- let { apiGatewayUrl: r } = e();
151
- return n({
152
- queryKey: [...s.providers, t],
153
- queryFn: async () => (await o(`query SubProviders(
186
+ }, j = "/SubscriberBot/Assets", M = () => {
187
+ let { apiGatewayUrl: r } = e(), [i, a] = n(0), [o, s] = n(!1);
188
+ return {
189
+ uploadFile: t(async (e) => {
190
+ s(!0), a(0);
191
+ try {
192
+ let t = (await c("mutation SubEnsureFolder($path: String!) {\n ensureFolderByPath(path: $path) { id }\n }", { path: j }, r)).ensureFolderByPath?.id;
193
+ if (!t) throw Error("Could not resolve the upload folder.");
194
+ 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: {
195
+ fileName: e.name,
196
+ extension: o,
197
+ mimeType: n,
198
+ fileSize: String(e.size),
199
+ folderId: t
200
+ } }, r), l = s.initiateUpload?.uploadUrl, u = s.initiateUpload?.session.id;
201
+ if (!l || !u) throw Error("The files service did not return an upload URL.");
202
+ await new Promise((t, r) => {
203
+ let i = new XMLHttpRequest();
204
+ i.open("PUT", l), i.setRequestHeader("Content-Type", n), i.upload.onprogress = (e) => {
205
+ e.lengthComputable && a(Math.round(e.loaded / e.total * 100));
206
+ }, i.onload = () => {
207
+ i.status >= 200 && i.status < 300 ? t() : r(/* @__PURE__ */ Error(`Upload to storage failed (${i.status}).`));
208
+ }, i.onerror = () => r(/* @__PURE__ */ Error("Upload to storage failed.")), i.send(e);
209
+ });
210
+ let d = await c("mutation SubCompleteUpload($input: CompleteUploadInput!) {\n completeUpload(input: $input) {\n fileId\n file { id name }\n }\n }", { input: {
211
+ sessionId: u,
212
+ fileSize: String(e.size),
213
+ folderId: t
214
+ } }, r), f = d.completeUpload?.file?.id ?? d.completeUpload?.fileId;
215
+ if (!f) throw Error("The upload could not be finalized.");
216
+ return {
217
+ fileId: f,
218
+ fileName: d.completeUpload?.file?.name ?? e.name
219
+ };
220
+ } finally {
221
+ s(!1);
222
+ }
223
+ }, [r]),
224
+ progress: i,
225
+ isUploading: o
226
+ };
227
+ }, N = () => {
228
+ let { apiGatewayUrl: n } = e();
229
+ return t(async (e) => (await c("query SubFileDownloadUrl($id: ID!, $expiresIn: Int) {\n getFileDownloadUrl(id: $id, expiresIn: $expiresIn)\n }", {
230
+ id: e,
231
+ expiresIn: 21600
232
+ }, n)).getFileDownloadUrl, [n]);
233
+ }, P = (t = {}) => {
234
+ let { apiGatewayUrl: n } = e();
235
+ return i({
236
+ queryKey: [...l.providers, t],
237
+ queryFn: async () => (await c(`query SubProviders(
154
238
  $category: SubProviderCategory
155
239
  $status: SubProviderStatus
156
240
  $search: String
@@ -162,7 +246,7 @@ var o = async (e, t, n) => {
162
246
  search: $search
163
247
  pagination: $pagination
164
248
  ) {
165
- items { ${c} }
249
+ items { ${u} }
166
250
  pageInfo { cursor hasMore }
167
251
  }
168
252
  }`, {
@@ -173,44 +257,75 @@ var o = async (e, t, n) => {
173
257
  limit: 50,
174
258
  offset: 0
175
259
  }
176
- }, r)).subListProviders
260
+ }, n)).subListProviders
177
261
  });
178
- }, S = (t) => {
179
- let { apiGatewayUrl: r } = e();
180
- return n({
181
- queryKey: s.provider(t ?? ""),
262
+ }, F = (t) => {
263
+ let { apiGatewayUrl: n } = e();
264
+ return i({
265
+ queryKey: l.provider(t ?? ""),
182
266
  enabled: !!t,
183
- queryFn: async () => (await o(`query SubProvider($id: ID!) {
267
+ queryFn: async () => (await c(`query SubProvider($id: ID!) {
184
268
  subProvider(id: $id) {
185
- ${c}
186
- plans { ${l} }
269
+ ${u}
270
+ plans { ${d} }
187
271
  }
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,
272
+ }`, { id: t }, n)).subProvider
273
+ });
274
+ }, I = () => {
275
+ let t = a(), { apiGatewayUrl: n } = e();
276
+ return r({
277
+ mutationFn: async (e) => (await c(`mutation SubCreateProvider($input: SubCreateProviderInput!) {
278
+ subCreateProvider(input: $input) { ${u} }
279
+ }`, { input: e }, n)).subCreateProvider,
196
280
  onSuccess: () => {
197
- n.invalidateQueries({ queryKey: s.providers });
281
+ t.invalidateQueries({ queryKey: l.providers });
198
282
  }
199
283
  });
200
- }, w = (t) => {
201
- let { apiGatewayUrl: r } = e();
202
- return n({
203
- queryKey: [...s.plans, t],
284
+ }, L = () => {
285
+ let t = a(), { apiGatewayUrl: n } = e();
286
+ return r({
287
+ mutationFn: async ({ id: e, input: t }) => (await c(`mutation SubUpdateProvider($id: ID!, $input: SubUpdateProviderInput!) {
288
+ subUpdateProvider(id: $id, input: $input) { ${u} }
289
+ }`, {
290
+ id: e,
291
+ input: t
292
+ }, n)).subUpdateProvider,
293
+ onSuccess: (e) => {
294
+ t.invalidateQueries({ queryKey: l.providers }), t.invalidateQueries({ queryKey: l.provider(e.id) });
295
+ }
296
+ });
297
+ }, R = () => {
298
+ let t = a(), { apiGatewayUrl: n } = e();
299
+ return r({
300
+ mutationFn: async (e) => (await c("mutation SubArchiveProvider($id: ID!) {\n subArchiveProvider(id: $id)\n }", { id: e }, n)).subArchiveProvider,
301
+ onSuccess: () => {
302
+ t.invalidateQueries({ queryKey: l.providers });
303
+ }
304
+ });
305
+ }, ee = (t) => {
306
+ let { apiGatewayUrl: n } = e();
307
+ return i({
308
+ queryKey: [...l.plans, t],
204
309
  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(
310
+ queryFn: async () => (await c(`query SubPlans($providerId: ID) {
311
+ subListPlans(providerId: $providerId) { ${d} }
312
+ }`, { providerId: t }, n)).subListPlans
313
+ });
314
+ }, z = () => {
315
+ let t = a(), { apiGatewayUrl: n } = e();
316
+ return r({
317
+ mutationFn: async (e) => (await c(`mutation SubCreatePlan($input: SubCreatePlanInput!) {
318
+ subCreatePlan(input: $input) { ${d} }
319
+ }`, { input: e }, n)).subCreatePlan,
320
+ onSuccess: (e) => {
321
+ t.invalidateQueries({ queryKey: l.plans }), t.invalidateQueries({ queryKey: l.provider(e.providerId) });
322
+ }
323
+ });
324
+ }, B = (t = {}) => {
325
+ let { apiGatewayUrl: n } = e();
326
+ return i({
327
+ queryKey: [...l.inbox, t],
328
+ queryFn: async () => (await c(`query SubInboxMessages(
214
329
  $category: SubMessageCategory
215
330
  $channelId: ID
216
331
  $relationshipId: ID
@@ -224,7 +339,7 @@ var o = async (e, t, n) => {
224
339
  unreadOnly: $unreadOnly
225
340
  pagination: $pagination
226
341
  ) {
227
- items { ${d} }
342
+ items { ${p} }
228
343
  pageInfo { cursor hasMore }
229
344
  }
230
345
  }`, {
@@ -236,23 +351,33 @@ var o = async (e, t, n) => {
236
351
  limit: 50,
237
352
  offset: 0
238
353
  }
239
- }, r)).subListInboxMessages
354
+ }, n)).subListInboxMessages
240
355
  });
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,
356
+ }, V = () => {
357
+ let t = a(), { apiGatewayUrl: n } = e();
358
+ return r({
359
+ mutationFn: async (e) => (await c(`mutation SubMarkMessageRead($id: ID!) {
360
+ subMarkMessageRead(id: $id) { ${p} }
361
+ }`, { id: e }, n)).subMarkMessageRead,
362
+ onSuccess: () => {
363
+ t.invalidateQueries({ queryKey: l.inbox });
364
+ }
365
+ });
366
+ }, H = () => {
367
+ let t = a(), { apiGatewayUrl: n } = e();
368
+ return r({
369
+ mutationFn: async (e) => (await c(`mutation SubIngestMessage($input: SubIngestMessageInput!) {
370
+ subIngestMessage(input: $input) { ${p} }
371
+ }`, { input: e }, n)).subIngestMessage,
247
372
  onSuccess: () => {
248
- n.invalidateQueries({ queryKey: s.inbox });
373
+ t.invalidateQueries({ queryKey: l.inbox });
249
374
  }
250
375
  });
251
- }, D = (t = {}) => {
252
- let { apiGatewayUrl: r } = e();
253
- return n({
254
- queryKey: [...s.invoices, t],
255
- queryFn: async () => (await o(`query SubInvoices(
376
+ }, U = (t = {}) => {
377
+ let { apiGatewayUrl: n } = e();
378
+ return i({
379
+ queryKey: [...l.invoices, t],
380
+ queryFn: async () => (await c(`query SubInvoices(
256
381
  $status: SubInvoiceStatus
257
382
  $relationshipId: ID
258
383
  $pagination: PaginationInput
@@ -262,7 +387,7 @@ var o = async (e, t, n) => {
262
387
  relationshipId: $relationshipId
263
388
  pagination: $pagination
264
389
  ) {
265
- items { ${f} }
390
+ items { ${m} }
266
391
  pageInfo { cursor hasMore }
267
392
  }
268
393
  }`, {
@@ -272,100 +397,170 @@ var o = async (e, t, n) => {
272
397
  limit: 50,
273
398
  offset: 0
274
399
  }
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,
400
+ }, n)).subListInvoices
401
+ });
402
+ }, W = () => {
403
+ let t = a(), { apiGatewayUrl: n } = e();
404
+ return r({
405
+ mutationFn: async (e) => (await c(`mutation SubMarkInvoicePaid($id: ID!) {
406
+ subMarkInvoicePaid(id: $id) { ${m} }
407
+ }`, { id: e }, n)).subMarkInvoicePaid,
283
408
  onSuccess: () => {
284
- n.invalidateQueries({ queryKey: s.invoices });
409
+ t.invalidateQueries({ queryKey: l.invoices });
285
410
  }
286
411
  });
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) {
412
+ }, G = () => {
413
+ let t = a(), { apiGatewayUrl: n } = e();
414
+ return r({
415
+ mutationFn: async (e) => (await c(`mutation SubCreateInvoice($input: SubCreateInvoiceInput!) {
416
+ subCreateInvoice(input: $input) { ${m} }
417
+ }`, { input: e }, n)).subCreateInvoice,
418
+ onSuccess: () => {
419
+ t.invalidateQueries({ queryKey: l.invoices });
420
+ }
421
+ });
422
+ }, K = (t) => {
423
+ let { apiGatewayUrl: n } = e();
424
+ return i({
425
+ queryKey: [...l.paymentInstruments, t],
426
+ 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
427
+ });
428
+ }, q = () => {
429
+ let t = a(), { apiGatewayUrl: n } = e();
430
+ return r({
431
+ mutationFn: async (e) => (await c(`mutation SubCreatePaymentInstrument($input: SubCreatePaymentInstrumentInput!) {
432
+ subCreatePaymentInstrument(input: $input) { ${y} }
433
+ }`, { input: e }, n)).subCreatePaymentInstrument,
434
+ onSuccess: () => {
435
+ t.invalidateQueries({ queryKey: l.paymentInstruments });
436
+ }
437
+ });
438
+ }, J = () => {
439
+ let t = a(), { apiGatewayUrl: n } = e();
440
+ return r({
441
+ mutationFn: async (e) => (await c("mutation SubRemovePaymentInstrument($id: ID!) {\n subRemovePaymentInstrument(id: $id)\n }", { id: e }, n)).subRemovePaymentInstrument,
442
+ onSuccess: () => {
443
+ t.invalidateQueries({ queryKey: l.paymentInstruments });
444
+ }
445
+ });
446
+ }, Y = (t) => {
447
+ let { apiGatewayUrl: n } = e();
448
+ return i({
449
+ queryKey: [...l.channels, t],
450
+ 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
451
+ });
452
+ }, X = () => {
453
+ let t = a(), { apiGatewayUrl: n } = e();
454
+ return r({
455
+ mutationFn: async (e) => (await c(`mutation SubCreateChannel($input: SubCreateChannelInput!) {
456
+ subCreateChannel(input: $input) { ${b} }
457
+ }`, { input: e }, n)).subCreateChannel,
458
+ onSuccess: () => {
459
+ t.invalidateQueries({ queryKey: l.channels });
460
+ }
461
+ });
462
+ }, Z = () => {
463
+ let t = a(), { apiGatewayUrl: n } = e();
464
+ return r({
465
+ mutationFn: async (e) => (await c(`mutation SubVerifyChannel($id: ID!) {
466
+ subVerifyChannel(id: $id) { ${b} }
467
+ }`, { id: e }, n)).subVerifyChannel,
468
+ onSuccess: () => {
469
+ t.invalidateQueries({ queryKey: l.channels });
470
+ }
471
+ });
472
+ }, Q = (t = {}) => {
473
+ let { apiGatewayUrl: n } = e();
474
+ return i({
475
+ queryKey: [...l.agents, t],
476
+ queryFn: async () => (await c(`query SubAgents($kind: SubAgentKind, $status: SubAgentStatus, $ownerId: ID) {
292
477
  subListAgents(kind: $kind, status: $status, ownerId: $ownerId) {
293
- ${p}
478
+ ${h}
294
479
  }
295
480
  }`, {
296
481
  kind: t.kind,
297
482
  status: t.status,
298
483
  ownerId: t.ownerId
299
- }, r)).subListAgents
484
+ }, n)).subListAgents
300
485
  });
301
- }, A = (t) => {
302
- let { apiGatewayUrl: r } = e();
303
- return n({
304
- queryKey: s.agent(t ?? ""),
486
+ }, $ = (t) => {
487
+ let { apiGatewayUrl: n } = e();
488
+ return i({
489
+ queryKey: l.agent(t ?? ""),
305
490
  enabled: !!t,
306
- queryFn: async () => (await o(`query SubAgent($id: ID!) {
491
+ queryFn: async () => (await c(`query SubAgent($id: ID!) {
307
492
  subAgent(id: $id) {
308
- ${p}
493
+ ${h}
309
494
  policies {
310
495
  id name description action agentId isEnabled triggerCount
311
496
  lastTriggeredAt workspaceId createdAt updatedAt
312
497
  }
313
498
  }
314
- }`, { id: t }, r)).subAgent
315
- });
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,
499
+ }`, { id: t }, n)).subAgent
500
+ });
501
+ }, te = () => {
502
+ let t = a(), { apiGatewayUrl: n } = e();
503
+ return r({
504
+ mutationFn: async (e) => (await c(`mutation SubCreateAgent($input: SubCreateAgentInput!) {
505
+ subCreateAgent(input: $input) { ${h} }
506
+ }`, { input: e }, n)).subCreateAgent,
322
507
  onSuccess: () => {
323
- n.invalidateQueries({ queryKey: s.agents });
508
+ t.invalidateQueries({ queryKey: l.agents });
324
509
  }
325
510
  });
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} }
511
+ }, ne = () => {
512
+ let t = a(), { apiGatewayUrl: n } = e();
513
+ return r({
514
+ mutationFn: async ({ id: e, status: t }) => (await c(`mutation SubSetAgentStatus($id: ID!, $status: SubAgentStatus!) {
515
+ subSetAgentStatus(id: $id, status: $status) { ${h} }
331
516
  }`, {
332
517
  id: e,
333
518
  status: t
334
- }, i)).subSetAgentStatus,
519
+ }, n)).subSetAgentStatus,
335
520
  onSuccess: (e) => {
336
- n.invalidateQueries({ queryKey: s.agents }), n.invalidateQueries({ queryKey: s.agent(e.id) });
521
+ t.invalidateQueries({ queryKey: l.agents }), t.invalidateQueries({ queryKey: l.agent(e.id) });
337
522
  }
338
523
  });
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
346
- });
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,
524
+ }, re = () => {
525
+ let t = a(), { apiGatewayUrl: n } = e();
526
+ return r({
527
+ mutationFn: async (e) => (await c(`mutation SubCreatePolicy($input: SubCreatePolicyInput!) {
528
+ subCreatePolicy(input: $input) { ${x} }
529
+ }`, { input: e }, n)).subCreatePolicy,
530
+ onSuccess: (e) => {
531
+ t.invalidateQueries({ queryKey: l.agents }), t.invalidateQueries({ queryKey: l.agent(e.agentId) });
532
+ }
533
+ });
534
+ }, ie = (t) => {
535
+ let { apiGatewayUrl: n } = e();
536
+ return i({
537
+ queryKey: [...l.workflows, t],
538
+ queryFn: async () => (await c(`query SubWorkflows($status: SubWorkflowStatus) {
539
+ subListWorkflows(status: $status) { ${g} }
540
+ }`, { status: t }, n)).subListWorkflows
541
+ });
542
+ }, ae = () => {
543
+ let t = a(), { apiGatewayUrl: n } = e();
544
+ return r({
545
+ mutationFn: async (e) => (await c(`mutation SubCreateWorkflow($input: SubCreateWorkflowInput!) {
546
+ subCreateWorkflow(input: $input) { ${g} }
547
+ }`, { input: e }, n)).subCreateWorkflow,
353
548
  onSuccess: () => {
354
- n.invalidateQueries({ queryKey: s.workflows });
549
+ t.invalidateQueries({ queryKey: l.workflows });
355
550
  }
356
551
  });
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,
552
+ }, oe = () => {
553
+ let t = a(), { apiGatewayUrl: n } = e();
554
+ return r({
555
+ mutationFn: async (e) => (await c(`mutation SubActivateWorkflow($id: ID!) {
556
+ subActivateWorkflow(id: $id) { ${g} }
557
+ }`, { id: e }, n)).subActivateWorkflow,
363
558
  onSuccess: () => {
364
- n.invalidateQueries({ queryKey: s.workflows });
559
+ t.invalidateQueries({ queryKey: l.workflows });
365
560
  }
366
561
  });
367
562
  };
368
563
  //#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 };
564
+ export { oe as useActivateWorkflow, $ as useAgent, Q as useAgents, R as useArchiveProvider, E as useCancelRelationship, Y as useChannels, te as useCreateAgent, A as useCreateAsset, X as useCreateChannel, k as useCreateEntitlement, G as useCreateInvoice, q as useCreatePaymentInstrument, z as useCreatePlan, re as useCreatePolicy, I as useCreateProvider, w as useCreateRelationship, ae as useCreateWorkflow, N as useFileDownloadUrl, B as useInboxMessages, H as useIngestMessage, U as useInvoices, W as useMarkInvoicePaid, V as useMarkMessageRead, K as usePaymentInstruments, ee as usePlans, F as useProvider, P as useProviders, C as useRelationship, S as useRelationships, J as useRemovePaymentInstrument, O as useRenewalEvents, ne as useSetAgentStatus, T as useTransitionRelationship, L as useUpdateProvider, D as useUpdateRelationship, M as useUploadFile, Z as useVerifyChannel, ie as useWorkflows };
370
565
 
371
566
  //# sourceMappingURL=useSubscriberBotApi.js.map