@greensecurity/javascript-sdk 0.43.1-beta.136 → 0.43.1-beta.138

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 (162) hide show
  1. package/README.md +6 -0
  2. package/dist/commonjs/__tests__/vendors.test.js +60 -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/admin-funcs/notifyVendorCredentialFileUploaded.d.ts +3 -0
  7. package/dist/commonjs/admin-funcs/notifyVendorCredentialFileUploaded.d.ts.map +1 -0
  8. package/dist/commonjs/admin-funcs/notifyVendorCredentialFileUploaded.js +9 -0
  9. package/dist/commonjs/admin-funcs/notifyVendorCredentialFileUploaded.js.map +1 -0
  10. package/dist/commonjs/funcs/vendorsAddVendorCredentialFileForAutoClassification.d.ts +26 -0
  11. package/dist/commonjs/funcs/vendorsAddVendorCredentialFileForAutoClassification.d.ts.map +1 -0
  12. package/dist/commonjs/funcs/vendorsAddVendorCredentialFileForAutoClassification.js +135 -0
  13. package/dist/commonjs/funcs/vendorsAddVendorCredentialFileForAutoClassification.js.map +1 -0
  14. package/dist/commonjs/funcs/vendorsGetVendorUploadHistory.d.ts +23 -0
  15. package/dist/commonjs/funcs/vendorsGetVendorUploadHistory.d.ts.map +1 -0
  16. package/dist/commonjs/funcs/vendorsGetVendorUploadHistory.js +166 -0
  17. package/dist/commonjs/funcs/vendorsGetVendorUploadHistory.js.map +1 -0
  18. package/dist/commonjs/index.extras.d.ts +4 -0
  19. package/dist/commonjs/index.extras.d.ts.map +1 -1
  20. package/dist/commonjs/index.extras.js +4 -0
  21. package/dist/commonjs/index.extras.js.map +1 -1
  22. package/dist/commonjs/lib/config.d.ts +2 -2
  23. package/dist/commonjs/lib/config.js +2 -2
  24. package/dist/commonjs/models/components/index.d.ts +3 -0
  25. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  26. package/dist/commonjs/models/components/index.js +3 -0
  27. package/dist/commonjs/models/components/index.js.map +1 -1
  28. package/dist/commonjs/models/components/uploadhistoryitem.d.ts +14 -0
  29. package/dist/commonjs/models/components/uploadhistoryitem.d.ts.map +1 -0
  30. package/dist/commonjs/models/components/uploadhistoryitem.js +63 -0
  31. package/dist/commonjs/models/components/uploadhistoryitem.js.map +1 -0
  32. package/dist/commonjs/models/components/vendorcredentialfileforautoclassificationok.d.ts +22 -0
  33. package/dist/commonjs/models/components/vendorcredentialfileforautoclassificationok.d.ts.map +1 -0
  34. package/dist/commonjs/models/components/vendorcredentialfileforautoclassificationok.js +62 -0
  35. package/dist/commonjs/models/components/vendorcredentialfileforautoclassificationok.js.map +1 -0
  36. package/dist/commonjs/models/components/vendorcredentialfileforautoclassificationrequest.d.ts +20 -0
  37. package/dist/commonjs/models/components/vendorcredentialfileforautoclassificationrequest.d.ts.map +1 -0
  38. package/dist/commonjs/models/components/vendorcredentialfileforautoclassificationrequest.js +56 -0
  39. package/dist/commonjs/models/components/vendorcredentialfileforautoclassificationrequest.js.map +1 -0
  40. package/dist/commonjs/models/operations/addvendorcredentialfileforautoclassification.d.ts +24 -0
  41. package/dist/commonjs/models/operations/addvendorcredentialfileforautoclassification.d.ts.map +1 -0
  42. package/dist/commonjs/models/operations/addvendorcredentialfileforautoclassification.js +59 -0
  43. package/dist/commonjs/models/operations/addvendorcredentialfileforautoclassification.js.map +1 -0
  44. package/dist/commonjs/models/operations/getvendoruploadhistory.d.ts +63 -0
  45. package/dist/commonjs/models/operations/getvendoruploadhistory.d.ts.map +1 -0
  46. package/dist/commonjs/models/operations/getvendoruploadhistory.js +83 -0
  47. package/dist/commonjs/models/operations/getvendoruploadhistory.js.map +1 -0
  48. package/dist/commonjs/models/operations/index.d.ts +2 -0
  49. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  50. package/dist/commonjs/models/operations/index.js +2 -0
  51. package/dist/commonjs/models/operations/index.js.map +1 -1
  52. package/dist/commonjs/react-query/index.d.ts +2 -0
  53. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  54. package/dist/commonjs/react-query/index.js +2 -0
  55. package/dist/commonjs/react-query/index.js.map +1 -1
  56. package/dist/commonjs/react-query/vendorsAddVendorCredentialFileForAutoClassification.d.ts +35 -0
  57. package/dist/commonjs/react-query/vendorsAddVendorCredentialFileForAutoClassification.d.ts.map +1 -0
  58. package/dist/commonjs/react-query/vendorsAddVendorCredentialFileForAutoClassification.js +57 -0
  59. package/dist/commonjs/react-query/vendorsAddVendorCredentialFileForAutoClassification.js.map +1 -0
  60. package/dist/commonjs/react-query/vendorsGetVendorUploadHistory.core.d.ts +36 -0
  61. package/dist/commonjs/react-query/vendorsGetVendorUploadHistory.core.d.ts.map +1 -0
  62. package/dist/commonjs/react-query/vendorsGetVendorUploadHistory.core.js +94 -0
  63. package/dist/commonjs/react-query/vendorsGetVendorUploadHistory.core.js.map +1 -0
  64. package/dist/commonjs/react-query/vendorsGetVendorUploadHistory.d.ts +60 -0
  65. package/dist/commonjs/react-query/vendorsGetVendorUploadHistory.d.ts.map +1 -0
  66. package/dist/commonjs/react-query/vendorsGetVendorUploadHistory.js +105 -0
  67. package/dist/commonjs/react-query/vendorsGetVendorUploadHistory.js.map +1 -0
  68. package/dist/commonjs/sdk/vendors.d.ts +21 -0
  69. package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
  70. package/dist/commonjs/sdk/vendors.js +25 -0
  71. package/dist/commonjs/sdk/vendors.js.map +1 -1
  72. package/dist/esm/__tests__/vendors.test.js +60 -0
  73. package/dist/esm/__tests__/vendors.test.js.map +1 -1
  74. package/dist/esm/__tests__/webhooks.test.js +1 -1
  75. package/dist/esm/__tests__/webhooks.test.js.map +1 -1
  76. package/dist/esm/admin-funcs/notifyVendorCredentialFileUploaded.d.ts +3 -0
  77. package/dist/esm/admin-funcs/notifyVendorCredentialFileUploaded.d.ts.map +1 -0
  78. package/dist/esm/admin-funcs/notifyVendorCredentialFileUploaded.js +6 -0
  79. package/dist/esm/admin-funcs/notifyVendorCredentialFileUploaded.js.map +1 -0
  80. package/dist/esm/funcs/vendorsAddVendorCredentialFileForAutoClassification.d.ts +26 -0
  81. package/dist/esm/funcs/vendorsAddVendorCredentialFileForAutoClassification.d.ts.map +1 -0
  82. package/dist/esm/funcs/vendorsAddVendorCredentialFileForAutoClassification.js +99 -0
  83. package/dist/esm/funcs/vendorsAddVendorCredentialFileForAutoClassification.js.map +1 -0
  84. package/dist/esm/funcs/vendorsGetVendorUploadHistory.d.ts +23 -0
  85. package/dist/esm/funcs/vendorsGetVendorUploadHistory.d.ts.map +1 -0
  86. package/dist/esm/funcs/vendorsGetVendorUploadHistory.js +130 -0
  87. package/dist/esm/funcs/vendorsGetVendorUploadHistory.js.map +1 -0
  88. package/dist/esm/index.extras.d.ts +4 -0
  89. package/dist/esm/index.extras.d.ts.map +1 -1
  90. package/dist/esm/index.extras.js +4 -0
  91. package/dist/esm/index.extras.js.map +1 -1
  92. package/dist/esm/lib/config.d.ts +2 -2
  93. package/dist/esm/lib/config.js +2 -2
  94. package/dist/esm/models/components/index.d.ts +3 -0
  95. package/dist/esm/models/components/index.d.ts.map +1 -1
  96. package/dist/esm/models/components/index.js +3 -0
  97. package/dist/esm/models/components/index.js.map +1 -1
  98. package/dist/esm/models/components/uploadhistoryitem.d.ts +14 -0
  99. package/dist/esm/models/components/uploadhistoryitem.d.ts.map +1 -0
  100. package/dist/esm/models/components/uploadhistoryitem.js +26 -0
  101. package/dist/esm/models/components/uploadhistoryitem.js.map +1 -0
  102. package/dist/esm/models/components/vendorcredentialfileforautoclassificationok.d.ts +22 -0
  103. package/dist/esm/models/components/vendorcredentialfileforautoclassificationok.d.ts.map +1 -0
  104. package/dist/esm/models/components/vendorcredentialfileforautoclassificationok.js +25 -0
  105. package/dist/esm/models/components/vendorcredentialfileforautoclassificationok.js.map +1 -0
  106. package/dist/esm/models/components/vendorcredentialfileforautoclassificationrequest.d.ts +20 -0
  107. package/dist/esm/models/components/vendorcredentialfileforautoclassificationrequest.d.ts.map +1 -0
  108. package/dist/esm/models/components/vendorcredentialfileforautoclassificationrequest.js +19 -0
  109. package/dist/esm/models/components/vendorcredentialfileforautoclassificationrequest.js.map +1 -0
  110. package/dist/esm/models/operations/addvendorcredentialfileforautoclassification.d.ts +24 -0
  111. package/dist/esm/models/operations/addvendorcredentialfileforautoclassification.d.ts.map +1 -0
  112. package/dist/esm/models/operations/addvendorcredentialfileforautoclassification.js +22 -0
  113. package/dist/esm/models/operations/addvendorcredentialfileforautoclassification.js.map +1 -0
  114. package/dist/esm/models/operations/getvendoruploadhistory.d.ts +63 -0
  115. package/dist/esm/models/operations/getvendoruploadhistory.d.ts.map +1 -0
  116. package/dist/esm/models/operations/getvendoruploadhistory.js +44 -0
  117. package/dist/esm/models/operations/getvendoruploadhistory.js.map +1 -0
  118. package/dist/esm/models/operations/index.d.ts +2 -0
  119. package/dist/esm/models/operations/index.d.ts.map +1 -1
  120. package/dist/esm/models/operations/index.js +2 -0
  121. package/dist/esm/models/operations/index.js.map +1 -1
  122. package/dist/esm/react-query/index.d.ts +2 -0
  123. package/dist/esm/react-query/index.d.ts.map +1 -1
  124. package/dist/esm/react-query/index.js +2 -0
  125. package/dist/esm/react-query/index.js.map +1 -1
  126. package/dist/esm/react-query/vendorsAddVendorCredentialFileForAutoClassification.d.ts +35 -0
  127. package/dist/esm/react-query/vendorsAddVendorCredentialFileForAutoClassification.d.ts.map +1 -0
  128. package/dist/esm/react-query/vendorsAddVendorCredentialFileForAutoClassification.js +52 -0
  129. package/dist/esm/react-query/vendorsAddVendorCredentialFileForAutoClassification.js.map +1 -0
  130. package/dist/esm/react-query/vendorsGetVendorUploadHistory.core.d.ts +36 -0
  131. package/dist/esm/react-query/vendorsGetVendorUploadHistory.core.d.ts.map +1 -0
  132. package/dist/esm/react-query/vendorsGetVendorUploadHistory.core.js +86 -0
  133. package/dist/esm/react-query/vendorsGetVendorUploadHistory.core.js.map +1 -0
  134. package/dist/esm/react-query/vendorsGetVendorUploadHistory.d.ts +60 -0
  135. package/dist/esm/react-query/vendorsGetVendorUploadHistory.d.ts.map +1 -0
  136. package/dist/esm/react-query/vendorsGetVendorUploadHistory.js +90 -0
  137. package/dist/esm/react-query/vendorsGetVendorUploadHistory.js.map +1 -0
  138. package/dist/esm/sdk/vendors.d.ts +21 -0
  139. package/dist/esm/sdk/vendors.d.ts.map +1 -1
  140. package/dist/esm/sdk/vendors.js +25 -0
  141. package/dist/esm/sdk/vendors.js.map +1 -1
  142. package/jsr.json +1 -1
  143. package/package.json +1 -1
  144. package/src/__tests__/vendors.test.ts +68 -0
  145. package/src/__tests__/webhooks.test.ts +1 -1
  146. package/src/admin-funcs/notifyVendorCredentialFileUploaded.ts +11 -0
  147. package/src/funcs/vendorsAddVendorCredentialFileForAutoClassification.ts +197 -0
  148. package/src/funcs/vendorsGetVendorUploadHistory.ts +260 -0
  149. package/src/index.extras.ts +6 -0
  150. package/src/lib/config.ts +2 -2
  151. package/src/models/components/index.ts +3 -0
  152. package/src/models/components/uploadhistoryitem.ts +48 -0
  153. package/src/models/components/vendorcredentialfileforautoclassificationok.ts +62 -0
  154. package/src/models/components/vendorcredentialfileforautoclassificationrequest.ts +50 -0
  155. package/src/models/operations/addvendorcredentialfileforautoclassification.ts +60 -0
  156. package/src/models/operations/getvendoruploadhistory.ts +144 -0
  157. package/src/models/operations/index.ts +2 -0
  158. package/src/react-query/index.ts +2 -0
  159. package/src/react-query/vendorsAddVendorCredentialFileForAutoClassification.ts +131 -0
  160. package/src/react-query/vendorsGetVendorUploadHistory.core.ts +199 -0
  161. package/src/react-query/vendorsGetVendorUploadHistory.ts +267 -0
  162. package/src/sdk/vendors.ts +43 -0
@@ -67,6 +67,7 @@ export * from "./vendorFieldsCreateVendorField.js";
67
67
  export * from "./vendorFieldsUpdateVendorField.js";
68
68
  export * from "./vendorsAcceptVendorCredential.js";
69
69
  export * from "./vendorsAddVendorCredentialFile.js";
70
+ export * from "./vendorsAddVendorCredentialFileForAutoClassification.js";
70
71
  export * from "./vendorsAddVendorManagedByCompany.js";
71
72
  export * from "./vendorsCalculateSubscriptionPrice.js";
72
73
  export * from "./vendorsCancelHandoff.js";
@@ -94,6 +95,7 @@ export * from "./vendorsGetVendorInvoiceDetails.js";
94
95
  export * from "./vendorsGetVendorInvoiceReceipt.js";
95
96
  export * from "./vendorsGetVendorLegalName.js";
96
97
  export * from "./vendorsGetVendorsDetails.js";
98
+ export * from "./vendorsGetVendorUploadHistory.js";
97
99
  export * from "./vendorsListVendorAdditionalFacilityFields.js";
98
100
  export * from "./vendorsListVendorCredentialDataRequests.js";
99
101
  export * from "./vendorsListVendorCredentialFiles.js";
@@ -0,0 +1,131 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: d4372147bc16
4
+ */
5
+
6
+ import {
7
+ MutationKey,
8
+ useMutation,
9
+ UseMutationResult,
10
+ } from "@tanstack/react-query";
11
+ import { GreenSecurityCore } from "../core.js";
12
+ import { vendorsAddVendorCredentialFileForAutoClassification } from "../funcs/vendorsAddVendorCredentialFileForAutoClassification.js";
13
+ import { combineSignals } from "../lib/primitives.js";
14
+ import { RequestOptions } from "../lib/sdks.js";
15
+ import * as components from "../models/components/index.js";
16
+ import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
17
+ import {
18
+ ConnectionError,
19
+ InvalidRequestError,
20
+ RequestAbortedError,
21
+ RequestTimeoutError,
22
+ UnexpectedClientError,
23
+ } from "../models/errors/httpclienterrors.js";
24
+ import * as errors from "../models/errors/index.js";
25
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
26
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
27
+ import * as operations from "../models/operations/index.js";
28
+ import { unwrapAsync } from "../types/fp.js";
29
+ import { useGreenSecurityContext } from "./_context.js";
30
+ import { MutationHookOptions } from "./_types.js";
31
+
32
+ export type VendorsAddVendorCredentialFileForAutoClassificationMutationVariables =
33
+ {
34
+ request: operations.AddVendorCredentialFileForAutoClassificationRequest;
35
+ options?: RequestOptions;
36
+ };
37
+
38
+ export type VendorsAddVendorCredentialFileForAutoClassificationMutationData =
39
+ components.VendorCredentialFileForAutoClassificationOk;
40
+
41
+ export type VendorsAddVendorCredentialFileForAutoClassificationMutationError =
42
+ | errors.ApiErrorResponse
43
+ | GreenSecurityError
44
+ | ResponseValidationError
45
+ | ConnectionError
46
+ | RequestAbortedError
47
+ | RequestTimeoutError
48
+ | InvalidRequestError
49
+ | UnexpectedClientError
50
+ | SDKValidationError;
51
+
52
+ /**
53
+ * Get a one-time URL for uploading a credential file for automatic classification (Emerald vendors only)
54
+ *
55
+ * @remarks
56
+ * This endpoint allows vendors on the Emerald plan to upload a series of
57
+ * documents and have them automatically ingested and routed to the proper
58
+ * credential. The endpoint will return a one-time-use URL where the file
59
+ * must be uploaded. Green Security will process the file asynchronously.
60
+ *
61
+ * Non-Emerald vendors must use `addVendorCredentialFile` instead.
62
+ */
63
+ export function useVendorsAddVendorCredentialFileForAutoClassificationMutation(
64
+ options?: MutationHookOptions<
65
+ VendorsAddVendorCredentialFileForAutoClassificationMutationData,
66
+ VendorsAddVendorCredentialFileForAutoClassificationMutationError,
67
+ VendorsAddVendorCredentialFileForAutoClassificationMutationVariables
68
+ >,
69
+ ): UseMutationResult<
70
+ VendorsAddVendorCredentialFileForAutoClassificationMutationData,
71
+ VendorsAddVendorCredentialFileForAutoClassificationMutationError,
72
+ VendorsAddVendorCredentialFileForAutoClassificationMutationVariables
73
+ > {
74
+ const client = useGreenSecurityContext();
75
+ return useMutation({
76
+ ...buildVendorsAddVendorCredentialFileForAutoClassificationMutation(
77
+ client,
78
+ options,
79
+ ),
80
+ ...options,
81
+ });
82
+ }
83
+
84
+ export function mutationKeyVendorsAddVendorCredentialFileForAutoClassification(): MutationKey {
85
+ return [
86
+ "@greensecurity/javascript-sdk",
87
+ "vendors",
88
+ "addVendorCredentialFileForAutoClassification",
89
+ ];
90
+ }
91
+
92
+ export function buildVendorsAddVendorCredentialFileForAutoClassificationMutation(
93
+ client$: GreenSecurityCore,
94
+ hookOptions?: RequestOptions,
95
+ ): {
96
+ mutationKey: MutationKey;
97
+ mutationFn: (
98
+ variables:
99
+ VendorsAddVendorCredentialFileForAutoClassificationMutationVariables,
100
+ ) => Promise<VendorsAddVendorCredentialFileForAutoClassificationMutationData>;
101
+ } {
102
+ return {
103
+ mutationKey:
104
+ mutationKeyVendorsAddVendorCredentialFileForAutoClassification(),
105
+ mutationFn:
106
+ function vendorsAddVendorCredentialFileForAutoClassificationMutationFn({
107
+ request,
108
+ options,
109
+ }): Promise<
110
+ VendorsAddVendorCredentialFileForAutoClassificationMutationData
111
+ > {
112
+ const mergedOptions = {
113
+ ...hookOptions,
114
+ ...options,
115
+ fetchOptions: {
116
+ ...hookOptions?.fetchOptions,
117
+ ...options?.fetchOptions,
118
+ signal: combineSignals(
119
+ hookOptions?.fetchOptions?.signal,
120
+ options?.fetchOptions?.signal,
121
+ ),
122
+ },
123
+ };
124
+ return unwrapAsync(vendorsAddVendorCredentialFileForAutoClassification(
125
+ client$,
126
+ request,
127
+ mergedOptions,
128
+ ));
129
+ },
130
+ };
131
+ }
@@ -0,0 +1,199 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: e3ca8c943345
4
+ */
5
+
6
+ import {
7
+ QueryClient,
8
+ QueryFunctionContext,
9
+ QueryKey,
10
+ } from "@tanstack/react-query";
11
+ import { GreenSecurityCore } from "../core.js";
12
+ import { vendorsGetVendorUploadHistory } from "../funcs/vendorsGetVendorUploadHistory.js";
13
+ import { combineSignals } from "../lib/primitives.js";
14
+ import { RequestOptions } from "../lib/sdks.js";
15
+ import * as components from "../models/components/index.js";
16
+ import * as operations from "../models/operations/index.js";
17
+ import { unwrapAsync } from "../types/fp.js";
18
+ import { PageIterator, unwrapResultIterator } from "../types/operations.js";
19
+ import { pageIteratorToJSON } from "./_types.js";
20
+ export type VendorsGetVendorUploadHistoryQueryData =
21
+ operations.GetVendorUploadHistoryResponse;
22
+
23
+ export type VendorsGetVendorUploadHistoryInfiniteQueryData = PageIterator<
24
+ operations.GetVendorUploadHistoryResponse,
25
+ { page: number }
26
+ >;
27
+
28
+ export type VendorsGetVendorUploadHistoryPageParams = PageIterator<
29
+ operations.GetVendorUploadHistoryResponse,
30
+ { page: number }
31
+ >["~next"];
32
+
33
+ export function prefetchVendorsGetVendorUploadHistory(
34
+ queryClient: QueryClient,
35
+ client$: GreenSecurityCore,
36
+ request: operations.GetVendorUploadHistoryRequest,
37
+ options?: RequestOptions,
38
+ ): Promise<void> {
39
+ return queryClient.prefetchQuery({
40
+ ...buildVendorsGetVendorUploadHistoryQuery(
41
+ client$,
42
+ request,
43
+ options,
44
+ ),
45
+ });
46
+ }
47
+
48
+ export function prefetchVendorsGetVendorUploadHistoryInfinite(
49
+ queryClient: QueryClient,
50
+ client$: GreenSecurityCore,
51
+ request: operations.GetVendorUploadHistoryRequest,
52
+ options?: RequestOptions,
53
+ ): Promise<void> {
54
+ return queryClient.prefetchInfiniteQuery({
55
+ ...buildVendorsGetVendorUploadHistoryInfiniteQuery(
56
+ client$,
57
+ request,
58
+ options,
59
+ ),
60
+ initialPageParam: undefined as VendorsGetVendorUploadHistoryPageParams,
61
+ getNextPageParam: (
62
+ previousPage: VendorsGetVendorUploadHistoryInfiniteQueryData,
63
+ ) => previousPage["~next"],
64
+ });
65
+ }
66
+
67
+ export function buildVendorsGetVendorUploadHistoryQuery(
68
+ client$: GreenSecurityCore,
69
+ request: operations.GetVendorUploadHistoryRequest,
70
+ options?: RequestOptions,
71
+ ): {
72
+ queryKey: QueryKey;
73
+ queryFn: (
74
+ context: QueryFunctionContext,
75
+ ) => Promise<VendorsGetVendorUploadHistoryQueryData>;
76
+ } {
77
+ return {
78
+ queryKey: queryKeyVendorsGetVendorUploadHistory(request.vendorIdOrMe, {
79
+ sort: request.sort,
80
+ desc: request.desc,
81
+ page: request.page,
82
+ itemsPerPage: request.itemsPerPage,
83
+ }),
84
+ queryFn: async function vendorsGetVendorUploadHistoryQueryFn(
85
+ ctx,
86
+ ): Promise<VendorsGetVendorUploadHistoryQueryData> {
87
+ const sig = combineSignals(
88
+ ctx.signal,
89
+ options?.signal,
90
+ options?.fetchOptions?.signal,
91
+ );
92
+ const mergedOptions = {
93
+ ...options?.fetchOptions,
94
+ ...options,
95
+ signal: sig,
96
+ };
97
+
98
+ return unwrapAsync(vendorsGetVendorUploadHistory(
99
+ client$,
100
+ request,
101
+ mergedOptions,
102
+ ));
103
+ },
104
+ };
105
+ }
106
+
107
+ export function buildVendorsGetVendorUploadHistoryInfiniteQuery(
108
+ client$: GreenSecurityCore,
109
+ request: operations.GetVendorUploadHistoryRequest,
110
+ options?: RequestOptions,
111
+ ): {
112
+ queryKey: QueryKey;
113
+ queryFn: (
114
+ context: QueryFunctionContext<
115
+ QueryKey,
116
+ VendorsGetVendorUploadHistoryPageParams
117
+ >,
118
+ ) => Promise<VendorsGetVendorUploadHistoryInfiniteQueryData>;
119
+ } {
120
+ return {
121
+ queryKey: queryKeyVendorsGetVendorUploadHistoryInfinite(
122
+ request.vendorIdOrMe,
123
+ {
124
+ sort: request.sort,
125
+ desc: request.desc,
126
+ page: request.page,
127
+ itemsPerPage: request.itemsPerPage,
128
+ },
129
+ ),
130
+ queryFn: async function vendorsGetVendorUploadHistoryQuery(
131
+ ctx,
132
+ ): Promise<VendorsGetVendorUploadHistoryInfiniteQueryData> {
133
+ const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
134
+ const mergedOptions = {
135
+ ...options,
136
+ fetchOptions: { ...options?.fetchOptions, signal: sig },
137
+ };
138
+
139
+ if (!ctx.pageParam) {
140
+ const pageResult = await unwrapResultIterator(
141
+ vendorsGetVendorUploadHistory(
142
+ client$,
143
+ request,
144
+ mergedOptions,
145
+ ),
146
+ );
147
+ return pageIteratorToJSON(pageResult);
148
+ }
149
+ const pageResult = await unwrapResultIterator(
150
+ vendorsGetVendorUploadHistory(
151
+ client$,
152
+ {
153
+ ...request,
154
+ page: ctx.pageParam.page,
155
+ },
156
+ mergedOptions,
157
+ ),
158
+ );
159
+ return pageIteratorToJSON(pageResult);
160
+ },
161
+ };
162
+ }
163
+
164
+ export function queryKeyVendorsGetVendorUploadHistory(
165
+ vendorIdOrMe: string,
166
+ parameters: {
167
+ sort?: string | null | undefined;
168
+ desc?: components.Desc | undefined;
169
+ page?: number | undefined;
170
+ itemsPerPage?: number | undefined;
171
+ },
172
+ ): QueryKey {
173
+ return [
174
+ "@greensecurity/javascript-sdk",
175
+ "vendors",
176
+ "getVendorUploadHistory",
177
+ vendorIdOrMe,
178
+ parameters,
179
+ ];
180
+ }
181
+
182
+ export function queryKeyVendorsGetVendorUploadHistoryInfinite(
183
+ vendorIdOrMe: string,
184
+ parameters: {
185
+ sort?: string | null | undefined;
186
+ desc?: components.Desc | undefined;
187
+ page?: number | undefined;
188
+ itemsPerPage?: number | undefined;
189
+ },
190
+ ): QueryKey {
191
+ return [
192
+ "@greensecurity/javascript-sdk",
193
+ "vendors",
194
+ "getVendorUploadHistory",
195
+ "infinite",
196
+ vendorIdOrMe,
197
+ parameters,
198
+ ];
199
+ }
@@ -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
+ }
@@ -5,6 +5,7 @@
5
5
 
6
6
  import { vendorsAcceptVendorCredential } from "../funcs/vendorsAcceptVendorCredential.js";
7
7
  import { vendorsAddVendorCredentialFile } from "../funcs/vendorsAddVendorCredentialFile.js";
8
+ import { vendorsAddVendorCredentialFileForAutoClassification } from "../funcs/vendorsAddVendorCredentialFileForAutoClassification.js";
8
9
  import { vendorsAddVendorManagedByCompany } from "../funcs/vendorsAddVendorManagedByCompany.js";
9
10
  import { vendorsCalculateSubscriptionPrice } from "../funcs/vendorsCalculateSubscriptionPrice.js";
10
11
  import { vendorsCancelHandoff } from "../funcs/vendorsCancelHandoff.js";
@@ -27,6 +28,7 @@ import { vendorsGetVendorInvoiceDetails } from "../funcs/vendorsGetVendorInvoice
27
28
  import { vendorsGetVendorInvoiceReceipt } from "../funcs/vendorsGetVendorInvoiceReceipt.js";
28
29
  import { vendorsGetVendorLegalName } from "../funcs/vendorsGetVendorLegalName.js";
29
30
  import { vendorsGetVendorsDetails } from "../funcs/vendorsGetVendorsDetails.js";
31
+ import { vendorsGetVendorUploadHistory } from "../funcs/vendorsGetVendorUploadHistory.js";
30
32
  import { vendorsListVendorAdditionalFacilityFields } from "../funcs/vendorsListVendorAdditionalFacilityFields.js";
31
33
  import { vendorsListVendorCredentialDataRequests } from "../funcs/vendorsListVendorCredentialDataRequests.js";
32
34
  import { vendorsListVendorCredentialFiles } from "../funcs/vendorsListVendorCredentialFiles.js";
@@ -1084,4 +1086,45 @@ export class Vendors extends ClientSDK {
1084
1086
  options,
1085
1087
  ));
1086
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
+
1109
+ /**
1110
+ * Get a one-time URL for uploading a credential file for automatic classification (Emerald vendors only)
1111
+ *
1112
+ * @remarks
1113
+ * This endpoint allows vendors on the Emerald plan to upload a series of
1114
+ * documents and have them automatically ingested and routed to the proper
1115
+ * credential. The endpoint will return a one-time-use URL where the file
1116
+ * must be uploaded. Green Security will process the file asynchronously.
1117
+ *
1118
+ * Non-Emerald vendors must use `addVendorCredentialFile` instead.
1119
+ */
1120
+ async addVendorCredentialFileForAutoClassification(
1121
+ request: operations.AddVendorCredentialFileForAutoClassificationRequest,
1122
+ options?: RequestOptions,
1123
+ ): Promise<components.VendorCredentialFileForAutoClassificationOk> {
1124
+ return unwrapAsync(vendorsAddVendorCredentialFileForAutoClassification(
1125
+ this,
1126
+ request,
1127
+ options,
1128
+ ));
1129
+ }
1087
1130
  }