@burdenoff/microfe-subscriberbot 2026.626.2 → 2026.629.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/dist/index.js +4 -4
  2. package/dist/subscriberbot/SubscriberBotRoot.js +61 -133
  3. package/dist/subscriberbot/SubscriberBotRoot.js.map +1 -1
  4. package/dist/subscriberbot/SubscriberBotRoutes.js +56 -187
  5. package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
  6. package/dist/subscriberbot/components/StateViews.js +49 -0
  7. package/dist/subscriberbot/components/StateViews.js.map +1 -0
  8. package/dist/subscriberbot/components/StatusBadge.js +45 -47
  9. package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
  10. package/dist/subscriberbot/context/SubscriberBotContext.js +22 -30
  11. package/dist/subscriberbot/context/SubscriberBotContext.js.map +1 -1
  12. package/dist/subscriberbot/hooks/useSubscriberBotApi.js +342 -195
  13. package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
  14. package/dist/subscriberbot/index.js +1 -1
  15. package/dist/subscriberbot/pages/DashboardPage.js +269 -0
  16. package/dist/subscriberbot/pages/DashboardPage.js.map +1 -0
  17. package/dist/subscriberbot/pages/InboxPage.js +186 -0
  18. package/dist/subscriberbot/pages/InboxPage.js.map +1 -0
  19. package/dist/subscriberbot/pages/InvoicesPage.js +211 -0
  20. package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -0
  21. package/dist/subscriberbot/pages/WorkflowsPage.js +236 -0
  22. package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -0
  23. package/dist/subscriberbot/pages/agents/AgentDetailPage.js +160 -0
  24. package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -0
  25. package/dist/subscriberbot/pages/agents/AgentNewPage.js +140 -0
  26. package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -0
  27. package/dist/subscriberbot/pages/agents/AgentsListPage.js +178 -0
  28. package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -0
  29. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +179 -0
  30. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -0
  31. package/dist/subscriberbot/pages/providers/ProviderNewPage.js +185 -0
  32. package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -0
  33. package/dist/subscriberbot/pages/providers/ProvidersListPage.js +254 -0
  34. package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -0
  35. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +306 -0
  36. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -0
  37. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +253 -0
  38. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -0
  39. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +248 -0
  40. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -0
  41. package/dist/subscriberbot/utils/formatters.js +50 -32
  42. package/dist/subscriberbot/utils/formatters.js.map +1 -1
  43. package/package.json +1 -1
  44. package/dist/subscriberbot/components/InvestmentCard.js +0 -97
  45. package/dist/subscriberbot/components/InvestmentCard.js.map +0 -1
  46. package/dist/subscriberbot/components/RatingDisplay.js +0 -35
  47. package/dist/subscriberbot/components/RatingDisplay.js.map +0 -1
  48. package/dist/subscriberbot/mocks/data.js +0 -1517
  49. package/dist/subscriberbot/mocks/data.js.map +0 -1
  50. package/dist/subscriberbot/mocks/users.js +0 -34
  51. package/dist/subscriberbot/mocks/users.js.map +0 -1
  52. package/dist/subscriberbot/pages/HomePage.js +0 -930
  53. package/dist/subscriberbot/pages/HomePage.js.map +0 -1
  54. package/dist/subscriberbot/pages/admin/AdminAnalyticsPage.js +0 -651
  55. package/dist/subscriberbot/pages/admin/AdminAnalyticsPage.js.map +0 -1
  56. package/dist/subscriberbot/pages/admin/AdminDashboard.js +0 -679
  57. package/dist/subscriberbot/pages/admin/AdminDashboard.js.map +0 -1
  58. package/dist/subscriberbot/pages/admin/AdminFinancialPage.js +0 -427
  59. package/dist/subscriberbot/pages/admin/AdminFinancialPage.js.map +0 -1
  60. package/dist/subscriberbot/pages/admin/AdminOrdersPage.js +0 -665
  61. package/dist/subscriberbot/pages/admin/AdminOrdersPage.js.map +0 -1
  62. package/dist/subscriberbot/pages/admin/AdminProfilePage.js +0 -261
  63. package/dist/subscriberbot/pages/admin/AdminProfilePage.js.map +0 -1
  64. package/dist/subscriberbot/pages/admin/AdminSettingsPage.js +0 -654
  65. package/dist/subscriberbot/pages/admin/AdminSettingsPage.js.map +0 -1
  66. package/dist/subscriberbot/pages/admin/CartManagementPage.js +0 -874
  67. package/dist/subscriberbot/pages/admin/CartManagementPage.js.map +0 -1
  68. package/dist/subscriberbot/pages/admin/UserManagementPage.js +0 -898
  69. package/dist/subscriberbot/pages/admin/UserManagementPage.js.map +0 -1
  70. package/dist/subscriberbot/pages/cart-owner/AnalyticsDashboard.js +0 -839
  71. package/dist/subscriberbot/pages/cart-owner/AnalyticsDashboard.js.map +0 -1
  72. package/dist/subscriberbot/pages/cart-owner/BusinessSettingsPage.js +0 -705
  73. package/dist/subscriberbot/pages/cart-owner/BusinessSettingsPage.js.map +0 -1
  74. package/dist/subscriberbot/pages/cart-owner/CartOwnerDashboard.js +0 -802
  75. package/dist/subscriberbot/pages/cart-owner/CartOwnerDashboard.js.map +0 -1
  76. package/dist/subscriberbot/pages/cart-owner/CartOwnerProfilePage.js +0 -891
  77. package/dist/subscriberbot/pages/cart-owner/CartOwnerProfilePage.js.map +0 -1
  78. package/dist/subscriberbot/pages/cart-owner/CartServiceConfigPage.js +0 -633
  79. package/dist/subscriberbot/pages/cart-owner/CartServiceConfigPage.js.map +0 -1
  80. package/dist/subscriberbot/pages/cart-owner/InventoryManagementPage.js +0 -910
  81. package/dist/subscriberbot/pages/cart-owner/InventoryManagementPage.js.map +0 -1
  82. package/dist/subscriberbot/pages/cart-owner/OrderManagementPage.js +0 -879
  83. package/dist/subscriberbot/pages/cart-owner/OrderManagementPage.js.map +0 -1
  84. package/dist/subscriberbot/pages/cart-owner/StaffManagementPage.js +0 -838
  85. package/dist/subscriberbot/pages/cart-owner/StaffManagementPage.js.map +0 -1
  86. package/dist/subscriberbot/pages/common/HelpSupportPage.js +0 -1323
  87. package/dist/subscriberbot/pages/common/HelpSupportPage.js.map +0 -1
  88. package/dist/subscriberbot/pages/common/NotificationCenterPage.js +0 -672
  89. package/dist/subscriberbot/pages/common/NotificationCenterPage.js.map +0 -1
  90. package/dist/subscriberbot/pages/common/SettingsPage.js +0 -973
  91. package/dist/subscriberbot/pages/common/SettingsPage.js.map +0 -1
  92. package/dist/subscriberbot/pages/customer/BookingDetailsPage.js +0 -626
  93. package/dist/subscriberbot/pages/customer/BookingDetailsPage.js.map +0 -1
  94. package/dist/subscriberbot/pages/customer/CartDetailPage.js +0 -654
  95. package/dist/subscriberbot/pages/customer/CartDetailPage.js.map +0 -1
  96. package/dist/subscriberbot/pages/customer/CartDiscoveryPage.js +0 -555
  97. package/dist/subscriberbot/pages/customer/CartDiscoveryPage.js.map +0 -1
  98. package/dist/subscriberbot/pages/customer/CheckoutPage.js +0 -529
  99. package/dist/subscriberbot/pages/customer/CheckoutPage.js.map +0 -1
  100. package/dist/subscriberbot/pages/customer/CustomerDashboard.js +0 -532
  101. package/dist/subscriberbot/pages/customer/CustomerDashboard.js.map +0 -1
  102. package/dist/subscriberbot/pages/customer/CustomerProfilePage.js +0 -630
  103. package/dist/subscriberbot/pages/customer/CustomerProfilePage.js.map +0 -1
  104. package/dist/subscriberbot/pages/customer/DirectServiceBookingPage.js +0 -633
  105. package/dist/subscriberbot/pages/customer/DirectServiceBookingPage.js.map +0 -1
  106. package/dist/subscriberbot/pages/customer/FavoritesPage.js +0 -484
  107. package/dist/subscriberbot/pages/customer/FavoritesPage.js.map +0 -1
  108. package/dist/subscriberbot/pages/customer/OrderHistoryPage.js +0 -446
  109. package/dist/subscriberbot/pages/customer/OrderHistoryPage.js.map +0 -1
  110. package/dist/subscriberbot/pages/customer/OrderTrackingPage.js +0 -394
  111. package/dist/subscriberbot/pages/customer/OrderTrackingPage.js.map +0 -1
  112. package/dist/subscriberbot/pages/customer/PaymentMethodsPage.js +0 -495
  113. package/dist/subscriberbot/pages/customer/PaymentMethodsPage.js.map +0 -1
  114. package/dist/subscriberbot/pages/customer/ReviewsPage.js +0 -613
  115. package/dist/subscriberbot/pages/customer/ReviewsPage.js.map +0 -1
  116. package/dist/subscriberbot/pages/customer/SavedAddressesPage.js +0 -450
  117. package/dist/subscriberbot/pages/customer/SavedAddressesPage.js.map +0 -1
  118. package/dist/subscriberbot/pages/investor/InvestmentDetailsPage.js +0 -886
  119. package/dist/subscriberbot/pages/investor/InvestmentDetailsPage.js.map +0 -1
  120. package/dist/subscriberbot/pages/investor/InvestmentOpportunitiesPage.js +0 -947
  121. package/dist/subscriberbot/pages/investor/InvestmentOpportunitiesPage.js.map +0 -1
  122. package/dist/subscriberbot/pages/investor/InvestorAnalyticsPage.js +0 -687
  123. package/dist/subscriberbot/pages/investor/InvestorAnalyticsPage.js.map +0 -1
  124. package/dist/subscriberbot/pages/investor/InvestorDashboard.js +0 -451
  125. package/dist/subscriberbot/pages/investor/InvestorDashboard.js.map +0 -1
  126. package/dist/subscriberbot/pages/investor/InvestorInvestmentsPage.js +0 -406
  127. package/dist/subscriberbot/pages/investor/InvestorInvestmentsPage.js.map +0 -1
  128. package/dist/subscriberbot/pages/investor/InvestorPortfolioPage.js +0 -575
  129. package/dist/subscriberbot/pages/investor/InvestorPortfolioPage.js.map +0 -1
  130. package/dist/subscriberbot/pages/investor/InvestorProfilePage.js +0 -1070
  131. package/dist/subscriberbot/pages/investor/InvestorProfilePage.js.map +0 -1
  132. package/dist/subscriberbot/pages/worker/TaskDetailsPage.js +0 -535
  133. package/dist/subscriberbot/pages/worker/TaskDetailsPage.js.map +0 -1
  134. package/dist/subscriberbot/pages/worker/WorkerDashboard.js +0 -666
  135. package/dist/subscriberbot/pages/worker/WorkerDashboard.js.map +0 -1
  136. package/dist/subscriberbot/pages/worker/WorkerOrdersPage.js +0 -681
  137. package/dist/subscriberbot/pages/worker/WorkerOrdersPage.js.map +0 -1
  138. package/dist/subscriberbot/pages/worker/WorkerProfilePage.js +0 -692
  139. package/dist/subscriberbot/pages/worker/WorkerProfilePage.js.map +0 -1
  140. package/dist/subscriberbot/pages/worker/WorkerSchedulePage.js +0 -588
  141. package/dist/subscriberbot/pages/worker/WorkerSchedulePage.js.map +0 -1
@@ -1,11 +1,10 @@
1
1
  import { useSubscriberBot as e } from "../context/SubscriberBotContext.js";
2
2
  import "../context/index.js";
3
- import { useMemo as t } from "react";
4
- import { useMutation as n, useQuery as r, useQueryClient as i } from "@tanstack/react-query";
5
- import { graphqlFetch as a } from "@burdenoff/fe-libs/shared/graphql";
3
+ import { useMutation as t, useQuery as n, useQueryClient as r } from "@tanstack/react-query";
4
+ import { graphqlFetch as i } from "@burdenoff/fe-libs/shared/graphql";
6
5
  //#region src/subscriberbot/hooks/useSubscriberBotApi.ts
7
- var o = async (e, t, n) => {
8
- let r = await a({
6
+ var a = async (e, t, n) => {
7
+ let r = await i({
9
8
  gateway: "workspace",
10
9
  baseUrl: n,
11
10
  query: e,
@@ -15,209 +14,357 @@ var o = async (e, t, n) => {
15
14
  if (r.errors?.length) throw Error(r.errors[0]?.message ?? "GraphQL request failed");
16
15
  if (!r.data) throw Error("GraphQL response did not include data");
17
16
  return r.data;
18
- }, s = (t) => {
19
- let { apiGatewayUrl: n } = e();
20
- return r({
21
- queryKey: [
22
- "subscriberbot",
23
- "providers",
24
- t
25
- ],
26
- queryFn: async () => (await o("query Providers($filter: SubscriberBotProviderFilterInput) {\n listServiceProviders(filter: $filter, limit: 200) {\n id name slug category status rating totalRatings averageOrderValue serviceTypes location businessHours createdAt\n }\n }", { filter: t ? { query: t } : void 0 }, n)).listServiceProviders.map((e) => ({
27
- ...e,
28
- image: "https://images.unsplash.com/photo-1567620905732-2d1ec7ab7445?w=400",
29
- images: ["https://images.unsplash.com/photo-1567620905732-2d1ec7ab7445?w=400"],
30
- isOpen: e.status === "ACTIVE" || e.status === "VERIFIED",
31
- isVerified: e.status === "VERIFIED",
32
- distance: .5,
33
- estimatedTime: 20,
34
- createdAt: e.createdAt
35
- }))
36
- });
37
- }, c = (t) => {
38
- let { apiGatewayUrl: n } = e();
39
- return r({
40
- queryKey: [
41
- "subscriberbot",
42
- "offerings",
43
- t
44
- ],
45
- queryFn: async () => (await o("query Offerings($providerId: String) {\n listOfferings(providerId: $providerId, limit: 300) {\n id providerId kind name slug category description price originalPrice stock durationMinutes serviceType tags isAvailable metadata media\n }\n }", { providerId: t }, n)).listOfferings,
46
- enabled: !!t
47
- });
48
- }, l = (t = {}) => {
49
- let { apiGatewayUrl: n } = e();
50
- return r({
51
- queryKey: [
52
- "subscriberbot",
53
- "orders",
54
- t.providerId,
55
- t.customerId
56
- ],
57
- queryFn: async () => (await o("query Orders($providerId: String, $customerId: String) {\n listOrders(providerId: $providerId, customerId: $customerId, limit: 200) {\n id orderNumber providerId customerId status paymentStatus fulfillmentType subtotal tax deliveryFee discount total notes timeline paymentMethod deliveryAddress createdAt\n provider { name }\n items { id offeringId name quantity unitPrice totalPrice customizations }\n }\n }", t, n)).listOrders.map((e) => ({
58
- id: e.id,
59
- cartId: e.providerId,
60
- cartName: e.provider?.name || "Unknown Cart",
61
- cartImage: "https://images.unsplash.com/photo-1567620905732-2d1ec7ab7445?w=100",
62
- items: e.items.map((e) => ({
63
- id: e.id,
64
- name: e.name,
65
- quantity: e.quantity,
66
- price: e.unitPrice,
67
- customizations: e.customizations
68
- })),
69
- total: e.total,
70
- subtotal: e.subtotal,
71
- taxes: e.tax,
72
- deliveryFee: e.deliveryFee,
73
- discount: e.discount,
74
- status: e.status.toLowerCase(),
75
- orderDate: e.createdAt,
76
- deliveryAddress: e.deliveryAddress,
77
- paymentMethod: e.paymentMethod || "Cash",
78
- paymentStatus: e.paymentStatus.toLowerCase(),
79
- timeline: e.timeline || []
80
- }))
81
- });
82
- }, u = () => {
83
- let { apiGatewayUrl: t } = e();
84
- return r({
85
- queryKey: ["subscriberbot", "dashboard-stats"],
86
- queryFn: async () => (await o("query DashboardStats { subscriberbotDashboardStats { totalOrders totalRevenue activeProviders activeCustomers avgRating pendingOrders } }", {}, t)).subscriberbotDashboardStats
87
- });
88
- }, d = () => {
89
- let { apiGatewayUrl: t } = e();
90
- return r({
91
- queryKey: ["subscriberbot", "investment-opportunities"],
92
- queryFn: async () => (await o("query Opportunities {\n listInvestmentOpportunities(limit: 200) {\n id providerId title description targetAmount raisedAmount minimumInvestment expectedReturnsPct lockInMonths riskLevel status expiresAt terms businessMetrics createdAt\n provider { name }\n }\n }", {}, t)).listInvestmentOpportunities.map((e) => ({
93
- id: e.id,
94
- cartId: e.providerId,
95
- cartName: e.provider?.name || "Unknown Cart",
96
- businessOwner: "Owner",
97
- targetAmount: e.targetAmount,
98
- raisedAmount: e.raisedAmount,
99
- minimumInvestment: e.minimumInvestment,
100
- expectedReturns: e.expectedReturnsPct,
101
- investmentPeriod: e.lockInMonths,
102
- riskLevel: e.riskLevel.toLowerCase(),
103
- description: e.description,
104
- businessPlan: "",
105
- financialProjections: [],
106
- documents: [],
107
- investors: [],
108
- status: e.status.toLowerCase(),
109
- createdAt: e.createdAt,
110
- expiresAt: e.expiresAt
111
- }))
112
- });
113
- }, f = (t) => {
114
- let { apiGatewayUrl: n } = e();
115
- return r({
116
- queryKey: [
117
- "subscriberbot",
118
- "investments",
119
- t
120
- ],
121
- queryFn: async () => (await o("query Investments($investorId: String!) {\n listInvestments(investorId: $investorId) {\n id opportunityId amount currentValue expectedReturnsPct status investedAt maturedAt realizedReturns\n opportunity { provider { name } }\n }\n }", { investorId: t }, n)).listInvestments.map((e) => ({
122
- id: e.id,
123
- opportunityId: e.opportunityId,
124
- cartName: e.opportunity?.provider?.name || "Unknown Cart",
125
- investedAmount: e.amount,
126
- currentValue: e.currentValue,
127
- returns: e.realizedReturns,
128
- returnsPercentage: e.expectedReturnsPct,
129
- investmentDate: e.investedAt,
130
- status: e.status.toLowerCase()
131
- })),
132
- enabled: !!t
133
- });
134
- }, p = (t) => {
135
- let { apiGatewayUrl: n } = e();
136
- return r({
137
- queryKey: [
138
- "subscriberbot",
139
- "worker-tasks",
140
- t
141
- ],
142
- queryFn: async () => (await o("query WorkerTasks($workerId: String!) {\n listWorkerTasks(workerId: $workerId, limit: 100) {\n id orderId providerId type description priority status assignedAt dueAt completedAt customerName customerPhone earnings distance notes\n provider { name }\n order { deliveryAddress }\n }\n }", { workerId: t }, n)).listWorkerTasks.map((e) => ({
143
- id: e.id,
144
- orderId: e.orderId,
145
- cartId: e.providerId,
146
- cartName: e.provider?.name || "Unknown Cart",
147
- type: e.type.toLowerCase(),
148
- description: e.description,
149
- priority: e.priority.toLowerCase(),
150
- status: e.status.toLowerCase(),
151
- assignedAt: e.assignedAt,
152
- dueAt: e.dueAt,
153
- completedAt: e.completedAt,
154
- customerName: e.customerName,
155
- customerPhone: e.customerPhone,
156
- deliveryAddress: e.order?.deliveryAddress,
157
- earnings: e.earnings,
158
- distance: e.distance,
159
- notes: e.notes
160
- })),
161
- enabled: !!t
162
- });
163
- }, m = (t) => {
164
- let { apiGatewayUrl: n } = e();
165
- return r({
166
- queryKey: [
167
- "subscriberbot",
168
- "worker-stats",
169
- t
170
- ],
171
- queryFn: async () => (await o("query WorkerStats($workerId: String!) {\n subscriberbotWorkerStats(workerId: $workerId) {\n totalDeliveries totalEarnings averageRating completionRate todayTasks todayEarnings\n }\n }", { workerId: t }, n)).subscriberbotWorkerStats,
172
- enabled: !!t
173
- });
174
- }, h = () => {
175
- let t = i(), { apiGatewayUrl: r } = e();
17
+ }, o = {
18
+ relationships: ["subscriberbot", "relationships"],
19
+ relationship: (e) => [
20
+ "subscriberbot",
21
+ "relationship",
22
+ e
23
+ ],
24
+ providers: ["subscriberbot", "providers"],
25
+ provider: (e) => [
26
+ "subscriberbot",
27
+ "provider",
28
+ e
29
+ ],
30
+ plans: ["subscriberbot", "plans"],
31
+ inbox: ["subscriberbot", "inbox"],
32
+ invoices: ["subscriberbot", "invoices"],
33
+ paymentInstruments: ["subscriberbot", "payment-instruments"],
34
+ channels: ["subscriberbot", "channels"],
35
+ agents: ["subscriberbot", "agents"],
36
+ agent: (e) => [
37
+ "subscriberbot",
38
+ "agent",
39
+ e
40
+ ],
41
+ workflows: ["subscriberbot", "workflows"],
42
+ renewals: ["subscriberbot", "renewals"],
43
+ assets: ["subscriberbot", "assets"],
44
+ entitlements: ["subscriberbot", "entitlements"]
45
+ }, s = "\n id name slug category status description industry region language websiteUrl\n logoFileId tags churnRiskScore vendorHealthScore workspaceId createdAt updatedAt\n", c = "\n id name description providerId amount currency interval features isActive\n workspaceId createdAt updatedAt\n", l = "\n id label kind status amount currency interval autoRenew discoverySource notes\n tags healthScore ownerId providerId planId startedAt renewsAt trialEndsAt\n cancelledAt workspaceId createdAt updatedAt\n", u = "\n id subject preview category categoryConfidence channelId relationshipId\n externalId actionRequired isRead receivedAt workspaceId createdAt updatedAt\n", d = "\n id number relationshipId status currency subtotal taxAmount total issueDate\n dueDate paidAt paymentInstrumentId workspaceId createdAt updatedAt\n", f = "\n id name description kind status ownerId lastRunAt workspaceId createdAt updatedAt\n", p = "\n id name description triggerEvent status runCount lastRunAt workspaceId\n createdAt updatedAt\n", m = (t = {}) => {
46
+ let { apiGatewayUrl: r } = e();
176
47
  return n({
177
- mutationFn: async (e) => (await o("mutation PlaceOrder($input: SubscriberBotPlaceOrderInput!) {\n placeOrder(input: $input) {\n id orderNumber status total createdAt\n }\n }", { input: e }, r)).placeOrder,
48
+ queryKey: [...o.relationships, t],
49
+ queryFn: async () => (await a(`query SubRelationships(
50
+ $kind: SubRelationshipKind
51
+ $status: SubRelationshipStatus
52
+ $providerId: ID
53
+ $ownerId: ID
54
+ $pagination: PaginationInput
55
+ ) {
56
+ subListRelationships(
57
+ kind: $kind
58
+ status: $status
59
+ providerId: $providerId
60
+ ownerId: $ownerId
61
+ pagination: $pagination
62
+ ) {
63
+ items {
64
+ ${l}
65
+ provider { id name category status logoFileId }
66
+ plan { id name amount currency interval }
67
+ }
68
+ pageInfo { cursor hasMore }
69
+ }
70
+ }`, {
71
+ kind: t.kind,
72
+ status: t.status,
73
+ providerId: t.providerId,
74
+ ownerId: t.ownerId,
75
+ pagination: t.pagination ?? {
76
+ limit: 50,
77
+ offset: 0
78
+ }
79
+ }, r)).subListRelationships
80
+ });
81
+ }, h = (t) => {
82
+ let { apiGatewayUrl: r } = e();
83
+ return n({
84
+ queryKey: o.relationship(t ?? ""),
85
+ enabled: !!t,
86
+ queryFn: async () => (await a(`query SubRelationship($id: ID!) {
87
+ subRelationship(id: $id) {
88
+ ${l}
89
+ provider { ${s} }
90
+ plan { ${c} }
91
+ entitlements {
92
+ id name description type relationshipId quota used unit isActive
93
+ workspaceId createdAt updatedAt
94
+ }
95
+ assets {
96
+ id name type relationshipId secretRef expiresAt workspaceId
97
+ createdAt updatedAt file { id }
98
+ }
99
+ renewalEvents {
100
+ id relationshipId eventType occursAt amount currency detail
101
+ notified workspaceId createdAt updatedAt
102
+ }
103
+ }
104
+ }`, { id: t }, r)).subRelationship
105
+ });
106
+ }, g = () => {
107
+ let n = r(), { apiGatewayUrl: i } = e();
108
+ return t({
109
+ mutationFn: async (e) => (await a(`mutation SubCreateRelationship($input: SubCreateRelationshipInput!) {
110
+ subCreateRelationship(input: $input) { ${l} }
111
+ }`, { input: e }, i)).subCreateRelationship,
178
112
  onSuccess: () => {
179
- t.invalidateQueries({ queryKey: ["subscriberbot", "orders"] }), t.invalidateQueries({ queryKey: ["subscriberbot", "dashboard-stats"] });
113
+ n.invalidateQueries({ queryKey: o.relationships });
180
114
  }
181
115
  });
182
- }, g = () => {
183
- let t = i(), { apiGatewayUrl: r } = e();
184
- return n({
185
- mutationFn: async ({ taskId: e, status: t }) => (await o("mutation UpdateTaskStatus($taskId: String!, $status: SubscriberBotWorkerTaskStatus!) {\n subscriberbotUpdateWorkerTaskStatus(taskId: $taskId, status: $status) {\n id status\n }\n }", {
186
- taskId: e,
116
+ }, _ = () => {
117
+ let n = r(), { apiGatewayUrl: i } = e();
118
+ return t({
119
+ mutationFn: async ({ id: e, status: t }) => (await a(`mutation SubTransitionRelationship($id: ID!, $status: SubRelationshipStatus!) {
120
+ subTransitionRelationship(id: $id, status: $status) { ${l} }
121
+ }`, {
122
+ id: e,
187
123
  status: t
188
- }, r)).subscriberbotUpdateWorkerTaskStatus,
124
+ }, i)).subTransitionRelationship,
125
+ onSuccess: (e) => {
126
+ n.invalidateQueries({ queryKey: o.relationships }), n.invalidateQueries({ queryKey: o.relationship(e.id) });
127
+ }
128
+ });
129
+ }, v = () => {
130
+ let n = r(), { apiGatewayUrl: i } = e();
131
+ return t({
132
+ mutationFn: async (e) => (await a(`mutation SubCancelRelationship($id: ID!) {
133
+ subCancelRelationship(id: $id) { ${l} }
134
+ }`, { id: e }, i)).subCancelRelationship,
135
+ onSuccess: (e) => {
136
+ n.invalidateQueries({ queryKey: o.relationships }), n.invalidateQueries({ queryKey: o.relationship(e.id) });
137
+ }
138
+ });
139
+ }, y = (t = {}) => {
140
+ let { apiGatewayUrl: r } = e();
141
+ return n({
142
+ queryKey: [...o.renewals, t],
143
+ queryFn: async () => (await a("query SubRenewalEvents($relationshipId: ID, $upcomingOnly: Boolean) {\n subListRenewalEvents(relationshipId: $relationshipId, upcomingOnly: $upcomingOnly) {\n id relationshipId eventType occursAt amount currency detail notified\n workspaceId createdAt updatedAt\n }\n }", {
144
+ relationshipId: t.relationshipId,
145
+ upcomingOnly: t.upcomingOnly
146
+ }, r)).subListRenewalEvents
147
+ });
148
+ }, b = (t = {}) => {
149
+ let { apiGatewayUrl: r } = e();
150
+ return n({
151
+ queryKey: [...o.providers, t],
152
+ queryFn: async () => (await a(`query SubProviders(
153
+ $category: SubProviderCategory
154
+ $status: SubProviderStatus
155
+ $search: String
156
+ $pagination: PaginationInput
157
+ ) {
158
+ subListProviders(
159
+ category: $category
160
+ status: $status
161
+ search: $search
162
+ pagination: $pagination
163
+ ) {
164
+ items { ${s} }
165
+ pageInfo { cursor hasMore }
166
+ }
167
+ }`, {
168
+ category: t.category,
169
+ status: t.status,
170
+ search: t.search,
171
+ pagination: t.pagination ?? {
172
+ limit: 50,
173
+ offset: 0
174
+ }
175
+ }, r)).subListProviders
176
+ });
177
+ }, x = (t) => {
178
+ let { apiGatewayUrl: r } = e();
179
+ return n({
180
+ queryKey: o.provider(t ?? ""),
181
+ enabled: !!t,
182
+ queryFn: async () => (await a(`query SubProvider($id: ID!) {
183
+ subProvider(id: $id) {
184
+ ${s}
185
+ plans { ${c} }
186
+ }
187
+ }`, { id: t }, r)).subProvider
188
+ });
189
+ }, S = () => {
190
+ let n = r(), { apiGatewayUrl: i } = e();
191
+ return t({
192
+ mutationFn: async (e) => (await a(`mutation SubCreateProvider($input: SubCreateProviderInput!) {
193
+ subCreateProvider(input: $input) { ${s} }
194
+ }`, { input: e }, i)).subCreateProvider,
189
195
  onSuccess: () => {
190
- t.invalidateQueries({ queryKey: ["subscriberbot", "worker-tasks"] }), t.invalidateQueries({ queryKey: ["subscriberbot", "worker-stats"] });
196
+ n.invalidateQueries({ queryKey: o.providers });
191
197
  }
192
198
  });
193
- }, _ = () => {
194
- let t = i(), { apiGatewayUrl: r } = e();
199
+ }, C = (t) => {
200
+ let { apiGatewayUrl: r } = e();
201
+ return n({
202
+ queryKey: [...o.plans, t],
203
+ enabled: !!t,
204
+ queryFn: async () => (await a(`query SubPlans($providerId: ID) {
205
+ subListPlans(providerId: $providerId) { ${c} }
206
+ }`, { providerId: t }, r)).subListPlans
207
+ });
208
+ }, w = (t = {}) => {
209
+ let { apiGatewayUrl: r } = e();
195
210
  return n({
196
- mutationFn: async ({ workerId: e, action: t }) => (await o("mutation ClockInOut($workerId: String!, $action: SubscriberBotClockAction!) {\n subscriberbotWorkerClockInOut(workerId: $workerId, action: $action) {\n success message\n }\n }", {
197
- workerId: e,
198
- action: t
199
- }, r)).subscriberbotWorkerClockInOut,
211
+ queryKey: [...o.inbox, t],
212
+ queryFn: async () => (await a(`query SubInboxMessages(
213
+ $category: SubMessageCategory
214
+ $channelId: ID
215
+ $relationshipId: ID
216
+ $unreadOnly: Boolean
217
+ $pagination: PaginationInput
218
+ ) {
219
+ subListInboxMessages(
220
+ category: $category
221
+ channelId: $channelId
222
+ relationshipId: $relationshipId
223
+ unreadOnly: $unreadOnly
224
+ pagination: $pagination
225
+ ) {
226
+ items { ${u} }
227
+ pageInfo { cursor hasMore }
228
+ }
229
+ }`, {
230
+ category: t.category,
231
+ channelId: t.channelId,
232
+ relationshipId: t.relationshipId,
233
+ unreadOnly: t.unreadOnly,
234
+ pagination: t.pagination ?? {
235
+ limit: 50,
236
+ offset: 0
237
+ }
238
+ }, r)).subListInboxMessages
239
+ });
240
+ }, T = () => {
241
+ let n = r(), { apiGatewayUrl: i } = e();
242
+ return t({
243
+ mutationFn: async (e) => (await a(`mutation SubMarkMessageRead($id: ID!) {
244
+ subMarkMessageRead(id: $id) { ${u} }
245
+ }`, { id: e }, i)).subMarkMessageRead,
200
246
  onSuccess: () => {
201
- t.invalidateQueries({ queryKey: ["subscriberbot", "worker-schedules"] });
247
+ n.invalidateQueries({ queryKey: o.inbox });
248
+ }
249
+ });
250
+ }, E = (t = {}) => {
251
+ let { apiGatewayUrl: r } = e();
252
+ return n({
253
+ queryKey: [...o.invoices, t],
254
+ queryFn: async () => (await a(`query SubInvoices(
255
+ $status: SubInvoiceStatus
256
+ $relationshipId: ID
257
+ $pagination: PaginationInput
258
+ ) {
259
+ subListInvoices(
260
+ status: $status
261
+ relationshipId: $relationshipId
262
+ pagination: $pagination
263
+ ) {
264
+ items { ${d} }
265
+ pageInfo { cursor hasMore }
266
+ }
267
+ }`, {
268
+ status: t.status,
269
+ relationshipId: t.relationshipId,
270
+ pagination: t.pagination ?? {
271
+ limit: 50,
272
+ offset: 0
273
+ }
274
+ }, r)).subListInvoices
275
+ });
276
+ }, D = () => {
277
+ let n = r(), { apiGatewayUrl: i } = e();
278
+ return t({
279
+ mutationFn: async (e) => (await a(`mutation SubMarkInvoicePaid($id: ID!) {
280
+ subMarkInvoicePaid(id: $id) { ${d} }
281
+ }`, { id: e }, i)).subMarkInvoicePaid,
282
+ onSuccess: () => {
283
+ n.invalidateQueries({ queryKey: o.invoices });
284
+ }
285
+ });
286
+ }, O = (t = {}) => {
287
+ let { apiGatewayUrl: r } = e();
288
+ return n({
289
+ queryKey: [...o.agents, t],
290
+ queryFn: async () => (await a(`query SubAgents($kind: SubAgentKind, $status: SubAgentStatus, $ownerId: ID) {
291
+ subListAgents(kind: $kind, status: $status, ownerId: $ownerId) {
292
+ ${f}
293
+ }
294
+ }`, {
295
+ kind: t.kind,
296
+ status: t.status,
297
+ ownerId: t.ownerId
298
+ }, r)).subListAgents
299
+ });
300
+ }, k = (t) => {
301
+ let { apiGatewayUrl: r } = e();
302
+ return n({
303
+ queryKey: o.agent(t ?? ""),
304
+ enabled: !!t,
305
+ queryFn: async () => (await a(`query SubAgent($id: ID!) {
306
+ subAgent(id: $id) {
307
+ ${f}
308
+ policies {
309
+ id name description action agentId isEnabled triggerCount
310
+ lastTriggeredAt workspaceId createdAt updatedAt
311
+ }
312
+ }
313
+ }`, { id: t }, r)).subAgent
314
+ });
315
+ }, A = () => {
316
+ let n = r(), { apiGatewayUrl: i } = e();
317
+ return t({
318
+ mutationFn: async (e) => (await a(`mutation SubCreateAgent($input: SubCreateAgentInput!) {
319
+ subCreateAgent(input: $input) { ${f} }
320
+ }`, { input: e }, i)).subCreateAgent,
321
+ onSuccess: () => {
322
+ n.invalidateQueries({ queryKey: o.agents });
323
+ }
324
+ });
325
+ }, j = () => {
326
+ let n = r(), { apiGatewayUrl: i } = e();
327
+ return t({
328
+ mutationFn: async ({ id: e, status: t }) => (await a(`mutation SubSetAgentStatus($id: ID!, $status: SubAgentStatus!) {
329
+ subSetAgentStatus(id: $id, status: $status) { ${f} }
330
+ }`, {
331
+ id: e,
332
+ status: t
333
+ }, i)).subSetAgentStatus,
334
+ onSuccess: (e) => {
335
+ n.invalidateQueries({ queryKey: o.agents }), n.invalidateQueries({ queryKey: o.agent(e.id) });
336
+ }
337
+ });
338
+ }, M = (t) => {
339
+ let { apiGatewayUrl: r } = e();
340
+ return n({
341
+ queryKey: [...o.workflows, t],
342
+ queryFn: async () => (await a(`query SubWorkflows($status: SubWorkflowStatus) {
343
+ subListWorkflows(status: $status) { ${p} }
344
+ }`, { status: t }, r)).subListWorkflows
345
+ });
346
+ }, N = () => {
347
+ let n = r(), { apiGatewayUrl: i } = e();
348
+ return t({
349
+ mutationFn: async (e) => (await a(`mutation SubCreateWorkflow($input: SubCreateWorkflowInput!) {
350
+ subCreateWorkflow(input: $input) { ${p} }
351
+ }`, { input: e }, i)).subCreateWorkflow,
352
+ onSuccess: () => {
353
+ n.invalidateQueries({ queryKey: o.workflows });
354
+ }
355
+ });
356
+ }, P = () => {
357
+ let n = r(), { apiGatewayUrl: i } = e();
358
+ return t({
359
+ mutationFn: async (e) => (await a(`mutation SubActivateWorkflow($id: ID!) {
360
+ subActivateWorkflow(id: $id) { ${p} }
361
+ }`, { id: e }, i)).subActivateWorkflow,
362
+ onSuccess: () => {
363
+ n.invalidateQueries({ queryKey: o.workflows });
202
364
  }
203
365
  });
204
- }, v = () => {
205
- let { currentUser: n } = e(), r = s(), i = l({ customerId: n?.id }), a = u(), o = d(), c = f(n?.id || "");
206
- return t(() => ({
207
- providers: r,
208
- orders: i,
209
- dashboardStats: a,
210
- investmentOpportunities: o,
211
- investments: c
212
- }), [
213
- r,
214
- i,
215
- a,
216
- o,
217
- c
218
- ]);
219
366
  };
220
367
  //#endregion
221
- export { u as useDashboardStats, d as useInvestmentOpportunities, f as useInvestments, c as useOfferings, l as useOrders, h as usePlaceOrder, s as useProviders, v as useSubscriberBotApi, g as useUpdateWorkerTaskStatus, _ as useWorkerClockInOut, m as useWorkerStats, p as useWorkerTasks };
368
+ export { P as useActivateWorkflow, k as useAgent, O as useAgents, v as useCancelRelationship, A as useCreateAgent, S as useCreateProvider, g as useCreateRelationship, N as useCreateWorkflow, w as useInboxMessages, E as useInvoices, D as useMarkInvoicePaid, T as useMarkMessageRead, C as usePlans, x as useProvider, b as useProviders, h as useRelationship, m as useRelationships, y as useRenewalEvents, j as useSetAgentStatus, _ as useTransitionRelationship, M as useWorkflows };
222
369
 
223
370
  //# sourceMappingURL=useSubscriberBotApi.js.map