@greensecurity/javascript-sdk 0.44.0-beta.15 → 0.44.0-beta.16
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 +4 -31
- 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 +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- 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 +4 -31
- 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 +2 -2
- package/dist/esm/lib/config.js +2 -2
- 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 +4 -31
- 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 +2 -2
- 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
|
@@ -14,7 +14,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
14
14
|
/**
|
|
15
15
|
* Filter by link status.
|
|
16
16
|
*/
|
|
17
|
-
export const
|
|
17
|
+
export const QueryParamStatus = {
|
|
18
18
|
Pending: "pending",
|
|
19
19
|
Approved: "approved",
|
|
20
20
|
Denied: "denied",
|
|
@@ -22,38 +22,40 @@ export const ExportCompanyTargetFacilitiesQueryParamStatus = {
|
|
|
22
22
|
/**
|
|
23
23
|
* Filter by link status.
|
|
24
24
|
*/
|
|
25
|
-
export type
|
|
26
|
-
typeof ExportCompanyTargetFacilitiesQueryParamStatus
|
|
27
|
-
>;
|
|
25
|
+
export type QueryParamStatus = ClosedEnum<typeof QueryParamStatus>;
|
|
28
26
|
|
|
29
27
|
/**
|
|
30
28
|
* `true` returns only facilities the company has at least one individual targeting; `false` returns only those with none.
|
|
31
29
|
*/
|
|
32
|
-
export const
|
|
30
|
+
export const QueryParamHasIndividual = {
|
|
33
31
|
True: "true",
|
|
34
32
|
False: "false",
|
|
35
33
|
} as const;
|
|
36
34
|
/**
|
|
37
35
|
* `true` returns only facilities the company has at least one individual targeting; `false` returns only those with none.
|
|
38
36
|
*/
|
|
39
|
-
export type
|
|
37
|
+
export type QueryParamHasIndividual = ClosedEnum<
|
|
38
|
+
typeof QueryParamHasIndividual
|
|
39
|
+
>;
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* `true` returns only facilities the company has at least one *active* individual targeting (active = vendor's credentialing subscription is active); `false` returns only those with none.
|
|
43
43
|
*/
|
|
44
|
-
export const
|
|
44
|
+
export const QueryParamHasActiveIndividual = {
|
|
45
45
|
True: "true",
|
|
46
46
|
False: "false",
|
|
47
47
|
} as const;
|
|
48
48
|
/**
|
|
49
49
|
* `true` returns only facilities the company has at least one *active* individual targeting (active = vendor's credentialing subscription is active); `false` returns only those with none.
|
|
50
50
|
*/
|
|
51
|
-
export type
|
|
51
|
+
export type QueryParamHasActiveIndividual = ClosedEnum<
|
|
52
|
+
typeof QueryParamHasActiveIndividual
|
|
53
|
+
>;
|
|
52
54
|
|
|
53
55
|
/**
|
|
54
56
|
* Sort field used by the exporter when ordering rows in the CSV. Defaults to `facility_name`.
|
|
55
57
|
*/
|
|
56
|
-
export const
|
|
58
|
+
export const ExportCompanyTargetFacilitiesQueryParamSort = {
|
|
57
59
|
Id: "id",
|
|
58
60
|
FacilityName: "facility_name",
|
|
59
61
|
Status: "status",
|
|
@@ -62,7 +64,9 @@ export const QueryParamSort = {
|
|
|
62
64
|
/**
|
|
63
65
|
* Sort field used by the exporter when ordering rows in the CSV. Defaults to `facility_name`.
|
|
64
66
|
*/
|
|
65
|
-
export type
|
|
67
|
+
export type ExportCompanyTargetFacilitiesQueryParamSort = ClosedEnum<
|
|
68
|
+
typeof ExportCompanyTargetFacilitiesQueryParamSort
|
|
69
|
+
>;
|
|
66
70
|
|
|
67
71
|
export const Two = {
|
|
68
72
|
Zero: 0,
|
|
@@ -83,15 +87,15 @@ export type ExportCompanyTargetFacilitiesRequest = {
|
|
|
83
87
|
/**
|
|
84
88
|
* Filter by link status.
|
|
85
89
|
*/
|
|
86
|
-
status?:
|
|
90
|
+
status?: QueryParamStatus | undefined;
|
|
87
91
|
/**
|
|
88
92
|
* `true` returns only facilities the company has at least one individual targeting; `false` returns only those with none.
|
|
89
93
|
*/
|
|
90
|
-
hasIndividual?:
|
|
94
|
+
hasIndividual?: QueryParamHasIndividual | undefined;
|
|
91
95
|
/**
|
|
92
96
|
* `true` returns only facilities the company has at least one *active* individual targeting (active = vendor's credentialing subscription is active); `false` returns only those with none.
|
|
93
97
|
*/
|
|
94
|
-
hasActiveIndividual?:
|
|
98
|
+
hasActiveIndividual?: QueryParamHasActiveIndividual | undefined;
|
|
95
99
|
/**
|
|
96
100
|
* Case-insensitive partial match on facility name.
|
|
97
101
|
*/
|
|
@@ -99,7 +103,7 @@ export type ExportCompanyTargetFacilitiesRequest = {
|
|
|
99
103
|
/**
|
|
100
104
|
* Sort field used by the exporter when ordering rows in the CSV. Defaults to `facility_name`.
|
|
101
105
|
*/
|
|
102
|
-
sort?:
|
|
106
|
+
sort?: ExportCompanyTargetFacilitiesQueryParamSort | undefined;
|
|
103
107
|
/**
|
|
104
108
|
* Sort descending flag.
|
|
105
109
|
*/
|
|
@@ -129,24 +133,24 @@ export type ExportCompanyTargetFacilitiesResponseBody = {
|
|
|
129
133
|
};
|
|
130
134
|
|
|
131
135
|
/** @internal */
|
|
132
|
-
export const
|
|
133
|
-
|
|
134
|
-
|
|
136
|
+
export const QueryParamStatus$outboundSchema: z.ZodNativeEnum<
|
|
137
|
+
typeof QueryParamStatus
|
|
138
|
+
> = z.nativeEnum(QueryParamStatus);
|
|
135
139
|
|
|
136
140
|
/** @internal */
|
|
137
|
-
export const
|
|
138
|
-
typeof
|
|
139
|
-
> = z.nativeEnum(
|
|
141
|
+
export const QueryParamHasIndividual$outboundSchema: z.ZodNativeEnum<
|
|
142
|
+
typeof QueryParamHasIndividual
|
|
143
|
+
> = z.nativeEnum(QueryParamHasIndividual);
|
|
140
144
|
|
|
141
145
|
/** @internal */
|
|
142
|
-
export const
|
|
143
|
-
typeof
|
|
144
|
-
> = z.nativeEnum(
|
|
146
|
+
export const QueryParamHasActiveIndividual$outboundSchema: z.ZodNativeEnum<
|
|
147
|
+
typeof QueryParamHasActiveIndividual
|
|
148
|
+
> = z.nativeEnum(QueryParamHasActiveIndividual);
|
|
145
149
|
|
|
146
150
|
/** @internal */
|
|
147
|
-
export const
|
|
148
|
-
typeof
|
|
149
|
-
|
|
151
|
+
export const ExportCompanyTargetFacilitiesQueryParamSort$outboundSchema:
|
|
152
|
+
z.ZodNativeEnum<typeof ExportCompanyTargetFacilitiesQueryParamSort> = z
|
|
153
|
+
.nativeEnum(ExportCompanyTargetFacilitiesQueryParamSort);
|
|
150
154
|
|
|
151
155
|
/** @internal */
|
|
152
156
|
export const Two$outboundSchema: z.ZodNativeEnum<typeof Two> = z.nativeEnum(
|
|
@@ -183,12 +187,11 @@ export const ExportCompanyTargetFacilitiesRequest$outboundSchema: z.ZodType<
|
|
|
183
187
|
ExportCompanyTargetFacilitiesRequest
|
|
184
188
|
> = z.object({
|
|
185
189
|
companyId: z.number().int(),
|
|
186
|
-
status:
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
hasActiveIndividual: HasActiveIndividual$outboundSchema.optional(),
|
|
190
|
+
status: QueryParamStatus$outboundSchema.optional(),
|
|
191
|
+
hasIndividual: QueryParamHasIndividual$outboundSchema.optional(),
|
|
192
|
+
hasActiveIndividual: QueryParamHasActiveIndividual$outboundSchema.optional(),
|
|
190
193
|
facilityNameLike: z.string().optional(),
|
|
191
|
-
sort:
|
|
194
|
+
sort: ExportCompanyTargetFacilitiesQueryParamSort$outboundSchema.optional(),
|
|
192
195
|
desc: smartUnion([z.boolean(), Two$outboundSchema]).optional(),
|
|
193
196
|
itemsPerPage: z.number().int().optional(),
|
|
194
197
|
}).transform((v) => {
|
|
@@ -15,6 +15,7 @@ export * from "./cancelhandoff.js";
|
|
|
15
15
|
export * from "./changepassword.js";
|
|
16
16
|
export * from "./changesubscription.js";
|
|
17
17
|
export * from "./checkdownloadcode.js";
|
|
18
|
+
export * from "./createcompanytargetfacility.js";
|
|
18
19
|
export * from "./createevent.js";
|
|
19
20
|
export * from "./createinvoice.js";
|
|
20
21
|
export * from "./createnewvendorcredentialversion.js";
|
|
@@ -25,6 +26,7 @@ export * from "./createvendorfield.js";
|
|
|
25
26
|
export * from "./createvendorregistration.js";
|
|
26
27
|
export * from "./declineinvitation.js";
|
|
27
28
|
export * from "./declinevendorcredential.js";
|
|
29
|
+
export * from "./deletecompanytargetfacility.js";
|
|
28
30
|
export * from "./deletedatarequestfile.js";
|
|
29
31
|
export * from "./deleteevent.js";
|
|
30
32
|
export * from "./deletefhirconfigbyid.js";
|
|
@@ -70,6 +72,7 @@ export * from "./listallwebhookendpoints.js";
|
|
|
70
72
|
export * from "./listcompanycredentials.js";
|
|
71
73
|
export * from "./listcompanycredits.js";
|
|
72
74
|
export * from "./listcompanymanagers.js";
|
|
75
|
+
export * from "./listcompanytargetfacilities.js";
|
|
73
76
|
export * from "./listfacilityvendors.js";
|
|
74
77
|
export * from "./listfeed.js";
|
|
75
78
|
export * from "./listinvoices.js";
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import * as components from "../components/index.js";
|
|
11
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Filter by link status.
|
|
15
|
+
*/
|
|
16
|
+
export const ListCompanyTargetFacilitiesQueryParamStatus = {
|
|
17
|
+
Pending: "pending",
|
|
18
|
+
Approved: "approved",
|
|
19
|
+
Denied: "denied",
|
|
20
|
+
} as const;
|
|
21
|
+
/**
|
|
22
|
+
* Filter by link status.
|
|
23
|
+
*/
|
|
24
|
+
export type ListCompanyTargetFacilitiesQueryParamStatus = ClosedEnum<
|
|
25
|
+
typeof ListCompanyTargetFacilitiesQueryParamStatus
|
|
26
|
+
>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* `true` returns only facilities the company has at least one individual targeting; `false` returns only those with none.
|
|
30
|
+
*/
|
|
31
|
+
export const HasIndividual = {
|
|
32
|
+
True: "true",
|
|
33
|
+
False: "false",
|
|
34
|
+
} as const;
|
|
35
|
+
/**
|
|
36
|
+
* `true` returns only facilities the company has at least one individual targeting; `false` returns only those with none.
|
|
37
|
+
*/
|
|
38
|
+
export type HasIndividual = ClosedEnum<typeof HasIndividual>;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Like `has_individual`, but only counts individuals whose credentialing subscription is active.
|
|
42
|
+
*/
|
|
43
|
+
export const HasActiveIndividual = {
|
|
44
|
+
True: "true",
|
|
45
|
+
False: "false",
|
|
46
|
+
} as const;
|
|
47
|
+
/**
|
|
48
|
+
* Like `has_individual`, but only counts individuals whose credentialing subscription is active.
|
|
49
|
+
*/
|
|
50
|
+
export type HasActiveIndividual = ClosedEnum<typeof HasActiveIndividual>;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* When `true`, returns ALL non-deleted facilities via LEFT JOIN. Targeted rows carry their CTF id and status; non-targeted rows have `id: null` and `status: "Not Targeted"`.
|
|
54
|
+
*/
|
|
55
|
+
export const IncludePotentialTargets = {
|
|
56
|
+
True: "true",
|
|
57
|
+
False: "false",
|
|
58
|
+
} as const;
|
|
59
|
+
/**
|
|
60
|
+
* When `true`, returns ALL non-deleted facilities via LEFT JOIN. Targeted rows carry their CTF id and status; non-targeted rows have `id: null` and `status: "Not Targeted"`.
|
|
61
|
+
*/
|
|
62
|
+
export type IncludePotentialTargets = ClosedEnum<
|
|
63
|
+
typeof IncludePotentialTargets
|
|
64
|
+
>;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Sort field (defaults to `facility_name`). When `include_potential_targets=true`, only `facility_name`, `system_name`, `city`, and `status` are applicable.
|
|
68
|
+
*/
|
|
69
|
+
export const QueryParamSort = {
|
|
70
|
+
Id: "id",
|
|
71
|
+
FacilityName: "facility_name",
|
|
72
|
+
SystemName: "system_name",
|
|
73
|
+
Status: "status",
|
|
74
|
+
DateCreated: "date_created",
|
|
75
|
+
City: "city",
|
|
76
|
+
} as const;
|
|
77
|
+
/**
|
|
78
|
+
* Sort field (defaults to `facility_name`). When `include_potential_targets=true`, only `facility_name`, `system_name`, `city`, and `status` are applicable.
|
|
79
|
+
*/
|
|
80
|
+
export type QueryParamSort = ClosedEnum<typeof QueryParamSort>;
|
|
81
|
+
|
|
82
|
+
export type ListCompanyTargetFacilitiesRequest = {
|
|
83
|
+
/**
|
|
84
|
+
* The company whose target facilities to list.
|
|
85
|
+
*/
|
|
86
|
+
companyId: number;
|
|
87
|
+
/**
|
|
88
|
+
* An array-style parameter to identify which sections of an object to expand. See documentation for the endpoint for a list of valid expansion values.
|
|
89
|
+
*/
|
|
90
|
+
expand?: Array<components.Expand> | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Filter by link status.
|
|
93
|
+
*/
|
|
94
|
+
status?: ListCompanyTargetFacilitiesQueryParamStatus | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* `true` returns only facilities the company has at least one individual targeting; `false` returns only those with none.
|
|
97
|
+
*/
|
|
98
|
+
hasIndividual?: HasIndividual | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* Like `has_individual`, but only counts individuals whose credentialing subscription is active.
|
|
101
|
+
*/
|
|
102
|
+
hasActiveIndividual?: HasActiveIndividual | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* When `true`, returns ALL non-deleted facilities via LEFT JOIN. Targeted rows carry their CTF id and status; non-targeted rows have `id: null` and `status: "Not Targeted"`.
|
|
105
|
+
*/
|
|
106
|
+
includePotentialTargets?: IncludePotentialTargets | undefined;
|
|
107
|
+
/**
|
|
108
|
+
* Case-insensitive partial match on facility name.
|
|
109
|
+
*/
|
|
110
|
+
facilityNameLike?: string | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* Case-insensitive partial match on facility city.
|
|
113
|
+
*/
|
|
114
|
+
cityLike?: string | undefined;
|
|
115
|
+
/**
|
|
116
|
+
* Case-insensitive partial match on facility street address.
|
|
117
|
+
*/
|
|
118
|
+
addressLike?: string | undefined;
|
|
119
|
+
/**
|
|
120
|
+
* Case-insensitive partial match on the facility's parent system name.
|
|
121
|
+
*/
|
|
122
|
+
systemNameLike?: string | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* Sort field (defaults to `facility_name`). When `include_potential_targets=true`, only `facility_name`, `system_name`, `city`, and `status` are applicable.
|
|
125
|
+
*/
|
|
126
|
+
sort?: QueryParamSort | undefined;
|
|
127
|
+
/**
|
|
128
|
+
* Sort desc
|
|
129
|
+
*/
|
|
130
|
+
desc?: components.Desc | undefined;
|
|
131
|
+
/**
|
|
132
|
+
* A 1-based offset for which page to request (defaults to 1)
|
|
133
|
+
*/
|
|
134
|
+
page?: number | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* Number of items to show in a given page
|
|
137
|
+
*/
|
|
138
|
+
itemsPerPage?: number | undefined;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* The request was successful, and the server has returned the requested resource in the response body.
|
|
143
|
+
*/
|
|
144
|
+
export type ListCompanyTargetFacilitiesListCompanyTargetFacilitiesOk = {
|
|
145
|
+
/**
|
|
146
|
+
* Pagination information for a pageable list
|
|
147
|
+
*/
|
|
148
|
+
pager: components.Pager;
|
|
149
|
+
items: Array<components.CompanyTargetFacility>;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export type ListCompanyTargetFacilitiesResponse = {
|
|
153
|
+
result: ListCompanyTargetFacilitiesListCompanyTargetFacilitiesOk;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
/** @internal */
|
|
157
|
+
export const ListCompanyTargetFacilitiesQueryParamStatus$outboundSchema:
|
|
158
|
+
z.ZodNativeEnum<typeof ListCompanyTargetFacilitiesQueryParamStatus> = z
|
|
159
|
+
.nativeEnum(ListCompanyTargetFacilitiesQueryParamStatus);
|
|
160
|
+
|
|
161
|
+
/** @internal */
|
|
162
|
+
export const HasIndividual$outboundSchema: z.ZodNativeEnum<
|
|
163
|
+
typeof HasIndividual
|
|
164
|
+
> = z.nativeEnum(HasIndividual);
|
|
165
|
+
|
|
166
|
+
/** @internal */
|
|
167
|
+
export const HasActiveIndividual$outboundSchema: z.ZodNativeEnum<
|
|
168
|
+
typeof HasActiveIndividual
|
|
169
|
+
> = z.nativeEnum(HasActiveIndividual);
|
|
170
|
+
|
|
171
|
+
/** @internal */
|
|
172
|
+
export const IncludePotentialTargets$outboundSchema: z.ZodNativeEnum<
|
|
173
|
+
typeof IncludePotentialTargets
|
|
174
|
+
> = z.nativeEnum(IncludePotentialTargets);
|
|
175
|
+
|
|
176
|
+
/** @internal */
|
|
177
|
+
export const QueryParamSort$outboundSchema: z.ZodNativeEnum<
|
|
178
|
+
typeof QueryParamSort
|
|
179
|
+
> = z.nativeEnum(QueryParamSort);
|
|
180
|
+
|
|
181
|
+
/** @internal */
|
|
182
|
+
export type ListCompanyTargetFacilitiesRequest$Outbound = {
|
|
183
|
+
company_id: number;
|
|
184
|
+
expand?: Array<string> | undefined;
|
|
185
|
+
status?: string | undefined;
|
|
186
|
+
has_individual?: string | undefined;
|
|
187
|
+
has_active_individual?: string | undefined;
|
|
188
|
+
include_potential_targets?: string | undefined;
|
|
189
|
+
facility_name_like?: string | undefined;
|
|
190
|
+
city_like?: string | undefined;
|
|
191
|
+
address_like?: string | undefined;
|
|
192
|
+
system_name_like?: string | undefined;
|
|
193
|
+
sort?: string | undefined;
|
|
194
|
+
desc?: components.Desc$Outbound | undefined;
|
|
195
|
+
page?: number | undefined;
|
|
196
|
+
items_per_page?: number | undefined;
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
/** @internal */
|
|
200
|
+
export const ListCompanyTargetFacilitiesRequest$outboundSchema: z.ZodType<
|
|
201
|
+
ListCompanyTargetFacilitiesRequest$Outbound,
|
|
202
|
+
z.ZodTypeDef,
|
|
203
|
+
ListCompanyTargetFacilitiesRequest
|
|
204
|
+
> = z.object({
|
|
205
|
+
companyId: z.number().int(),
|
|
206
|
+
expand: z.array(components.Expand$outboundSchema).optional(),
|
|
207
|
+
status: ListCompanyTargetFacilitiesQueryParamStatus$outboundSchema.optional(),
|
|
208
|
+
hasIndividual: HasIndividual$outboundSchema.optional(),
|
|
209
|
+
hasActiveIndividual: HasActiveIndividual$outboundSchema.optional(),
|
|
210
|
+
includePotentialTargets: IncludePotentialTargets$outboundSchema.optional(),
|
|
211
|
+
facilityNameLike: z.string().optional(),
|
|
212
|
+
cityLike: z.string().optional(),
|
|
213
|
+
addressLike: z.string().optional(),
|
|
214
|
+
systemNameLike: z.string().optional(),
|
|
215
|
+
sort: QueryParamSort$outboundSchema.optional(),
|
|
216
|
+
desc: components.Desc$outboundSchema.optional(),
|
|
217
|
+
page: z.number().int().optional(),
|
|
218
|
+
itemsPerPage: z.number().int().optional(),
|
|
219
|
+
}).transform((v) => {
|
|
220
|
+
return remap$(v, {
|
|
221
|
+
companyId: "company_id",
|
|
222
|
+
hasIndividual: "has_individual",
|
|
223
|
+
hasActiveIndividual: "has_active_individual",
|
|
224
|
+
includePotentialTargets: "include_potential_targets",
|
|
225
|
+
facilityNameLike: "facility_name_like",
|
|
226
|
+
cityLike: "city_like",
|
|
227
|
+
addressLike: "address_like",
|
|
228
|
+
systemNameLike: "system_name_like",
|
|
229
|
+
itemsPerPage: "items_per_page",
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
export function listCompanyTargetFacilitiesRequestToJSON(
|
|
234
|
+
listCompanyTargetFacilitiesRequest: ListCompanyTargetFacilitiesRequest,
|
|
235
|
+
): string {
|
|
236
|
+
return JSON.stringify(
|
|
237
|
+
ListCompanyTargetFacilitiesRequest$outboundSchema.parse(
|
|
238
|
+
listCompanyTargetFacilitiesRequest,
|
|
239
|
+
),
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/** @internal */
|
|
244
|
+
export const ListCompanyTargetFacilitiesListCompanyTargetFacilitiesOk$inboundSchema:
|
|
245
|
+
z.ZodType<
|
|
246
|
+
ListCompanyTargetFacilitiesListCompanyTargetFacilitiesOk,
|
|
247
|
+
z.ZodTypeDef,
|
|
248
|
+
unknown
|
|
249
|
+
> = z.object({
|
|
250
|
+
pager: components.Pager$inboundSchema,
|
|
251
|
+
items: z.array(components.CompanyTargetFacility$inboundSchema),
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
export function listCompanyTargetFacilitiesListCompanyTargetFacilitiesOkFromJSON(
|
|
255
|
+
jsonString: string,
|
|
256
|
+
): SafeParseResult<
|
|
257
|
+
ListCompanyTargetFacilitiesListCompanyTargetFacilitiesOk,
|
|
258
|
+
SDKValidationError
|
|
259
|
+
> {
|
|
260
|
+
return safeParse(
|
|
261
|
+
jsonString,
|
|
262
|
+
(x) =>
|
|
263
|
+
ListCompanyTargetFacilitiesListCompanyTargetFacilitiesOk$inboundSchema
|
|
264
|
+
.parse(JSON.parse(x)),
|
|
265
|
+
`Failed to parse 'ListCompanyTargetFacilitiesListCompanyTargetFacilitiesOk' from JSON`,
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/** @internal */
|
|
270
|
+
export const ListCompanyTargetFacilitiesResponse$inboundSchema: z.ZodType<
|
|
271
|
+
ListCompanyTargetFacilitiesResponse,
|
|
272
|
+
z.ZodTypeDef,
|
|
273
|
+
unknown
|
|
274
|
+
> = z.object({
|
|
275
|
+
Result: z.lazy(() =>
|
|
276
|
+
ListCompanyTargetFacilitiesListCompanyTargetFacilitiesOk$inboundSchema
|
|
277
|
+
),
|
|
278
|
+
}).transform((v) => {
|
|
279
|
+
return remap$(v, {
|
|
280
|
+
"Result": "result",
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
export function listCompanyTargetFacilitiesResponseFromJSON(
|
|
285
|
+
jsonString: string,
|
|
286
|
+
): SafeParseResult<ListCompanyTargetFacilitiesResponse, SDKValidationError> {
|
|
287
|
+
return safeParse(
|
|
288
|
+
jsonString,
|
|
289
|
+
(x) =>
|
|
290
|
+
ListCompanyTargetFacilitiesResponse$inboundSchema.parse(JSON.parse(x)),
|
|
291
|
+
`Failed to parse 'ListCompanyTargetFacilitiesResponse' from JSON`,
|
|
292
|
+
);
|
|
293
|
+
}
|
|
@@ -15,7 +15,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
15
15
|
/**
|
|
16
16
|
* Filter rows to a single facility access status. Omit for "All".
|
|
17
17
|
*/
|
|
18
|
-
export const
|
|
18
|
+
export const ListFacilityVendorsQueryParamStatus = {
|
|
19
19
|
Approved: "approved",
|
|
20
20
|
Pending: "pending",
|
|
21
21
|
Denied: "denied",
|
|
@@ -23,7 +23,9 @@ export const QueryParamStatus = {
|
|
|
23
23
|
/**
|
|
24
24
|
* Filter rows to a single facility access status. Omit for "All".
|
|
25
25
|
*/
|
|
26
|
-
export type
|
|
26
|
+
export type ListFacilityVendorsQueryParamStatus = ClosedEnum<
|
|
27
|
+
typeof ListFacilityVendorsQueryParamStatus
|
|
28
|
+
>;
|
|
27
29
|
|
|
28
30
|
/**
|
|
29
31
|
* Sort field. Defaults to `name`.
|
|
@@ -54,7 +56,7 @@ export type ListFacilityVendorsRequest = {
|
|
|
54
56
|
/**
|
|
55
57
|
* Filter rows to a single facility access status. Omit for "All".
|
|
56
58
|
*/
|
|
57
|
-
status?:
|
|
59
|
+
status?: ListFacilityVendorsQueryParamStatus | undefined;
|
|
58
60
|
/**
|
|
59
61
|
* Single search term applied case-insensitively across first name,
|
|
60
62
|
*
|
|
@@ -149,9 +151,10 @@ export type ListFacilityVendorsResponse = {
|
|
|
149
151
|
};
|
|
150
152
|
|
|
151
153
|
/** @internal */
|
|
152
|
-
export const
|
|
153
|
-
typeof
|
|
154
|
-
|
|
154
|
+
export const ListFacilityVendorsQueryParamStatus$outboundSchema:
|
|
155
|
+
z.ZodNativeEnum<typeof ListFacilityVendorsQueryParamStatus> = z.nativeEnum(
|
|
156
|
+
ListFacilityVendorsQueryParamStatus,
|
|
157
|
+
);
|
|
155
158
|
|
|
156
159
|
/** @internal */
|
|
157
160
|
export const ListFacilityVendorsQueryParamSort$outboundSchema: z.ZodNativeEnum<
|
|
@@ -178,7 +181,7 @@ export const ListFacilityVendorsRequest$outboundSchema: z.ZodType<
|
|
|
178
181
|
> = z.object({
|
|
179
182
|
id: z.number().int(),
|
|
180
183
|
companyId: z.number().int().optional(),
|
|
181
|
-
status:
|
|
184
|
+
status: ListFacilityVendorsQueryParamStatus$outboundSchema.optional(),
|
|
182
185
|
search: z.string().optional(),
|
|
183
186
|
page: z.number().int().optional(),
|
|
184
187
|
itemsPerPage: z.number().int().optional(),
|
package/src/react-query/index.ts
CHANGED
|
@@ -43,10 +43,13 @@ export * from "./invoicesMakePayment.js";
|
|
|
43
43
|
export * from "./invoicesUpdateInvoice.js";
|
|
44
44
|
export * from "./lookupsListLookupSystems.js";
|
|
45
45
|
export * from "./mobileDevicesAddMobileDevice.js";
|
|
46
|
+
export * from "./organizationsCreateCompanyTargetFacility.js";
|
|
47
|
+
export * from "./organizationsDeleteCompanyTargetFacility.js";
|
|
46
48
|
export * from "./organizationsDownloadCompanyTargetFacilitiesExport.js";
|
|
47
49
|
export * from "./organizationsExportCompanyTargetFacilities.js";
|
|
48
50
|
export * from "./organizationsGetCompanyTargetFacilitiesExportStatus.js";
|
|
49
51
|
export * from "./organizationsGetFacility.js";
|
|
52
|
+
export * from "./organizationsListCompanyTargetFacilities.js";
|
|
50
53
|
export * from "./organizationsListFacilityVendors.js";
|
|
51
54
|
export * from "./organizationsListOrSearchDepartmentContacts.js";
|
|
52
55
|
export * from "./organizationsListOrSearchDepartments.js";
|
|
@@ -0,0 +1,129 @@
|
|
|
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 { organizationsCreateCompanyTargetFacility } from "../funcs/organizationsCreateCompanyTargetFacility.js";
|
|
12
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
13
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
14
|
+
import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
27
|
+
import { useGreenSecurityContext } from "./_context.js";
|
|
28
|
+
import { MutationHookOptions } from "./_types.js";
|
|
29
|
+
|
|
30
|
+
export type OrganizationsCreateCompanyTargetFacilityMutationVariables = {
|
|
31
|
+
request: operations.CreateCompanyTargetFacilityRequest;
|
|
32
|
+
options?: RequestOptions;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type OrganizationsCreateCompanyTargetFacilityMutationData =
|
|
36
|
+
operations.CreateCompanyTargetFacilityCreateCompanyTargetFacilityOk;
|
|
37
|
+
|
|
38
|
+
export type OrganizationsCreateCompanyTargetFacilityMutationError =
|
|
39
|
+
| errors.ApiErrorResponse
|
|
40
|
+
| GreenSecurityError
|
|
41
|
+
| ResponseValidationError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| UnexpectedClientError
|
|
47
|
+
| SDKValidationError;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Add a company target facility
|
|
51
|
+
*
|
|
52
|
+
* @remarks
|
|
53
|
+
* Links the URL's company to an existing facility. The link is created with
|
|
54
|
+
* status `Pending`. Only the link row is created — the Facility entity
|
|
55
|
+
* itself is never created or modified by this endpoint.
|
|
56
|
+
*
|
|
57
|
+
* Access control: the URL's `company_id` must be in the caller's update
|
|
58
|
+
* scope for Company, AND the `facility_id` must be in the caller's create
|
|
59
|
+
* scope for Facility (a facility on the company's site, or a facility
|
|
60
|
+
* reachable via the API user's site/system/facility-scoped activation).
|
|
61
|
+
* Either being out of scope returns `404 Company not found` /
|
|
62
|
+
* `404 Facility not found` respectively. Deleted facilities also return
|
|
63
|
+
* `404 Facility not found`.
|
|
64
|
+
*
|
|
65
|
+
* Available `expand` scopes are:
|
|
66
|
+
*
|
|
67
|
+
* - company_target_facility.facility
|
|
68
|
+
*/
|
|
69
|
+
export function useOrganizationsCreateCompanyTargetFacilityMutation(
|
|
70
|
+
options?: MutationHookOptions<
|
|
71
|
+
OrganizationsCreateCompanyTargetFacilityMutationData,
|
|
72
|
+
OrganizationsCreateCompanyTargetFacilityMutationError,
|
|
73
|
+
OrganizationsCreateCompanyTargetFacilityMutationVariables
|
|
74
|
+
>,
|
|
75
|
+
): UseMutationResult<
|
|
76
|
+
OrganizationsCreateCompanyTargetFacilityMutationData,
|
|
77
|
+
OrganizationsCreateCompanyTargetFacilityMutationError,
|
|
78
|
+
OrganizationsCreateCompanyTargetFacilityMutationVariables
|
|
79
|
+
> {
|
|
80
|
+
const client = useGreenSecurityContext();
|
|
81
|
+
return useMutation({
|
|
82
|
+
...buildOrganizationsCreateCompanyTargetFacilityMutation(client, options),
|
|
83
|
+
...options,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function mutationKeyOrganizationsCreateCompanyTargetFacility(): MutationKey {
|
|
88
|
+
return [
|
|
89
|
+
"@greensecurity/javascript-sdk",
|
|
90
|
+
"organizations",
|
|
91
|
+
"createCompanyTargetFacility",
|
|
92
|
+
];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function buildOrganizationsCreateCompanyTargetFacilityMutation(
|
|
96
|
+
client$: GreenSecurityCore,
|
|
97
|
+
hookOptions?: RequestOptions,
|
|
98
|
+
): {
|
|
99
|
+
mutationKey: MutationKey;
|
|
100
|
+
mutationFn: (
|
|
101
|
+
variables: OrganizationsCreateCompanyTargetFacilityMutationVariables,
|
|
102
|
+
) => Promise<OrganizationsCreateCompanyTargetFacilityMutationData>;
|
|
103
|
+
} {
|
|
104
|
+
return {
|
|
105
|
+
mutationKey: mutationKeyOrganizationsCreateCompanyTargetFacility(),
|
|
106
|
+
mutationFn: function organizationsCreateCompanyTargetFacilityMutationFn({
|
|
107
|
+
request,
|
|
108
|
+
options,
|
|
109
|
+
}): Promise<OrganizationsCreateCompanyTargetFacilityMutationData> {
|
|
110
|
+
const mergedOptions = {
|
|
111
|
+
...hookOptions,
|
|
112
|
+
...options,
|
|
113
|
+
fetchOptions: {
|
|
114
|
+
...hookOptions?.fetchOptions,
|
|
115
|
+
...options?.fetchOptions,
|
|
116
|
+
signal: combineSignals(
|
|
117
|
+
hookOptions?.fetchOptions?.signal,
|
|
118
|
+
options?.fetchOptions?.signal,
|
|
119
|
+
),
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
return unwrapAsync(organizationsCreateCompanyTargetFacility(
|
|
123
|
+
client$,
|
|
124
|
+
request,
|
|
125
|
+
mergedOptions,
|
|
126
|
+
));
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
}
|