@mx-cartographer/experiences 9.6.9 → 9.6.11
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/CHANGELOG.md +8 -0
- package/dist/core/stores/AccountStore.d.ts +1 -0
- package/dist/core/stores/AccountStore.es.js +47 -42
- package/dist/core/stores/AccountStore.es.js.map +1 -1
- package/dist/core/stores/AppDataStore.d.ts +1 -0
- package/dist/core/stores/AppDataStore.es.js +15 -11
- package/dist/core/stores/AppDataStore.es.js.map +1 -1
- package/dist/core/stores/BeatStore.d.ts +1 -0
- package/dist/core/stores/BeatStore.es.js +10 -6
- package/dist/core/stores/BeatStore.es.js.map +1 -1
- package/dist/core/stores/BudgetsStore.d.ts +1 -0
- package/dist/core/stores/BudgetsStore.es.js +37 -35
- package/dist/core/stores/BudgetsStore.es.js.map +1 -1
- package/dist/core/stores/CategoryStore.d.ts +1 -0
- package/dist/core/stores/CategoryStore.es.js +36 -32
- package/dist/core/stores/CategoryStore.es.js.map +1 -1
- package/dist/core/stores/FinstrongStore.d.ts +1 -0
- package/dist/core/stores/FinstrongStore.es.js +42 -38
- package/dist/core/stores/FinstrongStore.es.js.map +1 -1
- package/dist/core/stores/GlobalCopyStore.d.ts +1 -0
- package/dist/core/stores/GlobalCopyStore.es.js +17 -13
- package/dist/core/stores/GlobalCopyStore.es.js.map +1 -1
- package/dist/core/stores/GoalStore.d.ts +1 -0
- package/dist/core/stores/GoalStore.es.js +104 -100
- package/dist/core/stores/GoalStore.es.js.map +1 -1
- package/dist/core/stores/HelpStore.d.ts +1 -0
- package/dist/core/stores/HelpStore.es.js +10 -6
- package/dist/core/stores/HelpStore.es.js.map +1 -1
- package/dist/core/stores/HoldingStore.d.ts +1 -0
- package/dist/core/stores/HoldingStore.es.js +6 -2
- package/dist/core/stores/HoldingStore.es.js.map +1 -1
- package/dist/core/stores/NetWorthStore.d.ts +1 -0
- package/dist/core/stores/NetWorthStore.es.js +12 -8
- package/dist/core/stores/NetWorthStore.es.js.map +1 -1
- package/dist/core/stores/NotificationStore.d.ts +1 -0
- package/dist/core/stores/NotificationStore.es.js +11 -7
- package/dist/core/stores/NotificationStore.es.js.map +1 -1
- package/dist/core/stores/SettingsStore.d.ts +1 -0
- package/dist/core/stores/SettingsStore.es.js +23 -19
- package/dist/core/stores/SettingsStore.es.js.map +1 -1
- package/dist/core/stores/TransactionStore.d.ts +1 -0
- package/dist/core/stores/TransactionStore.es.js +71 -67
- package/dist/core/stores/TransactionStore.es.js.map +1 -1
- package/dist/core/stores/UserStore.d.ts +1 -0
- package/dist/core/stores/UserStore.es.js +10 -6
- package/dist/core/stores/UserStore.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UserApi as t } from "../api/UserApi.es.js";
|
|
2
|
-
import { makeAutoObservable as s, runInAction as
|
|
2
|
+
import { makeAutoObservable as s, runInAction as a } from "mobx";
|
|
3
3
|
var u = class {
|
|
4
4
|
globalStore;
|
|
5
5
|
api = new t("/", "");
|
|
@@ -23,7 +23,7 @@ var u = class {
|
|
|
23
23
|
const e = await this.api.getUserFeatures();
|
|
24
24
|
this.setUserFeatures(e);
|
|
25
25
|
} catch (e) {
|
|
26
|
-
|
|
26
|
+
this.captureError("loadUserFeatures", e), this.setUserFeatures([]);
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
updateUser = async (e) => {
|
|
@@ -31,7 +31,7 @@ var u = class {
|
|
|
31
31
|
const r = await this.api.updateUser(e);
|
|
32
32
|
this.globalStore.appDataStore.setUser(r);
|
|
33
33
|
} catch (r) {
|
|
34
|
-
throw
|
|
34
|
+
throw this.captureError("updateUser", r), r;
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
updateUserProfile = async (e) => {
|
|
@@ -39,7 +39,7 @@ var u = class {
|
|
|
39
39
|
const r = await this.api.updateUserProfile(e);
|
|
40
40
|
this.globalStore.appDataStore.setUserProfile(r);
|
|
41
41
|
} catch (r) {
|
|
42
|
-
|
|
42
|
+
this.captureError("updateUserProfile", r);
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
setUserInsightProfile = (e) => {
|
|
@@ -52,13 +52,17 @@ var u = class {
|
|
|
52
52
|
...this.userInsightProfile,
|
|
53
53
|
...e
|
|
54
54
|
});
|
|
55
|
-
return
|
|
55
|
+
return a(() => {
|
|
56
56
|
this.userInsightProfile = r;
|
|
57
57
|
}), r;
|
|
58
58
|
} catch (r) {
|
|
59
|
-
throw
|
|
59
|
+
throw this.captureError("updateUserInsightProfile", r), r;
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
|
+
captureError = (e, r) => this.globalStore.captureException(r, {
|
|
63
|
+
store: "UserStore",
|
|
64
|
+
action: e
|
|
65
|
+
});
|
|
62
66
|
};
|
|
63
67
|
export {
|
|
64
68
|
u as UserStore
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserStore.es.js","names":[],"sources":["../../../src/core/stores/UserStore.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from 'mobx'\n\nimport { UserApi } from '../api'\nimport type { User, UserFeature, UserInsightProfile, UserProfile } from '../types'\n\nimport { GlobalStore } from './GlobalStore'\n\nexport class UserStore {\n globalStore: GlobalStore\n api: UserApi = new UserApi('/', '')\n\n userFeatures: UserFeature[] = []\n userFeaturesLoaded: boolean = false\n userInsightProfile: UserInsightProfile | null = null\n\n constructor(globalStore: GlobalStore) {\n this.globalStore = globalStore\n this.api = new UserApi(globalStore.endpoint, globalStore.sessionToken, globalStore.onError)\n\n makeAutoObservable(this)\n }\n\n get userProfile() {\n return this.globalStore.appDataStore.userProfile\n }\n\n get user() {\n return this.globalStore.appDataStore.user\n }\n\n setUserFeatures = (features: UserFeature[]) => {\n this.userFeatures = features\n this.userFeaturesLoaded = true\n }\n\n loadUserFeatures = async () => {\n try {\n const features = await this.api.getUserFeatures()\n this.setUserFeatures(features)\n } catch (e) {\n
|
|
1
|
+
{"version":3,"file":"UserStore.es.js","names":[],"sources":["../../../src/core/stores/UserStore.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from 'mobx'\n\nimport { UserApi } from '../api'\nimport type { User, UserFeature, UserInsightProfile, UserProfile } from '../types'\n\nimport { GlobalStore } from './GlobalStore'\n\nexport class UserStore {\n globalStore: GlobalStore\n api: UserApi = new UserApi('/', '')\n\n userFeatures: UserFeature[] = []\n userFeaturesLoaded: boolean = false\n userInsightProfile: UserInsightProfile | null = null\n\n constructor(globalStore: GlobalStore) {\n this.globalStore = globalStore\n this.api = new UserApi(globalStore.endpoint, globalStore.sessionToken, globalStore.onError)\n\n makeAutoObservable(this)\n }\n\n get userProfile() {\n return this.globalStore.appDataStore.userProfile\n }\n\n get user() {\n return this.globalStore.appDataStore.user\n }\n\n setUserFeatures = (features: UserFeature[]) => {\n this.userFeatures = features\n this.userFeaturesLoaded = true\n }\n\n loadUserFeatures = async () => {\n try {\n const features = await this.api.getUserFeatures()\n this.setUserFeatures(features)\n } catch (e) {\n this.captureError('loadUserFeatures', e)\n this.setUserFeatures([])\n }\n }\n\n updateUser = async (user: User) => {\n try {\n const updatedUser = await this.api.updateUser(user)\n\n this.globalStore.appDataStore.setUser(updatedUser)\n } catch (error) {\n this.captureError('updateUser', error)\n throw error\n }\n }\n\n updateUserProfile = async (userProfile: UserProfile) => {\n try {\n const updatedProfile = await this.api.updateUserProfile(userProfile)\n\n this.globalStore.appDataStore.setUserProfile(updatedProfile)\n } catch (error) {\n this.captureError('updateUserProfile', error)\n }\n }\n\n /**\n * Seeds the profile. The host (pulse) loads `user_insight_profile` and pushes it in here;\n * experiences itself never fetches it.\n */\n setUserInsightProfile = (profile: UserInsightProfile | null) => {\n this.userInsightProfile = profile\n }\n\n /**\n * Merges `fields` into the seeded profile and PUTs the whole profile. The endpoint is an\n * upsert that writes every profile field from the request, so a partial body would null\n * the fields it omits; the merge is what keeps them. Throws if the host has not seeded the\n * profile yet, and rethrows API failures, so a caller driving UI state (e.g. an insight\n * CTA) reports the error instead of silently treating the save as done.\n */\n updateUserInsightProfile = async (fields: Partial<UserInsightProfile>) => {\n if (!this.userInsightProfile) {\n throw new Error('User insight profile has not been loaded; refusing a partial PUT')\n }\n\n try {\n const updated = await this.api.updateUserInsightProfile({\n ...this.userInsightProfile,\n ...fields,\n })\n\n runInAction(() => {\n this.userInsightProfile = updated\n })\n\n return updated\n } catch (error) {\n this.captureError('updateUserInsightProfile', error)\n throw error\n }\n }\n\n private captureError = (action: string, error: unknown) =>\n this.globalStore.captureException(error, { store: 'UserStore', action })\n}\n"],"mappings":";;AAOA,IAAa,IAAb,MAAuB;AAAA,EACrB;AAAA,EACA,MAAe,IAAI,EAAQ,KAAK,EAAE;AAAA,EAElC,eAA8B,CAAC;AAAA,EAC/B,qBAA8B;AAAA,EAC9B,qBAAgD;AAAA,EAEhD,YAAY,GAA0B;AACpC,SAAK,cAAc,GACnB,KAAK,MAAM,IAAI,EAAQ,EAAY,UAAU,EAAY,cAAc,EAAY,OAAO,GAE1F,EAAmB,IAAI;AAAA,EACzB;AAAA,EAEA,IAAI,cAAc;AAChB,WAAO,KAAK,YAAY,aAAa;AAAA,EACvC;AAAA,EAEA,IAAI,OAAO;AACT,WAAO,KAAK,YAAY,aAAa;AAAA,EACvC;AAAA,EAEA,kBAAA,CAAmB,MAA4B;AAC7C,SAAK,eAAe,GACpB,KAAK,qBAAqB;AAAA,EAC5B;AAAA,EAEA,mBAAmB,YAAY;AAC7B,QAAI;AACF,YAAM,IAAW,MAAM,KAAK,IAAI,gBAAgB;AAChD,WAAK,gBAAgB,CAAQ;AAAA,IAC/B,SAAS,GAAG;AACV,WAAK,aAAa,oBAAoB,CAAC,GACvC,KAAK,gBAAgB,CAAC,CAAC;AAAA,IACzB;AAAA,EACF;AAAA,EAEA,aAAa,OAAO,MAAe;AACjC,QAAI;AACF,YAAM,IAAc,MAAM,KAAK,IAAI,WAAW,CAAI;AAElD,WAAK,YAAY,aAAa,QAAQ,CAAW;AAAA,IACnD,SAAS,G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