@greensecurity/javascript-sdk 0.30.25 → 0.30.29
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 +9 -0
- package/bin/mcp-server.js +937 -518
- package/bin/mcp-server.js.map +25 -18
- 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 +25 -2
- package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js.map +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/vendorsCreateVendorCompany.d.ts +17 -0
- package/dist/commonjs/funcs/vendorsCreateVendorCompany.d.ts.map +1 -0
- package/dist/commonjs/funcs/vendorsCreateVendorCompany.js +121 -0
- package/dist/commonjs/funcs/vendorsCreateVendorCompany.js.map +1 -0
- 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 +5 -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/mcp-server/tools/vendorsCreateVendorCompany.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/vendorsCreateVendorCompany.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/vendorsCreateVendorCompany.js +64 -0
- package/dist/commonjs/mcp-server/tools/vendorsCreateVendorCompany.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +1 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +1 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/state.d.ts +181 -0
- package/dist/commonjs/models/components/state.d.ts.map +1 -0
- package/dist/commonjs/models/components/state.js +112 -0
- package/dist/commonjs/models/components/state.js.map +1 -0
- package/dist/commonjs/models/components/userlocation.d.ts +4 -172
- package/dist/commonjs/models/components/userlocation.d.ts.map +1 -1
- package/dist/commonjs/models/components/userlocation.js +4 -71
- package/dist/commonjs/models/components/userlocation.js.map +1 -1
- package/dist/commonjs/models/operations/createvendorcompany.d.ts +116 -0
- package/dist/commonjs/models/operations/createvendorcompany.d.ts.map +1 -0
- package/dist/commonjs/models/operations/createvendorcompany.js +163 -0
- package/dist/commonjs/models/operations/createvendorcompany.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +2 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +2 -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/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 +2 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +2 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/vendorsCreateVendorCompany.d.ts +23 -0
- package/dist/commonjs/react-query/vendorsCreateVendorCompany.d.ts.map +1 -0
- package/dist/commonjs/react-query/vendorsCreateVendorCompany.js +47 -0
- package/dist/commonjs/react-query/vendorsCreateVendorCompany.js.map +1 -0
- 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/commonjs/sdk/vendors.d.ts +7 -0
- package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
- package/dist/commonjs/sdk/vendors.js +10 -0
- package/dist/commonjs/sdk/vendors.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 +25 -2
- package/dist/esm/__tests__/vendors.test.js.map +1 -1
- package/dist/esm/__tests__/webhooks.test.js +1 -1
- package/dist/esm/__tests__/webhooks.test.js.map +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/vendorsCreateVendorCompany.d.ts +17 -0
- package/dist/esm/funcs/vendorsCreateVendorCompany.d.ts.map +1 -0
- package/dist/esm/funcs/vendorsCreateVendorCompany.js +85 -0
- package/dist/esm/funcs/vendorsCreateVendorCompany.js.map +1 -0
- 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 +5 -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/mcp-server/tools/vendorsCreateVendorCompany.d.ts +8 -0
- package/dist/esm/mcp-server/tools/vendorsCreateVendorCompany.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/vendorsCreateVendorCompany.js +28 -0
- package/dist/esm/mcp-server/tools/vendorsCreateVendorCompany.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +1 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +1 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/state.d.ts +181 -0
- package/dist/esm/models/components/state.d.ts.map +1 -0
- package/dist/esm/models/components/state.js +76 -0
- package/dist/esm/models/components/state.js.map +1 -0
- package/dist/esm/models/components/userlocation.d.ts +4 -172
- package/dist/esm/models/components/userlocation.d.ts.map +1 -1
- package/dist/esm/models/components/userlocation.js +1 -68
- package/dist/esm/models/components/userlocation.js.map +1 -1
- package/dist/esm/models/operations/createvendorcompany.d.ts +116 -0
- package/dist/esm/models/operations/createvendorcompany.d.ts.map +1 -0
- package/dist/esm/models/operations/createvendorcompany.js +121 -0
- package/dist/esm/models/operations/createvendorcompany.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +2 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +2 -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/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 +2 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +2 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/vendorsCreateVendorCompany.d.ts +23 -0
- package/dist/esm/react-query/vendorsCreateVendorCompany.d.ts.map +1 -0
- package/dist/esm/react-query/vendorsCreateVendorCompany.js +42 -0
- package/dist/esm/react-query/vendorsCreateVendorCompany.js.map +1 -0
- 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/dist/esm/sdk/vendors.d.ts +7 -0
- package/dist/esm/sdk/vendors.d.ts.map +1 -1
- package/dist/esm/sdk/vendors.js +10 -0
- package/dist/esm/sdk/vendors.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 +28 -2
- package/src/__tests__/webhooks.test.ts +1 -1
- package/src/funcs/companiesListOrSearchCompanies.ts +246 -0
- package/src/funcs/vendorsCreateVendorCompany.ts +174 -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 +5 -1
- package/src/mcp-server/tools/companiesListOrSearchCompanies.ts +38 -0
- package/src/mcp-server/tools/vendorsCreateVendorCompany.ts +37 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/components/state.ts +87 -0
- package/src/models/components/userlocation.ts +4 -75
- package/src/models/operations/createvendorcompany.ts +262 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/listorsearchcompanies.ts +264 -0
- package/src/models/operations/listvendorinvoices.ts +37 -27
- package/src/react-query/companiesListOrSearchCompanies.ts +345 -0
- package/src/react-query/index.ts +2 -0
- package/src/react-query/vendorsCreateVendorCompany.ts +89 -0
- package/src/react-query/vendorsListVendorInvoices.ts +5 -5
- package/src/sdk/companies.ts +29 -0
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/vendors.ts +18 -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";
|
|
@@ -18,6 +19,7 @@ export * from "./usersPassword.js";
|
|
|
18
19
|
export * from "./usersPasswordResetRequest.js";
|
|
19
20
|
export * from "./vendorsAddVendorManagedByCompany.js";
|
|
20
21
|
export * from "./vendorScansVendorScanOut.js";
|
|
22
|
+
export * from "./vendorsCreateVendorCompany.js";
|
|
21
23
|
export * from "./vendorsCreateVendorRegistration.js";
|
|
22
24
|
export * from "./vendorsDeleteVendorManagedByCompany.js";
|
|
23
25
|
export * from "./vendorsExpediteTimeRemaining.js";
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
MutationKey,
|
|
7
|
+
useMutation,
|
|
8
|
+
UseMutationResult,
|
|
9
|
+
} from "@tanstack/react-query";
|
|
10
|
+
import { GreenSecurityCore } from "../core.js";
|
|
11
|
+
import { vendorsCreateVendorCompany } from "../funcs/vendorsCreateVendorCompany.js";
|
|
12
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
13
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
14
|
+
import * as operations from "../models/operations/index.js";
|
|
15
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
16
|
+
import { useGreenSecurityContext } from "./_context.js";
|
|
17
|
+
import { MutationHookOptions } from "./_types.js";
|
|
18
|
+
|
|
19
|
+
export type VendorsCreateVendorCompanyMutationVariables = {
|
|
20
|
+
request: operations.CreateVendorCompanyRequest;
|
|
21
|
+
options?: RequestOptions;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type VendorsCreateVendorCompanyMutationData =
|
|
25
|
+
operations.CreateVendorCompanyResponseBody;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Create vendor company
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Create vendor company
|
|
32
|
+
*/
|
|
33
|
+
export function useVendorsCreateVendorCompanyMutation(
|
|
34
|
+
options?: MutationHookOptions<
|
|
35
|
+
VendorsCreateVendorCompanyMutationData,
|
|
36
|
+
Error,
|
|
37
|
+
VendorsCreateVendorCompanyMutationVariables
|
|
38
|
+
>,
|
|
39
|
+
): UseMutationResult<
|
|
40
|
+
VendorsCreateVendorCompanyMutationData,
|
|
41
|
+
Error,
|
|
42
|
+
VendorsCreateVendorCompanyMutationVariables
|
|
43
|
+
> {
|
|
44
|
+
const client = useGreenSecurityContext();
|
|
45
|
+
return useMutation({
|
|
46
|
+
...buildVendorsCreateVendorCompanyMutation(client, options),
|
|
47
|
+
...options,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function mutationKeyVendorsCreateVendorCompany(): MutationKey {
|
|
52
|
+
return ["@greensecurity/javascript-sdk", "vendors", "createVendorCompany"];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function buildVendorsCreateVendorCompanyMutation(
|
|
56
|
+
client$: GreenSecurityCore,
|
|
57
|
+
hookOptions?: RequestOptions,
|
|
58
|
+
): {
|
|
59
|
+
mutationKey: MutationKey;
|
|
60
|
+
mutationFn: (
|
|
61
|
+
variables: VendorsCreateVendorCompanyMutationVariables,
|
|
62
|
+
) => Promise<VendorsCreateVendorCompanyMutationData>;
|
|
63
|
+
} {
|
|
64
|
+
return {
|
|
65
|
+
mutationKey: mutationKeyVendorsCreateVendorCompany(),
|
|
66
|
+
mutationFn: function vendorsCreateVendorCompanyMutationFn({
|
|
67
|
+
request,
|
|
68
|
+
options,
|
|
69
|
+
}): Promise<VendorsCreateVendorCompanyMutationData> {
|
|
70
|
+
const mergedOptions = {
|
|
71
|
+
...hookOptions,
|
|
72
|
+
...options,
|
|
73
|
+
fetchOptions: {
|
|
74
|
+
...hookOptions?.fetchOptions,
|
|
75
|
+
...options?.fetchOptions,
|
|
76
|
+
signal: combineSignals(
|
|
77
|
+
hookOptions?.fetchOptions?.signal,
|
|
78
|
+
options?.fetchOptions?.signal,
|
|
79
|
+
),
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
return unwrapAsync(vendorsCreateVendorCompany(
|
|
83
|
+
client$,
|
|
84
|
+
request,
|
|
85
|
+
mergedOptions,
|
|
86
|
+
));
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
}
|
|
@@ -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
|
}
|
package/src/sdk/vendors.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { vendorsAddVendorManagedByCompany } from "../funcs/vendorsAddVendorManagedByCompany.js";
|
|
6
|
+
import { vendorsCreateVendorCompany } from "../funcs/vendorsCreateVendorCompany.js";
|
|
6
7
|
import { vendorsCreateVendorRegistration } from "../funcs/vendorsCreateVendorRegistration.js";
|
|
7
8
|
import { vendorsDeleteVendorManagedByCompany } from "../funcs/vendorsDeleteVendorManagedByCompany.js";
|
|
8
9
|
import { vendorsExpediteTimeRemaining } from "../funcs/vendorsExpediteTimeRemaining.js";
|
|
@@ -422,4 +423,21 @@ export class Vendors extends ClientSDK {
|
|
|
422
423
|
options,
|
|
423
424
|
));
|
|
424
425
|
}
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Create vendor company
|
|
429
|
+
*
|
|
430
|
+
* @remarks
|
|
431
|
+
* Create vendor company
|
|
432
|
+
*/
|
|
433
|
+
async createVendorCompany(
|
|
434
|
+
request: operations.CreateVendorCompanyRequest,
|
|
435
|
+
options?: RequestOptions,
|
|
436
|
+
): Promise<operations.CreateVendorCompanyResponseBody> {
|
|
437
|
+
return unwrapAsync(vendorsCreateVendorCompany(
|
|
438
|
+
this,
|
|
439
|
+
request,
|
|
440
|
+
options,
|
|
441
|
+
));
|
|
442
|
+
}
|
|
425
443
|
}
|