fas-admin 0.0.118 → 0.0.119

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.
@@ -0,0 +1,70 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { IAdConversionDeliveryVm, IAdConversionVm, IAdPlatformFieldVm, IAdPlatformSettingsIm, IAdPlatformSettingsVm } from './api/ad-platforms.models';
3
+ import * as i0 from "@angular/core";
4
+ /** Edited state of one platform card. */
5
+ export interface AdPlatformForm {
6
+ vm: IAdPlatformSettingsVm;
7
+ enabled: boolean;
8
+ /** Text fields and new secrets (a secret starts empty - the saved one never reaches the browser). */
9
+ texts: Record<string, string>;
10
+ flags: Record<string, boolean>;
11
+ /** Saved secrets to remove. */
12
+ clear: Record<string, boolean>;
13
+ dirty: boolean;
14
+ saving: boolean;
15
+ testing: boolean;
16
+ /** Result of the last save or connection test, shown under the buttons. */
17
+ message: {
18
+ success: boolean;
19
+ text: string;
20
+ } | null;
21
+ }
22
+ /**
23
+ * "Reklamy": the ad platforms paid purchases are reported to (Meta, Google Ads...) - their credentials and switches,
24
+ * a connection test and the list of purchases with their origin and deliveries. Backend: library ITBees.AdConversions
25
+ * (/AdPlatformSettings, /AdPlatformConnectionTest, /AdConversions). The forms are drawn from the fields the backend
26
+ * describes, so a platform added there shows up here by itself. A host switches the view on by adding
27
+ * 'ad-platforms' to its access rules.
28
+ */
29
+ export declare class AdPlatformsComponent implements OnInit {
30
+ private _adPlatformsService;
31
+ loading: boolean;
32
+ loadError: string | null;
33
+ moduleEnabled: boolean;
34
+ platforms: AdPlatformForm[];
35
+ conversions: IAdConversionVm[];
36
+ conversionsTotal: number;
37
+ conversionsLoading: boolean;
38
+ conversionsError: string | null;
39
+ readonly pageSize = 25;
40
+ private conversionsPage;
41
+ ngOnInit(): void;
42
+ loadPlatforms(): void;
43
+ markDirty(form: AdPlatformForm): void;
44
+ /** A saved secret is marked for removal; typing a new one cancels the removal. */
45
+ toggleClear(form: AdPlatformForm, field: IAdPlatformFieldVm): void;
46
+ onSecretInput(form: AdPlatformForm, field: IAdPlatformFieldVm): void;
47
+ save(form: AdPlatformForm): void;
48
+ /** Checks the values of the form as they are (also not saved yet); empty secrets fall back to the saved ones. */
49
+ test(form: AdPlatformForm): void;
50
+ cancel(form: AdPlatformForm): void;
51
+ statusLabel(form: AdPlatformForm): string;
52
+ statusSeverity(form: AdPlatformForm): 'success' | 'warning' | 'secondary';
53
+ secretPlaceholder(form: AdPlatformForm, field: IAdPlatformFieldVm): string;
54
+ /** PrimeNG lazy table: `first` is the index of the first row of the page. */
55
+ loadConversions(event?: {
56
+ first?: number | null;
57
+ rows?: number | null;
58
+ }): void;
59
+ platformName(key: string): string;
60
+ deliveryLabel(delivery: IAdConversionDeliveryVm): string;
61
+ deliverySeverity(delivery: IAdConversionDeliveryVm): 'success' | 'danger' | 'secondary' | 'info';
62
+ deliveryTooltip(delivery: IAdConversionDeliveryVm): string;
63
+ /** Campaign and ad of the purchase: "kampania · reklama" (UTM), with the platform's campaign id as a fallback. */
64
+ campaign(conversion: IAdConversionVm): string;
65
+ originTooltip(conversion: IAdConversionVm): string;
66
+ static ɵfac: i0.ɵɵFactoryDeclaration<AdPlatformsComponent, never>;
67
+ static ɵcmp: i0.ɵɵComponentDeclaration<AdPlatformsComponent, "lib-ad-platforms", never, {}, {}, never, never, false, never>;
68
+ }
69
+ export declare function toForm(vm: IAdPlatformSettingsVm): AdPlatformForm;
70
+ export declare function toIm(form: AdPlatformForm): IAdPlatformSettingsIm;
@@ -0,0 +1,16 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./ad-platforms.component";
3
+ import * as i2 from "@angular/common";
4
+ import * as i3 from "@angular/forms";
5
+ import * as i4 from "primeng/button";
6
+ import * as i5 from "primeng/inputtext";
7
+ import * as i6 from "primeng/inputswitch";
8
+ import * as i7 from "primeng/progressspinner";
9
+ import * as i8 from "primeng/table";
10
+ import * as i9 from "primeng/tag";
11
+ import * as i10 from "primeng/tooltip";
12
+ export declare class AdPlatformsModule {
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<AdPlatformsModule, never>;
14
+ static ɵmod: i0.ɵɵNgModuleDeclaration<AdPlatformsModule, [typeof i1.AdPlatformsComponent], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i4.ButtonModule, typeof i5.InputTextModule, typeof i6.InputSwitchModule, typeof i7.ProgressSpinnerModule, typeof i8.TableModule, typeof i9.TagModule, typeof i10.TooltipModule], never>;
15
+ static ɵinj: i0.ɵɵInjectorDeclaration<AdPlatformsModule>;
16
+ }
@@ -0,0 +1,99 @@
1
+ /** Models of the ITBees.AdConversions backend library (/AdPlatformSettings, /AdPlatformConnectionTest, /AdConversions). */
2
+ export type AdPlatformFieldType = 'Text' | 'Secret' | 'Flag';
3
+ /** One settings field of an ad platform - the form is drawn from this list, so a new platform needs no panel change. */
4
+ export interface IAdPlatformFieldVm {
5
+ key: string;
6
+ label: string;
7
+ type: AdPlatformFieldType;
8
+ help?: string | null;
9
+ required: boolean;
10
+ placeholder?: string | null;
11
+ /** Saved (or default) value; always null for a secret. */
12
+ value?: string | null;
13
+ hasValue: boolean;
14
+ /** Last 4 characters of a saved secret. */
15
+ ending?: string | null;
16
+ }
17
+ export interface IAdPlatformSettingsVm {
18
+ /** Platform key: "meta", "google-ads". */
19
+ platform: string;
20
+ name: string;
21
+ description: string;
22
+ enabled: boolean;
23
+ /** Every required field has a value. */
24
+ configured: boolean;
25
+ /** Enabled and configured - purchases are sent to the platform. */
26
+ active: boolean;
27
+ modified?: string | null;
28
+ fields: IAdPlatformFieldVm[];
29
+ }
30
+ export interface IAdPlatformsVm {
31
+ /** false - the module is switched off in the application's configuration. */
32
+ moduleEnabled: boolean;
33
+ platforms: IAdPlatformSettingsVm[];
34
+ }
35
+ export interface IAdPlatformSettingsIm {
36
+ platform: string;
37
+ enabled: boolean;
38
+ /** Omitted field = unchanged; empty text = default; empty secret = the saved one stays. */
39
+ values: Record<string, string | null>;
40
+ /** Fields to clear (a secret to remove). */
41
+ clearFields: string[];
42
+ }
43
+ export interface IAdPlatformConnectionTestIm {
44
+ platform: string;
45
+ values: Record<string, string | null>;
46
+ }
47
+ export interface IAdPlatformConnectionTestVm {
48
+ success: boolean;
49
+ message: string;
50
+ }
51
+ export type AdConversionDeliveryStatus = 'Sent' | 'Skipped' | 'Failed';
52
+ export interface IAdConversionDeliveryVm {
53
+ platform: string;
54
+ status: AdConversionDeliveryStatus;
55
+ attempts: number;
56
+ lastAttemptAt?: string | null;
57
+ nextAttemptAt?: string | null;
58
+ sentAt?: string | null;
59
+ matchKeys?: string | null;
60
+ detail?: string | null;
61
+ test: boolean;
62
+ }
63
+ export interface IAdConversionVm {
64
+ guid: string;
65
+ kind: string;
66
+ sourceGuid: string;
67
+ transactionId: string;
68
+ paidAt: string;
69
+ userAccountGuid?: string | null;
70
+ companyGuid?: string | null;
71
+ description?: string | null;
72
+ value: number;
73
+ valueGross?: number | null;
74
+ currency: string;
75
+ channelName?: string | null;
76
+ attributedPlatform?: string | null;
77
+ sourceLabel?: string | null;
78
+ attributionBasis?: string | null;
79
+ utmSource?: string | null;
80
+ utmMedium?: string | null;
81
+ utmCampaign?: string | null;
82
+ utmContent?: string | null;
83
+ utmTerm?: string | null;
84
+ utmId?: string | null;
85
+ campaignId?: string | null;
86
+ landingPage?: string | null;
87
+ referrer?: string | null;
88
+ touchCapturedAt?: string | null;
89
+ marketingConsent: boolean;
90
+ googleClickKind?: string | null;
91
+ googleClickAt?: string | null;
92
+ hasMetaClickId: boolean;
93
+ hasMetaBrowserId: boolean;
94
+ deliveries: IAdConversionDeliveryVm[];
95
+ }
96
+ export interface IAdConversionsVm {
97
+ total: number;
98
+ items: IAdConversionVm[];
99
+ }
@@ -0,0 +1,20 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Observable } from 'rxjs';
3
+ import { IAdConversionsVm, IAdPlatformConnectionTestIm, IAdPlatformConnectionTestVm, IAdPlatformSettingsIm, IAdPlatformSettingsVm, IAdPlatformsVm } from './ad-platforms.models';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Ad platforms of the application (backend library ITBees.AdConversions): their settings kept in the database,
7
+ * the connection test and the purchases reported to them.
8
+ */
9
+ export declare class AdPlatformsService {
10
+ private http;
11
+ private apiUrl;
12
+ constructor(http: HttpClient, apiUrl: string);
13
+ getPlatforms(): Observable<IAdPlatformsVm>;
14
+ savePlatform(im: IAdPlatformSettingsIm): Observable<IAdPlatformSettingsVm>;
15
+ testConnection(im: IAdPlatformConnectionTestIm): Observable<IAdPlatformConnectionTestVm>;
16
+ getConversions(page: number, pageSize: number): Observable<IAdConversionsVm>;
17
+ private createHeaders;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<AdPlatformsService, never>;
19
+ static ɵprov: i0.ɵɵInjectableDeclaration<AdPlatformsService>;
20
+ }
@@ -17,13 +17,14 @@ import * as i13 from "./components/views/ratings/ratings.module";
17
17
  import * as i14 from "./components/views/users/users.module";
18
18
  import * as i15 from "./components/views/faq/faq.module";
19
19
  import * as i16 from "./components/views/support-settings/support-settings.module";
20
- import * as i17 from "primeng/toast";
20
+ import * as i17 from "./components/views/ad-platforms/ad-platforms.module";
21
+ import * as i18 from "primeng/toast";
21
22
  export declare class FASAdminModule {
22
23
  private configData;
23
24
  private fasAdminService;
24
25
  constructor(configData: IFASAdminConfigInitializer, fasAdminService: FASAdminService);
25
26
  private generateRoutes;
26
27
  static ɵfac: i0.ɵɵFactoryDeclaration<FASAdminModule, never>;
27
- static ɵmod: i0.ɵɵNgModuleDeclaration<FASAdminModule, [typeof i1.FASAdminComponent, typeof i2.TopBarComponent, typeof i3.SideBarComponent], [typeof i4.CommonModule, typeof i5.RouterModule, typeof i6.SubscriptionsModule, typeof i7.NotificationsModule, typeof i8.OverlayPanelModule, typeof i9.OperatorsModule, typeof i10.StatisticModule, typeof i11.MessagesModule, typeof i12.DividerModule, typeof i13.RatingsModule, typeof i14.UsersModule, typeof i15.FaqModule, typeof i16.SupportSettingsModule, typeof i17.ToastModule], never>;
28
+ static ɵmod: i0.ɵɵNgModuleDeclaration<FASAdminModule, [typeof i1.FASAdminComponent, typeof i2.TopBarComponent, typeof i3.SideBarComponent], [typeof i4.CommonModule, typeof i5.RouterModule, typeof i6.SubscriptionsModule, typeof i7.NotificationsModule, typeof i8.OverlayPanelModule, typeof i9.OperatorsModule, typeof i10.StatisticModule, typeof i11.MessagesModule, typeof i12.DividerModule, typeof i13.RatingsModule, typeof i14.UsersModule, typeof i15.FaqModule, typeof i16.SupportSettingsModule, typeof i17.AdPlatformsModule, typeof i18.ToastModule], never>;
28
29
  static ɵinj: i0.ɵɵInjectorDeclaration<FASAdminModule>;
29
30
  }
@@ -5,7 +5,7 @@ export interface IFASButtonList {
5
5
  label: string;
6
6
  icon: string;
7
7
  }
8
- export type IFASDefaultRoutePath = 'dashboard' | 'statistic' | 'subscriptions' | 'messages' | 'operators' | 'users' | 'ratings' | 'notifications' | 'faq' | 'support-settings';
8
+ export type IFASDefaultRoutePath = 'dashboard' | 'statistic' | 'subscriptions' | 'messages' | 'operators' | 'users' | 'ratings' | 'notifications' | 'faq' | 'support-settings' | 'ad-platforms';
9
9
  export type IFASUserRole = 'PlatformOperator' | 'Osk';
10
10
  export interface IFASDefaultPath {
11
11
  path: IFASDefaultRoutePath;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fas-admin",
3
- "version": "0.0.118",
3
+ "version": "0.0.119",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.2.0",
6
6
  "@angular/core": "^17.2.0",