@mx-cartographer/experiences 3.9.0-alpha.bb1 → 3.9.0-alpha.sms1

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [3.9.0] - 10-16-2024
2
+
3
+ - **UPDATED** - `Fetch` requests throw errors to be caught and handled upstream
4
+ - **FIXED** - `MicroInsights` logs user out if 401 error is thrown
5
+ - **FIXED** - Analytics types
6
+
1
7
  ## [3.8.0] - 10-15-2024
2
8
 
3
9
  - **UPDATED** - KyperMUI to 4.1
@@ -1,8 +1,8 @@
1
1
  import { default as React } from 'react';
2
- import { DetailedBudget } from '../../common/types/Budget';
2
+ import { BubbleData } from './BubbleChart';
3
3
  interface BubbleBudgetsProps {
4
4
  isDraggable?: boolean;
5
- onClick?: (budget: DetailedBudget) => void;
5
+ onClick?: (bubble: BubbleData) => void;
6
6
  shouldShowZeroState: boolean;
7
7
  unavailableHeight?: number;
8
8
  unavailableWidth?: number;
@@ -1,16 +1,23 @@
1
1
  import { default as React } from 'react';
2
2
  import { SimulationNodeDatum } from 'd3-force';
3
- import { DetailedBudget } from '../../common/types/Budget';
4
3
  export interface BubbleData extends SimulationNodeDatum {
5
- budget: DetailedBudget;
4
+ backgroundColor: string;
5
+ budgetGuid: string;
6
+ currentAmount: number;
7
+ description: string;
8
+ icon?: string;
9
+ label: string;
10
+ progressColor: string;
6
11
  radius: number;
12
+ textColor: string;
13
+ totalAmount: number;
7
14
  }
8
15
  interface BubbleChartProps {
9
16
  data: BubbleData[];
10
17
  height: number;
11
18
  width: number;
12
19
  isDraggable?: boolean;
13
- onClick?: (budget: DetailedBudget) => void;
20
+ onClick?: (bubble: BubbleData) => void;
14
21
  }
15
22
  declare const BubbleChart: React.FC<BubbleChartProps>;
16
23
  export default BubbleChart;
@@ -1,10 +1,9 @@
1
1
  import { default as React } from 'react';
2
2
  import { BubbleData } from '../BubbleChart';
3
- import { DetailedBudget } from '../../../common/types/Budget';
4
3
  interface BubbleProps {
5
4
  bubble: BubbleData;
6
5
  isDraggable: boolean;
7
- onClick?: (budget: DetailedBudget) => void;
6
+ onClick?: (bubble: BubbleData) => void;
8
7
  }
9
8
  export declare const Bubble: React.FC<BubbleProps>;
10
9
  export {};
@@ -1,2 +1 @@
1
1
  export { default as BubbleBudgetsMiniWidget } from './BubbleBudgetsMiniWidget';
2
- export { BubbleBudgetsWidget } from './BubbleBudgetsWidget';
@@ -1,13 +1,10 @@
1
- import { Budget, BudgetsCopy, GlobalStore } from '../../common';
1
+ import { Budget, GlobalStore } from '../../common';
2
2
  import { BudgetsApi } from '../api/BudgetsApi';
3
- import { DetailedBudget } from '../../common/types/Budget';
4
- import { Theme } from '@mui/system';
5
3
  export declare class BudgetsStore {
6
4
  api: BudgetsApi;
7
5
  globalStore: GlobalStore;
8
- budgets: DetailedBudget[];
9
- income: Budget | undefined;
6
+ budgets: Budget[];
10
7
  constructor(globalStore: GlobalStore);
11
8
  initialize: (endpoint: string, token: string) => Promise<void>;
12
- loadBudgets: (copy: BudgetsCopy, theme: Theme) => Promise<void>;
9
+ loadBudgets: () => Promise<void>;
13
10
  }
@@ -1,7 +1,13 @@
1
1
  import { Theme } from '@mui/system';
2
2
  import { Budget, BudgetsCopy, Category } from '../../common';
3
- import { BudgetColors, DetailedBudget } from '../../common/types/Budget';
4
- export declare const getBudgetPercentage: (budget: Budget) => number;
5
- export declare const getBudgetColors: (budget: Budget, theme: Theme) => BudgetColors;
3
+ import { BubbleData } from '../components/BubbleChart';
4
+ export declare const getBudgetPercentage: (budgetAmount: number, budgetSpent: number) => number;
5
+ interface BubbleColors {
6
+ bubble: string;
7
+ mercury: string;
8
+ text: string;
9
+ }
10
+ export declare const getBubbleColors: (budgetAmount: number, budgetSpent: number, theme: Theme) => BubbleColors;
6
11
  export declare const useGetBudgetDifference: () => number;
7
- export declare const augmentBudgets: (budgets: Budget[], categories: Category[], copy: BudgetsCopy, theme: Theme) => DetailedBudget[];
12
+ export declare const buildBubbleData: (budgets: Budget[], categories: Category[], theme: Theme, copy: BudgetsCopy) => BubbleData[];
13
+ export {};
@@ -2,7 +2,7 @@ import { Fetch } from '../utils';
2
2
  import { AnalyticsEvent } from '../types';
3
3
  export declare class AnalyticsApi {
4
4
  fetchInstance: Fetch;
5
- constructor(endpoint: string, token: string);
5
+ constructor(endpoint: string, token: string, shouldPropagateError?: boolean);
6
6
  initializeAnalyticsSession: (version: string, featureName?: string) => Promise<{
7
7
  analytics_session: any;
8
8
  }>;
@@ -10,20 +10,25 @@ export type AnalyticsEvent = {
10
10
  name: string;
11
11
  session_id: string;
12
12
  user_agent: string;
13
+ value: string | null;
13
14
  version: number;
14
15
  };
15
16
  };
16
17
  export type AnalyticsPageview = {
17
- created_at: string;
18
- detailed_path: string;
19
- host: string;
20
- metadata: string | null;
21
- name: string;
22
- path: string;
23
- user_agent: string;
18
+ analytics_pageview: {
19
+ app_version: string;
20
+ created_at: string;
21
+ detailed_path: string;
22
+ host: string;
23
+ metadata: string | null;
24
+ name: string;
25
+ path: string;
26
+ session_id: string;
27
+ user_agent: string;
28
+ };
24
29
  };
25
- export type BasicAnalyticsEvent = Pick<AnalyticsEvent['analytics_event'], 'action' | 'category' | 'label'>;
26
- export type BasicAnalyticsPageview = Pick<AnalyticsPageview, 'path' | 'name'>;
30
+ export type BasicAnalyticsEvent = Pick<AnalyticsEvent['analytics_event'], 'action' | 'category' | 'label' | 'value'>;
31
+ export type BasicAnalyticsPageview = Pick<AnalyticsPageview['analytics_pageview'], 'name' | 'detailed_path' | 'metadata' | 'path'>;
27
32
  export type AnalyticsSession = {
28
33
  browser_name: string;
29
34
  browser_version: string;
@@ -34,3 +39,12 @@ export type AnalyticsSession = {
34
39
  };
35
40
  export type AnalyticEventFunction = (event: string, session?: Awaited<ReturnType<typeof analyticsSession>> | null) => void;
36
41
  export type AnalyticPageviewFunction = (page: string, session?: Awaited<ReturnType<typeof analyticsSession>> | null) => void;
42
+ export interface AnalyticsEventsObjectType extends BasicAnalyticsEvent {
43
+ instanceId: string;
44
+ }
45
+ export interface AnalyticsPageviewObjectType extends BasicAnalyticsPageview {
46
+ label: string;
47
+ name: string;
48
+ path: string;
49
+ value: string;
50
+ }
@@ -1,10 +1,3 @@
1
- import { Category } from './Category';
2
- export type BudgetColors = {
3
- background: string;
4
- mercury: string;
5
- description: string;
6
- text: string;
7
- };
8
1
  export interface Budget {
9
2
  amount: number;
10
3
  category_guid: string;
@@ -17,12 +10,3 @@ export interface Budget {
17
10
  transaction_total: number;
18
11
  user_guid: string;
19
12
  }
20
- export interface DetailedBudget extends Budget {
21
- budgetColors: BudgetColors;
22
- category: Category;
23
- description: string;
24
- icon: string;
25
- label: string;
26
- percentage: number;
27
- subBudgets: DetailedBudget[];
28
- }
@@ -1,5 +1,5 @@
1
1
  import { BasicAnalyticsEvent, BasicAnalyticsPageview } from '../types';
2
- export declare const analyticsSession: (endpoint: string, token: string, version?: string, featureName?: string) => Promise<{
2
+ export declare const analyticsSession: (endpoint: string, token: string, version?: string, featureName?: string, shouldPropagateError?: boolean) => Promise<{
3
3
  sendAnalyticEvent: (event: BasicAnalyticsEvent) => Promise<any>;
4
4
  sendAnalyticsPageview: (pageview: BasicAnalyticsPageview) => Promise<any>;
5
5
  }>;