@moonbase.sh/storefront-api 0.1.98 → 0.1.100

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/dist/index.cjs CHANGED
@@ -299,6 +299,12 @@ var identityUserSchema = userSchema.and(import_zod7.z.object({
299
299
  accessToken: import_zod7.z.string(),
300
300
  refreshToken: import_zod7.z.string()
301
301
  }));
302
+ var userAccountConfirmedSchema = import_zod7.z.object({
303
+ id: import_zod7.z.string(),
304
+ name: import_zod7.z.string(),
305
+ email: import_zod7.z.string(),
306
+ resetPasswordToken: import_zod7.z.string().nullable()
307
+ });
302
308
 
303
309
  // src/identity/endpoints.ts
304
310
  var IdentityEndpoints = class {
@@ -361,7 +367,7 @@ var IdentityEndpoints = class {
361
367
  await this.api.fetch(`/api/customer/identity/forgot-password?email=${encodeURIComponent(email)}`, "POST");
362
368
  }
363
369
  async resetPassword(email, newPassword, code) {
364
- const response = await (0, import_cross_fetch.default)(`${this.api.baseUrl}/api/customer/identity/reset-password?email=${encodeURIComponent(email)}&code=${code}`, {
370
+ const response = await (0, import_cross_fetch.default)(`${this.api.baseUrl}/api/customer/identity/reset-password?email=${encodeURIComponent(email)}&code=${encodeURIComponent(code.replaceAll(" ", "+"))}`, {
365
371
  method: "POST",
366
372
  headers: {
367
373
  "Accept": "application/json",
@@ -373,6 +379,16 @@ var IdentityEndpoints = class {
373
379
  if (response.status >= 400)
374
380
  await handleResponseProblem(response);
375
381
  }
382
+ async confirmAccount(email, code) {
383
+ const response = await this.api.fetch(`/api/customer/identity/confirm-account?email=${encodeURIComponent(email)}&code=${encodeURIComponent(code.replaceAll(" ", "+"))}`, "POST");
384
+ return userAccountConfirmedSchema.parse(response.data);
385
+ }
386
+ async confirmEmail(email, code) {
387
+ await this.api.fetch(`/customer/identity/confirm-email?email=${encodeURIComponent(email)}&code=${encodeURIComponent(code.replaceAll(" ", "+"))}`, "POST");
388
+ }
389
+ async confirmEmailChange(email, code) {
390
+ await this.api.authenticatedFetch(`/customer/identity/confirm-email-change?email=${encodeURIComponent(email)}&code=${encodeURIComponent(code.replaceAll(" ", "+"))}`, "POST");
391
+ }
376
392
  };
377
393
 
378
394
  // src/orders/schemas.ts
package/dist/index.d.cts CHANGED
@@ -172,6 +172,22 @@ declare const identityUserSchema: z.ZodIntersection<z.ZodObject<{
172
172
  accessToken: string;
173
173
  refreshToken: string;
174
174
  }>>;
175
+ declare const userAccountConfirmedSchema: z.ZodObject<{
176
+ id: z.ZodString;
177
+ name: z.ZodString;
178
+ email: z.ZodString;
179
+ resetPasswordToken: z.ZodNullable<z.ZodString>;
180
+ }, "strip", z.ZodTypeAny, {
181
+ id: string;
182
+ email: string;
183
+ name: string;
184
+ resetPasswordToken: string | null;
185
+ }, {
186
+ id: string;
187
+ email: string;
188
+ name: string;
189
+ resetPasswordToken: string | null;
190
+ }>;
175
191
 
176
192
  type IdentityUser = z.infer<typeof identityUserSchema>;
177
193
  type UserTokens = IdentityUser & {
@@ -679,6 +695,7 @@ declare class ActivationRequestEndpoints {
679
695
  type CommunicationPreferences = z.infer<typeof communicationPreferencesSchema>;
680
696
  type User = z.infer<typeof userSchema>;
681
697
  type Address = z.infer<typeof addressSchema>;
698
+ type UserAccountConfirmed = z.infer<typeof userAccountConfirmedSchema>;
682
699
 
683
700
  declare class IdentityEndpoints {
684
701
  private api;
@@ -693,6 +710,9 @@ declare class IdentityEndpoints {
693
710
  setPassword(currentPassword: string, newPassword: string): Promise<void>;
694
711
  forgotPassword(email: string): Promise<void>;
695
712
  resetPassword(email: string, newPassword: string, code: string): Promise<void>;
713
+ confirmAccount(email: string, code: string): Promise<UserAccountConfirmed>;
714
+ confirmEmail(email: string, code: string): Promise<void>;
715
+ confirmEmailChange(email: string, code: string): Promise<void>;
696
716
  }
697
717
 
698
718
  declare const openProductLineItem: z.ZodObject<{
@@ -13143,4 +13163,4 @@ declare class MoonbaseClient {
13143
13163
  orders: OrderEndpoints;
13144
13164
  }
13145
13165
 
13146
- export { type Activation, ActivationMethod, type ActivationRequest, ActivationRequestStatus, ActivationStatus, type Address, type BundleLineItem, type CommunicationPreferences, type Download, type License, LicenseStatus, type LineItem, MoonbaseClient, type MoonbaseConfiguration, MoonbaseError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, type OpenOrder, type Order, OrderStatus, type OwnedProduct, type Page, Platform, type PricingVariation, type ProductLineItem, type Quantifiable, type Storefront, type StorefrontBundle, type StorefrontProduct, type UrchinTrackingModule, type User, type Voucher, utmToObject };
13166
+ export { type Activation, ActivationMethod, type ActivationRequest, ActivationRequestStatus, ActivationStatus, type Address, type BundleLineItem, type CommunicationPreferences, type Download, type License, LicenseStatus, type LineItem, MoonbaseClient, type MoonbaseConfiguration, MoonbaseError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, type OpenOrder, type Order, OrderStatus, type OwnedProduct, type Page, Platform, type PricingVariation, type ProductLineItem, type Quantifiable, type Storefront, type StorefrontBundle, type StorefrontProduct, type UrchinTrackingModule, type User, type UserAccountConfirmed, type Voucher, utmToObject };
package/dist/index.d.ts CHANGED
@@ -172,6 +172,22 @@ declare const identityUserSchema: z.ZodIntersection<z.ZodObject<{
172
172
  accessToken: string;
173
173
  refreshToken: string;
174
174
  }>>;
175
+ declare const userAccountConfirmedSchema: z.ZodObject<{
176
+ id: z.ZodString;
177
+ name: z.ZodString;
178
+ email: z.ZodString;
179
+ resetPasswordToken: z.ZodNullable<z.ZodString>;
180
+ }, "strip", z.ZodTypeAny, {
181
+ id: string;
182
+ email: string;
183
+ name: string;
184
+ resetPasswordToken: string | null;
185
+ }, {
186
+ id: string;
187
+ email: string;
188
+ name: string;
189
+ resetPasswordToken: string | null;
190
+ }>;
175
191
 
176
192
  type IdentityUser = z.infer<typeof identityUserSchema>;
177
193
  type UserTokens = IdentityUser & {
@@ -679,6 +695,7 @@ declare class ActivationRequestEndpoints {
679
695
  type CommunicationPreferences = z.infer<typeof communicationPreferencesSchema>;
680
696
  type User = z.infer<typeof userSchema>;
681
697
  type Address = z.infer<typeof addressSchema>;
698
+ type UserAccountConfirmed = z.infer<typeof userAccountConfirmedSchema>;
682
699
 
683
700
  declare class IdentityEndpoints {
684
701
  private api;
@@ -693,6 +710,9 @@ declare class IdentityEndpoints {
693
710
  setPassword(currentPassword: string, newPassword: string): Promise<void>;
694
711
  forgotPassword(email: string): Promise<void>;
695
712
  resetPassword(email: string, newPassword: string, code: string): Promise<void>;
713
+ confirmAccount(email: string, code: string): Promise<UserAccountConfirmed>;
714
+ confirmEmail(email: string, code: string): Promise<void>;
715
+ confirmEmailChange(email: string, code: string): Promise<void>;
696
716
  }
697
717
 
698
718
  declare const openProductLineItem: z.ZodObject<{
@@ -13143,4 +13163,4 @@ declare class MoonbaseClient {
13143
13163
  orders: OrderEndpoints;
13144
13164
  }
13145
13165
 
13146
- export { type Activation, ActivationMethod, type ActivationRequest, ActivationRequestStatus, ActivationStatus, type Address, type BundleLineItem, type CommunicationPreferences, type Download, type License, LicenseStatus, type LineItem, MoonbaseClient, type MoonbaseConfiguration, MoonbaseError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, type OpenOrder, type Order, OrderStatus, type OwnedProduct, type Page, Platform, type PricingVariation, type ProductLineItem, type Quantifiable, type Storefront, type StorefrontBundle, type StorefrontProduct, type UrchinTrackingModule, type User, type Voucher, utmToObject };
13166
+ export { type Activation, ActivationMethod, type ActivationRequest, ActivationRequestStatus, ActivationStatus, type Address, type BundleLineItem, type CommunicationPreferences, type Download, type License, LicenseStatus, type LineItem, MoonbaseClient, type MoonbaseConfiguration, MoonbaseError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, type OpenOrder, type Order, OrderStatus, type OwnedProduct, type Page, Platform, type PricingVariation, type ProductLineItem, type Quantifiable, type Storefront, type StorefrontBundle, type StorefrontProduct, type UrchinTrackingModule, type User, type UserAccountConfirmed, type Voucher, utmToObject };
package/dist/index.js CHANGED
@@ -252,6 +252,12 @@ var identityUserSchema = userSchema.and(z7.object({
252
252
  accessToken: z7.string(),
253
253
  refreshToken: z7.string()
254
254
  }));
255
+ var userAccountConfirmedSchema = z7.object({
256
+ id: z7.string(),
257
+ name: z7.string(),
258
+ email: z7.string(),
259
+ resetPasswordToken: z7.string().nullable()
260
+ });
255
261
 
256
262
  // src/identity/endpoints.ts
257
263
  var IdentityEndpoints = class {
@@ -314,7 +320,7 @@ var IdentityEndpoints = class {
314
320
  await this.api.fetch(`/api/customer/identity/forgot-password?email=${encodeURIComponent(email)}`, "POST");
315
321
  }
316
322
  async resetPassword(email, newPassword, code) {
317
- const response = await fetch(`${this.api.baseUrl}/api/customer/identity/reset-password?email=${encodeURIComponent(email)}&code=${code}`, {
323
+ const response = await fetch(`${this.api.baseUrl}/api/customer/identity/reset-password?email=${encodeURIComponent(email)}&code=${encodeURIComponent(code.replaceAll(" ", "+"))}`, {
318
324
  method: "POST",
319
325
  headers: {
320
326
  "Accept": "application/json",
@@ -326,6 +332,16 @@ var IdentityEndpoints = class {
326
332
  if (response.status >= 400)
327
333
  await handleResponseProblem(response);
328
334
  }
335
+ async confirmAccount(email, code) {
336
+ const response = await this.api.fetch(`/api/customer/identity/confirm-account?email=${encodeURIComponent(email)}&code=${encodeURIComponent(code.replaceAll(" ", "+"))}`, "POST");
337
+ return userAccountConfirmedSchema.parse(response.data);
338
+ }
339
+ async confirmEmail(email, code) {
340
+ await this.api.fetch(`/customer/identity/confirm-email?email=${encodeURIComponent(email)}&code=${encodeURIComponent(code.replaceAll(" ", "+"))}`, "POST");
341
+ }
342
+ async confirmEmailChange(email, code) {
343
+ await this.api.authenticatedFetch(`/customer/identity/confirm-email-change?email=${encodeURIComponent(email)}&code=${encodeURIComponent(code.replaceAll(" ", "+"))}`, "POST");
344
+ }
329
345
  };
330
346
 
331
347
  // src/orders/schemas.ts
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@moonbase.sh/storefront-api",
3
3
  "type": "module",
4
- "version": "0.1.98",
4
+ "version": "0.1.100",
5
5
  "description": "Package to let you build storefronts with Moonbase.sh as payment and delivery provider",
6
6
  "author": "Tobias Lønnerød Madsen <m@dsen.tv>",
7
7
  "license": "MIT",