@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.
- package/README.md +7 -4
- package/dist/commonjs/__tests__/lookups.test.js +24 -0
- package/dist/commonjs/__tests__/lookups.test.js.map +1 -1
- package/dist/commonjs/__tests__/vendors.test.js +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 -11
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/funcs/companiesListCompanyManagerContacts.d.ts +3 -1
- package/dist/commonjs/funcs/companiesListCompanyManagerContacts.d.ts.map +1 -1
- package/dist/commonjs/funcs/companiesListCompanyManagerContacts.js +3 -1
- package/dist/commonjs/funcs/companiesListCompanyManagerContacts.js.map +1 -1
- package/dist/commonjs/funcs/lookupsLookupCompanyManagers.d.ts +18 -0
- package/dist/commonjs/funcs/lookupsLookupCompanyManagers.d.ts.map +1 -0
- package/dist/commonjs/funcs/lookupsLookupCompanyManagers.js +121 -0
- package/dist/commonjs/funcs/lookupsLookupCompanyManagers.js.map +1 -0
- package/dist/commonjs/funcs/organizationsListOrSearchFacilities.js +1 -0
- package/dist/commonjs/funcs/organizationsListOrSearchFacilities.js.map +1 -1
- package/dist/commonjs/funcs/vendorsGetVendorInvoiceDetails.d.ts +1 -0
- package/dist/commonjs/funcs/vendorsGetVendorInvoiceDetails.d.ts.map +1 -1
- package/dist/commonjs/funcs/vendorsGetVendorInvoiceDetails.js +1 -0
- package/dist/commonjs/funcs/vendorsGetVendorInvoiceDetails.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/components/alert.d.ts +3 -2
- package/dist/commonjs/models/components/alert.d.ts.map +1 -1
- package/dist/commonjs/models/components/alert.js +2 -0
- package/dist/commonjs/models/components/alert.js.map +1 -1
- package/dist/commonjs/models/components/{companymanagercontact.d.ts → companymanagerlookup.d.ts} +4 -4
- package/dist/commonjs/models/components/companymanagerlookup.d.ts.map +1 -0
- package/dist/commonjs/models/components/{companymanagercontact.js → companymanagerlookup.js} +6 -6
- package/dist/commonjs/models/components/companymanagerlookup.js.map +1 -0
- package/dist/commonjs/models/components/expand.d.ts +1 -0
- package/dist/commonjs/models/components/expand.d.ts.map +1 -1
- package/dist/commonjs/models/components/expand.js +1 -0
- package/dist/commonjs/models/components/expand.js.map +1 -1
- package/dist/commonjs/models/components/index.d.ts +1 -1
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +1 -1
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/invoice.d.ts +30 -6
- package/dist/commonjs/models/components/invoice.d.ts.map +1 -1
- package/dist/commonjs/models/components/invoice.js +39 -1
- package/dist/commonjs/models/components/invoice.js.map +1 -1
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/listcompanymanagercontacts.d.ts +2 -2
- package/dist/commonjs/models/operations/listcompanymanagercontacts.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listcompanymanagercontacts.js +1 -1
- package/dist/commonjs/models/operations/listcompanymanagercontacts.js.map +1 -1
- package/dist/commonjs/models/operations/listlookupsystems.d.ts +4 -4
- package/dist/commonjs/models/operations/listlookupsystems.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listlookupsystems.js +4 -4
- package/dist/commonjs/models/operations/listlookupsystems.js.map +1 -1
- package/dist/commonjs/models/operations/listorsearchfacilities.d.ts +17 -0
- package/dist/commonjs/models/operations/listorsearchfacilities.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listorsearchfacilities.js +10 -1
- package/dist/commonjs/models/operations/listorsearchfacilities.js.map +1 -1
- package/dist/commonjs/models/operations/lookupcompanymanagers.d.ts +27 -0
- package/dist/commonjs/models/operations/lookupcompanymanagers.d.ts.map +1 -0
- package/dist/commonjs/models/operations/lookupcompanymanagers.js +64 -0
- package/dist/commonjs/models/operations/lookupcompanymanagers.js.map +1 -0
- package/dist/commonjs/react-query/companiesListCompanyManagerContacts.d.ts +6 -2
- package/dist/commonjs/react-query/companiesListCompanyManagerContacts.d.ts.map +1 -1
- package/dist/commonjs/react-query/companiesListCompanyManagerContacts.js +6 -2
- package/dist/commonjs/react-query/companiesListCompanyManagerContacts.js.map +1 -1
- package/dist/commonjs/react-query/index.d.ts +1 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +1 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/lookupsListLookupSystems.core.d.ts +1 -1
- package/dist/commonjs/react-query/lookupsListLookupSystems.core.d.ts.map +1 -1
- package/dist/commonjs/react-query/lookupsListLookupSystems.d.ts +2 -2
- package/dist/commonjs/react-query/lookupsListLookupSystems.d.ts.map +1 -1
- package/dist/commonjs/react-query/lookupsLookupCompanyManagers.core.d.ts +14 -0
- package/dist/commonjs/react-query/lookupsLookupCompanyManagers.core.d.ts.map +1 -0
- package/dist/commonjs/react-query/lookupsLookupCompanyManagers.core.js +41 -0
- package/dist/commonjs/react-query/lookupsLookupCompanyManagers.core.js.map +1 -0
- package/dist/commonjs/react-query/lookupsLookupCompanyManagers.d.ts +33 -0
- package/dist/commonjs/react-query/lookupsLookupCompanyManagers.d.ts.map +1 -0
- package/dist/commonjs/react-query/lookupsLookupCompanyManagers.js +69 -0
- package/dist/commonjs/react-query/lookupsLookupCompanyManagers.js.map +1 -0
- package/dist/commonjs/react-query/organizationsListOrSearchFacilities.core.d.ts +2 -0
- package/dist/commonjs/react-query/organizationsListOrSearchFacilities.core.d.ts.map +1 -1
- package/dist/commonjs/react-query/organizationsListOrSearchFacilities.core.js +2 -0
- package/dist/commonjs/react-query/organizationsListOrSearchFacilities.core.js.map +1 -1
- package/dist/commonjs/react-query/organizationsListOrSearchFacilities.d.ts +2 -0
- package/dist/commonjs/react-query/organizationsListOrSearchFacilities.d.ts.map +1 -1
- package/dist/commonjs/react-query/organizationsListOrSearchFacilities.js.map +1 -1
- package/dist/commonjs/react-query/vendorsGetVendorInvoiceDetails.d.ts +2 -0
- package/dist/commonjs/react-query/vendorsGetVendorInvoiceDetails.d.ts.map +1 -1
- package/dist/commonjs/react-query/vendorsGetVendorInvoiceDetails.js +2 -0
- package/dist/commonjs/react-query/vendorsGetVendorInvoiceDetails.js.map +1 -1
- package/dist/commonjs/sdk/companies.d.ts +3 -1
- package/dist/commonjs/sdk/companies.d.ts.map +1 -1
- package/dist/commonjs/sdk/companies.js +3 -1
- package/dist/commonjs/sdk/companies.js.map +1 -1
- package/dist/commonjs/sdk/lookups.d.ts +7 -0
- package/dist/commonjs/sdk/lookups.d.ts.map +1 -1
- package/dist/commonjs/sdk/lookups.js +10 -0
- package/dist/commonjs/sdk/lookups.js.map +1 -1
- package/dist/commonjs/sdk/sdk.d.ts +2 -2
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +3 -3
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/commonjs/sdk/vendors.d.ts +1 -0
- package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
- package/dist/commonjs/sdk/vendors.js +1 -0
- package/dist/commonjs/sdk/vendors.js.map +1 -1
- package/dist/esm/__tests__/lookups.test.js +24 -0
- package/dist/esm/__tests__/lookups.test.js.map +1 -1
- package/dist/esm/__tests__/vendors.test.js +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 -11
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/funcs/companiesListCompanyManagerContacts.d.ts +3 -1
- package/dist/esm/funcs/companiesListCompanyManagerContacts.d.ts.map +1 -1
- package/dist/esm/funcs/companiesListCompanyManagerContacts.js +3 -1
- package/dist/esm/funcs/companiesListCompanyManagerContacts.js.map +1 -1
- package/dist/esm/funcs/lookupsLookupCompanyManagers.d.ts +18 -0
- package/dist/esm/funcs/lookupsLookupCompanyManagers.d.ts.map +1 -0
- package/dist/esm/funcs/lookupsLookupCompanyManagers.js +85 -0
- package/dist/esm/funcs/lookupsLookupCompanyManagers.js.map +1 -0
- package/dist/esm/funcs/organizationsListOrSearchFacilities.js +1 -0
- package/dist/esm/funcs/organizationsListOrSearchFacilities.js.map +1 -1
- package/dist/esm/funcs/vendorsGetVendorInvoiceDetails.d.ts +1 -0
- package/dist/esm/funcs/vendorsGetVendorInvoiceDetails.d.ts.map +1 -1
- package/dist/esm/funcs/vendorsGetVendorInvoiceDetails.js +1 -0
- package/dist/esm/funcs/vendorsGetVendorInvoiceDetails.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/components/alert.d.ts +3 -2
- package/dist/esm/models/components/alert.d.ts.map +1 -1
- package/dist/esm/models/components/alert.js +2 -0
- package/dist/esm/models/components/alert.js.map +1 -1
- package/dist/esm/models/components/{companymanagercontact.d.ts → companymanagerlookup.d.ts} +4 -4
- package/dist/esm/models/components/companymanagerlookup.d.ts.map +1 -0
- package/dist/esm/models/components/{companymanagercontact.js → companymanagerlookup.js} +4 -4
- package/dist/esm/models/components/companymanagerlookup.js.map +1 -0
- package/dist/esm/models/components/expand.d.ts +1 -0
- package/dist/esm/models/components/expand.d.ts.map +1 -1
- package/dist/esm/models/components/expand.js +1 -0
- package/dist/esm/models/components/expand.js.map +1 -1
- package/dist/esm/models/components/index.d.ts +1 -1
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +1 -1
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/invoice.d.ts +30 -6
- package/dist/esm/models/components/invoice.d.ts.map +1 -1
- package/dist/esm/models/components/invoice.js +36 -0
- package/dist/esm/models/components/invoice.js.map +1 -1
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/listcompanymanagercontacts.d.ts +2 -2
- package/dist/esm/models/operations/listcompanymanagercontacts.d.ts.map +1 -1
- package/dist/esm/models/operations/listcompanymanagercontacts.js +1 -1
- package/dist/esm/models/operations/listcompanymanagercontacts.js.map +1 -1
- package/dist/esm/models/operations/listlookupsystems.d.ts +4 -4
- package/dist/esm/models/operations/listlookupsystems.d.ts.map +1 -1
- package/dist/esm/models/operations/listlookupsystems.js +3 -3
- package/dist/esm/models/operations/listlookupsystems.js.map +1 -1
- package/dist/esm/models/operations/listorsearchfacilities.d.ts +17 -0
- package/dist/esm/models/operations/listorsearchfacilities.d.ts.map +1 -1
- package/dist/esm/models/operations/listorsearchfacilities.js +9 -0
- package/dist/esm/models/operations/listorsearchfacilities.js.map +1 -1
- package/dist/esm/models/operations/lookupcompanymanagers.d.ts +27 -0
- package/dist/esm/models/operations/lookupcompanymanagers.d.ts.map +1 -0
- package/dist/esm/models/operations/lookupcompanymanagers.js +26 -0
- package/dist/esm/models/operations/lookupcompanymanagers.js.map +1 -0
- package/dist/esm/react-query/companiesListCompanyManagerContacts.d.ts +6 -2
- package/dist/esm/react-query/companiesListCompanyManagerContacts.d.ts.map +1 -1
- package/dist/esm/react-query/companiesListCompanyManagerContacts.js +6 -2
- package/dist/esm/react-query/companiesListCompanyManagerContacts.js.map +1 -1
- package/dist/esm/react-query/index.d.ts +1 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +1 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/lookupsListLookupSystems.core.d.ts +1 -1
- package/dist/esm/react-query/lookupsListLookupSystems.core.d.ts.map +1 -1
- package/dist/esm/react-query/lookupsListLookupSystems.d.ts +2 -2
- package/dist/esm/react-query/lookupsListLookupSystems.d.ts.map +1 -1
- package/dist/esm/react-query/lookupsLookupCompanyManagers.core.d.ts +14 -0
- package/dist/esm/react-query/lookupsLookupCompanyManagers.core.d.ts.map +1 -0
- package/dist/esm/react-query/lookupsLookupCompanyManagers.core.js +36 -0
- package/dist/esm/react-query/lookupsLookupCompanyManagers.core.js.map +1 -0
- package/dist/esm/react-query/lookupsLookupCompanyManagers.d.ts +33 -0
- package/dist/esm/react-query/lookupsLookupCompanyManagers.d.ts.map +1 -0
- package/dist/esm/react-query/lookupsLookupCompanyManagers.js +59 -0
- package/dist/esm/react-query/lookupsLookupCompanyManagers.js.map +1 -0
- package/dist/esm/react-query/organizationsListOrSearchFacilities.core.d.ts +2 -0
- package/dist/esm/react-query/organizationsListOrSearchFacilities.core.d.ts.map +1 -1
- package/dist/esm/react-query/organizationsListOrSearchFacilities.core.js +2 -0
- package/dist/esm/react-query/organizationsListOrSearchFacilities.core.js.map +1 -1
- package/dist/esm/react-query/organizationsListOrSearchFacilities.d.ts +2 -0
- package/dist/esm/react-query/organizationsListOrSearchFacilities.d.ts.map +1 -1
- package/dist/esm/react-query/organizationsListOrSearchFacilities.js.map +1 -1
- package/dist/esm/react-query/vendorsGetVendorInvoiceDetails.d.ts +2 -0
- package/dist/esm/react-query/vendorsGetVendorInvoiceDetails.d.ts.map +1 -1
- package/dist/esm/react-query/vendorsGetVendorInvoiceDetails.js +2 -0
- package/dist/esm/react-query/vendorsGetVendorInvoiceDetails.js.map +1 -1
- package/dist/esm/sdk/companies.d.ts +3 -1
- package/dist/esm/sdk/companies.d.ts.map +1 -1
- package/dist/esm/sdk/companies.js +3 -1
- package/dist/esm/sdk/companies.js.map +1 -1
- package/dist/esm/sdk/lookups.d.ts +7 -0
- package/dist/esm/sdk/lookups.d.ts.map +1 -1
- package/dist/esm/sdk/lookups.js +10 -0
- package/dist/esm/sdk/lookups.js.map +1 -1
- package/dist/esm/sdk/sdk.d.ts +2 -2
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +3 -3
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/dist/esm/sdk/vendors.d.ts +1 -0
- package/dist/esm/sdk/vendors.d.ts.map +1 -1
- package/dist/esm/sdk/vendors.js +1 -0
- package/dist/esm/sdk/vendors.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +2 -2
- package/src/__tests__/lookups.test.ts +27 -0
- package/src/__tests__/vendors.test.ts +1 -1
- package/src/__tests__/webhooks.test.ts +1 -1
- package/src/__tests__/zones.test.ts +4 -11
- package/src/funcs/companiesListCompanyManagerContacts.ts +3 -1
- package/src/funcs/lookupsLookupCompanyManagers.ts +178 -0
- package/src/funcs/organizationsListOrSearchFacilities.ts +1 -0
- package/src/funcs/vendorsGetVendorInvoiceDetails.ts +1 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/alert.ts +5 -2
- package/src/models/components/{companymanagercontact.ts → companymanagerlookup.ts} +7 -7
- package/src/models/components/expand.ts +1 -0
- package/src/models/components/index.ts +1 -1
- package/src/models/components/invoice.ts +89 -6
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/listcompanymanagercontacts.ts +3 -3
- package/src/models/operations/listlookupsystems.ts +7 -7
- package/src/models/operations/listorsearchfacilities.ts +22 -0
- package/src/models/operations/lookupcompanymanagers.ts +78 -0
- package/src/react-query/companiesListCompanyManagerContacts.ts +6 -2
- package/src/react-query/index.ts +1 -0
- package/src/react-query/lookupsListLookupSystems.core.ts +1 -1
- package/src/react-query/lookupsListLookupSystems.ts +2 -2
- package/src/react-query/lookupsLookupCompanyManagers.core.ts +80 -0
- package/src/react-query/lookupsLookupCompanyManagers.ts +147 -0
- package/src/react-query/organizationsListOrSearchFacilities.core.ts +4 -0
- package/src/react-query/organizationsListOrSearchFacilities.ts +2 -0
- package/src/react-query/vendorsGetVendorInvoiceDetails.ts +2 -0
- package/src/sdk/companies.ts +3 -1
- package/src/sdk/lookups.ts +18 -0
- package/src/sdk/sdk.ts +5 -5
- package/src/sdk/vendors.ts +1 -0
- package/dist/commonjs/models/components/companymanagercontact.d.ts.map +0 -1
- package/dist/commonjs/models/components/companymanagercontact.js.map +0 -1
- package/dist/esm/models/components/companymanagercontact.d.ts.map +0 -1
- 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
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
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?:
|
|
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
|
|
55
|
-
|
|
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:
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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,
|
package/src/react-query/index.ts
CHANGED
|
@@ -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.
|
|
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.
|
|
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.
|
|
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
|
+
}
|