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