@greensecurity/javascript-sdk 0.43.1-beta.132 → 0.43.1-beta.133
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__/webhooks.test.js +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
- package/dist/commonjs/__tests__/zones.test.js +2 -30
- 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__/webhooks.test.js +1 -1
- package/dist/esm/__tests__/webhooks.test.js.map +1 -1
- package/dist/esm/__tests__/zones.test.js +2 -30
- 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__/webhooks.test.ts +1 -1
- package/src/__tests__/zones.test.ts +2 -30
- 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
|
@@ -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(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id:
|
|
3
|
+
* @generated-id: abd496c93274
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import * as z from "zod/v3";
|
|
@@ -10,7 +10,7 @@ import { Result as SafeParseResult } from "../../types/fp.js";
|
|
|
10
10
|
import * as types from "../../types/primitives.js";
|
|
11
11
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
12
12
|
|
|
13
|
-
export type
|
|
13
|
+
export type CreateVendorRequestBody = {
|
|
14
14
|
/**
|
|
15
15
|
* The vendor's email address
|
|
16
16
|
*/
|
|
@@ -84,18 +84,18 @@ export type CreateVendorByCompanyManagerRequestBody = {
|
|
|
84
84
|
*/
|
|
85
85
|
zip: string;
|
|
86
86
|
/**
|
|
87
|
-
*
|
|
87
|
+
* The company to register the vendor under. Required for all callers except
|
|
88
88
|
*
|
|
89
89
|
* @remarks
|
|
90
|
-
*
|
|
90
|
+
* company managers, who default to their own company if omitted.
|
|
91
91
|
*/
|
|
92
|
-
|
|
92
|
+
companyId?: number | undefined;
|
|
93
93
|
};
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
96
|
* Vendor created successfully.
|
|
97
97
|
*/
|
|
98
|
-
export type
|
|
98
|
+
export type CreateVendorResponseBody = {
|
|
99
99
|
/**
|
|
100
100
|
* ID of the newly created vendor
|
|
101
101
|
*/
|
|
@@ -103,7 +103,7 @@ export type CreateVendorByCompanyManagerResponseBody = {
|
|
|
103
103
|
};
|
|
104
104
|
|
|
105
105
|
/** @internal */
|
|
106
|
-
export type
|
|
106
|
+
export type CreateVendorRequestBody$Outbound = {
|
|
107
107
|
email: string;
|
|
108
108
|
first_name: string;
|
|
109
109
|
last_name: string;
|
|
@@ -122,14 +122,14 @@ export type CreateVendorByCompanyManagerRequestBody$Outbound = {
|
|
|
122
122
|
city: string;
|
|
123
123
|
state: string;
|
|
124
124
|
zip: string;
|
|
125
|
-
|
|
125
|
+
company_id?: number | undefined;
|
|
126
126
|
};
|
|
127
127
|
|
|
128
128
|
/** @internal */
|
|
129
|
-
export const
|
|
130
|
-
|
|
129
|
+
export const CreateVendorRequestBody$outboundSchema: z.ZodType<
|
|
130
|
+
CreateVendorRequestBody$Outbound,
|
|
131
131
|
z.ZodTypeDef,
|
|
132
|
-
|
|
132
|
+
CreateVendorRequestBody
|
|
133
133
|
> = z.object({
|
|
134
134
|
email: z.string(),
|
|
135
135
|
firstName: z.string(),
|
|
@@ -149,7 +149,7 @@ export const CreateVendorByCompanyManagerRequestBody$outboundSchema: z.ZodType<
|
|
|
149
149
|
city: z.string(),
|
|
150
150
|
state: z.string(),
|
|
151
151
|
zip: z.string(),
|
|
152
|
-
|
|
152
|
+
companyId: z.number().int().optional(),
|
|
153
153
|
}).transform((v) => {
|
|
154
154
|
return remap$(v, {
|
|
155
155
|
firstName: "first_name",
|
|
@@ -158,24 +158,21 @@ export const CreateVendorByCompanyManagerRequestBody$outboundSchema: z.ZodType<
|
|
|
158
158
|
supervisorName: "supervisor_name",
|
|
159
159
|
supervisorEmail: "supervisor_email",
|
|
160
160
|
supervisorPhone: "supervisor_phone",
|
|
161
|
-
|
|
161
|
+
companyId: "company_id",
|
|
162
162
|
});
|
|
163
163
|
});
|
|
164
164
|
|
|
165
|
-
export function
|
|
166
|
-
|
|
167
|
-
CreateVendorByCompanyManagerRequestBody,
|
|
165
|
+
export function createVendorRequestBodyToJSON(
|
|
166
|
+
createVendorRequestBody: CreateVendorRequestBody,
|
|
168
167
|
): string {
|
|
169
168
|
return JSON.stringify(
|
|
170
|
-
|
|
171
|
-
createVendorByCompanyManagerRequestBody,
|
|
172
|
-
),
|
|
169
|
+
CreateVendorRequestBody$outboundSchema.parse(createVendorRequestBody),
|
|
173
170
|
);
|
|
174
171
|
}
|
|
175
172
|
|
|
176
173
|
/** @internal */
|
|
177
|
-
export const
|
|
178
|
-
|
|
174
|
+
export const CreateVendorResponseBody$inboundSchema: z.ZodType<
|
|
175
|
+
CreateVendorResponseBody,
|
|
179
176
|
z.ZodTypeDef,
|
|
180
177
|
unknown
|
|
181
178
|
> = z.object({
|
|
@@ -186,18 +183,12 @@ export const CreateVendorByCompanyManagerResponseBody$inboundSchema: z.ZodType<
|
|
|
186
183
|
});
|
|
187
184
|
});
|
|
188
185
|
|
|
189
|
-
export function
|
|
186
|
+
export function createVendorResponseBodyFromJSON(
|
|
190
187
|
jsonString: string,
|
|
191
|
-
): SafeParseResult<
|
|
192
|
-
CreateVendorByCompanyManagerResponseBody,
|
|
193
|
-
SDKValidationError
|
|
194
|
-
> {
|
|
188
|
+
): SafeParseResult<CreateVendorResponseBody, SDKValidationError> {
|
|
195
189
|
return safeParse(
|
|
196
190
|
jsonString,
|
|
197
|
-
(x) =>
|
|
198
|
-
|
|
199
|
-
JSON.parse(x),
|
|
200
|
-
),
|
|
201
|
-
`Failed to parse 'CreateVendorByCompanyManagerResponseBody' from JSON`,
|
|
191
|
+
(x) => CreateVendorResponseBody$inboundSchema.parse(JSON.parse(x)),
|
|
192
|
+
`Failed to parse 'CreateVendorResponseBody' from JSON`,
|
|
202
193
|
);
|
|
203
194
|
}
|
|
@@ -4,17 +4,27 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import * as z from "zod/v3";
|
|
7
|
+
import * as components from "../components/index.js";
|
|
7
8
|
|
|
8
9
|
export type GetUserByIdRequest = {
|
|
9
10
|
/**
|
|
10
|
-
*
|
|
11
|
+
* Either `me` for the authenticated user, or a positive integer user ID.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* Other values (including `0` and non-numeric strings) are rejected with
|
|
15
|
+
* a `422 Unprocessable Entity`.
|
|
11
16
|
*/
|
|
12
|
-
id:
|
|
17
|
+
id: string;
|
|
18
|
+
/**
|
|
19
|
+
* An array-style parameter to identify which sections of an object to expand. See documentation for the endpoint for a list of valid expansion values.
|
|
20
|
+
*/
|
|
21
|
+
expand?: Array<components.Expand> | undefined;
|
|
13
22
|
};
|
|
14
23
|
|
|
15
24
|
/** @internal */
|
|
16
25
|
export type GetUserByIdRequest$Outbound = {
|
|
17
|
-
id:
|
|
26
|
+
id: string;
|
|
27
|
+
expand?: Array<string> | undefined;
|
|
18
28
|
};
|
|
19
29
|
|
|
20
30
|
/** @internal */
|
|
@@ -23,7 +33,8 @@ export const GetUserByIdRequest$outboundSchema: z.ZodType<
|
|
|
23
33
|
z.ZodTypeDef,
|
|
24
34
|
GetUserByIdRequest
|
|
25
35
|
> = z.object({
|
|
26
|
-
id: z.
|
|
36
|
+
id: z.string(),
|
|
37
|
+
expand: z.array(components.Expand$outboundSchema).optional(),
|
|
27
38
|
});
|
|
28
39
|
|
|
29
40
|
export function getUserByIdRequestToJSON(
|
|
@@ -19,7 +19,7 @@ export * from "./createevent.js";
|
|
|
19
19
|
export * from "./createinvoice.js";
|
|
20
20
|
export * from "./createnewvendorcredentialversion.js";
|
|
21
21
|
export * from "./createorupdatebcr.js";
|
|
22
|
-
export * from "./
|
|
22
|
+
export * from "./createvendor.js";
|
|
23
23
|
export * from "./createvendorcompany.js";
|
|
24
24
|
export * from "./createvendorfield.js";
|
|
25
25
|
export * from "./createvendorregistration.js";
|
|
@@ -28,11 +28,28 @@ export type UpdateUserRequestBody = {
|
|
|
28
28
|
country?: string | undefined;
|
|
29
29
|
timezone?: string | undefined;
|
|
30
30
|
utcOffset?: number | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* A user's consolidated email preferences. Used by the
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* `email_preferences` payload section on `PUT /users/:id` and returned
|
|
36
|
+
* on `GET /users/:id` / `GET /users/me` when the request includes
|
|
37
|
+
* `expand=user.email_preferences`.
|
|
38
|
+
*
|
|
39
|
+
* Replaces the legacy vendor-side fields `email_recepient` and
|
|
40
|
+
* `send_weekly_summary_email`, which remain on the Vendor object during
|
|
41
|
+
* the migration window but are deprecated.
|
|
42
|
+
*/
|
|
43
|
+
emailPreferences?: components.EmailPreferences | undefined;
|
|
31
44
|
};
|
|
32
45
|
|
|
33
46
|
export type UpdateUserRequest = {
|
|
34
47
|
/**
|
|
35
|
-
*
|
|
48
|
+
* Either `me` for the authenticated user, or a positive integer user ID.
|
|
49
|
+
*
|
|
50
|
+
* @remarks
|
|
51
|
+
* Other values (including `0` and non-numeric strings) are rejected with
|
|
52
|
+
* a `422 Unprocessable Entity`.
|
|
36
53
|
*/
|
|
37
54
|
id: string;
|
|
38
55
|
requestBody: UpdateUserRequestBody;
|
|
@@ -67,6 +84,7 @@ export type UpdateUserRequestBody$Outbound = {
|
|
|
67
84
|
country?: string | undefined;
|
|
68
85
|
timezone?: string | undefined;
|
|
69
86
|
utc_offset?: number | undefined;
|
|
87
|
+
email_preferences?: components.EmailPreferences$Outbound | undefined;
|
|
70
88
|
};
|
|
71
89
|
|
|
72
90
|
/** @internal */
|
|
@@ -92,12 +110,14 @@ export const UpdateUserRequestBody$outboundSchema: z.ZodType<
|
|
|
92
110
|
country: z.string().optional(),
|
|
93
111
|
timezone: z.string().optional(),
|
|
94
112
|
utcOffset: z.number().optional(),
|
|
113
|
+
emailPreferences: components.EmailPreferences$outboundSchema.optional(),
|
|
95
114
|
}).transform((v) => {
|
|
96
115
|
return remap$(v, {
|
|
97
116
|
firstName: "first_name",
|
|
98
117
|
lastName: "last_name",
|
|
99
118
|
mobilePhone: "mobile_phone",
|
|
100
119
|
utcOffset: "utc_offset",
|
|
120
|
+
emailPreferences: "email_preferences",
|
|
101
121
|
});
|
|
102
122
|
});
|
|
103
123
|
|
|
@@ -9,7 +9,15 @@ import { ClosedEnum } from "../../types/enums.js";
|
|
|
9
9
|
import * as components from "../components/index.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* **Deprecated.** Use `PUT /api/users/:id` with
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* `email_preferences.notification_recipients` instead.
|
|
16
|
+
* The handler dual-writes to the user-side field during the
|
|
17
|
+
* migration window; this field will be removed once SDK
|
|
18
|
+
* consumers migrate.
|
|
19
|
+
*
|
|
20
|
+
* @deprecated enum: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
13
21
|
*/
|
|
14
22
|
export const EmailRecepient = {
|
|
15
23
|
NoEmail: "No email",
|
|
@@ -18,7 +26,15 @@ export const EmailRecepient = {
|
|
|
18
26
|
VendorAndCompanyManager: "Vendor and company manager",
|
|
19
27
|
} as const;
|
|
20
28
|
/**
|
|
21
|
-
*
|
|
29
|
+
* **Deprecated.** Use `PUT /api/users/:id` with
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* `email_preferences.notification_recipients` instead.
|
|
33
|
+
* The handler dual-writes to the user-side field during the
|
|
34
|
+
* migration window; this field will be removed once SDK
|
|
35
|
+
* consumers migrate.
|
|
36
|
+
*
|
|
37
|
+
* @deprecated enum: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
22
38
|
*/
|
|
23
39
|
export type EmailRecepient = ClosedEnum<typeof EmailRecepient>;
|
|
24
40
|
|
|
@@ -28,11 +44,27 @@ export type UpdateVendorDetailsRequestBody = {
|
|
|
28
44
|
*/
|
|
29
45
|
qrCode?: string | undefined;
|
|
30
46
|
/**
|
|
31
|
-
*
|
|
47
|
+
* **Deprecated.** Use `PUT /api/users/:id` with
|
|
48
|
+
*
|
|
49
|
+
* @remarks
|
|
50
|
+
* `email_preferences.notification_recipients` instead.
|
|
51
|
+
* The handler dual-writes to the user-side field during the
|
|
52
|
+
* migration window; this field will be removed once SDK
|
|
53
|
+
* consumers migrate.
|
|
54
|
+
*
|
|
55
|
+
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
32
56
|
*/
|
|
33
57
|
emailRecepient?: EmailRecepient | undefined;
|
|
34
58
|
/**
|
|
35
|
-
*
|
|
59
|
+
* **Deprecated.** Use `PUT /api/users/:id` with
|
|
60
|
+
*
|
|
61
|
+
* @remarks
|
|
62
|
+
* `email_preferences.send_weekly_summary_email` instead.
|
|
63
|
+
* The handler dual-writes to the user-side field during the
|
|
64
|
+
* migration window; this field will be removed once SDK
|
|
65
|
+
* consumers migrate.
|
|
66
|
+
*
|
|
67
|
+
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
36
68
|
*/
|
|
37
69
|
sendWeeklySummaryEmail?: boolean | undefined;
|
|
38
70
|
/**
|
package/src/react-query/index.ts
CHANGED
|
@@ -79,7 +79,7 @@ export * from "./vendorsChangeSubscription.js";
|
|
|
79
79
|
export * from "./vendorsCheckDownloadCode.js";
|
|
80
80
|
export * from "./vendorsCreateNewVendorCredentialVersion.js";
|
|
81
81
|
export * from "./vendorsCreateOrUpdateBcr.js";
|
|
82
|
-
export * from "./
|
|
82
|
+
export * from "./vendorsCreateVendor.js";
|
|
83
83
|
export * from "./vendorsCreateVendorCompany.js";
|
|
84
84
|
export * from "./vendorsCreateVendorRegistration.js";
|
|
85
85
|
export * from "./vendorsDeclineVendorCredential.js";
|
|
@@ -59,7 +59,17 @@ export type UsersGetCurrentUserQueryError =
|
|
|
59
59
|
*
|
|
60
60
|
* @remarks
|
|
61
61
|
* Returns a user object for the user represented by the authorization token.
|
|
62
|
-
*
|
|
62
|
+
*
|
|
63
|
+
* By default the response returns a compact profile (id, name, email,
|
|
64
|
+
* phone, timezone, user type, and a handful of confirmation flags).
|
|
65
|
+
*
|
|
66
|
+
* Supported `expand` values:
|
|
67
|
+
* - `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)
|
|
68
|
+
* - `user.email_preferences` — include the user's `email_preferences` block (notification recipients and weekly email flags)
|
|
69
|
+
* - `company.location`, `company.vendor_type_restrictions`, `company.vendor_fields` — only valid for Company Manager users; embed extra fields on the user's company
|
|
70
|
+
*
|
|
71
|
+
* Multiple values can be combined with commas, e.g.
|
|
72
|
+
* `?expand=user.email_preferences,company.location`.
|
|
63
73
|
*/
|
|
64
74
|
export function useUsersGetCurrentUser(
|
|
65
75
|
request: operations.GetCurrentUserRequest,
|
|
@@ -84,7 +94,17 @@ export function useUsersGetCurrentUser(
|
|
|
84
94
|
*
|
|
85
95
|
* @remarks
|
|
86
96
|
* Returns a user object for the user represented by the authorization token.
|
|
87
|
-
*
|
|
97
|
+
*
|
|
98
|
+
* By default the response returns a compact profile (id, name, email,
|
|
99
|
+
* phone, timezone, user type, and a handful of confirmation flags).
|
|
100
|
+
*
|
|
101
|
+
* Supported `expand` values:
|
|
102
|
+
* - `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)
|
|
103
|
+
* - `user.email_preferences` — include the user's `email_preferences` block (notification recipients and weekly email flags)
|
|
104
|
+
* - `company.location`, `company.vendor_type_restrictions`, `company.vendor_fields` — only valid for Company Manager users; embed extra fields on the user's company
|
|
105
|
+
*
|
|
106
|
+
* Multiple values can be combined with commas, e.g.
|
|
107
|
+
* `?expand=user.email_preferences,company.location`.
|
|
88
108
|
*/
|
|
89
109
|
export function useUsersGetCurrentUserSuspense(
|
|
90
110
|
request: operations.GetCurrentUserRequest,
|
|
@@ -43,7 +43,7 @@ export function buildUsersGetUserByIdQuery(
|
|
|
43
43
|
) => Promise<UsersGetUserByIdQueryData>;
|
|
44
44
|
} {
|
|
45
45
|
return {
|
|
46
|
-
queryKey: queryKeyUsersGetUserById(request.id),
|
|
46
|
+
queryKey: queryKeyUsersGetUserById(request.id, { expand: request.expand }),
|
|
47
47
|
queryFn: async function usersGetUserByIdQueryFn(
|
|
48
48
|
ctx,
|
|
49
49
|
): Promise<UsersGetUserByIdQueryData> {
|
|
@@ -67,6 +67,15 @@ export function buildUsersGetUserByIdQuery(
|
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
export function queryKeyUsersGetUserById(
|
|
71
|
-
|
|
70
|
+
export function queryKeyUsersGetUserById(
|
|
71
|
+
id: string,
|
|
72
|
+
parameters: { expand?: Array<components.Expand> | undefined },
|
|
73
|
+
): QueryKey {
|
|
74
|
+
return [
|
|
75
|
+
"@greensecurity/javascript-sdk",
|
|
76
|
+
"users",
|
|
77
|
+
"getUserById",
|
|
78
|
+
id,
|
|
79
|
+
parameters,
|
|
80
|
+
];
|
|
72
81
|
}
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
useSuspenseQuery,
|
|
12
12
|
UseSuspenseQueryResult,
|
|
13
13
|
} from "@tanstack/react-query";
|
|
14
|
+
import * as components from "../models/components/index.js";
|
|
14
15
|
import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
|
|
15
16
|
import {
|
|
16
17
|
ConnectionError,
|
|
@@ -57,7 +58,15 @@ export type UsersGetUserByIdQueryError =
|
|
|
57
58
|
* Get user by id
|
|
58
59
|
*
|
|
59
60
|
* @remarks
|
|
60
|
-
* Returns a user object for the user represented by the identifier in
|
|
61
|
+
* Returns a user object for the user represented by the identifier in
|
|
62
|
+
* the path.
|
|
63
|
+
*
|
|
64
|
+
* By default the response returns a compact profile (id, name, email,
|
|
65
|
+
* phone, timezone, user type, and a handful of confirmation flags).
|
|
66
|
+
*
|
|
67
|
+
* Supported `expand` values:
|
|
68
|
+
* - `user` — return the full user record (sensitive columns such as passwords and payment-provider IDs are always omitted)
|
|
69
|
+
* - `user.email_preferences` — include the user's `email_preferences` block (notification recipients and weekly email flags)
|
|
61
70
|
*/
|
|
62
71
|
export function useUsersGetUserById(
|
|
63
72
|
request: operations.GetUserByIdRequest,
|
|
@@ -81,7 +90,15 @@ export function useUsersGetUserById(
|
|
|
81
90
|
* Get user by id
|
|
82
91
|
*
|
|
83
92
|
* @remarks
|
|
84
|
-
* Returns a user object for the user represented by the identifier in
|
|
93
|
+
* Returns a user object for the user represented by the identifier in
|
|
94
|
+
* the path.
|
|
95
|
+
*
|
|
96
|
+
* By default the response returns a compact profile (id, name, email,
|
|
97
|
+
* phone, timezone, user type, and a handful of confirmation flags).
|
|
98
|
+
*
|
|
99
|
+
* Supported `expand` values:
|
|
100
|
+
* - `user` — return the full user record (sensitive columns such as passwords and payment-provider IDs are always omitted)
|
|
101
|
+
* - `user.email_preferences` — include the user's `email_preferences` block (notification recipients and weekly email flags)
|
|
85
102
|
*/
|
|
86
103
|
export function useUsersGetUserByIdSuspense(
|
|
87
104
|
request: operations.GetUserByIdRequest,
|
|
@@ -106,7 +123,10 @@ export function useUsersGetUserByIdSuspense(
|
|
|
106
123
|
|
|
107
124
|
export function setUsersGetUserByIdData(
|
|
108
125
|
client: QueryClient,
|
|
109
|
-
queryKeyBase: [
|
|
126
|
+
queryKeyBase: [
|
|
127
|
+
id: string,
|
|
128
|
+
parameters: { expand?: Array<components.Expand> | undefined },
|
|
129
|
+
],
|
|
110
130
|
data: UsersGetUserByIdQueryData,
|
|
111
131
|
): UsersGetUserByIdQueryData | undefined {
|
|
112
132
|
const key = queryKeyUsersGetUserById(...queryKeyBase);
|
|
@@ -116,7 +136,9 @@ export function setUsersGetUserByIdData(
|
|
|
116
136
|
|
|
117
137
|
export function invalidateUsersGetUserById(
|
|
118
138
|
client: QueryClient,
|
|
119
|
-
queryKeyBase: TupleToPrefixes<
|
|
139
|
+
queryKeyBase: TupleToPrefixes<
|
|
140
|
+
[id: string, parameters: { expand?: Array<components.Expand> | undefined }]
|
|
141
|
+
>,
|
|
120
142
|
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
121
143
|
): Promise<void> {
|
|
122
144
|
return client.invalidateQueries({
|
|
@@ -50,12 +50,22 @@ export type UsersUpdateUserMutationError =
|
|
|
50
50
|
* Update user by ID
|
|
51
51
|
*
|
|
52
52
|
* @remarks
|
|
53
|
-
* Updates the contact information, address,
|
|
54
|
-
* Pass `me` as `{id}` to update the authenticated
|
|
53
|
+
* Updates the contact information, address, locale settings, and email
|
|
54
|
+
* preferences of a user. Pass `me` as `{id}` to update the authenticated
|
|
55
|
+
* user's own profile, or a positive integer user ID otherwise.
|
|
55
56
|
*
|
|
56
57
|
* Only submitted fields are applied — unrecognised fields are silently ignored.
|
|
57
58
|
* Changing `email` automatically resets `bounced_email` to `false`.
|
|
58
59
|
*
|
|
60
|
+
* Each subkey of `email_preferences` is independently optional; sending
|
|
61
|
+
* `{ "email_preferences": { "send_weekly_summary_email": true } }` flips
|
|
62
|
+
* only that flag and leaves the others unchanged.
|
|
63
|
+
*
|
|
64
|
+
* If the request body includes an `email_preferences` block, the response
|
|
65
|
+
* echoes the persisted values back as `user.email_preferences` so the
|
|
66
|
+
* client can confirm the write without a follow-up
|
|
67
|
+
* `GET ?expand=user.email_preferences` call.
|
|
68
|
+
*
|
|
59
69
|
* To rotate an API token use `POST /users/api_key_rotator` instead.
|
|
60
70
|
*/
|
|
61
71
|
export function useUsersUpdateUserMutation(
|