@greensecurity/javascript-sdk 0.45.0-beta.20 → 0.45.0-beta.21

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 (259) hide show
  1. package/README.md +7 -4
  2. package/dist/commonjs/__tests__/lookups.test.js +24 -0
  3. package/dist/commonjs/__tests__/lookups.test.js.map +1 -1
  4. package/dist/commonjs/__tests__/vendors.test.js +1 -1
  5. package/dist/commonjs/__tests__/webhooks.test.js +1 -1
  6. package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
  7. package/dist/commonjs/__tests__/zones.test.js +4 -11
  8. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  9. package/dist/commonjs/funcs/companiesListCompanyManagerContacts.d.ts +3 -1
  10. package/dist/commonjs/funcs/companiesListCompanyManagerContacts.d.ts.map +1 -1
  11. package/dist/commonjs/funcs/companiesListCompanyManagerContacts.js +3 -1
  12. package/dist/commonjs/funcs/companiesListCompanyManagerContacts.js.map +1 -1
  13. package/dist/commonjs/funcs/lookupsLookupCompanyManagers.d.ts +18 -0
  14. package/dist/commonjs/funcs/lookupsLookupCompanyManagers.d.ts.map +1 -0
  15. package/dist/commonjs/funcs/lookupsLookupCompanyManagers.js +121 -0
  16. package/dist/commonjs/funcs/lookupsLookupCompanyManagers.js.map +1 -0
  17. package/dist/commonjs/funcs/organizationsListOrSearchFacilities.js +1 -0
  18. package/dist/commonjs/funcs/organizationsListOrSearchFacilities.js.map +1 -1
  19. package/dist/commonjs/funcs/vendorsGetVendorInvoiceDetails.d.ts +1 -0
  20. package/dist/commonjs/funcs/vendorsGetVendorInvoiceDetails.d.ts.map +1 -1
  21. package/dist/commonjs/funcs/vendorsGetVendorInvoiceDetails.js +1 -0
  22. package/dist/commonjs/funcs/vendorsGetVendorInvoiceDetails.js.map +1 -1
  23. package/dist/commonjs/lib/config.d.ts +2 -2
  24. package/dist/commonjs/lib/config.js +2 -2
  25. package/dist/commonjs/models/components/alert.d.ts +3 -2
  26. package/dist/commonjs/models/components/alert.d.ts.map +1 -1
  27. package/dist/commonjs/models/components/alert.js +2 -0
  28. package/dist/commonjs/models/components/alert.js.map +1 -1
  29. package/dist/commonjs/models/components/{companymanagercontact.d.ts → companymanagerlookup.d.ts} +4 -4
  30. package/dist/commonjs/models/components/companymanagerlookup.d.ts.map +1 -0
  31. package/dist/commonjs/models/components/{companymanagercontact.js → companymanagerlookup.js} +6 -6
  32. package/dist/commonjs/models/components/companymanagerlookup.js.map +1 -0
  33. package/dist/commonjs/models/components/expand.d.ts +1 -0
  34. package/dist/commonjs/models/components/expand.d.ts.map +1 -1
  35. package/dist/commonjs/models/components/expand.js +1 -0
  36. package/dist/commonjs/models/components/expand.js.map +1 -1
  37. package/dist/commonjs/models/components/index.d.ts +1 -1
  38. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  39. package/dist/commonjs/models/components/index.js +1 -1
  40. package/dist/commonjs/models/components/index.js.map +1 -1
  41. package/dist/commonjs/models/components/invoice.d.ts +30 -6
  42. package/dist/commonjs/models/components/invoice.d.ts.map +1 -1
  43. package/dist/commonjs/models/components/invoice.js +39 -1
  44. package/dist/commonjs/models/components/invoice.js.map +1 -1
  45. package/dist/commonjs/models/operations/index.d.ts +1 -0
  46. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  47. package/dist/commonjs/models/operations/index.js +1 -0
  48. package/dist/commonjs/models/operations/index.js.map +1 -1
  49. package/dist/commonjs/models/operations/listcompanymanagercontacts.d.ts +2 -2
  50. package/dist/commonjs/models/operations/listcompanymanagercontacts.d.ts.map +1 -1
  51. package/dist/commonjs/models/operations/listcompanymanagercontacts.js +1 -1
  52. package/dist/commonjs/models/operations/listcompanymanagercontacts.js.map +1 -1
  53. package/dist/commonjs/models/operations/listlookupsystems.d.ts +4 -4
  54. package/dist/commonjs/models/operations/listlookupsystems.d.ts.map +1 -1
  55. package/dist/commonjs/models/operations/listlookupsystems.js +4 -4
  56. package/dist/commonjs/models/operations/listlookupsystems.js.map +1 -1
  57. package/dist/commonjs/models/operations/listorsearchfacilities.d.ts +17 -0
  58. package/dist/commonjs/models/operations/listorsearchfacilities.d.ts.map +1 -1
  59. package/dist/commonjs/models/operations/listorsearchfacilities.js +10 -1
  60. package/dist/commonjs/models/operations/listorsearchfacilities.js.map +1 -1
  61. package/dist/commonjs/models/operations/lookupcompanymanagers.d.ts +27 -0
  62. package/dist/commonjs/models/operations/lookupcompanymanagers.d.ts.map +1 -0
  63. package/dist/commonjs/models/operations/lookupcompanymanagers.js +64 -0
  64. package/dist/commonjs/models/operations/lookupcompanymanagers.js.map +1 -0
  65. package/dist/commonjs/react-query/companiesListCompanyManagerContacts.d.ts +6 -2
  66. package/dist/commonjs/react-query/companiesListCompanyManagerContacts.d.ts.map +1 -1
  67. package/dist/commonjs/react-query/companiesListCompanyManagerContacts.js +6 -2
  68. package/dist/commonjs/react-query/companiesListCompanyManagerContacts.js.map +1 -1
  69. package/dist/commonjs/react-query/index.d.ts +1 -0
  70. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  71. package/dist/commonjs/react-query/index.js +1 -0
  72. package/dist/commonjs/react-query/index.js.map +1 -1
  73. package/dist/commonjs/react-query/lookupsListLookupSystems.core.d.ts +1 -1
  74. package/dist/commonjs/react-query/lookupsListLookupSystems.core.d.ts.map +1 -1
  75. package/dist/commonjs/react-query/lookupsListLookupSystems.d.ts +2 -2
  76. package/dist/commonjs/react-query/lookupsListLookupSystems.d.ts.map +1 -1
  77. package/dist/commonjs/react-query/lookupsLookupCompanyManagers.core.d.ts +14 -0
  78. package/dist/commonjs/react-query/lookupsLookupCompanyManagers.core.d.ts.map +1 -0
  79. package/dist/commonjs/react-query/lookupsLookupCompanyManagers.core.js +41 -0
  80. package/dist/commonjs/react-query/lookupsLookupCompanyManagers.core.js.map +1 -0
  81. package/dist/commonjs/react-query/lookupsLookupCompanyManagers.d.ts +33 -0
  82. package/dist/commonjs/react-query/lookupsLookupCompanyManagers.d.ts.map +1 -0
  83. package/dist/commonjs/react-query/lookupsLookupCompanyManagers.js +69 -0
  84. package/dist/commonjs/react-query/lookupsLookupCompanyManagers.js.map +1 -0
  85. package/dist/commonjs/react-query/organizationsListOrSearchFacilities.core.d.ts +2 -0
  86. package/dist/commonjs/react-query/organizationsListOrSearchFacilities.core.d.ts.map +1 -1
  87. package/dist/commonjs/react-query/organizationsListOrSearchFacilities.core.js +2 -0
  88. package/dist/commonjs/react-query/organizationsListOrSearchFacilities.core.js.map +1 -1
  89. package/dist/commonjs/react-query/organizationsListOrSearchFacilities.d.ts +2 -0
  90. package/dist/commonjs/react-query/organizationsListOrSearchFacilities.d.ts.map +1 -1
  91. package/dist/commonjs/react-query/organizationsListOrSearchFacilities.js.map +1 -1
  92. package/dist/commonjs/react-query/vendorsGetVendorInvoiceDetails.d.ts +2 -0
  93. package/dist/commonjs/react-query/vendorsGetVendorInvoiceDetails.d.ts.map +1 -1
  94. package/dist/commonjs/react-query/vendorsGetVendorInvoiceDetails.js +2 -0
  95. package/dist/commonjs/react-query/vendorsGetVendorInvoiceDetails.js.map +1 -1
  96. package/dist/commonjs/sdk/companies.d.ts +3 -1
  97. package/dist/commonjs/sdk/companies.d.ts.map +1 -1
  98. package/dist/commonjs/sdk/companies.js +3 -1
  99. package/dist/commonjs/sdk/companies.js.map +1 -1
  100. package/dist/commonjs/sdk/lookups.d.ts +7 -0
  101. package/dist/commonjs/sdk/lookups.d.ts.map +1 -1
  102. package/dist/commonjs/sdk/lookups.js +10 -0
  103. package/dist/commonjs/sdk/lookups.js.map +1 -1
  104. package/dist/commonjs/sdk/sdk.d.ts +2 -2
  105. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  106. package/dist/commonjs/sdk/sdk.js +3 -3
  107. package/dist/commonjs/sdk/sdk.js.map +1 -1
  108. package/dist/commonjs/sdk/vendors.d.ts +1 -0
  109. package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
  110. package/dist/commonjs/sdk/vendors.js +1 -0
  111. package/dist/commonjs/sdk/vendors.js.map +1 -1
  112. package/dist/esm/__tests__/lookups.test.js +24 -0
  113. package/dist/esm/__tests__/lookups.test.js.map +1 -1
  114. package/dist/esm/__tests__/vendors.test.js +1 -1
  115. package/dist/esm/__tests__/webhooks.test.js +1 -1
  116. package/dist/esm/__tests__/webhooks.test.js.map +1 -1
  117. package/dist/esm/__tests__/zones.test.js +4 -11
  118. package/dist/esm/__tests__/zones.test.js.map +1 -1
  119. package/dist/esm/funcs/companiesListCompanyManagerContacts.d.ts +3 -1
  120. package/dist/esm/funcs/companiesListCompanyManagerContacts.d.ts.map +1 -1
  121. package/dist/esm/funcs/companiesListCompanyManagerContacts.js +3 -1
  122. package/dist/esm/funcs/companiesListCompanyManagerContacts.js.map +1 -1
  123. package/dist/esm/funcs/lookupsLookupCompanyManagers.d.ts +18 -0
  124. package/dist/esm/funcs/lookupsLookupCompanyManagers.d.ts.map +1 -0
  125. package/dist/esm/funcs/lookupsLookupCompanyManagers.js +85 -0
  126. package/dist/esm/funcs/lookupsLookupCompanyManagers.js.map +1 -0
  127. package/dist/esm/funcs/organizationsListOrSearchFacilities.js +1 -0
  128. package/dist/esm/funcs/organizationsListOrSearchFacilities.js.map +1 -1
  129. package/dist/esm/funcs/vendorsGetVendorInvoiceDetails.d.ts +1 -0
  130. package/dist/esm/funcs/vendorsGetVendorInvoiceDetails.d.ts.map +1 -1
  131. package/dist/esm/funcs/vendorsGetVendorInvoiceDetails.js +1 -0
  132. package/dist/esm/funcs/vendorsGetVendorInvoiceDetails.js.map +1 -1
  133. package/dist/esm/lib/config.d.ts +2 -2
  134. package/dist/esm/lib/config.js +2 -2
  135. package/dist/esm/models/components/alert.d.ts +3 -2
  136. package/dist/esm/models/components/alert.d.ts.map +1 -1
  137. package/dist/esm/models/components/alert.js +2 -0
  138. package/dist/esm/models/components/alert.js.map +1 -1
  139. package/dist/esm/models/components/{companymanagercontact.d.ts → companymanagerlookup.d.ts} +4 -4
  140. package/dist/esm/models/components/companymanagerlookup.d.ts.map +1 -0
  141. package/dist/esm/models/components/{companymanagercontact.js → companymanagerlookup.js} +4 -4
  142. package/dist/esm/models/components/companymanagerlookup.js.map +1 -0
  143. package/dist/esm/models/components/expand.d.ts +1 -0
  144. package/dist/esm/models/components/expand.d.ts.map +1 -1
  145. package/dist/esm/models/components/expand.js +1 -0
  146. package/dist/esm/models/components/expand.js.map +1 -1
  147. package/dist/esm/models/components/index.d.ts +1 -1
  148. package/dist/esm/models/components/index.d.ts.map +1 -1
  149. package/dist/esm/models/components/index.js +1 -1
  150. package/dist/esm/models/components/index.js.map +1 -1
  151. package/dist/esm/models/components/invoice.d.ts +30 -6
  152. package/dist/esm/models/components/invoice.d.ts.map +1 -1
  153. package/dist/esm/models/components/invoice.js +36 -0
  154. package/dist/esm/models/components/invoice.js.map +1 -1
  155. package/dist/esm/models/operations/index.d.ts +1 -0
  156. package/dist/esm/models/operations/index.d.ts.map +1 -1
  157. package/dist/esm/models/operations/index.js +1 -0
  158. package/dist/esm/models/operations/index.js.map +1 -1
  159. package/dist/esm/models/operations/listcompanymanagercontacts.d.ts +2 -2
  160. package/dist/esm/models/operations/listcompanymanagercontacts.d.ts.map +1 -1
  161. package/dist/esm/models/operations/listcompanymanagercontacts.js +1 -1
  162. package/dist/esm/models/operations/listcompanymanagercontacts.js.map +1 -1
  163. package/dist/esm/models/operations/listlookupsystems.d.ts +4 -4
  164. package/dist/esm/models/operations/listlookupsystems.d.ts.map +1 -1
  165. package/dist/esm/models/operations/listlookupsystems.js +3 -3
  166. package/dist/esm/models/operations/listlookupsystems.js.map +1 -1
  167. package/dist/esm/models/operations/listorsearchfacilities.d.ts +17 -0
  168. package/dist/esm/models/operations/listorsearchfacilities.d.ts.map +1 -1
  169. package/dist/esm/models/operations/listorsearchfacilities.js +9 -0
  170. package/dist/esm/models/operations/listorsearchfacilities.js.map +1 -1
  171. package/dist/esm/models/operations/lookupcompanymanagers.d.ts +27 -0
  172. package/dist/esm/models/operations/lookupcompanymanagers.d.ts.map +1 -0
  173. package/dist/esm/models/operations/lookupcompanymanagers.js +26 -0
  174. package/dist/esm/models/operations/lookupcompanymanagers.js.map +1 -0
  175. package/dist/esm/react-query/companiesListCompanyManagerContacts.d.ts +6 -2
  176. package/dist/esm/react-query/companiesListCompanyManagerContacts.d.ts.map +1 -1
  177. package/dist/esm/react-query/companiesListCompanyManagerContacts.js +6 -2
  178. package/dist/esm/react-query/companiesListCompanyManagerContacts.js.map +1 -1
  179. package/dist/esm/react-query/index.d.ts +1 -0
  180. package/dist/esm/react-query/index.d.ts.map +1 -1
  181. package/dist/esm/react-query/index.js +1 -0
  182. package/dist/esm/react-query/index.js.map +1 -1
  183. package/dist/esm/react-query/lookupsListLookupSystems.core.d.ts +1 -1
  184. package/dist/esm/react-query/lookupsListLookupSystems.core.d.ts.map +1 -1
  185. package/dist/esm/react-query/lookupsListLookupSystems.d.ts +2 -2
  186. package/dist/esm/react-query/lookupsListLookupSystems.d.ts.map +1 -1
  187. package/dist/esm/react-query/lookupsLookupCompanyManagers.core.d.ts +14 -0
  188. package/dist/esm/react-query/lookupsLookupCompanyManagers.core.d.ts.map +1 -0
  189. package/dist/esm/react-query/lookupsLookupCompanyManagers.core.js +36 -0
  190. package/dist/esm/react-query/lookupsLookupCompanyManagers.core.js.map +1 -0
  191. package/dist/esm/react-query/lookupsLookupCompanyManagers.d.ts +33 -0
  192. package/dist/esm/react-query/lookupsLookupCompanyManagers.d.ts.map +1 -0
  193. package/dist/esm/react-query/lookupsLookupCompanyManagers.js +59 -0
  194. package/dist/esm/react-query/lookupsLookupCompanyManagers.js.map +1 -0
  195. package/dist/esm/react-query/organizationsListOrSearchFacilities.core.d.ts +2 -0
  196. package/dist/esm/react-query/organizationsListOrSearchFacilities.core.d.ts.map +1 -1
  197. package/dist/esm/react-query/organizationsListOrSearchFacilities.core.js +2 -0
  198. package/dist/esm/react-query/organizationsListOrSearchFacilities.core.js.map +1 -1
  199. package/dist/esm/react-query/organizationsListOrSearchFacilities.d.ts +2 -0
  200. package/dist/esm/react-query/organizationsListOrSearchFacilities.d.ts.map +1 -1
  201. package/dist/esm/react-query/organizationsListOrSearchFacilities.js.map +1 -1
  202. package/dist/esm/react-query/vendorsGetVendorInvoiceDetails.d.ts +2 -0
  203. package/dist/esm/react-query/vendorsGetVendorInvoiceDetails.d.ts.map +1 -1
  204. package/dist/esm/react-query/vendorsGetVendorInvoiceDetails.js +2 -0
  205. package/dist/esm/react-query/vendorsGetVendorInvoiceDetails.js.map +1 -1
  206. package/dist/esm/sdk/companies.d.ts +3 -1
  207. package/dist/esm/sdk/companies.d.ts.map +1 -1
  208. package/dist/esm/sdk/companies.js +3 -1
  209. package/dist/esm/sdk/companies.js.map +1 -1
  210. package/dist/esm/sdk/lookups.d.ts +7 -0
  211. package/dist/esm/sdk/lookups.d.ts.map +1 -1
  212. package/dist/esm/sdk/lookups.js +10 -0
  213. package/dist/esm/sdk/lookups.js.map +1 -1
  214. package/dist/esm/sdk/sdk.d.ts +2 -2
  215. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  216. package/dist/esm/sdk/sdk.js +3 -3
  217. package/dist/esm/sdk/sdk.js.map +1 -1
  218. package/dist/esm/sdk/vendors.d.ts +1 -0
  219. package/dist/esm/sdk/vendors.d.ts.map +1 -1
  220. package/dist/esm/sdk/vendors.js +1 -0
  221. package/dist/esm/sdk/vendors.js.map +1 -1
  222. package/jsr.json +1 -1
  223. package/package.json +2 -2
  224. package/src/__tests__/lookups.test.ts +27 -0
  225. package/src/__tests__/vendors.test.ts +1 -1
  226. package/src/__tests__/webhooks.test.ts +1 -1
  227. package/src/__tests__/zones.test.ts +4 -11
  228. package/src/funcs/companiesListCompanyManagerContacts.ts +3 -1
  229. package/src/funcs/lookupsLookupCompanyManagers.ts +178 -0
  230. package/src/funcs/organizationsListOrSearchFacilities.ts +1 -0
  231. package/src/funcs/vendorsGetVendorInvoiceDetails.ts +1 -0
  232. package/src/lib/config.ts +2 -2
  233. package/src/models/components/alert.ts +5 -2
  234. package/src/models/components/{companymanagercontact.ts → companymanagerlookup.ts} +7 -7
  235. package/src/models/components/expand.ts +1 -0
  236. package/src/models/components/index.ts +1 -1
  237. package/src/models/components/invoice.ts +89 -6
  238. package/src/models/operations/index.ts +1 -0
  239. package/src/models/operations/listcompanymanagercontacts.ts +3 -3
  240. package/src/models/operations/listlookupsystems.ts +7 -7
  241. package/src/models/operations/listorsearchfacilities.ts +22 -0
  242. package/src/models/operations/lookupcompanymanagers.ts +78 -0
  243. package/src/react-query/companiesListCompanyManagerContacts.ts +6 -2
  244. package/src/react-query/index.ts +1 -0
  245. package/src/react-query/lookupsListLookupSystems.core.ts +1 -1
  246. package/src/react-query/lookupsListLookupSystems.ts +2 -2
  247. package/src/react-query/lookupsLookupCompanyManagers.core.ts +80 -0
  248. package/src/react-query/lookupsLookupCompanyManagers.ts +147 -0
  249. package/src/react-query/organizationsListOrSearchFacilities.core.ts +4 -0
  250. package/src/react-query/organizationsListOrSearchFacilities.ts +2 -0
  251. package/src/react-query/vendorsGetVendorInvoiceDetails.ts +2 -0
  252. package/src/sdk/companies.ts +3 -1
  253. package/src/sdk/lookups.ts +18 -0
  254. package/src/sdk/sdk.ts +5 -5
  255. package/src/sdk/vendors.ts +1 -0
  256. package/dist/commonjs/models/components/companymanagercontact.d.ts.map +0 -1
  257. package/dist/commonjs/models/components/companymanagercontact.js.map +0 -1
  258. package/dist/esm/models/components/companymanagercontact.d.ts.map +0 -1
  259. package/dist/esm/models/components/companymanagercontact.js.map +0 -1
@@ -69,9 +69,6 @@ export type InvoiceType = OpenEnum<typeof InvoiceType>;
69
69
  *
70
70
  * This is used exclusively to control the visibility of the "Make Payment" button in the UI.
71
71
  * It is not used for any other invoice logic or backend decision-making.
72
- *
73
- * Frontend should compare the logged-in user's ID (for vendors) or company_id (for company managers)
74
- * with these arrays to determine if the payment button should be shown.
75
72
  */
76
73
  export type MayPayInvoice = {
77
74
  /**
@@ -84,6 +81,16 @@ export type MayPayInvoice = {
84
81
  companies?: Array<number> | undefined;
85
82
  };
86
83
 
84
+ export type AssociatedCredentials = {
85
+ id: number;
86
+ vendorId: number | null;
87
+ companyId: number | null;
88
+ /**
89
+ * True when the credential's invoice is paid but its required info has not been submitted yet.
90
+ */
91
+ awaitingSubmission: boolean;
92
+ };
93
+
87
94
  /**
88
95
  * A simplified representation of an Invoice
89
96
  */
@@ -131,11 +138,15 @@ export type Invoice = {
131
138
  *
132
139
  * This is used exclusively to control the visibility of the "Make Payment" button in the UI.
133
140
  * It is not used for any other invoice logic or backend decision-making.
134
- *
135
- * Frontend should compare the logged-in user's ID (for vendors) or company_id (for company managers)
136
- * with these arrays to determine if the payment button should be shown.
137
141
  */
138
142
  mayPayInvoice?: MayPayInvoice | null | undefined;
143
+ /**
144
+ * Credentials this invoice pays for, including those on its child invoices, limited to the ones the caller can read. Only included when `invoice.associated_credentials` is requested in the expand parameter.
145
+ *
146
+ * @remarks
147
+ * Frontend should compare the logged-in user's ID (for vendors) or company_id (for company managers) with these arrays to determine if the payment button should be shown.
148
+ */
149
+ associatedCredentials?: Array<AssociatedCredentials> | null | undefined;
139
150
  };
140
151
 
141
152
  /** @internal */
@@ -243,6 +254,66 @@ export function mayPayInvoiceFromJSON(
243
254
  );
244
255
  }
245
256
 
257
+ /** @internal */
258
+ export const AssociatedCredentials$inboundSchema: z.ZodType<
259
+ AssociatedCredentials,
260
+ z.ZodTypeDef,
261
+ unknown
262
+ > = z.object({
263
+ id: types.number(),
264
+ vendor_id: types.nullable(types.number()),
265
+ company_id: types.nullable(types.number()),
266
+ awaiting_submission: types.boolean(),
267
+ }).transform((v) => {
268
+ return remap$(v, {
269
+ "vendor_id": "vendorId",
270
+ "company_id": "companyId",
271
+ "awaiting_submission": "awaitingSubmission",
272
+ });
273
+ });
274
+ /** @internal */
275
+ export type AssociatedCredentials$Outbound = {
276
+ id: number;
277
+ vendor_id: number | null;
278
+ company_id: number | null;
279
+ awaiting_submission: boolean;
280
+ };
281
+
282
+ /** @internal */
283
+ export const AssociatedCredentials$outboundSchema: z.ZodType<
284
+ AssociatedCredentials$Outbound,
285
+ z.ZodTypeDef,
286
+ AssociatedCredentials
287
+ > = z.object({
288
+ id: z.number().int(),
289
+ vendorId: z.nullable(z.number().int()),
290
+ companyId: z.nullable(z.number().int()),
291
+ awaitingSubmission: z.boolean(),
292
+ }).transform((v) => {
293
+ return remap$(v, {
294
+ vendorId: "vendor_id",
295
+ companyId: "company_id",
296
+ awaitingSubmission: "awaiting_submission",
297
+ });
298
+ });
299
+
300
+ export function associatedCredentialsToJSON(
301
+ associatedCredentials: AssociatedCredentials,
302
+ ): string {
303
+ return JSON.stringify(
304
+ AssociatedCredentials$outboundSchema.parse(associatedCredentials),
305
+ );
306
+ }
307
+ export function associatedCredentialsFromJSON(
308
+ jsonString: string,
309
+ ): SafeParseResult<AssociatedCredentials, SDKValidationError> {
310
+ return safeParse(
311
+ jsonString,
312
+ (x) => AssociatedCredentials$inboundSchema.parse(JSON.parse(x)),
313
+ `Failed to parse 'AssociatedCredentials' from JSON`,
314
+ );
315
+ }
316
+
246
317
  /** @internal */
247
318
  export const Invoice$inboundSchema: z.ZodType<Invoice, z.ZodTypeDef, unknown> =
248
319
  z.object({
@@ -269,6 +340,9 @@ export const Invoice$inboundSchema: z.ZodType<Invoice, z.ZodTypeDef, unknown> =
269
340
  invoice_type: types.optional(InvoiceType$inboundSchema),
270
341
  may_pay_invoice: z.nullable(z.lazy(() => MayPayInvoice$inboundSchema))
271
342
  .optional(),
343
+ associated_credentials: z.nullable(
344
+ z.array(z.lazy(() => AssociatedCredentials$inboundSchema)),
345
+ ).optional(),
272
346
  }).transform((v) => {
273
347
  return remap$(v, {
274
348
  "invoice_number": "invoiceNumber",
@@ -282,6 +356,7 @@ export const Invoice$inboundSchema: z.ZodType<Invoice, z.ZodTypeDef, unknown> =
282
356
  "custom_fields": "customFields",
283
357
  "invoice_type": "invoiceType",
284
358
  "may_pay_invoice": "mayPayInvoice",
359
+ "associated_credentials": "associatedCredentials",
285
360
  });
286
361
  });
287
362
  /** @internal */
@@ -305,6 +380,10 @@ export type Invoice$Outbound = {
305
380
  representative?: string | null | undefined;
306
381
  invoice_type?: string | undefined;
307
382
  may_pay_invoice?: MayPayInvoice$Outbound | null | undefined;
383
+ associated_credentials?:
384
+ | Array<AssociatedCredentials$Outbound>
385
+ | null
386
+ | undefined;
308
387
  };
309
388
 
310
389
  /** @internal */
@@ -335,6 +414,9 @@ export const Invoice$outboundSchema: z.ZodType<
335
414
  invoiceType: InvoiceType$outboundSchema.optional(),
336
415
  mayPayInvoice: z.nullable(z.lazy(() => MayPayInvoice$outboundSchema))
337
416
  .optional(),
417
+ associatedCredentials: z.nullable(
418
+ z.array(z.lazy(() => AssociatedCredentials$outboundSchema)),
419
+ ).optional(),
338
420
  }).transform((v) => {
339
421
  return remap$(v, {
340
422
  invoiceNumber: "invoice_number",
@@ -348,6 +430,7 @@ export const Invoice$outboundSchema: z.ZodType<
348
430
  customFields: "custom_fields",
349
431
  invoiceType: "invoice_type",
350
432
  mayPayInvoice: "may_pay_invoice",
433
+ associatedCredentials: "associated_credentials",
351
434
  });
352
435
  });
353
436
 
@@ -133,6 +133,7 @@ export * from "./listvendorscrubpackages.js";
133
133
  export * from "./listvendorscrubpurchases.js";
134
134
  export * from "./listvendortypes.js";
135
135
  export * from "./lookupcompanies.js";
136
+ export * from "./lookupcompanymanagers.js";
136
137
  export * from "./lookuppostalcode.js";
137
138
  export * from "./magiclink.js";
138
139
  export * from "./makepayment.js";
@@ -11,7 +11,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
11
 
12
12
  export type ListCompanyManagerContactsRequest = {
13
13
  /**
14
- * Id of the company whose manager contacts are being listed.
14
+ * Id of the company whose managers are being listed.
15
15
  */
16
16
  companyId: number;
17
17
  };
@@ -20,7 +20,7 @@ export type ListCompanyManagerContactsRequest = {
20
20
  * The request was successful, and the server has returned the requested resource in the response body.
21
21
  */
22
22
  export type ListCompanyManagerContactsListCompanyManagerContactsOk = {
23
- items: Array<components.CompanyManagerContact>;
23
+ items: Array<components.CompanyManagerLookup>;
24
24
  };
25
25
 
26
26
  /** @internal */
@@ -58,7 +58,7 @@ export const ListCompanyManagerContactsListCompanyManagerContactsOk$inboundSchem
58
58
  z.ZodTypeDef,
59
59
  unknown
60
60
  > = z.object({
61
- items: z.array(components.CompanyManagerContact$inboundSchema),
61
+ items: z.array(components.CompanyManagerLookup$inboundSchema),
62
62
  });
63
63
 
64
64
  export function listCompanyManagerContactsListCompanyManagerContactsOkFromJSON(
@@ -18,14 +18,14 @@ export type QueryParamExpand = ClosedEnum<typeof QueryParamExpand>;
18
18
  /**
19
19
  * Filter systems to those with facilities of the given use type.
20
20
  */
21
- export const Use = {
21
+ export const QueryParamUse = {
22
22
  Credentialing: "credentialing",
23
23
  VisitorManagement: "visitor_management",
24
24
  } as const;
25
25
  /**
26
26
  * Filter systems to those with facilities of the given use type.
27
27
  */
28
- export type Use = ClosedEnum<typeof Use>;
28
+ export type QueryParamUse = ClosedEnum<typeof QueryParamUse>;
29
29
 
30
30
  export type ListLookupSystemsRequest = {
31
31
  /**
@@ -35,7 +35,7 @@ export type ListLookupSystemsRequest = {
35
35
  /**
36
36
  * Filter systems to those with facilities of the given use type.
37
37
  */
38
- use?: Use | undefined;
38
+ use?: QueryParamUse | undefined;
39
39
  };
40
40
 
41
41
  /**
@@ -51,9 +51,9 @@ export const QueryParamExpand$outboundSchema: z.ZodNativeEnum<
51
51
  > = z.nativeEnum(QueryParamExpand);
52
52
 
53
53
  /** @internal */
54
- export const Use$outboundSchema: z.ZodNativeEnum<typeof Use> = z.nativeEnum(
55
- Use,
56
- );
54
+ export const QueryParamUse$outboundSchema: z.ZodNativeEnum<
55
+ typeof QueryParamUse
56
+ > = z.nativeEnum(QueryParamUse);
57
57
 
58
58
  /** @internal */
59
59
  export type ListLookupSystemsRequest$Outbound = {
@@ -68,7 +68,7 @@ export const ListLookupSystemsRequest$outboundSchema: z.ZodType<
68
68
  ListLookupSystemsRequest
69
69
  > = z.object({
70
70
  expand: z.array(QueryParamExpand$outboundSchema).optional(),
71
- use: Use$outboundSchema.optional(),
71
+ use: QueryParamUse$outboundSchema.optional(),
72
72
  });
73
73
 
74
74
  export function listLookupSystemsRequestToJSON(
@@ -22,6 +22,17 @@ export const Targeted = {
22
22
  */
23
23
  export type Targeted = ClosedEnum<typeof Targeted>;
24
24
 
25
+ /**
26
+ * Narrow the listing to facilities that are selectable for a given product. `credentialing` restricts the response to facilities in the caller's own site that use credentialing and are publicly listed — exactly the facilities `POST /api/vendors` accepts as a `primary_facility_id`, so a picker built on this endpoint cannot offer a facility that the create call would then reject.
27
+ */
28
+ export const Use = {
29
+ Credentialing: "credentialing",
30
+ } as const;
31
+ /**
32
+ * Narrow the listing to facilities that are selectable for a given product. `credentialing` restricts the response to facilities in the caller's own site that use credentialing and are publicly listed — exactly the facilities `POST /api/vendors` accepts as a `primary_facility_id`, so a picker built on this endpoint cannot offer a facility that the create call would then reject.
33
+ */
34
+ export type Use = ClosedEnum<typeof Use>;
35
+
25
36
  export type ListOrSearchFacilitiesRequest = {
26
37
  /**
27
38
  * A comma-separated list of object attributes to sort on.
@@ -75,6 +86,10 @@ export type ListOrSearchFacilitiesRequest = {
75
86
  * For Company Manager callers, filter facilities by whether the manager's company has already targeted them via a `CompanyTargetFacility` link. Only `false` is accepted — restricts the response to same-site facilities the company has not yet targeted (useful when discovering candidate facilities the company could newly target). The facilities a company already targets are available from `GET /api/companies/{company_id}/target-facilities`. Ignored for non-Company-Manager callers.
76
87
  */
77
88
  targeted?: Targeted | undefined;
89
+ /**
90
+ * Narrow the listing to facilities that are selectable for a given product. `credentialing` restricts the response to facilities in the caller's own site that use credentialing and are publicly listed — exactly the facilities `POST /api/vendors` accepts as a `primary_facility_id`, so a picker built on this endpoint cannot offer a facility that the create call would then reject.
91
+ */
92
+ use?: Use | undefined;
78
93
  };
79
94
 
80
95
  /**
@@ -96,6 +111,11 @@ export type ListOrSearchFacilitiesResponse = {
96
111
  export const Targeted$outboundSchema: z.ZodNativeEnum<typeof Targeted> = z
97
112
  .nativeEnum(Targeted);
98
113
 
114
+ /** @internal */
115
+ export const Use$outboundSchema: z.ZodNativeEnum<typeof Use> = z.nativeEnum(
116
+ Use,
117
+ );
118
+
99
119
  /** @internal */
100
120
  export type ListOrSearchFacilitiesRequest$Outbound = {
101
121
  sort?: string | null | undefined;
@@ -110,6 +130,7 @@ export type ListOrSearchFacilitiesRequest$Outbound = {
110
130
  latitude?: number | undefined;
111
131
  longitude?: number | undefined;
112
132
  targeted?: string | undefined;
133
+ use?: string | undefined;
113
134
  };
114
135
 
115
136
  /** @internal */
@@ -130,6 +151,7 @@ export const ListOrSearchFacilitiesRequest$outboundSchema: z.ZodType<
130
151
  latitude: z.number().optional(),
131
152
  longitude: z.number().optional(),
132
153
  targeted: Targeted$outboundSchema.optional(),
154
+ use: Use$outboundSchema.optional(),
133
155
  }).transform((v) => {
134
156
  return remap$(v, {
135
157
  itemsPerPage: "items_per_page",
@@ -0,0 +1,78 @@
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 { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as components from "../components/index.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type LookupCompanyManagersRequest = {
13
+ /**
14
+ * Id of the company whose managers are being listed.
15
+ */
16
+ companyId: number;
17
+ };
18
+
19
+ /**
20
+ * The request was successful, and the server has returned the requested resource in the response body.
21
+ */
22
+ export type LookupCompanyManagersLookupCompanyManagersOk = {
23
+ items: Array<components.CompanyManagerLookup>;
24
+ };
25
+
26
+ /** @internal */
27
+ export type LookupCompanyManagersRequest$Outbound = {
28
+ company_id: number;
29
+ };
30
+
31
+ /** @internal */
32
+ export const LookupCompanyManagersRequest$outboundSchema: z.ZodType<
33
+ LookupCompanyManagersRequest$Outbound,
34
+ z.ZodTypeDef,
35
+ LookupCompanyManagersRequest
36
+ > = z.object({
37
+ companyId: z.number().int(),
38
+ }).transform((v) => {
39
+ return remap$(v, {
40
+ companyId: "company_id",
41
+ });
42
+ });
43
+
44
+ export function lookupCompanyManagersRequestToJSON(
45
+ lookupCompanyManagersRequest: LookupCompanyManagersRequest,
46
+ ): string {
47
+ return JSON.stringify(
48
+ LookupCompanyManagersRequest$outboundSchema.parse(
49
+ lookupCompanyManagersRequest,
50
+ ),
51
+ );
52
+ }
53
+
54
+ /** @internal */
55
+ export const LookupCompanyManagersLookupCompanyManagersOk$inboundSchema:
56
+ z.ZodType<
57
+ LookupCompanyManagersLookupCompanyManagersOk,
58
+ z.ZodTypeDef,
59
+ unknown
60
+ > = z.object({
61
+ items: z.array(components.CompanyManagerLookup$inboundSchema),
62
+ });
63
+
64
+ export function lookupCompanyManagersLookupCompanyManagersOkFromJSON(
65
+ jsonString: string,
66
+ ): SafeParseResult<
67
+ LookupCompanyManagersLookupCompanyManagersOk,
68
+ SDKValidationError
69
+ > {
70
+ return safeParse(
71
+ jsonString,
72
+ (x) =>
73
+ LookupCompanyManagersLookupCompanyManagersOk$inboundSchema.parse(
74
+ JSON.parse(x),
75
+ ),
76
+ `Failed to parse 'LookupCompanyManagersLookupCompanyManagersOk' from JSON`,
77
+ );
78
+ }
@@ -56,7 +56,9 @@ export type CompaniesListCompanyManagerContactsQueryError =
56
56
  * List the contact details of a company's managers
57
57
  *
58
58
  * @remarks
59
- * List the active managers of a company who have an email address, so someone who belongs to that company can contact them. Readable by a vendor of the company, a manager of the company, or an admin; every other caller receives a 404. Carries only the fields needed to address a message, not the full company manager or user record. Distinct from `/companies/{company_id}/managers`, which is the administration listing and is gated on the `company_managers` view permission.
59
+ * Deprecated in favor of `/lookups/company_managers`, which returns the same list. Kept so app builds released before the move keep working.
60
+ *
61
+ * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
60
62
  */
61
63
  export function useCompaniesListCompanyManagerContacts(
62
64
  request: operations.ListCompanyManagerContactsRequest,
@@ -83,7 +85,9 @@ export function useCompaniesListCompanyManagerContacts(
83
85
  * List the contact details of a company's managers
84
86
  *
85
87
  * @remarks
86
- * List the active managers of a company who have an email address, so someone who belongs to that company can contact them. Readable by a vendor of the company, a manager of the company, or an admin; every other caller receives a 404. Carries only the fields needed to address a message, not the full company manager or user record. Distinct from `/companies/{company_id}/managers`, which is the administration listing and is gated on the `company_managers` view permission.
88
+ * Deprecated in favor of `/lookups/company_managers`, which returns the same list. Kept so app builds released before the move keep working.
89
+ *
90
+ * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
87
91
  */
88
92
  export function useCompaniesListCompanyManagerContactsSuspense(
89
93
  request: operations.ListCompanyManagerContactsRequest,
@@ -44,6 +44,7 @@ export * from "./invoicesListInvoices.js";
44
44
  export * from "./invoicesMakePayment.js";
45
45
  export * from "./invoicesUpdateInvoice.js";
46
46
  export * from "./lookupsListLookupSystems.js";
47
+ export * from "./lookupsLookupCompanyManagers.js";
47
48
  export * from "./lookupsLookupPostalCode.js";
48
49
  export * from "./medicalProductsCreateDistributor.js";
49
50
  export * from "./medicalProductsCreateManufacturer.js";
@@ -72,7 +72,7 @@ export function buildLookupsListLookupSystemsQuery(
72
72
  export function queryKeyLookupsListLookupSystems(
73
73
  parameters: {
74
74
  expand?: Array<operations.QueryParamExpand> | undefined;
75
- use?: operations.Use | undefined;
75
+ use?: operations.QueryParamUse | undefined;
76
76
  },
77
77
  ): QueryKey {
78
78
  return [
@@ -125,7 +125,7 @@ export function setLookupsListLookupSystemsData(
125
125
  queryKeyBase: [
126
126
  parameters: {
127
127
  expand?: Array<operations.QueryParamExpand> | undefined;
128
- use?: operations.Use | undefined;
128
+ use?: operations.QueryParamUse | undefined;
129
129
  },
130
130
  ],
131
131
  data: LookupsListLookupSystemsQueryData,
@@ -140,7 +140,7 @@ export function invalidateLookupsListLookupSystems(
140
140
  queryKeyBase: TupleToPrefixes<
141
141
  [parameters: {
142
142
  expand?: Array<operations.QueryParamExpand> | undefined;
143
- use?: operations.Use | undefined;
143
+ use?: operations.QueryParamUse | undefined;
144
144
  }]
145
145
  >,
146
146
  filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
@@ -0,0 +1,80 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import {
6
+ QueryClient,
7
+ QueryFunctionContext,
8
+ QueryKey,
9
+ } from "@tanstack/react-query";
10
+ import { GreenSecurityCore } from "../core.js";
11
+ import { lookupsLookupCompanyManagers } from "../funcs/lookupsLookupCompanyManagers.js";
12
+ import { combineSignals } from "../lib/primitives.js";
13
+ import { RequestOptions } from "../lib/sdks.js";
14
+ import * as operations from "../models/operations/index.js";
15
+ import { unwrapAsync } from "../types/fp.js";
16
+ export type LookupsLookupCompanyManagersQueryData =
17
+ operations.LookupCompanyManagersLookupCompanyManagersOk;
18
+
19
+ export function prefetchLookupsLookupCompanyManagers(
20
+ queryClient: QueryClient,
21
+ client$: GreenSecurityCore,
22
+ request: operations.LookupCompanyManagersRequest,
23
+ options?: RequestOptions,
24
+ ): Promise<void> {
25
+ return queryClient.prefetchQuery({
26
+ ...buildLookupsLookupCompanyManagersQuery(
27
+ client$,
28
+ request,
29
+ options,
30
+ ),
31
+ });
32
+ }
33
+
34
+ export function buildLookupsLookupCompanyManagersQuery(
35
+ client$: GreenSecurityCore,
36
+ request: operations.LookupCompanyManagersRequest,
37
+ options?: RequestOptions,
38
+ ): {
39
+ queryKey: QueryKey;
40
+ queryFn: (
41
+ context: QueryFunctionContext,
42
+ ) => Promise<LookupsLookupCompanyManagersQueryData>;
43
+ } {
44
+ return {
45
+ queryKey: queryKeyLookupsLookupCompanyManagers({
46
+ companyId: request.companyId,
47
+ }),
48
+ queryFn: async function lookupsLookupCompanyManagersQueryFn(
49
+ ctx,
50
+ ): Promise<LookupsLookupCompanyManagersQueryData> {
51
+ const sig = combineSignals(
52
+ ctx.signal,
53
+ options?.signal,
54
+ options?.fetchOptions?.signal,
55
+ );
56
+ const mergedOptions = {
57
+ ...options?.fetchOptions,
58
+ ...options,
59
+ signal: sig,
60
+ };
61
+
62
+ return unwrapAsync(lookupsLookupCompanyManagers(
63
+ client$,
64
+ request,
65
+ mergedOptions,
66
+ ));
67
+ },
68
+ };
69
+ }
70
+
71
+ export function queryKeyLookupsLookupCompanyManagers(
72
+ parameters: { companyId: number },
73
+ ): QueryKey {
74
+ return [
75
+ "@greensecurity/javascript-sdk",
76
+ "lookups",
77
+ "lookupCompanyManagers",
78
+ parameters,
79
+ ];
80
+ }
@@ -0,0 +1,147 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import {
6
+ InvalidateQueryFilters,
7
+ QueryClient,
8
+ useQuery,
9
+ UseQueryResult,
10
+ useSuspenseQuery,
11
+ UseSuspenseQueryResult,
12
+ } from "@tanstack/react-query";
13
+ import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
14
+ import {
15
+ ConnectionError,
16
+ InvalidRequestError,
17
+ RequestAbortedError,
18
+ RequestTimeoutError,
19
+ UnexpectedClientError,
20
+ } from "../models/errors/httpclienterrors.js";
21
+ import * as errors from "../models/errors/index.js";
22
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
23
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import * as operations from "../models/operations/index.js";
25
+ import { useGreenSecurityContext } from "./_context.js";
26
+ import {
27
+ QueryHookOptions,
28
+ SuspenseQueryHookOptions,
29
+ TupleToPrefixes,
30
+ } from "./_types.js";
31
+ import {
32
+ buildLookupsLookupCompanyManagersQuery,
33
+ LookupsLookupCompanyManagersQueryData,
34
+ prefetchLookupsLookupCompanyManagers,
35
+ queryKeyLookupsLookupCompanyManagers,
36
+ } from "./lookupsLookupCompanyManagers.core.js";
37
+ export {
38
+ buildLookupsLookupCompanyManagersQuery,
39
+ type LookupsLookupCompanyManagersQueryData,
40
+ prefetchLookupsLookupCompanyManagers,
41
+ queryKeyLookupsLookupCompanyManagers,
42
+ };
43
+
44
+ export type LookupsLookupCompanyManagersQueryError =
45
+ | errors.ApiErrorResponse
46
+ | GreenSecurityError
47
+ | ResponseValidationError
48
+ | ConnectionError
49
+ | RequestAbortedError
50
+ | RequestTimeoutError
51
+ | InvalidRequestError
52
+ | UnexpectedClientError
53
+ | SDKValidationError;
54
+
55
+ /**
56
+ * List the managers of a company for addressing a message
57
+ *
58
+ * @remarks
59
+ * List the active managers of a company who have an email address, so someone who belongs to that company can contact them. Readable by a vendor of the company, a manager of the company, or an admin; every other caller receives a 404. Carries only the fields needed to address a message, not the full company manager or user record. Distinct from `/companies/{id}/managers`, which is the administration listing and is gated on the `company_managers` view permission.
60
+ */
61
+ export function useLookupsLookupCompanyManagers(
62
+ request: operations.LookupCompanyManagersRequest,
63
+ options?: QueryHookOptions<
64
+ LookupsLookupCompanyManagersQueryData,
65
+ LookupsLookupCompanyManagersQueryError
66
+ >,
67
+ ): UseQueryResult<
68
+ LookupsLookupCompanyManagersQueryData,
69
+ LookupsLookupCompanyManagersQueryError
70
+ > {
71
+ const client = useGreenSecurityContext();
72
+ return useQuery({
73
+ ...buildLookupsLookupCompanyManagersQuery(
74
+ client,
75
+ request,
76
+ options,
77
+ ),
78
+ ...options,
79
+ });
80
+ }
81
+
82
+ /**
83
+ * List the managers of a company for addressing a message
84
+ *
85
+ * @remarks
86
+ * List the active managers of a company who have an email address, so someone who belongs to that company can contact them. Readable by a vendor of the company, a manager of the company, or an admin; every other caller receives a 404. Carries only the fields needed to address a message, not the full company manager or user record. Distinct from `/companies/{id}/managers`, which is the administration listing and is gated on the `company_managers` view permission.
87
+ */
88
+ export function useLookupsLookupCompanyManagersSuspense(
89
+ request: operations.LookupCompanyManagersRequest,
90
+ options?: SuspenseQueryHookOptions<
91
+ LookupsLookupCompanyManagersQueryData,
92
+ LookupsLookupCompanyManagersQueryError
93
+ >,
94
+ ): UseSuspenseQueryResult<
95
+ LookupsLookupCompanyManagersQueryData,
96
+ LookupsLookupCompanyManagersQueryError
97
+ > {
98
+ const client = useGreenSecurityContext();
99
+ return useSuspenseQuery({
100
+ ...buildLookupsLookupCompanyManagersQuery(
101
+ client,
102
+ request,
103
+ options,
104
+ ),
105
+ ...options,
106
+ });
107
+ }
108
+
109
+ export function setLookupsLookupCompanyManagersData(
110
+ client: QueryClient,
111
+ queryKeyBase: [parameters: { companyId: number }],
112
+ data: LookupsLookupCompanyManagersQueryData,
113
+ ): LookupsLookupCompanyManagersQueryData | undefined {
114
+ const key = queryKeyLookupsLookupCompanyManagers(...queryKeyBase);
115
+
116
+ return client.setQueryData<LookupsLookupCompanyManagersQueryData>(key, data);
117
+ }
118
+
119
+ export function invalidateLookupsLookupCompanyManagers(
120
+ client: QueryClient,
121
+ queryKeyBase: TupleToPrefixes<[parameters: { companyId: number }]>,
122
+ filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
123
+ ): Promise<void> {
124
+ return client.invalidateQueries({
125
+ ...filters,
126
+ queryKey: [
127
+ "@greensecurity/javascript-sdk",
128
+ "lookups",
129
+ "lookupCompanyManagers",
130
+ ...queryKeyBase,
131
+ ],
132
+ });
133
+ }
134
+
135
+ export function invalidateAllLookupsLookupCompanyManagers(
136
+ client: QueryClient,
137
+ filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
138
+ ): Promise<void> {
139
+ return client.invalidateQueries({
140
+ ...filters,
141
+ queryKey: [
142
+ "@greensecurity/javascript-sdk",
143
+ "lookups",
144
+ "lookupCompanyManagers",
145
+ ],
146
+ });
147
+ }