@greensecurity/javascript-sdk 0.44.0-beta.12 → 0.44.0-beta.14

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.
Files changed (157) hide show
  1. package/README.md +3 -0
  2. package/dist/commonjs/__tests__/organizations.test.js +29 -0
  3. package/dist/commonjs/__tests__/organizations.test.js.map +1 -1
  4. package/dist/commonjs/__tests__/webhooks.test.js +1 -1
  5. package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
  6. package/dist/commonjs/__tests__/zones.test.js +30 -2
  7. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  8. package/dist/commonjs/admin-funcs/companyManagerGetPaymentForm.d.ts +3 -0
  9. package/dist/commonjs/admin-funcs/companyManagerGetPaymentForm.d.ts.map +1 -0
  10. package/dist/commonjs/admin-funcs/companyManagerGetPaymentForm.js +9 -0
  11. package/dist/commonjs/admin-funcs/companyManagerGetPaymentForm.js.map +1 -0
  12. package/dist/commonjs/admin-funcs/vendorGetPaymentForm.d.ts +3 -0
  13. package/dist/commonjs/admin-funcs/vendorGetPaymentForm.d.ts.map +1 -0
  14. package/dist/commonjs/admin-funcs/vendorGetPaymentForm.js +9 -0
  15. package/dist/commonjs/admin-funcs/vendorGetPaymentForm.js.map +1 -0
  16. package/dist/commonjs/funcs/organizationsListFacilityVendors.d.ts +42 -0
  17. package/dist/commonjs/funcs/organizationsListFacilityVendors.d.ts.map +1 -0
  18. package/dist/commonjs/funcs/organizationsListFacilityVendors.js +187 -0
  19. package/dist/commonjs/funcs/organizationsListFacilityVendors.js.map +1 -0
  20. package/dist/commonjs/hooks/types.d.ts +1 -0
  21. package/dist/commonjs/hooks/types.d.ts.map +1 -1
  22. package/dist/commonjs/index.extras.d.ts +8 -0
  23. package/dist/commonjs/index.extras.d.ts.map +1 -1
  24. package/dist/commonjs/index.extras.js +8 -0
  25. package/dist/commonjs/index.extras.js.map +1 -1
  26. package/dist/commonjs/lib/config.d.ts +4 -4
  27. package/dist/commonjs/lib/config.js +4 -4
  28. package/dist/commonjs/lib/sdks.d.ts.map +1 -1
  29. package/dist/commonjs/lib/sdks.js +13 -4
  30. package/dist/commonjs/lib/sdks.js.map +1 -1
  31. package/dist/commonjs/models/operations/exportcompanytargetfacilities.d.ts +4 -4
  32. package/dist/commonjs/models/operations/exportcompanytargetfacilities.d.ts.map +1 -1
  33. package/dist/commonjs/models/operations/exportcompanytargetfacilities.js +6 -4
  34. package/dist/commonjs/models/operations/exportcompanytargetfacilities.js.map +1 -1
  35. package/dist/commonjs/models/operations/index.d.ts +1 -0
  36. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  37. package/dist/commonjs/models/operations/index.js +1 -0
  38. package/dist/commonjs/models/operations/index.js.map +1 -1
  39. package/dist/commonjs/models/operations/listfacilityvendors.d.ts +162 -0
  40. package/dist/commonjs/models/operations/listfacilityvendors.d.ts.map +1 -0
  41. package/dist/commonjs/models/operations/listfacilityvendors.js +150 -0
  42. package/dist/commonjs/models/operations/listfacilityvendors.js.map +1 -0
  43. package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.d.ts +4 -4
  44. package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.d.ts.map +1 -1
  45. package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.js +6 -7
  46. package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.js.map +1 -1
  47. package/dist/commonjs/react-query/index.d.ts +1 -0
  48. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  49. package/dist/commonjs/react-query/index.js +1 -0
  50. package/dist/commonjs/react-query/index.js.map +1 -1
  51. package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.core.d.ts +1 -1
  52. package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.core.d.ts.map +1 -1
  53. package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.core.js.map +1 -1
  54. package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.d.ts +2 -2
  55. package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.d.ts.map +1 -1
  56. package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.js.map +1 -1
  57. package/dist/commonjs/react-query/organizationsListFacilityVendors.core.d.ts +42 -0
  58. package/dist/commonjs/react-query/organizationsListFacilityVendors.core.d.ts.map +1 -0
  59. package/dist/commonjs/react-query/organizationsListFacilityVendors.core.js +99 -0
  60. package/dist/commonjs/react-query/organizationsListFacilityVendors.core.js.map +1 -0
  61. package/dist/commonjs/react-query/organizationsListFacilityVendors.d.ts +142 -0
  62. package/dist/commonjs/react-query/organizationsListFacilityVendors.d.ts.map +1 -0
  63. package/dist/commonjs/react-query/organizationsListFacilityVendors.js +180 -0
  64. package/dist/commonjs/react-query/organizationsListFacilityVendors.js.map +1 -0
  65. package/dist/commonjs/sdk/organizations.d.ts +28 -0
  66. package/dist/commonjs/sdk/organizations.d.ts.map +1 -1
  67. package/dist/commonjs/sdk/organizations.js +29 -0
  68. package/dist/commonjs/sdk/organizations.js.map +1 -1
  69. package/dist/esm/__tests__/organizations.test.js +29 -0
  70. package/dist/esm/__tests__/organizations.test.js.map +1 -1
  71. package/dist/esm/__tests__/webhooks.test.js +1 -1
  72. package/dist/esm/__tests__/webhooks.test.js.map +1 -1
  73. package/dist/esm/__tests__/zones.test.js +30 -2
  74. package/dist/esm/__tests__/zones.test.js.map +1 -1
  75. package/dist/esm/admin-funcs/companyManagerGetPaymentForm.d.ts +3 -0
  76. package/dist/esm/admin-funcs/companyManagerGetPaymentForm.d.ts.map +1 -0
  77. package/dist/esm/admin-funcs/companyManagerGetPaymentForm.js +6 -0
  78. package/dist/esm/admin-funcs/companyManagerGetPaymentForm.js.map +1 -0
  79. package/dist/esm/admin-funcs/vendorGetPaymentForm.d.ts +3 -0
  80. package/dist/esm/admin-funcs/vendorGetPaymentForm.d.ts.map +1 -0
  81. package/dist/esm/admin-funcs/vendorGetPaymentForm.js +6 -0
  82. package/dist/esm/admin-funcs/vendorGetPaymentForm.js.map +1 -0
  83. package/dist/esm/funcs/organizationsListFacilityVendors.d.ts +42 -0
  84. package/dist/esm/funcs/organizationsListFacilityVendors.d.ts.map +1 -0
  85. package/dist/esm/funcs/organizationsListFacilityVendors.js +151 -0
  86. package/dist/esm/funcs/organizationsListFacilityVendors.js.map +1 -0
  87. package/dist/esm/hooks/types.d.ts +1 -0
  88. package/dist/esm/hooks/types.d.ts.map +1 -1
  89. package/dist/esm/index.extras.d.ts +8 -0
  90. package/dist/esm/index.extras.d.ts.map +1 -1
  91. package/dist/esm/index.extras.js +8 -0
  92. package/dist/esm/index.extras.js.map +1 -1
  93. package/dist/esm/lib/config.d.ts +4 -4
  94. package/dist/esm/lib/config.js +4 -4
  95. package/dist/esm/lib/sdks.d.ts.map +1 -1
  96. package/dist/esm/lib/sdks.js +13 -4
  97. package/dist/esm/lib/sdks.js.map +1 -1
  98. package/dist/esm/models/operations/exportcompanytargetfacilities.d.ts +4 -4
  99. package/dist/esm/models/operations/exportcompanytargetfacilities.d.ts.map +1 -1
  100. package/dist/esm/models/operations/exportcompanytargetfacilities.js +5 -3
  101. package/dist/esm/models/operations/exportcompanytargetfacilities.js.map +1 -1
  102. package/dist/esm/models/operations/index.d.ts +1 -0
  103. package/dist/esm/models/operations/index.d.ts.map +1 -1
  104. package/dist/esm/models/operations/index.js +1 -0
  105. package/dist/esm/models/operations/index.js.map +1 -1
  106. package/dist/esm/models/operations/listfacilityvendors.d.ts +162 -0
  107. package/dist/esm/models/operations/listfacilityvendors.d.ts.map +1 -0
  108. package/dist/esm/models/operations/listfacilityvendors.js +109 -0
  109. package/dist/esm/models/operations/listfacilityvendors.js.map +1 -0
  110. package/dist/esm/models/operations/listvendoradditionalfacilityfields.d.ts +4 -4
  111. package/dist/esm/models/operations/listvendoradditionalfacilityfields.d.ts.map +1 -1
  112. package/dist/esm/models/operations/listvendoradditionalfacilityfields.js +4 -5
  113. package/dist/esm/models/operations/listvendoradditionalfacilityfields.js.map +1 -1
  114. package/dist/esm/react-query/index.d.ts +1 -0
  115. package/dist/esm/react-query/index.d.ts.map +1 -1
  116. package/dist/esm/react-query/index.js +1 -0
  117. package/dist/esm/react-query/index.js.map +1 -1
  118. package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.core.d.ts +1 -1
  119. package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.core.d.ts.map +1 -1
  120. package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.core.js.map +1 -1
  121. package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.d.ts +2 -2
  122. package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.d.ts.map +1 -1
  123. package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.js.map +1 -1
  124. package/dist/esm/react-query/organizationsListFacilityVendors.core.d.ts +42 -0
  125. package/dist/esm/react-query/organizationsListFacilityVendors.core.d.ts.map +1 -0
  126. package/dist/esm/react-query/organizationsListFacilityVendors.core.js +91 -0
  127. package/dist/esm/react-query/organizationsListFacilityVendors.core.js.map +1 -0
  128. package/dist/esm/react-query/organizationsListFacilityVendors.d.ts +142 -0
  129. package/dist/esm/react-query/organizationsListFacilityVendors.d.ts.map +1 -0
  130. package/dist/esm/react-query/organizationsListFacilityVendors.js +165 -0
  131. package/dist/esm/react-query/organizationsListFacilityVendors.js.map +1 -0
  132. package/dist/esm/sdk/organizations.d.ts +28 -0
  133. package/dist/esm/sdk/organizations.d.ts.map +1 -1
  134. package/dist/esm/sdk/organizations.js +29 -0
  135. package/dist/esm/sdk/organizations.js.map +1 -1
  136. package/jsr.json +1 -1
  137. package/package.json +1 -1
  138. package/src/__tests__/organizations.test.ts +32 -0
  139. package/src/__tests__/webhooks.test.ts +1 -1
  140. package/src/__tests__/zones.test.ts +30 -2
  141. package/src/admin-funcs/companyManagerGetPaymentForm.ts +6 -0
  142. package/src/admin-funcs/vendorGetPaymentForm.ts +6 -0
  143. package/src/funcs/organizationsListFacilityVendors.ts +279 -0
  144. package/src/hooks/types.ts +1 -0
  145. package/src/index.extras.ts +13 -3
  146. package/src/lib/config.ts +4 -4
  147. package/src/lib/sdks.ts +13 -4
  148. package/src/models/operations/exportcompanytargetfacilities.ts +10 -7
  149. package/src/models/operations/index.ts +1 -0
  150. package/src/models/operations/listfacilityvendors.ts +307 -0
  151. package/src/models/operations/listvendoradditionalfacilityfields.ts +26 -15
  152. package/src/react-query/index.ts +1 -0
  153. package/src/react-query/organizationsExportCompanyTargetFacilities.core.ts +3 -1
  154. package/src/react-query/organizationsExportCompanyTargetFacilities.ts +6 -2
  155. package/src/react-query/organizationsListFacilityVendors.core.ts +207 -0
  156. package/src/react-query/organizationsListFacilityVendors.ts +351 -0
  157. package/src/sdk/organizations.ts +39 -0
@@ -0,0 +1,351 @@
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
+ buildOrganizationsListFacilityVendorsInfiniteQuery,
42
+ buildOrganizationsListFacilityVendorsQuery,
43
+ OrganizationsListFacilityVendorsInfiniteQueryData,
44
+ OrganizationsListFacilityVendorsPageParams,
45
+ OrganizationsListFacilityVendorsQueryData,
46
+ prefetchOrganizationsListFacilityVendors,
47
+ prefetchOrganizationsListFacilityVendorsInfinite,
48
+ queryKeyOrganizationsListFacilityVendors,
49
+ queryKeyOrganizationsListFacilityVendorsInfinite,
50
+ } from "./organizationsListFacilityVendors.core.js";
51
+ export {
52
+ buildOrganizationsListFacilityVendorsInfiniteQuery,
53
+ buildOrganizationsListFacilityVendorsQuery,
54
+ type OrganizationsListFacilityVendorsInfiniteQueryData,
55
+ type OrganizationsListFacilityVendorsPageParams,
56
+ type OrganizationsListFacilityVendorsQueryData,
57
+ prefetchOrganizationsListFacilityVendors,
58
+ prefetchOrganizationsListFacilityVendorsInfinite,
59
+ queryKeyOrganizationsListFacilityVendors,
60
+ queryKeyOrganizationsListFacilityVendorsInfinite,
61
+ };
62
+
63
+ export type OrganizationsListFacilityVendorsQueryError =
64
+ | errors.ApiErrorResponse
65
+ | GreenSecurityError
66
+ | ResponseValidationError
67
+ | ConnectionError
68
+ | RequestAbortedError
69
+ | RequestTimeoutError
70
+ | InvalidRequestError
71
+ | UnexpectedClientError
72
+ | SDKValidationError;
73
+
74
+ /**
75
+ * List vendors targeting a facility
76
+ *
77
+ * @remarks
78
+ * Powers the Company Portal → Facility Details page. Returns the
79
+ * paginated list of company-scoped vendor reps that are targeting the
80
+ * given facility, with each row carrying the rep's name + email, their
81
+ * last visit to this facility, their facility access status, and any
82
+ * company custom fields the company has flagged `show_to_vendor` (which
83
+ * is where the "Employee ID" column on the UI lives).
84
+ *
85
+ * Filtering: pass `status=approved|pending|denied` to scope the rows to a
86
+ * single status tab. Pass `search=<term>` for a single search box that
87
+ * matches first name, last name, full name, email, OR any visible custom
88
+ * field value (covering the "search by name / email / Employee ID"
89
+ * requirement).
90
+ *
91
+ * Access control:
92
+ * * Regular users: the URL's `:id` must be in the caller's read scope for
93
+ * Facility (resolved via `has_facility_access_policy`). Out-of-scope or
94
+ * soft-deleted facilities return `404 Facility not found`.
95
+ * * API users: must pass `company_id`. Both the company and the facility
96
+ * must be activated for the caller's marketplace app
97
+ * (`MarketplaceAppActivation`).
98
+ */
99
+ export function useOrganizationsListFacilityVendors(
100
+ request: operations.ListFacilityVendorsRequest,
101
+ options?: QueryHookOptions<
102
+ OrganizationsListFacilityVendorsQueryData,
103
+ OrganizationsListFacilityVendorsQueryError
104
+ >,
105
+ ): UseQueryResult<
106
+ OrganizationsListFacilityVendorsQueryData,
107
+ OrganizationsListFacilityVendorsQueryError
108
+ > {
109
+ const client = useGreenSecurityContext();
110
+ return useQuery({
111
+ ...buildOrganizationsListFacilityVendorsQuery(
112
+ client,
113
+ request,
114
+ options,
115
+ ),
116
+ ...options,
117
+ });
118
+ }
119
+
120
+ /**
121
+ * List vendors targeting a facility
122
+ *
123
+ * @remarks
124
+ * Powers the Company Portal → Facility Details page. Returns the
125
+ * paginated list of company-scoped vendor reps that are targeting the
126
+ * given facility, with each row carrying the rep's name + email, their
127
+ * last visit to this facility, their facility access status, and any
128
+ * company custom fields the company has flagged `show_to_vendor` (which
129
+ * is where the "Employee ID" column on the UI lives).
130
+ *
131
+ * Filtering: pass `status=approved|pending|denied` to scope the rows to a
132
+ * single status tab. Pass `search=<term>` for a single search box that
133
+ * matches first name, last name, full name, email, OR any visible custom
134
+ * field value (covering the "search by name / email / Employee ID"
135
+ * requirement).
136
+ *
137
+ * Access control:
138
+ * * Regular users: the URL's `:id` must be in the caller's read scope for
139
+ * Facility (resolved via `has_facility_access_policy`). Out-of-scope or
140
+ * soft-deleted facilities return `404 Facility not found`.
141
+ * * API users: must pass `company_id`. Both the company and the facility
142
+ * must be activated for the caller's marketplace app
143
+ * (`MarketplaceAppActivation`).
144
+ */
145
+ export function useOrganizationsListFacilityVendorsSuspense(
146
+ request: operations.ListFacilityVendorsRequest,
147
+ options?: SuspenseQueryHookOptions<
148
+ OrganizationsListFacilityVendorsQueryData,
149
+ OrganizationsListFacilityVendorsQueryError
150
+ >,
151
+ ): UseSuspenseQueryResult<
152
+ OrganizationsListFacilityVendorsQueryData,
153
+ OrganizationsListFacilityVendorsQueryError
154
+ > {
155
+ const client = useGreenSecurityContext();
156
+ return useSuspenseQuery({
157
+ ...buildOrganizationsListFacilityVendorsQuery(
158
+ client,
159
+ request,
160
+ options,
161
+ ),
162
+ ...options,
163
+ });
164
+ }
165
+
166
+ /**
167
+ * List vendors targeting a facility
168
+ *
169
+ * @remarks
170
+ * Powers the Company Portal → Facility Details page. Returns the
171
+ * paginated list of company-scoped vendor reps that are targeting the
172
+ * given facility, with each row carrying the rep's name + email, their
173
+ * last visit to this facility, their facility access status, and any
174
+ * company custom fields the company has flagged `show_to_vendor` (which
175
+ * is where the "Employee ID" column on the UI lives).
176
+ *
177
+ * Filtering: pass `status=approved|pending|denied` to scope the rows to a
178
+ * single status tab. Pass `search=<term>` for a single search box that
179
+ * matches first name, last name, full name, email, OR any visible custom
180
+ * field value (covering the "search by name / email / Employee ID"
181
+ * requirement).
182
+ *
183
+ * Access control:
184
+ * * Regular users: the URL's `:id` must be in the caller's read scope for
185
+ * Facility (resolved via `has_facility_access_policy`). Out-of-scope or
186
+ * soft-deleted facilities return `404 Facility not found`.
187
+ * * API users: must pass `company_id`. Both the company and the facility
188
+ * must be activated for the caller's marketplace app
189
+ * (`MarketplaceAppActivation`).
190
+ */
191
+ export function useOrganizationsListFacilityVendorsInfinite(
192
+ request: operations.ListFacilityVendorsRequest,
193
+ options?: InfiniteQueryHookOptions<
194
+ OrganizationsListFacilityVendorsInfiniteQueryData,
195
+ OrganizationsListFacilityVendorsQueryError
196
+ >,
197
+ ): UseInfiniteQueryResult<
198
+ InfiniteData<
199
+ OrganizationsListFacilityVendorsInfiniteQueryData,
200
+ OrganizationsListFacilityVendorsPageParams
201
+ >,
202
+ OrganizationsListFacilityVendorsQueryError
203
+ > {
204
+ const client = useGreenSecurityContext();
205
+ return useInfiniteQuery<
206
+ OrganizationsListFacilityVendorsInfiniteQueryData,
207
+ OrganizationsListFacilityVendorsQueryError,
208
+ InfiniteData<
209
+ OrganizationsListFacilityVendorsInfiniteQueryData,
210
+ OrganizationsListFacilityVendorsPageParams
211
+ >,
212
+ QueryKey,
213
+ OrganizationsListFacilityVendorsPageParams
214
+ >({
215
+ ...buildOrganizationsListFacilityVendorsInfiniteQuery(
216
+ client,
217
+ request,
218
+ options,
219
+ ),
220
+ initialPageParam: options?.initialPageParam,
221
+ getNextPageParam: (previousPage) => previousPage["~next"],
222
+ ...options,
223
+ });
224
+ }
225
+
226
+ /**
227
+ * List vendors targeting a facility
228
+ *
229
+ * @remarks
230
+ * Powers the Company Portal → Facility Details page. Returns the
231
+ * paginated list of company-scoped vendor reps that are targeting the
232
+ * given facility, with each row carrying the rep's name + email, their
233
+ * last visit to this facility, their facility access status, and any
234
+ * company custom fields the company has flagged `show_to_vendor` (which
235
+ * is where the "Employee ID" column on the UI lives).
236
+ *
237
+ * Filtering: pass `status=approved|pending|denied` to scope the rows to a
238
+ * single status tab. Pass `search=<term>` for a single search box that
239
+ * matches first name, last name, full name, email, OR any visible custom
240
+ * field value (covering the "search by name / email / Employee ID"
241
+ * requirement).
242
+ *
243
+ * Access control:
244
+ * * Regular users: the URL's `:id` must be in the caller's read scope for
245
+ * Facility (resolved via `has_facility_access_policy`). Out-of-scope or
246
+ * soft-deleted facilities return `404 Facility not found`.
247
+ * * API users: must pass `company_id`. Both the company and the facility
248
+ * must be activated for the caller's marketplace app
249
+ * (`MarketplaceAppActivation`).
250
+ */
251
+ export function useOrganizationsListFacilityVendorsInfiniteSuspense(
252
+ request: operations.ListFacilityVendorsRequest,
253
+ options?: SuspenseInfiniteQueryHookOptions<
254
+ OrganizationsListFacilityVendorsInfiniteQueryData,
255
+ OrganizationsListFacilityVendorsQueryError
256
+ >,
257
+ ): UseSuspenseInfiniteQueryResult<
258
+ InfiniteData<
259
+ OrganizationsListFacilityVendorsInfiniteQueryData,
260
+ OrganizationsListFacilityVendorsPageParams
261
+ >,
262
+ OrganizationsListFacilityVendorsQueryError
263
+ > {
264
+ const client = useGreenSecurityContext();
265
+ return useSuspenseInfiniteQuery<
266
+ OrganizationsListFacilityVendorsInfiniteQueryData,
267
+ OrganizationsListFacilityVendorsQueryError,
268
+ InfiniteData<
269
+ OrganizationsListFacilityVendorsInfiniteQueryData,
270
+ OrganizationsListFacilityVendorsPageParams
271
+ >,
272
+ QueryKey,
273
+ OrganizationsListFacilityVendorsPageParams
274
+ >({
275
+ ...buildOrganizationsListFacilityVendorsInfiniteQuery(
276
+ client,
277
+ request,
278
+ options,
279
+ ),
280
+ initialPageParam: options?.initialPageParam,
281
+ getNextPageParam: (previousPage) => previousPage["~next"],
282
+ ...options,
283
+ });
284
+ }
285
+
286
+ export function setOrganizationsListFacilityVendorsData(
287
+ client: QueryClient,
288
+ queryKeyBase: [
289
+ id: number,
290
+ parameters: {
291
+ companyId?: number | undefined;
292
+ status?: operations.QueryParamStatus | undefined;
293
+ search?: string | undefined;
294
+ page?: number | undefined;
295
+ itemsPerPage?: number | undefined;
296
+ sort?: operations.ListFacilityVendorsQueryParamSort | undefined;
297
+ desc?: components.Desc | undefined;
298
+ },
299
+ ],
300
+ data: OrganizationsListFacilityVendorsQueryData,
301
+ ): OrganizationsListFacilityVendorsQueryData | undefined {
302
+ const key = queryKeyOrganizationsListFacilityVendors(...queryKeyBase);
303
+
304
+ return client.setQueryData<OrganizationsListFacilityVendorsQueryData>(
305
+ key,
306
+ data,
307
+ );
308
+ }
309
+
310
+ export function invalidateOrganizationsListFacilityVendors(
311
+ client: QueryClient,
312
+ queryKeyBase: TupleToPrefixes<
313
+ [
314
+ id: number,
315
+ parameters: {
316
+ companyId?: number | undefined;
317
+ status?: operations.QueryParamStatus | undefined;
318
+ search?: string | undefined;
319
+ page?: number | undefined;
320
+ itemsPerPage?: number | undefined;
321
+ sort?: operations.ListFacilityVendorsQueryParamSort | undefined;
322
+ desc?: components.Desc | undefined;
323
+ },
324
+ ]
325
+ >,
326
+ filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
327
+ ): Promise<void> {
328
+ return client.invalidateQueries({
329
+ ...filters,
330
+ queryKey: [
331
+ "@greensecurity/javascript-sdk",
332
+ "organizations",
333
+ "listFacilityVendors",
334
+ ...queryKeyBase,
335
+ ],
336
+ });
337
+ }
338
+
339
+ export function invalidateAllOrganizationsListFacilityVendors(
340
+ client: QueryClient,
341
+ filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
342
+ ): Promise<void> {
343
+ return client.invalidateQueries({
344
+ ...filters,
345
+ queryKey: [
346
+ "@greensecurity/javascript-sdk",
347
+ "organizations",
348
+ "listFacilityVendors",
349
+ ],
350
+ });
351
+ }
@@ -6,6 +6,7 @@ import { organizationsDownloadCompanyTargetFacilitiesExport } from "../funcs/org
6
6
  import { organizationsExportCompanyTargetFacilities } from "../funcs/organizationsExportCompanyTargetFacilities.js";
7
7
  import { organizationsGetCompanyTargetFacilitiesExportStatus } from "../funcs/organizationsGetCompanyTargetFacilitiesExportStatus.js";
8
8
  import { organizationsGetFacility } from "../funcs/organizationsGetFacility.js";
9
+ import { organizationsListFacilityVendors } from "../funcs/organizationsListFacilityVendors.js";
9
10
  import { organizationsListOrSearchDepartmentContacts } from "../funcs/organizationsListOrSearchDepartmentContacts.js";
10
11
  import { organizationsListOrSearchDepartments } from "../funcs/organizationsListOrSearchDepartments.js";
11
12
  import { organizationsListOrSearchFacilities } from "../funcs/organizationsListOrSearchFacilities.js";
@@ -146,6 +147,44 @@ export class Organizations extends ClientSDK {
146
147
  ));
147
148
  }
148
149
 
150
+ /**
151
+ * List vendors targeting a facility
152
+ *
153
+ * @remarks
154
+ * Powers the Company Portal → Facility Details page. Returns the
155
+ * paginated list of company-scoped vendor reps that are targeting the
156
+ * given facility, with each row carrying the rep's name + email, their
157
+ * last visit to this facility, their facility access status, and any
158
+ * company custom fields the company has flagged `show_to_vendor` (which
159
+ * is where the "Employee ID" column on the UI lives).
160
+ *
161
+ * Filtering: pass `status=approved|pending|denied` to scope the rows to a
162
+ * single status tab. Pass `search=<term>` for a single search box that
163
+ * matches first name, last name, full name, email, OR any visible custom
164
+ * field value (covering the "search by name / email / Employee ID"
165
+ * requirement).
166
+ *
167
+ * Access control:
168
+ * * Regular users: the URL's `:id` must be in the caller's read scope for
169
+ * Facility (resolved via `has_facility_access_policy`). Out-of-scope or
170
+ * soft-deleted facilities return `404 Facility not found`.
171
+ * * API users: must pass `company_id`. Both the company and the facility
172
+ * must be activated for the caller's marketplace app
173
+ * (`MarketplaceAppActivation`).
174
+ */
175
+ async listFacilityVendors(
176
+ request: operations.ListFacilityVendorsRequest,
177
+ options?: RequestOptions,
178
+ ): Promise<
179
+ PageIterator<operations.ListFacilityVendorsResponse, { page: number }>
180
+ > {
181
+ return unwrapResultIterator(organizationsListFacilityVendors(
182
+ this,
183
+ request,
184
+ options,
185
+ ));
186
+ }
187
+
149
188
  /**
150
189
  * List or search department contacts
151
190
  *