@greensecurity/javascript-sdk 0.44.0-beta.15 → 0.44.0-beta.17
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 +72 -6
- 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 +34 -6
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/funcs/organizationsCreateCompanyTargetFacility.d.ts +34 -0
- package/dist/commonjs/funcs/organizationsCreateCompanyTargetFacility.d.ts.map +1 -0
- package/dist/commonjs/funcs/organizationsCreateCompanyTargetFacility.js +145 -0
- package/dist/commonjs/funcs/organizationsCreateCompanyTargetFacility.js.map +1 -0
- package/dist/commonjs/funcs/organizationsDeleteCompanyTargetFacility.d.ts +28 -0
- package/dist/commonjs/funcs/organizationsDeleteCompanyTargetFacility.d.ts.map +1 -0
- package/dist/commonjs/funcs/organizationsDeleteCompanyTargetFacility.js +138 -0
- package/dist/commonjs/funcs/organizationsDeleteCompanyTargetFacility.js.map +1 -0
- package/dist/commonjs/funcs/organizationsListCompanyTargetFacilities.d.ts +42 -0
- package/dist/commonjs/funcs/organizationsListCompanyTargetFacilities.d.ts.map +1 -0
- package/dist/commonjs/funcs/organizationsListCompanyTargetFacilities.js +194 -0
- package/dist/commonjs/funcs/organizationsListCompanyTargetFacilities.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/models/components/companytargetfacility.d.ts +54 -0
- package/dist/commonjs/models/components/companytargetfacility.d.ts.map +1 -0
- package/dist/commonjs/models/components/companytargetfacility.js +80 -0
- package/dist/commonjs/models/components/companytargetfacility.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/createcompanytargetfacility.d.ts +50 -0
- package/dist/commonjs/models/operations/createcompanytargetfacility.d.ts.map +1 -0
- package/dist/commonjs/models/operations/createcompanytargetfacility.js +84 -0
- package/dist/commonjs/models/operations/createcompanytargetfacility.js.map +1 -0
- package/dist/commonjs/models/operations/deletecompanytargetfacility.d.ts +20 -0
- package/dist/commonjs/models/operations/deletecompanytargetfacility.d.ts.map +1 -0
- package/dist/commonjs/models/operations/deletecompanytargetfacility.js +55 -0
- package/dist/commonjs/models/operations/deletecompanytargetfacility.js.map +1 -0
- package/dist/commonjs/models/operations/exportcompanytargetfacilities.d.ts +16 -16
- package/dist/commonjs/models/operations/exportcompanytargetfacilities.d.ts.map +1 -1
- package/dist/commonjs/models/operations/exportcompanytargetfacilities.js +14 -15
- package/dist/commonjs/models/operations/exportcompanytargetfacilities.js.map +1 -1
- 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/models/operations/listcompanytargetfacilities.d.ts +173 -0
- package/dist/commonjs/models/operations/listcompanytargetfacilities.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listcompanytargetfacilities.js +150 -0
- package/dist/commonjs/models/operations/listcompanytargetfacilities.js.map +1 -0
- package/dist/commonjs/models/operations/listfacilityvendors.d.ts +4 -4
- package/dist/commonjs/models/operations/listfacilityvendors.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listfacilityvendors.js +4 -4
- package/dist/commonjs/models/operations/listfacilityvendors.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/organizationsCreateCompanyTargetFacility.d.ts +43 -0
- package/dist/commonjs/react-query/organizationsCreateCompanyTargetFacility.d.ts.map +1 -0
- package/dist/commonjs/react-query/organizationsCreateCompanyTargetFacility.js +65 -0
- package/dist/commonjs/react-query/organizationsCreateCompanyTargetFacility.js.map +1 -0
- package/dist/commonjs/react-query/organizationsDeleteCompanyTargetFacility.d.ts +37 -0
- package/dist/commonjs/react-query/organizationsDeleteCompanyTargetFacility.d.ts.map +1 -0
- package/dist/commonjs/react-query/organizationsDeleteCompanyTargetFacility.js +59 -0
- package/dist/commonjs/react-query/organizationsDeleteCompanyTargetFacility.js.map +1 -0
- package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.core.d.ts +4 -4
- package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.core.d.ts.map +1 -1
- package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.core.js.map +1 -1
- package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.d.ts +8 -8
- package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.d.ts.map +1 -1
- package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.js.map +1 -1
- package/dist/commonjs/react-query/organizationsListCompanyTargetFacilities.core.d.ts +54 -0
- package/dist/commonjs/react-query/organizationsListCompanyTargetFacilities.core.d.ts.map +1 -0
- package/dist/commonjs/react-query/organizationsListCompanyTargetFacilities.core.js +111 -0
- package/dist/commonjs/react-query/organizationsListCompanyTargetFacilities.core.js.map +1 -0
- package/dist/commonjs/react-query/organizationsListCompanyTargetFacilities.d.ts +154 -0
- package/dist/commonjs/react-query/organizationsListCompanyTargetFacilities.d.ts.map +1 -0
- package/dist/commonjs/react-query/organizationsListCompanyTargetFacilities.js +180 -0
- package/dist/commonjs/react-query/organizationsListCompanyTargetFacilities.js.map +1 -0
- package/dist/commonjs/react-query/organizationsListFacilityVendors.core.d.ts +2 -2
- package/dist/commonjs/react-query/organizationsListFacilityVendors.core.d.ts.map +1 -1
- package/dist/commonjs/react-query/organizationsListFacilityVendors.d.ts +2 -2
- package/dist/commonjs/react-query/organizationsListFacilityVendors.d.ts.map +1 -1
- package/dist/commonjs/sdk/organizations.d.ts +64 -0
- package/dist/commonjs/sdk/organizations.d.ts.map +1 -1
- package/dist/commonjs/sdk/organizations.js +71 -0
- package/dist/commonjs/sdk/organizations.js.map +1 -1
- package/dist/esm/__tests__/organizations.test.js +73 -7
- 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 +34 -6
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/funcs/organizationsCreateCompanyTargetFacility.d.ts +34 -0
- package/dist/esm/funcs/organizationsCreateCompanyTargetFacility.d.ts.map +1 -0
- package/dist/esm/funcs/organizationsCreateCompanyTargetFacility.js +109 -0
- package/dist/esm/funcs/organizationsCreateCompanyTargetFacility.js.map +1 -0
- package/dist/esm/funcs/organizationsDeleteCompanyTargetFacility.d.ts +28 -0
- package/dist/esm/funcs/organizationsDeleteCompanyTargetFacility.d.ts.map +1 -0
- package/dist/esm/funcs/organizationsDeleteCompanyTargetFacility.js +102 -0
- package/dist/esm/funcs/organizationsDeleteCompanyTargetFacility.js.map +1 -0
- package/dist/esm/funcs/organizationsListCompanyTargetFacilities.d.ts +42 -0
- package/dist/esm/funcs/organizationsListCompanyTargetFacilities.d.ts.map +1 -0
- package/dist/esm/funcs/organizationsListCompanyTargetFacilities.js +158 -0
- package/dist/esm/funcs/organizationsListCompanyTargetFacilities.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/models/components/companytargetfacility.d.ts +54 -0
- package/dist/esm/models/components/companytargetfacility.d.ts.map +1 -0
- package/dist/esm/models/components/companytargetfacility.js +41 -0
- package/dist/esm/models/components/companytargetfacility.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/createcompanytargetfacility.d.ts +50 -0
- package/dist/esm/models/operations/createcompanytargetfacility.d.ts.map +1 -0
- package/dist/esm/models/operations/createcompanytargetfacility.js +45 -0
- package/dist/esm/models/operations/createcompanytargetfacility.js.map +1 -0
- package/dist/esm/models/operations/deletecompanytargetfacility.d.ts +20 -0
- package/dist/esm/models/operations/deletecompanytargetfacility.d.ts.map +1 -0
- package/dist/esm/models/operations/deletecompanytargetfacility.js +18 -0
- package/dist/esm/models/operations/deletecompanytargetfacility.js.map +1 -0
- package/dist/esm/models/operations/exportcompanytargetfacilities.d.ts +16 -16
- package/dist/esm/models/operations/exportcompanytargetfacilities.d.ts.map +1 -1
- package/dist/esm/models/operations/exportcompanytargetfacilities.js +13 -14
- package/dist/esm/models/operations/exportcompanytargetfacilities.js.map +1 -1
- 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/models/operations/listcompanytargetfacilities.d.ts +173 -0
- package/dist/esm/models/operations/listcompanytargetfacilities.d.ts.map +1 -0
- package/dist/esm/models/operations/listcompanytargetfacilities.js +111 -0
- package/dist/esm/models/operations/listcompanytargetfacilities.js.map +1 -0
- package/dist/esm/models/operations/listfacilityvendors.d.ts +4 -4
- package/dist/esm/models/operations/listfacilityvendors.d.ts.map +1 -1
- package/dist/esm/models/operations/listfacilityvendors.js +3 -3
- package/dist/esm/models/operations/listfacilityvendors.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/organizationsCreateCompanyTargetFacility.d.ts +43 -0
- package/dist/esm/react-query/organizationsCreateCompanyTargetFacility.d.ts.map +1 -0
- package/dist/esm/react-query/organizationsCreateCompanyTargetFacility.js +60 -0
- package/dist/esm/react-query/organizationsCreateCompanyTargetFacility.js.map +1 -0
- package/dist/esm/react-query/organizationsDeleteCompanyTargetFacility.d.ts +37 -0
- package/dist/esm/react-query/organizationsDeleteCompanyTargetFacility.d.ts.map +1 -0
- package/dist/esm/react-query/organizationsDeleteCompanyTargetFacility.js +54 -0
- package/dist/esm/react-query/organizationsDeleteCompanyTargetFacility.js.map +1 -0
- package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.core.d.ts +4 -4
- package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.core.d.ts.map +1 -1
- package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.core.js.map +1 -1
- package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.d.ts +8 -8
- package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.d.ts.map +1 -1
- package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.js.map +1 -1
- package/dist/esm/react-query/organizationsListCompanyTargetFacilities.core.d.ts +54 -0
- package/dist/esm/react-query/organizationsListCompanyTargetFacilities.core.d.ts.map +1 -0
- package/dist/esm/react-query/organizationsListCompanyTargetFacilities.core.js +103 -0
- package/dist/esm/react-query/organizationsListCompanyTargetFacilities.core.js.map +1 -0
- package/dist/esm/react-query/organizationsListCompanyTargetFacilities.d.ts +154 -0
- package/dist/esm/react-query/organizationsListCompanyTargetFacilities.d.ts.map +1 -0
- package/dist/esm/react-query/organizationsListCompanyTargetFacilities.js +165 -0
- package/dist/esm/react-query/organizationsListCompanyTargetFacilities.js.map +1 -0
- package/dist/esm/react-query/organizationsListFacilityVendors.core.d.ts +2 -2
- package/dist/esm/react-query/organizationsListFacilityVendors.core.d.ts.map +1 -1
- package/dist/esm/react-query/organizationsListFacilityVendors.d.ts +2 -2
- package/dist/esm/react-query/organizationsListFacilityVendors.d.ts.map +1 -1
- package/dist/esm/sdk/organizations.d.ts +64 -0
- package/dist/esm/sdk/organizations.d.ts.map +1 -1
- package/dist/esm/sdk/organizations.js +71 -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 +79 -13
- package/src/__tests__/webhooks.test.ts +1 -1
- package/src/__tests__/zones.test.ts +34 -6
- package/src/funcs/organizationsCreateCompanyTargetFacility.ts +204 -0
- package/src/funcs/organizationsDeleteCompanyTargetFacility.ts +193 -0
- package/src/funcs/organizationsListCompanyTargetFacilities.ts +291 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/companytargetfacility.ts +124 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/operations/createcompanytargetfacility.ts +132 -0
- package/src/models/operations/deletecompanytargetfacility.ts +47 -0
- package/src/models/operations/exportcompanytargetfacilities.ts +34 -31
- package/src/models/operations/index.ts +3 -0
- package/src/models/operations/listcompanytargetfacilities.ts +293 -0
- package/src/models/operations/listfacilityvendors.ts +10 -7
- package/src/react-query/index.ts +3 -0
- package/src/react-query/organizationsCreateCompanyTargetFacility.ts +129 -0
- package/src/react-query/organizationsDeleteCompanyTargetFacility.ts +122 -0
- package/src/react-query/organizationsExportCompanyTargetFacilities.core.ts +4 -6
- package/src/react-query/organizationsExportCompanyTargetFacilities.ts +12 -10
- package/src/react-query/organizationsListCompanyTargetFacilities.core.ts +239 -0
- package/src/react-query/organizationsListCompanyTargetFacilities.ts +369 -0
- package/src/react-query/organizationsListFacilityVendors.core.ts +2 -2
- package/src/react-query/organizationsListFacilityVendors.ts +2 -2
- package/src/sdk/organizations.ts +102 -0
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
InfiniteData,
|
|
7
|
+
InvalidateQueryFilters,
|
|
8
|
+
QueryClient,
|
|
9
|
+
QueryKey,
|
|
10
|
+
useInfiniteQuery,
|
|
11
|
+
UseInfiniteQueryResult,
|
|
12
|
+
useQuery,
|
|
13
|
+
UseQueryResult,
|
|
14
|
+
useSuspenseInfiniteQuery,
|
|
15
|
+
UseSuspenseInfiniteQueryResult,
|
|
16
|
+
useSuspenseQuery,
|
|
17
|
+
UseSuspenseQueryResult,
|
|
18
|
+
} from "@tanstack/react-query";
|
|
19
|
+
import * as components from "../models/components/index.js";
|
|
20
|
+
import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
|
|
21
|
+
import {
|
|
22
|
+
ConnectionError,
|
|
23
|
+
InvalidRequestError,
|
|
24
|
+
RequestAbortedError,
|
|
25
|
+
RequestTimeoutError,
|
|
26
|
+
UnexpectedClientError,
|
|
27
|
+
} from "../models/errors/httpclienterrors.js";
|
|
28
|
+
import * as errors from "../models/errors/index.js";
|
|
29
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
30
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
31
|
+
import * as operations from "../models/operations/index.js";
|
|
32
|
+
import { useGreenSecurityContext } from "./_context.js";
|
|
33
|
+
import {
|
|
34
|
+
InfiniteQueryHookOptions,
|
|
35
|
+
QueryHookOptions,
|
|
36
|
+
SuspenseInfiniteQueryHookOptions,
|
|
37
|
+
SuspenseQueryHookOptions,
|
|
38
|
+
TupleToPrefixes,
|
|
39
|
+
} from "./_types.js";
|
|
40
|
+
import {
|
|
41
|
+
buildOrganizationsListCompanyTargetFacilitiesInfiniteQuery,
|
|
42
|
+
buildOrganizationsListCompanyTargetFacilitiesQuery,
|
|
43
|
+
OrganizationsListCompanyTargetFacilitiesInfiniteQueryData,
|
|
44
|
+
OrganizationsListCompanyTargetFacilitiesPageParams,
|
|
45
|
+
OrganizationsListCompanyTargetFacilitiesQueryData,
|
|
46
|
+
prefetchOrganizationsListCompanyTargetFacilities,
|
|
47
|
+
prefetchOrganizationsListCompanyTargetFacilitiesInfinite,
|
|
48
|
+
queryKeyOrganizationsListCompanyTargetFacilities,
|
|
49
|
+
queryKeyOrganizationsListCompanyTargetFacilitiesInfinite,
|
|
50
|
+
} from "./organizationsListCompanyTargetFacilities.core.js";
|
|
51
|
+
export {
|
|
52
|
+
buildOrganizationsListCompanyTargetFacilitiesInfiniteQuery,
|
|
53
|
+
buildOrganizationsListCompanyTargetFacilitiesQuery,
|
|
54
|
+
type OrganizationsListCompanyTargetFacilitiesInfiniteQueryData,
|
|
55
|
+
type OrganizationsListCompanyTargetFacilitiesPageParams,
|
|
56
|
+
type OrganizationsListCompanyTargetFacilitiesQueryData,
|
|
57
|
+
prefetchOrganizationsListCompanyTargetFacilities,
|
|
58
|
+
prefetchOrganizationsListCompanyTargetFacilitiesInfinite,
|
|
59
|
+
queryKeyOrganizationsListCompanyTargetFacilities,
|
|
60
|
+
queryKeyOrganizationsListCompanyTargetFacilitiesInfinite,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export type OrganizationsListCompanyTargetFacilitiesQueryError =
|
|
64
|
+
| errors.ApiErrorResponse
|
|
65
|
+
| GreenSecurityError
|
|
66
|
+
| ResponseValidationError
|
|
67
|
+
| ConnectionError
|
|
68
|
+
| RequestAbortedError
|
|
69
|
+
| RequestTimeoutError
|
|
70
|
+
| InvalidRequestError
|
|
71
|
+
| UnexpectedClientError
|
|
72
|
+
| SDKValidationError;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* List company target facilities
|
|
76
|
+
*
|
|
77
|
+
* @remarks
|
|
78
|
+
* Lists the CompanyTargetFacility links for a company — the facilities the
|
|
79
|
+
* company is targeting. Each row carries the linked facility (with location
|
|
80
|
+
* and parent system), the link status, and per-facility counts of the
|
|
81
|
+
* company's individuals targeting it.
|
|
82
|
+
*
|
|
83
|
+
* When `include_potential_targets=true`, returns ALL non-deleted facilities
|
|
84
|
+
* via a LEFT JOIN. Targeted rows carry their CTF `id` and `status`; non-targeted
|
|
85
|
+
* rows have `id: null` and `status: "Not Targeted"`.
|
|
86
|
+
*
|
|
87
|
+
* Access control: the URL's `company_id` must be in the caller's read scope
|
|
88
|
+
* for Company (a company manager's or vendor's own company, or a company
|
|
89
|
+
* whose app is activated for the API user). Callers outside that scope
|
|
90
|
+
* receive `404 Company not found`.
|
|
91
|
+
*
|
|
92
|
+
* Filter with `has_individual` / `has_active_individual` to drive the
|
|
93
|
+
* facility roster views.
|
|
94
|
+
*
|
|
95
|
+
* Available `expand` scopes are:
|
|
96
|
+
*
|
|
97
|
+
* - company_target_facility.facility
|
|
98
|
+
*/
|
|
99
|
+
export function useOrganizationsListCompanyTargetFacilities(
|
|
100
|
+
request: operations.ListCompanyTargetFacilitiesRequest,
|
|
101
|
+
options?: QueryHookOptions<
|
|
102
|
+
OrganizationsListCompanyTargetFacilitiesQueryData,
|
|
103
|
+
OrganizationsListCompanyTargetFacilitiesQueryError
|
|
104
|
+
>,
|
|
105
|
+
): UseQueryResult<
|
|
106
|
+
OrganizationsListCompanyTargetFacilitiesQueryData,
|
|
107
|
+
OrganizationsListCompanyTargetFacilitiesQueryError
|
|
108
|
+
> {
|
|
109
|
+
const client = useGreenSecurityContext();
|
|
110
|
+
return useQuery({
|
|
111
|
+
...buildOrganizationsListCompanyTargetFacilitiesQuery(
|
|
112
|
+
client,
|
|
113
|
+
request,
|
|
114
|
+
options,
|
|
115
|
+
),
|
|
116
|
+
...options,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* List company target facilities
|
|
122
|
+
*
|
|
123
|
+
* @remarks
|
|
124
|
+
* Lists the CompanyTargetFacility links for a company — the facilities the
|
|
125
|
+
* company is targeting. Each row carries the linked facility (with location
|
|
126
|
+
* and parent system), the link status, and per-facility counts of the
|
|
127
|
+
* company's individuals targeting it.
|
|
128
|
+
*
|
|
129
|
+
* When `include_potential_targets=true`, returns ALL non-deleted facilities
|
|
130
|
+
* via a LEFT JOIN. Targeted rows carry their CTF `id` and `status`; non-targeted
|
|
131
|
+
* rows have `id: null` and `status: "Not Targeted"`.
|
|
132
|
+
*
|
|
133
|
+
* Access control: the URL's `company_id` must be in the caller's read scope
|
|
134
|
+
* for Company (a company manager's or vendor's own company, or a company
|
|
135
|
+
* whose app is activated for the API user). Callers outside that scope
|
|
136
|
+
* receive `404 Company not found`.
|
|
137
|
+
*
|
|
138
|
+
* Filter with `has_individual` / `has_active_individual` to drive the
|
|
139
|
+
* facility roster views.
|
|
140
|
+
*
|
|
141
|
+
* Available `expand` scopes are:
|
|
142
|
+
*
|
|
143
|
+
* - company_target_facility.facility
|
|
144
|
+
*/
|
|
145
|
+
export function useOrganizationsListCompanyTargetFacilitiesSuspense(
|
|
146
|
+
request: operations.ListCompanyTargetFacilitiesRequest,
|
|
147
|
+
options?: SuspenseQueryHookOptions<
|
|
148
|
+
OrganizationsListCompanyTargetFacilitiesQueryData,
|
|
149
|
+
OrganizationsListCompanyTargetFacilitiesQueryError
|
|
150
|
+
>,
|
|
151
|
+
): UseSuspenseQueryResult<
|
|
152
|
+
OrganizationsListCompanyTargetFacilitiesQueryData,
|
|
153
|
+
OrganizationsListCompanyTargetFacilitiesQueryError
|
|
154
|
+
> {
|
|
155
|
+
const client = useGreenSecurityContext();
|
|
156
|
+
return useSuspenseQuery({
|
|
157
|
+
...buildOrganizationsListCompanyTargetFacilitiesQuery(
|
|
158
|
+
client,
|
|
159
|
+
request,
|
|
160
|
+
options,
|
|
161
|
+
),
|
|
162
|
+
...options,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* List company target facilities
|
|
168
|
+
*
|
|
169
|
+
* @remarks
|
|
170
|
+
* Lists the CompanyTargetFacility links for a company — the facilities the
|
|
171
|
+
* company is targeting. Each row carries the linked facility (with location
|
|
172
|
+
* and parent system), the link status, and per-facility counts of the
|
|
173
|
+
* company's individuals targeting it.
|
|
174
|
+
*
|
|
175
|
+
* When `include_potential_targets=true`, returns ALL non-deleted facilities
|
|
176
|
+
* via a LEFT JOIN. Targeted rows carry their CTF `id` and `status`; non-targeted
|
|
177
|
+
* rows have `id: null` and `status: "Not Targeted"`.
|
|
178
|
+
*
|
|
179
|
+
* Access control: the URL's `company_id` must be in the caller's read scope
|
|
180
|
+
* for Company (a company manager's or vendor's own company, or a company
|
|
181
|
+
* whose app is activated for the API user). Callers outside that scope
|
|
182
|
+
* receive `404 Company not found`.
|
|
183
|
+
*
|
|
184
|
+
* Filter with `has_individual` / `has_active_individual` to drive the
|
|
185
|
+
* facility roster views.
|
|
186
|
+
*
|
|
187
|
+
* Available `expand` scopes are:
|
|
188
|
+
*
|
|
189
|
+
* - company_target_facility.facility
|
|
190
|
+
*/
|
|
191
|
+
export function useOrganizationsListCompanyTargetFacilitiesInfinite(
|
|
192
|
+
request: operations.ListCompanyTargetFacilitiesRequest,
|
|
193
|
+
options?: InfiniteQueryHookOptions<
|
|
194
|
+
OrganizationsListCompanyTargetFacilitiesInfiniteQueryData,
|
|
195
|
+
OrganizationsListCompanyTargetFacilitiesQueryError
|
|
196
|
+
>,
|
|
197
|
+
): UseInfiniteQueryResult<
|
|
198
|
+
InfiniteData<
|
|
199
|
+
OrganizationsListCompanyTargetFacilitiesInfiniteQueryData,
|
|
200
|
+
OrganizationsListCompanyTargetFacilitiesPageParams
|
|
201
|
+
>,
|
|
202
|
+
OrganizationsListCompanyTargetFacilitiesQueryError
|
|
203
|
+
> {
|
|
204
|
+
const client = useGreenSecurityContext();
|
|
205
|
+
return useInfiniteQuery<
|
|
206
|
+
OrganizationsListCompanyTargetFacilitiesInfiniteQueryData,
|
|
207
|
+
OrganizationsListCompanyTargetFacilitiesQueryError,
|
|
208
|
+
InfiniteData<
|
|
209
|
+
OrganizationsListCompanyTargetFacilitiesInfiniteQueryData,
|
|
210
|
+
OrganizationsListCompanyTargetFacilitiesPageParams
|
|
211
|
+
>,
|
|
212
|
+
QueryKey,
|
|
213
|
+
OrganizationsListCompanyTargetFacilitiesPageParams
|
|
214
|
+
>({
|
|
215
|
+
...buildOrganizationsListCompanyTargetFacilitiesInfiniteQuery(
|
|
216
|
+
client,
|
|
217
|
+
request,
|
|
218
|
+
options,
|
|
219
|
+
),
|
|
220
|
+
initialPageParam: options?.initialPageParam,
|
|
221
|
+
getNextPageParam: (previousPage) => previousPage["~next"],
|
|
222
|
+
...options,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* List company target facilities
|
|
228
|
+
*
|
|
229
|
+
* @remarks
|
|
230
|
+
* Lists the CompanyTargetFacility links for a company — the facilities the
|
|
231
|
+
* company is targeting. Each row carries the linked facility (with location
|
|
232
|
+
* and parent system), the link status, and per-facility counts of the
|
|
233
|
+
* company's individuals targeting it.
|
|
234
|
+
*
|
|
235
|
+
* When `include_potential_targets=true`, returns ALL non-deleted facilities
|
|
236
|
+
* via a LEFT JOIN. Targeted rows carry their CTF `id` and `status`; non-targeted
|
|
237
|
+
* rows have `id: null` and `status: "Not Targeted"`.
|
|
238
|
+
*
|
|
239
|
+
* Access control: the URL's `company_id` must be in the caller's read scope
|
|
240
|
+
* for Company (a company manager's or vendor's own company, or a company
|
|
241
|
+
* whose app is activated for the API user). Callers outside that scope
|
|
242
|
+
* receive `404 Company not found`.
|
|
243
|
+
*
|
|
244
|
+
* Filter with `has_individual` / `has_active_individual` to drive the
|
|
245
|
+
* facility roster views.
|
|
246
|
+
*
|
|
247
|
+
* Available `expand` scopes are:
|
|
248
|
+
*
|
|
249
|
+
* - company_target_facility.facility
|
|
250
|
+
*/
|
|
251
|
+
export function useOrganizationsListCompanyTargetFacilitiesInfiniteSuspense(
|
|
252
|
+
request: operations.ListCompanyTargetFacilitiesRequest,
|
|
253
|
+
options?: SuspenseInfiniteQueryHookOptions<
|
|
254
|
+
OrganizationsListCompanyTargetFacilitiesInfiniteQueryData,
|
|
255
|
+
OrganizationsListCompanyTargetFacilitiesQueryError
|
|
256
|
+
>,
|
|
257
|
+
): UseSuspenseInfiniteQueryResult<
|
|
258
|
+
InfiniteData<
|
|
259
|
+
OrganizationsListCompanyTargetFacilitiesInfiniteQueryData,
|
|
260
|
+
OrganizationsListCompanyTargetFacilitiesPageParams
|
|
261
|
+
>,
|
|
262
|
+
OrganizationsListCompanyTargetFacilitiesQueryError
|
|
263
|
+
> {
|
|
264
|
+
const client = useGreenSecurityContext();
|
|
265
|
+
return useSuspenseInfiniteQuery<
|
|
266
|
+
OrganizationsListCompanyTargetFacilitiesInfiniteQueryData,
|
|
267
|
+
OrganizationsListCompanyTargetFacilitiesQueryError,
|
|
268
|
+
InfiniteData<
|
|
269
|
+
OrganizationsListCompanyTargetFacilitiesInfiniteQueryData,
|
|
270
|
+
OrganizationsListCompanyTargetFacilitiesPageParams
|
|
271
|
+
>,
|
|
272
|
+
QueryKey,
|
|
273
|
+
OrganizationsListCompanyTargetFacilitiesPageParams
|
|
274
|
+
>({
|
|
275
|
+
...buildOrganizationsListCompanyTargetFacilitiesInfiniteQuery(
|
|
276
|
+
client,
|
|
277
|
+
request,
|
|
278
|
+
options,
|
|
279
|
+
),
|
|
280
|
+
initialPageParam: options?.initialPageParam,
|
|
281
|
+
getNextPageParam: (previousPage) => previousPage["~next"],
|
|
282
|
+
...options,
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export function setOrganizationsListCompanyTargetFacilitiesData(
|
|
287
|
+
client: QueryClient,
|
|
288
|
+
queryKeyBase: [
|
|
289
|
+
companyId: number,
|
|
290
|
+
parameters: {
|
|
291
|
+
expand?: Array<components.Expand> | undefined;
|
|
292
|
+
status?:
|
|
293
|
+
| operations.ListCompanyTargetFacilitiesQueryParamStatus
|
|
294
|
+
| undefined;
|
|
295
|
+
hasIndividual?: operations.HasIndividual | undefined;
|
|
296
|
+
hasActiveIndividual?: operations.HasActiveIndividual | undefined;
|
|
297
|
+
includePotentialTargets?: operations.IncludePotentialTargets | undefined;
|
|
298
|
+
facilityNameLike?: string | undefined;
|
|
299
|
+
cityLike?: string | undefined;
|
|
300
|
+
addressLike?: string | undefined;
|
|
301
|
+
systemNameLike?: string | undefined;
|
|
302
|
+
sort?: operations.QueryParamSort | undefined;
|
|
303
|
+
desc?: components.Desc | undefined;
|
|
304
|
+
page?: number | undefined;
|
|
305
|
+
itemsPerPage?: number | undefined;
|
|
306
|
+
},
|
|
307
|
+
],
|
|
308
|
+
data: OrganizationsListCompanyTargetFacilitiesQueryData,
|
|
309
|
+
): OrganizationsListCompanyTargetFacilitiesQueryData | undefined {
|
|
310
|
+
const key = queryKeyOrganizationsListCompanyTargetFacilities(...queryKeyBase);
|
|
311
|
+
|
|
312
|
+
return client.setQueryData<OrganizationsListCompanyTargetFacilitiesQueryData>(
|
|
313
|
+
key,
|
|
314
|
+
data,
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export function invalidateOrganizationsListCompanyTargetFacilities(
|
|
319
|
+
client: QueryClient,
|
|
320
|
+
queryKeyBase: TupleToPrefixes<
|
|
321
|
+
[
|
|
322
|
+
companyId: number,
|
|
323
|
+
parameters: {
|
|
324
|
+
expand?: Array<components.Expand> | undefined;
|
|
325
|
+
status?:
|
|
326
|
+
| operations.ListCompanyTargetFacilitiesQueryParamStatus
|
|
327
|
+
| undefined;
|
|
328
|
+
hasIndividual?: operations.HasIndividual | undefined;
|
|
329
|
+
hasActiveIndividual?: operations.HasActiveIndividual | undefined;
|
|
330
|
+
includePotentialTargets?:
|
|
331
|
+
| operations.IncludePotentialTargets
|
|
332
|
+
| undefined;
|
|
333
|
+
facilityNameLike?: string | undefined;
|
|
334
|
+
cityLike?: string | undefined;
|
|
335
|
+
addressLike?: string | undefined;
|
|
336
|
+
systemNameLike?: string | undefined;
|
|
337
|
+
sort?: operations.QueryParamSort | undefined;
|
|
338
|
+
desc?: components.Desc | undefined;
|
|
339
|
+
page?: number | undefined;
|
|
340
|
+
itemsPerPage?: number | undefined;
|
|
341
|
+
},
|
|
342
|
+
]
|
|
343
|
+
>,
|
|
344
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
345
|
+
): Promise<void> {
|
|
346
|
+
return client.invalidateQueries({
|
|
347
|
+
...filters,
|
|
348
|
+
queryKey: [
|
|
349
|
+
"@greensecurity/javascript-sdk",
|
|
350
|
+
"organizations",
|
|
351
|
+
"listCompanyTargetFacilities",
|
|
352
|
+
...queryKeyBase,
|
|
353
|
+
],
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export function invalidateAllOrganizationsListCompanyTargetFacilities(
|
|
358
|
+
client: QueryClient,
|
|
359
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
360
|
+
): Promise<void> {
|
|
361
|
+
return client.invalidateQueries({
|
|
362
|
+
...filters,
|
|
363
|
+
queryKey: [
|
|
364
|
+
"@greensecurity/javascript-sdk",
|
|
365
|
+
"organizations",
|
|
366
|
+
"listCompanyTargetFacilities",
|
|
367
|
+
],
|
|
368
|
+
});
|
|
369
|
+
}
|
|
@@ -167,7 +167,7 @@ export function queryKeyOrganizationsListFacilityVendors(
|
|
|
167
167
|
id: number,
|
|
168
168
|
parameters: {
|
|
169
169
|
companyId?: number | undefined;
|
|
170
|
-
status?: operations.
|
|
170
|
+
status?: operations.ListFacilityVendorsQueryParamStatus | undefined;
|
|
171
171
|
search?: string | undefined;
|
|
172
172
|
page?: number | undefined;
|
|
173
173
|
itemsPerPage?: number | undefined;
|
|
@@ -188,7 +188,7 @@ export function queryKeyOrganizationsListFacilityVendorsInfinite(
|
|
|
188
188
|
id: number,
|
|
189
189
|
parameters: {
|
|
190
190
|
companyId?: number | undefined;
|
|
191
|
-
status?: operations.
|
|
191
|
+
status?: operations.ListFacilityVendorsQueryParamStatus | undefined;
|
|
192
192
|
search?: string | undefined;
|
|
193
193
|
page?: number | undefined;
|
|
194
194
|
itemsPerPage?: number | undefined;
|
|
@@ -289,7 +289,7 @@ export function setOrganizationsListFacilityVendorsData(
|
|
|
289
289
|
id: number,
|
|
290
290
|
parameters: {
|
|
291
291
|
companyId?: number | undefined;
|
|
292
|
-
status?: operations.
|
|
292
|
+
status?: operations.ListFacilityVendorsQueryParamStatus | undefined;
|
|
293
293
|
search?: string | undefined;
|
|
294
294
|
page?: number | undefined;
|
|
295
295
|
itemsPerPage?: number | undefined;
|
|
@@ -314,7 +314,7 @@ export function invalidateOrganizationsListFacilityVendors(
|
|
|
314
314
|
id: number,
|
|
315
315
|
parameters: {
|
|
316
316
|
companyId?: number | undefined;
|
|
317
|
-
status?: operations.
|
|
317
|
+
status?: operations.ListFacilityVendorsQueryParamStatus | undefined;
|
|
318
318
|
search?: string | undefined;
|
|
319
319
|
page?: number | undefined;
|
|
320
320
|
itemsPerPage?: number | undefined;
|
package/src/sdk/organizations.ts
CHANGED
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import { organizationsCreateCompanyTargetFacility } from "../funcs/organizationsCreateCompanyTargetFacility.js";
|
|
6
|
+
import { organizationsDeleteCompanyTargetFacility } from "../funcs/organizationsDeleteCompanyTargetFacility.js";
|
|
5
7
|
import { organizationsDownloadCompanyTargetFacilitiesExport } from "../funcs/organizationsDownloadCompanyTargetFacilitiesExport.js";
|
|
6
8
|
import { organizationsExportCompanyTargetFacilities } from "../funcs/organizationsExportCompanyTargetFacilities.js";
|
|
7
9
|
import { organizationsGetCompanyTargetFacilitiesExportStatus } from "../funcs/organizationsGetCompanyTargetFacilitiesExportStatus.js";
|
|
8
10
|
import { organizationsGetFacility } from "../funcs/organizationsGetFacility.js";
|
|
11
|
+
import { organizationsListCompanyTargetFacilities } from "../funcs/organizationsListCompanyTargetFacilities.js";
|
|
9
12
|
import { organizationsListFacilityVendors } from "../funcs/organizationsListFacilityVendors.js";
|
|
10
13
|
import { organizationsListOrSearchDepartmentContacts } from "../funcs/organizationsListOrSearchDepartmentContacts.js";
|
|
11
14
|
import { organizationsListOrSearchDepartments } from "../funcs/organizationsListOrSearchDepartments.js";
|
|
@@ -85,6 +88,105 @@ export class Organizations extends ClientSDK {
|
|
|
85
88
|
));
|
|
86
89
|
}
|
|
87
90
|
|
|
91
|
+
/**
|
|
92
|
+
* List company target facilities
|
|
93
|
+
*
|
|
94
|
+
* @remarks
|
|
95
|
+
* Lists the CompanyTargetFacility links for a company — the facilities the
|
|
96
|
+
* company is targeting. Each row carries the linked facility (with location
|
|
97
|
+
* and parent system), the link status, and per-facility counts of the
|
|
98
|
+
* company's individuals targeting it.
|
|
99
|
+
*
|
|
100
|
+
* When `include_potential_targets=true`, returns ALL non-deleted facilities
|
|
101
|
+
* via a LEFT JOIN. Targeted rows carry their CTF `id` and `status`; non-targeted
|
|
102
|
+
* rows have `id: null` and `status: "Not Targeted"`.
|
|
103
|
+
*
|
|
104
|
+
* Access control: the URL's `company_id` must be in the caller's read scope
|
|
105
|
+
* for Company (a company manager's or vendor's own company, or a company
|
|
106
|
+
* whose app is activated for the API user). Callers outside that scope
|
|
107
|
+
* receive `404 Company not found`.
|
|
108
|
+
*
|
|
109
|
+
* Filter with `has_individual` / `has_active_individual` to drive the
|
|
110
|
+
* facility roster views.
|
|
111
|
+
*
|
|
112
|
+
* Available `expand` scopes are:
|
|
113
|
+
*
|
|
114
|
+
* - company_target_facility.facility
|
|
115
|
+
*/
|
|
116
|
+
async listCompanyTargetFacilities(
|
|
117
|
+
request: operations.ListCompanyTargetFacilitiesRequest,
|
|
118
|
+
options?: RequestOptions,
|
|
119
|
+
): Promise<
|
|
120
|
+
PageIterator<
|
|
121
|
+
operations.ListCompanyTargetFacilitiesResponse,
|
|
122
|
+
{ page: number }
|
|
123
|
+
>
|
|
124
|
+
> {
|
|
125
|
+
return unwrapResultIterator(organizationsListCompanyTargetFacilities(
|
|
126
|
+
this,
|
|
127
|
+
request,
|
|
128
|
+
options,
|
|
129
|
+
));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Add a company target facility
|
|
134
|
+
*
|
|
135
|
+
* @remarks
|
|
136
|
+
* Links the URL's company to an existing facility. The link is created with
|
|
137
|
+
* status `Pending`. Only the link row is created — the Facility entity
|
|
138
|
+
* itself is never created or modified by this endpoint.
|
|
139
|
+
*
|
|
140
|
+
* Access control: the URL's `company_id` must be in the caller's update
|
|
141
|
+
* scope for Company, AND the `facility_id` must be in the caller's create
|
|
142
|
+
* scope for Facility (a facility on the company's site, or a facility
|
|
143
|
+
* reachable via the API user's site/system/facility-scoped activation).
|
|
144
|
+
* Either being out of scope returns `404 Company not found` /
|
|
145
|
+
* `404 Facility not found` respectively. Deleted facilities also return
|
|
146
|
+
* `404 Facility not found`.
|
|
147
|
+
*
|
|
148
|
+
* Available `expand` scopes are:
|
|
149
|
+
*
|
|
150
|
+
* - company_target_facility.facility
|
|
151
|
+
*/
|
|
152
|
+
async createCompanyTargetFacility(
|
|
153
|
+
request: operations.CreateCompanyTargetFacilityRequest,
|
|
154
|
+
options?: RequestOptions,
|
|
155
|
+
): Promise<
|
|
156
|
+
operations.CreateCompanyTargetFacilityCreateCompanyTargetFacilityOk
|
|
157
|
+
> {
|
|
158
|
+
return unwrapAsync(organizationsCreateCompanyTargetFacility(
|
|
159
|
+
this,
|
|
160
|
+
request,
|
|
161
|
+
options,
|
|
162
|
+
));
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Remove a company target facility
|
|
167
|
+
*
|
|
168
|
+
* @remarks
|
|
169
|
+
* Removes a CompanyTargetFacility link. Blocked when any of the company's
|
|
170
|
+
* individuals still target the same facility (to avoid orphaning their
|
|
171
|
+
* vendor-scoped target rows). Only the link row is removed — the Facility
|
|
172
|
+
* entity itself is never touched.
|
|
173
|
+
*
|
|
174
|
+
* Access control: the URL's `company_id` must be in the caller's update
|
|
175
|
+
* scope for Company (a company manager's or vendor's own company, or a
|
|
176
|
+
* company whose app is activated for the API user). Callers outside that
|
|
177
|
+
* scope receive `404 Company not found`.
|
|
178
|
+
*/
|
|
179
|
+
async deleteCompanyTargetFacility(
|
|
180
|
+
request: operations.DeleteCompanyTargetFacilityRequest,
|
|
181
|
+
options?: RequestOptions,
|
|
182
|
+
): Promise<boolean> {
|
|
183
|
+
return unwrapAsync(organizationsDeleteCompanyTargetFacility(
|
|
184
|
+
this,
|
|
185
|
+
request,
|
|
186
|
+
options,
|
|
187
|
+
));
|
|
188
|
+
}
|
|
189
|
+
|
|
88
190
|
/**
|
|
89
191
|
* Export company target facilities to CSV (async)
|
|
90
192
|
*
|