@posiwise/common-services 0.1.86 → 0.1.88

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.
@@ -4,6 +4,11 @@ export interface ProfileData {
4
4
  id?: number;
5
5
  send_marketing_emails?: string[];
6
6
  avatar?: string;
7
+ /**
8
+ * UTC datetime when the user accepted the latest Terms of Service.
9
+ * This is written via the generic `/user` profile update endpoint.
10
+ */
11
+ tos_accepted_at?: string;
7
12
  }
8
13
  export interface WindowData {
9
14
  ga: (command: string, fieldName: string, fieldValue: string) => void;
@@ -17,6 +17,8 @@ export declare class ProductService {
17
17
  getProductCategories(): import("rxjs").Observable<any>;
18
18
  getProductInsight(subscriptionId: number, starting_at?: string, ending_at?: string): import("rxjs").Observable<any>;
19
19
  getUsersForProduct(id: number, subscription_id: number): import("rxjs").Observable<any>;
20
+ getAvailableStripeUnsubscribeBehaviors(): import("rxjs").Observable<any>;
21
+ getAvailableStripeProrationBehaviors(): import("rxjs").Observable<any>;
20
22
  static ɵfac: i0.ɵɵFactoryDeclaration<ProductService, never>;
21
23
  static ɵprov: i0.ɵɵInjectableDeclaration<ProductService>;
22
24
  }
@@ -1,18 +1,31 @@
1
1
  import { Router } from '@angular/router';
2
+ import { AppConfigService } from '@posiwise/app-config-service';
2
3
  import { AppState, UserState } from '@posiwise/app-store';
3
4
  import { Paging, User } from '@posiwise/common-utilities';
4
5
  import { Observable } from 'rxjs';
5
6
  import { Store } from '@ngrx/store';
6
7
  import { MainApiHttpService } from './main-api-http.service';
8
+ import { ProfileService } from './profile.service';
9
+ import { CustomToastService } from './toast.service';
7
10
  import * as i0 from "@angular/core";
8
11
  export declare class UserService {
9
12
  private readonly api;
10
13
  private readonly store;
11
14
  private readonly router;
15
+ private readonly appConfigService;
16
+ private readonly profileService;
17
+ private readonly toast;
12
18
  private readonly endpoint;
13
- constructor(api: MainApiHttpService, store: Store<AppState>, router: Router);
19
+ private isTosModalOpen;
20
+ constructor(api: MainApiHttpService, store: Store<AppState>, router: Router, appConfigService: AppConfigService, profileService: ProfileService, toast: CustomToastService);
14
21
  getUserState(): Observable<UserState>;
15
22
  getUserInfo(): Observable<User>;
23
+ /**
24
+ * Ensure the current user has accepted the latest Terms of Service for this domain.
25
+ * If the domain has a newer TOS version than the user's accepted timestamp, a blocking
26
+ * SweetAlert2 modal is shown that forces the user to accept before continuing.
27
+ */
28
+ private checkAndHandleTosAcceptance;
16
29
  followUser(id: number): Observable<any>;
17
30
  sendSSOActivationEmail(): Observable<any>;
18
31
  updateSlug(slug: string): Observable<any>;
@@ -44,6 +57,7 @@ export declare class UserService {
44
57
  tip_id: number;
45
58
  disregarded: boolean;
46
59
  }): Observable<any>;
60
+ refreshUserApiTokens(): Observable<any>;
47
61
  static ɵfac: i0.ɵɵFactoryDeclaration<UserService, never>;
48
62
  static ɵprov: i0.ɵɵInjectableDeclaration<UserService>;
49
63
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posiwise/common-services",
3
- "version": "0.1.86",
3
+ "version": "0.1.88",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "17.3.11",
6
6
  "@angular/core": "17.3.11",