@greensecurity/javascript-sdk 0.30.23 → 0.30.27
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.
- package/README.md +6 -0
- package/bin/mcp-server.js +3103 -2872
- package/bin/mcp-server.js.map +25 -22
- package/dist/commonjs/__tests__/companies.test.d.ts +2 -0
- package/dist/commonjs/__tests__/companies.test.d.ts.map +1 -0
- package/dist/commonjs/__tests__/companies.test.js +51 -0
- package/dist/commonjs/__tests__/companies.test.js.map +1 -0
- package/dist/commonjs/__tests__/vendors.test.js +2 -2
- package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js +1 -1
- package/dist/commonjs/funcs/companiesListOrSearchCompanies.d.ts +20 -0
- package/dist/commonjs/funcs/companiesListOrSearchCompanies.d.ts.map +1 -0
- package/dist/commonjs/funcs/companiesListOrSearchCompanies.js +155 -0
- package/dist/commonjs/funcs/companiesListOrSearchCompanies.js.map +1 -0
- package/dist/commonjs/funcs/vendorsListVendorFacilityStatuses.js +1 -0
- package/dist/commonjs/funcs/vendorsListVendorFacilityStatuses.js.map +1 -1
- package/dist/commonjs/funcs/vendorsListVendorInvoices.js +1 -1
- package/dist/commonjs/funcs/vendorsListVendorInvoices.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/matchers.d.ts +3 -1
- package/dist/commonjs/lib/matchers.d.ts.map +1 -1
- package/dist/commonjs/lib/matchers.js +12 -0
- package/dist/commonjs/lib/matchers.js.map +1 -1
- package/dist/commonjs/lib/sdks.js +7 -2
- package/dist/commonjs/lib/sdks.js.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +3 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/companiesListOrSearchCompanies.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/companiesListOrSearchCompanies.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/companiesListOrSearchCompanies.js +64 -0
- package/dist/commonjs/mcp-server/tools/companiesListOrSearchCompanies.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/listorsearchcompanies.d.ts +111 -0
- package/dist/commonjs/models/operations/listorsearchcompanies.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listorsearchcompanies.js +153 -0
- package/dist/commonjs/models/operations/listorsearchcompanies.js.map +1 -0
- package/dist/commonjs/models/operations/listvendorfacilitystatuses.d.ts +5 -0
- package/dist/commonjs/models/operations/listvendorfacilitystatuses.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listvendorfacilitystatuses.js +4 -0
- package/dist/commonjs/models/operations/listvendorfacilitystatuses.js.map +1 -1
- package/dist/commonjs/models/operations/listvendorinvoices.d.ts +57 -27
- package/dist/commonjs/models/operations/listvendorinvoices.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listvendorinvoices.js +31 -21
- package/dist/commonjs/models/operations/listvendorinvoices.js.map +1 -1
- package/dist/commonjs/react-query/companiesListOrSearchCompanies.d.ts +78 -0
- package/dist/commonjs/react-query/companiesListOrSearchCompanies.d.ts.map +1 -0
- package/dist/commonjs/react-query/companiesListOrSearchCompanies.js +161 -0
- package/dist/commonjs/react-query/companiesListOrSearchCompanies.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +1 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +1 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/vendorsListVendorFacilityStatuses.d.ts +3 -0
- package/dist/commonjs/react-query/vendorsListVendorFacilityStatuses.d.ts.map +1 -1
- package/dist/commonjs/react-query/vendorsListVendorFacilityStatuses.js +2 -0
- package/dist/commonjs/react-query/vendorsListVendorFacilityStatuses.js.map +1 -1
- package/dist/commonjs/react-query/vendorsListVendorInvoices.d.ts +3 -3
- package/dist/commonjs/react-query/vendorsListVendorInvoices.d.ts.map +1 -1
- package/dist/commonjs/react-query/vendorsListVendorInvoices.js +2 -2
- package/dist/commonjs/react-query/vendorsListVendorInvoices.js.map +1 -1
- package/dist/commonjs/sdk/companies.d.ts +15 -0
- package/dist/commonjs/sdk/companies.d.ts.map +1 -0
- package/dist/commonjs/sdk/companies.js +22 -0
- package/dist/commonjs/sdk/companies.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +4 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/__tests__/companies.test.d.ts +2 -0
- package/dist/esm/__tests__/companies.test.d.ts.map +1 -0
- package/dist/esm/__tests__/companies.test.js +49 -0
- package/dist/esm/__tests__/companies.test.js.map +1 -0
- package/dist/esm/__tests__/vendors.test.js +2 -2
- package/dist/esm/__tests__/vendors.test.js.map +1 -1
- package/dist/esm/__tests__/webhooks.test.js +1 -1
- package/dist/esm/funcs/companiesListOrSearchCompanies.d.ts +20 -0
- package/dist/esm/funcs/companiesListOrSearchCompanies.d.ts.map +1 -0
- package/dist/esm/funcs/companiesListOrSearchCompanies.js +119 -0
- package/dist/esm/funcs/companiesListOrSearchCompanies.js.map +1 -0
- package/dist/esm/funcs/vendorsListVendorFacilityStatuses.js +1 -0
- package/dist/esm/funcs/vendorsListVendorFacilityStatuses.js.map +1 -1
- package/dist/esm/funcs/vendorsListVendorInvoices.js +1 -1
- package/dist/esm/funcs/vendorsListVendorInvoices.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/matchers.d.ts +3 -1
- package/dist/esm/lib/matchers.d.ts.map +1 -1
- package/dist/esm/lib/matchers.js +10 -0
- package/dist/esm/lib/matchers.js.map +1 -1
- package/dist/esm/lib/sdks.js +7 -2
- package/dist/esm/lib/sdks.js.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +3 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/companiesListOrSearchCompanies.d.ts +8 -0
- package/dist/esm/mcp-server/tools/companiesListOrSearchCompanies.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/companiesListOrSearchCompanies.js +28 -0
- package/dist/esm/mcp-server/tools/companiesListOrSearchCompanies.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/listorsearchcompanies.d.ts +111 -0
- package/dist/esm/models/operations/listorsearchcompanies.d.ts.map +1 -0
- package/dist/esm/models/operations/listorsearchcompanies.js +111 -0
- package/dist/esm/models/operations/listorsearchcompanies.js.map +1 -0
- package/dist/esm/models/operations/listvendorfacilitystatuses.d.ts +5 -0
- package/dist/esm/models/operations/listvendorfacilitystatuses.d.ts.map +1 -1
- package/dist/esm/models/operations/listvendorfacilitystatuses.js +4 -0
- package/dist/esm/models/operations/listvendorfacilitystatuses.js.map +1 -1
- package/dist/esm/models/operations/listvendorinvoices.d.ts +57 -27
- package/dist/esm/models/operations/listvendorinvoices.d.ts.map +1 -1
- package/dist/esm/models/operations/listvendorinvoices.js +30 -20
- package/dist/esm/models/operations/listvendorinvoices.js.map +1 -1
- package/dist/esm/react-query/companiesListOrSearchCompanies.d.ts +78 -0
- package/dist/esm/react-query/companiesListOrSearchCompanies.d.ts.map +1 -0
- package/dist/esm/react-query/companiesListOrSearchCompanies.js +148 -0
- package/dist/esm/react-query/companiesListOrSearchCompanies.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +1 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +1 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/vendorsListVendorFacilityStatuses.d.ts +3 -0
- package/dist/esm/react-query/vendorsListVendorFacilityStatuses.d.ts.map +1 -1
- package/dist/esm/react-query/vendorsListVendorFacilityStatuses.js +2 -0
- package/dist/esm/react-query/vendorsListVendorFacilityStatuses.js.map +1 -1
- package/dist/esm/react-query/vendorsListVendorInvoices.d.ts +3 -3
- package/dist/esm/react-query/vendorsListVendorInvoices.d.ts.map +1 -1
- package/dist/esm/react-query/vendorsListVendorInvoices.js +2 -2
- package/dist/esm/react-query/vendorsListVendorInvoices.js.map +1 -1
- package/dist/esm/sdk/companies.d.ts +15 -0
- package/dist/esm/sdk/companies.d.ts.map +1 -0
- package/dist/esm/sdk/companies.js +18 -0
- package/dist/esm/sdk/companies.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +4 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/companies.test.ts +52 -0
- package/src/__tests__/vendors.test.ts +2 -2
- package/src/__tests__/webhooks.test.ts +1 -1
- package/src/funcs/companiesListOrSearchCompanies.ts +246 -0
- package/src/funcs/vendorsListVendorFacilityStatuses.ts +1 -0
- package/src/funcs/vendorsListVendorInvoices.ts +1 -1
- package/src/lib/config.ts +3 -3
- package/src/lib/matchers.ts +20 -0
- package/src/lib/sdks.ts +8 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/companiesListOrSearchCompanies.ts +38 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/listorsearchcompanies.ts +264 -0
- package/src/models/operations/listvendorfacilitystatuses.ts +9 -0
- package/src/models/operations/listvendorinvoices.ts +37 -27
- package/src/react-query/companiesListOrSearchCompanies.ts +345 -0
- package/src/react-query/index.ts +1 -0
- package/src/react-query/vendorsListVendorFacilityStatuses.ts +5 -0
- package/src/react-query/vendorsListVendorInvoices.ts +5 -5
- package/src/sdk/companies.ts +29 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -0,0 +1,345 @@
|
|
|
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 { companiesListOrSearchCompanies } from "../funcs/companiesListOrSearchCompanies.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 CompaniesListOrSearchCompaniesQueryData =
|
|
38
|
+
operations.ListOrSearchCompaniesResponse;
|
|
39
|
+
|
|
40
|
+
export type CompaniesListOrSearchCompaniesInfiniteQueryData = PageIterator<
|
|
41
|
+
operations.ListOrSearchCompaniesResponse,
|
|
42
|
+
{ page: number }
|
|
43
|
+
>;
|
|
44
|
+
|
|
45
|
+
export type CompaniesListOrSearchCompaniesPageParams = PageIterator<
|
|
46
|
+
operations.ListOrSearchCompaniesResponse,
|
|
47
|
+
{ page: number }
|
|
48
|
+
>["~next"];
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* List or search companies
|
|
52
|
+
*
|
|
53
|
+
* @remarks
|
|
54
|
+
* List or search companies.
|
|
55
|
+
*/
|
|
56
|
+
export function useCompaniesListOrSearchCompanies(
|
|
57
|
+
request: operations.ListOrSearchCompaniesRequest,
|
|
58
|
+
options?: QueryHookOptions<CompaniesListOrSearchCompaniesQueryData>,
|
|
59
|
+
): UseQueryResult<CompaniesListOrSearchCompaniesQueryData, Error> {
|
|
60
|
+
const client = useGreenSecurityContext();
|
|
61
|
+
return useQuery({
|
|
62
|
+
...buildCompaniesListOrSearchCompaniesQuery(
|
|
63
|
+
client,
|
|
64
|
+
request,
|
|
65
|
+
options,
|
|
66
|
+
),
|
|
67
|
+
...options,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* List or search companies
|
|
73
|
+
*
|
|
74
|
+
* @remarks
|
|
75
|
+
* List or search companies.
|
|
76
|
+
*/
|
|
77
|
+
export function useCompaniesListOrSearchCompaniesSuspense(
|
|
78
|
+
request: operations.ListOrSearchCompaniesRequest,
|
|
79
|
+
options?: SuspenseQueryHookOptions<CompaniesListOrSearchCompaniesQueryData>,
|
|
80
|
+
): UseSuspenseQueryResult<CompaniesListOrSearchCompaniesQueryData, Error> {
|
|
81
|
+
const client = useGreenSecurityContext();
|
|
82
|
+
return useSuspenseQuery({
|
|
83
|
+
...buildCompaniesListOrSearchCompaniesQuery(
|
|
84
|
+
client,
|
|
85
|
+
request,
|
|
86
|
+
options,
|
|
87
|
+
),
|
|
88
|
+
...options,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* List or search companies
|
|
94
|
+
*
|
|
95
|
+
* @remarks
|
|
96
|
+
* List or search companies.
|
|
97
|
+
*/
|
|
98
|
+
export function useCompaniesListOrSearchCompaniesInfinite(
|
|
99
|
+
request: operations.ListOrSearchCompaniesRequest,
|
|
100
|
+
options?: InfiniteQueryHookOptions<
|
|
101
|
+
CompaniesListOrSearchCompaniesInfiniteQueryData
|
|
102
|
+
>,
|
|
103
|
+
): UseInfiniteQueryResult<
|
|
104
|
+
InfiniteData<
|
|
105
|
+
CompaniesListOrSearchCompaniesInfiniteQueryData,
|
|
106
|
+
CompaniesListOrSearchCompaniesPageParams
|
|
107
|
+
>,
|
|
108
|
+
Error
|
|
109
|
+
> {
|
|
110
|
+
const client = useGreenSecurityContext();
|
|
111
|
+
return useInfiniteQuery<
|
|
112
|
+
CompaniesListOrSearchCompaniesInfiniteQueryData,
|
|
113
|
+
Error,
|
|
114
|
+
InfiniteData<
|
|
115
|
+
CompaniesListOrSearchCompaniesInfiniteQueryData,
|
|
116
|
+
CompaniesListOrSearchCompaniesPageParams
|
|
117
|
+
>,
|
|
118
|
+
QueryKey,
|
|
119
|
+
CompaniesListOrSearchCompaniesPageParams
|
|
120
|
+
>({
|
|
121
|
+
...buildCompaniesListOrSearchCompaniesInfiniteQuery(
|
|
122
|
+
client,
|
|
123
|
+
request,
|
|
124
|
+
options,
|
|
125
|
+
),
|
|
126
|
+
initialPageParam: options?.initialPageParam,
|
|
127
|
+
getNextPageParam: (previousPage) => previousPage["~next"],
|
|
128
|
+
...options,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* List or search companies
|
|
134
|
+
*
|
|
135
|
+
* @remarks
|
|
136
|
+
* List or search companies.
|
|
137
|
+
*/
|
|
138
|
+
export function useCompaniesListOrSearchCompaniesInfiniteSuspense(
|
|
139
|
+
request: operations.ListOrSearchCompaniesRequest,
|
|
140
|
+
options?: SuspenseInfiniteQueryHookOptions<
|
|
141
|
+
CompaniesListOrSearchCompaniesInfiniteQueryData
|
|
142
|
+
>,
|
|
143
|
+
): UseSuspenseInfiniteQueryResult<
|
|
144
|
+
InfiniteData<
|
|
145
|
+
CompaniesListOrSearchCompaniesInfiniteQueryData,
|
|
146
|
+
CompaniesListOrSearchCompaniesPageParams
|
|
147
|
+
>,
|
|
148
|
+
Error
|
|
149
|
+
> {
|
|
150
|
+
const client = useGreenSecurityContext();
|
|
151
|
+
return useSuspenseInfiniteQuery<
|
|
152
|
+
CompaniesListOrSearchCompaniesInfiniteQueryData,
|
|
153
|
+
Error,
|
|
154
|
+
InfiniteData<
|
|
155
|
+
CompaniesListOrSearchCompaniesInfiniteQueryData,
|
|
156
|
+
CompaniesListOrSearchCompaniesPageParams
|
|
157
|
+
>,
|
|
158
|
+
QueryKey,
|
|
159
|
+
CompaniesListOrSearchCompaniesPageParams
|
|
160
|
+
>({
|
|
161
|
+
...buildCompaniesListOrSearchCompaniesInfiniteQuery(
|
|
162
|
+
client,
|
|
163
|
+
request,
|
|
164
|
+
options,
|
|
165
|
+
),
|
|
166
|
+
initialPageParam: options?.initialPageParam,
|
|
167
|
+
getNextPageParam: (previousPage) => previousPage["~next"],
|
|
168
|
+
...options,
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export function prefetchCompaniesListOrSearchCompanies(
|
|
173
|
+
queryClient: QueryClient,
|
|
174
|
+
client$: GreenSecurityCore,
|
|
175
|
+
request: operations.ListOrSearchCompaniesRequest,
|
|
176
|
+
): Promise<void> {
|
|
177
|
+
return queryClient.prefetchQuery({
|
|
178
|
+
...buildCompaniesListOrSearchCompaniesQuery(
|
|
179
|
+
client$,
|
|
180
|
+
request,
|
|
181
|
+
),
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export function setCompaniesListOrSearchCompaniesData(
|
|
186
|
+
client: QueryClient,
|
|
187
|
+
queryKeyBase: [
|
|
188
|
+
parameters: {
|
|
189
|
+
sort?: string | null | undefined;
|
|
190
|
+
desc?: components.Desc | undefined;
|
|
191
|
+
page?: number | undefined;
|
|
192
|
+
itemsPerPage?: number | undefined;
|
|
193
|
+
nameLike?: string | undefined;
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
data: CompaniesListOrSearchCompaniesQueryData,
|
|
197
|
+
): CompaniesListOrSearchCompaniesQueryData | undefined {
|
|
198
|
+
const key = queryKeyCompaniesListOrSearchCompanies(...queryKeyBase);
|
|
199
|
+
|
|
200
|
+
return client.setQueryData<CompaniesListOrSearchCompaniesQueryData>(
|
|
201
|
+
key,
|
|
202
|
+
data,
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export function invalidateCompaniesListOrSearchCompanies(
|
|
207
|
+
client: QueryClient,
|
|
208
|
+
queryKeyBase: TupleToPrefixes<
|
|
209
|
+
[parameters: {
|
|
210
|
+
sort?: string | null | undefined;
|
|
211
|
+
desc?: components.Desc | undefined;
|
|
212
|
+
page?: number | undefined;
|
|
213
|
+
itemsPerPage?: number | undefined;
|
|
214
|
+
nameLike?: string | 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
|
+
"companies",
|
|
224
|
+
"listOrSearchCompanies",
|
|
225
|
+
...queryKeyBase,
|
|
226
|
+
],
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export function invalidateAllCompaniesListOrSearchCompanies(
|
|
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
|
+
"companies",
|
|
239
|
+
"listOrSearchCompanies",
|
|
240
|
+
],
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export function buildCompaniesListOrSearchCompaniesQuery(
|
|
245
|
+
client$: GreenSecurityCore,
|
|
246
|
+
request: operations.ListOrSearchCompaniesRequest,
|
|
247
|
+
options?: RequestOptions,
|
|
248
|
+
): {
|
|
249
|
+
queryKey: QueryKey;
|
|
250
|
+
queryFn: (
|
|
251
|
+
context: QueryFunctionContext,
|
|
252
|
+
) => Promise<CompaniesListOrSearchCompaniesQueryData>;
|
|
253
|
+
} {
|
|
254
|
+
return {
|
|
255
|
+
queryKey: queryKeyCompaniesListOrSearchCompanies({
|
|
256
|
+
sort: request.sort,
|
|
257
|
+
desc: request.desc,
|
|
258
|
+
page: request.page,
|
|
259
|
+
itemsPerPage: request.itemsPerPage,
|
|
260
|
+
nameLike: request.nameLike,
|
|
261
|
+
}),
|
|
262
|
+
queryFn: async function companiesListOrSearchCompaniesQueryFn(
|
|
263
|
+
ctx,
|
|
264
|
+
): Promise<CompaniesListOrSearchCompaniesQueryData> {
|
|
265
|
+
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
266
|
+
const mergedOptions = {
|
|
267
|
+
...options,
|
|
268
|
+
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
return unwrapAsync(companiesListOrSearchCompanies(
|
|
272
|
+
client$,
|
|
273
|
+
request,
|
|
274
|
+
mergedOptions,
|
|
275
|
+
));
|
|
276
|
+
},
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export function buildCompaniesListOrSearchCompaniesInfiniteQuery(
|
|
281
|
+
client$: GreenSecurityCore,
|
|
282
|
+
request: operations.ListOrSearchCompaniesRequest,
|
|
283
|
+
options?: RequestOptions,
|
|
284
|
+
): {
|
|
285
|
+
queryKey: QueryKey;
|
|
286
|
+
queryFn: (
|
|
287
|
+
context: QueryFunctionContext<
|
|
288
|
+
QueryKey,
|
|
289
|
+
CompaniesListOrSearchCompaniesPageParams
|
|
290
|
+
>,
|
|
291
|
+
) => Promise<CompaniesListOrSearchCompaniesInfiniteQueryData>;
|
|
292
|
+
} {
|
|
293
|
+
return {
|
|
294
|
+
queryKey: queryKeyCompaniesListOrSearchCompanies({
|
|
295
|
+
sort: request.sort,
|
|
296
|
+
desc: request.desc,
|
|
297
|
+
page: request.page,
|
|
298
|
+
itemsPerPage: request.itemsPerPage,
|
|
299
|
+
nameLike: request.nameLike,
|
|
300
|
+
}),
|
|
301
|
+
queryFn: async function companiesListOrSearchCompaniesQuery(
|
|
302
|
+
ctx,
|
|
303
|
+
): Promise<CompaniesListOrSearchCompaniesInfiniteQueryData> {
|
|
304
|
+
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
305
|
+
const mergedOptions = {
|
|
306
|
+
...options,
|
|
307
|
+
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
if (!ctx.pageParam) {
|
|
311
|
+
return unwrapResultIterator(companiesListOrSearchCompanies(
|
|
312
|
+
client$,
|
|
313
|
+
request,
|
|
314
|
+
mergedOptions,
|
|
315
|
+
));
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
return unwrapResultIterator(companiesListOrSearchCompanies(
|
|
319
|
+
client$,
|
|
320
|
+
{
|
|
321
|
+
...request,
|
|
322
|
+
page: ctx.pageParam.page,
|
|
323
|
+
},
|
|
324
|
+
mergedOptions,
|
|
325
|
+
));
|
|
326
|
+
},
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export function queryKeyCompaniesListOrSearchCompanies(
|
|
331
|
+
parameters: {
|
|
332
|
+
sort?: string | null | undefined;
|
|
333
|
+
desc?: components.Desc | undefined;
|
|
334
|
+
page?: number | undefined;
|
|
335
|
+
itemsPerPage?: number | undefined;
|
|
336
|
+
nameLike?: string | undefined;
|
|
337
|
+
},
|
|
338
|
+
): QueryKey {
|
|
339
|
+
return [
|
|
340
|
+
"@greensecurity/javascript-sdk",
|
|
341
|
+
"companies",
|
|
342
|
+
"listOrSearchCompanies",
|
|
343
|
+
parameters,
|
|
344
|
+
];
|
|
345
|
+
}
|
package/src/react-query/index.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
export { GreenSecurityProvider, useGreenSecurityContext } from "./_context.js";
|
|
6
6
|
export * from "./_types.js";
|
|
7
7
|
|
|
8
|
+
export * from "./companiesListOrSearchCompanies.js";
|
|
8
9
|
export * from "./organizationsGetFacility.js";
|
|
9
10
|
export * from "./organizationsListOrSearchFacilities.js";
|
|
10
11
|
export * from "./supportArticlesGetSupportArticle.js";
|
|
@@ -193,6 +193,7 @@ export function setVendorsListVendorFacilityStatusesData(
|
|
|
193
193
|
page?: number | undefined;
|
|
194
194
|
itemsPerPage?: number | undefined;
|
|
195
195
|
scanType?: components.ScanType | undefined;
|
|
196
|
+
facilityNameLike?: string | undefined;
|
|
196
197
|
},
|
|
197
198
|
],
|
|
198
199
|
data: VendorsListVendorFacilityStatusesQueryData,
|
|
@@ -214,6 +215,7 @@ export function invalidateVendorsListVendorFacilityStatuses(
|
|
|
214
215
|
page?: number | undefined;
|
|
215
216
|
itemsPerPage?: number | undefined;
|
|
216
217
|
scanType?: components.ScanType | undefined;
|
|
218
|
+
facilityNameLike?: string | undefined;
|
|
217
219
|
}]
|
|
218
220
|
>,
|
|
219
221
|
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
@@ -260,6 +262,7 @@ export function buildVendorsListVendorFacilityStatusesQuery(
|
|
|
260
262
|
page: request.page,
|
|
261
263
|
itemsPerPage: request.itemsPerPage,
|
|
262
264
|
scanType: request.scanType,
|
|
265
|
+
facilityNameLike: request.facilityNameLike,
|
|
263
266
|
}),
|
|
264
267
|
queryFn: async function vendorsListVendorFacilityStatusesQueryFn(
|
|
265
268
|
ctx,
|
|
@@ -299,6 +302,7 @@ export function buildVendorsListVendorFacilityStatusesInfiniteQuery(
|
|
|
299
302
|
page: request.page,
|
|
300
303
|
itemsPerPage: request.itemsPerPage,
|
|
301
304
|
scanType: request.scanType,
|
|
305
|
+
facilityNameLike: request.facilityNameLike,
|
|
302
306
|
}),
|
|
303
307
|
queryFn: async function vendorsListVendorFacilityStatusesQuery(
|
|
304
308
|
ctx,
|
|
@@ -336,6 +340,7 @@ export function queryKeyVendorsListVendorFacilityStatuses(
|
|
|
336
340
|
page?: number | undefined;
|
|
337
341
|
itemsPerPage?: number | undefined;
|
|
338
342
|
scanType?: components.ScanType | undefined;
|
|
343
|
+
facilityNameLike?: string | undefined;
|
|
339
344
|
},
|
|
340
345
|
): QueryKey {
|
|
341
346
|
return [
|
|
@@ -209,7 +209,7 @@ export function setVendorsListVendorInvoicesData(
|
|
|
209
209
|
itemsPerPage?: number | undefined;
|
|
210
210
|
expand?: Array<components.Expand> | undefined;
|
|
211
211
|
invoiceNumber?: string | undefined;
|
|
212
|
-
|
|
212
|
+
invoiceFinancialStatus?: operations.InvoiceFinancialStatus | undefined;
|
|
213
213
|
},
|
|
214
214
|
],
|
|
215
215
|
data: VendorsListVendorInvoicesQueryData,
|
|
@@ -231,7 +231,7 @@ export function invalidateVendorsListVendorInvoices(
|
|
|
231
231
|
itemsPerPage?: number | undefined;
|
|
232
232
|
expand?: Array<components.Expand> | undefined;
|
|
233
233
|
invoiceNumber?: string | undefined;
|
|
234
|
-
|
|
234
|
+
invoiceFinancialStatus?: operations.InvoiceFinancialStatus | undefined;
|
|
235
235
|
},
|
|
236
236
|
]
|
|
237
237
|
>,
|
|
@@ -280,7 +280,7 @@ export function buildVendorsListVendorInvoicesQuery(
|
|
|
280
280
|
itemsPerPage: request.itemsPerPage,
|
|
281
281
|
expand: request.expand,
|
|
282
282
|
invoiceNumber: request.invoiceNumber,
|
|
283
|
-
|
|
283
|
+
invoiceFinancialStatus: request.invoiceFinancialStatus,
|
|
284
284
|
}),
|
|
285
285
|
queryFn: async function vendorsListVendorInvoicesQueryFn(
|
|
286
286
|
ctx,
|
|
@@ -321,7 +321,7 @@ export function buildVendorsListVendorInvoicesInfiniteQuery(
|
|
|
321
321
|
itemsPerPage: request.itemsPerPage,
|
|
322
322
|
expand: request.expand,
|
|
323
323
|
invoiceNumber: request.invoiceNumber,
|
|
324
|
-
|
|
324
|
+
invoiceFinancialStatus: request.invoiceFinancialStatus,
|
|
325
325
|
}),
|
|
326
326
|
queryFn: async function vendorsListVendorInvoicesQuery(
|
|
327
327
|
ctx,
|
|
@@ -361,7 +361,7 @@ export function queryKeyVendorsListVendorInvoices(
|
|
|
361
361
|
itemsPerPage?: number | undefined;
|
|
362
362
|
expand?: Array<components.Expand> | undefined;
|
|
363
363
|
invoiceNumber?: string | undefined;
|
|
364
|
-
|
|
364
|
+
invoiceFinancialStatus?: operations.InvoiceFinancialStatus | undefined;
|
|
365
365
|
},
|
|
366
366
|
): QueryKey {
|
|
367
367
|
return [
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { companiesListOrSearchCompanies } from "../funcs/companiesListOrSearchCompanies.js";
|
|
6
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
7
|
+
import * as operations from "../models/operations/index.js";
|
|
8
|
+
import { PageIterator, unwrapResultIterator } from "../types/operations.js";
|
|
9
|
+
|
|
10
|
+
export class Companies extends ClientSDK {
|
|
11
|
+
/**
|
|
12
|
+
* List or search companies
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* List or search companies.
|
|
16
|
+
*/
|
|
17
|
+
async listOrSearchCompanies(
|
|
18
|
+
request: operations.ListOrSearchCompaniesRequest,
|
|
19
|
+
options?: RequestOptions,
|
|
20
|
+
): Promise<
|
|
21
|
+
PageIterator<operations.ListOrSearchCompaniesResponse, { page: number }>
|
|
22
|
+
> {
|
|
23
|
+
return unwrapResultIterator(companiesListOrSearchCompanies(
|
|
24
|
+
this,
|
|
25
|
+
request,
|
|
26
|
+
options,
|
|
27
|
+
));
|
|
28
|
+
}
|
|
29
|
+
}
|
package/src/sdk/sdk.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { ClientSDK } from "../lib/sdks.js";
|
|
6
|
+
import { Companies } from "./companies.js";
|
|
6
7
|
import { Organizations } from "./organizations.js";
|
|
7
8
|
import { SupportArticles } from "./supportarticles.js";
|
|
8
9
|
import { Users } from "./users.js";
|
|
@@ -40,4 +41,9 @@ export class GreenSecurity extends ClientSDK {
|
|
|
40
41
|
get vendorScans(): VendorScans {
|
|
41
42
|
return (this._vendorScans ??= new VendorScans(this._options));
|
|
42
43
|
}
|
|
44
|
+
|
|
45
|
+
private _companies?: Companies;
|
|
46
|
+
get companies(): Companies {
|
|
47
|
+
return (this._companies ??= new Companies(this._options));
|
|
48
|
+
}
|
|
43
49
|
}
|