@burdenoff/microfe-subscriberbot 2026.629.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 +355 -159
  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,10 +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";
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";
5
7
  //#region src/subscriberbot/hooks/useSubscriberBotApi.ts
6
- var a = async (e, t, n) => {
7
- let r = await i({
8
+ var c = async (e, t, n) => {
9
+ let r = await o({
8
10
  gateway: "workspace",
9
11
  baseUrl: n,
10
12
  query: e,
@@ -13,8 +15,8 @@ var a = async (e, t, n) => {
13
15
  });
14
16
  if (r.errors?.length) throw Error(r.errors[0]?.message ?? "GraphQL request failed");
15
17
  if (!r.data) throw Error("GraphQL response did not include data");
16
- return r.data;
17
- }, o = {
18
+ return /^\s*mutation\b/.test(e) && s(), r.data;
19
+ }, l = {
18
20
  relationships: ["subscriberbot", "relationships"],
19
21
  relationship: (e) => [
20
22
  "subscriberbot",
@@ -42,15 +44,16 @@ var a = async (e, t, n) => {
42
44
  renewals: ["subscriberbot", "renewals"],
43
45
  assets: ["subscriberbot", "assets"],
44
46
  entitlements: ["subscriberbot", "entitlements"]
45
- }, s = "\n id name slug category status description industry region language websiteUrl\n logoFileId tags churnRiskScore vendorHealthScore workspaceId createdAt updatedAt\n", c = "\n id name description providerId amount currency interval features isActive\n workspaceId createdAt updatedAt\n", l = "\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", u = "\n id subject preview category categoryConfidence channelId relationshipId\n externalId actionRequired isRead receivedAt workspaceId createdAt updatedAt\n", d = "\n id number relationshipId status currency subtotal taxAmount total issueDate\n dueDate paidAt paymentInstrumentId workspaceId createdAt updatedAt\n", f = "\n id name description kind status ownerId lastRunAt workspaceId createdAt updatedAt\n", p = "\n id name description triggerEvent status runCount lastRunAt workspaceId\n createdAt updatedAt\n", m = (t = {}) => {
46
- let { apiGatewayUrl: r } = e();
47
- return n({
48
- queryKey: [...o.relationships, t],
49
- queryFn: async () => (await a(`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(
50
52
  $kind: SubRelationshipKind
51
53
  $status: SubRelationshipStatus
52
54
  $providerId: ID
53
55
  $ownerId: ID
56
+ $search: String
54
57
  $pagination: PaginationInput
55
58
  ) {
56
59
  subListRelationships(
@@ -58,10 +61,11 @@ var a = async (e, t, n) => {
58
61
  status: $status
59
62
  providerId: $providerId
60
63
  ownerId: $ownerId
64
+ search: $search
61
65
  pagination: $pagination
62
66
  ) {
63
67
  items {
64
- ${l}
68
+ ${f}
65
69
  provider { id name category status logoFileId }
66
70
  plan { id name amount currency interval }
67
71
  }
@@ -72,22 +76,23 @@ var a = async (e, t, n) => {
72
76
  status: t.status,
73
77
  providerId: t.providerId,
74
78
  ownerId: t.ownerId,
79
+ search: t.search,
75
80
  pagination: t.pagination ?? {
76
81
  limit: 50,
77
82
  offset: 0
78
83
  }
79
- }, r)).subListRelationships
84
+ }, n)).subListRelationships
80
85
  });
81
- }, h = (t) => {
82
- let { apiGatewayUrl: r } = e();
83
- return n({
84
- queryKey: o.relationship(t ?? ""),
86
+ }, C = (t) => {
87
+ let { apiGatewayUrl: n } = e();
88
+ return i({
89
+ queryKey: l.relationship(t ?? ""),
85
90
  enabled: !!t,
86
- queryFn: async () => (await a(`query SubRelationship($id: ID!) {
91
+ queryFn: async () => (await c(`query SubRelationship($id: ID!) {
87
92
  subRelationship(id: $id) {
88
- ${l}
89
- provider { ${s} }
90
- plan { ${c} }
93
+ ${f}
94
+ provider { ${u} }
95
+ plan { ${d} }
91
96
  entitlements {
92
97
  id name description type relationshipId quota used unit isActive
93
98
  workspaceId createdAt updatedAt
@@ -101,55 +106,135 @@ var a = async (e, t, n) => {
101
106
  notified workspaceId createdAt updatedAt
102
107
  }
103
108
  }
104
- }`, { id: t }, r)).subRelationship
105
- });
106
- }, g = () => {
107
- let n = r(), { apiGatewayUrl: i } = e();
108
- return t({
109
- mutationFn: async (e) => (await a(`mutation SubCreateRelationship($input: SubCreateRelationshipInput!) {
110
- subCreateRelationship(input: $input) { ${l} }
111
- }`, { 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,
112
117
  onSuccess: () => {
113
- n.invalidateQueries({ queryKey: o.relationships });
118
+ t.invalidateQueries({ queryKey: l.relationships });
114
119
  }
115
120
  });
116
- }, _ = () => {
117
- let n = r(), { apiGatewayUrl: i } = e();
118
- return t({
119
- mutationFn: async ({ id: e, status: t }) => (await a(`mutation SubTransitionRelationship($id: ID!, $status: SubRelationshipStatus!) {
120
- subTransitionRelationship(id: $id, status: $status) { ${l} }
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} }
121
126
  }`, {
122
127
  id: e,
123
128
  status: t
124
- }, 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,
125
140
  onSuccess: (e) => {
126
- n.invalidateQueries({ queryKey: o.relationships }), n.invalidateQueries({ queryKey: o.relationship(e.id) });
141
+ t.invalidateQueries({ queryKey: l.relationships }), t.invalidateQueries({ queryKey: l.relationship(e.id) });
127
142
  }
128
143
  });
129
- }, v = () => {
130
- let n = r(), { apiGatewayUrl: i } = e();
131
- return t({
132
- mutationFn: async (e) => (await a(`mutation SubCancelRelationship($id: ID!) {
133
- subCancelRelationship(id: $id) { ${l} }
134
- }`, { 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,
135
153
  onSuccess: (e) => {
136
- n.invalidateQueries({ queryKey: o.relationships }), n.invalidateQueries({ queryKey: o.relationship(e.id) });
154
+ t.invalidateQueries({ queryKey: l.relationships }), t.invalidateQueries({ queryKey: l.relationship(e.id) });
137
155
  }
138
156
  });
139
- }, y = (t = {}) => {
140
- let { apiGatewayUrl: r } = e();
141
- return n({
142
- queryKey: [...o.renewals, t],
143
- queryFn: async () => (await a("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 }", {
144
162
  relationshipId: t.relationshipId,
145
163
  upcomingOnly: t.upcomingOnly
146
- }, r)).subListRenewalEvents
164
+ }, n)).subListRenewalEvents
147
165
  });
148
- }, b = (t = {}) => {
149
- let { apiGatewayUrl: r } = e();
150
- return n({
151
- queryKey: [...o.providers, t],
152
- queryFn: async () => (await a(`query SubProviders(
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
+ }
185
+ });
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(
153
238
  $category: SubProviderCategory
154
239
  $status: SubProviderStatus
155
240
  $search: String
@@ -161,7 +246,7 @@ var a = async (e, t, n) => {
161
246
  search: $search
162
247
  pagination: $pagination
163
248
  ) {
164
- items { ${s} }
249
+ items { ${u} }
165
250
  pageInfo { cursor hasMore }
166
251
  }
167
252
  }`, {
@@ -172,44 +257,75 @@ var a = async (e, t, n) => {
172
257
  limit: 50,
173
258
  offset: 0
174
259
  }
175
- }, r)).subListProviders
260
+ }, n)).subListProviders
176
261
  });
177
- }, x = (t) => {
178
- let { apiGatewayUrl: r } = e();
179
- return n({
180
- queryKey: o.provider(t ?? ""),
262
+ }, F = (t) => {
263
+ let { apiGatewayUrl: n } = e();
264
+ return i({
265
+ queryKey: l.provider(t ?? ""),
181
266
  enabled: !!t,
182
- queryFn: async () => (await a(`query SubProvider($id: ID!) {
267
+ queryFn: async () => (await c(`query SubProvider($id: ID!) {
183
268
  subProvider(id: $id) {
184
- ${s}
185
- plans { ${c} }
269
+ ${u}
270
+ plans { ${d} }
186
271
  }
187
- }`, { id: t }, r)).subProvider
188
- });
189
- }, S = () => {
190
- let n = r(), { apiGatewayUrl: i } = e();
191
- return t({
192
- mutationFn: async (e) => (await a(`mutation SubCreateProvider($input: SubCreateProviderInput!) {
193
- subCreateProvider(input: $input) { ${s} }
194
- }`, { 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,
195
280
  onSuccess: () => {
196
- n.invalidateQueries({ queryKey: o.providers });
281
+ t.invalidateQueries({ queryKey: l.providers });
197
282
  }
198
283
  });
199
- }, C = (t) => {
200
- let { apiGatewayUrl: r } = e();
201
- return n({
202
- queryKey: [...o.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],
203
309
  enabled: !!t,
204
- queryFn: async () => (await a(`query SubPlans($providerId: ID) {
205
- subListPlans(providerId: $providerId) { ${c} }
206
- }`, { providerId: t }, r)).subListPlans
207
- });
208
- }, w = (t = {}) => {
209
- let { apiGatewayUrl: r } = e();
210
- return n({
211
- queryKey: [...o.inbox, t],
212
- queryFn: async () => (await a(`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(
213
329
  $category: SubMessageCategory
214
330
  $channelId: ID
215
331
  $relationshipId: ID
@@ -223,7 +339,7 @@ var a = async (e, t, n) => {
223
339
  unreadOnly: $unreadOnly
224
340
  pagination: $pagination
225
341
  ) {
226
- items { ${u} }
342
+ items { ${p} }
227
343
  pageInfo { cursor hasMore }
228
344
  }
229
345
  }`, {
@@ -235,23 +351,33 @@ var a = async (e, t, n) => {
235
351
  limit: 50,
236
352
  offset: 0
237
353
  }
238
- }, r)).subListInboxMessages
354
+ }, n)).subListInboxMessages
239
355
  });
240
- }, T = () => {
241
- let n = r(), { apiGatewayUrl: i } = e();
242
- return t({
243
- mutationFn: async (e) => (await a(`mutation SubMarkMessageRead($id: ID!) {
244
- subMarkMessageRead(id: $id) { ${u} }
245
- }`, { 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,
246
362
  onSuccess: () => {
247
- n.invalidateQueries({ queryKey: o.inbox });
363
+ t.invalidateQueries({ queryKey: l.inbox });
248
364
  }
249
365
  });
250
- }, E = (t = {}) => {
251
- let { apiGatewayUrl: r } = e();
252
- return n({
253
- queryKey: [...o.invoices, t],
254
- queryFn: async () => (await a(`query SubInvoices(
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,
372
+ onSuccess: () => {
373
+ t.invalidateQueries({ queryKey: l.inbox });
374
+ }
375
+ });
376
+ }, U = (t = {}) => {
377
+ let { apiGatewayUrl: n } = e();
378
+ return i({
379
+ queryKey: [...l.invoices, t],
380
+ queryFn: async () => (await c(`query SubInvoices(
255
381
  $status: SubInvoiceStatus
256
382
  $relationshipId: ID
257
383
  $pagination: PaginationInput
@@ -261,7 +387,7 @@ var a = async (e, t, n) => {
261
387
  relationshipId: $relationshipId
262
388
  pagination: $pagination
263
389
  ) {
264
- items { ${d} }
390
+ items { ${m} }
265
391
  pageInfo { cursor hasMore }
266
392
  }
267
393
  }`, {
@@ -271,100 +397,170 @@ var a = async (e, t, n) => {
271
397
  limit: 50,
272
398
  offset: 0
273
399
  }
274
- }, r)).subListInvoices
400
+ }, n)).subListInvoices
275
401
  });
276
- }, D = () => {
277
- let n = r(), { apiGatewayUrl: i } = e();
278
- return t({
279
- mutationFn: async (e) => (await a(`mutation SubMarkInvoicePaid($id: ID!) {
280
- subMarkInvoicePaid(id: $id) { ${d} }
281
- }`, { id: e }, i)).subMarkInvoicePaid,
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,
282
408
  onSuccess: () => {
283
- n.invalidateQueries({ queryKey: o.invoices });
409
+ t.invalidateQueries({ queryKey: l.invoices });
284
410
  }
285
411
  });
286
- }, O = (t = {}) => {
287
- let { apiGatewayUrl: r } = e();
288
- return n({
289
- queryKey: [...o.agents, t],
290
- queryFn: async () => (await a(`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) {
291
477
  subListAgents(kind: $kind, status: $status, ownerId: $ownerId) {
292
- ${f}
478
+ ${h}
293
479
  }
294
480
  }`, {
295
481
  kind: t.kind,
296
482
  status: t.status,
297
483
  ownerId: t.ownerId
298
- }, r)).subListAgents
484
+ }, n)).subListAgents
299
485
  });
300
- }, k = (t) => {
301
- let { apiGatewayUrl: r } = e();
302
- return n({
303
- queryKey: o.agent(t ?? ""),
486
+ }, $ = (t) => {
487
+ let { apiGatewayUrl: n } = e();
488
+ return i({
489
+ queryKey: l.agent(t ?? ""),
304
490
  enabled: !!t,
305
- queryFn: async () => (await a(`query SubAgent($id: ID!) {
491
+ queryFn: async () => (await c(`query SubAgent($id: ID!) {
306
492
  subAgent(id: $id) {
307
- ${f}
493
+ ${h}
308
494
  policies {
309
495
  id name description action agentId isEnabled triggerCount
310
496
  lastTriggeredAt workspaceId createdAt updatedAt
311
497
  }
312
498
  }
313
- }`, { id: t }, r)).subAgent
499
+ }`, { id: t }, n)).subAgent
314
500
  });
315
- }, A = () => {
316
- let n = r(), { apiGatewayUrl: i } = e();
317
- return t({
318
- mutationFn: async (e) => (await a(`mutation SubCreateAgent($input: SubCreateAgentInput!) {
319
- subCreateAgent(input: $input) { ${f} }
320
- }`, { input: e }, i)).subCreateAgent,
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,
321
507
  onSuccess: () => {
322
- n.invalidateQueries({ queryKey: o.agents });
508
+ t.invalidateQueries({ queryKey: l.agents });
323
509
  }
324
510
  });
325
- }, j = () => {
326
- let n = r(), { apiGatewayUrl: i } = e();
327
- return t({
328
- mutationFn: async ({ id: e, status: t }) => (await a(`mutation SubSetAgentStatus($id: ID!, $status: SubAgentStatus!) {
329
- subSetAgentStatus(id: $id, status: $status) { ${f} }
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} }
330
516
  }`, {
331
517
  id: e,
332
518
  status: t
333
- }, i)).subSetAgentStatus,
519
+ }, n)).subSetAgentStatus,
334
520
  onSuccess: (e) => {
335
- n.invalidateQueries({ queryKey: o.agents }), n.invalidateQueries({ queryKey: o.agent(e.id) });
521
+ t.invalidateQueries({ queryKey: l.agents }), t.invalidateQueries({ queryKey: l.agent(e.id) });
336
522
  }
337
523
  });
338
- }, M = (t) => {
339
- let { apiGatewayUrl: r } = e();
340
- return n({
341
- queryKey: [...o.workflows, t],
342
- queryFn: async () => (await a(`query SubWorkflows($status: SubWorkflowStatus) {
343
- subListWorkflows(status: $status) { ${p} }
344
- }`, { status: t }, r)).subListWorkflows
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
+ }
345
533
  });
346
- }, N = () => {
347
- let n = r(), { apiGatewayUrl: i } = e();
348
- return t({
349
- mutationFn: async (e) => (await a(`mutation SubCreateWorkflow($input: SubCreateWorkflowInput!) {
350
- subCreateWorkflow(input: $input) { ${p} }
351
- }`, { input: e }, i)).subCreateWorkflow,
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,
352
548
  onSuccess: () => {
353
- n.invalidateQueries({ queryKey: o.workflows });
549
+ t.invalidateQueries({ queryKey: l.workflows });
354
550
  }
355
551
  });
356
- }, P = () => {
357
- let n = r(), { apiGatewayUrl: i } = e();
358
- return t({
359
- mutationFn: async (e) => (await a(`mutation SubActivateWorkflow($id: ID!) {
360
- subActivateWorkflow(id: $id) { ${p} }
361
- }`, { 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,
362
558
  onSuccess: () => {
363
- n.invalidateQueries({ queryKey: o.workflows });
559
+ t.invalidateQueries({ queryKey: l.workflows });
364
560
  }
365
561
  });
366
562
  };
367
563
  //#endregion
368
- export { P as useActivateWorkflow, k as useAgent, O as useAgents, v as useCancelRelationship, A as useCreateAgent, S as useCreateProvider, g as useCreateRelationship, N as useCreateWorkflow, w as useInboxMessages, E as useInvoices, D as useMarkInvoicePaid, T as useMarkMessageRead, C as usePlans, x as useProvider, b as useProviders, h as useRelationship, m as useRelationships, y as useRenewalEvents, j as useSetAgentStatus, _ as useTransitionRelationship, M 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 };
369
565
 
370
566
  //# sourceMappingURL=useSubscriberBotApi.js.map