@burdenoff/microfe-subscriberbot 2026.1102.1 → 2026.1102.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.
Files changed (88) hide show
  1. package/dist/stories/pages/InsightsPage.stories.d.ts +1 -0
  2. package/dist/stories/pages/InsightsPage.stories.d.ts.map +1 -1
  3. package/dist/stories/pages/ProcurementDetailPage.stories.d.ts +10 -0
  4. package/dist/stories/pages/ProcurementDetailPage.stories.d.ts.map +1 -0
  5. package/dist/stories/pages/ProcurementNewPage.stories.d.ts +9 -0
  6. package/dist/stories/pages/ProcurementNewPage.stories.d.ts.map +1 -0
  7. package/dist/stories/pages/ProcurementPage.stories.d.ts +11 -0
  8. package/dist/stories/pages/ProcurementPage.stories.d.ts.map +1 -0
  9. package/dist/stories/pages/RenewalsPage.stories.d.ts +18 -0
  10. package/dist/stories/pages/RenewalsPage.stories.d.ts.map +1 -0
  11. package/dist/stories/support/fixtures.d.ts +2 -1
  12. package/dist/stories/support/fixtures.d.ts.map +1 -1
  13. package/dist/stories/support/handlers.d.ts.map +1 -1
  14. package/dist/stories/support/procurementFixtures.d.ts +14 -0
  15. package/dist/stories/support/procurementFixtures.d.ts.map +1 -0
  16. package/dist/subscriberbot/SubscriberBotRoot.d.ts.map +1 -1
  17. package/dist/subscriberbot/SubscriberBotRoot.js +57 -49
  18. package/dist/subscriberbot/SubscriberBotRoot.js.map +1 -1
  19. package/dist/subscriberbot/SubscriberBotRoutes.d.ts.map +1 -1
  20. package/dist/subscriberbot/SubscriberBotRoutes.js +25 -9
  21. package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
  22. package/dist/subscriberbot/admin/AdminDashboardPage.d.ts.map +1 -1
  23. package/dist/subscriberbot/admin/AdminDashboardPage.js +170 -160
  24. package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
  25. package/dist/subscriberbot/admin/ProcurementDeskPanel.d.ts +4 -0
  26. package/dist/subscriberbot/admin/ProcurementDeskPanel.d.ts.map +1 -0
  27. package/dist/subscriberbot/admin/ProcurementDeskPanel.js +450 -0
  28. package/dist/subscriberbot/admin/ProcurementDeskPanel.js.map +1 -0
  29. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.d.ts +12 -0
  30. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.d.ts.map +1 -0
  31. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js +155 -0
  32. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js.map +1 -0
  33. package/dist/subscriberbot/components/procurement/ProcurementStatusPill.d.ts +8 -0
  34. package/dist/subscriberbot/components/procurement/ProcurementStatusPill.d.ts.map +1 -0
  35. package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js +18 -0
  36. package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js.map +1 -0
  37. package/dist/subscriberbot/components/procurement/ProcurementThread.d.ts +13 -0
  38. package/dist/subscriberbot/components/procurement/ProcurementThread.d.ts.map +1 -0
  39. package/dist/subscriberbot/components/procurement/ProcurementThread.js +51 -0
  40. package/dist/subscriberbot/components/procurement/ProcurementThread.js.map +1 -0
  41. package/dist/subscriberbot/components/procurement/index.d.ts +5 -0
  42. package/dist/subscriberbot/components/procurement/index.d.ts.map +1 -0
  43. package/dist/subscriberbot/components/procurement/index.js +4 -0
  44. package/dist/subscriberbot/components/procurement/labels.d.ts +16 -0
  45. package/dist/subscriberbot/components/procurement/labels.d.ts.map +1 -0
  46. package/dist/subscriberbot/components/procurement/labels.js +154 -0
  47. package/dist/subscriberbot/components/procurement/labels.js.map +1 -0
  48. package/dist/subscriberbot/hooks/index.d.ts +1 -1
  49. package/dist/subscriberbot/hooks/index.d.ts.map +1 -1
  50. package/dist/subscriberbot/hooks/useProcurementApi.d.ts +58 -0
  51. package/dist/subscriberbot/hooks/useProcurementApi.d.ts.map +1 -0
  52. package/dist/subscriberbot/hooks/useProcurementApi.js +128 -0
  53. package/dist/subscriberbot/hooks/useProcurementApi.js.map +1 -0
  54. package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts +8 -1
  55. package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +1 -1
  56. package/dist/subscriberbot/hooks/useSubscriberBotApi.js +87 -36
  57. package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
  58. package/dist/subscriberbot/pages/InsightsPage.d.ts.map +1 -1
  59. package/dist/subscriberbot/pages/InsightsPage.js +12 -3
  60. package/dist/subscriberbot/pages/InsightsPage.js.map +1 -1
  61. package/dist/subscriberbot/pages/RenewalsPage.d.ts +4 -0
  62. package/dist/subscriberbot/pages/RenewalsPage.d.ts.map +1 -0
  63. package/dist/subscriberbot/pages/RenewalsPage.js +582 -0
  64. package/dist/subscriberbot/pages/RenewalsPage.js.map +1 -0
  65. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts +11 -0
  66. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts.map +1 -0
  67. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js +276 -0
  68. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js.map +1 -0
  69. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts +12 -0
  70. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts.map +1 -0
  71. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js +362 -0
  72. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js.map +1 -0
  73. package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts +11 -0
  74. package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts.map +1 -0
  75. package/dist/subscriberbot/pages/procurement/ProcurementPage.js +156 -0
  76. package/dist/subscriberbot/pages/procurement/ProcurementPage.js.map +1 -0
  77. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +1 -1
  78. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +323 -312
  79. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
  80. package/dist/subscriberbot/types/index.d.ts +79 -0
  81. package/dist/subscriberbot/types/index.d.ts.map +1 -1
  82. package/dist/subscriberbot/types/procurement.d.ts +127 -0
  83. package/dist/subscriberbot/types/procurement.d.ts.map +1 -0
  84. package/dist/subscriberbot/utils/renewals.d.ts +19 -0
  85. package/dist/subscriberbot/utils/renewals.d.ts.map +1 -0
  86. package/dist/subscriberbot/utils/renewals.js +26 -0
  87. package/dist/subscriberbot/utils/renewals.js.map +1 -0
  88. package/package.json +1 -1
@@ -0,0 +1,58 @@
1
+ import { SubConnection } from '../types';
2
+ import { SubCreateProcurementRequestInput, SubProcurementExpert, SubProcurementRequest, SubProcurementStatus, SubProcurementSummary, SubProcurementTerms, SubRecordProcurementOutcomeInput, SubUpsertProcurementExpertInput } from '../types/procurement';
3
+
4
+ export type ProcurementDeskView = 'ALL' | 'UNASSIGNED' | 'MINE';
5
+ export declare const useProcurementTerms: () => import('@tanstack/react-query').UseQueryResult<SubProcurementTerms, Error>;
6
+ /** Cursor-paged list of the workspace's requests; `fetchNextPage` loads more. */
7
+ export declare const useProcurementRequests: (status?: SubProcurementStatus | null) => import('@tanstack/react-query').UseInfiniteQueryResult<import('@tanstack/query-core').InfiniteData<SubConnection<SubProcurementRequest>, unknown>, Error>;
8
+ export declare const useProcurementRequest: (id: string | undefined) => import('@tanstack/react-query').UseQueryResult<SubProcurementRequest | null, Error>;
9
+ export declare const useProcurementSummary: () => import('@tanstack/react-query').UseQueryResult<SubProcurementSummary, Error>;
10
+ export declare const useCreateProcurementRequest: () => import('@tanstack/react-query').UseMutationResult<SubProcurementRequest, Error, {
11
+ input: SubCreateProcurementRequestInput;
12
+ }, unknown>;
13
+ export declare const useSubmitProcurementRequest: () => import('@tanstack/react-query').UseMutationResult<SubProcurementRequest, Error, {
14
+ id: string;
15
+ input: {
16
+ acceptAuthorization: boolean;
17
+ authorizationVersion: string;
18
+ };
19
+ }, unknown>;
20
+ export declare const useCancelProcurementRequest: () => import('@tanstack/react-query').UseMutationResult<SubProcurementRequest, Error, {
21
+ id: string;
22
+ reason?: string | null;
23
+ }, unknown>;
24
+ export declare const useSendProcurementMessage: () => import('@tanstack/react-query').UseMutationResult<SubProcurementRequest, Error, {
25
+ id: string;
26
+ message: string;
27
+ }, unknown>;
28
+ export declare const useDeskProcurementRequests: (status?: SubProcurementStatus | null, view?: ProcurementDeskView) => import('@tanstack/react-query').UseInfiniteQueryResult<import('@tanstack/query-core').InfiniteData<SubConnection<SubProcurementRequest>, unknown>, Error>;
29
+ export declare const useProcurementExperts: () => import('@tanstack/react-query').UseQueryResult<SubProcurementExpert[], Error>;
30
+ export declare const useUpsertProcurementExpert: () => import('@tanstack/react-query').UseMutationResult<SubProcurementExpert, Error, {
31
+ input: SubUpsertProcurementExpertInput;
32
+ }, unknown>;
33
+ export declare const useDeskAssignProcurement: () => import('@tanstack/react-query').UseMutationResult<SubProcurementRequest, Error, {
34
+ id: string;
35
+ expertId?: string | null;
36
+ }, unknown>;
37
+ export declare const useDeskSetProcurementStatus: () => import('@tanstack/react-query').UseMutationResult<SubProcurementRequest, Error, {
38
+ id: string;
39
+ status: SubProcurementStatus;
40
+ message?: string | null;
41
+ }, unknown>;
42
+ export declare const useDeskSendProcurementMessage: () => import('@tanstack/react-query').UseMutationResult<SubProcurementRequest, Error, {
43
+ id: string;
44
+ message: string;
45
+ internal?: boolean;
46
+ }, unknown>;
47
+ export declare const useDeskRecordProcurementOutcome: () => import('@tanstack/react-query').UseMutationResult<SubProcurementRequest, Error, {
48
+ id: string;
49
+ input: SubRecordProcurementOutcomeInput;
50
+ }, unknown>;
51
+ export declare const useDeskRetryProcurementFee: () => import('@tanstack/react-query').UseMutationResult<SubProcurementRequest, Error, {
52
+ id: string;
53
+ }, unknown>;
54
+ export declare const useDeskWaiveProcurementFee: () => import('@tanstack/react-query').UseMutationResult<SubProcurementRequest, Error, {
55
+ id: string;
56
+ reason: string;
57
+ }, unknown>;
58
+ //# sourceMappingURL=useProcurementApi.d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AAM,GAAG,IAAI;WAG5D,CAAC;AAEJ,eAAO,MAAM,2BAA2B;QACT,MAAM;YAAU,oBAAoB;cAAY,MAAM,GAAG,IAAI;WAGzF,CAAC;AAEJ,eAAO,MAAM,6BAA6B;QACX,MAAM;aAAW,MAAM;eAAa,OAAO;WAGvE,CAAC;AAEJ,eAAO,MAAM,+BAA+B;QACb,MAAM;WAAS,gCAAgC;WAG3E,CAAC;AAEJ,eAAO,MAAM,0BAA0B;QACR,MAAM;WAGlC,CAAC;AAEJ,eAAO,MAAM,0BAA0B;QACR,MAAM;YAAU,MAAM;WAGlD,CAAC"}
@@ -0,0 +1,128 @@
1
+ import { useSubscriberBot as e } from "../context/SubscriberBotContext.js";
2
+ import "../context/index.js";
3
+ import { subQuery as t } from "./useSubscriberBotApi.js";
4
+ import { useInfiniteQuery as n, useMutation as r, useQuery as i, useQueryClient as a } from "@tanstack/react-query";
5
+ //#region src/subscriberbot/hooks/useProcurementApi.ts
6
+ var o = {
7
+ all: ["subscriberbot", "procurement"],
8
+ list: (e) => [
9
+ "subscriberbot",
10
+ "procurement",
11
+ "list",
12
+ e
13
+ ],
14
+ one: (e) => [
15
+ "subscriberbot",
16
+ "procurement",
17
+ "one",
18
+ e
19
+ ],
20
+ summary: [
21
+ "subscriberbot",
22
+ "procurement",
23
+ "summary"
24
+ ],
25
+ terms: [
26
+ "subscriberbot",
27
+ "procurement",
28
+ "terms"
29
+ ],
30
+ desk: (e, t) => [
31
+ "subscriberbot",
32
+ "procurement",
33
+ "desk",
34
+ e,
35
+ t
36
+ ],
37
+ experts: [
38
+ "subscriberbot",
39
+ "procurement",
40
+ "experts"
41
+ ]
42
+ }, s = "\n id workspaceId ownerId relationshipId vendorName productName category requestType status\n currency currentAnnualValue quotedAnnualValue targetAnnualValue baselineAnnualValue termMonths\n seats deadline notes authorizationVersion authorizedAt submittedAt expertId expertName assignedAt\n startedAt completedAt finalAnnualValue finalTermMonths oneTimeCredit annualSavings\n firstYearSavings contractSavings nonPriceWins outcomeSummary feeRate feeAmount feeStatus\n feeBilledAt feeWaivedReason createdAt updatedAt\n", c = "events { id kind fromStatus toStatus message internal actorRole createdAt }", l = "id userId displayName email specialties maxOpenRequests active openRequests createdAt updatedAt", u = () => {
43
+ let { apiGatewayUrl: n } = e();
44
+ return i({
45
+ queryKey: o.terms,
46
+ queryFn: async () => (await t("query SubProcurementTerms {\n subProcurementTerms { authorizationVersion authorizationText feeRate maxTermMonths }\n }", {}, n)).subProcurementTerms,
47
+ staleTime: 300 * 1e3
48
+ });
49
+ }, d = 50, f = (e) => e.pageInfo.hasMore && e.pageInfo.cursor ? e.pageInfo.cursor : void 0, p = (r = null) => {
50
+ let { apiGatewayUrl: i } = e();
51
+ return n({
52
+ queryKey: o.list(r),
53
+ initialPageParam: null,
54
+ getNextPageParam: f,
55
+ queryFn: async ({ pageParam: e }) => (await t(`query SubListProcurementRequests($pagination: PaginationInput, $status: SubProcurementStatus) {
56
+ subListProcurementRequests(pagination: $pagination, status: $status) {
57
+ items { ${s} }
58
+ pageInfo { hasMore cursor }
59
+ }
60
+ }`, {
61
+ pagination: {
62
+ limit: d,
63
+ cursor: e
64
+ },
65
+ status: r
66
+ }, i)).subListProcurementRequests
67
+ });
68
+ }, m = (n) => {
69
+ let { apiGatewayUrl: r } = e();
70
+ return i({
71
+ queryKey: o.one(n ?? ""),
72
+ enabled: !!n,
73
+ queryFn: async () => (await t(`query SubProcurementRequest($id: ID!) {
74
+ subProcurementRequest(id: $id) { ${s} ${c} }
75
+ }`, { id: n }, r)).subProcurementRequest
76
+ });
77
+ }, h = () => {
78
+ let { apiGatewayUrl: n } = e();
79
+ return i({
80
+ queryKey: o.summary,
81
+ queryFn: async () => (await t("query SubProcurementSummary {\n subProcurementSummary {\n totalCount openCount succeededCount noSavingsCount\n totals { currency firstYearSavings contractSavings feesCharged succeededCount }\n }\n }", {}, n)).subProcurementSummary
82
+ });
83
+ };
84
+ function g(n, i) {
85
+ let s = a(), { apiGatewayUrl: c } = e();
86
+ return r({
87
+ mutationFn: async (e) => {
88
+ let r = (await t(i, e, c))[n];
89
+ if (!r) throw Error(`${n} returned no data`);
90
+ return r;
91
+ },
92
+ onSuccess: () => {
93
+ s.invalidateQueries({ queryKey: o.all });
94
+ }
95
+ });
96
+ }
97
+ var _ = `{ ${s} ${c} }`, v = () => g("subCreateProcurementRequest", `mutation SubCreateProcurementRequest($input: SubCreateProcurementRequestInput!) { subCreateProcurementRequest(input: $input) ${_} }`), y = () => g("subSubmitProcurementRequest", `mutation SubSubmitProcurementRequest($id: ID!, $input: SubSubmitProcurementRequestInput!) { subSubmitProcurementRequest(id: $id, input: $input) ${_} }`), b = () => g("subCancelProcurementRequest", `mutation SubCancelProcurementRequest($id: ID!, $reason: String) { subCancelProcurementRequest(id: $id, reason: $reason) ${_} }`), x = () => g("subSendProcurementMessage", `mutation SubSendProcurementMessage($id: ID!, $message: String!) { subSendProcurementMessage(id: $id, message: $message) ${_} }`), S = (r = null, i = "ALL") => {
98
+ let { apiGatewayUrl: a } = e();
99
+ return n({
100
+ queryKey: o.desk(r, i),
101
+ initialPageParam: null,
102
+ getNextPageParam: f,
103
+ queryFn: async ({ pageParam: e }) => (await t(`query SubAdminListProcurementRequests($pagination: PaginationInput, $status: SubProcurementStatus, $unassignedOnly: Boolean, $mine: Boolean) {
104
+ subAdminListProcurementRequests(pagination: $pagination, status: $status, unassignedOnly: $unassignedOnly, mine: $mine) {
105
+ items { ${s} ${c} }
106
+ pageInfo { hasMore cursor }
107
+ }
108
+ }`, {
109
+ pagination: {
110
+ limit: d,
111
+ cursor: e
112
+ },
113
+ status: r,
114
+ unassignedOnly: i === "UNASSIGNED",
115
+ mine: i === "MINE"
116
+ }, a)).subAdminListProcurementRequests
117
+ });
118
+ }, C = () => {
119
+ let { apiGatewayUrl: n } = e();
120
+ return i({
121
+ queryKey: o.experts,
122
+ queryFn: async () => (await t(`query SubAdminListProcurementExperts { subAdminListProcurementExperts(includeInactive: true) { ${l} } }`, {}, n)).subAdminListProcurementExperts
123
+ });
124
+ }, w = () => g("subAdminUpsertProcurementExpert", `mutation SubAdminUpsertProcurementExpert($input: SubUpsertProcurementExpertInput!) { subAdminUpsertProcurementExpert(input: $input) { ${l} } }`), T = () => g("subAdminAssignProcurementRequest", `mutation SubAdminAssignProcurementRequest($id: ID!, $expertId: ID) { subAdminAssignProcurementRequest(id: $id, expertId: $expertId) ${_} }`), E = () => g("subAdminSetProcurementStatus", `mutation SubAdminSetProcurementStatus($id: ID!, $status: SubProcurementStatus!, $message: String) { subAdminSetProcurementStatus(id: $id, status: $status, message: $message) ${_} }`), D = () => g("subAdminSendProcurementMessage", `mutation SubAdminSendProcurementMessage($id: ID!, $message: String!, $internal: Boolean) { subAdminSendProcurementMessage(id: $id, message: $message, internal: $internal) ${_} }`), O = () => g("subAdminRecordProcurementOutcome", `mutation SubAdminRecordProcurementOutcome($id: ID!, $input: SubRecordProcurementOutcomeInput!) { subAdminRecordProcurementOutcome(id: $id, input: $input) ${_} }`), k = () => g("subAdminRetryProcurementFeeBilling", `mutation SubAdminRetryProcurementFeeBilling($id: ID!) { subAdminRetryProcurementFeeBilling(id: $id) ${_} }`), A = () => g("subAdminWaiveProcurementFee", `mutation SubAdminWaiveProcurementFee($id: ID!, $reason: String!) { subAdminWaiveProcurementFee(id: $id, reason: $reason) ${_} }`);
125
+ //#endregion
126
+ export { b as useCancelProcurementRequest, v as useCreateProcurementRequest, T as useDeskAssignProcurement, S as useDeskProcurementRequests, O as useDeskRecordProcurementOutcome, k as useDeskRetryProcurementFee, D as useDeskSendProcurementMessage, E as useDeskSetProcurementStatus, A as useDeskWaiveProcurementFee, C as useProcurementExperts, m as useProcurementRequest, p as useProcurementRequests, h as useProcurementSummary, u as useProcurementTerms, x as useSendProcurementMessage, y as useSubmitProcurementRequest, w as useUpsertProcurementExpert };
127
+
128
+ //# sourceMappingURL=useProcurementApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useProcurementApi.js","names":[],"sources":["../../../src/subscriberbot/hooks/useProcurementApi.ts"],"sourcesContent":["/**\n * Human procurement / negotiation support hooks (BOFF-4158)\n * @module subscriberbot/hooks\n *\n * React-Query hooks for the `SubProcurement*` contract of\n * wspace-subscriberbot-svc: the workspace's procurement requests, the service\n * terms, the summary, and the procurement desk (expert queue, assignment,\n * expert roster) used by super admins in admin-app. Same transport as every\n * other Subscriber Bot hook (`subQuery`).\n */\n\nimport { useInfiniteQuery, useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\n\nimport { useSubscriberBot } from '../context';\nimport type { SubConnection } from '../types';\nimport type {\n SubCreateProcurementRequestInput,\n SubProcurementExpert,\n SubProcurementRequest,\n SubProcurementStatus,\n SubProcurementSummary,\n SubProcurementTerms,\n SubRecordProcurementOutcomeInput,\n SubUpsertProcurementExpertInput,\n} from '../types/procurement';\nimport { subQuery } from './useSubscriberBotApi';\n\nexport type ProcurementDeskView = 'ALL' | 'UNASSIGNED' | 'MINE';\n\nconst KEY = {\n all: ['subscriberbot', 'procurement'] as const,\n list: (status: SubProcurementStatus | null) =>\n ['subscriberbot', 'procurement', 'list', status] as const,\n one: (id: string) => ['subscriberbot', 'procurement', 'one', id] as const,\n summary: ['subscriberbot', 'procurement', 'summary'] as const,\n terms: ['subscriberbot', 'procurement', 'terms'] as const,\n desk: (status: SubProcurementStatus | null, view: ProcurementDeskView) =>\n ['subscriberbot', 'procurement', 'desk', status, view] as const,\n experts: ['subscriberbot', 'procurement', 'experts'] as const,\n};\n\nconst REQUEST_FIELDS = `\n id workspaceId ownerId relationshipId vendorName productName category requestType status\n currency currentAnnualValue quotedAnnualValue targetAnnualValue baselineAnnualValue termMonths\n seats deadline notes authorizationVersion authorizedAt submittedAt expertId expertName assignedAt\n startedAt completedAt finalAnnualValue finalTermMonths oneTimeCredit annualSavings\n firstYearSavings contractSavings nonPriceWins outcomeSummary feeRate feeAmount feeStatus\n feeBilledAt feeWaivedReason createdAt updatedAt\n`;\n\nconst EVENT_FIELDS = `events { id kind fromStatus toStatus message internal actorRole createdAt }`;\n\nconst EXPERT_FIELDS = `id userId displayName email specialties maxOpenRequests active openRequests createdAt updatedAt`;\n\nexport const useProcurementTerms = () => {\n const { apiGatewayUrl } = useSubscriberBot();\n return useQuery({\n queryKey: KEY.terms,\n queryFn: async () => {\n const result = await subQuery<{ subProcurementTerms: SubProcurementTerms }>(\n `query SubProcurementTerms {\n subProcurementTerms { authorizationVersion authorizationText feeRate maxTermMonths }\n }`,\n {},\n apiGatewayUrl\n );\n return result.subProcurementTerms;\n },\n staleTime: 5 * 60 * 1000,\n });\n};\n\nconst PAGE_SIZE = 50;\n\n/** Next cursor of a connection page, or undefined when it was the last page. */\nconst nextCursor = (page: SubConnection<SubProcurementRequest>): string | undefined =>\n page.pageInfo.hasMore && page.pageInfo.cursor ? page.pageInfo.cursor : undefined;\n\n/** Cursor-paged list of the workspace's requests; `fetchNextPage` loads more. */\nexport const useProcurementRequests = (status: SubProcurementStatus | null = null) => {\n const { apiGatewayUrl } = useSubscriberBot();\n return useInfiniteQuery({\n queryKey: KEY.list(status),\n initialPageParam: null as string | null,\n getNextPageParam: nextCursor,\n queryFn: async ({ pageParam }) => {\n const result = await subQuery<{\n subListProcurementRequests: SubConnection<SubProcurementRequest>;\n }>(\n `query SubListProcurementRequests($pagination: PaginationInput, $status: SubProcurementStatus) {\n subListProcurementRequests(pagination: $pagination, status: $status) {\n items { ${REQUEST_FIELDS} }\n pageInfo { hasMore cursor }\n }\n }`,\n { pagination: { limit: PAGE_SIZE, cursor: pageParam }, status },\n apiGatewayUrl\n );\n return result.subListProcurementRequests;\n },\n });\n};\n\nexport const useProcurementRequest = (id: string | undefined) => {\n const { apiGatewayUrl } = useSubscriberBot();\n return useQuery({\n queryKey: KEY.one(id ?? ''),\n enabled: Boolean(id),\n queryFn: async () => {\n const result = await subQuery<{ subProcurementRequest: SubProcurementRequest | null }>(\n `query SubProcurementRequest($id: ID!) {\n subProcurementRequest(id: $id) { ${REQUEST_FIELDS} ${EVENT_FIELDS} }\n }`,\n { id },\n apiGatewayUrl\n );\n return result.subProcurementRequest;\n },\n });\n};\n\nexport const useProcurementSummary = () => {\n const { apiGatewayUrl } = useSubscriberBot();\n return useQuery({\n queryKey: KEY.summary,\n queryFn: async () => {\n const result = await subQuery<{ subProcurementSummary: SubProcurementSummary }>(\n `query SubProcurementSummary {\n subProcurementSummary {\n totalCount openCount succeededCount noSavingsCount\n totals { currency firstYearSavings contractSavings feesCharged succeededCount }\n }\n }`,\n {},\n apiGatewayUrl\n );\n return result.subProcurementSummary;\n },\n });\n};\n\n/** Shared mutation plumbing: every write refreshes every procurement query. */\nfunction useProcurementMutation<TVars, TResult = SubProcurementRequest>(\n operation: string,\n document: string\n) {\n const queryClient = useQueryClient();\n const { apiGatewayUrl } = useSubscriberBot();\n return useMutation({\n mutationFn: async (variables: TVars) => {\n const result = await subQuery<Record<string, TResult>>(\n document,\n variables as Record<string, unknown>,\n apiGatewayUrl\n );\n const value = result[operation];\n if (!value) throw new Error(`${operation} returned no data`);\n return value;\n },\n onSuccess: () => {\n void queryClient.invalidateQueries({ queryKey: KEY.all });\n },\n });\n}\n\nconst RETURNING = `{ ${REQUEST_FIELDS} ${EVENT_FIELDS} }`;\n\nexport const useCreateProcurementRequest = () =>\n useProcurementMutation<{ input: SubCreateProcurementRequestInput }>(\n 'subCreateProcurementRequest',\n `mutation SubCreateProcurementRequest($input: SubCreateProcurementRequestInput!) { subCreateProcurementRequest(input: $input) ${RETURNING} }`\n );\n\nexport const useSubmitProcurementRequest = () =>\n useProcurementMutation<{\n id: string;\n input: { acceptAuthorization: boolean; authorizationVersion: string };\n }>(\n 'subSubmitProcurementRequest',\n `mutation SubSubmitProcurementRequest($id: ID!, $input: SubSubmitProcurementRequestInput!) { subSubmitProcurementRequest(id: $id, input: $input) ${RETURNING} }`\n );\n\nexport const useCancelProcurementRequest = () =>\n useProcurementMutation<{ id: string; reason?: string | null }>(\n 'subCancelProcurementRequest',\n `mutation SubCancelProcurementRequest($id: ID!, $reason: String) { subCancelProcurementRequest(id: $id, reason: $reason) ${RETURNING} }`\n );\n\nexport const useSendProcurementMessage = () =>\n useProcurementMutation<{ id: string; message: string }>(\n 'subSendProcurementMessage',\n `mutation SubSendProcurementMessage($id: ID!, $message: String!) { subSendProcurementMessage(id: $id, message: $message) ${RETURNING} }`\n );\n\n// ---------------------------------------------------------------------------\n// Procurement desk (super admin, admin-app)\n// ---------------------------------------------------------------------------\n\nexport const useDeskProcurementRequests = (\n status: SubProcurementStatus | null = null,\n view: ProcurementDeskView = 'ALL'\n) => {\n const { apiGatewayUrl } = useSubscriberBot();\n return useInfiniteQuery({\n queryKey: KEY.desk(status, view),\n initialPageParam: null as string | null,\n getNextPageParam: nextCursor,\n queryFn: async ({ pageParam }) => {\n const result = await subQuery<{\n subAdminListProcurementRequests: SubConnection<SubProcurementRequest>;\n }>(\n `query SubAdminListProcurementRequests($pagination: PaginationInput, $status: SubProcurementStatus, $unassignedOnly: Boolean, $mine: Boolean) {\n subAdminListProcurementRequests(pagination: $pagination, status: $status, unassignedOnly: $unassignedOnly, mine: $mine) {\n items { ${REQUEST_FIELDS} ${EVENT_FIELDS} }\n pageInfo { hasMore cursor }\n }\n }`,\n {\n pagination: { limit: PAGE_SIZE, cursor: pageParam },\n status,\n unassignedOnly: view === 'UNASSIGNED',\n mine: view === 'MINE',\n },\n apiGatewayUrl\n );\n return result.subAdminListProcurementRequests;\n },\n });\n};\n\nexport const useProcurementExperts = () => {\n const { apiGatewayUrl } = useSubscriberBot();\n return useQuery({\n queryKey: KEY.experts,\n queryFn: async () => {\n const result = await subQuery<{ subAdminListProcurementExperts: SubProcurementExpert[] }>(\n `query SubAdminListProcurementExperts { subAdminListProcurementExperts(includeInactive: true) { ${EXPERT_FIELDS} } }`,\n {},\n apiGatewayUrl\n );\n return result.subAdminListProcurementExperts;\n },\n });\n};\n\nexport const useUpsertProcurementExpert = () =>\n useProcurementMutation<{ input: SubUpsertProcurementExpertInput }, SubProcurementExpert>(\n 'subAdminUpsertProcurementExpert',\n `mutation SubAdminUpsertProcurementExpert($input: SubUpsertProcurementExpertInput!) { subAdminUpsertProcurementExpert(input: $input) { ${EXPERT_FIELDS} } }`\n );\n\nexport const useDeskAssignProcurement = () =>\n useProcurementMutation<{ id: string; expertId?: string | null }>(\n 'subAdminAssignProcurementRequest',\n `mutation SubAdminAssignProcurementRequest($id: ID!, $expertId: ID) { subAdminAssignProcurementRequest(id: $id, expertId: $expertId) ${RETURNING} }`\n );\n\nexport const useDeskSetProcurementStatus = () =>\n useProcurementMutation<{ id: string; status: SubProcurementStatus; message?: string | null }>(\n 'subAdminSetProcurementStatus',\n `mutation SubAdminSetProcurementStatus($id: ID!, $status: SubProcurementStatus!, $message: String) { subAdminSetProcurementStatus(id: $id, status: $status, message: $message) ${RETURNING} }`\n );\n\nexport const useDeskSendProcurementMessage = () =>\n useProcurementMutation<{ id: string; message: string; internal?: boolean }>(\n 'subAdminSendProcurementMessage',\n `mutation SubAdminSendProcurementMessage($id: ID!, $message: String!, $internal: Boolean) { subAdminSendProcurementMessage(id: $id, message: $message, internal: $internal) ${RETURNING} }`\n );\n\nexport const useDeskRecordProcurementOutcome = () =>\n useProcurementMutation<{ id: string; input: SubRecordProcurementOutcomeInput }>(\n 'subAdminRecordProcurementOutcome',\n `mutation SubAdminRecordProcurementOutcome($id: ID!, $input: SubRecordProcurementOutcomeInput!) { subAdminRecordProcurementOutcome(id: $id, input: $input) ${RETURNING} }`\n );\n\nexport const useDeskRetryProcurementFee = () =>\n useProcurementMutation<{ id: string }>(\n 'subAdminRetryProcurementFeeBilling',\n `mutation SubAdminRetryProcurementFeeBilling($id: ID!) { subAdminRetryProcurementFeeBilling(id: $id) ${RETURNING} }`\n );\n\nexport const useDeskWaiveProcurementFee = () =>\n useProcurementMutation<{ id: string; reason: string }>(\n 'subAdminWaiveProcurementFee',\n `mutation SubAdminWaiveProcurementFee($id: ID!, $reason: String!) { subAdminWaiveProcurementFee(id: $id, reason: $reason) ${RETURNING} }`\n );\n"],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Ac,KACzJ,GAEW,UACX,EACE,oCACA,uIAAuI,EAAU,GACnJ,GAEW,UACX,EACE,gCACA,iLAAiL,EAAU,GAC7L,GAEW,UACX,EACE,kCACA,8KAA8K,EAAU,GAC1L,GAEW,UACX,EACE,oCACA,6JAA6J,EAAU,GACzK,GAEW,UACX,EACE,sCACA,uGAAuG,EAAU,GACnH,GAEW,UACX,EACE,+BACA,4HAA4H,EAAU,GACxI"}
@@ -1,4 +1,4 @@
1
- import { PaginationInput, SubAdapterSubmission, SubAgentKind, SubAgentStatus, SubAiAgent, SubAsset, SubBenchmarkDataPoint, SubCommunicationChannel, SubConnection, SubCreateAgentInput, SubCreateAssetInput, SubCreateChannelInput, SubCreateEntitlementInput, SubCreateInvoiceInput, SubCreatePaymentInstrumentInput, SubCreatePlanInput, SubCreatePolicyInput, SubCreateProviderInput, SubCreateRelationshipInput, SubCreateWorkflowInput, SubAgentRunResult, SubDecision, SubDecisionFilter, SubDecisionResult, SubConsolidateRelationshipsInput, SubConsolidationResult, SubSavingsOverview, SubEnterpriseSpendDashboard, SubEntitlement, SubInboxMessage, SubIngestMessageInput, SubInvoice, SubInvoiceStatus, SubMarketplaceReport, SubMessageCategory, SubModerationAction, SubPaymentInstrument, SubPlan, SubPolicy, SubProvider, SubProviderCategory, SubProviderStatus, SubRelationship, SubRelationshipKind, SubRelationshipStatus, SubRenewalEvent, SubReportStatus, SubSetSpendBudgetInput, SubSpendBudget, SubSubmissionStatus, SubUpdateProviderInput, SubUpdateRelationshipInput, SubWorkflow, SubWorkflowStatus } from '../types';
1
+ import { PaginationInput, SubAdapterSubmission, SubAgentKind, SubAgentStatus, SubAiAgent, SubAsset, SubBenchmarkDataPoint, SubCommunicationChannel, SubConnection, SubCreateAgentInput, SubCreateAssetInput, SubCreateChannelInput, SubCreateEntitlementInput, SubCreateInvoiceInput, SubCreatePaymentInstrumentInput, SubCreatePlanInput, SubCreatePolicyInput, SubCreateProviderInput, SubCreateRelationshipInput, SubCreateWorkflowInput, SubAgentRunResult, SubDecision, SubDecisionFilter, SubDecisionResult, SubConsolidateRelationshipsInput, SubConsolidationResult, SubSavingsOverview, SubEnterpriseSpendDashboard, SubEntitlement, SubInboxMessage, SubIngestMessageInput, SubInvoice, SubInvoiceStatus, SubMarketplaceReport, SubMessageCategory, SubModerationAction, SubPaymentInstrument, SubPlan, SubPolicy, SubProvider, SubProviderCategory, SubProviderStatus, SubRelationship, SubRelationshipKind, SubRelationshipStatus, SubRenewalEvent, SubRenewalForecast, SubRenewalForecastArgs, SubReportStatus, SubSetSpendBudgetInput, SubSpendBudget, SubSubmissionStatus, SubUpdateProviderInput, SubUpdateRelationshipInput, SubWorkflow, SubWorkflowStatus } from '../types';
2
2
 
3
3
  export declare const subQuery: <TData>(query: string, variables: Record<string, unknown>, baseUrl?: string) => Promise<TData>;
4
4
  export interface RelationshipListFilters {
@@ -164,4 +164,11 @@ export declare const useModerateListing: () => import('@tanstack/react-query').U
164
164
  export declare const useEnterpriseSpendDashboard: (currency?: string | null) => import('@tanstack/react-query').UseQueryResult<SubEnterpriseSpendDashboard, Error>;
165
165
  export declare const useSpendBudgets: () => import('@tanstack/react-query').UseQueryResult<SubSpendBudget[], Error>;
166
166
  export declare const useSetSpendBudget: () => import('@tanstack/react-query').UseMutationResult<SubSpendBudget | null, Error, SubSetSpendBudgetInput, unknown>;
167
+ export declare const useRenewalForecast: (args?: SubRenewalForecastArgs) => import('@tanstack/react-query').UseQueryResult<SubRenewalForecast, Error>;
168
+ export declare const useSetRenewalReminder: () => import('@tanstack/react-query').UseMutationResult<SubRenewalEvent, Error, {
169
+ relationshipId: string;
170
+ remindAt?: string | null;
171
+ note?: string | null;
172
+ }, unknown>;
173
+ export declare const useCancelRenewalReminder: () => import('@tanstack/react-query').UseMutationResult<boolean, Error, string, unknown>;
167
174
  //# sourceMappingURL=useSubscriberBotApi.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSubscriberBotApi.d.ts","sourceRoot":"","sources":["../../../src/subscriberbot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BAAiB,8GAkB7B,CAAC;AAEF,eAAO,MAAM,mBAAmB,8FAkB/B,CAAC;AAMF,MAAM,WAAW,4BAA4B;IAC3C,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B;AAED,eAAO,MAAM,qBAAqB,GAAI,UAAS,4BAAiC,+FAuB/E,CAAC;AAEF,eAAO,MAAM,iBAAiB;QAIc,MAAM;YAAU,MAAM;WAcjE,CAAC;AAEF,eAAO,MAAM,gBAAgB;QAIgB,MAAM;YAAU,MAAM;WAclE,CAAC;AAEF,MAAM,WAAW,4BAA4B;IAC3C,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B;AAED,eAAO,MAAM,qBAAqB,GAAI,UAAS,4BAAiC,+FAuB/E,CAAC;AAEF,eAAO,MAAM,kBAAkB;QASrB,MAAM;YACF,mBAAmB;YACnB,MAAM;WAenB,CAAC;AA6CF,eAAO,MAAM,2BAA2B,GAAI,WAAW,MAAM,GAAG,IAAI,uFAenE,CAAC;AAEF,eAAO,MAAM,eAAe,+EAe3B,CAAC;AAEF,eAAO,MAAM,iBAAiB,wHAmB7B,CAAC"}
1
+ {"version":3,"file":"useSubscriberBotApi.d.ts","sourceRoot":"","sources":["../../../src/subscriberbot/hooks/useSubscriberBotApi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAWH,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,UAAU,EACV,QAAQ,EACR,qBAAqB,EAErB,uBAAuB,EACvB,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,+BAA+B,EAC/B,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,0BAA0B,EAC1B,sBAAsB,EACtB,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,iBAAiB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MAAM,WAAW,4BAA4B;IAC3C,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B;AAED,eAAO,MAAM,qBAAqB,GAAI,UAAS,4BAAiC,+FAuB/E,CAAC;AAEF,eAAO,MAAM,kBAAkB;QASrB,MAAM;YACF,mBAAmB;YACnB,MAAM;WAenB,CAAC;AA6CF,eAAO,MAAM,2BAA2B,GAAI,WAAW,MAAM,GAAG,IAAI,uFAenE,CAAC;AAEF,eAAO,MAAM,eAAe,+EAe3B,CAAC;AAEF,eAAO,MAAM,iBAAiB,wHAmB7B,CAAC;AAyBF,eAAO,MAAM,kBAAkB,GAAI,OAAM,sBAA2B,8EAiCnE,CAAC;AAEF,eAAO,MAAM,qBAAqB;oBAKZ,MAAM;eACX,MAAM,GAAG,IAAI;WACjB,MAAM,GAAG,IAAI;WAsBzB,CAAC;AAEF,eAAO,MAAM,wBAAwB,0FAkBpC,CAAC"}
@@ -58,6 +58,11 @@ var c = async (e, t, n) => {
58
58
  ],
59
59
  workflows: ["subscriberbot", "workflows"],
60
60
  renewals: ["subscriberbot", "renewals"],
61
+ renewalForecast: [
62
+ "subscriberbot",
63
+ "renewals",
64
+ "forecast"
65
+ ],
61
66
  assets: ["subscriberbot", "assets"],
62
67
  entitlements: ["subscriberbot", "entitlements"],
63
68
  adapterSubmissions: [
@@ -80,7 +85,7 @@ var c = async (e, t, n) => {
80
85
  "enterprise",
81
86
  "budgets"
82
87
  ]
83
- }, 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 department 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 agentId runId relationshipId kind recommendation status rationale confidence\n estimatedSavings currency evidence proposedChange validationErrors invocationRef\n applyInvocationRef appliedAt appliedBy dismissedAt dismissedReason workspaceId\n createdAt updatedAt\n agent { id name kind status }\n relationship { id label status amount currency interval providerId planId }\n", _ = "\n id name description triggerEvent status runCount lastRunAt workspaceId\n createdAt updatedAt\n", ee = "\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", te = "\n id label type status brand last4 expiryMonth expiryYear isDefault ownerId\n workspaceId createdAt updatedAt\n", y = "\n id label type status address ingestEnabled ownerId verifiedAt workspaceId\n createdAt updatedAt\n", b = "\n id name description action agentId condition isEnabled triggerCount\n lastTriggeredAt workspaceId createdAt updatedAt\n", ne = "\n id providerSlug providerName planName region currency interval amount\n contractSizeSeats sourceKind sourceLabel notes observedAt createdAt\n", x = "\n id workspaceId adapterId submitterWorkspaceId status notes createdAt updatedAt\n", S = "\n id workspaceId listingId reporterWorkspaceId reason status resolutionReason\n createdAt updatedAt\n", C = (t = {}) => {
88
+ }, 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 department 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 agentId runId relationshipId kind recommendation status rationale confidence\n estimatedSavings currency evidence proposedChange validationErrors invocationRef\n applyInvocationRef appliedAt appliedBy dismissedAt dismissedReason workspaceId\n createdAt updatedAt\n agent { id name kind status }\n relationship { id label status amount currency interval providerId planId }\n", _ = "\n id name description triggerEvent status runCount lastRunAt workspaceId\n createdAt updatedAt\n", ee = "\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", te = "\n id label type status brand last4 expiryMonth expiryYear isDefault ownerId\n workspaceId createdAt updatedAt\n", y = "\n id label type status address ingestEnabled ownerId verifiedAt workspaceId\n createdAt updatedAt\n", b = "\n id name description action agentId condition isEnabled triggerCount\n lastTriggeredAt workspaceId createdAt updatedAt\n", ne = "\n id providerSlug providerName planName region currency interval amount\n contractSizeSeats sourceKind sourceLabel notes observedAt createdAt\n", x = "\n id workspaceId adapterId submitterWorkspaceId status notes createdAt updatedAt\n", S = "\n id workspaceId listingId reporterWorkspaceId reason status resolutionReason\n createdAt updatedAt\n", re = (t = {}) => {
84
89
  let { apiGatewayUrl: n } = e();
85
90
  return i({
86
91
  queryKey: [...l.relationships, t],
@@ -119,7 +124,7 @@ var c = async (e, t, n) => {
119
124
  }
120
125
  }, n)).subListRelationships
121
126
  });
122
- }, w = (t) => {
127
+ }, C = (t) => {
123
128
  let { apiGatewayUrl: n } = e();
124
129
  return i({
125
130
  queryKey: l.relationship(t ?? ""),
@@ -144,17 +149,17 @@ var c = async (e, t, n) => {
144
149
  }
145
150
  }`, { id: t }, n)).subRelationship
146
151
  });
147
- }, T = () => {
152
+ }, w = () => {
148
153
  let t = a(), { apiGatewayUrl: n } = e();
149
154
  return r({
150
155
  mutationFn: async (e) => (await c(`mutation SubCreateRelationship($input: SubCreateRelationshipInput!) {
151
156
  subCreateRelationship(input: $input) { ${f} }
152
157
  }`, { input: e }, n)).subCreateRelationship,
153
158
  onSuccess: () => {
154
- t.invalidateQueries({ queryKey: l.relationships });
159
+ t.invalidateQueries({ queryKey: l.relationships }), t.invalidateQueries({ queryKey: l.renewals });
155
160
  }
156
161
  });
157
- }, E = () => {
162
+ }, T = () => {
158
163
  let t = a(), { apiGatewayUrl: n } = e();
159
164
  return r({
160
165
  mutationFn: async ({ id: e, status: t }) => (await c(`mutation SubTransitionRelationship($id: ID!, $status: SubRelationshipStatus!) {
@@ -164,20 +169,20 @@ var c = async (e, t, n) => {
164
169
  status: t
165
170
  }, n)).subTransitionRelationship,
166
171
  onSuccess: (e) => {
167
- t.invalidateQueries({ queryKey: l.relationships }), t.invalidateQueries({ queryKey: l.relationship(e.id) });
172
+ t.invalidateQueries({ queryKey: l.relationships }), t.invalidateQueries({ queryKey: l.relationship(e.id) }), t.invalidateQueries({ queryKey: l.renewals });
168
173
  }
169
174
  });
170
- }, D = () => {
175
+ }, E = () => {
171
176
  let t = a(), { apiGatewayUrl: n } = e();
172
177
  return r({
173
178
  mutationFn: async (e) => (await c(`mutation SubCancelRelationship($id: ID!) {
174
179
  subCancelRelationship(id: $id) { ${f} }
175
180
  }`, { id: e }, n)).subCancelRelationship,
176
181
  onSuccess: (e) => {
177
- t.invalidateQueries({ queryKey: l.relationships }), t.invalidateQueries({ queryKey: l.relationship(e.id) });
182
+ t.invalidateQueries({ queryKey: l.relationships }), t.invalidateQueries({ queryKey: l.relationship(e.id) }), t.invalidateQueries({ queryKey: l.renewals });
178
183
  }
179
184
  });
180
- }, O = () => {
185
+ }, D = () => {
181
186
  let t = a(), { apiGatewayUrl: n } = e();
182
187
  return r({
183
188
  mutationFn: async ({ id: e, input: t }) => (await c(`mutation SubUpdateRelationship($id: ID!, $input: SubUpdateRelationshipInput!) {
@@ -187,10 +192,10 @@ var c = async (e, t, n) => {
187
192
  input: t
188
193
  }, n)).subUpdateRelationship,
189
194
  onSuccess: (e) => {
190
- t.invalidateQueries({ queryKey: l.relationships }), t.invalidateQueries({ queryKey: l.relationship(e.id) });
195
+ t.invalidateQueries({ queryKey: l.relationships }), t.invalidateQueries({ queryKey: l.relationship(e.id) }), t.invalidateQueries({ queryKey: l.renewals });
191
196
  }
192
197
  });
193
- }, k = (t = {}) => {
198
+ }, O = (t = {}) => {
194
199
  let { apiGatewayUrl: n } = e();
195
200
  return i({
196
201
  queryKey: [...l.renewals, t],
@@ -199,7 +204,7 @@ var c = async (e, t, n) => {
199
204
  upcomingOnly: t.upcomingOnly
200
205
  }, n)).subListRenewalEvents.items
201
206
  });
202
- }, A = () => {
207
+ }, k = () => {
203
208
  let t = a(), { apiGatewayUrl: n } = e();
204
209
  return r({
205
210
  mutationFn: async (e) => (await c(`mutation SubCreateEntitlement($input: SubCreateEntitlementInput!) {
@@ -209,7 +214,7 @@ var c = async (e, t, n) => {
209
214
  t.invalidateQueries({ queryKey: l.entitlements }), t.invalidateQueries({ queryKey: l.relationship(e.relationshipId) });
210
215
  }
211
216
  });
212
- }, j = () => {
217
+ }, A = () => {
213
218
  let { apiGatewayUrl: t } = e();
214
219
  return i({
215
220
  queryKey: [...l.assets, "all"],
@@ -217,7 +222,7 @@ var c = async (e, t, n) => {
217
222
  subListAssets { items { ${v} } pageInfo { cursor hasMore } }
218
223
  }`, {}, t)).subListAssets.items
219
224
  });
220
- }, M = () => {
225
+ }, j = () => {
221
226
  let t = a(), { apiGatewayUrl: n } = e();
222
227
  return r({
223
228
  mutationFn: async (e) => (await c(`mutation SubCreateAsset($input: SubCreateAssetInput!) {
@@ -227,13 +232,13 @@ var c = async (e, t, n) => {
227
232
  t.invalidateQueries({ queryKey: l.assets }), t.invalidateQueries({ queryKey: l.relationship(e.relationshipId) });
228
233
  }
229
234
  });
230
- }, N = "/SubscriberBot/Assets", P = () => {
235
+ }, M = "/SubscriberBot/Assets", N = () => {
231
236
  let { apiGatewayUrl: r } = e(), [i, a] = n(0), [o, s] = n(!1);
232
237
  return {
233
238
  uploadFile: t(async (e) => {
234
239
  s(!0), a(0);
235
240
  try {
236
- let t = (await c("mutation SubEnsureFolder($path: String!) {\n ensureFolderByPath(path: $path) { id }\n }", { path: N }, r)).ensureFolderByPath?.id;
241
+ let t = (await c("mutation SubEnsureFolder($path: String!) {\n ensureFolderByPath(path: $path) { id }\n }", { path: M }, r)).ensureFolderByPath?.id;
237
242
  if (!t) throw Error("Could not resolve the upload folder.");
238
243
  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: {
239
244
  fileName: e.name,
@@ -268,13 +273,13 @@ var c = async (e, t, n) => {
268
273
  progress: i,
269
274
  isUploading: o
270
275
  };
271
- }, F = () => {
276
+ }, P = () => {
272
277
  let { apiGatewayUrl: n } = e();
273
278
  return t(async (e) => (await c("query SubFileDownloadUrl($id: ID!, $expiresIn: Int) {\n getFileDownloadUrl(id: $id, expiresIn: $expiresIn)\n }", {
274
279
  id: e,
275
280
  expiresIn: 21600
276
281
  }, n)).getFileDownloadUrl, [n]);
277
- }, I = (t = {}) => {
282
+ }, F = (t = {}) => {
278
283
  let { apiGatewayUrl: n } = e();
279
284
  return i({
280
285
  queryKey: [...l.providers, t],
@@ -303,7 +308,7 @@ var c = async (e, t, n) => {
303
308
  }
304
309
  }, n)).subListProviders
305
310
  });
306
- }, L = (t) => {
311
+ }, I = (t) => {
307
312
  let { apiGatewayUrl: n } = e();
308
313
  return i({
309
314
  queryKey: l.provider(t ?? ""),
@@ -315,7 +320,7 @@ var c = async (e, t, n) => {
315
320
  }
316
321
  }`, { id: t }, n)).subProvider
317
322
  });
318
- }, R = () => {
323
+ }, L = () => {
319
324
  let t = a(), { apiGatewayUrl: n } = e();
320
325
  return r({
321
326
  mutationFn: async (e) => (await c(`mutation SubCreateProvider($input: SubCreateProviderInput!) {
@@ -325,7 +330,7 @@ var c = async (e, t, n) => {
325
330
  t.invalidateQueries({ queryKey: l.providers });
326
331
  }
327
332
  });
328
- }, z = () => {
333
+ }, R = () => {
329
334
  let t = a(), { apiGatewayUrl: n } = e();
330
335
  return r({
331
336
  mutationFn: async ({ id: e, input: t }) => (await c(`mutation SubUpdateProvider($id: ID!, $input: SubUpdateProviderInput!) {
@@ -338,7 +343,7 @@ var c = async (e, t, n) => {
338
343
  t.invalidateQueries({ queryKey: l.providers }), t.invalidateQueries({ queryKey: l.provider(e.id) });
339
344
  }
340
345
  });
341
- }, B = () => {
346
+ }, z = () => {
342
347
  let t = a(), { apiGatewayUrl: n } = e();
343
348
  return r({
344
349
  mutationFn: async (e) => (await c("mutation SubArchiveProvider($id: ID!) {\n subArchiveProvider(id: $id)\n }", { id: e }, n)).subArchiveProvider,
@@ -346,7 +351,7 @@ var c = async (e, t, n) => {
346
351
  t.invalidateQueries({ queryKey: l.providers });
347
352
  }
348
353
  });
349
- }, V = (t) => {
354
+ }, B = (t) => {
350
355
  let { apiGatewayUrl: n } = e();
351
356
  return i({
352
357
  queryKey: [...l.plans, t],
@@ -355,7 +360,7 @@ var c = async (e, t, n) => {
355
360
  subListPlans(providerId: $providerId) { items { ${d} } pageInfo { cursor hasMore } }
356
361
  }`, { providerId: t }, n)).subListPlans.items
357
362
  });
358
- }, H = () => {
363
+ }, V = () => {
359
364
  let t = a(), { apiGatewayUrl: n } = e();
360
365
  return r({
361
366
  mutationFn: async (e) => (await c(`mutation SubCreatePlan($input: SubCreatePlanInput!) {
@@ -365,7 +370,7 @@ var c = async (e, t, n) => {
365
370
  t.invalidateQueries({ queryKey: l.plans }), t.invalidateQueries({ queryKey: l.provider(e.providerId) });
366
371
  }
367
372
  });
368
- }, U = (t) => {
373
+ }, H = (t) => {
369
374
  let { apiGatewayUrl: n } = e();
370
375
  return i({
371
376
  queryKey: l.benchmarks(t ?? ""),
@@ -389,7 +394,7 @@ var c = async (e, t, n) => {
389
394
  }, n)).subListBenchmarkDataPoints.items;
390
395
  }
391
396
  });
392
- }, W = (t = {}) => {
397
+ }, U = (t = {}) => {
393
398
  let { apiGatewayUrl: n } = e();
394
399
  return i({
395
400
  queryKey: [...l.inbox, t],
@@ -421,7 +426,7 @@ var c = async (e, t, n) => {
421
426
  }
422
427
  }, n)).subListInboxMessages
423
428
  });
424
- }, G = () => {
429
+ }, W = () => {
425
430
  let t = a(), { apiGatewayUrl: n } = e();
426
431
  return r({
427
432
  mutationFn: async (e) => (await c(`mutation SubMarkMessageRead($id: ID!) {
@@ -431,7 +436,7 @@ var c = async (e, t, n) => {
431
436
  t.invalidateQueries({ queryKey: l.inbox });
432
437
  }
433
438
  });
434
- }, K = () => {
439
+ }, G = () => {
435
440
  let t = a(), { apiGatewayUrl: n } = e();
436
441
  return r({
437
442
  mutationFn: async (e) => (await c(`mutation SubIngestMessage($input: SubIngestMessageInput!) {
@@ -441,7 +446,7 @@ var c = async (e, t, n) => {
441
446
  t.invalidateQueries({ queryKey: l.inbox });
442
447
  }
443
448
  });
444
- }, q = (t = {}, n = {}) => {
449
+ }, K = (t = {}, n = {}) => {
445
450
  let { apiGatewayUrl: r } = e();
446
451
  return i({
447
452
  queryKey: [...l.invoices, t],
@@ -468,7 +473,7 @@ var c = async (e, t, n) => {
468
473
  }
469
474
  }, r)).subListInvoices
470
475
  });
471
- }, J = () => {
476
+ }, q = () => {
472
477
  let t = a(), { apiGatewayUrl: n } = e();
473
478
  return r({
474
479
  mutationFn: async (e) => (await c(`mutation SubMarkInvoicePaid($id: ID!) {
@@ -478,7 +483,7 @@ var c = async (e, t, n) => {
478
483
  t.invalidateQueries({ queryKey: l.invoices });
479
484
  }
480
485
  });
481
- }, Y = () => {
486
+ }, J = () => {
482
487
  let t = a(), { apiGatewayUrl: n } = e();
483
488
  return r({
484
489
  mutationFn: async (e) => (await c(`mutation SubCreateInvoice($input: SubCreateInvoiceInput!) {
@@ -488,13 +493,13 @@ var c = async (e, t, n) => {
488
493
  t.invalidateQueries({ queryKey: l.invoices });
489
494
  }
490
495
  });
491
- }, X = (t) => {
496
+ }, Y = (t) => {
492
497
  let { apiGatewayUrl: n } = e();
493
498
  return i({
494
499
  queryKey: [...l.paymentInstruments, t],
495
500
  queryFn: async () => (await c("query SubPaymentInstruments($ownerId: ID) {\n subListPaymentInstruments(ownerId: $ownerId) {\n items {\n id label type status brand last4 expiryMonth expiryYear isDefault\n ownerId workspaceId createdAt updatedAt\n }\n pageInfo { cursor hasMore }\n }\n }", { ownerId: t }, n)).subListPaymentInstruments.items
496
501
  });
497
- }, re = () => {
502
+ }, X = () => {
498
503
  let t = a(), { apiGatewayUrl: n } = e();
499
504
  return r({
500
505
  mutationFn: async (e) => (await c(`mutation SubCreatePaymentInstrument($input: SubCreatePaymentInstrumentInput!) {
@@ -625,7 +630,7 @@ var c = async (e, t, n) => {
625
630
  }`, { id: t }, n)).subDecision
626
631
  });
627
632
  }, Z = (e, t) => {
628
- e.invalidateQueries({ queryKey: l.decisions }), t.decisionId && e.invalidateQueries({ queryKey: l.decision(t.decisionId) }), t.agentId && (e.invalidateQueries({ queryKey: l.agent(t.agentId) }), e.invalidateQueries({ queryKey: l.agents })), t.relationshipId && (e.invalidateQueries({ queryKey: l.relationship(t.relationshipId) }), e.invalidateQueries({ queryKey: l.relationships }));
633
+ e.invalidateQueries({ queryKey: l.decisions }), e.invalidateQueries({ queryKey: l.renewals }), t.decisionId && e.invalidateQueries({ queryKey: l.decision(t.decisionId) }), t.agentId && (e.invalidateQueries({ queryKey: l.agent(t.agentId) }), e.invalidateQueries({ queryKey: l.agents })), t.relationshipId && (e.invalidateQueries({ queryKey: l.relationship(t.relationshipId) }), e.invalidateQueries({ queryKey: l.relationships }));
629
634
  }, ge = () => {
630
635
  let t = a(), { apiGatewayUrl: n } = e();
631
636
  return r({
@@ -677,7 +682,7 @@ var c = async (e, t, n) => {
677
682
  return r({
678
683
  mutationFn: async (e) => (await c("mutation SubConsolidateRelationships($input: SubConsolidateRelationshipsInput!) {\n subConsolidateRelationships(input: $input) {\n kept { id label status amount currency interval }\n cancelled { id label status }\n failed { relationshipId message }\n estimatedSavings currency\n }\n }", { input: e }, n)).subConsolidateRelationships,
679
684
  onSettled: (e, n, r) => {
680
- t.invalidateQueries({ queryKey: l.decisions }), t.invalidateQueries({ queryKey: l.relationships });
685
+ t.invalidateQueries({ queryKey: l.decisions }), t.invalidateQueries({ queryKey: l.relationships }), t.invalidateQueries({ queryKey: l.renewals });
681
686
  for (let e of [r.keepRelationshipId, ...r.cancelRelationshipIds]) t.invalidateQueries({ queryKey: l.relationship(e) });
682
687
  }
683
688
  });
@@ -847,8 +852,54 @@ var c = async (e, t, n) => {
847
852
  t.invalidateQueries({ queryKey: l.spendBudgets }), t.invalidateQueries({ queryKey: l.enterpriseSpend });
848
853
  }
849
854
  });
855
+ }, Pe = "\n currency generatedAt from to trialWindowDays statuses totalAmount renewalCount\n relationshipCount truncated\n otherCurrencyTotals { currency amount renewalCount }\n months {\n key year month startsAt endsAt amount renewalCount\n otherCurrencyTotals { currency amount renewalCount }\n items {\n relationshipId label providerId providerName kind status interval currency\n renewsAt daysRemaining amount occurrenceCount autoRenew healthScore\n reminderId reminderAt openDecisionId openDecisionKind needsReview\n }\n }\n trialsEndingSoon {\n relationshipId label providerId providerName trialEndsAt daysRemaining amount\n currency interval autoRenew reminderId reminderAt openDecisionId openDecisionKind\n }\n", Fe = (t = {}) => {
856
+ let { apiGatewayUrl: n } = e();
857
+ return i({
858
+ queryKey: [...l.renewalForecast, t],
859
+ queryFn: async () => (await c(`query SubRenewalForecast(
860
+ $from: DateTime
861
+ $to: DateTime
862
+ $statuses: [SubRelationshipStatus!]
863
+ $trialWindowDays: Int
864
+ $currency: String
865
+ ) {
866
+ subRenewalForecast(
867
+ from: $from
868
+ to: $to
869
+ statuses: $statuses
870
+ trialWindowDays: $trialWindowDays
871
+ currency: $currency
872
+ ) { ${Pe} }
873
+ }`, {
874
+ from: t.from ?? null,
875
+ to: t.to ?? null,
876
+ statuses: t.statuses?.length ? t.statuses : null,
877
+ trialWindowDays: t.trialWindowDays ?? null,
878
+ currency: t.currency || null
879
+ }, n)).subRenewalForecast
880
+ });
881
+ }, Ie = () => {
882
+ let t = a(), { apiGatewayUrl: n } = e();
883
+ return r({
884
+ mutationFn: async (e) => (await c("mutation SubSetRenewalReminder($relationshipId: ID!, $remindAt: DateTime, $note: String) {\n subSetRenewalReminder(relationshipId: $relationshipId, remindAt: $remindAt, note: $note) {\n id relationshipId eventType occursAt amount currency detail notified\n workspaceId createdAt updatedAt\n }\n }", {
885
+ relationshipId: e.relationshipId,
886
+ remindAt: e.remindAt || null,
887
+ note: e.note || null
888
+ }, n)).subSetRenewalReminder,
889
+ onSuccess: () => {
890
+ t.invalidateQueries({ queryKey: l.renewals });
891
+ }
892
+ });
893
+ }, Le = () => {
894
+ let t = a(), { apiGatewayUrl: n } = e();
895
+ return r({
896
+ mutationFn: async (e) => (await c("mutation SubCancelRenewalReminder($id: ID!) {\n subCancelRenewalReminder(id: $id)\n }", { id: e }, n)).subCancelRenewalReminder,
897
+ onSuccess: () => {
898
+ t.invalidateQueries({ queryKey: l.renewals });
899
+ }
900
+ });
850
901
  };
851
902
  //#endregion
852
- export { c as subQuery, Te as useActivateWorkflow, Ee as useAdapterSubmissions, le as useAgent, ce as useAgents, j as useAllAssets, _e as useApplyDecision, De as useApproveAdapter, B as useArchiveProvider, U as useBenchmarkDataPoints, D as useCancelRelationship, ae as useChannels, xe as useConsolidateRelationships, ue as useCreateAgent, M as useCreateAsset, oe as useCreateChannel, A as useCreateEntitlement, Y as useCreateInvoice, re as useCreatePaymentInstrument, H as useCreatePlan, fe as useCreatePolicy, R as useCreateProvider, T as useCreateRelationship, we as useCreateWorkflow, he as useDecision, me as useDecisions, Se as useDismissBundle, ve as useDismissDecision, je as useEnterpriseSpendDashboard, F as useFileDownloadUrl, W as useInboxMessages, K as useIngestMessage, q as useInvoices, J as useMarkInvoicePaid, G as useMarkMessageRead, Q as useMarketplaceReports, ke as useModerateListing, X as usePaymentInstruments, V as usePlans, L as useProvider, I as useProviders, Oe as useRejectAdapter, w as useRelationship, C as useRelationships, ie as useRemovePaymentInstrument, k as useRenewalEvents, ge as useRunAgent, be as useSavingsOverview, de as useSetAgentStatus, Ne as useSetSpendBudget, Me as useSpendBudgets, E as useTransitionRelationship, z as useUpdateProvider, O as useUpdateRelationship, P as useUploadFile, se as useVerifyChannel, Ce as useWorkflows };
903
+ export { c as subQuery, Te as useActivateWorkflow, Ee as useAdapterSubmissions, le as useAgent, ce as useAgents, A as useAllAssets, _e as useApplyDecision, De as useApproveAdapter, z as useArchiveProvider, H as useBenchmarkDataPoints, E as useCancelRelationship, Le as useCancelRenewalReminder, ae as useChannels, xe as useConsolidateRelationships, ue as useCreateAgent, j as useCreateAsset, oe as useCreateChannel, k as useCreateEntitlement, J as useCreateInvoice, X as useCreatePaymentInstrument, V as useCreatePlan, fe as useCreatePolicy, L as useCreateProvider, w as useCreateRelationship, we as useCreateWorkflow, he as useDecision, me as useDecisions, Se as useDismissBundle, ve as useDismissDecision, je as useEnterpriseSpendDashboard, P as useFileDownloadUrl, U as useInboxMessages, G as useIngestMessage, K as useInvoices, q as useMarkInvoicePaid, W as useMarkMessageRead, Q as useMarketplaceReports, ke as useModerateListing, Y as usePaymentInstruments, B as usePlans, I as useProvider, F as useProviders, Oe as useRejectAdapter, C as useRelationship, re as useRelationships, ie as useRemovePaymentInstrument, O as useRenewalEvents, Fe as useRenewalForecast, ge as useRunAgent, be as useSavingsOverview, de as useSetAgentStatus, Ie as useSetRenewalReminder, Ne as useSetSpendBudget, Me as useSpendBudgets, T as useTransitionRelationship, R as useUpdateProvider, D as useUpdateRelationship, N as useUploadFile, se as useVerifyChannel, Ce as useWorkflows };
853
904
 
854
905
  //# sourceMappingURL=useSubscriberBotApi.js.map