@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.
- package/dist/subscriberbot/components/Modal.js +51 -0
- package/dist/subscriberbot/components/Modal.js.map +1 -0
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js +355 -159
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.js +339 -66
- package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
- package/dist/subscriberbot/pages/InvoicesPage.js +496 -73
- package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.js +136 -150
- package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +197 -58
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.js +2 -0
- package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +538 -71
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js +2 -0
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +664 -126
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +18 -16
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
- 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 {
|
|
4
|
-
import {
|
|
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
|
|
7
|
-
let r = await
|
|
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
|
-
},
|
|
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
|
-
},
|
|
46
|
-
let { apiGatewayUrl:
|
|
47
|
-
return
|
|
48
|
-
queryKey: [...
|
|
49
|
-
queryFn: async () => (await
|
|
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
|
-
${
|
|
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
|
-
},
|
|
84
|
+
}, n)).subListRelationships
|
|
80
85
|
});
|
|
81
|
-
},
|
|
82
|
-
let { apiGatewayUrl:
|
|
83
|
-
return
|
|
84
|
-
queryKey:
|
|
86
|
+
}, C = (t) => {
|
|
87
|
+
let { apiGatewayUrl: n } = e();
|
|
88
|
+
return i({
|
|
89
|
+
queryKey: l.relationship(t ?? ""),
|
|
85
90
|
enabled: !!t,
|
|
86
|
-
queryFn: async () => (await
|
|
91
|
+
queryFn: async () => (await c(`query SubRelationship($id: ID!) {
|
|
87
92
|
subRelationship(id: $id) {
|
|
88
|
-
${
|
|
89
|
-
provider { ${
|
|
90
|
-
plan { ${
|
|
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 },
|
|
105
|
-
});
|
|
106
|
-
},
|
|
107
|
-
let
|
|
108
|
-
return
|
|
109
|
-
mutationFn: async (e) => (await
|
|
110
|
-
subCreateRelationship(input: $input) { ${
|
|
111
|
-
}`, { input: e },
|
|
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
|
-
|
|
118
|
+
t.invalidateQueries({ queryKey: l.relationships });
|
|
114
119
|
}
|
|
115
120
|
});
|
|
116
|
-
},
|
|
117
|
-
let
|
|
118
|
-
return
|
|
119
|
-
mutationFn: async ({ id: e, status: t }) => (await
|
|
120
|
-
subTransitionRelationship(id: $id, status: $status) { ${
|
|
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
|
-
},
|
|
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
|
-
|
|
141
|
+
t.invalidateQueries({ queryKey: l.relationships }), t.invalidateQueries({ queryKey: l.relationship(e.id) });
|
|
127
142
|
}
|
|
128
143
|
});
|
|
129
|
-
},
|
|
130
|
-
let
|
|
131
|
-
return
|
|
132
|
-
mutationFn: async (e) => (await
|
|
133
|
-
|
|
134
|
-
}`, {
|
|
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
|
-
|
|
154
|
+
t.invalidateQueries({ queryKey: l.relationships }), t.invalidateQueries({ queryKey: l.relationship(e.id) });
|
|
137
155
|
}
|
|
138
156
|
});
|
|
139
|
-
},
|
|
140
|
-
let { apiGatewayUrl:
|
|
141
|
-
return
|
|
142
|
-
queryKey: [...
|
|
143
|
-
queryFn: async () => (await
|
|
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
|
-
},
|
|
164
|
+
}, n)).subListRenewalEvents
|
|
147
165
|
});
|
|
148
|
-
},
|
|
149
|
-
let { apiGatewayUrl:
|
|
150
|
-
return
|
|
151
|
-
|
|
152
|
-
|
|
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 { ${
|
|
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
|
-
},
|
|
260
|
+
}, n)).subListProviders
|
|
176
261
|
});
|
|
177
|
-
},
|
|
178
|
-
let { apiGatewayUrl:
|
|
179
|
-
return
|
|
180
|
-
queryKey:
|
|
262
|
+
}, F = (t) => {
|
|
263
|
+
let { apiGatewayUrl: n } = e();
|
|
264
|
+
return i({
|
|
265
|
+
queryKey: l.provider(t ?? ""),
|
|
181
266
|
enabled: !!t,
|
|
182
|
-
queryFn: async () => (await
|
|
267
|
+
queryFn: async () => (await c(`query SubProvider($id: ID!) {
|
|
183
268
|
subProvider(id: $id) {
|
|
184
|
-
${
|
|
185
|
-
plans { ${
|
|
269
|
+
${u}
|
|
270
|
+
plans { ${d} }
|
|
186
271
|
}
|
|
187
|
-
}`, { id: t },
|
|
188
|
-
});
|
|
189
|
-
},
|
|
190
|
-
let
|
|
191
|
-
return
|
|
192
|
-
mutationFn: async (e) => (await
|
|
193
|
-
subCreateProvider(input: $input) { ${
|
|
194
|
-
}`, { input: e },
|
|
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
|
-
|
|
281
|
+
t.invalidateQueries({ queryKey: l.providers });
|
|
197
282
|
}
|
|
198
283
|
});
|
|
199
|
-
},
|
|
200
|
-
let { apiGatewayUrl:
|
|
201
|
-
return
|
|
202
|
-
|
|
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
|
|
205
|
-
subListPlans(providerId: $providerId) { ${
|
|
206
|
-
}`, { providerId: t },
|
|
207
|
-
});
|
|
208
|
-
},
|
|
209
|
-
let { apiGatewayUrl:
|
|
210
|
-
return
|
|
211
|
-
|
|
212
|
-
|
|
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 { ${
|
|
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
|
-
},
|
|
354
|
+
}, n)).subListInboxMessages
|
|
239
355
|
});
|
|
240
|
-
},
|
|
241
|
-
let
|
|
242
|
-
return
|
|
243
|
-
mutationFn: async (e) => (await
|
|
244
|
-
subMarkMessageRead(id: $id) { ${
|
|
245
|
-
}`, { id: e },
|
|
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
|
-
|
|
363
|
+
t.invalidateQueries({ queryKey: l.inbox });
|
|
248
364
|
}
|
|
249
365
|
});
|
|
250
|
-
},
|
|
251
|
-
let { apiGatewayUrl:
|
|
252
|
-
return
|
|
253
|
-
|
|
254
|
-
|
|
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 { ${
|
|
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
|
-
},
|
|
400
|
+
}, n)).subListInvoices
|
|
275
401
|
});
|
|
276
|
-
},
|
|
277
|
-
let
|
|
278
|
-
return
|
|
279
|
-
mutationFn: async (e) => (await
|
|
280
|
-
subMarkInvoicePaid(id: $id) { ${
|
|
281
|
-
}`, { id: e },
|
|
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
|
-
|
|
409
|
+
t.invalidateQueries({ queryKey: l.invoices });
|
|
284
410
|
}
|
|
285
411
|
});
|
|
286
|
-
},
|
|
287
|
-
let { apiGatewayUrl:
|
|
288
|
-
return
|
|
289
|
-
|
|
290
|
-
|
|
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
|
-
${
|
|
478
|
+
${h}
|
|
293
479
|
}
|
|
294
480
|
}`, {
|
|
295
481
|
kind: t.kind,
|
|
296
482
|
status: t.status,
|
|
297
483
|
ownerId: t.ownerId
|
|
298
|
-
},
|
|
484
|
+
}, n)).subListAgents
|
|
299
485
|
});
|
|
300
|
-
},
|
|
301
|
-
let { apiGatewayUrl:
|
|
302
|
-
return
|
|
303
|
-
queryKey:
|
|
486
|
+
}, $ = (t) => {
|
|
487
|
+
let { apiGatewayUrl: n } = e();
|
|
488
|
+
return i({
|
|
489
|
+
queryKey: l.agent(t ?? ""),
|
|
304
490
|
enabled: !!t,
|
|
305
|
-
queryFn: async () => (await
|
|
491
|
+
queryFn: async () => (await c(`query SubAgent($id: ID!) {
|
|
306
492
|
subAgent(id: $id) {
|
|
307
|
-
${
|
|
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 },
|
|
499
|
+
}`, { id: t }, n)).subAgent
|
|
314
500
|
});
|
|
315
|
-
},
|
|
316
|
-
let
|
|
317
|
-
return
|
|
318
|
-
mutationFn: async (e) => (await
|
|
319
|
-
subCreateAgent(input: $input) { ${
|
|
320
|
-
}`, { input: e },
|
|
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
|
-
|
|
508
|
+
t.invalidateQueries({ queryKey: l.agents });
|
|
323
509
|
}
|
|
324
510
|
});
|
|
325
|
-
},
|
|
326
|
-
let
|
|
327
|
-
return
|
|
328
|
-
mutationFn: async ({ id: e, status: t }) => (await
|
|
329
|
-
subSetAgentStatus(id: $id, status: $status) { ${
|
|
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
|
-
},
|
|
519
|
+
}, n)).subSetAgentStatus,
|
|
334
520
|
onSuccess: (e) => {
|
|
335
|
-
|
|
521
|
+
t.invalidateQueries({ queryKey: l.agents }), t.invalidateQueries({ queryKey: l.agent(e.id) });
|
|
336
522
|
}
|
|
337
523
|
});
|
|
338
|
-
},
|
|
339
|
-
let { apiGatewayUrl:
|
|
340
|
-
return
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
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
|
-
},
|
|
347
|
-
let
|
|
348
|
-
return
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
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
|
-
|
|
549
|
+
t.invalidateQueries({ queryKey: l.workflows });
|
|
354
550
|
}
|
|
355
551
|
});
|
|
356
|
-
},
|
|
357
|
-
let
|
|
358
|
-
return
|
|
359
|
-
mutationFn: async (e) => (await
|
|
360
|
-
subActivateWorkflow(id: $id) { ${
|
|
361
|
-
}`, { id: e },
|
|
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
|
-
|
|
559
|
+
t.invalidateQueries({ queryKey: l.workflows });
|
|
364
560
|
}
|
|
365
561
|
});
|
|
366
562
|
};
|
|
367
563
|
//#endregion
|
|
368
|
-
export {
|
|
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
|