@insignia-education/api-sdk-js 0.15.114 → 0.15.116

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insignia-education/api-sdk-js",
3
- "version": "0.15.114",
3
+ "version": "0.15.116",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -264,6 +264,25 @@ export default class Users {
264
264
  };
265
265
  }
266
266
 
267
+ /** Email verification for this user. verify/unverify/sendVerification: Sellers-and-above only. */
268
+ emails(userId) {
269
+ const base = `/users/${userId}/emails`;
270
+ const client = this.#client;
271
+ return {
272
+ /** field: 'email' | 'contact_mail' | 'public_mail' | 'legal_guardian_mail'. */
273
+ verify: (field) => client.post(`${base}/${field}/verify`),
274
+ /** Clears the field back to unverified. */
275
+ unverify: (field) => client.post(`${base}/${field}/unverify`),
276
+ /** Sends a real confirm-link email to whatever address is on file for field. */
277
+ sendVerification: (field) => client.post(`${base}/${field}/send-verification`),
278
+ };
279
+ }
280
+
281
+ /** Public — confirms a contact/public/guardian email verify-link's hash. No auth. */
282
+ confirmEmailVerification(hash) {
283
+ return this.#client.post(`/users/emails/verify/${hash}`);
284
+ }
285
+
267
286
  /** Verified Telegram account linking for this user. Owner or staff only. */
268
287
  telegram(userId) {
269
288
  const base = `/users/${userId}/telegram`;