@greensecurity/javascript-sdk 0.44.0-beta.18 → 0.44.0-beta.19
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/dist/commonjs/__tests__/organizations.test.js +57 -0
- package/dist/commonjs/__tests__/organizations.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/__tests__/zones.test.js +27 -6
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/funcs/organizationsDownloadFacilityVendorsExport.d.ts +22 -0
- package/dist/commonjs/funcs/organizationsDownloadFacilityVendorsExport.d.ts.map +1 -0
- package/dist/commonjs/funcs/organizationsDownloadFacilityVendorsExport.js +132 -0
- package/dist/commonjs/funcs/organizationsDownloadFacilityVendorsExport.js.map +1 -0
- package/dist/commonjs/funcs/organizationsExportFacilityVendors.d.ts +34 -0
- package/dist/commonjs/funcs/organizationsExportFacilityVendors.d.ts.map +1 -0
- package/dist/commonjs/funcs/organizationsExportFacilityVendors.js +148 -0
- package/dist/commonjs/funcs/organizationsExportFacilityVendors.js.map +1 -0
- package/dist/commonjs/funcs/organizationsGetFacilityVendorsExportStatus.d.ts +22 -0
- package/dist/commonjs/funcs/organizationsGetFacilityVendorsExportStatus.d.ts.map +1 -0
- package/dist/commonjs/funcs/organizationsGetFacilityVendorsExportStatus.js +131 -0
- package/dist/commonjs/funcs/organizationsGetFacilityVendorsExportStatus.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/components/csvexportstatusresponse.d.ts +43 -0
- package/dist/commonjs/models/components/csvexportstatusresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/csvexportstatusresponse.js +65 -0
- package/dist/commonjs/models/components/csvexportstatusresponse.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/operations/downloadfacilityvendorsexport.d.ts +47 -0
- package/dist/commonjs/models/operations/downloadfacilityvendorsexport.d.ts.map +1 -0
- package/dist/commonjs/models/operations/downloadfacilityvendorsexport.js +80 -0
- package/dist/commonjs/models/operations/downloadfacilityvendorsexport.js.map +1 -0
- package/dist/commonjs/models/operations/exportfacilityvendors.d.ts +118 -0
- package/dist/commonjs/models/operations/exportfacilityvendors.d.ts.map +1 -0
- package/dist/commonjs/models/operations/exportfacilityvendors.js +115 -0
- package/dist/commonjs/models/operations/exportfacilityvendors.js.map +1 -0
- package/dist/commonjs/models/operations/getfacilityvendorsexportstatus.d.ts +20 -0
- package/dist/commonjs/models/operations/getfacilityvendorsexportstatus.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getfacilityvendorsexportstatus.js +55 -0
- package/dist/commonjs/models/operations/getfacilityvendorsexportstatus.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +3 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +3 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/react-query/index.d.ts +3 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +3 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/organizationsDownloadFacilityVendorsExport.core.d.ts +12 -0
- package/dist/commonjs/react-query/organizationsDownloadFacilityVendorsExport.core.d.ts.map +1 -0
- package/dist/commonjs/react-query/organizationsDownloadFacilityVendorsExport.core.js +40 -0
- package/dist/commonjs/react-query/organizationsDownloadFacilityVendorsExport.core.js.map +1 -0
- package/dist/commonjs/react-query/organizationsDownloadFacilityVendorsExport.d.ts +33 -0
- package/dist/commonjs/react-query/organizationsDownloadFacilityVendorsExport.d.ts.map +1 -0
- package/dist/commonjs/react-query/organizationsDownloadFacilityVendorsExport.js +73 -0
- package/dist/commonjs/react-query/organizationsDownloadFacilityVendorsExport.js.map +1 -0
- package/dist/commonjs/react-query/organizationsExportFacilityVendors.core.d.ts +19 -0
- package/dist/commonjs/react-query/organizationsExportFacilityVendors.core.d.ts.map +1 -0
- package/dist/commonjs/react-query/organizationsExportFacilityVendors.core.js +47 -0
- package/dist/commonjs/react-query/organizationsExportFacilityVendors.core.js.map +1 -0
- package/dist/commonjs/react-query/organizationsExportFacilityVendors.d.ts +77 -0
- package/dist/commonjs/react-query/organizationsExportFacilityVendors.d.ts.map +1 -0
- package/dist/commonjs/react-query/organizationsExportFacilityVendors.js +97 -0
- package/dist/commonjs/react-query/organizationsExportFacilityVendors.js.map +1 -0
- package/dist/commonjs/react-query/organizationsGetFacilityVendorsExportStatus.core.d.ts +13 -0
- package/dist/commonjs/react-query/organizationsGetFacilityVendorsExportStatus.core.d.ts.map +1 -0
- package/dist/commonjs/react-query/organizationsGetFacilityVendorsExportStatus.core.js +40 -0
- package/dist/commonjs/react-query/organizationsGetFacilityVendorsExportStatus.core.js.map +1 -0
- package/dist/commonjs/react-query/organizationsGetFacilityVendorsExportStatus.d.ts +31 -0
- package/dist/commonjs/react-query/organizationsGetFacilityVendorsExportStatus.d.ts.map +1 -0
- package/dist/commonjs/react-query/organizationsGetFacilityVendorsExportStatus.js +71 -0
- package/dist/commonjs/react-query/organizationsGetFacilityVendorsExportStatus.js.map +1 -0
- package/dist/commonjs/sdk/organizations.d.ts +38 -0
- package/dist/commonjs/sdk/organizations.d.ts.map +1 -1
- package/dist/commonjs/sdk/organizations.js +47 -0
- package/dist/commonjs/sdk/organizations.js.map +1 -1
- package/dist/esm/__tests__/organizations.test.js +57 -0
- package/dist/esm/__tests__/organizations.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/__tests__/zones.test.js +27 -6
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/funcs/organizationsDownloadFacilityVendorsExport.d.ts +22 -0
- package/dist/esm/funcs/organizationsDownloadFacilityVendorsExport.d.ts.map +1 -0
- package/dist/esm/funcs/organizationsDownloadFacilityVendorsExport.js +96 -0
- package/dist/esm/funcs/organizationsDownloadFacilityVendorsExport.js.map +1 -0
- package/dist/esm/funcs/organizationsExportFacilityVendors.d.ts +34 -0
- package/dist/esm/funcs/organizationsExportFacilityVendors.d.ts.map +1 -0
- package/dist/esm/funcs/organizationsExportFacilityVendors.js +112 -0
- package/dist/esm/funcs/organizationsExportFacilityVendors.js.map +1 -0
- package/dist/esm/funcs/organizationsGetFacilityVendorsExportStatus.d.ts +22 -0
- package/dist/esm/funcs/organizationsGetFacilityVendorsExportStatus.d.ts.map +1 -0
- package/dist/esm/funcs/organizationsGetFacilityVendorsExportStatus.js +95 -0
- package/dist/esm/funcs/organizationsGetFacilityVendorsExportStatus.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/components/csvexportstatusresponse.d.ts +43 -0
- package/dist/esm/models/components/csvexportstatusresponse.d.ts.map +1 -0
- package/dist/esm/models/components/csvexportstatusresponse.js +28 -0
- package/dist/esm/models/components/csvexportstatusresponse.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/operations/downloadfacilityvendorsexport.d.ts +47 -0
- package/dist/esm/models/operations/downloadfacilityvendorsexport.d.ts.map +1 -0
- package/dist/esm/models/operations/downloadfacilityvendorsexport.js +41 -0
- package/dist/esm/models/operations/downloadfacilityvendorsexport.js.map +1 -0
- package/dist/esm/models/operations/exportfacilityvendors.d.ts +118 -0
- package/dist/esm/models/operations/exportfacilityvendors.d.ts.map +1 -0
- package/dist/esm/models/operations/exportfacilityvendors.js +76 -0
- package/dist/esm/models/operations/exportfacilityvendors.js.map +1 -0
- package/dist/esm/models/operations/getfacilityvendorsexportstatus.d.ts +20 -0
- package/dist/esm/models/operations/getfacilityvendorsexportstatus.d.ts.map +1 -0
- package/dist/esm/models/operations/getfacilityvendorsexportstatus.js +18 -0
- package/dist/esm/models/operations/getfacilityvendorsexportstatus.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +3 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +3 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/react-query/index.d.ts +3 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +3 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/organizationsDownloadFacilityVendorsExport.core.d.ts +12 -0
- package/dist/esm/react-query/organizationsDownloadFacilityVendorsExport.core.d.ts.map +1 -0
- package/dist/esm/react-query/organizationsDownloadFacilityVendorsExport.core.js +35 -0
- package/dist/esm/react-query/organizationsDownloadFacilityVendorsExport.core.js.map +1 -0
- package/dist/esm/react-query/organizationsDownloadFacilityVendorsExport.d.ts +33 -0
- package/dist/esm/react-query/organizationsDownloadFacilityVendorsExport.d.ts.map +1 -0
- package/dist/esm/react-query/organizationsDownloadFacilityVendorsExport.js +63 -0
- package/dist/esm/react-query/organizationsDownloadFacilityVendorsExport.js.map +1 -0
- package/dist/esm/react-query/organizationsExportFacilityVendors.core.d.ts +19 -0
- package/dist/esm/react-query/organizationsExportFacilityVendors.core.d.ts.map +1 -0
- package/dist/esm/react-query/organizationsExportFacilityVendors.core.js +42 -0
- package/dist/esm/react-query/organizationsExportFacilityVendors.core.js.map +1 -0
- package/dist/esm/react-query/organizationsExportFacilityVendors.d.ts +77 -0
- package/dist/esm/react-query/organizationsExportFacilityVendors.d.ts.map +1 -0
- package/dist/esm/react-query/organizationsExportFacilityVendors.js +87 -0
- package/dist/esm/react-query/organizationsExportFacilityVendors.js.map +1 -0
- package/dist/esm/react-query/organizationsGetFacilityVendorsExportStatus.core.d.ts +13 -0
- package/dist/esm/react-query/organizationsGetFacilityVendorsExportStatus.core.d.ts.map +1 -0
- package/dist/esm/react-query/organizationsGetFacilityVendorsExportStatus.core.js +35 -0
- package/dist/esm/react-query/organizationsGetFacilityVendorsExportStatus.core.js.map +1 -0
- package/dist/esm/react-query/organizationsGetFacilityVendorsExportStatus.d.ts +31 -0
- package/dist/esm/react-query/organizationsGetFacilityVendorsExportStatus.d.ts.map +1 -0
- package/dist/esm/react-query/organizationsGetFacilityVendorsExportStatus.js +61 -0
- package/dist/esm/react-query/organizationsGetFacilityVendorsExportStatus.js.map +1 -0
- package/dist/esm/sdk/organizations.d.ts +38 -0
- package/dist/esm/sdk/organizations.d.ts.map +1 -1
- package/dist/esm/sdk/organizations.js +47 -0
- package/dist/esm/sdk/organizations.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/organizations.test.ts +66 -0
- package/src/__tests__/webhooks.test.ts +1 -1
- package/src/__tests__/zones.test.ts +27 -6
- package/src/funcs/organizationsDownloadFacilityVendorsExport.ts +202 -0
- package/src/funcs/organizationsExportFacilityVendors.ts +202 -0
- package/src/funcs/organizationsGetFacilityVendorsExportStatus.ts +188 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/csvexportstatusresponse.ts +79 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/operations/downloadfacilityvendorsexport.ts +124 -0
- package/src/models/operations/exportfacilityvendors.ts +206 -0
- package/src/models/operations/getfacilityvendorsexportstatus.ts +47 -0
- package/src/models/operations/index.ts +3 -0
- package/src/react-query/index.ts +3 -0
- package/src/react-query/organizationsDownloadFacilityVendorsExport.core.ts +84 -0
- package/src/react-query/organizationsDownloadFacilityVendorsExport.ts +155 -0
- package/src/react-query/organizationsExportFacilityVendors.core.ts +94 -0
- package/src/react-query/organizationsExportFacilityVendors.ts +200 -0
- package/src/react-query/organizationsGetFacilityVendorsExportStatus.core.ts +84 -0
- package/src/react-query/organizationsGetFacilityVendorsExportStatus.ts +153 -0
- package/src/sdk/organizations.ts +71 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
QueryClient,
|
|
7
|
+
QueryFunctionContext,
|
|
8
|
+
QueryKey,
|
|
9
|
+
} from "@tanstack/react-query";
|
|
10
|
+
import { GreenSecurityCore } from "../core.js";
|
|
11
|
+
import { organizationsDownloadFacilityVendorsExport } from "../funcs/organizationsDownloadFacilityVendorsExport.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
|
+
export type OrganizationsDownloadFacilityVendorsExportQueryData =
|
|
17
|
+
| operations.DownloadFacilityVendorsExportResponse
|
|
18
|
+
| undefined;
|
|
19
|
+
|
|
20
|
+
export function prefetchOrganizationsDownloadFacilityVendorsExport(
|
|
21
|
+
queryClient: QueryClient,
|
|
22
|
+
client$: GreenSecurityCore,
|
|
23
|
+
request: operations.DownloadFacilityVendorsExportRequest,
|
|
24
|
+
options?: RequestOptions,
|
|
25
|
+
): Promise<void> {
|
|
26
|
+
return queryClient.prefetchQuery({
|
|
27
|
+
...buildOrganizationsDownloadFacilityVendorsExportQuery(
|
|
28
|
+
client$,
|
|
29
|
+
request,
|
|
30
|
+
options,
|
|
31
|
+
),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function buildOrganizationsDownloadFacilityVendorsExportQuery(
|
|
36
|
+
client$: GreenSecurityCore,
|
|
37
|
+
request: operations.DownloadFacilityVendorsExportRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): {
|
|
40
|
+
queryKey: QueryKey;
|
|
41
|
+
queryFn: (
|
|
42
|
+
context: QueryFunctionContext,
|
|
43
|
+
) => Promise<OrganizationsDownloadFacilityVendorsExportQueryData>;
|
|
44
|
+
} {
|
|
45
|
+
return {
|
|
46
|
+
queryKey: queryKeyOrganizationsDownloadFacilityVendorsExport(
|
|
47
|
+
request.id,
|
|
48
|
+
request.exportId,
|
|
49
|
+
),
|
|
50
|
+
queryFn: async function organizationsDownloadFacilityVendorsExportQueryFn(
|
|
51
|
+
ctx,
|
|
52
|
+
): Promise<OrganizationsDownloadFacilityVendorsExportQueryData> {
|
|
53
|
+
const sig = combineSignals(
|
|
54
|
+
ctx.signal,
|
|
55
|
+
options?.signal,
|
|
56
|
+
options?.fetchOptions?.signal,
|
|
57
|
+
);
|
|
58
|
+
const mergedOptions = {
|
|
59
|
+
...options?.fetchOptions,
|
|
60
|
+
...options,
|
|
61
|
+
signal: sig,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
return unwrapAsync(organizationsDownloadFacilityVendorsExport(
|
|
65
|
+
client$,
|
|
66
|
+
request,
|
|
67
|
+
mergedOptions,
|
|
68
|
+
));
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function queryKeyOrganizationsDownloadFacilityVendorsExport(
|
|
74
|
+
id: number,
|
|
75
|
+
exportId: string,
|
|
76
|
+
): QueryKey {
|
|
77
|
+
return [
|
|
78
|
+
"@greensecurity/javascript-sdk",
|
|
79
|
+
"organizations",
|
|
80
|
+
"downloadFacilityVendorsExport",
|
|
81
|
+
id,
|
|
82
|
+
exportId,
|
|
83
|
+
];
|
|
84
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
InvalidateQueryFilters,
|
|
7
|
+
QueryClient,
|
|
8
|
+
useQuery,
|
|
9
|
+
UseQueryResult,
|
|
10
|
+
useSuspenseQuery,
|
|
11
|
+
UseSuspenseQueryResult,
|
|
12
|
+
} from "@tanstack/react-query";
|
|
13
|
+
import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { useGreenSecurityContext } from "./_context.js";
|
|
26
|
+
import {
|
|
27
|
+
QueryHookOptions,
|
|
28
|
+
SuspenseQueryHookOptions,
|
|
29
|
+
TupleToPrefixes,
|
|
30
|
+
} from "./_types.js";
|
|
31
|
+
import {
|
|
32
|
+
buildOrganizationsDownloadFacilityVendorsExportQuery,
|
|
33
|
+
OrganizationsDownloadFacilityVendorsExportQueryData,
|
|
34
|
+
prefetchOrganizationsDownloadFacilityVendorsExport,
|
|
35
|
+
queryKeyOrganizationsDownloadFacilityVendorsExport,
|
|
36
|
+
} from "./organizationsDownloadFacilityVendorsExport.core.js";
|
|
37
|
+
export {
|
|
38
|
+
buildOrganizationsDownloadFacilityVendorsExportQuery,
|
|
39
|
+
type OrganizationsDownloadFacilityVendorsExportQueryData,
|
|
40
|
+
prefetchOrganizationsDownloadFacilityVendorsExport,
|
|
41
|
+
queryKeyOrganizationsDownloadFacilityVendorsExport,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type OrganizationsDownloadFacilityVendorsExportQueryError =
|
|
45
|
+
| errors.ApiErrorResponse
|
|
46
|
+
| GreenSecurityError
|
|
47
|
+
| ResponseValidationError
|
|
48
|
+
| ConnectionError
|
|
49
|
+
| RequestAbortedError
|
|
50
|
+
| RequestTimeoutError
|
|
51
|
+
| InvalidRequestError
|
|
52
|
+
| UnexpectedClientError
|
|
53
|
+
| SDKValidationError;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Download facility vendors CSV
|
|
57
|
+
*
|
|
58
|
+
* @remarks
|
|
59
|
+
* Returns the exported facility vendors CSV via a 302 redirect to a short-lived
|
|
60
|
+
* presigned S3 URL. If the export is still being generated, returns 202 with a JSON
|
|
61
|
+
* `{ ready: false }` payload.
|
|
62
|
+
*/
|
|
63
|
+
export function useOrganizationsDownloadFacilityVendorsExport(
|
|
64
|
+
request: operations.DownloadFacilityVendorsExportRequest,
|
|
65
|
+
options?: QueryHookOptions<
|
|
66
|
+
OrganizationsDownloadFacilityVendorsExportQueryData,
|
|
67
|
+
OrganizationsDownloadFacilityVendorsExportQueryError
|
|
68
|
+
>,
|
|
69
|
+
): UseQueryResult<
|
|
70
|
+
OrganizationsDownloadFacilityVendorsExportQueryData,
|
|
71
|
+
OrganizationsDownloadFacilityVendorsExportQueryError
|
|
72
|
+
> {
|
|
73
|
+
const client = useGreenSecurityContext();
|
|
74
|
+
return useQuery({
|
|
75
|
+
...buildOrganizationsDownloadFacilityVendorsExportQuery(
|
|
76
|
+
client,
|
|
77
|
+
request,
|
|
78
|
+
options,
|
|
79
|
+
),
|
|
80
|
+
...options,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Download facility vendors CSV
|
|
86
|
+
*
|
|
87
|
+
* @remarks
|
|
88
|
+
* Returns the exported facility vendors CSV via a 302 redirect to a short-lived
|
|
89
|
+
* presigned S3 URL. If the export is still being generated, returns 202 with a JSON
|
|
90
|
+
* `{ ready: false }` payload.
|
|
91
|
+
*/
|
|
92
|
+
export function useOrganizationsDownloadFacilityVendorsExportSuspense(
|
|
93
|
+
request: operations.DownloadFacilityVendorsExportRequest,
|
|
94
|
+
options?: SuspenseQueryHookOptions<
|
|
95
|
+
OrganizationsDownloadFacilityVendorsExportQueryData,
|
|
96
|
+
OrganizationsDownloadFacilityVendorsExportQueryError
|
|
97
|
+
>,
|
|
98
|
+
): UseSuspenseQueryResult<
|
|
99
|
+
OrganizationsDownloadFacilityVendorsExportQueryData,
|
|
100
|
+
OrganizationsDownloadFacilityVendorsExportQueryError
|
|
101
|
+
> {
|
|
102
|
+
const client = useGreenSecurityContext();
|
|
103
|
+
return useSuspenseQuery({
|
|
104
|
+
...buildOrganizationsDownloadFacilityVendorsExportQuery(
|
|
105
|
+
client,
|
|
106
|
+
request,
|
|
107
|
+
options,
|
|
108
|
+
),
|
|
109
|
+
...options,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function setOrganizationsDownloadFacilityVendorsExportData(
|
|
114
|
+
client: QueryClient,
|
|
115
|
+
queryKeyBase: [id: number, exportId: string],
|
|
116
|
+
data: OrganizationsDownloadFacilityVendorsExportQueryData,
|
|
117
|
+
): OrganizationsDownloadFacilityVendorsExportQueryData | undefined {
|
|
118
|
+
const key = queryKeyOrganizationsDownloadFacilityVendorsExport(
|
|
119
|
+
...queryKeyBase,
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
return client.setQueryData<
|
|
123
|
+
OrganizationsDownloadFacilityVendorsExportQueryData
|
|
124
|
+
>(key, data);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function invalidateOrganizationsDownloadFacilityVendorsExport(
|
|
128
|
+
client: QueryClient,
|
|
129
|
+
queryKeyBase: TupleToPrefixes<[id: number, exportId: string]>,
|
|
130
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
131
|
+
): Promise<void> {
|
|
132
|
+
return client.invalidateQueries({
|
|
133
|
+
...filters,
|
|
134
|
+
queryKey: [
|
|
135
|
+
"@greensecurity/javascript-sdk",
|
|
136
|
+
"organizations",
|
|
137
|
+
"downloadFacilityVendorsExport",
|
|
138
|
+
...queryKeyBase,
|
|
139
|
+
],
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export function invalidateAllOrganizationsDownloadFacilityVendorsExport(
|
|
144
|
+
client: QueryClient,
|
|
145
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
146
|
+
): Promise<void> {
|
|
147
|
+
return client.invalidateQueries({
|
|
148
|
+
...filters,
|
|
149
|
+
queryKey: [
|
|
150
|
+
"@greensecurity/javascript-sdk",
|
|
151
|
+
"organizations",
|
|
152
|
+
"downloadFacilityVendorsExport",
|
|
153
|
+
],
|
|
154
|
+
});
|
|
155
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
QueryClient,
|
|
7
|
+
QueryFunctionContext,
|
|
8
|
+
QueryKey,
|
|
9
|
+
} from "@tanstack/react-query";
|
|
10
|
+
import { GreenSecurityCore } from "../core.js";
|
|
11
|
+
import { organizationsExportFacilityVendors } from "../funcs/organizationsExportFacilityVendors.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
|
+
export type OrganizationsExportFacilityVendorsQueryData =
|
|
17
|
+
operations.ExportFacilityVendorsResponseBody;
|
|
18
|
+
|
|
19
|
+
export function prefetchOrganizationsExportFacilityVendors(
|
|
20
|
+
queryClient: QueryClient,
|
|
21
|
+
client$: GreenSecurityCore,
|
|
22
|
+
request: operations.ExportFacilityVendorsRequest,
|
|
23
|
+
options?: RequestOptions,
|
|
24
|
+
): Promise<void> {
|
|
25
|
+
return queryClient.prefetchQuery({
|
|
26
|
+
...buildOrganizationsExportFacilityVendorsQuery(
|
|
27
|
+
client$,
|
|
28
|
+
request,
|
|
29
|
+
options,
|
|
30
|
+
),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function buildOrganizationsExportFacilityVendorsQuery(
|
|
35
|
+
client$: GreenSecurityCore,
|
|
36
|
+
request: operations.ExportFacilityVendorsRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): {
|
|
39
|
+
queryKey: QueryKey;
|
|
40
|
+
queryFn: (
|
|
41
|
+
context: QueryFunctionContext,
|
|
42
|
+
) => Promise<OrganizationsExportFacilityVendorsQueryData>;
|
|
43
|
+
} {
|
|
44
|
+
return {
|
|
45
|
+
queryKey: queryKeyOrganizationsExportFacilityVendors(request.id, {
|
|
46
|
+
companyId: request.companyId,
|
|
47
|
+
status: request.status,
|
|
48
|
+
search: request.search,
|
|
49
|
+
sort: request.sort,
|
|
50
|
+
desc: request.desc,
|
|
51
|
+
itemsPerPage: request.itemsPerPage,
|
|
52
|
+
}),
|
|
53
|
+
queryFn: async function organizationsExportFacilityVendorsQueryFn(
|
|
54
|
+
ctx,
|
|
55
|
+
): Promise<OrganizationsExportFacilityVendorsQueryData> {
|
|
56
|
+
const sig = combineSignals(
|
|
57
|
+
ctx.signal,
|
|
58
|
+
options?.signal,
|
|
59
|
+
options?.fetchOptions?.signal,
|
|
60
|
+
);
|
|
61
|
+
const mergedOptions = {
|
|
62
|
+
...options?.fetchOptions,
|
|
63
|
+
...options,
|
|
64
|
+
signal: sig,
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
return unwrapAsync(organizationsExportFacilityVendors(
|
|
68
|
+
client$,
|
|
69
|
+
request,
|
|
70
|
+
mergedOptions,
|
|
71
|
+
));
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function queryKeyOrganizationsExportFacilityVendors(
|
|
77
|
+
id: number,
|
|
78
|
+
parameters: {
|
|
79
|
+
companyId?: number | undefined;
|
|
80
|
+
status?: operations.ExportFacilityVendorsQueryParamStatus | undefined;
|
|
81
|
+
search?: string | undefined;
|
|
82
|
+
sort?: operations.ExportFacilityVendorsQueryParamSort | undefined;
|
|
83
|
+
desc?: operations.QueryParamDesc | undefined;
|
|
84
|
+
itemsPerPage?: number | undefined;
|
|
85
|
+
},
|
|
86
|
+
): QueryKey {
|
|
87
|
+
return [
|
|
88
|
+
"@greensecurity/javascript-sdk",
|
|
89
|
+
"organizations",
|
|
90
|
+
"exportFacilityVendors",
|
|
91
|
+
id,
|
|
92
|
+
parameters,
|
|
93
|
+
];
|
|
94
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
InvalidateQueryFilters,
|
|
7
|
+
QueryClient,
|
|
8
|
+
useQuery,
|
|
9
|
+
UseQueryResult,
|
|
10
|
+
useSuspenseQuery,
|
|
11
|
+
UseSuspenseQueryResult,
|
|
12
|
+
} from "@tanstack/react-query";
|
|
13
|
+
import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { useGreenSecurityContext } from "./_context.js";
|
|
26
|
+
import {
|
|
27
|
+
QueryHookOptions,
|
|
28
|
+
SuspenseQueryHookOptions,
|
|
29
|
+
TupleToPrefixes,
|
|
30
|
+
} from "./_types.js";
|
|
31
|
+
import {
|
|
32
|
+
buildOrganizationsExportFacilityVendorsQuery,
|
|
33
|
+
OrganizationsExportFacilityVendorsQueryData,
|
|
34
|
+
prefetchOrganizationsExportFacilityVendors,
|
|
35
|
+
queryKeyOrganizationsExportFacilityVendors,
|
|
36
|
+
} from "./organizationsExportFacilityVendors.core.js";
|
|
37
|
+
export {
|
|
38
|
+
buildOrganizationsExportFacilityVendorsQuery,
|
|
39
|
+
type OrganizationsExportFacilityVendorsQueryData,
|
|
40
|
+
prefetchOrganizationsExportFacilityVendors,
|
|
41
|
+
queryKeyOrganizationsExportFacilityVendors,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type OrganizationsExportFacilityVendorsQueryError =
|
|
45
|
+
| errors.ApiErrorResponse
|
|
46
|
+
| GreenSecurityError
|
|
47
|
+
| ResponseValidationError
|
|
48
|
+
| ConnectionError
|
|
49
|
+
| RequestAbortedError
|
|
50
|
+
| RequestTimeoutError
|
|
51
|
+
| InvalidRequestError
|
|
52
|
+
| UnexpectedClientError
|
|
53
|
+
| SDKValidationError;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Export facility vendors to CSV (async)
|
|
57
|
+
*
|
|
58
|
+
* @remarks
|
|
59
|
+
* Enqueues an asynchronous job to generate a CSV export of the vendors (vendor reps)
|
|
60
|
+
* targeting the given facility, applying the same access scope and filter parameters as
|
|
61
|
+
* the listing endpoint. The CSV contains: Name, Email, one column per company custom field
|
|
62
|
+
* flagged `show_to_vendor` (e.g. Employee ID), Last Visit, and Status.
|
|
63
|
+
*
|
|
64
|
+
* Returns a `status_url` for polling until the export is ready, along with a `download_url`
|
|
65
|
+
* and `status_id`.
|
|
66
|
+
*
|
|
67
|
+
* Access control mirrors the list endpoint:
|
|
68
|
+
* * Regular users — facility must be in the caller's read scope (via
|
|
69
|
+
* `has_facility_access_policy`); company resolved from the session. Out-of-scope or
|
|
70
|
+
* soft-deleted facilities return `404 Facility not found`.
|
|
71
|
+
* * API users — `company_id` required; both the company AND the facility must be
|
|
72
|
+
* activated for the caller's marketplace app via the join-scoped
|
|
73
|
+
* `MarketplaceAppActivation` check.
|
|
74
|
+
*/
|
|
75
|
+
export function useOrganizationsExportFacilityVendors(
|
|
76
|
+
request: operations.ExportFacilityVendorsRequest,
|
|
77
|
+
options?: QueryHookOptions<
|
|
78
|
+
OrganizationsExportFacilityVendorsQueryData,
|
|
79
|
+
OrganizationsExportFacilityVendorsQueryError
|
|
80
|
+
>,
|
|
81
|
+
): UseQueryResult<
|
|
82
|
+
OrganizationsExportFacilityVendorsQueryData,
|
|
83
|
+
OrganizationsExportFacilityVendorsQueryError
|
|
84
|
+
> {
|
|
85
|
+
const client = useGreenSecurityContext();
|
|
86
|
+
return useQuery({
|
|
87
|
+
...buildOrganizationsExportFacilityVendorsQuery(
|
|
88
|
+
client,
|
|
89
|
+
request,
|
|
90
|
+
options,
|
|
91
|
+
),
|
|
92
|
+
...options,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Export facility vendors to CSV (async)
|
|
98
|
+
*
|
|
99
|
+
* @remarks
|
|
100
|
+
* Enqueues an asynchronous job to generate a CSV export of the vendors (vendor reps)
|
|
101
|
+
* targeting the given facility, applying the same access scope and filter parameters as
|
|
102
|
+
* the listing endpoint. The CSV contains: Name, Email, one column per company custom field
|
|
103
|
+
* flagged `show_to_vendor` (e.g. Employee ID), Last Visit, and Status.
|
|
104
|
+
*
|
|
105
|
+
* Returns a `status_url` for polling until the export is ready, along with a `download_url`
|
|
106
|
+
* and `status_id`.
|
|
107
|
+
*
|
|
108
|
+
* Access control mirrors the list endpoint:
|
|
109
|
+
* * Regular users — facility must be in the caller's read scope (via
|
|
110
|
+
* `has_facility_access_policy`); company resolved from the session. Out-of-scope or
|
|
111
|
+
* soft-deleted facilities return `404 Facility not found`.
|
|
112
|
+
* * API users — `company_id` required; both the company AND the facility must be
|
|
113
|
+
* activated for the caller's marketplace app via the join-scoped
|
|
114
|
+
* `MarketplaceAppActivation` check.
|
|
115
|
+
*/
|
|
116
|
+
export function useOrganizationsExportFacilityVendorsSuspense(
|
|
117
|
+
request: operations.ExportFacilityVendorsRequest,
|
|
118
|
+
options?: SuspenseQueryHookOptions<
|
|
119
|
+
OrganizationsExportFacilityVendorsQueryData,
|
|
120
|
+
OrganizationsExportFacilityVendorsQueryError
|
|
121
|
+
>,
|
|
122
|
+
): UseSuspenseQueryResult<
|
|
123
|
+
OrganizationsExportFacilityVendorsQueryData,
|
|
124
|
+
OrganizationsExportFacilityVendorsQueryError
|
|
125
|
+
> {
|
|
126
|
+
const client = useGreenSecurityContext();
|
|
127
|
+
return useSuspenseQuery({
|
|
128
|
+
...buildOrganizationsExportFacilityVendorsQuery(
|
|
129
|
+
client,
|
|
130
|
+
request,
|
|
131
|
+
options,
|
|
132
|
+
),
|
|
133
|
+
...options,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export function setOrganizationsExportFacilityVendorsData(
|
|
138
|
+
client: QueryClient,
|
|
139
|
+
queryKeyBase: [
|
|
140
|
+
id: number,
|
|
141
|
+
parameters: {
|
|
142
|
+
companyId?: number | undefined;
|
|
143
|
+
status?: operations.ExportFacilityVendorsQueryParamStatus | undefined;
|
|
144
|
+
search?: string | undefined;
|
|
145
|
+
sort?: operations.ExportFacilityVendorsQueryParamSort | undefined;
|
|
146
|
+
desc?: operations.QueryParamDesc | undefined;
|
|
147
|
+
itemsPerPage?: number | undefined;
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
data: OrganizationsExportFacilityVendorsQueryData,
|
|
151
|
+
): OrganizationsExportFacilityVendorsQueryData | undefined {
|
|
152
|
+
const key = queryKeyOrganizationsExportFacilityVendors(...queryKeyBase);
|
|
153
|
+
|
|
154
|
+
return client.setQueryData<OrganizationsExportFacilityVendorsQueryData>(
|
|
155
|
+
key,
|
|
156
|
+
data,
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export function invalidateOrganizationsExportFacilityVendors(
|
|
161
|
+
client: QueryClient,
|
|
162
|
+
queryKeyBase: TupleToPrefixes<
|
|
163
|
+
[
|
|
164
|
+
id: number,
|
|
165
|
+
parameters: {
|
|
166
|
+
companyId?: number | undefined;
|
|
167
|
+
status?: operations.ExportFacilityVendorsQueryParamStatus | undefined;
|
|
168
|
+
search?: string | undefined;
|
|
169
|
+
sort?: operations.ExportFacilityVendorsQueryParamSort | undefined;
|
|
170
|
+
desc?: operations.QueryParamDesc | undefined;
|
|
171
|
+
itemsPerPage?: number | undefined;
|
|
172
|
+
},
|
|
173
|
+
]
|
|
174
|
+
>,
|
|
175
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
176
|
+
): Promise<void> {
|
|
177
|
+
return client.invalidateQueries({
|
|
178
|
+
...filters,
|
|
179
|
+
queryKey: [
|
|
180
|
+
"@greensecurity/javascript-sdk",
|
|
181
|
+
"organizations",
|
|
182
|
+
"exportFacilityVendors",
|
|
183
|
+
...queryKeyBase,
|
|
184
|
+
],
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export function invalidateAllOrganizationsExportFacilityVendors(
|
|
189
|
+
client: QueryClient,
|
|
190
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
191
|
+
): Promise<void> {
|
|
192
|
+
return client.invalidateQueries({
|
|
193
|
+
...filters,
|
|
194
|
+
queryKey: [
|
|
195
|
+
"@greensecurity/javascript-sdk",
|
|
196
|
+
"organizations",
|
|
197
|
+
"exportFacilityVendors",
|
|
198
|
+
],
|
|
199
|
+
});
|
|
200
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
QueryClient,
|
|
7
|
+
QueryFunctionContext,
|
|
8
|
+
QueryKey,
|
|
9
|
+
} from "@tanstack/react-query";
|
|
10
|
+
import { GreenSecurityCore } from "../core.js";
|
|
11
|
+
import { organizationsGetFacilityVendorsExportStatus } from "../funcs/organizationsGetFacilityVendorsExportStatus.js";
|
|
12
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
13
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
14
|
+
import * as components from "../models/components/index.js";
|
|
15
|
+
import * as operations from "../models/operations/index.js";
|
|
16
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
17
|
+
export type OrganizationsGetFacilityVendorsExportStatusQueryData =
|
|
18
|
+
components.CsvExportStatusResponse;
|
|
19
|
+
|
|
20
|
+
export function prefetchOrganizationsGetFacilityVendorsExportStatus(
|
|
21
|
+
queryClient: QueryClient,
|
|
22
|
+
client$: GreenSecurityCore,
|
|
23
|
+
request: operations.GetFacilityVendorsExportStatusRequest,
|
|
24
|
+
options?: RequestOptions,
|
|
25
|
+
): Promise<void> {
|
|
26
|
+
return queryClient.prefetchQuery({
|
|
27
|
+
...buildOrganizationsGetFacilityVendorsExportStatusQuery(
|
|
28
|
+
client$,
|
|
29
|
+
request,
|
|
30
|
+
options,
|
|
31
|
+
),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function buildOrganizationsGetFacilityVendorsExportStatusQuery(
|
|
36
|
+
client$: GreenSecurityCore,
|
|
37
|
+
request: operations.GetFacilityVendorsExportStatusRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): {
|
|
40
|
+
queryKey: QueryKey;
|
|
41
|
+
queryFn: (
|
|
42
|
+
context: QueryFunctionContext,
|
|
43
|
+
) => Promise<OrganizationsGetFacilityVendorsExportStatusQueryData>;
|
|
44
|
+
} {
|
|
45
|
+
return {
|
|
46
|
+
queryKey: queryKeyOrganizationsGetFacilityVendorsExportStatus(
|
|
47
|
+
request.id,
|
|
48
|
+
request.exportId,
|
|
49
|
+
),
|
|
50
|
+
queryFn: async function organizationsGetFacilityVendorsExportStatusQueryFn(
|
|
51
|
+
ctx,
|
|
52
|
+
): Promise<OrganizationsGetFacilityVendorsExportStatusQueryData> {
|
|
53
|
+
const sig = combineSignals(
|
|
54
|
+
ctx.signal,
|
|
55
|
+
options?.signal,
|
|
56
|
+
options?.fetchOptions?.signal,
|
|
57
|
+
);
|
|
58
|
+
const mergedOptions = {
|
|
59
|
+
...options?.fetchOptions,
|
|
60
|
+
...options,
|
|
61
|
+
signal: sig,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
return unwrapAsync(organizationsGetFacilityVendorsExportStatus(
|
|
65
|
+
client$,
|
|
66
|
+
request,
|
|
67
|
+
mergedOptions,
|
|
68
|
+
));
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function queryKeyOrganizationsGetFacilityVendorsExportStatus(
|
|
74
|
+
id: number,
|
|
75
|
+
exportId: string,
|
|
76
|
+
): QueryKey {
|
|
77
|
+
return [
|
|
78
|
+
"@greensecurity/javascript-sdk",
|
|
79
|
+
"organizations",
|
|
80
|
+
"getFacilityVendorsExportStatus",
|
|
81
|
+
id,
|
|
82
|
+
exportId,
|
|
83
|
+
];
|
|
84
|
+
}
|