@greensecurity/javascript-sdk 0.47.0 → 0.48.0-beta.0
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 +1 -1
- package/dist/commonjs/__tests__/users.test.js +2 -0
- package/dist/commonjs/__tests__/users.test.js.map +1 -1
- package/dist/commonjs/__tests__/vendorGetCompanyCredentialsSummary.test.d.ts +2 -0
- package/dist/commonjs/__tests__/vendorGetCompanyCredentialsSummary.test.d.ts.map +1 -0
- package/dist/commonjs/__tests__/vendorGetCompanyCredentialsSummary.test.js +30 -0
- package/dist/commonjs/__tests__/vendorGetCompanyCredentialsSummary.test.js.map +1 -0
- 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 +39 -8
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/admin-funcs/clearVerifications.d.ts +24 -0
- package/dist/commonjs/admin-funcs/clearVerifications.d.ts.map +1 -0
- package/dist/commonjs/admin-funcs/clearVerifications.js +30 -0
- package/dist/commonjs/admin-funcs/clearVerifications.js.map +1 -0
- package/dist/commonjs/admin-funcs/registerGeneralInfo.d.ts +11 -6
- package/dist/commonjs/admin-funcs/registerGeneralInfo.d.ts.map +1 -1
- package/dist/commonjs/admin-funcs/registerGeneralInfo.js.map +1 -1
- package/dist/commonjs/admin-funcs/vendorGetCompanyCredentialsSummary.d.ts +1 -1
- package/dist/commonjs/admin-funcs/vendorGetCompanyCredentialsSummary.d.ts.map +1 -1
- package/dist/commonjs/admin-funcs/vendorGetCompanyCredentialsSummary.js +9 -3
- package/dist/commonjs/admin-funcs/vendorGetCompanyCredentialsSummary.js.map +1 -1
- package/dist/commonjs/funcs/vendorsGetVendorTargetFacilities.d.ts +1 -0
- package/dist/commonjs/funcs/vendorsGetVendorTargetFacilities.d.ts.map +1 -1
- package/dist/commonjs/funcs/vendorsGetVendorTargetFacilities.js +1 -0
- package/dist/commonjs/funcs/vendorsGetVendorTargetFacilities.js.map +1 -1
- package/dist/commonjs/funcs/vendorsUpdateVendorDetails.d.ts +5 -2
- package/dist/commonjs/funcs/vendorsUpdateVendorDetails.d.ts.map +1 -1
- package/dist/commonjs/funcs/vendorsUpdateVendorDetails.js +5 -2
- package/dist/commonjs/funcs/vendorsUpdateVendorDetails.js.map +1 -1
- package/dist/commonjs/index.extras.d.ts +8 -0
- package/dist/commonjs/index.extras.d.ts.map +1 -1
- package/dist/commonjs/index.extras.js +8 -0
- package/dist/commonjs/index.extras.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/lib/config.js.map +1 -1
- 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/invoice.d.ts +5 -0
- package/dist/commonjs/models/components/invoice.d.ts.map +1 -1
- package/dist/commonjs/models/components/invoice.js +4 -0
- package/dist/commonjs/models/components/invoice.js.map +1 -1
- package/dist/commonjs/models/components/userdetails.d.ts +12 -0
- package/dist/commonjs/models/components/userdetails.d.ts.map +1 -1
- package/dist/commonjs/models/components/userdetails.js +4 -0
- package/dist/commonjs/models/components/userdetails.js.map +1 -1
- package/dist/commonjs/models/components/userlocation.d.ts +5 -0
- package/dist/commonjs/models/components/userlocation.d.ts.map +1 -1
- package/dist/commonjs/models/components/userlocation.js +4 -0
- package/dist/commonjs/models/components/userlocation.js.map +1 -1
- package/dist/commonjs/models/components/vendortargetfacility.d.ts +4 -0
- package/dist/commonjs/models/components/vendortargetfacility.d.ts.map +1 -1
- package/dist/commonjs/models/components/vendortargetfacility.js +2 -0
- package/dist/commonjs/models/components/vendortargetfacility.js.map +1 -1
- package/dist/commonjs/models/operations/getvendortargetfacilities.d.ts +4 -3
- package/dist/commonjs/models/operations/getvendortargetfacilities.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getvendortargetfacilities.js +2 -1
- package/dist/commonjs/models/operations/getvendortargetfacilities.js.map +1 -1
- package/dist/commonjs/react-query/vendorsGetVendorTargetFacilities.d.ts +4 -0
- package/dist/commonjs/react-query/vendorsGetVendorTargetFacilities.d.ts.map +1 -1
- package/dist/commonjs/react-query/vendorsGetVendorTargetFacilities.js +4 -0
- package/dist/commonjs/react-query/vendorsGetVendorTargetFacilities.js.map +1 -1
- package/dist/commonjs/react-query/vendorsUpdateVendorDetails.d.ts +5 -2
- package/dist/commonjs/react-query/vendorsUpdateVendorDetails.d.ts.map +1 -1
- package/dist/commonjs/react-query/vendorsUpdateVendorDetails.js +4 -1
- package/dist/commonjs/react-query/vendorsUpdateVendorDetails.js.map +1 -1
- package/dist/commonjs/sdk/vendors.d.ts +5 -1
- package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
- package/dist/commonjs/sdk/vendors.js +5 -1
- package/dist/commonjs/sdk/vendors.js.map +1 -1
- package/dist/esm/__tests__/users.test.js +2 -0
- package/dist/esm/__tests__/users.test.js.map +1 -1
- package/dist/esm/__tests__/vendorGetCompanyCredentialsSummary.test.d.ts +2 -0
- package/dist/esm/__tests__/vendorGetCompanyCredentialsSummary.test.d.ts.map +1 -0
- package/dist/esm/__tests__/vendorGetCompanyCredentialsSummary.test.js +28 -0
- package/dist/esm/__tests__/vendorGetCompanyCredentialsSummary.test.js.map +1 -0
- 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 +39 -8
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/admin-funcs/clearVerifications.d.ts +24 -0
- package/dist/esm/admin-funcs/clearVerifications.d.ts.map +1 -0
- package/dist/esm/admin-funcs/clearVerifications.js +23 -0
- package/dist/esm/admin-funcs/clearVerifications.js.map +1 -0
- package/dist/esm/admin-funcs/registerGeneralInfo.d.ts +11 -6
- package/dist/esm/admin-funcs/registerGeneralInfo.d.ts.map +1 -1
- package/dist/esm/admin-funcs/registerGeneralInfo.js.map +1 -1
- package/dist/esm/admin-funcs/vendorGetCompanyCredentialsSummary.d.ts +1 -1
- package/dist/esm/admin-funcs/vendorGetCompanyCredentialsSummary.d.ts.map +1 -1
- package/dist/esm/admin-funcs/vendorGetCompanyCredentialsSummary.js +10 -4
- package/dist/esm/admin-funcs/vendorGetCompanyCredentialsSummary.js.map +1 -1
- package/dist/esm/funcs/vendorsGetVendorTargetFacilities.d.ts +1 -0
- package/dist/esm/funcs/vendorsGetVendorTargetFacilities.d.ts.map +1 -1
- package/dist/esm/funcs/vendorsGetVendorTargetFacilities.js +1 -0
- package/dist/esm/funcs/vendorsGetVendorTargetFacilities.js.map +1 -1
- package/dist/esm/funcs/vendorsUpdateVendorDetails.d.ts +5 -2
- package/dist/esm/funcs/vendorsUpdateVendorDetails.d.ts.map +1 -1
- package/dist/esm/funcs/vendorsUpdateVendorDetails.js +5 -2
- package/dist/esm/funcs/vendorsUpdateVendorDetails.js.map +1 -1
- package/dist/esm/index.extras.d.ts +8 -0
- package/dist/esm/index.extras.d.ts.map +1 -1
- package/dist/esm/index.extras.js +8 -0
- package/dist/esm/index.extras.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/lib/config.js.map +1 -1
- 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/invoice.d.ts +5 -0
- package/dist/esm/models/components/invoice.d.ts.map +1 -1
- package/dist/esm/models/components/invoice.js +4 -0
- package/dist/esm/models/components/invoice.js.map +1 -1
- package/dist/esm/models/components/userdetails.d.ts +12 -0
- package/dist/esm/models/components/userdetails.d.ts.map +1 -1
- package/dist/esm/models/components/userdetails.js +4 -0
- package/dist/esm/models/components/userdetails.js.map +1 -1
- package/dist/esm/models/components/userlocation.d.ts +5 -0
- package/dist/esm/models/components/userlocation.d.ts.map +1 -1
- package/dist/esm/models/components/userlocation.js +4 -0
- package/dist/esm/models/components/userlocation.js.map +1 -1
- package/dist/esm/models/components/vendortargetfacility.d.ts +4 -0
- package/dist/esm/models/components/vendortargetfacility.d.ts.map +1 -1
- package/dist/esm/models/components/vendortargetfacility.js +2 -0
- package/dist/esm/models/components/vendortargetfacility.js.map +1 -1
- package/dist/esm/models/operations/getvendortargetfacilities.d.ts +4 -3
- package/dist/esm/models/operations/getvendortargetfacilities.d.ts.map +1 -1
- package/dist/esm/models/operations/getvendortargetfacilities.js +2 -1
- package/dist/esm/models/operations/getvendortargetfacilities.js.map +1 -1
- package/dist/esm/react-query/vendorsGetVendorTargetFacilities.d.ts +4 -0
- package/dist/esm/react-query/vendorsGetVendorTargetFacilities.d.ts.map +1 -1
- package/dist/esm/react-query/vendorsGetVendorTargetFacilities.js +4 -0
- package/dist/esm/react-query/vendorsGetVendorTargetFacilities.js.map +1 -1
- package/dist/esm/react-query/vendorsUpdateVendorDetails.d.ts +5 -2
- package/dist/esm/react-query/vendorsUpdateVendorDetails.d.ts.map +1 -1
- package/dist/esm/react-query/vendorsUpdateVendorDetails.js +4 -1
- package/dist/esm/react-query/vendorsUpdateVendorDetails.js.map +1 -1
- package/dist/esm/sdk/vendors.d.ts +5 -1
- package/dist/esm/sdk/vendors.d.ts.map +1 -1
- package/dist/esm/sdk/vendors.js +5 -1
- package/dist/esm/sdk/vendors.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/users.test.ts +2 -0
- package/src/__tests__/vendorGetCompanyCredentialsSummary.test.ts +40 -0
- package/src/__tests__/vendors.test.ts +1 -1
- package/src/__tests__/webhooks.test.ts +1 -1
- package/src/__tests__/zones.test.ts +39 -8
- package/src/admin-funcs/clearVerifications.ts +42 -0
- package/src/admin-funcs/registerGeneralInfo.ts +11 -6
- package/src/admin-funcs/vendorGetCompanyCredentialsSummary.ts +11 -7
- package/src/funcs/vendorsGetVendorTargetFacilities.ts +1 -0
- package/src/funcs/vendorsUpdateVendorDetails.ts +8 -1
- package/src/index.extras.ts +15 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/expand.ts +1 -0
- package/src/models/components/invoice.ts +9 -0
- package/src/models/components/userdetails.ts +16 -0
- package/src/models/components/userlocation.ts +9 -0
- package/src/models/components/vendortargetfacility.ts +6 -0
- package/src/models/operations/getvendortargetfacilities.ts +4 -3
- package/src/react-query/vendorsGetVendorTargetFacilities.ts +4 -0
- package/src/react-query/vendorsUpdateVendorDetails.ts +5 -1
- package/src/sdk/vendors.ts +5 -1
|
@@ -35,34 +35,65 @@ test("Zones List Or Search Security Zones", async () => {
|
|
|
35
35
|
useUrlParams: false,
|
|
36
36
|
},
|
|
37
37
|
items: [
|
|
38
|
-
{
|
|
39
|
-
facility: {},
|
|
40
|
-
},
|
|
41
38
|
{
|
|
42
39
|
facility: {
|
|
43
40
|
contacts: {
|
|
44
41
|
contact: {
|
|
42
|
+
status: "Inactive",
|
|
43
|
+
department: null,
|
|
44
|
+
},
|
|
45
|
+
adminContact: {
|
|
46
|
+
status: "Deleted",
|
|
47
|
+
department: 123,
|
|
48
|
+
},
|
|
49
|
+
techContact: {
|
|
50
|
+
status: "Deleted",
|
|
51
|
+
department: 123,
|
|
52
|
+
},
|
|
53
|
+
greenSecurityCsm: {
|
|
54
|
+
status: "Deleted",
|
|
55
|
+
department: 123,
|
|
56
|
+
},
|
|
57
|
+
accountManager: {
|
|
45
58
|
status: "Active",
|
|
46
59
|
department: 123,
|
|
47
60
|
},
|
|
48
|
-
|
|
61
|
+
},
|
|
62
|
+
vendorGuestPolicy: {
|
|
63
|
+
enabled: false,
|
|
64
|
+
vendorGuestLimitAndOr: "and",
|
|
65
|
+
vendorGuestRequireEmail: false,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
facility: {
|
|
71
|
+
contacts: {
|
|
72
|
+
contact: {
|
|
49
73
|
status: "Inactive",
|
|
74
|
+
department: null,
|
|
75
|
+
},
|
|
76
|
+
adminContact: {
|
|
77
|
+
status: "Deleted",
|
|
50
78
|
department: 123,
|
|
51
79
|
},
|
|
52
80
|
techContact: {
|
|
53
|
-
status: "
|
|
81
|
+
status: "Deleted",
|
|
54
82
|
department: 123,
|
|
55
83
|
},
|
|
56
84
|
greenSecurityCsm: {
|
|
85
|
+
status: "Deleted",
|
|
86
|
+
department: 123,
|
|
87
|
+
},
|
|
88
|
+
accountManager: {
|
|
57
89
|
status: "Active",
|
|
58
90
|
department: 123,
|
|
59
91
|
},
|
|
60
|
-
accountManager: null,
|
|
61
92
|
},
|
|
62
93
|
vendorGuestPolicy: {
|
|
63
94
|
enabled: false,
|
|
64
95
|
vendorGuestLimitAndOr: "and",
|
|
65
|
-
vendorGuestRequireEmail:
|
|
96
|
+
vendorGuestRequireEmail: false,
|
|
66
97
|
},
|
|
67
98
|
},
|
|
68
99
|
},
|
|
@@ -83,7 +114,7 @@ test("Zones Security Zone Checkin", async () => {
|
|
|
83
114
|
|
|
84
115
|
const result = await greenSecurity.zones.securityZoneCheckin({
|
|
85
116
|
qrCode: "<value>",
|
|
86
|
-
zoneId:
|
|
117
|
+
zoneId: 834385,
|
|
87
118
|
});
|
|
88
119
|
expect(result).toBeDefined();
|
|
89
120
|
expect(result).toEqual({});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { APIPromise } from "../types/async.js";
|
|
2
|
+
import { $doGetSingle, $doPost, internalApiResult } from "./doAdmin.js";
|
|
3
|
+
|
|
4
|
+
export type ClearVerificationContext = "registration" | "account";
|
|
5
|
+
export type ClearVerificationPlatform = "web" | "native";
|
|
6
|
+
|
|
7
|
+
export type clearCreateSessionRequest = {
|
|
8
|
+
context: ClearVerificationContext;
|
|
9
|
+
platform: ClearVerificationPlatform;
|
|
10
|
+
/** Where CLEAR sends the vendor back; the server adds a `state` parameter. */
|
|
11
|
+
return_url: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type clearCompleteRequest = {
|
|
15
|
+
/** The `state` CLEAR sent back on the return URL. */
|
|
16
|
+
state: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** Starts a CLEAR verification for the calling vendor. Resolves to `{ verify_url }`. */
|
|
20
|
+
export function clearCreateSession(request: clearCreateSessionRequest): internalApiResult {
|
|
21
|
+
return new APIPromise($doPost("/clear-verifications", request));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Reads the outcome of the session `state` belongs to. Resolves to the vendor's CLEAR summary plus `outcome` and `context`. */
|
|
25
|
+
export function clearComplete(request: clearCompleteRequest): internalApiResult {
|
|
26
|
+
return new APIPromise($doPost("/clear-verifications/complete", request));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Records that the calling vendor continued without CLEAR. Resolves to the vendor's CLEAR summary. */
|
|
30
|
+
export function clearOptOut(): internalApiResult {
|
|
31
|
+
return new APIPromise($doPost("/clear-verifications/opt-out", {}));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** The calling vendor's CLEAR summary: `{ status, prefilled_fields, personal_email }`. */
|
|
35
|
+
export function clearGetStatus(): internalApiResult {
|
|
36
|
+
return new APIPromise($doGetSingle("/clear-verifications/status", {}));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** What the vendor's profile and CLEAR can fill on their background check, SSN included. */
|
|
40
|
+
export function clearGetBackgroundCheckPrefill(): internalApiResult {
|
|
41
|
+
return new APIPromise($doGetSingle("/clear-verifications/background-check-prefill", {}));
|
|
42
|
+
}
|
|
@@ -14,12 +14,17 @@ export type formInputs = {
|
|
|
14
14
|
supervisor_name: string;
|
|
15
15
|
supervisor_email: string;
|
|
16
16
|
supervisor_phone: string;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
/** Becomes the login email when it differs from the one the vendor registered with. */
|
|
18
|
+
work_email?: string;
|
|
19
|
+
personal_email?: string;
|
|
20
|
+
work_phone?: string;
|
|
21
|
+
/** Registration no longer collects an address; these remain for older forms. */
|
|
22
|
+
country?: string;
|
|
23
|
+
address1?: string;
|
|
24
|
+
address2?: string;
|
|
25
|
+
city?: string;
|
|
26
|
+
state?: string;
|
|
27
|
+
zip?: string;
|
|
23
28
|
};
|
|
24
29
|
|
|
25
30
|
export function submitGeneralInfo(request: formInputs): internalApiResult {
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { APIPromise } from "../types/async.js";
|
|
2
|
-
import { $doGetSingle, internalApiResult } from "./doAdmin.js";
|
|
2
|
+
import { $doGetSingle, hashToQueryString, internalApiResult } from "./doAdmin.js";
|
|
3
3
|
|
|
4
|
-
// Internal-only, not part of openapi.yaml. Vendor is resolved from the token
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
)
|
|
4
|
+
// Internal-only, not part of openapi.yaml. Vendor is resolved from the token. Pass `facilityId` to
|
|
5
|
+
// summarize only the company credentials required at that facility instead of at every facility
|
|
6
|
+
// the vendor targets.
|
|
7
|
+
export function vendorGetCompanyCredentialsSummary(facilityId?: number): internalApiResult {
|
|
8
|
+
let route = "/vendors/me/company-credentials-summary";
|
|
9
|
+
if (facilityId !== undefined) {
|
|
10
|
+
route += `?${hashToQueryString({ facility_id: facilityId })}`;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return new APIPromise($doGetSingle(route, {}));
|
|
10
14
|
}
|
|
@@ -45,6 +45,7 @@ import {
|
|
|
45
45
|
* - `vendor_target_facility.facility`
|
|
46
46
|
* - `vendor_target_facility.has_screening_responses`
|
|
47
47
|
* - `vendor_target_facility.expiring_credential_count`
|
|
48
|
+
* - `vendor_target_facility.system_logo_url`
|
|
48
49
|
*
|
|
49
50
|
* The endpoint rejects any other value with `422 Unprocessable Entity`.
|
|
50
51
|
*
|
|
@@ -36,12 +36,15 @@ import * as types$ from "../types/primitives.js";
|
|
|
36
36
|
* can also remove the vendor from their company by sending `company_id: null`.
|
|
37
37
|
*
|
|
38
38
|
* From `location` this endpoint reads only `timezone`, `address1`, `address2`,
|
|
39
|
-
* `city`, `state`, `zip`, `phone`, `mobile_phone` and `
|
|
39
|
+
* `city`, `state`, `zip`, `phone`, `mobile_phone`, `fax` and `personal_email`. The `address` and
|
|
40
40
|
* `country` properties of the shared `UserLocation` schema have no effect here, and
|
|
41
41
|
* updating them is not supported. `state` accepts a US state or a Canadian
|
|
42
42
|
* province—the vendor's country, set only at registration, is not editable
|
|
43
43
|
* through this endpoint.
|
|
44
44
|
*
|
|
45
|
+
* `location.personal_email` is stored lowercased, and a value that is not a valid
|
|
46
|
+
* email address, or is longer than 255 characters, gets a `422` response.
|
|
47
|
+
*
|
|
45
48
|
* Submitting `location.zip` or `location.state` cross-checks the postal code
|
|
46
49
|
* against the resulting state (using the vendor's existing value for whichever
|
|
47
50
|
* of the two you omit from the request). The server rejects a code that is not shaped like a real
|
|
@@ -66,6 +69,7 @@ export function vendorsUpdateVendorDetails(
|
|
|
66
69
|
Result<
|
|
67
70
|
boolean,
|
|
68
71
|
| errors.ApiErrorResponse
|
|
72
|
+
| errors.UnprocessableEntityOrValidationError
|
|
69
73
|
| GreenSecurityError
|
|
70
74
|
| ResponseValidationError
|
|
71
75
|
| ConnectionError
|
|
@@ -92,6 +96,7 @@ async function $do(
|
|
|
92
96
|
Result<
|
|
93
97
|
boolean,
|
|
94
98
|
| errors.ApiErrorResponse
|
|
99
|
+
| errors.UnprocessableEntityOrValidationError
|
|
95
100
|
| GreenSecurityError
|
|
96
101
|
| ResponseValidationError
|
|
97
102
|
| ConnectionError
|
|
@@ -181,6 +186,7 @@ async function $do(
|
|
|
181
186
|
const [result] = await M.match<
|
|
182
187
|
boolean,
|
|
183
188
|
| errors.ApiErrorResponse
|
|
189
|
+
| errors.UnprocessableEntityOrValidationError
|
|
184
190
|
| GreenSecurityError
|
|
185
191
|
| ResponseValidationError
|
|
186
192
|
| ConnectionError
|
|
@@ -192,6 +198,7 @@ async function $do(
|
|
|
192
198
|
>(
|
|
193
199
|
M.json(200, types$.boolean()),
|
|
194
200
|
M.jsonErr([400, 401, 403, 404], errors.ApiErrorResponse$inboundSchema),
|
|
201
|
+
M.jsonErr(422, errors.UnprocessableEntityOrValidationError$inboundSchema),
|
|
195
202
|
M.fail("4XX"),
|
|
196
203
|
M.fail([500, "5XX"]),
|
|
197
204
|
)(response, req, { extraFields: responseFields });
|
package/src/index.extras.ts
CHANGED
|
@@ -33,6 +33,13 @@ import { submitEmailStep } from "./admin-funcs/registerEmail.js";
|
|
|
33
33
|
import { submitPassword } from "./admin-funcs/registerPassword.js";
|
|
34
34
|
import { submitGeneralInfo } from "./admin-funcs/registerGeneralInfo.js";
|
|
35
35
|
import { submitCompany } from "./admin-funcs/registerCompanies.js";
|
|
36
|
+
import {
|
|
37
|
+
clearComplete,
|
|
38
|
+
clearCreateSession,
|
|
39
|
+
clearGetBackgroundCheckPrefill,
|
|
40
|
+
clearGetStatus,
|
|
41
|
+
clearOptOut,
|
|
42
|
+
} from "./admin-funcs/clearVerifications.js";
|
|
36
43
|
|
|
37
44
|
import { smartBadgePairBadge } from "./admin-funcs/smartBadgePairBadge.js";
|
|
38
45
|
import { smartBadgeUnpairBadge } from "./admin-funcs/smartBadgeUnpairBadge.js";
|
|
@@ -126,6 +133,14 @@ export const __internal = {
|
|
|
126
133
|
submitCompany
|
|
127
134
|
},
|
|
128
135
|
|
|
136
|
+
clear: {
|
|
137
|
+
createSession: clearCreateSession,
|
|
138
|
+
complete: clearComplete,
|
|
139
|
+
optOut: clearOptOut,
|
|
140
|
+
getStatus: clearGetStatus,
|
|
141
|
+
getBackgroundCheckPrefill: clearGetBackgroundCheckPrefill
|
|
142
|
+
},
|
|
143
|
+
|
|
129
144
|
smartBadge: {
|
|
130
145
|
pairBadge: smartBadgePairBadge,
|
|
131
146
|
unpairBadge: smartBadgeUnpairBadge,
|
package/src/lib/config.ts
CHANGED
|
@@ -80,8 +80,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
80
80
|
export const SDK_METADATA = {
|
|
81
81
|
language: "typescript",
|
|
82
82
|
openapiDocVersion: "0.47.0",
|
|
83
|
-
sdkVersion: "0.
|
|
83
|
+
sdkVersion: "0.48.0-beta.0",
|
|
84
84
|
genVersion: "2.948.4",
|
|
85
85
|
userAgent:
|
|
86
|
-
"speakeasy-sdk/typescript 0.
|
|
86
|
+
"speakeasy-sdk/typescript 0.48.0-beta.0 2.948.4 0.47.0 @greensecurity/javascript-sdk",
|
|
87
87
|
} as const;
|
|
@@ -21,6 +21,7 @@ export const Expand = {
|
|
|
21
21
|
"vendor_target_facility.has_screening_responses",
|
|
22
22
|
VendorTargetFacilityExpiringCredentialCount:
|
|
23
23
|
"vendor_target_facility.expiring_credential_count",
|
|
24
|
+
VendorTargetFacilitySystemLogoUrl: "vendor_target_facility.system_logo_url",
|
|
24
25
|
ContactFacility: "contact.facility",
|
|
25
26
|
ContactSystem: "contact.system",
|
|
26
27
|
ContactDepartment: "contact.department",
|
|
@@ -103,6 +103,10 @@ export type AssociatedCredentials = {
|
|
|
103
103
|
* The ID of the company that requested the credential. `null` if the credential has no company.
|
|
104
104
|
*/
|
|
105
105
|
companyId: number | null;
|
|
106
|
+
/**
|
|
107
|
+
* The ID of the invoice the credential was raised on. This can be a child of the requested invoice. `null` if the credential has no invoice.
|
|
108
|
+
*/
|
|
109
|
+
invoiceId: number | null;
|
|
106
110
|
/**
|
|
107
111
|
* Whether the vendor has paid the credential's invoice but has not submitted the required information.
|
|
108
112
|
*/
|
|
@@ -320,11 +324,13 @@ export const AssociatedCredentials$inboundSchema: z.ZodType<
|
|
|
320
324
|
id: types.number(),
|
|
321
325
|
vendor_id: types.nullable(types.number()),
|
|
322
326
|
company_id: types.nullable(types.number()),
|
|
327
|
+
invoice_id: types.nullable(types.number()),
|
|
323
328
|
awaiting_submission: types.boolean(),
|
|
324
329
|
}).transform((v) => {
|
|
325
330
|
return remap$(v, {
|
|
326
331
|
"vendor_id": "vendorId",
|
|
327
332
|
"company_id": "companyId",
|
|
333
|
+
"invoice_id": "invoiceId",
|
|
328
334
|
"awaiting_submission": "awaitingSubmission",
|
|
329
335
|
});
|
|
330
336
|
});
|
|
@@ -333,6 +339,7 @@ export type AssociatedCredentials$Outbound = {
|
|
|
333
339
|
id: number;
|
|
334
340
|
vendor_id: number | null;
|
|
335
341
|
company_id: number | null;
|
|
342
|
+
invoice_id: number | null;
|
|
336
343
|
awaiting_submission: boolean;
|
|
337
344
|
};
|
|
338
345
|
|
|
@@ -345,11 +352,13 @@ export const AssociatedCredentials$outboundSchema: z.ZodType<
|
|
|
345
352
|
id: z.number().int(),
|
|
346
353
|
vendorId: z.nullable(z.number().int()),
|
|
347
354
|
companyId: z.nullable(z.number().int()),
|
|
355
|
+
invoiceId: z.nullable(z.number().int()),
|
|
348
356
|
awaitingSubmission: z.boolean(),
|
|
349
357
|
}).transform((v) => {
|
|
350
358
|
return remap$(v, {
|
|
351
359
|
vendorId: "vendor_id",
|
|
352
360
|
companyId: "company_id",
|
|
361
|
+
invoiceId: "invoice_id",
|
|
353
362
|
awaitingSubmission: "awaiting_submission",
|
|
354
363
|
});
|
|
355
364
|
});
|
|
@@ -85,6 +85,10 @@ export type UserDetails = {
|
|
|
85
85
|
* First name of the user.
|
|
86
86
|
*/
|
|
87
87
|
firstName?: string | null | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* Middle name of the user, or `null` if not set. Returned only in the full user record (`expand=user`).
|
|
90
|
+
*/
|
|
91
|
+
middleName?: string | null | undefined;
|
|
88
92
|
/**
|
|
89
93
|
* Last name of the user.
|
|
90
94
|
*/
|
|
@@ -93,6 +97,14 @@ export type UserDetails = {
|
|
|
93
97
|
* Email address (not always valid)
|
|
94
98
|
*/
|
|
95
99
|
email: string;
|
|
100
|
+
/**
|
|
101
|
+
* A vendor's personal email address, kept apart from `email`, which is
|
|
102
|
+
*
|
|
103
|
+
* @remarks
|
|
104
|
+
* the work email they sign in with. `null` if not set. Returned only in
|
|
105
|
+
* the full user record (`expand=user`).
|
|
106
|
+
*/
|
|
107
|
+
personalEmail?: string | null | undefined;
|
|
96
108
|
/**
|
|
97
109
|
* The user's landline phone number, or `null` if not set.
|
|
98
110
|
*/
|
|
@@ -253,8 +265,10 @@ export const UserDetails$inboundSchema: z.ZodType<
|
|
|
253
265
|
> = z.object({
|
|
254
266
|
id: types.number(),
|
|
255
267
|
first_name: z.nullable(types.string()).optional(),
|
|
268
|
+
middle_name: z.nullable(types.string()).optional(),
|
|
256
269
|
last_name: z.nullable(types.string()).optional(),
|
|
257
270
|
email: types.string(),
|
|
271
|
+
personal_email: z.nullable(types.string()).optional(),
|
|
258
272
|
phone: z.nullable(types.string()).optional(),
|
|
259
273
|
mobile_phone: z.nullable(types.string()).optional(),
|
|
260
274
|
fax: z.nullable(types.string()).optional(),
|
|
@@ -274,7 +288,9 @@ export const UserDetails$inboundSchema: z.ZodType<
|
|
|
274
288
|
}).transform((v) => {
|
|
275
289
|
return remap$(v, {
|
|
276
290
|
"first_name": "firstName",
|
|
291
|
+
"middle_name": "middleName",
|
|
277
292
|
"last_name": "lastName",
|
|
293
|
+
"personal_email": "personalEmail",
|
|
278
294
|
"mobile_phone": "mobilePhone",
|
|
279
295
|
"phone_confirmed": "phoneConfirmed",
|
|
280
296
|
"email_confirmed": "emailConfirmed",
|
|
@@ -212,6 +212,10 @@ export type UserLocation = {
|
|
|
212
212
|
* The fax number of the location. `null` if not set.
|
|
213
213
|
*/
|
|
214
214
|
fax?: string | null | undefined;
|
|
215
|
+
/**
|
|
216
|
+
* The vendor's personal email address. Only `PUT /vendors/{vendor_id_or_me}` reads it. `null` if not set.
|
|
217
|
+
*/
|
|
218
|
+
personalEmail?: string | null | undefined;
|
|
215
219
|
/**
|
|
216
220
|
* The country of the location. `null` if not set.
|
|
217
221
|
*/
|
|
@@ -250,11 +254,13 @@ export const UserLocation$inboundSchema: z.ZodType<
|
|
|
250
254
|
phone: z.nullable(types.string()).optional(),
|
|
251
255
|
mobile_phone: z.nullable(types.string()).optional(),
|
|
252
256
|
fax: z.nullable(types.string()).optional(),
|
|
257
|
+
personal_email: z.nullable(types.string()).optional(),
|
|
253
258
|
country: z.nullable(types.string()).optional(),
|
|
254
259
|
timezone: z.nullable(Timezone$inboundSchema).optional(),
|
|
255
260
|
}).transform((v) => {
|
|
256
261
|
return remap$(v, {
|
|
257
262
|
"mobile_phone": "mobilePhone",
|
|
263
|
+
"personal_email": "personalEmail",
|
|
258
264
|
});
|
|
259
265
|
});
|
|
260
266
|
/** @internal */
|
|
@@ -268,6 +274,7 @@ export type UserLocation$Outbound = {
|
|
|
268
274
|
phone?: string | null | undefined;
|
|
269
275
|
mobile_phone?: string | null | undefined;
|
|
270
276
|
fax?: string | null | undefined;
|
|
277
|
+
personal_email?: string | null | undefined;
|
|
271
278
|
country?: string | null | undefined;
|
|
272
279
|
timezone?: string | null | undefined;
|
|
273
280
|
};
|
|
@@ -287,11 +294,13 @@ export const UserLocation$outboundSchema: z.ZodType<
|
|
|
287
294
|
phone: z.nullable(z.string()).optional(),
|
|
288
295
|
mobilePhone: z.nullable(z.string()).optional(),
|
|
289
296
|
fax: z.nullable(z.string()).optional(),
|
|
297
|
+
personalEmail: z.nullable(z.string()).optional(),
|
|
290
298
|
country: z.nullable(z.string()).optional(),
|
|
291
299
|
timezone: z.nullable(Timezone$outboundSchema).optional(),
|
|
292
300
|
}).transform((v) => {
|
|
293
301
|
return remap$(v, {
|
|
294
302
|
mobilePhone: "mobile_phone",
|
|
303
|
+
personalEmail: "personal_email",
|
|
295
304
|
});
|
|
296
305
|
});
|
|
297
306
|
|
|
@@ -44,6 +44,10 @@ export type VendorTargetFacility = {
|
|
|
44
44
|
* How many credentials the facility requires from the vendor have an approved version that expires within 30 days, with no newer version approved or waiting for approval. Company-owned credentials are left out when the caller is a vendor whose company has company managers. Present only when you pass `vendor_target_facility.expiring_credential_count` to `expand`.
|
|
45
45
|
*/
|
|
46
46
|
expiringCredentialCount?: number | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* The URL of the logo of the facility's system, or `null` when the system has no logo or the facility has no system. Present only when you pass `vendor_target_facility.system_logo_url` to `expand`.
|
|
49
|
+
*/
|
|
50
|
+
systemLogoUrl?: string | null | undefined;
|
|
47
51
|
/**
|
|
48
52
|
* The date and time the target facility was added to the vendor, in ISO 8601 format, or `null` if not available.
|
|
49
53
|
*/
|
|
@@ -81,12 +85,14 @@ export const VendorTargetFacility$inboundSchema: z.ZodType<
|
|
|
81
85
|
questions_answered: types.nullable(types.boolean()),
|
|
82
86
|
has_screening_responses: types.optional(types.boolean()),
|
|
83
87
|
expiring_credential_count: types.optional(types.number()),
|
|
88
|
+
system_logo_url: z.nullable(types.string()).optional(),
|
|
84
89
|
date_created: z.nullable(types.date()).optional(),
|
|
85
90
|
}).transform((v) => {
|
|
86
91
|
return remap$(v, {
|
|
87
92
|
"questions_answered": "questionsAnswered",
|
|
88
93
|
"has_screening_responses": "hasScreeningResponses",
|
|
89
94
|
"expiring_credential_count": "expiringCredentialCount",
|
|
95
|
+
"system_logo_url": "systemLogoUrl",
|
|
90
96
|
"date_created": "dateCreated",
|
|
91
97
|
});
|
|
92
98
|
});
|
|
@@ -52,7 +52,7 @@ export const IncludeStatusCounts = {
|
|
|
52
52
|
export type IncludeStatusCounts = ClosedEnum<typeof IncludeStatusCounts>;
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
|
-
* The field to sort results by. Defaults to `facility_name`. `not_approved_first` lists the systems with the most rows that are not approved first, then by system name; within a system it puts the rows that are not approved first, then sorts by facility name. `
|
|
55
|
+
* The field to sort results by. Defaults to `facility_name`. `not_approved_first` lists the systems with the most rows that are not approved first, then by system name; within a system it puts the rows that are not approved first, then sorts by facility name. `system_and_facility_name` sorts by system name, then by facility name, and lists facilities without a system last. Both ignore `desc`.
|
|
56
56
|
*/
|
|
57
57
|
export const GetVendorTargetFacilitiesQueryParamSort = {
|
|
58
58
|
FacilityName: "facility_name",
|
|
@@ -61,9 +61,10 @@ export const GetVendorTargetFacilitiesQueryParamSort = {
|
|
|
61
61
|
QuestionsAnswered: "questions_answered",
|
|
62
62
|
DateCreated: "date_created",
|
|
63
63
|
NotApprovedFirst: "not_approved_first",
|
|
64
|
+
SystemAndFacilityName: "system_and_facility_name",
|
|
64
65
|
} as const;
|
|
65
66
|
/**
|
|
66
|
-
* The field to sort results by. Defaults to `facility_name`. `not_approved_first` lists the systems with the most rows that are not approved first, then by system name; within a system it puts the rows that are not approved first, then sorts by facility name. `
|
|
67
|
+
* The field to sort results by. Defaults to `facility_name`. `not_approved_first` lists the systems with the most rows that are not approved first, then by system name; within a system it puts the rows that are not approved first, then sorts by facility name. `system_and_facility_name` sorts by system name, then by facility name, and lists facilities without a system last. Both ignore `desc`.
|
|
67
68
|
*/
|
|
68
69
|
export type GetVendorTargetFacilitiesQueryParamSort = ClosedEnum<
|
|
69
70
|
typeof GetVendorTargetFacilitiesQueryParamSort
|
|
@@ -117,7 +118,7 @@ export type GetVendorTargetFacilitiesRequest = {
|
|
|
117
118
|
*/
|
|
118
119
|
itemsPerPage?: number | undefined;
|
|
119
120
|
/**
|
|
120
|
-
* The field to sort results by. Defaults to `facility_name`. `not_approved_first` lists the systems with the most rows that are not approved first, then by system name; within a system it puts the rows that are not approved first, then sorts by facility name. `
|
|
121
|
+
* The field to sort results by. Defaults to `facility_name`. `not_approved_first` lists the systems with the most rows that are not approved first, then by system name; within a system it puts the rows that are not approved first, then sorts by facility name. `system_and_facility_name` sorts by system name, then by facility name, and lists facilities without a system last. Both ignore `desc`.
|
|
121
122
|
*/
|
|
122
123
|
sort?: GetVendorTargetFacilitiesQueryParamSort | undefined;
|
|
123
124
|
/**
|
|
@@ -84,6 +84,7 @@ export type VendorsGetVendorTargetFacilitiesQueryError =
|
|
|
84
84
|
* - `vendor_target_facility.facility`
|
|
85
85
|
* - `vendor_target_facility.has_screening_responses`
|
|
86
86
|
* - `vendor_target_facility.expiring_credential_count`
|
|
87
|
+
* - `vendor_target_facility.system_logo_url`
|
|
87
88
|
*
|
|
88
89
|
* The endpoint rejects any other value with `422 Unprocessable Entity`.
|
|
89
90
|
*
|
|
@@ -123,6 +124,7 @@ export function useVendorsGetVendorTargetFacilities(
|
|
|
123
124
|
* - `vendor_target_facility.facility`
|
|
124
125
|
* - `vendor_target_facility.has_screening_responses`
|
|
125
126
|
* - `vendor_target_facility.expiring_credential_count`
|
|
127
|
+
* - `vendor_target_facility.system_logo_url`
|
|
126
128
|
*
|
|
127
129
|
* The endpoint rejects any other value with `422 Unprocessable Entity`.
|
|
128
130
|
*
|
|
@@ -162,6 +164,7 @@ export function useVendorsGetVendorTargetFacilitiesSuspense(
|
|
|
162
164
|
* - `vendor_target_facility.facility`
|
|
163
165
|
* - `vendor_target_facility.has_screening_responses`
|
|
164
166
|
* - `vendor_target_facility.expiring_credential_count`
|
|
167
|
+
* - `vendor_target_facility.system_logo_url`
|
|
165
168
|
*
|
|
166
169
|
* The endpoint rejects any other value with `422 Unprocessable Entity`.
|
|
167
170
|
*
|
|
@@ -215,6 +218,7 @@ export function useVendorsGetVendorTargetFacilitiesInfinite(
|
|
|
215
218
|
* - `vendor_target_facility.facility`
|
|
216
219
|
* - `vendor_target_facility.has_screening_responses`
|
|
217
220
|
* - `vendor_target_facility.expiring_credential_count`
|
|
221
|
+
* - `vendor_target_facility.system_logo_url`
|
|
218
222
|
*
|
|
219
223
|
* The endpoint rejects any other value with `422 Unprocessable Entity`.
|
|
220
224
|
*
|
|
@@ -36,6 +36,7 @@ export type VendorsUpdateVendorDetailsMutationData = boolean;
|
|
|
36
36
|
|
|
37
37
|
export type VendorsUpdateVendorDetailsMutationError =
|
|
38
38
|
| errors.ApiErrorResponse
|
|
39
|
+
| errors.UnprocessableEntityOrValidationError
|
|
39
40
|
| GreenSecurityError
|
|
40
41
|
| ResponseValidationError
|
|
41
42
|
| ConnectionError
|
|
@@ -54,12 +55,15 @@ export type VendorsUpdateVendorDetailsMutationError =
|
|
|
54
55
|
* can also remove the vendor from their company by sending `company_id: null`.
|
|
55
56
|
*
|
|
56
57
|
* From `location` this endpoint reads only `timezone`, `address1`, `address2`,
|
|
57
|
-
* `city`, `state`, `zip`, `phone`, `mobile_phone` and `
|
|
58
|
+
* `city`, `state`, `zip`, `phone`, `mobile_phone`, `fax` and `personal_email`. The `address` and
|
|
58
59
|
* `country` properties of the shared `UserLocation` schema have no effect here, and
|
|
59
60
|
* updating them is not supported. `state` accepts a US state or a Canadian
|
|
60
61
|
* province—the vendor's country, set only at registration, is not editable
|
|
61
62
|
* through this endpoint.
|
|
62
63
|
*
|
|
64
|
+
* `location.personal_email` is stored lowercased, and a value that is not a valid
|
|
65
|
+
* email address, or is longer than 255 characters, gets a `422` response.
|
|
66
|
+
*
|
|
63
67
|
* Submitting `location.zip` or `location.state` cross-checks the postal code
|
|
64
68
|
* against the resulting state (using the vendor's existing value for whichever
|
|
65
69
|
* of the two you omit from the request). The server rejects a code that is not shaped like a real
|
package/src/sdk/vendors.ts
CHANGED
|
@@ -1026,12 +1026,15 @@ export class Vendors extends ClientSDK {
|
|
|
1026
1026
|
* can also remove the vendor from their company by sending `company_id: null`.
|
|
1027
1027
|
*
|
|
1028
1028
|
* From `location` this endpoint reads only `timezone`, `address1`, `address2`,
|
|
1029
|
-
* `city`, `state`, `zip`, `phone`, `mobile_phone` and `
|
|
1029
|
+
* `city`, `state`, `zip`, `phone`, `mobile_phone`, `fax` and `personal_email`. The `address` and
|
|
1030
1030
|
* `country` properties of the shared `UserLocation` schema have no effect here, and
|
|
1031
1031
|
* updating them is not supported. `state` accepts a US state or a Canadian
|
|
1032
1032
|
* province—the vendor's country, set only at registration, is not editable
|
|
1033
1033
|
* through this endpoint.
|
|
1034
1034
|
*
|
|
1035
|
+
* `location.personal_email` is stored lowercased, and a value that is not a valid
|
|
1036
|
+
* email address, or is longer than 255 characters, gets a `422` response.
|
|
1037
|
+
*
|
|
1035
1038
|
* Submitting `location.zip` or `location.state` cross-checks the postal code
|
|
1036
1039
|
* against the resulting state (using the vendor's existing value for whichever
|
|
1037
1040
|
* of the two you omit from the request). The server rejects a code that is not shaped like a real
|
|
@@ -1504,6 +1507,7 @@ export class Vendors extends ClientSDK {
|
|
|
1504
1507
|
* - `vendor_target_facility.facility`
|
|
1505
1508
|
* - `vendor_target_facility.has_screening_responses`
|
|
1506
1509
|
* - `vendor_target_facility.expiring_credential_count`
|
|
1510
|
+
* - `vendor_target_facility.system_logo_url`
|
|
1507
1511
|
*
|
|
1508
1512
|
* The endpoint rejects any other value with `422 Unprocessable Entity`.
|
|
1509
1513
|
*
|