@greensecurity/javascript-sdk 0.43.1-beta.137 → 0.43.1-beta.139

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 (104) hide show
  1. package/README.md +3 -0
  2. package/dist/commonjs/__tests__/vendors.test.js +36 -0
  3. package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
  4. package/dist/commonjs/__tests__/webhooks.test.js +1 -1
  5. package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
  6. package/dist/commonjs/__tests__/zones.test.js +32 -3
  7. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  8. package/dist/commonjs/funcs/vendorsGetVendorUploadHistory.d.ts +23 -0
  9. package/dist/commonjs/funcs/vendorsGetVendorUploadHistory.d.ts.map +1 -0
  10. package/dist/commonjs/funcs/vendorsGetVendorUploadHistory.js +166 -0
  11. package/dist/commonjs/funcs/vendorsGetVendorUploadHistory.js.map +1 -0
  12. package/dist/commonjs/lib/config.d.ts +2 -2
  13. package/dist/commonjs/lib/config.js +2 -2
  14. package/dist/commonjs/models/components/index.d.ts +1 -0
  15. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  16. package/dist/commonjs/models/components/index.js +1 -0
  17. package/dist/commonjs/models/components/index.js.map +1 -1
  18. package/dist/commonjs/models/components/uploadhistoryitem.d.ts +14 -0
  19. package/dist/commonjs/models/components/uploadhistoryitem.d.ts.map +1 -0
  20. package/dist/commonjs/models/components/uploadhistoryitem.js +63 -0
  21. package/dist/commonjs/models/components/uploadhistoryitem.js.map +1 -0
  22. package/dist/commonjs/models/operations/getvendoruploadhistory.d.ts +63 -0
  23. package/dist/commonjs/models/operations/getvendoruploadhistory.d.ts.map +1 -0
  24. package/dist/commonjs/models/operations/getvendoruploadhistory.js +83 -0
  25. package/dist/commonjs/models/operations/getvendoruploadhistory.js.map +1 -0
  26. package/dist/commonjs/models/operations/index.d.ts +1 -0
  27. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  28. package/dist/commonjs/models/operations/index.js +1 -0
  29. package/dist/commonjs/models/operations/index.js.map +1 -1
  30. package/dist/commonjs/react-query/index.d.ts +1 -0
  31. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  32. package/dist/commonjs/react-query/index.js +1 -0
  33. package/dist/commonjs/react-query/index.js.map +1 -1
  34. package/dist/commonjs/react-query/vendorsGetVendorUploadHistory.core.d.ts +36 -0
  35. package/dist/commonjs/react-query/vendorsGetVendorUploadHistory.core.d.ts.map +1 -0
  36. package/dist/commonjs/react-query/vendorsGetVendorUploadHistory.core.js +94 -0
  37. package/dist/commonjs/react-query/vendorsGetVendorUploadHistory.core.js.map +1 -0
  38. package/dist/commonjs/react-query/vendorsGetVendorUploadHistory.d.ts +60 -0
  39. package/dist/commonjs/react-query/vendorsGetVendorUploadHistory.d.ts.map +1 -0
  40. package/dist/commonjs/react-query/vendorsGetVendorUploadHistory.js +105 -0
  41. package/dist/commonjs/react-query/vendorsGetVendorUploadHistory.js.map +1 -0
  42. package/dist/commonjs/sdk/vendors.d.ts +9 -0
  43. package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
  44. package/dist/commonjs/sdk/vendors.js +10 -0
  45. package/dist/commonjs/sdk/vendors.js.map +1 -1
  46. package/dist/esm/__tests__/vendors.test.js +36 -0
  47. package/dist/esm/__tests__/vendors.test.js.map +1 -1
  48. package/dist/esm/__tests__/webhooks.test.js +1 -1
  49. package/dist/esm/__tests__/webhooks.test.js.map +1 -1
  50. package/dist/esm/__tests__/zones.test.js +32 -3
  51. package/dist/esm/__tests__/zones.test.js.map +1 -1
  52. package/dist/esm/funcs/vendorsGetVendorUploadHistory.d.ts +23 -0
  53. package/dist/esm/funcs/vendorsGetVendorUploadHistory.d.ts.map +1 -0
  54. package/dist/esm/funcs/vendorsGetVendorUploadHistory.js +130 -0
  55. package/dist/esm/funcs/vendorsGetVendorUploadHistory.js.map +1 -0
  56. package/dist/esm/lib/config.d.ts +2 -2
  57. package/dist/esm/lib/config.js +2 -2
  58. package/dist/esm/models/components/index.d.ts +1 -0
  59. package/dist/esm/models/components/index.d.ts.map +1 -1
  60. package/dist/esm/models/components/index.js +1 -0
  61. package/dist/esm/models/components/index.js.map +1 -1
  62. package/dist/esm/models/components/uploadhistoryitem.d.ts +14 -0
  63. package/dist/esm/models/components/uploadhistoryitem.d.ts.map +1 -0
  64. package/dist/esm/models/components/uploadhistoryitem.js +26 -0
  65. package/dist/esm/models/components/uploadhistoryitem.js.map +1 -0
  66. package/dist/esm/models/operations/getvendoruploadhistory.d.ts +63 -0
  67. package/dist/esm/models/operations/getvendoruploadhistory.d.ts.map +1 -0
  68. package/dist/esm/models/operations/getvendoruploadhistory.js +44 -0
  69. package/dist/esm/models/operations/getvendoruploadhistory.js.map +1 -0
  70. package/dist/esm/models/operations/index.d.ts +1 -0
  71. package/dist/esm/models/operations/index.d.ts.map +1 -1
  72. package/dist/esm/models/operations/index.js +1 -0
  73. package/dist/esm/models/operations/index.js.map +1 -1
  74. package/dist/esm/react-query/index.d.ts +1 -0
  75. package/dist/esm/react-query/index.d.ts.map +1 -1
  76. package/dist/esm/react-query/index.js +1 -0
  77. package/dist/esm/react-query/index.js.map +1 -1
  78. package/dist/esm/react-query/vendorsGetVendorUploadHistory.core.d.ts +36 -0
  79. package/dist/esm/react-query/vendorsGetVendorUploadHistory.core.d.ts.map +1 -0
  80. package/dist/esm/react-query/vendorsGetVendorUploadHistory.core.js +86 -0
  81. package/dist/esm/react-query/vendorsGetVendorUploadHistory.core.js.map +1 -0
  82. package/dist/esm/react-query/vendorsGetVendorUploadHistory.d.ts +60 -0
  83. package/dist/esm/react-query/vendorsGetVendorUploadHistory.d.ts.map +1 -0
  84. package/dist/esm/react-query/vendorsGetVendorUploadHistory.js +90 -0
  85. package/dist/esm/react-query/vendorsGetVendorUploadHistory.js.map +1 -0
  86. package/dist/esm/sdk/vendors.d.ts +9 -0
  87. package/dist/esm/sdk/vendors.d.ts.map +1 -1
  88. package/dist/esm/sdk/vendors.js +10 -0
  89. package/dist/esm/sdk/vendors.js.map +1 -1
  90. package/jsr.json +1 -1
  91. package/package.json +1 -1
  92. package/src/__tests__/vendors.test.ts +39 -0
  93. package/src/__tests__/webhooks.test.ts +1 -1
  94. package/src/__tests__/zones.test.ts +32 -3
  95. package/src/funcs/vendorsGetVendorUploadHistory.ts +260 -0
  96. package/src/lib/config.ts +2 -2
  97. package/src/models/components/index.ts +1 -0
  98. package/src/models/components/uploadhistoryitem.ts +48 -0
  99. package/src/models/operations/getvendoruploadhistory.ts +144 -0
  100. package/src/models/operations/index.ts +1 -0
  101. package/src/react-query/index.ts +1 -0
  102. package/src/react-query/vendorsGetVendorUploadHistory.core.ts +199 -0
  103. package/src/react-query/vendorsGetVendorUploadHistory.ts +267 -0
  104. package/src/sdk/vendors.ts +20 -0
@@ -0,0 +1,267 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: d5ed03adbdf5
4
+ */
5
+
6
+ import {
7
+ InfiniteData,
8
+ InvalidateQueryFilters,
9
+ QueryClient,
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 * as components from "../models/components/index.js";
21
+ import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
22
+ import {
23
+ ConnectionError,
24
+ InvalidRequestError,
25
+ RequestAbortedError,
26
+ RequestTimeoutError,
27
+ UnexpectedClientError,
28
+ } from "../models/errors/httpclienterrors.js";
29
+ import * as errors from "../models/errors/index.js";
30
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
31
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
32
+ import * as operations from "../models/operations/index.js";
33
+ import { useGreenSecurityContext } from "./_context.js";
34
+ import {
35
+ InfiniteQueryHookOptions,
36
+ QueryHookOptions,
37
+ SuspenseInfiniteQueryHookOptions,
38
+ SuspenseQueryHookOptions,
39
+ TupleToPrefixes,
40
+ } from "./_types.js";
41
+ import {
42
+ buildVendorsGetVendorUploadHistoryInfiniteQuery,
43
+ buildVendorsGetVendorUploadHistoryQuery,
44
+ prefetchVendorsGetVendorUploadHistory,
45
+ prefetchVendorsGetVendorUploadHistoryInfinite,
46
+ queryKeyVendorsGetVendorUploadHistory,
47
+ queryKeyVendorsGetVendorUploadHistoryInfinite,
48
+ VendorsGetVendorUploadHistoryInfiniteQueryData,
49
+ VendorsGetVendorUploadHistoryPageParams,
50
+ VendorsGetVendorUploadHistoryQueryData,
51
+ } from "./vendorsGetVendorUploadHistory.core.js";
52
+ export {
53
+ buildVendorsGetVendorUploadHistoryInfiniteQuery,
54
+ buildVendorsGetVendorUploadHistoryQuery,
55
+ prefetchVendorsGetVendorUploadHistory,
56
+ prefetchVendorsGetVendorUploadHistoryInfinite,
57
+ queryKeyVendorsGetVendorUploadHistory,
58
+ queryKeyVendorsGetVendorUploadHistoryInfinite,
59
+ type VendorsGetVendorUploadHistoryInfiniteQueryData,
60
+ type VendorsGetVendorUploadHistoryPageParams,
61
+ type VendorsGetVendorUploadHistoryQueryData,
62
+ };
63
+
64
+ export type VendorsGetVendorUploadHistoryQueryError =
65
+ | errors.ApiErrorResponse
66
+ | GreenSecurityError
67
+ | ResponseValidationError
68
+ | ConnectionError
69
+ | RequestAbortedError
70
+ | RequestTimeoutError
71
+ | InvalidRequestError
72
+ | UnexpectedClientError
73
+ | SDKValidationError;
74
+
75
+ /**
76
+ * Get vendor upload history
77
+ *
78
+ * @remarks
79
+ * Lists files the vendor has uploaded across all their credentials, ordered by upload date descending. Excludes decline-document uploads.
80
+ */
81
+ export function useVendorsGetVendorUploadHistory(
82
+ request: operations.GetVendorUploadHistoryRequest,
83
+ options?: QueryHookOptions<
84
+ VendorsGetVendorUploadHistoryQueryData,
85
+ VendorsGetVendorUploadHistoryQueryError
86
+ >,
87
+ ): UseQueryResult<
88
+ VendorsGetVendorUploadHistoryQueryData,
89
+ VendorsGetVendorUploadHistoryQueryError
90
+ > {
91
+ const client = useGreenSecurityContext();
92
+ return useQuery({
93
+ ...buildVendorsGetVendorUploadHistoryQuery(
94
+ client,
95
+ request,
96
+ options,
97
+ ),
98
+ ...options,
99
+ });
100
+ }
101
+
102
+ /**
103
+ * Get vendor upload history
104
+ *
105
+ * @remarks
106
+ * Lists files the vendor has uploaded across all their credentials, ordered by upload date descending. Excludes decline-document uploads.
107
+ */
108
+ export function useVendorsGetVendorUploadHistorySuspense(
109
+ request: operations.GetVendorUploadHistoryRequest,
110
+ options?: SuspenseQueryHookOptions<
111
+ VendorsGetVendorUploadHistoryQueryData,
112
+ VendorsGetVendorUploadHistoryQueryError
113
+ >,
114
+ ): UseSuspenseQueryResult<
115
+ VendorsGetVendorUploadHistoryQueryData,
116
+ VendorsGetVendorUploadHistoryQueryError
117
+ > {
118
+ const client = useGreenSecurityContext();
119
+ return useSuspenseQuery({
120
+ ...buildVendorsGetVendorUploadHistoryQuery(
121
+ client,
122
+ request,
123
+ options,
124
+ ),
125
+ ...options,
126
+ });
127
+ }
128
+
129
+ /**
130
+ * Get vendor upload history
131
+ *
132
+ * @remarks
133
+ * Lists files the vendor has uploaded across all their credentials, ordered by upload date descending. Excludes decline-document uploads.
134
+ */
135
+ export function useVendorsGetVendorUploadHistoryInfinite(
136
+ request: operations.GetVendorUploadHistoryRequest,
137
+ options?: InfiniteQueryHookOptions<
138
+ VendorsGetVendorUploadHistoryInfiniteQueryData,
139
+ VendorsGetVendorUploadHistoryQueryError
140
+ >,
141
+ ): UseInfiniteQueryResult<
142
+ InfiniteData<
143
+ VendorsGetVendorUploadHistoryInfiniteQueryData,
144
+ VendorsGetVendorUploadHistoryPageParams
145
+ >,
146
+ VendorsGetVendorUploadHistoryQueryError
147
+ > {
148
+ const client = useGreenSecurityContext();
149
+ return useInfiniteQuery<
150
+ VendorsGetVendorUploadHistoryInfiniteQueryData,
151
+ VendorsGetVendorUploadHistoryQueryError,
152
+ InfiniteData<
153
+ VendorsGetVendorUploadHistoryInfiniteQueryData,
154
+ VendorsGetVendorUploadHistoryPageParams
155
+ >,
156
+ QueryKey,
157
+ VendorsGetVendorUploadHistoryPageParams
158
+ >({
159
+ ...buildVendorsGetVendorUploadHistoryInfiniteQuery(
160
+ client,
161
+ request,
162
+ options,
163
+ ),
164
+ initialPageParam: options?.initialPageParam,
165
+ getNextPageParam: (previousPage) => previousPage["~next"],
166
+ ...options,
167
+ });
168
+ }
169
+
170
+ /**
171
+ * Get vendor upload history
172
+ *
173
+ * @remarks
174
+ * Lists files the vendor has uploaded across all their credentials, ordered by upload date descending. Excludes decline-document uploads.
175
+ */
176
+ export function useVendorsGetVendorUploadHistoryInfiniteSuspense(
177
+ request: operations.GetVendorUploadHistoryRequest,
178
+ options?: SuspenseInfiniteQueryHookOptions<
179
+ VendorsGetVendorUploadHistoryInfiniteQueryData,
180
+ VendorsGetVendorUploadHistoryQueryError
181
+ >,
182
+ ): UseSuspenseInfiniteQueryResult<
183
+ InfiniteData<
184
+ VendorsGetVendorUploadHistoryInfiniteQueryData,
185
+ VendorsGetVendorUploadHistoryPageParams
186
+ >,
187
+ VendorsGetVendorUploadHistoryQueryError
188
+ > {
189
+ const client = useGreenSecurityContext();
190
+ return useSuspenseInfiniteQuery<
191
+ VendorsGetVendorUploadHistoryInfiniteQueryData,
192
+ VendorsGetVendorUploadHistoryQueryError,
193
+ InfiniteData<
194
+ VendorsGetVendorUploadHistoryInfiniteQueryData,
195
+ VendorsGetVendorUploadHistoryPageParams
196
+ >,
197
+ QueryKey,
198
+ VendorsGetVendorUploadHistoryPageParams
199
+ >({
200
+ ...buildVendorsGetVendorUploadHistoryInfiniteQuery(
201
+ client,
202
+ request,
203
+ options,
204
+ ),
205
+ initialPageParam: options?.initialPageParam,
206
+ getNextPageParam: (previousPage) => previousPage["~next"],
207
+ ...options,
208
+ });
209
+ }
210
+
211
+ export function setVendorsGetVendorUploadHistoryData(
212
+ client: QueryClient,
213
+ queryKeyBase: [
214
+ vendorIdOrMe: string,
215
+ parameters: {
216
+ sort?: string | null | undefined;
217
+ desc?: components.Desc | undefined;
218
+ page?: number | undefined;
219
+ itemsPerPage?: number | undefined;
220
+ },
221
+ ],
222
+ data: VendorsGetVendorUploadHistoryQueryData,
223
+ ): VendorsGetVendorUploadHistoryQueryData | undefined {
224
+ const key = queryKeyVendorsGetVendorUploadHistory(...queryKeyBase);
225
+
226
+ return client.setQueryData<VendorsGetVendorUploadHistoryQueryData>(key, data);
227
+ }
228
+
229
+ export function invalidateVendorsGetVendorUploadHistory(
230
+ client: QueryClient,
231
+ queryKeyBase: TupleToPrefixes<
232
+ [
233
+ vendorIdOrMe: string,
234
+ parameters: {
235
+ sort?: string | null | undefined;
236
+ desc?: components.Desc | undefined;
237
+ page?: number | undefined;
238
+ itemsPerPage?: number | undefined;
239
+ },
240
+ ]
241
+ >,
242
+ filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
243
+ ): Promise<void> {
244
+ return client.invalidateQueries({
245
+ ...filters,
246
+ queryKey: [
247
+ "@greensecurity/javascript-sdk",
248
+ "vendors",
249
+ "getVendorUploadHistory",
250
+ ...queryKeyBase,
251
+ ],
252
+ });
253
+ }
254
+
255
+ export function invalidateAllVendorsGetVendorUploadHistory(
256
+ client: QueryClient,
257
+ filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
258
+ ): Promise<void> {
259
+ return client.invalidateQueries({
260
+ ...filters,
261
+ queryKey: [
262
+ "@greensecurity/javascript-sdk",
263
+ "vendors",
264
+ "getVendorUploadHistory",
265
+ ],
266
+ });
267
+ }
@@ -28,6 +28,7 @@ import { vendorsGetVendorInvoiceDetails } from "../funcs/vendorsGetVendorInvoice
28
28
  import { vendorsGetVendorInvoiceReceipt } from "../funcs/vendorsGetVendorInvoiceReceipt.js";
29
29
  import { vendorsGetVendorLegalName } from "../funcs/vendorsGetVendorLegalName.js";
30
30
  import { vendorsGetVendorsDetails } from "../funcs/vendorsGetVendorsDetails.js";
31
+ import { vendorsGetVendorUploadHistory } from "../funcs/vendorsGetVendorUploadHistory.js";
31
32
  import { vendorsListVendorAdditionalFacilityFields } from "../funcs/vendorsListVendorAdditionalFacilityFields.js";
32
33
  import { vendorsListVendorCredentialDataRequests } from "../funcs/vendorsListVendorCredentialDataRequests.js";
33
34
  import { vendorsListVendorCredentialFiles } from "../funcs/vendorsListVendorCredentialFiles.js";
@@ -1086,6 +1087,25 @@ export class Vendors extends ClientSDK {
1086
1087
  ));
1087
1088
  }
1088
1089
 
1090
+ /**
1091
+ * Get vendor upload history
1092
+ *
1093
+ * @remarks
1094
+ * Lists files the vendor has uploaded across all their credentials, ordered by upload date descending. Excludes decline-document uploads.
1095
+ */
1096
+ async getVendorUploadHistory(
1097
+ request: operations.GetVendorUploadHistoryRequest,
1098
+ options?: RequestOptions,
1099
+ ): Promise<
1100
+ PageIterator<operations.GetVendorUploadHistoryResponse, { page: number }>
1101
+ > {
1102
+ return unwrapResultIterator(vendorsGetVendorUploadHistory(
1103
+ this,
1104
+ request,
1105
+ options,
1106
+ ));
1107
+ }
1108
+
1089
1109
  /**
1090
1110
  * Get a one-time URL for uploading a credential file for automatic classification (Emerald vendors only)
1091
1111
  *