@greensecurity/javascript-sdk 0.43.1-beta.132 → 0.43.1-beta.134
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 +3 -3
- package/dist/commonjs/__tests__/vendors.test.js +17 -14
- package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
- package/dist/commonjs/__tests__/zones.test.js +8 -10
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/funcs/usersGetCurrentUser.d.ts +11 -1
- package/dist/commonjs/funcs/usersGetCurrentUser.d.ts.map +1 -1
- package/dist/commonjs/funcs/usersGetCurrentUser.js +11 -1
- package/dist/commonjs/funcs/usersGetCurrentUser.js.map +1 -1
- package/dist/commonjs/funcs/usersGetUserById.d.ts +9 -1
- package/dist/commonjs/funcs/usersGetUserById.d.ts.map +1 -1
- package/dist/commonjs/funcs/usersGetUserById.js +13 -1
- package/dist/commonjs/funcs/usersGetUserById.js.map +1 -1
- package/dist/commonjs/funcs/usersUpdateUser.d.ts +12 -2
- package/dist/commonjs/funcs/usersUpdateUser.d.ts.map +1 -1
- package/dist/commonjs/funcs/usersUpdateUser.js +12 -2
- package/dist/commonjs/funcs/usersUpdateUser.js.map +1 -1
- package/dist/commonjs/funcs/vendorsCreateVendor.d.ts +24 -0
- package/dist/commonjs/funcs/vendorsCreateVendor.d.ts.map +1 -0
- package/dist/commonjs/funcs/{vendorsCreateVendorByCompanyManager.js → vendorsCreateVendor.js} +13 -13
- package/dist/commonjs/funcs/vendorsCreateVendor.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/components/emailpreferences.d.ts +78 -0
- package/dist/commonjs/models/components/emailpreferences.d.ts.map +1 -0
- package/dist/commonjs/models/components/emailpreferences.js +99 -0
- package/dist/commonjs/models/components/emailpreferences.js.map +1 -0
- package/dist/commonjs/models/components/expand.d.ts +9 -0
- package/dist/commonjs/models/components/expand.d.ts.map +1 -1
- package/dist/commonjs/models/components/expand.js +9 -0
- package/dist/commonjs/models/components/expand.js.map +1 -1
- package/dist/commonjs/models/components/index.d.ts +1 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +1 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/userdetails.d.ts +14 -0
- package/dist/commonjs/models/components/userdetails.d.ts.map +1 -1
- package/dist/commonjs/models/components/userdetails.js +3 -0
- package/dist/commonjs/models/components/userdetails.js.map +1 -1
- package/dist/commonjs/models/components/vendor.d.ts +23 -0
- package/dist/commonjs/models/components/vendor.d.ts.map +1 -1
- package/dist/commonjs/models/components/vendor.js +2 -0
- package/dist/commonjs/models/components/vendor.js.map +1 -1
- package/dist/commonjs/models/components/vendortype.d.ts +1 -0
- package/dist/commonjs/models/components/vendortype.d.ts.map +1 -1
- package/dist/commonjs/models/components/vendortype.js +6 -0
- package/dist/commonjs/models/components/vendortype.js.map +1 -1
- package/dist/{esm/models/operations/createvendorbycompanymanager.d.ts → commonjs/models/operations/createvendor.d.ts} +12 -12
- package/dist/commonjs/models/operations/createvendor.d.ts.map +1 -0
- package/dist/commonjs/models/operations/{createvendorbycompanymanager.js → createvendor.js} +13 -13
- package/dist/commonjs/models/operations/createvendor.js.map +1 -0
- package/dist/commonjs/models/operations/getuserbyid.d.ts +13 -3
- package/dist/commonjs/models/operations/getuserbyid.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getuserbyid.js +3 -1
- package/dist/commonjs/models/operations/getuserbyid.js.map +1 -1
- package/dist/commonjs/models/operations/index.d.ts +1 -1
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -1
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/updateuser.d.ts +19 -1
- package/dist/commonjs/models/operations/updateuser.d.ts.map +1 -1
- package/dist/commonjs/models/operations/updateuser.js +2 -0
- package/dist/commonjs/models/operations/updateuser.js.map +1 -1
- package/dist/commonjs/models/operations/updatevendordetails.d.ts +36 -4
- package/dist/commonjs/models/operations/updatevendordetails.d.ts.map +1 -1
- package/dist/commonjs/models/operations/updatevendordetails.js +9 -1
- package/dist/commonjs/models/operations/updatevendordetails.js.map +1 -1
- package/dist/commonjs/react-query/index.d.ts +1 -1
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +1 -1
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/usersGetCurrentUser.d.ts +22 -2
- package/dist/commonjs/react-query/usersGetCurrentUser.d.ts.map +1 -1
- package/dist/commonjs/react-query/usersGetCurrentUser.js +22 -2
- package/dist/commonjs/react-query/usersGetCurrentUser.js.map +1 -1
- package/dist/commonjs/react-query/usersGetUserById.core.d.ts +3 -1
- package/dist/commonjs/react-query/usersGetUserById.core.d.ts.map +1 -1
- package/dist/commonjs/react-query/usersGetUserById.core.js +9 -3
- package/dist/commonjs/react-query/usersGetUserById.core.js.map +1 -1
- package/dist/commonjs/react-query/usersGetUserById.d.ts +31 -4
- package/dist/commonjs/react-query/usersGetUserById.d.ts.map +1 -1
- package/dist/commonjs/react-query/usersGetUserById.js +18 -2
- package/dist/commonjs/react-query/usersGetUserById.js.map +1 -1
- package/dist/commonjs/react-query/usersUpdateUser.d.ts +12 -2
- package/dist/commonjs/react-query/usersUpdateUser.d.ts.map +1 -1
- package/dist/commonjs/react-query/usersUpdateUser.js +12 -2
- package/dist/commonjs/react-query/usersUpdateUser.js.map +1 -1
- package/dist/commonjs/react-query/vendorsCreateVendor.d.ts +33 -0
- package/dist/commonjs/react-query/vendorsCreateVendor.d.ts.map +1 -0
- package/dist/commonjs/react-query/vendorsCreateVendor.js +52 -0
- package/dist/commonjs/react-query/vendorsCreateVendor.js.map +1 -0
- package/dist/commonjs/sdk/users.d.ts +32 -4
- package/dist/commonjs/sdk/users.d.ts.map +1 -1
- package/dist/commonjs/sdk/users.js +32 -4
- package/dist/commonjs/sdk/users.js.map +1 -1
- package/dist/commonjs/sdk/vendors.d.ts +6 -6
- package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
- package/dist/commonjs/sdk/vendors.js +8 -8
- package/dist/commonjs/sdk/vendors.js.map +1 -1
- package/dist/esm/__tests__/vendors.test.js +17 -14
- package/dist/esm/__tests__/vendors.test.js.map +1 -1
- package/dist/esm/__tests__/zones.test.js +8 -10
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/funcs/usersGetCurrentUser.d.ts +11 -1
- package/dist/esm/funcs/usersGetCurrentUser.d.ts.map +1 -1
- package/dist/esm/funcs/usersGetCurrentUser.js +11 -1
- package/dist/esm/funcs/usersGetCurrentUser.js.map +1 -1
- package/dist/esm/funcs/usersGetUserById.d.ts +9 -1
- package/dist/esm/funcs/usersGetUserById.d.ts.map +1 -1
- package/dist/esm/funcs/usersGetUserById.js +14 -2
- package/dist/esm/funcs/usersGetUserById.js.map +1 -1
- package/dist/esm/funcs/usersUpdateUser.d.ts +12 -2
- package/dist/esm/funcs/usersUpdateUser.d.ts.map +1 -1
- package/dist/esm/funcs/usersUpdateUser.js +12 -2
- package/dist/esm/funcs/usersUpdateUser.js.map +1 -1
- package/dist/esm/funcs/vendorsCreateVendor.d.ts +24 -0
- package/dist/esm/funcs/vendorsCreateVendor.d.ts.map +1 -0
- package/dist/esm/funcs/{vendorsCreateVendorByCompanyManager.js → vendorsCreateVendor.js} +12 -12
- package/dist/esm/funcs/vendorsCreateVendor.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/components/emailpreferences.d.ts +78 -0
- package/dist/esm/models/components/emailpreferences.d.ts.map +1 -0
- package/dist/esm/models/components/emailpreferences.js +61 -0
- package/dist/esm/models/components/emailpreferences.js.map +1 -0
- package/dist/esm/models/components/expand.d.ts +9 -0
- package/dist/esm/models/components/expand.d.ts.map +1 -1
- package/dist/esm/models/components/expand.js +9 -0
- package/dist/esm/models/components/expand.js.map +1 -1
- package/dist/esm/models/components/index.d.ts +1 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +1 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/userdetails.d.ts +14 -0
- package/dist/esm/models/components/userdetails.d.ts.map +1 -1
- package/dist/esm/models/components/userdetails.js +3 -0
- package/dist/esm/models/components/userdetails.js.map +1 -1
- package/dist/esm/models/components/vendor.d.ts +23 -0
- package/dist/esm/models/components/vendor.d.ts.map +1 -1
- package/dist/esm/models/components/vendor.js +2 -0
- package/dist/esm/models/components/vendor.js.map +1 -1
- package/dist/esm/models/components/vendortype.d.ts +1 -0
- package/dist/esm/models/components/vendortype.d.ts.map +1 -1
- package/dist/esm/models/components/vendortype.js +6 -0
- package/dist/esm/models/components/vendortype.js.map +1 -1
- package/dist/{commonjs/models/operations/createvendorbycompanymanager.d.ts → esm/models/operations/createvendor.d.ts} +12 -12
- package/dist/esm/models/operations/createvendor.d.ts.map +1 -0
- package/dist/esm/models/operations/{createvendorbycompanymanager.js → createvendor.js} +10 -10
- package/dist/esm/models/operations/createvendor.js.map +1 -0
- package/dist/esm/models/operations/getuserbyid.d.ts +13 -3
- package/dist/esm/models/operations/getuserbyid.d.ts.map +1 -1
- package/dist/esm/models/operations/getuserbyid.js +3 -1
- package/dist/esm/models/operations/getuserbyid.js.map +1 -1
- package/dist/esm/models/operations/index.d.ts +1 -1
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -1
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/updateuser.d.ts +19 -1
- package/dist/esm/models/operations/updateuser.d.ts.map +1 -1
- package/dist/esm/models/operations/updateuser.js +2 -0
- package/dist/esm/models/operations/updateuser.js.map +1 -1
- package/dist/esm/models/operations/updatevendordetails.d.ts +36 -4
- package/dist/esm/models/operations/updatevendordetails.d.ts.map +1 -1
- package/dist/esm/models/operations/updatevendordetails.js +9 -1
- package/dist/esm/models/operations/updatevendordetails.js.map +1 -1
- package/dist/esm/react-query/index.d.ts +1 -1
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +1 -1
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/usersGetCurrentUser.d.ts +22 -2
- package/dist/esm/react-query/usersGetCurrentUser.d.ts.map +1 -1
- package/dist/esm/react-query/usersGetCurrentUser.js +22 -2
- package/dist/esm/react-query/usersGetCurrentUser.js.map +1 -1
- package/dist/esm/react-query/usersGetUserById.core.d.ts +3 -1
- package/dist/esm/react-query/usersGetUserById.core.d.ts.map +1 -1
- package/dist/esm/react-query/usersGetUserById.core.js +9 -3
- package/dist/esm/react-query/usersGetUserById.core.js.map +1 -1
- package/dist/esm/react-query/usersGetUserById.d.ts +31 -4
- package/dist/esm/react-query/usersGetUserById.d.ts.map +1 -1
- package/dist/esm/react-query/usersGetUserById.js +18 -2
- package/dist/esm/react-query/usersGetUserById.js.map +1 -1
- package/dist/esm/react-query/usersUpdateUser.d.ts +12 -2
- package/dist/esm/react-query/usersUpdateUser.d.ts.map +1 -1
- package/dist/esm/react-query/usersUpdateUser.js +12 -2
- package/dist/esm/react-query/usersUpdateUser.js.map +1 -1
- package/dist/esm/react-query/vendorsCreateVendor.d.ts +33 -0
- package/dist/esm/react-query/vendorsCreateVendor.d.ts.map +1 -0
- package/dist/esm/react-query/vendorsCreateVendor.js +47 -0
- package/dist/esm/react-query/vendorsCreateVendor.js.map +1 -0
- package/dist/esm/sdk/users.d.ts +32 -4
- package/dist/esm/sdk/users.d.ts.map +1 -1
- package/dist/esm/sdk/users.js +32 -4
- package/dist/esm/sdk/users.js.map +1 -1
- package/dist/esm/sdk/vendors.d.ts +6 -6
- package/dist/esm/sdk/vendors.d.ts.map +1 -1
- package/dist/esm/sdk/vendors.js +8 -8
- package/dist/esm/sdk/vendors.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/vendors.test.ts +20 -14
- package/src/__tests__/zones.test.ts +8 -10
- package/src/funcs/usersGetCurrentUser.ts +11 -1
- package/src/funcs/usersGetUserById.ts +15 -2
- package/src/funcs/usersUpdateUser.ts +12 -2
- package/src/funcs/{vendorsCreateVendorByCompanyManager.ts → vendorsCreateVendor.ts} +16 -22
- package/src/lib/config.ts +2 -2
- package/src/models/components/emailpreferences.ts +146 -0
- package/src/models/components/expand.ts +9 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/components/userdetails.ts +19 -0
- package/src/models/components/vendor.ts +25 -0
- package/src/models/components/vendortype.ts +7 -0
- package/src/models/operations/{createvendorbycompanymanager.ts → createvendor.ts} +22 -31
- package/src/models/operations/getuserbyid.ts +15 -4
- package/src/models/operations/index.ts +1 -1
- package/src/models/operations/updateuser.ts +21 -1
- package/src/models/operations/updatevendordetails.ts +36 -4
- package/src/react-query/index.ts +1 -1
- package/src/react-query/usersGetCurrentUser.ts +22 -2
- package/src/react-query/usersGetUserById.core.ts +12 -3
- package/src/react-query/usersGetUserById.ts +26 -4
- package/src/react-query/usersUpdateUser.ts +12 -2
- package/src/react-query/{vendorsCreateVendorByCompanyManager.ts → vendorsCreateVendor.ts} +29 -33
- package/src/sdk/users.ts +32 -4
- package/src/sdk/vendors.ts +10 -10
- package/dist/commonjs/funcs/vendorsCreateVendorByCompanyManager.d.ts +0 -24
- package/dist/commonjs/funcs/vendorsCreateVendorByCompanyManager.d.ts.map +0 -1
- package/dist/commonjs/funcs/vendorsCreateVendorByCompanyManager.js.map +0 -1
- package/dist/commonjs/models/operations/createvendorbycompanymanager.d.ts.map +0 -1
- package/dist/commonjs/models/operations/createvendorbycompanymanager.js.map +0 -1
- package/dist/commonjs/react-query/vendorsCreateVendorByCompanyManager.d.ts +0 -33
- package/dist/commonjs/react-query/vendorsCreateVendorByCompanyManager.d.ts.map +0 -1
- package/dist/commonjs/react-query/vendorsCreateVendorByCompanyManager.js +0 -56
- package/dist/commonjs/react-query/vendorsCreateVendorByCompanyManager.js.map +0 -1
- package/dist/esm/funcs/vendorsCreateVendorByCompanyManager.d.ts +0 -24
- package/dist/esm/funcs/vendorsCreateVendorByCompanyManager.d.ts.map +0 -1
- package/dist/esm/funcs/vendorsCreateVendorByCompanyManager.js.map +0 -1
- package/dist/esm/models/operations/createvendorbycompanymanager.d.ts.map +0 -1
- package/dist/esm/models/operations/createvendorbycompanymanager.js.map +0 -1
- package/dist/esm/react-query/vendorsCreateVendorByCompanyManager.d.ts +0 -33
- package/dist/esm/react-query/vendorsCreateVendorByCompanyManager.d.ts.map +0 -1
- package/dist/esm/react-query/vendorsCreateVendorByCompanyManager.js +0 -51
- package/dist/esm/react-query/vendorsCreateVendorByCompanyManager.js.map +0 -1
|
@@ -1064,8 +1064,14 @@ test("Vendors Update Vendor Custom Field", async () => {
|
|
|
1064
1064
|
expect(result).toEqual({});
|
|
1065
1065
|
});
|
|
1066
1066
|
|
|
1067
|
-
|
|
1068
|
-
|
|
1067
|
+
it.skip("Vendors Create Vendor By Company Manager", async () => {
|
|
1068
|
+
assert.fail(
|
|
1069
|
+
"incomplete test found please make sure to address the following errors: [`workflow step createVendorByCompanyManager.test referencing operation createVendorByCompanyManager not found in document`]",
|
|
1070
|
+
);
|
|
1071
|
+
});
|
|
1072
|
+
|
|
1073
|
+
test("Vendors Create Vendor", async () => {
|
|
1074
|
+
const testHttpClient = createTestHTTPClient("createVendor");
|
|
1069
1075
|
|
|
1070
1076
|
const greenSecurity = new GreenSecurity({
|
|
1071
1077
|
serverURL: process.env["TEST_SERVER_URL"] ?? "https://localhost:3000/api",
|
|
@@ -1075,24 +1081,24 @@ test("Vendors Create Vendor By Company Manager", async () => {
|
|
|
1075
1081
|
},
|
|
1076
1082
|
});
|
|
1077
1083
|
|
|
1078
|
-
const result = await greenSecurity.vendors.
|
|
1079
|
-
email: "
|
|
1080
|
-
firstName: "
|
|
1081
|
-
lastName: "
|
|
1084
|
+
const result = await greenSecurity.vendors.createVendor({
|
|
1085
|
+
email: "Lillie11@gmail.com",
|
|
1086
|
+
firstName: "Nannie",
|
|
1087
|
+
lastName: "Conroy",
|
|
1082
1088
|
title: "<value>",
|
|
1083
|
-
phone: "
|
|
1084
|
-
primaryFacilityId:
|
|
1089
|
+
phone: "611-206-9678",
|
|
1090
|
+
primaryFacilityId: 450969,
|
|
1085
1091
|
supervisorName: "<value>",
|
|
1086
|
-
supervisorEmail: "
|
|
1092
|
+
supervisorEmail: "Nettie.Prohaska-Frami37@yahoo.com",
|
|
1087
1093
|
supervisorPhone: "<value>",
|
|
1088
|
-
country: "
|
|
1094
|
+
country: "Tuvalu",
|
|
1089
1095
|
address1: "<value>",
|
|
1090
|
-
city: "
|
|
1091
|
-
state: "
|
|
1092
|
-
zip: "
|
|
1096
|
+
city: "Las Cruces",
|
|
1097
|
+
state: "Utah",
|
|
1098
|
+
zip: "42613",
|
|
1093
1099
|
});
|
|
1094
1100
|
expect(result).toBeDefined();
|
|
1095
1101
|
expect(result).toEqual({
|
|
1096
|
-
vendorId:
|
|
1102
|
+
vendorId: 333613,
|
|
1097
1103
|
});
|
|
1098
1104
|
});
|
|
@@ -39,12 +39,9 @@ test("Zones List Or Search Security Zones", async () => {
|
|
|
39
39
|
{
|
|
40
40
|
facility: {
|
|
41
41
|
contacts: {
|
|
42
|
-
contact:
|
|
43
|
-
status: "Deleted",
|
|
44
|
-
department: 123,
|
|
45
|
-
},
|
|
42
|
+
contact: null,
|
|
46
43
|
adminContact: {
|
|
47
|
-
status: "
|
|
44
|
+
status: "Inactive",
|
|
48
45
|
department: 123,
|
|
49
46
|
},
|
|
50
47
|
techContact: {
|
|
@@ -52,8 +49,8 @@ test("Zones List Or Search Security Zones", async () => {
|
|
|
52
49
|
department: 123,
|
|
53
50
|
},
|
|
54
51
|
greenSecurityCsm: {
|
|
55
|
-
status: "
|
|
56
|
-
department:
|
|
52
|
+
status: "Active",
|
|
53
|
+
department: null,
|
|
57
54
|
},
|
|
58
55
|
accountManager: {
|
|
59
56
|
status: "Active",
|
|
@@ -61,7 +58,7 @@ test("Zones List Or Search Security Zones", async () => {
|
|
|
61
58
|
},
|
|
62
59
|
},
|
|
63
60
|
vendorGuestPolicy: {
|
|
64
|
-
enabled:
|
|
61
|
+
enabled: true,
|
|
65
62
|
vendorGuestLimitAndOr: "and",
|
|
66
63
|
vendorGuestRequireEmail: false,
|
|
67
64
|
},
|
|
@@ -86,8 +83,9 @@ test("Zones Security Zone Checkin", async () => {
|
|
|
86
83
|
});
|
|
87
84
|
|
|
88
85
|
const result = await greenSecurity.zones.securityZoneCheckin({
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
longitude: 4275.84,
|
|
87
|
+
latitude: 5120.17,
|
|
88
|
+
zoneId: 673216,
|
|
91
89
|
});
|
|
92
90
|
expect(result).toBeDefined();
|
|
93
91
|
expect(result).toEqual({});
|
|
@@ -33,7 +33,17 @@ import { Result } from "../types/fp.js";
|
|
|
33
33
|
*
|
|
34
34
|
* @remarks
|
|
35
35
|
* Returns a user object for the user represented by the authorization token.
|
|
36
|
-
*
|
|
36
|
+
*
|
|
37
|
+
* By default the response returns a compact profile (id, name, email,
|
|
38
|
+
* phone, timezone, user type, and a handful of confirmation flags).
|
|
39
|
+
*
|
|
40
|
+
* Supported `expand` values:
|
|
41
|
+
* - `user` — return the full user record, including all profile fields stored against the user (sensitive columns such as passwords, MFA codes, and payment-provider IDs are always omitted)
|
|
42
|
+
* - `user.email_preferences` — include the user's `email_preferences` block (notification recipients and weekly email flags)
|
|
43
|
+
* - `company.location`, `company.vendor_type_restrictions`, `company.vendor_fields` — only valid for Company Manager users; embed extra fields on the user's company
|
|
44
|
+
*
|
|
45
|
+
* Multiple values can be combined with commas, e.g.
|
|
46
|
+
* `?expand=user.email_preferences,company.location`.
|
|
37
47
|
*
|
|
38
48
|
* If set, this operation will use {@link Security.bearerJwt} from the global security.
|
|
39
49
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { GreenSecurityCore } from "../core.js";
|
|
7
|
-
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
8
|
import { matchStatusCode } from "../lib/http.js";
|
|
9
9
|
import * as M from "../lib/matchers.js";
|
|
10
10
|
import { compactMap } from "../lib/primitives.js";
|
|
@@ -32,7 +32,15 @@ import { Result } from "../types/fp.js";
|
|
|
32
32
|
* Get user by id
|
|
33
33
|
*
|
|
34
34
|
* @remarks
|
|
35
|
-
* Returns a user object for the user represented by the identifier in
|
|
35
|
+
* Returns a user object for the user represented by the identifier in
|
|
36
|
+
* the path.
|
|
37
|
+
*
|
|
38
|
+
* By default the response returns a compact profile (id, name, email,
|
|
39
|
+
* phone, timezone, user type, and a handful of confirmation flags).
|
|
40
|
+
*
|
|
41
|
+
* Supported `expand` values:
|
|
42
|
+
* - `user` — return the full user record (sensitive columns such as passwords and payment-provider IDs are always omitted)
|
|
43
|
+
* - `user.email_preferences` — include the user's `email_preferences` block (notification recipients and weekly email flags)
|
|
36
44
|
*
|
|
37
45
|
* If set, this operation will use {@link Security.bearerJwt} from the global security.
|
|
38
46
|
*/
|
|
@@ -101,6 +109,10 @@ async function $do(
|
|
|
101
109
|
};
|
|
102
110
|
const path = pathToFunc("/users/{id}")(pathParams);
|
|
103
111
|
|
|
112
|
+
const query = encodeFormQuery({
|
|
113
|
+
"expand": payload.expand,
|
|
114
|
+
}, { explode: false });
|
|
115
|
+
|
|
104
116
|
const headers = new Headers(compactMap({
|
|
105
117
|
Accept: "application/json",
|
|
106
118
|
}));
|
|
@@ -129,6 +141,7 @@ async function $do(
|
|
|
129
141
|
baseURL: options?.serverURL,
|
|
130
142
|
path: path,
|
|
131
143
|
headers: headers,
|
|
144
|
+
query: query,
|
|
132
145
|
body: body,
|
|
133
146
|
userAgent: client._options.userAgent,
|
|
134
147
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
@@ -31,12 +31,22 @@ import { Result } from "../types/fp.js";
|
|
|
31
31
|
* Update user by ID
|
|
32
32
|
*
|
|
33
33
|
* @remarks
|
|
34
|
-
* Updates the contact information, address,
|
|
35
|
-
* Pass `me` as `{id}` to update the authenticated
|
|
34
|
+
* Updates the contact information, address, locale settings, and email
|
|
35
|
+
* preferences of a user. Pass `me` as `{id}` to update the authenticated
|
|
36
|
+
* user's own profile, or a positive integer user ID otherwise.
|
|
36
37
|
*
|
|
37
38
|
* Only submitted fields are applied — unrecognised fields are silently ignored.
|
|
38
39
|
* Changing `email` automatically resets `bounced_email` to `false`.
|
|
39
40
|
*
|
|
41
|
+
* Each subkey of `email_preferences` is independently optional; sending
|
|
42
|
+
* `{ "email_preferences": { "send_weekly_summary_email": true } }` flips
|
|
43
|
+
* only that flag and leaves the others unchanged.
|
|
44
|
+
*
|
|
45
|
+
* If the request body includes an `email_preferences` block, the response
|
|
46
|
+
* echoes the persisted values back as `user.email_preferences` so the
|
|
47
|
+
* client can confirm the write without a follow-up
|
|
48
|
+
* `GET ?expand=user.email_preferences` call.
|
|
49
|
+
*
|
|
40
50
|
* To rotate an API token use `POST /users/api_key_rotator` instead.
|
|
41
51
|
*
|
|
42
52
|
* If set, this operation will use {@link Security.bearerJwt} from the global security.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id:
|
|
3
|
+
* @generated-id: 24cce6a339d6
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { GreenSecurityCore } from "../core.js";
|
|
@@ -28,24 +28,24 @@ import { APICall, APIPromise } from "../types/async.js";
|
|
|
28
28
|
import { Result } from "../types/fp.js";
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* Create
|
|
31
|
+
* Create a new vendor
|
|
32
32
|
*
|
|
33
33
|
* @remarks
|
|
34
|
-
* Creates a new vendor account
|
|
35
|
-
* The vendor is automatically linked to the company manager's company.
|
|
34
|
+
* Creates a new vendor account linked to the specified company.
|
|
36
35
|
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
36
|
+
* `company_id` is optional for company managers — it defaults to their own company.
|
|
37
|
+
* All other callers must provide `company_id`. The caller must have access to the
|
|
38
|
+
* specified company (verified via scoped access policy) and the `vendors:add` permission.
|
|
39
39
|
*
|
|
40
40
|
* If set, this operation will use {@link Security.bearerJwt} from the global security.
|
|
41
41
|
*/
|
|
42
|
-
export function
|
|
42
|
+
export function vendorsCreateVendor(
|
|
43
43
|
client: GreenSecurityCore,
|
|
44
|
-
request: operations.
|
|
44
|
+
request: operations.CreateVendorRequestBody,
|
|
45
45
|
options?: RequestOptions,
|
|
46
46
|
): APIPromise<
|
|
47
47
|
Result<
|
|
48
|
-
operations.
|
|
48
|
+
operations.CreateVendorResponseBody,
|
|
49
49
|
| errors.ApiErrorResponse
|
|
50
50
|
| GreenSecurityError
|
|
51
51
|
| ResponseValidationError
|
|
@@ -66,12 +66,12 @@ export function vendorsCreateVendorByCompanyManager(
|
|
|
66
66
|
|
|
67
67
|
async function $do(
|
|
68
68
|
client: GreenSecurityCore,
|
|
69
|
-
request: operations.
|
|
69
|
+
request: operations.CreateVendorRequestBody,
|
|
70
70
|
options?: RequestOptions,
|
|
71
71
|
): Promise<
|
|
72
72
|
[
|
|
73
73
|
Result<
|
|
74
|
-
operations.
|
|
74
|
+
operations.CreateVendorResponseBody,
|
|
75
75
|
| errors.ApiErrorResponse
|
|
76
76
|
| GreenSecurityError
|
|
77
77
|
| ResponseValidationError
|
|
@@ -87,10 +87,7 @@ async function $do(
|
|
|
87
87
|
> {
|
|
88
88
|
const parsed = safeParse(
|
|
89
89
|
request,
|
|
90
|
-
(value) =>
|
|
91
|
-
operations.CreateVendorByCompanyManagerRequestBody$outboundSchema.parse(
|
|
92
|
-
value,
|
|
93
|
-
),
|
|
90
|
+
(value) => operations.CreateVendorRequestBody$outboundSchema.parse(value),
|
|
94
91
|
"Input validation failed",
|
|
95
92
|
);
|
|
96
93
|
if (!parsed.ok) {
|
|
@@ -99,7 +96,7 @@ async function $do(
|
|
|
99
96
|
const payload = parsed.value;
|
|
100
97
|
const body = encodeJSON("body", payload, { explode: true });
|
|
101
98
|
|
|
102
|
-
const path = pathToFunc("/
|
|
99
|
+
const path = pathToFunc("/vendors")();
|
|
103
100
|
|
|
104
101
|
const headers = new Headers(compactMap({
|
|
105
102
|
"Content-Type": "application/json",
|
|
@@ -112,7 +109,7 @@ async function $do(
|
|
|
112
109
|
const context = {
|
|
113
110
|
options: client._options,
|
|
114
111
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
115
|
-
operationID: "
|
|
112
|
+
operationID: "createVendor",
|
|
116
113
|
oAuth2Scopes: null,
|
|
117
114
|
|
|
118
115
|
resolvedSecurity: requestSecurity,
|
|
@@ -156,7 +153,7 @@ async function $do(
|
|
|
156
153
|
};
|
|
157
154
|
|
|
158
155
|
const [result] = await M.match<
|
|
159
|
-
operations.
|
|
156
|
+
operations.CreateVendorResponseBody,
|
|
160
157
|
| errors.ApiErrorResponse
|
|
161
158
|
| GreenSecurityError
|
|
162
159
|
| ResponseValidationError
|
|
@@ -167,10 +164,7 @@ async function $do(
|
|
|
167
164
|
| UnexpectedClientError
|
|
168
165
|
| SDKValidationError
|
|
169
166
|
>(
|
|
170
|
-
M.json(
|
|
171
|
-
201,
|
|
172
|
-
operations.CreateVendorByCompanyManagerResponseBody$inboundSchema,
|
|
173
|
-
),
|
|
167
|
+
M.json(201, operations.CreateVendorResponseBody$inboundSchema),
|
|
174
168
|
M.jsonErr([400, 401, 409, 422], errors.ApiErrorResponse$inboundSchema),
|
|
175
169
|
M.fail("4XX"),
|
|
176
170
|
M.fail([500, "5XX"]),
|
package/src/lib/config.ts
CHANGED
|
@@ -81,8 +81,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
81
81
|
export const SDK_METADATA = {
|
|
82
82
|
language: "typescript",
|
|
83
83
|
openapiDocVersion: "0.0.11",
|
|
84
|
-
sdkVersion: "0.43.1-beta.
|
|
84
|
+
sdkVersion: "0.43.1-beta.134",
|
|
85
85
|
genVersion: "2.882.0",
|
|
86
86
|
userAgent:
|
|
87
|
-
"speakeasy-sdk/typescript 0.43.1-beta.
|
|
87
|
+
"speakeasy-sdk/typescript 0.43.1-beta.134 2.882.0 0.0.11 @greensecurity/javascript-sdk",
|
|
88
88
|
} as const;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 2af302c1fbc3
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v3";
|
|
7
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
8
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
9
|
+
import * as openEnums from "../../types/enums.js";
|
|
10
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
11
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
12
|
+
import * as types from "../../types/primitives.js";
|
|
13
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Who receives vendor-related notification emails:
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* - `none` — no recipients
|
|
20
|
+
* - `self` — the user (vendor) themselves
|
|
21
|
+
* - `company_manager` — the vendor's company manager only
|
|
22
|
+
* - `self_and_company_manager` — both
|
|
23
|
+
*/
|
|
24
|
+
export const NotificationRecipients = {
|
|
25
|
+
None: "none",
|
|
26
|
+
Self: "self",
|
|
27
|
+
CompanyManager: "company_manager",
|
|
28
|
+
SelfAndCompanyManager: "self_and_company_manager",
|
|
29
|
+
} as const;
|
|
30
|
+
/**
|
|
31
|
+
* Who receives vendor-related notification emails:
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* - `none` — no recipients
|
|
35
|
+
* - `self` — the user (vendor) themselves
|
|
36
|
+
* - `company_manager` — the vendor's company manager only
|
|
37
|
+
* - `self_and_company_manager` — both
|
|
38
|
+
*/
|
|
39
|
+
export type NotificationRecipients = OpenEnum<typeof NotificationRecipients>;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* A user's consolidated email preferences. Used by the
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
* `email_preferences` payload section on `PUT /users/:id` and returned
|
|
46
|
+
* on `GET /users/:id` / `GET /users/me` when the request includes
|
|
47
|
+
* `expand=user.email_preferences`.
|
|
48
|
+
*
|
|
49
|
+
* Replaces the legacy vendor-side fields `email_recepient` and
|
|
50
|
+
* `send_weekly_summary_email`, which remain on the Vendor object during
|
|
51
|
+
* the migration window but are deprecated.
|
|
52
|
+
*/
|
|
53
|
+
export type EmailPreferences = {
|
|
54
|
+
/**
|
|
55
|
+
* Who receives vendor-related notification emails:
|
|
56
|
+
*
|
|
57
|
+
* @remarks
|
|
58
|
+
* - `none` — no recipients
|
|
59
|
+
* - `self` — the user (vendor) themselves
|
|
60
|
+
* - `company_manager` — the vendor's company manager only
|
|
61
|
+
* - `self_and_company_manager` — both
|
|
62
|
+
*/
|
|
63
|
+
notificationRecipients?: NotificationRecipients | null | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Whether the user receives the weekly vendor activity summary email.
|
|
66
|
+
*/
|
|
67
|
+
sendWeeklySummaryEmail?: boolean | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* Whether the user receives the weekly credentialing status summary email.
|
|
70
|
+
*/
|
|
71
|
+
sendWeeklyCredentialingStatusEmail?: boolean | undefined;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/** @internal */
|
|
75
|
+
export const NotificationRecipients$inboundSchema: z.ZodType<
|
|
76
|
+
NotificationRecipients,
|
|
77
|
+
z.ZodTypeDef,
|
|
78
|
+
unknown
|
|
79
|
+
> = openEnums.inboundSchema(NotificationRecipients);
|
|
80
|
+
/** @internal */
|
|
81
|
+
export const NotificationRecipients$outboundSchema: z.ZodType<
|
|
82
|
+
string,
|
|
83
|
+
z.ZodTypeDef,
|
|
84
|
+
NotificationRecipients
|
|
85
|
+
> = openEnums.outboundSchema(NotificationRecipients);
|
|
86
|
+
|
|
87
|
+
/** @internal */
|
|
88
|
+
export const EmailPreferences$inboundSchema: z.ZodType<
|
|
89
|
+
EmailPreferences,
|
|
90
|
+
z.ZodTypeDef,
|
|
91
|
+
unknown
|
|
92
|
+
> = z.object({
|
|
93
|
+
notification_recipients: z.nullable(NotificationRecipients$inboundSchema)
|
|
94
|
+
.optional(),
|
|
95
|
+
send_weekly_summary_email: types.optional(types.boolean()),
|
|
96
|
+
send_weekly_credentialing_status_email: types.optional(types.boolean()),
|
|
97
|
+
}).transform((v) => {
|
|
98
|
+
return remap$(v, {
|
|
99
|
+
"notification_recipients": "notificationRecipients",
|
|
100
|
+
"send_weekly_summary_email": "sendWeeklySummaryEmail",
|
|
101
|
+
"send_weekly_credentialing_status_email":
|
|
102
|
+
"sendWeeklyCredentialingStatusEmail",
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
/** @internal */
|
|
106
|
+
export type EmailPreferences$Outbound = {
|
|
107
|
+
notification_recipients?: string | null | undefined;
|
|
108
|
+
send_weekly_summary_email?: boolean | undefined;
|
|
109
|
+
send_weekly_credentialing_status_email?: boolean | undefined;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/** @internal */
|
|
113
|
+
export const EmailPreferences$outboundSchema: z.ZodType<
|
|
114
|
+
EmailPreferences$Outbound,
|
|
115
|
+
z.ZodTypeDef,
|
|
116
|
+
EmailPreferences
|
|
117
|
+
> = z.object({
|
|
118
|
+
notificationRecipients: z.nullable(NotificationRecipients$outboundSchema)
|
|
119
|
+
.optional(),
|
|
120
|
+
sendWeeklySummaryEmail: z.boolean().optional(),
|
|
121
|
+
sendWeeklyCredentialingStatusEmail: z.boolean().optional(),
|
|
122
|
+
}).transform((v) => {
|
|
123
|
+
return remap$(v, {
|
|
124
|
+
notificationRecipients: "notification_recipients",
|
|
125
|
+
sendWeeklySummaryEmail: "send_weekly_summary_email",
|
|
126
|
+
sendWeeklyCredentialingStatusEmail:
|
|
127
|
+
"send_weekly_credentialing_status_email",
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
export function emailPreferencesToJSON(
|
|
132
|
+
emailPreferences: EmailPreferences,
|
|
133
|
+
): string {
|
|
134
|
+
return JSON.stringify(
|
|
135
|
+
EmailPreferences$outboundSchema.parse(emailPreferences),
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
export function emailPreferencesFromJSON(
|
|
139
|
+
jsonString: string,
|
|
140
|
+
): SafeParseResult<EmailPreferences, SDKValidationError> {
|
|
141
|
+
return safeParse(
|
|
142
|
+
jsonString,
|
|
143
|
+
(x) => EmailPreferences$inboundSchema.parse(JSON.parse(x)),
|
|
144
|
+
`Failed to parse 'EmailPreferences' from JSON`,
|
|
145
|
+
);
|
|
146
|
+
}
|
|
@@ -36,6 +36,8 @@ export const Expand = {
|
|
|
36
36
|
VendorCreditBalance: "vendor.credit_balance",
|
|
37
37
|
VendorHasCredentialedFacilities: "vendor.has_credentialed_facilities",
|
|
38
38
|
VendorHasEmeraldStatus: "vendor.has_emerald_status",
|
|
39
|
+
VendorCustomFields: "vendor.custom_fields",
|
|
40
|
+
VendorLastScanned: "vendor.last_scanned",
|
|
39
41
|
VendorImageUrls: "vendor.image_urls",
|
|
40
42
|
VendorPrimaryFacility: "vendor.primary_facility",
|
|
41
43
|
VendorPrimaryDepartment: "vendor.primary_department",
|
|
@@ -105,6 +107,13 @@ export const Expand = {
|
|
|
105
107
|
SystemFacilities: "system.facilities",
|
|
106
108
|
SystemLocation: "system.location",
|
|
107
109
|
SubscriptionExpeditedOffer: "subscription.expedited_offer",
|
|
110
|
+
SubscriptionExpeditedOffers: "subscription.expedited_offers",
|
|
111
|
+
SubscriptionDateEnds: "subscription.date_ends",
|
|
112
|
+
SubscriptionVariantTitle: "subscription.variant_title",
|
|
113
|
+
SubscriptionCurrentLineItem: "subscription.current_line_item",
|
|
114
|
+
SubscriptionNextLineItem: "subscription.next_line_item",
|
|
115
|
+
SubscriptionCurrentFinancialStatus: "subscription.current_financial_status",
|
|
116
|
+
SubscriptionNextFinancialStatus: "subscription.next_financial_status",
|
|
108
117
|
DepartmentMembershipContact: "department_membership.contact",
|
|
109
118
|
DepartmentMembershipDepartment: "department_membership.department",
|
|
110
119
|
ScreeningQuestionScreeningAnswers: "screening_question.screening_answers",
|
|
@@ -23,6 +23,7 @@ export * from "./department.js";
|
|
|
23
23
|
export * from "./departmentmembership.js";
|
|
24
24
|
export * from "./departmentsummary.js";
|
|
25
25
|
export * from "./desc.js";
|
|
26
|
+
export * from "./emailpreferences.js";
|
|
26
27
|
export * from "./expand.js";
|
|
27
28
|
export * from "./facility.js";
|
|
28
29
|
export * from "./facilitycalendarsummary.js";
|
|
@@ -11,6 +11,10 @@ import { OpenEnum } from "../../types/enums.js";
|
|
|
11
11
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
12
12
|
import * as types from "../../types/primitives.js";
|
|
13
13
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
14
|
+
import {
|
|
15
|
+
EmailPreferences,
|
|
16
|
+
EmailPreferences$inboundSchema,
|
|
17
|
+
} from "./emailpreferences.js";
|
|
14
18
|
import { ImageSet, ImageSet$inboundSchema } from "./imageset.js";
|
|
15
19
|
import { UserLocation, UserLocation$inboundSchema } from "./userlocation.js";
|
|
16
20
|
|
|
@@ -74,6 +78,19 @@ export type UserDetails = {
|
|
|
74
78
|
* Reduced list of attributes of the User Location
|
|
75
79
|
*/
|
|
76
80
|
location?: UserLocation | null | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* A user's consolidated email preferences. Used by the
|
|
83
|
+
*
|
|
84
|
+
* @remarks
|
|
85
|
+
* `email_preferences` payload section on `PUT /users/:id` and returned
|
|
86
|
+
* on `GET /users/:id` / `GET /users/me` when the request includes
|
|
87
|
+
* `expand=user.email_preferences`.
|
|
88
|
+
*
|
|
89
|
+
* Replaces the legacy vendor-side fields `email_recepient` and
|
|
90
|
+
* `send_weekly_summary_email`, which remain on the Vendor object during
|
|
91
|
+
* the migration window but are deprecated.
|
|
92
|
+
*/
|
|
93
|
+
emailPreferences?: EmailPreferences | undefined;
|
|
77
94
|
};
|
|
78
95
|
|
|
79
96
|
/** @internal */
|
|
@@ -102,6 +119,7 @@ export const UserDetails$inboundSchema: z.ZodType<
|
|
|
102
119
|
timezone: z.nullable(types.string()).optional(),
|
|
103
120
|
image_urls: z.nullable(ImageSet$inboundSchema).optional(),
|
|
104
121
|
location: z.nullable(UserLocation$inboundSchema).optional(),
|
|
122
|
+
email_preferences: types.optional(EmailPreferences$inboundSchema),
|
|
105
123
|
}).transform((v) => {
|
|
106
124
|
return remap$(v, {
|
|
107
125
|
"first_name": "firstName",
|
|
@@ -111,6 +129,7 @@ export const UserDetails$inboundSchema: z.ZodType<
|
|
|
111
129
|
"email_confirmed": "emailConfirmed",
|
|
112
130
|
"user_type": "userType",
|
|
113
131
|
"image_urls": "imageUrls",
|
|
132
|
+
"email_preferences": "emailPreferences",
|
|
114
133
|
});
|
|
115
134
|
});
|
|
116
135
|
|
|
@@ -131,7 +131,26 @@ export type PendingInvoice = Invoice | number;
|
|
|
131
131
|
export type Vendor = {
|
|
132
132
|
id?: number | undefined;
|
|
133
133
|
badge?: Badge | null | undefined;
|
|
134
|
+
/**
|
|
135
|
+
* **Deprecated.** Use `user.email_preferences.notification_recipients`
|
|
136
|
+
*
|
|
137
|
+
* @remarks
|
|
138
|
+
* (returned via `expand=user.email_preferences` on `GET /api/users/:id`)
|
|
139
|
+
* instead. Will be removed once SDK consumers migrate.
|
|
140
|
+
*
|
|
141
|
+
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
142
|
+
*/
|
|
134
143
|
emailRecepient?: string | null | undefined;
|
|
144
|
+
/**
|
|
145
|
+
* **Deprecated.** Use
|
|
146
|
+
*
|
|
147
|
+
* @remarks
|
|
148
|
+
* `user.email_preferences.send_weekly_summary_email` (returned via
|
|
149
|
+
* `expand=user.email_preferences` on `GET /api/users/:id`) instead.
|
|
150
|
+
* Will be removed once SDK consumers migrate.
|
|
151
|
+
*
|
|
152
|
+
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
153
|
+
*/
|
|
135
154
|
sendWeeklySummaryEmail?: boolean | null | undefined;
|
|
136
155
|
title?: string | null | undefined;
|
|
137
156
|
hasEmeraldStatus?: boolean | null | undefined;
|
|
@@ -197,6 +216,10 @@ export type Vendor = {
|
|
|
197
216
|
* All custom fields (company-level and facility-level) associated with the vendor. Returned when expand includes vendor.custom_fields.
|
|
198
217
|
*/
|
|
199
218
|
customFields?: Array<VendorCustomFields> | null | undefined;
|
|
219
|
+
/**
|
|
220
|
+
* Date and time of the vendor's most recent scan. Returned when expand includes vendor.last_scanned.
|
|
221
|
+
*/
|
|
222
|
+
lastScanned?: string | null | undefined;
|
|
200
223
|
};
|
|
201
224
|
|
|
202
225
|
/** @internal */
|
|
@@ -596,6 +619,7 @@ export const Vendor$inboundSchema: z.ZodType<Vendor, z.ZodTypeDef, unknown> = z
|
|
|
596
619
|
target_facilities_updated: z.nullable(types.string()).optional(),
|
|
597
620
|
custom_fields: z.nullable(z.array(VendorCustomFields$inboundSchema))
|
|
598
621
|
.optional(),
|
|
622
|
+
last_scanned: z.nullable(types.string()).optional(),
|
|
599
623
|
}).transform((v) => {
|
|
600
624
|
return remap$(v, {
|
|
601
625
|
"email_recepient": "emailRecepient",
|
|
@@ -624,6 +648,7 @@ export const Vendor$inboundSchema: z.ZodType<Vendor, z.ZodTypeDef, unknown> = z
|
|
|
624
648
|
"has_credentialed_facilities": "hasCredentialedFacilities",
|
|
625
649
|
"target_facilities_updated": "targetFacilitiesUpdated",
|
|
626
650
|
"custom_fields": "customFields",
|
|
651
|
+
"last_scanned": "lastScanned",
|
|
627
652
|
});
|
|
628
653
|
});
|
|
629
654
|
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import * as z from "zod/v3";
|
|
7
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
8
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
10
|
import * as types from "../../types/primitives.js";
|
|
@@ -12,6 +13,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
12
13
|
export type VendorType = {
|
|
13
14
|
id?: number | undefined;
|
|
14
15
|
name?: string | undefined;
|
|
16
|
+
shortName?: string | null | undefined;
|
|
15
17
|
};
|
|
16
18
|
|
|
17
19
|
/** @internal */
|
|
@@ -22,6 +24,11 @@ export const VendorType$inboundSchema: z.ZodType<
|
|
|
22
24
|
> = z.object({
|
|
23
25
|
id: types.optional(types.number()),
|
|
24
26
|
name: types.optional(types.string()),
|
|
27
|
+
short_name: z.nullable(types.string()).optional(),
|
|
28
|
+
}).transform((v) => {
|
|
29
|
+
return remap$(v, {
|
|
30
|
+
"short_name": "shortName",
|
|
31
|
+
});
|
|
25
32
|
});
|
|
26
33
|
|
|
27
34
|
export function vendorTypeFromJSON(
|