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