@metrifox/angular-sdk 0.0.2-beta.2 → 0.0.2-beta.3
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/fesm2022/index.mjs +1536 -1343
- package/dist/lib/metrifox.service.d.ts +5 -5
- package/dist/lib/types/enum.d.ts +4 -2
- package/dist/lib/types/interface.d.ts +5 -0
- package/dist/modules/customer-portal/components/billing-history.component.d.ts +3 -2
- package/dist/modules/customer-portal/components/credit/credit-balance-section.component.d.ts +12 -10
- package/dist/modules/customer-portal/components/customer-portal.component.d.ts +7 -7
- package/dist/modules/customer-portal/components/entitlements/entitlement-summary.component.d.ts +15 -0
- package/dist/modules/customer-portal/components/entitlements/entitlement-usage.component.d.ts +35 -0
- package/dist/modules/customer-portal/components/entitlements/entitlements-section.component.d.ts +5 -21
- package/dist/modules/customer-portal/components/invoice-preview.component.d.ts +8 -7
- package/dist/modules/customer-portal/components/payment.component.d.ts +4 -3
- package/dist/modules/customer-portal/components/plan/plans-section.component.d.ts +28 -26
- package/dist/modules/customer-portal/components/subscription/subscription-details.component.d.ts +12 -0
- package/dist/modules/customer-portal/components/subscription/subscription-items.component.d.ts +27 -0
- package/dist/modules/customer-portal/components/subscription/subscription-section.component.d.ts +5 -25
- package/dist/modules/pricing-table/components/pricing-table.component.d.ts +12 -6
- package/dist/modules/pricing-table/utils/defaults.d.ts +2 -0
- package/dist/public-api.d.ts +10 -10
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient } from '@angular/common/http';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { MetrifoxConfig, Theme, CustomerDetails, Product, ProductPlans, BillingHistory, EntitlementUsage, EntitlementSummary, Wallet, CreditAllocation, Invoice, Localization, LocalizationSettings, WalletSetting, CreateWalletSettings } from './types';
|
|
3
|
+
import { MetrifoxConfig, Theme, CustomerDetails, Product, ProductPlans, BillingHistory, EntitlementUsage, EntitlementSummary, Wallet, CreditAllocation, Invoice, Localization, LocalizationSettings, WalletSetting, CreateWalletSettings, CreditTransaction } from './types';
|
|
4
4
|
import { setIfDefined as _setIfDefined, customerPortalThemeToCssVars as _customerPortalThemeToCssVars, pricingTableThemeToCssVars as _pricingTableThemeToCssVars, getGradient as _getGradient, getBackgroundImage as _getBackgroundImage } from './utils/theme';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
/**
|
|
@@ -109,7 +109,7 @@ export declare class MetrifoxService {
|
|
|
109
109
|
/**
|
|
110
110
|
* Get credit transactions for an allocation
|
|
111
111
|
*/
|
|
112
|
-
getCreditTransactions(allocationId: string): Observable<
|
|
112
|
+
getCreditTransactions(allocationId: string): Observable<CreditTransaction[]>;
|
|
113
113
|
/**
|
|
114
114
|
* Read wallet settings for customer
|
|
115
115
|
*/
|
|
@@ -117,15 +117,15 @@ export declare class MetrifoxService {
|
|
|
117
117
|
/**
|
|
118
118
|
* Create wallet settings
|
|
119
119
|
*/
|
|
120
|
-
createWalletSettings(payload: CreateWalletSettings): Observable<
|
|
120
|
+
createWalletSettings(payload: CreateWalletSettings): Observable<unknown>;
|
|
121
121
|
/**
|
|
122
122
|
* Edit wallet settings
|
|
123
123
|
*/
|
|
124
|
-
editWalletSettings(id: string, payload: CreateWalletSettings): Observable<
|
|
124
|
+
editWalletSettings(id: string, payload: CreateWalletSettings): Observable<unknown>;
|
|
125
125
|
/**
|
|
126
126
|
* Delete wallet settings
|
|
127
127
|
*/
|
|
128
|
-
deleteWalletSettings(id: string): Observable<
|
|
128
|
+
deleteWalletSettings(id: string): Observable<unknown>;
|
|
129
129
|
/**
|
|
130
130
|
* Cancel subscription (schedule cancellation)
|
|
131
131
|
*/
|
package/dist/lib/types/enum.d.ts
CHANGED
|
@@ -85,7 +85,8 @@ export declare enum ResetIntervals {
|
|
|
85
85
|
WEEKLY = "weekly",
|
|
86
86
|
DAILY = "daily",
|
|
87
87
|
BILLING_PERIOD = "billing_period",
|
|
88
|
-
NEVER = "never"
|
|
88
|
+
NEVER = "never",
|
|
89
|
+
NONE = "none"
|
|
89
90
|
}
|
|
90
91
|
/**
|
|
91
92
|
* Enforcement types
|
|
@@ -109,7 +110,8 @@ export declare enum BillingInterval {
|
|
|
109
110
|
*/
|
|
110
111
|
export declare enum BillingTimingTypes {
|
|
111
112
|
IN_ADVANCE = "in_advance",
|
|
112
|
-
IN_ARREARS = "in_arrears"
|
|
113
|
+
IN_ARREARS = "in_arrears",
|
|
114
|
+
PAY_AS_YOU_GO = "pay_as_you_go"
|
|
113
115
|
}
|
|
114
116
|
/**
|
|
115
117
|
* Aggregation methods
|
|
@@ -468,6 +468,7 @@ export interface SubscriptionDetails {
|
|
|
468
468
|
can_update_quantities: boolean;
|
|
469
469
|
}
|
|
470
470
|
export interface SubscriptionItem {
|
|
471
|
+
id?: string;
|
|
471
472
|
price_option_id: string;
|
|
472
473
|
name: string;
|
|
473
474
|
currency_code: string;
|
|
@@ -477,7 +478,9 @@ export interface SubscriptionItem {
|
|
|
477
478
|
billing_period_start: string | null;
|
|
478
479
|
billing_period_end: string | null;
|
|
479
480
|
line_source_type: string;
|
|
481
|
+
source_type?: string;
|
|
480
482
|
is_addon?: boolean;
|
|
483
|
+
offering_key?: string;
|
|
481
484
|
}
|
|
482
485
|
export interface UpcomingInvoice {
|
|
483
486
|
invoice_id: string;
|
|
@@ -647,6 +650,8 @@ export interface CreditTransaction {
|
|
|
647
650
|
type: string;
|
|
648
651
|
created_at: string;
|
|
649
652
|
description?: string;
|
|
653
|
+
event_name?: string;
|
|
654
|
+
quantity?: number;
|
|
650
655
|
}
|
|
651
656
|
export interface WalletSetting {
|
|
652
657
|
id: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { BillingHistory, SectionConfig } from '../../../lib/types';
|
|
1
2
|
import * as i0 from "@angular/core";
|
|
2
3
|
export declare class BillingHistorySectionComponent {
|
|
3
|
-
billingHistory:
|
|
4
|
-
sectionsConfig:
|
|
4
|
+
billingHistory: BillingHistory[];
|
|
5
|
+
sectionsConfig: SectionConfig[] | undefined;
|
|
5
6
|
_formatDate(d: string | null | undefined): string;
|
|
6
7
|
_formatCurrency(amount: number | null | undefined, currency: string | null | undefined): string;
|
|
7
8
|
_formatStatus(status: string | null | undefined): string;
|
package/dist/modules/customer-portal/components/credit/credit-balance-section.component.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { EventEmitter, OnDestroy } from '@angular/core';
|
|
2
2
|
import { SafeHtml } from '@angular/platform-browser';
|
|
3
|
+
import { Wallet, SectionConfig, CreditAllocation, CreditTransaction, WalletSetting } from '../../../../lib/types';
|
|
4
|
+
import { IconName } from '../../utils/icons';
|
|
3
5
|
import * as i0 from "@angular/core";
|
|
4
6
|
export declare class CreditBalanceSectionComponent implements OnDestroy {
|
|
5
|
-
wallets:
|
|
6
|
-
creditAllocations:
|
|
7
|
+
wallets: Wallet[];
|
|
8
|
+
creditAllocations: CreditAllocation[];
|
|
7
9
|
allocationsLoading: boolean;
|
|
8
10
|
customerKey: string;
|
|
9
|
-
sectionsConfig:
|
|
11
|
+
sectionsConfig: SectionConfig[] | undefined;
|
|
10
12
|
walletTabChanged: EventEmitter<{
|
|
11
13
|
walletId: string;
|
|
12
14
|
tab: string;
|
|
@@ -26,8 +28,8 @@ export declare class CreditBalanceSectionComponent implements OnDestroy {
|
|
|
26
28
|
label: string;
|
|
27
29
|
})[];
|
|
28
30
|
showCreditTransactions: import("@angular/core").WritableSignal<boolean>;
|
|
29
|
-
selectedAllocation: import("@angular/core").WritableSignal<
|
|
30
|
-
creditTransactions: import("@angular/core").WritableSignal<
|
|
31
|
+
selectedAllocation: import("@angular/core").WritableSignal<CreditAllocation>;
|
|
32
|
+
creditTransactions: import("@angular/core").WritableSignal<CreditTransaction[]>;
|
|
31
33
|
creditTransactionsLoading: import("@angular/core").WritableSignal<boolean>;
|
|
32
34
|
showWalletSettings: import("@angular/core").WritableSignal<boolean>;
|
|
33
35
|
selectedWalletForSettings: string;
|
|
@@ -36,7 +38,7 @@ export declare class CreditBalanceSectionComponent implements OnDestroy {
|
|
|
36
38
|
walletSettingBehaviour: 'notify' | 'auto_top_up';
|
|
37
39
|
walletSettingTargetBalance: string;
|
|
38
40
|
walletSettingMonthlyLimit: string;
|
|
39
|
-
walletSettingsList: import("@angular/core").WritableSignal<
|
|
41
|
+
walletSettingsList: import("@angular/core").WritableSignal<WalletSetting[]>;
|
|
40
42
|
walletSettingsLoading: import("@angular/core").WritableSignal<boolean>;
|
|
41
43
|
walletSettingsSaving: import("@angular/core").WritableSignal<boolean>;
|
|
42
44
|
walletSettingsError: import("@angular/core").WritableSignal<string>;
|
|
@@ -47,7 +49,7 @@ export declare class CreditBalanceSectionComponent implements OnDestroy {
|
|
|
47
49
|
private sanitizer;
|
|
48
50
|
_isSectionHidden(key: string): boolean;
|
|
49
51
|
_getSectionLabel(key: string): string;
|
|
50
|
-
_getIcon(name:
|
|
52
|
+
_getIcon(name: IconName): SafeHtml;
|
|
51
53
|
_formatPrice(value: number | undefined | null): string;
|
|
52
54
|
selectWallet(index: number): void;
|
|
53
55
|
changeWalletTab(tab: 'active' | 'expired' | 'overage'): void;
|
|
@@ -55,9 +57,9 @@ export declare class CreditBalanceSectionComponent implements OnDestroy {
|
|
|
55
57
|
formatAllocationDateShort(dateStr: string): string;
|
|
56
58
|
formatAllocationSource(type: string): string;
|
|
57
59
|
formatValidUntilDate(dateStr: string): string;
|
|
58
|
-
getAllocationBalance(allocation:
|
|
59
|
-
getAllocationProgressPercent(allocation:
|
|
60
|
-
openCreditTransactions(allocation:
|
|
60
|
+
getAllocationBalance(allocation: CreditAllocation): number;
|
|
61
|
+
getAllocationProgressPercent(allocation: CreditAllocation): number;
|
|
62
|
+
openCreditTransactions(allocation: CreditAllocation): void;
|
|
61
63
|
closeCreditTransactions(): void;
|
|
62
64
|
openWalletSettings(): void;
|
|
63
65
|
closeWalletSettings(): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter, OnInit, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { SafeHtml } from '@angular/platform-browser';
|
|
3
|
-
import { CustomerDetails, Wallet, SectionConfig, CustomerDataLoadedEvent, ErrorEvent, CustomerPortalTheme, BillingHistory, ProductPlans, Offering, Invoice, Subscription } from '../../../lib/types';
|
|
3
|
+
import { CustomerDetails, Wallet, SectionConfig, CustomerDataLoadedEvent, ErrorEvent, CustomerPortalTheme, BillingHistory, ProductPlans, Offering, Invoice, Subscription, EntitlementSummary, EntitlementUsage, CreditAllocation, UpcomingInvoice } from '../../../lib/types';
|
|
4
4
|
import { ICONS } from '../utils/icons';
|
|
5
5
|
import { defaultCustomerPortalTheme } from '../utils/defaults';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
@@ -24,12 +24,12 @@ export declare class CustomerPortalComponent implements OnInit, OnChanges, OnDes
|
|
|
24
24
|
wallets: import("@angular/core").WritableSignal<Wallet[]>;
|
|
25
25
|
billingHistory: import("@angular/core").WritableSignal<BillingHistory[]>;
|
|
26
26
|
productPlans: import("@angular/core").WritableSignal<ProductPlans>;
|
|
27
|
-
entitlementSummary: import("@angular/core").WritableSignal<
|
|
28
|
-
entitlementUsage: import("@angular/core").WritableSignal<
|
|
29
|
-
creditAllocations: import("@angular/core").WritableSignal<
|
|
27
|
+
entitlementSummary: import("@angular/core").WritableSignal<EntitlementSummary[]>;
|
|
28
|
+
entitlementUsage: import("@angular/core").WritableSignal<EntitlementUsage[]>;
|
|
29
|
+
creditAllocations: import("@angular/core").WritableSignal<CreditAllocation[]>;
|
|
30
30
|
selectedTabIndex: import("@angular/core").WritableSignal<number>;
|
|
31
31
|
showInvoicePreview: import("@angular/core").WritableSignal<boolean>;
|
|
32
|
-
selectedInvoice: import("@angular/core").WritableSignal<
|
|
32
|
+
selectedInvoice: import("@angular/core").WritableSignal<Record<string, unknown>>;
|
|
33
33
|
invoiceDetails: import("@angular/core").WritableSignal<Invoice>;
|
|
34
34
|
invoiceDetailsLoading: import("@angular/core").WritableSignal<boolean>;
|
|
35
35
|
allocationsLoading: import("@angular/core").WritableSignal<boolean>;
|
|
@@ -51,9 +51,9 @@ export declare class CustomerPortalComponent implements OnInit, OnChanges, OnDes
|
|
|
51
51
|
private loadCreditAllocations;
|
|
52
52
|
selectTab(index: number): void;
|
|
53
53
|
getIcon(name: keyof typeof ICONS): SafeHtml;
|
|
54
|
-
handleManagePlan(_subscription:
|
|
54
|
+
handleManagePlan(_subscription: unknown): void;
|
|
55
55
|
handleTopup(walletId: string): void;
|
|
56
|
-
openInvoicePreview(invoice:
|
|
56
|
+
openInvoicePreview(invoice: UpcomingInvoice): void;
|
|
57
57
|
closeInvoicePreview(): void;
|
|
58
58
|
onWalletTabChanged(event: {
|
|
59
59
|
walletId: string;
|
package/dist/modules/customer-portal/components/entitlements/entitlement-summary.component.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SafeHtml } from '@angular/platform-browser';
|
|
2
|
+
import { IconName } from '../../utils/icons';
|
|
3
|
+
import { EntitlementSummary } from '../../../../lib/types';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class EntitlementSummaryComponent {
|
|
6
|
+
private sanitizer;
|
|
7
|
+
entitlementSummary: EntitlementSummary[];
|
|
8
|
+
_getIcon(name: IconName): SafeHtml;
|
|
9
|
+
_capitalize(str: string): string;
|
|
10
|
+
formatUsageModel(entitlement: EntitlementSummary): string;
|
|
11
|
+
formatIncludedAllowance(entitlement: EntitlementSummary): string;
|
|
12
|
+
formatUsageLimits(entitlement: EntitlementSummary): string;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EntitlementSummaryComponent, never>;
|
|
14
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EntitlementSummaryComponent, "cp-entitlement-summary", never, { "entitlementSummary": { "alias": "entitlementSummary"; "required": false; }; }, {}, never, never, true, never>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SafeHtml } from '@angular/platform-browser';
|
|
2
|
+
import { IconName } from '../../utils/icons';
|
|
3
|
+
import { EntitlementUsage } from '../../../../lib/types';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
interface ProcessedPool {
|
|
6
|
+
pool: string;
|
|
7
|
+
balance: number;
|
|
8
|
+
used: number;
|
|
9
|
+
amount: number;
|
|
10
|
+
color: string;
|
|
11
|
+
percent: number;
|
|
12
|
+
isUnlimited: boolean;
|
|
13
|
+
order: number;
|
|
14
|
+
nextResetAt: string | null;
|
|
15
|
+
}
|
|
16
|
+
export declare class EntitlementUsageComponent {
|
|
17
|
+
private sanitizer;
|
|
18
|
+
private expandedEntitlements;
|
|
19
|
+
Math: Math;
|
|
20
|
+
entitlementUsage: EntitlementUsage[];
|
|
21
|
+
get meteredEntitlements(): EntitlementUsage[];
|
|
22
|
+
_getIcon(name: IconName): SafeHtml;
|
|
23
|
+
_capitalize(str: string): string;
|
|
24
|
+
_formatNumber(num: number): string;
|
|
25
|
+
toggleExpand(id: string): void;
|
|
26
|
+
isExpanded(id: string): boolean;
|
|
27
|
+
getUsageBalance(usage: EntitlementUsage): string;
|
|
28
|
+
getUsagePercent(usage: EntitlementUsage): number;
|
|
29
|
+
getUsageText(usage: EntitlementUsage): string;
|
|
30
|
+
getProcessedPools(usage: EntitlementUsage): ProcessedPool[];
|
|
31
|
+
formatResetDate(dateStr: string): string;
|
|
32
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EntitlementUsageComponent, never>;
|
|
33
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EntitlementUsageComponent, "cp-entitlement-usage", never, { "entitlementUsage": { "alias": "entitlementUsage"; "required": false; }; }, {}, never, never, true, never>;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
package/dist/modules/customer-portal/components/entitlements/entitlements-section.component.d.ts
CHANGED
|
@@ -1,30 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SectionConfig, EntitlementSummary, EntitlementUsage } from '../../../../lib/types/interface';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class EntitlementsSectionComponent {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
sectionsConfig: any[] | undefined;
|
|
4
|
+
entitlementSummary: EntitlementSummary[];
|
|
5
|
+
entitlementUsage: EntitlementUsage[];
|
|
6
|
+
sectionsConfig: SectionConfig[] | undefined;
|
|
8
7
|
entitlementTab: import("@angular/core").WritableSignal<"usage" | "summary">;
|
|
9
|
-
|
|
10
|
-
Math: Math;
|
|
8
|
+
get hasMeteredEntitlements(): boolean;
|
|
11
9
|
_isSectionHidden(key: string): boolean;
|
|
12
10
|
_getSectionLabel(key: string): string;
|
|
13
|
-
_getIcon(name: any): SafeHtml;
|
|
14
|
-
_capitalize(str: string): string;
|
|
15
|
-
_formatNumber(num: number): string;
|
|
16
11
|
changeEntitlementTab(tab: 'summary' | 'usage'): void;
|
|
17
|
-
getMeteredEntitlements(): any[];
|
|
18
|
-
formatUsageModel(entitlement: any): string;
|
|
19
|
-
formatIncludedAllowance(entitlement: any): string;
|
|
20
|
-
formatUsageLimits(entitlement: any): string;
|
|
21
|
-
toggleEntitlementExpand(id: string): void;
|
|
22
|
-
isEntitlementExpanded(id: string): boolean;
|
|
23
|
-
getEntitlementUsageBalance(usage: any): string;
|
|
24
|
-
getEntitlementUsagePercent(usage: any): number;
|
|
25
|
-
getEntitlementUsageText(usage: any): string;
|
|
26
|
-
getProcessedPools(usage: any): any[];
|
|
27
|
-
formatResetDate(dateStr: string): string;
|
|
28
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<EntitlementsSectionComponent, never>;
|
|
29
13
|
static ɵcmp: i0.ɵɵComponentDeclaration<EntitlementsSectionComponent, "cp-entitlements-section", never, { "entitlementSummary": { "alias": "entitlementSummary"; "required": false; }; "entitlementUsage": { "alias": "entitlementUsage"; "required": false; }; "sectionsConfig": { "alias": "sectionsConfig"; "required": false; }; }, {}, never, never, true, never>;
|
|
30
14
|
}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { Invoice, TenantAddress, CustomerDetails } from '../../../lib/types';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
4
|
export declare class InvoicePreviewComponent {
|
|
4
5
|
show: boolean;
|
|
5
|
-
selectedInvoice: any;
|
|
6
|
-
invoiceDetails:
|
|
6
|
+
selectedInvoice: Record<string, any> | null;
|
|
7
|
+
invoiceDetails: Invoice | null;
|
|
7
8
|
invoiceDetailsLoading: boolean;
|
|
8
9
|
close: EventEmitter<void>;
|
|
9
10
|
closePreview(): void;
|
|
10
11
|
formatInvoiceDate(d: string | null | undefined): string;
|
|
11
12
|
formatInvoicePrice(amount: number): string;
|
|
12
13
|
toNumber(value: string | number | null | undefined): number;
|
|
13
|
-
getInvoiceCurrencySymbol(invoice:
|
|
14
|
-
getInvoiceSummaryNumber(invoice:
|
|
15
|
-
getInvoiceLineItems(invoice:
|
|
14
|
+
getInvoiceCurrencySymbol(invoice: Invoice | null): string;
|
|
15
|
+
getInvoiceSummaryNumber(invoice: Invoice | null, ...keys: string[]): number;
|
|
16
|
+
getInvoiceLineItems(invoice: Invoice | null): Record<string, any>[];
|
|
16
17
|
private getInvoiceLineItemRangeLabel;
|
|
17
18
|
private normalizeInvoiceLineItem;
|
|
18
|
-
buildTenantAddress(addr:
|
|
19
|
-
buildBilledToAddress(customer:
|
|
19
|
+
buildTenantAddress(addr: TenantAddress | null | undefined): string;
|
|
20
|
+
buildBilledToAddress(customer: CustomerDetails | null | undefined): string;
|
|
20
21
|
private escapeHtml;
|
|
21
22
|
triggerInvoicePrint(): void;
|
|
22
23
|
private buildInvoicePrintHtml;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { Subscription, CustomerDetails, SectionConfig } from '../../../lib/types';
|
|
1
2
|
import * as i0 from "@angular/core";
|
|
2
3
|
export declare class PaymentSectionComponent {
|
|
3
|
-
subscription:
|
|
4
|
-
customerDetails:
|
|
5
|
-
sectionsConfig:
|
|
4
|
+
subscription: Subscription | undefined;
|
|
5
|
+
customerDetails: CustomerDetails | undefined;
|
|
6
|
+
sectionsConfig: SectionConfig[] | undefined;
|
|
6
7
|
_isSectionHidden(key: string): boolean;
|
|
7
8
|
_getSectionLabel(key: string): string;
|
|
8
9
|
getBillingAddress(): string;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { OnChanges } from '@angular/core';
|
|
2
2
|
import { SafeHtml } from '@angular/platform-browser';
|
|
3
3
|
import { formatPrice } from '../../utils/helpers';
|
|
4
|
+
import { IconName } from '../../utils/icons';
|
|
5
|
+
import { SectionConfig, Offering, PriceOption, Entitlement, CreditSystem, Subscription } from '../../../../lib/types';
|
|
4
6
|
import * as i0 from "@angular/core";
|
|
5
7
|
export declare class PlansSectionComponent implements OnChanges {
|
|
6
|
-
plans:
|
|
8
|
+
plans: Offering[];
|
|
7
9
|
planIntervals: string[];
|
|
8
|
-
subscription:
|
|
10
|
+
subscription: Subscription | undefined;
|
|
9
11
|
tenantCheckoutUsername: string;
|
|
10
|
-
sectionsConfig:
|
|
12
|
+
sectionsConfig: SectionConfig[] | undefined;
|
|
11
13
|
selectedPlanInterval: import("@angular/core").WritableSignal<string>;
|
|
12
|
-
explorePricesPlan: import("@angular/core").WritableSignal<
|
|
14
|
+
explorePricesPlan: import("@angular/core").WritableSignal<Offering>;
|
|
13
15
|
private sanitizer;
|
|
14
16
|
ngOnChanges(): void;
|
|
15
17
|
currentPlanIndex: import("@angular/core").Signal<number>;
|
|
@@ -17,33 +19,33 @@ export declare class PlansSectionComponent implements OnChanges {
|
|
|
17
19
|
shouldShowDynamicPricesSlot: import("@angular/core").Signal<boolean>;
|
|
18
20
|
_isSectionHidden(key: string): boolean;
|
|
19
21
|
_getSectionLabel(key: string): string;
|
|
20
|
-
_getIcon(name:
|
|
22
|
+
_getIcon(name: IconName): SafeHtml;
|
|
21
23
|
selectPlanInterval(interval: string): void;
|
|
22
24
|
formatPlanInterval(interval: string): string;
|
|
23
|
-
getPlanPriceOption(plan:
|
|
24
|
-
getPlanPriceInteger(plan:
|
|
25
|
-
getPlanPriceDecimal(plan:
|
|
25
|
+
getPlanPriceOption(plan: Offering): PriceOption | undefined;
|
|
26
|
+
getPlanPriceInteger(plan: Offering): string;
|
|
27
|
+
getPlanPriceDecimal(plan: Offering): string;
|
|
26
28
|
getMultiplyNumber(interval: string, intervalValue: number): number;
|
|
27
|
-
getPlanFixedPriceBilledAmount(plan:
|
|
28
|
-
getPlanFixedPriceCurrencySymbol(plan:
|
|
29
|
-
hasFixedPrice(plan:
|
|
30
|
-
getDynamicPrices(plan:
|
|
31
|
-
getDynamicPriceName(priceOption:
|
|
32
|
-
formatDynamicPrice(priceOption:
|
|
33
|
-
formatDynamicPriceFull(priceOption:
|
|
34
|
-
getDynamicPriceAmountDisplay(priceOption:
|
|
35
|
-
getMainDynamicPriceInteger(plan:
|
|
36
|
-
getMainDynamicPriceDecimal(plan:
|
|
37
|
-
getMainDynamicPriceUnit(plan:
|
|
38
|
-
getPluralizedUnit(plan:
|
|
39
|
-
getPlanButtonText(plan:
|
|
40
|
-
getVisibleEntitlements(plan:
|
|
41
|
-
getVisibleCredits(plan:
|
|
42
|
-
formatEntitlement(entitlement:
|
|
29
|
+
getPlanFixedPriceBilledAmount(plan: Offering): number;
|
|
30
|
+
getPlanFixedPriceCurrencySymbol(plan: Offering): string;
|
|
31
|
+
hasFixedPrice(plan: Offering): boolean;
|
|
32
|
+
getDynamicPrices(plan: Offering): PriceOption[];
|
|
33
|
+
getDynamicPriceName(priceOption: PriceOption): string;
|
|
34
|
+
formatDynamicPrice(priceOption: PriceOption): string;
|
|
35
|
+
formatDynamicPriceFull(priceOption: PriceOption): string;
|
|
36
|
+
getDynamicPriceAmountDisplay(priceOption: PriceOption): string;
|
|
37
|
+
getMainDynamicPriceInteger(plan: Offering): string;
|
|
38
|
+
getMainDynamicPriceDecimal(plan: Offering): string;
|
|
39
|
+
getMainDynamicPriceUnit(plan: Offering): string;
|
|
40
|
+
getPluralizedUnit(plan: Offering): string;
|
|
41
|
+
getPlanButtonText(plan: Offering, index: number): string;
|
|
42
|
+
getVisibleEntitlements(plan: Offering): Entitlement[];
|
|
43
|
+
getVisibleCredits(plan: Offering): CreditSystem[];
|
|
44
|
+
formatEntitlement(entitlement: Entitlement): string;
|
|
43
45
|
getListingUrl(): string;
|
|
44
|
-
openExplorePricesModal(plan:
|
|
46
|
+
openExplorePricesModal(plan: Offering): void;
|
|
45
47
|
closeExplorePricesModal(): void;
|
|
46
|
-
handlePlanAction(plan:
|
|
48
|
+
handlePlanAction(plan: Offering): void;
|
|
47
49
|
formatPrice: typeof formatPrice;
|
|
48
50
|
static ɵfac: i0.ɵɵFactoryDeclaration<PlansSectionComponent, never>;
|
|
49
51
|
static ɵcmp: i0.ɵɵComponentDeclaration<PlansSectionComponent, "cp-plans-section", never, { "plans": { "alias": "plans"; "required": false; }; "planIntervals": { "alias": "planIntervals"; "required": false; }; "subscription": { "alias": "subscription"; "required": false; }; "tenantCheckoutUsername": { "alias": "tenantCheckoutUsername"; "required": false; }; "sectionsConfig": { "alias": "sectionsConfig"; "required": false; }; }, {}, never, never, true, never>;
|
package/dist/modules/customer-portal/components/subscription/subscription-details.component.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { SubscriptionDetails, UpcomingInvoice } from '../../../../lib/types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class SubscriptionDetailsComponent {
|
|
5
|
+
sub: SubscriptionDetails;
|
|
6
|
+
invoicePreview: EventEmitter<UpcomingInvoice>;
|
|
7
|
+
_formatDate(d: string | null | undefined): string;
|
|
8
|
+
_formatCurrency(amount: number | null | undefined, currency: string | null | undefined): string;
|
|
9
|
+
_formatStatus(status: string | null | undefined): string;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SubscriptionDetailsComponent, never>;
|
|
11
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SubscriptionDetailsComponent, "cp-subscription-details", never, { "sub": { "alias": "sub"; "required": true; }; }, { "invoicePreview": "invoicePreview"; }, never, never, true, never>;
|
|
12
|
+
}
|
package/dist/modules/customer-portal/components/subscription/subscription-items.component.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SubscriptionItem } from '../../../../lib/types';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class SubscriptionItemsComponent {
|
|
4
|
+
private expandedAddons;
|
|
5
|
+
items: SubscriptionItem[];
|
|
6
|
+
canUpdateQuantities: boolean;
|
|
7
|
+
tenantCheckoutUsername: string;
|
|
8
|
+
customerKey: string;
|
|
9
|
+
subscriptionId: string;
|
|
10
|
+
offeringKey: string;
|
|
11
|
+
toggleAddon(key: string): void;
|
|
12
|
+
isAddonExpanded(key: string): boolean;
|
|
13
|
+
openUpdateItems(): void;
|
|
14
|
+
handleAddAddon(): void;
|
|
15
|
+
getPlanLineItems(): SubscriptionItem[];
|
|
16
|
+
getAddonLineItems(): SubscriptionItem[];
|
|
17
|
+
getGroupedAddonItems(): {
|
|
18
|
+
key: string;
|
|
19
|
+
name: string;
|
|
20
|
+
baseItem: SubscriptionItem;
|
|
21
|
+
children: SubscriptionItem[];
|
|
22
|
+
}[];
|
|
23
|
+
_capitalize(str: string | undefined): string;
|
|
24
|
+
_formatCurrency(amount: number | null | undefined, currency: string | null | undefined): string;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SubscriptionItemsComponent, never>;
|
|
26
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SubscriptionItemsComponent, "cp-subscription-items", never, { "items": { "alias": "items"; "required": false; }; "canUpdateQuantities": { "alias": "canUpdateQuantities"; "required": false; }; "tenantCheckoutUsername": { "alias": "tenantCheckoutUsername"; "required": false; }; "customerKey": { "alias": "customerKey"; "required": false; }; "subscriptionId": { "alias": "subscriptionId"; "required": false; }; "offeringKey": { "alias": "offeringKey"; "required": false; }; }, {}, never, never, true, never>;
|
|
27
|
+
}
|
package/dist/modules/customer-portal/components/subscription/subscription-section.component.d.ts
CHANGED
|
@@ -1,36 +1,16 @@
|
|
|
1
1
|
import { EventEmitter } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { SectionConfig, Subscription, UpcomingInvoice } from '../../../../lib/types';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class SubscriptionSectionComponent {
|
|
5
|
-
subscription:
|
|
6
|
-
sectionsConfig:
|
|
5
|
+
subscription: Subscription | undefined;
|
|
6
|
+
sectionsConfig: SectionConfig[] | undefined;
|
|
7
7
|
customerKey: string;
|
|
8
8
|
tenantCheckoutUsername: string;
|
|
9
|
-
invoicePreview: EventEmitter<
|
|
10
|
-
managePlan: EventEmitter<
|
|
11
|
-
private expandedAddons;
|
|
12
|
-
private sanitizer;
|
|
13
|
-
toggleAddon(key: string): void;
|
|
14
|
-
isAddonExpanded(key: string): boolean;
|
|
15
|
-
openUpdateItems(subscription: any): void;
|
|
9
|
+
invoicePreview: EventEmitter<UpcomingInvoice>;
|
|
10
|
+
managePlan: EventEmitter<Subscription>;
|
|
16
11
|
handleManagePlan(): void;
|
|
17
|
-
handleAddAddon(): void;
|
|
18
|
-
getPlanLineItems(items: any[]): any[];
|
|
19
|
-
getAddonLineItems(items: any[]): any[];
|
|
20
|
-
getGroupedAddonItems(items: any[]): {
|
|
21
|
-
key: string;
|
|
22
|
-
name: string;
|
|
23
|
-
baseItem: any;
|
|
24
|
-
children: any[];
|
|
25
|
-
}[];
|
|
26
|
-
getStatusBgClass(status: string | null | undefined): string;
|
|
27
|
-
_formatDate(d: string | null | undefined): string;
|
|
28
|
-
_formatCurrency(amount: number | null | undefined, currency: string | null | undefined): string;
|
|
29
|
-
_formatStatus(status: string | null | undefined): string;
|
|
30
|
-
_capitalize(str: string | undefined): string;
|
|
31
12
|
_isSectionHidden(key: string): boolean;
|
|
32
13
|
_getSectionLabel(key: string): string;
|
|
33
|
-
_getIcon(name: any): SafeHtml;
|
|
34
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<SubscriptionSectionComponent, never>;
|
|
35
15
|
static ɵcmp: i0.ɵɵComponentDeclaration<SubscriptionSectionComponent, "cp-subscription-section", never, { "subscription": { "alias": "subscription"; "required": false; }; "sectionsConfig": { "alias": "sectionsConfig"; "required": false; }; "customerKey": { "alias": "customerKey"; "required": false; }; "tenantCheckoutUsername": { "alias": "tenantCheckoutUsername"; "required": false; }; }, { "invoicePreview": "invoicePreview"; "managePlan": "managePlan"; }, never, never, true, never>;
|
|
36
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter, OnInit, OnDestroy } from '@angular/core';
|
|
2
2
|
import { SafeHtml } from '@angular/platform-browser';
|
|
3
|
-
import { Product, ParentOffering, Offering, PlanSelectedEvent, PurchaseSelectedEvent, ErrorEvent, Entitlement } from '../../../lib/types';
|
|
3
|
+
import { Product, ParentOffering, Offering, PlanSelectedEvent, PurchaseSelectedEvent, ErrorEvent, PricingTableTheme, Entitlement, CreditSystem } from '../../../lib/types';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
declare const ICONS: {
|
|
6
6
|
check: string;
|
|
@@ -45,11 +45,17 @@ export declare class PricingTableComponent implements OnInit, OnDestroy {
|
|
|
45
45
|
/** Product key to load pricing for */
|
|
46
46
|
productKey: string;
|
|
47
47
|
/** Show only plans (hide single purchases) */
|
|
48
|
-
|
|
48
|
+
private plansOnlySignal;
|
|
49
|
+
set plansOnly(value: boolean);
|
|
49
50
|
/** Show only single purchases (hide plans) */
|
|
50
|
-
|
|
51
|
+
private singlePurchasesOnlySignal;
|
|
52
|
+
set singlePurchasesOnly(value: boolean);
|
|
51
53
|
/** Show tab header when both plans and purchases exist */
|
|
52
|
-
|
|
54
|
+
protected showTabHeaderSignal: import("@angular/core").WritableSignal<boolean>;
|
|
55
|
+
set showTabHeader(value: boolean);
|
|
56
|
+
/** Optional theme override for this instance */
|
|
57
|
+
private themeSignal;
|
|
58
|
+
set theme(value: PricingTableTheme | undefined);
|
|
53
59
|
/** Emitted when a plan is selected */
|
|
54
60
|
planSelected: EventEmitter<PlanSelectedEvent>;
|
|
55
61
|
/** Emitted when a single purchase is selected */
|
|
@@ -126,7 +132,7 @@ export declare class PricingTableComponent implements OnInit, OnDestroy {
|
|
|
126
132
|
/**
|
|
127
133
|
* Get visible credits (included_usage or included_allowance)
|
|
128
134
|
*/
|
|
129
|
-
getVisibleCredits(offering: Offering):
|
|
135
|
+
getVisibleCredits(offering: Offering): CreditSystem[];
|
|
130
136
|
/**
|
|
131
137
|
* Format entitlement for display
|
|
132
138
|
*/
|
|
@@ -158,6 +164,6 @@ export declare class PricingTableComponent implements OnInit, OnDestroy {
|
|
|
158
164
|
private updateCartItem;
|
|
159
165
|
proceedToCheckout(): void;
|
|
160
166
|
static ɵfac: i0.ɵɵFactoryDeclaration<PricingTableComponent, never>;
|
|
161
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<PricingTableComponent, "metrifox-pricing-table", never, { "checkoutUsername": { "alias": "checkoutUsername"; "required": true; }; "productKey": { "alias": "productKey"; "required": true; }; "plansOnly": { "alias": "plansOnly"; "required": false; }; "singlePurchasesOnly": { "alias": "singlePurchasesOnly"; "required": false; }; "showTabHeader": { "alias": "showTabHeader"; "required": false; }; }, { "planSelected": "planSelected"; "purchaseSelected": "purchaseSelected"; "errorOccurred": "errorOccurred"; }, never, never, true, never>;
|
|
167
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PricingTableComponent, "metrifox-pricing-table", never, { "checkoutUsername": { "alias": "checkoutUsername"; "required": true; }; "productKey": { "alias": "productKey"; "required": true; }; "plansOnly": { "alias": "plansOnly"; "required": false; }; "singlePurchasesOnly": { "alias": "singlePurchasesOnly"; "required": false; }; "showTabHeader": { "alias": "showTabHeader"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; }, { "planSelected": "planSelected"; "purchaseSelected": "purchaseSelected"; "errorOccurred": "errorOccurred"; }, never, never, true, never>;
|
|
162
168
|
}
|
|
163
169
|
export {};
|
package/dist/public-api.d.ts
CHANGED
|
@@ -9,13 +9,13 @@ export { MetrifoxService, metrifoxInit, MetrifoxNotInitializedError } from './li
|
|
|
9
9
|
export { CustomerPortalComponent } from './modules/customer-portal/components/customer-portal.component';
|
|
10
10
|
export { PricingTableComponent } from './modules/pricing-table/components/pricing-table.component';
|
|
11
11
|
export { MetrifoxModule, provideMetrifox } from './lib/metrifox.module';
|
|
12
|
-
export type { Theme, CustomerPortalTheme, PricingTableTheme
|
|
13
|
-
export { setIfDefined, customerPortalThemeToCssVars, pricingTableThemeToCssVars, getGradient, getBackgroundImage
|
|
14
|
-
export type { MetrifoxConfig, SectionConfig, SectionKey
|
|
15
|
-
export type { CustomerPortalProps, CustomerDetails, Subscription, SubscriptionDetails, SubscriptionItem, UpcomingInvoice, PaymentMethod, BillingAddress, Currency, InvoiceStatus
|
|
16
|
-
export type { Entitlement, Feature, EntitlementUsage, EntitlementSummary, Pool, ProcessedPool
|
|
17
|
-
export type { Wallet, WalletAllocation, CreditAllocation, CreditTransaction, WalletSetting, CreditSystem, CreditOwner
|
|
18
|
-
export type { PricingTableProps, Product, Offering, ParentOffering, PriceOption, PriceOwner, Price, Tier, SinglePurchase
|
|
19
|
-
export type { Invoice, InvoiceLineItem, InvoiceSummary, Tenant, TenantAddress, BillingHistory
|
|
20
|
-
export type { CustomerDataLoadedEvent, PlanSelectedEvent, PurchaseSelectedEvent, ErrorEvent, CssVarMap
|
|
21
|
-
export { FeatureType, FeatureModel, FeatureStatus, SubscriptionStatus, InvoiceStatusType, InvoiceItemType, PriceTypes, TierType, ResetIntervals, EnforcementType, BillingInterval, BillingTimingTypes, AggregationMethods, OneOffType, PoolType, OfferingTypes
|
|
12
|
+
export type { Theme, CustomerPortalTheme, PricingTableTheme } from './lib/types';
|
|
13
|
+
export { setIfDefined, customerPortalThemeToCssVars, pricingTableThemeToCssVars, getGradient, getBackgroundImage } from './lib/utils/theme';
|
|
14
|
+
export type { MetrifoxConfig, SectionConfig, SectionKey } from './lib/types';
|
|
15
|
+
export type { CustomerPortalProps, CustomerDetails, Subscription, SubscriptionDetails, SubscriptionItem, UpcomingInvoice, PaymentMethod, BillingAddress, Currency, InvoiceStatus } from './lib/types';
|
|
16
|
+
export type { Entitlement, Feature, EntitlementUsage, EntitlementSummary, Pool, ProcessedPool } from './lib/types';
|
|
17
|
+
export type { Wallet, WalletAllocation, CreditAllocation, CreditTransaction, WalletSetting, CreditSystem, CreditOwner } from './lib/types';
|
|
18
|
+
export type { PricingTableProps, Product, Offering, ParentOffering, PriceOption, PriceOwner, Price, Tier, SinglePurchase } from './lib/types';
|
|
19
|
+
export type { Invoice, InvoiceLineItem, InvoiceSummary, Tenant, TenantAddress, BillingHistory } from './lib/types';
|
|
20
|
+
export type { CustomerDataLoadedEvent, PlanSelectedEvent, PurchaseSelectedEvent, ErrorEvent, CssVarMap } from './lib/types';
|
|
21
|
+
export { FeatureType, FeatureModel, FeatureStatus, SubscriptionStatus, InvoiceStatusType, InvoiceItemType, PriceTypes, TierType, ResetIntervals, EnforcementType, BillingInterval, BillingTimingTypes, AggregationMethods, OneOffType, PoolType, OfferingTypes } from './lib/types/enum';
|