@greensecurity/javascript-sdk 0.18.0 → 0.19.0

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 (151) hide show
  1. package/README.md +6 -0
  2. package/bin/mcp-server.js +522 -58
  3. package/bin/mcp-server.js.map +38 -30
  4. package/funcs/supportArticlesListOrSearchSupportArticles.js +2 -0
  5. package/funcs/supportArticlesListOrSearchSupportArticles.js.map +1 -1
  6. package/funcs/vendorsGetVendorInvoiceDetails.d.ts +23 -0
  7. package/funcs/vendorsGetVendorInvoiceDetails.d.ts.map +1 -0
  8. package/funcs/vendorsGetVendorInvoiceDetails.js +130 -0
  9. package/funcs/vendorsGetVendorInvoiceDetails.js.map +1 -0
  10. package/funcs/vendorsListVendorFacilityStatuses.d.ts +20 -0
  11. package/funcs/vendorsListVendorFacilityStatuses.d.ts.map +1 -0
  12. package/funcs/vendorsListVendorFacilityStatuses.js +154 -0
  13. package/funcs/vendorsListVendorFacilityStatuses.js.map +1 -0
  14. package/jsr.json +1 -1
  15. package/lib/config.d.ts +3 -3
  16. package/lib/config.js +3 -3
  17. package/lib/sdks.d.ts.map +1 -1
  18. package/lib/sdks.js +2 -8
  19. package/lib/sdks.js.map +1 -1
  20. package/mcp-server/mcp-server.js +1 -1
  21. package/mcp-server/server.d.ts.map +1 -1
  22. package/mcp-server/server.js +5 -1
  23. package/mcp-server/server.js.map +1 -1
  24. package/mcp-server/tools/organizationsGetFacility.js +1 -1
  25. package/mcp-server/tools/organizationsListOrSearchFacilities.js +1 -1
  26. package/mcp-server/tools/supportArticlesGetSupportArticle.js +1 -1
  27. package/mcp-server/tools/supportArticlesListOrSearchSupportArticles.js +1 -1
  28. package/mcp-server/tools/usersGetCurrentUser.js +1 -1
  29. package/mcp-server/tools/usersGetUserById.js +1 -1
  30. package/mcp-server/tools/usersLogsUserIntoTheSystem.js +1 -1
  31. package/mcp-server/tools/usersMagiclink.js +1 -1
  32. package/mcp-server/tools/usersPassword.js +1 -1
  33. package/mcp-server/tools/usersPasswordResetRequest.js +1 -1
  34. package/mcp-server/tools/vendorsCreateVendorRegistration.js +1 -1
  35. package/mcp-server/tools/vendorsExpediteTimeRemaining.js +1 -1
  36. package/mcp-server/tools/vendorsGetVendorInvoiceDetails.d.ts +8 -0
  37. package/mcp-server/tools/vendorsGetVendorInvoiceDetails.d.ts.map +1 -0
  38. package/mcp-server/tools/vendorsGetVendorInvoiceDetails.js +69 -0
  39. package/mcp-server/tools/vendorsGetVendorInvoiceDetails.js.map +1 -0
  40. package/mcp-server/tools/vendorsListVendorCredentials.js +1 -1
  41. package/mcp-server/tools/vendorsListVendorFacilityStatuses.d.ts +8 -0
  42. package/mcp-server/tools/vendorsListVendorFacilityStatuses.d.ts.map +1 -0
  43. package/mcp-server/tools/vendorsListVendorFacilityStatuses.js +64 -0
  44. package/mcp-server/tools/vendorsListVendorFacilityStatuses.js.map +1 -0
  45. package/mcp-server/tools/vendorsListVendorInvoices.js +1 -1
  46. package/mcp-server/tools/vendorsListVendorJobTitles.js +1 -1
  47. package/mcp-server/tools.d.ts.map +1 -1
  48. package/mcp-server/tools.js +3 -0
  49. package/mcp-server/tools.js.map +1 -1
  50. package/models/components/expand.d.ts +3 -0
  51. package/models/components/expand.d.ts.map +1 -1
  52. package/models/components/expand.js +1 -0
  53. package/models/components/expand.js.map +1 -1
  54. package/models/components/index.d.ts +2 -0
  55. package/models/components/index.d.ts.map +1 -1
  56. package/models/components/index.js +2 -0
  57. package/models/components/index.js.map +1 -1
  58. package/models/components/invoice.d.ts +13 -2
  59. package/models/components/invoice.d.ts.map +1 -1
  60. package/models/components/invoice.js +19 -2
  61. package/models/components/invoice.js.map +1 -1
  62. package/models/components/invoiceitem.d.ts +8 -0
  63. package/models/components/invoiceitem.d.ts.map +1 -1
  64. package/models/components/invoiceitem.js +12 -0
  65. package/models/components/invoiceitem.js.map +1 -1
  66. package/models/components/invoicetransaction.d.ts +44 -0
  67. package/models/components/invoicetransaction.d.ts.map +1 -0
  68. package/models/components/invoicetransaction.js +96 -0
  69. package/models/components/invoicetransaction.js.map +1 -0
  70. package/models/components/vendorfacilitystatusview.d.ts +42 -0
  71. package/models/components/vendorfacilitystatusview.d.ts.map +1 -0
  72. package/models/components/vendorfacilitystatusview.js +98 -0
  73. package/models/components/vendorfacilitystatusview.js.map +1 -0
  74. package/models/operations/getvendorinvoicedetails.d.ts +38 -0
  75. package/models/operations/getvendorinvoicedetails.d.ts.map +1 -0
  76. package/models/operations/getvendorinvoicedetails.js +72 -0
  77. package/models/operations/getvendorinvoicedetails.js.map +1 -0
  78. package/models/operations/index.d.ts +2 -0
  79. package/models/operations/index.d.ts.map +1 -1
  80. package/models/operations/index.js +2 -0
  81. package/models/operations/index.js.map +1 -1
  82. package/models/operations/listorsearchsupportarticles.d.ts +10 -0
  83. package/models/operations/listorsearchsupportarticles.d.ts.map +1 -1
  84. package/models/operations/listorsearchsupportarticles.js +4 -0
  85. package/models/operations/listorsearchsupportarticles.js.map +1 -1
  86. package/models/operations/listvendorfacilitystatuses.d.ts +106 -0
  87. package/models/operations/listvendorfacilitystatuses.d.ts.map +1 -0
  88. package/models/operations/listvendorfacilitystatuses.js +149 -0
  89. package/models/operations/listvendorfacilitystatuses.js.map +1 -0
  90. package/package.json +1 -1
  91. package/react-query/index.d.ts +2 -0
  92. package/react-query/index.d.ts.map +1 -1
  93. package/react-query/index.js +2 -0
  94. package/react-query/index.js.map +1 -1
  95. package/react-query/supportArticlesListOrSearchSupportArticles.d.ts +6 -0
  96. package/react-query/supportArticlesListOrSearchSupportArticles.d.ts.map +1 -1
  97. package/react-query/supportArticlesListOrSearchSupportArticles.js +4 -0
  98. package/react-query/supportArticlesListOrSearchSupportArticles.js.map +1 -1
  99. package/react-query/vendorsGetVendorInvoiceDetails.d.ts +53 -0
  100. package/react-query/vendorsGetVendorInvoiceDetails.d.ts.map +1 -0
  101. package/react-query/vendorsGetVendorInvoiceDetails.js +109 -0
  102. package/react-query/vendorsGetVendorInvoiceDetails.js.map +1 -0
  103. package/react-query/vendorsListVendorFacilityStatuses.d.ts +75 -0
  104. package/react-query/vendorsListVendorFacilityStatuses.d.ts.map +1 -0
  105. package/react-query/vendorsListVendorFacilityStatuses.js +159 -0
  106. package/react-query/vendorsListVendorFacilityStatuses.js.map +1 -0
  107. package/sdk/vendors.d.ts +22 -0
  108. package/sdk/vendors.d.ts.map +1 -1
  109. package/sdk/vendors.js +25 -0
  110. package/sdk/vendors.js.map +1 -1
  111. package/src/__tests__/vendors.test.ts +58 -0
  112. package/src/funcs/supportArticlesListOrSearchSupportArticles.ts +2 -0
  113. package/src/funcs/vendorsGetVendorInvoiceDetails.ts +180 -0
  114. package/src/funcs/vendorsListVendorFacilityStatuses.ts +240 -0
  115. package/src/lib/config.ts +3 -3
  116. package/src/lib/sdks.ts +2 -7
  117. package/src/mcp-server/mcp-server.ts +1 -1
  118. package/src/mcp-server/server.ts +5 -1
  119. package/src/mcp-server/tools/organizationsGetFacility.ts +1 -1
  120. package/src/mcp-server/tools/organizationsListOrSearchFacilities.ts +1 -1
  121. package/src/mcp-server/tools/supportArticlesGetSupportArticle.ts +1 -1
  122. package/src/mcp-server/tools/supportArticlesListOrSearchSupportArticles.ts +1 -1
  123. package/src/mcp-server/tools/usersGetCurrentUser.ts +1 -1
  124. package/src/mcp-server/tools/usersGetUserById.ts +1 -1
  125. package/src/mcp-server/tools/usersLogsUserIntoTheSystem.ts +1 -1
  126. package/src/mcp-server/tools/usersMagiclink.ts +1 -1
  127. package/src/mcp-server/tools/usersPassword.ts +1 -1
  128. package/src/mcp-server/tools/usersPasswordResetRequest.ts +1 -1
  129. package/src/mcp-server/tools/vendorsCreateVendorRegistration.ts +1 -1
  130. package/src/mcp-server/tools/vendorsExpediteTimeRemaining.ts +1 -1
  131. package/src/mcp-server/tools/vendorsGetVendorInvoiceDetails.ts +43 -0
  132. package/src/mcp-server/tools/vendorsListVendorCredentials.ts +1 -1
  133. package/src/mcp-server/tools/vendorsListVendorFacilityStatuses.ts +39 -0
  134. package/src/mcp-server/tools/vendorsListVendorInvoices.ts +1 -1
  135. package/src/mcp-server/tools/vendorsListVendorJobTitles.ts +1 -1
  136. package/src/mcp-server/tools.ts +4 -0
  137. package/src/models/components/expand.ts +1 -0
  138. package/src/models/components/index.ts +2 -0
  139. package/src/models/components/invoice.ts +36 -4
  140. package/src/models/components/invoiceitem.ts +20 -0
  141. package/src/models/components/invoicetransaction.ts +108 -0
  142. package/src/models/components/vendorfacilitystatusview.ts +108 -0
  143. package/src/models/operations/getvendorinvoicedetails.ts +79 -0
  144. package/src/models/operations/index.ts +2 -0
  145. package/src/models/operations/listorsearchsupportarticles.ts +14 -0
  146. package/src/models/operations/listvendorfacilitystatuses.ts +247 -0
  147. package/src/react-query/index.ts +2 -0
  148. package/src/react-query/supportArticlesListOrSearchSupportArticles.ts +10 -0
  149. package/src/react-query/vendorsGetVendorInvoiceDetails.ts +187 -0
  150. package/src/react-query/vendorsListVendorFacilityStatuses.ts +342 -0
  151. package/src/sdk/vendors.ts +47 -0
@@ -198,6 +198,8 @@ export function setSupportArticlesListOrSearchSupportArticlesData(
198
198
  desc?: components.Desc | undefined;
199
199
  page?: number | undefined;
200
200
  itemsPerPage?: number | undefined;
201
+ category?: string | undefined;
202
+ search?: string | undefined;
201
203
  },
202
204
  ],
203
205
  data: SupportArticlesListOrSearchSupportArticlesQueryData,
@@ -219,6 +221,8 @@ export function invalidateSupportArticlesListOrSearchSupportArticles(
219
221
  desc?: components.Desc | undefined;
220
222
  page?: number | undefined;
221
223
  itemsPerPage?: number | undefined;
224
+ category?: string | undefined;
225
+ search?: string | undefined;
222
226
  }]
223
227
  >,
224
228
  filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
@@ -264,6 +268,8 @@ export function buildSupportArticlesListOrSearchSupportArticlesQuery(
264
268
  desc: request.desc,
265
269
  page: request.page,
266
270
  itemsPerPage: request.itemsPerPage,
271
+ category: request.category,
272
+ search: request.search,
267
273
  }),
268
274
  queryFn: async function supportArticlesListOrSearchSupportArticlesQueryFn(
269
275
  ctx,
@@ -302,6 +308,8 @@ export function buildSupportArticlesListOrSearchSupportArticlesInfiniteQuery(
302
308
  desc: request.desc,
303
309
  page: request.page,
304
310
  itemsPerPage: request.itemsPerPage,
311
+ category: request.category,
312
+ search: request.search,
305
313
  }),
306
314
  queryFn: async function supportArticlesListOrSearchSupportArticlesQuery(
307
315
  ctx,
@@ -338,6 +346,8 @@ export function queryKeySupportArticlesListOrSearchSupportArticles(
338
346
  desc?: components.Desc | undefined;
339
347
  page?: number | undefined;
340
348
  itemsPerPage?: number | undefined;
349
+ category?: string | undefined;
350
+ search?: string | undefined;
341
351
  },
342
352
  ): QueryKey {
343
353
  return [
@@ -0,0 +1,187 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import {
6
+ InvalidateQueryFilters,
7
+ QueryClient,
8
+ QueryFunctionContext,
9
+ QueryKey,
10
+ useQuery,
11
+ UseQueryResult,
12
+ useSuspenseQuery,
13
+ UseSuspenseQueryResult,
14
+ } from "@tanstack/react-query";
15
+ import { GreenSecurityCore } from "../core.js";
16
+ import { vendorsGetVendorInvoiceDetails } from "../funcs/vendorsGetVendorInvoiceDetails.js";
17
+ import { combineSignals } from "../lib/primitives.js";
18
+ import { RequestOptions } from "../lib/sdks.js";
19
+ import * as components from "../models/components/index.js";
20
+ import * as operations from "../models/operations/index.js";
21
+ import { unwrapAsync } from "../types/fp.js";
22
+ import { useGreenSecurityContext } from "./_context.js";
23
+ import {
24
+ QueryHookOptions,
25
+ SuspenseQueryHookOptions,
26
+ TupleToPrefixes,
27
+ } from "./_types.js";
28
+
29
+ export type VendorsGetVendorInvoiceDetailsQueryData = components.Invoice;
30
+
31
+ /**
32
+ * Get vendor invoice details
33
+ *
34
+ * @remarks
35
+ * Retrieve an individual vendor invoice detais.
36
+ *
37
+ * Available `expand` scopes are:
38
+ *
39
+ * invoice.line_items
40
+ * invoice.invoice_transactions
41
+ */
42
+ export function useVendorsGetVendorInvoiceDetails(
43
+ request: operations.GetVendorInvoiceDetailsRequest,
44
+ options?: QueryHookOptions<VendorsGetVendorInvoiceDetailsQueryData>,
45
+ ): UseQueryResult<VendorsGetVendorInvoiceDetailsQueryData, Error> {
46
+ const client = useGreenSecurityContext();
47
+ return useQuery({
48
+ ...buildVendorsGetVendorInvoiceDetailsQuery(
49
+ client,
50
+ request,
51
+ options,
52
+ ),
53
+ ...options,
54
+ });
55
+ }
56
+
57
+ /**
58
+ * Get vendor invoice details
59
+ *
60
+ * @remarks
61
+ * Retrieve an individual vendor invoice detais.
62
+ *
63
+ * Available `expand` scopes are:
64
+ *
65
+ * invoice.line_items
66
+ * invoice.invoice_transactions
67
+ */
68
+ export function useVendorsGetVendorInvoiceDetailsSuspense(
69
+ request: operations.GetVendorInvoiceDetailsRequest,
70
+ options?: SuspenseQueryHookOptions<VendorsGetVendorInvoiceDetailsQueryData>,
71
+ ): UseSuspenseQueryResult<VendorsGetVendorInvoiceDetailsQueryData, Error> {
72
+ const client = useGreenSecurityContext();
73
+ return useSuspenseQuery({
74
+ ...buildVendorsGetVendorInvoiceDetailsQuery(
75
+ client,
76
+ request,
77
+ options,
78
+ ),
79
+ ...options,
80
+ });
81
+ }
82
+
83
+ export function prefetchVendorsGetVendorInvoiceDetails(
84
+ queryClient: QueryClient,
85
+ client$: GreenSecurityCore,
86
+ request: operations.GetVendorInvoiceDetailsRequest,
87
+ ): Promise<void> {
88
+ return queryClient.prefetchQuery({
89
+ ...buildVendorsGetVendorInvoiceDetailsQuery(
90
+ client$,
91
+ request,
92
+ ),
93
+ });
94
+ }
95
+
96
+ export function setVendorsGetVendorInvoiceDetailsData(
97
+ client: QueryClient,
98
+ queryKeyBase: [
99
+ id: number,
100
+ parameters: { expand?: Array<components.Expand> | undefined },
101
+ ],
102
+ data: VendorsGetVendorInvoiceDetailsQueryData,
103
+ ): VendorsGetVendorInvoiceDetailsQueryData | undefined {
104
+ const key = queryKeyVendorsGetVendorInvoiceDetails(...queryKeyBase);
105
+
106
+ return client.setQueryData<VendorsGetVendorInvoiceDetailsQueryData>(
107
+ key,
108
+ data,
109
+ );
110
+ }
111
+
112
+ export function invalidateVendorsGetVendorInvoiceDetails(
113
+ client: QueryClient,
114
+ queryKeyBase: TupleToPrefixes<
115
+ [id: number, parameters: { expand?: Array<components.Expand> | undefined }]
116
+ >,
117
+ filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
118
+ ): Promise<void> {
119
+ return client.invalidateQueries({
120
+ ...filters,
121
+ queryKey: [
122
+ "@greensecurity/javascript-sdk",
123
+ "vendors",
124
+ "getVendorInvoiceDetails",
125
+ ...queryKeyBase,
126
+ ],
127
+ });
128
+ }
129
+
130
+ export function invalidateAllVendorsGetVendorInvoiceDetails(
131
+ client: QueryClient,
132
+ filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
133
+ ): Promise<void> {
134
+ return client.invalidateQueries({
135
+ ...filters,
136
+ queryKey: [
137
+ "@greensecurity/javascript-sdk",
138
+ "vendors",
139
+ "getVendorInvoiceDetails",
140
+ ],
141
+ });
142
+ }
143
+
144
+ export function buildVendorsGetVendorInvoiceDetailsQuery(
145
+ client$: GreenSecurityCore,
146
+ request: operations.GetVendorInvoiceDetailsRequest,
147
+ options?: RequestOptions,
148
+ ): {
149
+ queryKey: QueryKey;
150
+ queryFn: (
151
+ context: QueryFunctionContext,
152
+ ) => Promise<VendorsGetVendorInvoiceDetailsQueryData>;
153
+ } {
154
+ return {
155
+ queryKey: queryKeyVendorsGetVendorInvoiceDetails(request.id, {
156
+ expand: request.expand,
157
+ }),
158
+ queryFn: async function vendorsGetVendorInvoiceDetailsQueryFn(
159
+ ctx,
160
+ ): Promise<VendorsGetVendorInvoiceDetailsQueryData> {
161
+ const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
162
+ const mergedOptions = {
163
+ ...options,
164
+ fetchOptions: { ...options?.fetchOptions, signal: sig },
165
+ };
166
+
167
+ return unwrapAsync(vendorsGetVendorInvoiceDetails(
168
+ client$,
169
+ request,
170
+ mergedOptions,
171
+ ));
172
+ },
173
+ };
174
+ }
175
+
176
+ export function queryKeyVendorsGetVendorInvoiceDetails(
177
+ id: number,
178
+ parameters: { expand?: Array<components.Expand> | undefined },
179
+ ): QueryKey {
180
+ return [
181
+ "@greensecurity/javascript-sdk",
182
+ "vendors",
183
+ "getVendorInvoiceDetails",
184
+ id,
185
+ parameters,
186
+ ];
187
+ }
@@ -0,0 +1,342 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import {
6
+ InfiniteData,
7
+ InvalidateQueryFilters,
8
+ QueryClient,
9
+ QueryFunctionContext,
10
+ QueryKey,
11
+ useInfiniteQuery,
12
+ UseInfiniteQueryResult,
13
+ useQuery,
14
+ UseQueryResult,
15
+ useSuspenseInfiniteQuery,
16
+ UseSuspenseInfiniteQueryResult,
17
+ useSuspenseQuery,
18
+ UseSuspenseQueryResult,
19
+ } from "@tanstack/react-query";
20
+ import { GreenSecurityCore } from "../core.js";
21
+ import { vendorsListVendorFacilityStatuses } from "../funcs/vendorsListVendorFacilityStatuses.js";
22
+ import { combineSignals } from "../lib/primitives.js";
23
+ import { RequestOptions } from "../lib/sdks.js";
24
+ import * as components from "../models/components/index.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { unwrapAsync } from "../types/fp.js";
27
+ import { PageIterator, unwrapResultIterator } from "../types/operations.js";
28
+ import { useGreenSecurityContext } from "./_context.js";
29
+ import {
30
+ InfiniteQueryHookOptions,
31
+ QueryHookOptions,
32
+ SuspenseInfiniteQueryHookOptions,
33
+ SuspenseQueryHookOptions,
34
+ TupleToPrefixes,
35
+ } from "./_types.js";
36
+
37
+ export type VendorsListVendorFacilityStatusesQueryData =
38
+ operations.ListVendorFacilityStatusesResponse;
39
+
40
+ export type VendorsListVendorFacilityStatusesInfiniteQueryData = PageIterator<
41
+ operations.ListVendorFacilityStatusesResponse,
42
+ { page: number }
43
+ >;
44
+
45
+ export type VendorsListVendorFacilityStatusesPageParams = PageIterator<
46
+ operations.ListVendorFacilityStatusesResponse,
47
+ { page: number }
48
+ >["~next"];
49
+
50
+ /**
51
+ * List vendor facility statuses
52
+ *
53
+ * @remarks
54
+ * List the facilities for the vendor
55
+ */
56
+ export function useVendorsListVendorFacilityStatuses(
57
+ request: operations.ListVendorFacilityStatusesRequest,
58
+ options?: QueryHookOptions<VendorsListVendorFacilityStatusesQueryData>,
59
+ ): UseQueryResult<VendorsListVendorFacilityStatusesQueryData, Error> {
60
+ const client = useGreenSecurityContext();
61
+ return useQuery({
62
+ ...buildVendorsListVendorFacilityStatusesQuery(
63
+ client,
64
+ request,
65
+ options,
66
+ ),
67
+ ...options,
68
+ });
69
+ }
70
+
71
+ /**
72
+ * List vendor facility statuses
73
+ *
74
+ * @remarks
75
+ * List the facilities for the vendor
76
+ */
77
+ export function useVendorsListVendorFacilityStatusesSuspense(
78
+ request: operations.ListVendorFacilityStatusesRequest,
79
+ options?: SuspenseQueryHookOptions<
80
+ VendorsListVendorFacilityStatusesQueryData
81
+ >,
82
+ ): UseSuspenseQueryResult<VendorsListVendorFacilityStatusesQueryData, Error> {
83
+ const client = useGreenSecurityContext();
84
+ return useSuspenseQuery({
85
+ ...buildVendorsListVendorFacilityStatusesQuery(
86
+ client,
87
+ request,
88
+ options,
89
+ ),
90
+ ...options,
91
+ });
92
+ }
93
+
94
+ /**
95
+ * List vendor facility statuses
96
+ *
97
+ * @remarks
98
+ * List the facilities for the vendor
99
+ */
100
+ export function useVendorsListVendorFacilityStatusesInfinite(
101
+ request: operations.ListVendorFacilityStatusesRequest,
102
+ options?: InfiniteQueryHookOptions<
103
+ VendorsListVendorFacilityStatusesInfiniteQueryData
104
+ >,
105
+ ): UseInfiniteQueryResult<
106
+ InfiniteData<
107
+ VendorsListVendorFacilityStatusesInfiniteQueryData,
108
+ VendorsListVendorFacilityStatusesPageParams
109
+ >,
110
+ Error
111
+ > {
112
+ const client = useGreenSecurityContext();
113
+ return useInfiniteQuery<
114
+ VendorsListVendorFacilityStatusesInfiniteQueryData,
115
+ Error,
116
+ InfiniteData<
117
+ VendorsListVendorFacilityStatusesInfiniteQueryData,
118
+ VendorsListVendorFacilityStatusesPageParams
119
+ >,
120
+ QueryKey,
121
+ VendorsListVendorFacilityStatusesPageParams
122
+ >({
123
+ ...buildVendorsListVendorFacilityStatusesInfiniteQuery(
124
+ client,
125
+ request,
126
+ options,
127
+ ),
128
+ initialPageParam: options?.initialPageParam,
129
+ getNextPageParam: (previousPage) => previousPage["~next"],
130
+ ...options,
131
+ });
132
+ }
133
+
134
+ /**
135
+ * List vendor facility statuses
136
+ *
137
+ * @remarks
138
+ * List the facilities for the vendor
139
+ */
140
+ export function useVendorsListVendorFacilityStatusesInfiniteSuspense(
141
+ request: operations.ListVendorFacilityStatusesRequest,
142
+ options?: SuspenseInfiniteQueryHookOptions<
143
+ VendorsListVendorFacilityStatusesInfiniteQueryData
144
+ >,
145
+ ): UseSuspenseInfiniteQueryResult<
146
+ InfiniteData<
147
+ VendorsListVendorFacilityStatusesInfiniteQueryData,
148
+ VendorsListVendorFacilityStatusesPageParams
149
+ >,
150
+ Error
151
+ > {
152
+ const client = useGreenSecurityContext();
153
+ return useSuspenseInfiniteQuery<
154
+ VendorsListVendorFacilityStatusesInfiniteQueryData,
155
+ Error,
156
+ InfiniteData<
157
+ VendorsListVendorFacilityStatusesInfiniteQueryData,
158
+ VendorsListVendorFacilityStatusesPageParams
159
+ >,
160
+ QueryKey,
161
+ VendorsListVendorFacilityStatusesPageParams
162
+ >({
163
+ ...buildVendorsListVendorFacilityStatusesInfiniteQuery(
164
+ client,
165
+ request,
166
+ options,
167
+ ),
168
+ initialPageParam: options?.initialPageParam,
169
+ getNextPageParam: (previousPage) => previousPage["~next"],
170
+ ...options,
171
+ });
172
+ }
173
+
174
+ export function prefetchVendorsListVendorFacilityStatuses(
175
+ queryClient: QueryClient,
176
+ client$: GreenSecurityCore,
177
+ request: operations.ListVendorFacilityStatusesRequest,
178
+ ): Promise<void> {
179
+ return queryClient.prefetchQuery({
180
+ ...buildVendorsListVendorFacilityStatusesQuery(
181
+ client$,
182
+ request,
183
+ ),
184
+ });
185
+ }
186
+
187
+ export function setVendorsListVendorFacilityStatusesData(
188
+ client: QueryClient,
189
+ queryKeyBase: [
190
+ parameters: {
191
+ sort?: string | null | undefined;
192
+ desc?: components.Desc | undefined;
193
+ page?: number | undefined;
194
+ itemsPerPage?: number | undefined;
195
+ },
196
+ ],
197
+ data: VendorsListVendorFacilityStatusesQueryData,
198
+ ): VendorsListVendorFacilityStatusesQueryData | undefined {
199
+ const key = queryKeyVendorsListVendorFacilityStatuses(...queryKeyBase);
200
+
201
+ return client.setQueryData<VendorsListVendorFacilityStatusesQueryData>(
202
+ key,
203
+ data,
204
+ );
205
+ }
206
+
207
+ export function invalidateVendorsListVendorFacilityStatuses(
208
+ client: QueryClient,
209
+ queryKeyBase: TupleToPrefixes<
210
+ [parameters: {
211
+ sort?: string | null | undefined;
212
+ desc?: components.Desc | undefined;
213
+ page?: number | undefined;
214
+ itemsPerPage?: number | undefined;
215
+ }]
216
+ >,
217
+ filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
218
+ ): Promise<void> {
219
+ return client.invalidateQueries({
220
+ ...filters,
221
+ queryKey: [
222
+ "@greensecurity/javascript-sdk",
223
+ "vendors",
224
+ "listVendorFacilityStatuses",
225
+ ...queryKeyBase,
226
+ ],
227
+ });
228
+ }
229
+
230
+ export function invalidateAllVendorsListVendorFacilityStatuses(
231
+ client: QueryClient,
232
+ filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
233
+ ): Promise<void> {
234
+ return client.invalidateQueries({
235
+ ...filters,
236
+ queryKey: [
237
+ "@greensecurity/javascript-sdk",
238
+ "vendors",
239
+ "listVendorFacilityStatuses",
240
+ ],
241
+ });
242
+ }
243
+
244
+ export function buildVendorsListVendorFacilityStatusesQuery(
245
+ client$: GreenSecurityCore,
246
+ request: operations.ListVendorFacilityStatusesRequest,
247
+ options?: RequestOptions,
248
+ ): {
249
+ queryKey: QueryKey;
250
+ queryFn: (
251
+ context: QueryFunctionContext,
252
+ ) => Promise<VendorsListVendorFacilityStatusesQueryData>;
253
+ } {
254
+ return {
255
+ queryKey: queryKeyVendorsListVendorFacilityStatuses({
256
+ sort: request.sort,
257
+ desc: request.desc,
258
+ page: request.page,
259
+ itemsPerPage: request.itemsPerPage,
260
+ }),
261
+ queryFn: async function vendorsListVendorFacilityStatusesQueryFn(
262
+ ctx,
263
+ ): Promise<VendorsListVendorFacilityStatusesQueryData> {
264
+ const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
265
+ const mergedOptions = {
266
+ ...options,
267
+ fetchOptions: { ...options?.fetchOptions, signal: sig },
268
+ };
269
+
270
+ return unwrapAsync(vendorsListVendorFacilityStatuses(
271
+ client$,
272
+ request,
273
+ mergedOptions,
274
+ ));
275
+ },
276
+ };
277
+ }
278
+
279
+ export function buildVendorsListVendorFacilityStatusesInfiniteQuery(
280
+ client$: GreenSecurityCore,
281
+ request: operations.ListVendorFacilityStatusesRequest,
282
+ options?: RequestOptions,
283
+ ): {
284
+ queryKey: QueryKey;
285
+ queryFn: (
286
+ context: QueryFunctionContext<
287
+ QueryKey,
288
+ VendorsListVendorFacilityStatusesPageParams
289
+ >,
290
+ ) => Promise<VendorsListVendorFacilityStatusesInfiniteQueryData>;
291
+ } {
292
+ return {
293
+ queryKey: queryKeyVendorsListVendorFacilityStatuses({
294
+ sort: request.sort,
295
+ desc: request.desc,
296
+ page: request.page,
297
+ itemsPerPage: request.itemsPerPage,
298
+ }),
299
+ queryFn: async function vendorsListVendorFacilityStatusesQuery(
300
+ ctx,
301
+ ): Promise<VendorsListVendorFacilityStatusesInfiniteQueryData> {
302
+ const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
303
+ const mergedOptions = {
304
+ ...options,
305
+ fetchOptions: { ...options?.fetchOptions, signal: sig },
306
+ };
307
+
308
+ if (!ctx.pageParam) {
309
+ return unwrapResultIterator(vendorsListVendorFacilityStatuses(
310
+ client$,
311
+ request,
312
+ mergedOptions,
313
+ ));
314
+ }
315
+
316
+ return unwrapResultIterator(vendorsListVendorFacilityStatuses(
317
+ client$,
318
+ {
319
+ ...request,
320
+ page: ctx.pageParam.page,
321
+ },
322
+ mergedOptions,
323
+ ));
324
+ },
325
+ };
326
+ }
327
+
328
+ export function queryKeyVendorsListVendorFacilityStatuses(
329
+ parameters: {
330
+ sort?: string | null | undefined;
331
+ desc?: components.Desc | undefined;
332
+ page?: number | undefined;
333
+ itemsPerPage?: number | undefined;
334
+ },
335
+ ): QueryKey {
336
+ return [
337
+ "@greensecurity/javascript-sdk",
338
+ "vendors",
339
+ "listVendorFacilityStatuses",
340
+ parameters,
341
+ ];
342
+ }
@@ -4,10 +4,13 @@
4
4
 
5
5
  import { vendorsCreateVendorRegistration } from "../funcs/vendorsCreateVendorRegistration.js";
6
6
  import { vendorsExpediteTimeRemaining } from "../funcs/vendorsExpediteTimeRemaining.js";
7
+ import { vendorsGetVendorInvoiceDetails } from "../funcs/vendorsGetVendorInvoiceDetails.js";
7
8
  import { vendorsListVendorCredentials } from "../funcs/vendorsListVendorCredentials.js";
9
+ import { vendorsListVendorFacilityStatuses } from "../funcs/vendorsListVendorFacilityStatuses.js";
8
10
  import { vendorsListVendorInvoices } from "../funcs/vendorsListVendorInvoices.js";
9
11
  import { vendorsListVendorJobTitles } from "../funcs/vendorsListVendorJobTitles.js";
10
12
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
13
+ import * as components from "../models/components/index.js";
11
14
  import * as operations from "../models/operations/index.js";
12
15
  import { unwrapAsync } from "../types/fp.js";
13
16
  import { PageIterator, unwrapResultIterator } from "../types/operations.js";
@@ -107,4 +110,48 @@ export class Vendors extends ClientSDK {
107
110
  options,
108
111
  ));
109
112
  }
113
+
114
+ /**
115
+ * Get vendor invoice details
116
+ *
117
+ * @remarks
118
+ * Retrieve an individual vendor invoice detais.
119
+ *
120
+ * Available `expand` scopes are:
121
+ *
122
+ * invoice.line_items
123
+ * invoice.invoice_transactions
124
+ */
125
+ async getVendorInvoiceDetails(
126
+ request: operations.GetVendorInvoiceDetailsRequest,
127
+ options?: RequestOptions,
128
+ ): Promise<components.Invoice> {
129
+ return unwrapAsync(vendorsGetVendorInvoiceDetails(
130
+ this,
131
+ request,
132
+ options,
133
+ ));
134
+ }
135
+
136
+ /**
137
+ * List vendor facility statuses
138
+ *
139
+ * @remarks
140
+ * List the facilities for the vendor
141
+ */
142
+ async listVendorFacilityStatuses(
143
+ request: operations.ListVendorFacilityStatusesRequest,
144
+ options?: RequestOptions,
145
+ ): Promise<
146
+ PageIterator<
147
+ operations.ListVendorFacilityStatusesResponse,
148
+ { page: number }
149
+ >
150
+ > {
151
+ return unwrapResultIterator(vendorsListVendorFacilityStatuses(
152
+ this,
153
+ request,
154
+ options,
155
+ ));
156
+ }
110
157
  }