@cranberry-money/shared-services 1.3.0 → 1.4.0

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.
Files changed (31) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +1 -0
  4. package/dist/services/users/constants.d.ts +7 -0
  5. package/dist/services/users/constants.d.ts.map +1 -0
  6. package/dist/services/users/constants.js +8 -0
  7. package/dist/services/users/index.d.ts +9 -0
  8. package/dist/services/users/index.d.ts.map +1 -0
  9. package/dist/services/users/index.js +9 -0
  10. package/dist/services/users/investment_preferences/constants.d.ts +7 -0
  11. package/dist/services/users/investment_preferences/constants.d.ts.map +1 -0
  12. package/dist/services/users/investment_preferences/constants.js +7 -0
  13. package/dist/services/users/investment_preferences/index.d.ts +7 -0
  14. package/dist/services/users/investment_preferences/index.d.ts.map +1 -0
  15. package/dist/services/users/investment_preferences/index.js +6 -0
  16. package/dist/services/users/investment_preferences/service.d.ts +5 -0
  17. package/dist/services/users/investment_preferences/service.d.ts.map +1 -0
  18. package/dist/services/users/investment_preferences/service.js +12 -0
  19. package/dist/services/users/investment_preferences/types.d.ts +23 -0
  20. package/dist/services/users/investment_preferences/types.d.ts.map +1 -0
  21. package/dist/services/users/investment_preferences/types.js +1 -0
  22. package/dist/services/users/service.d.ts +6 -0
  23. package/dist/services/users/service.d.ts.map +1 -0
  24. package/dist/services/users/service.js +15 -0
  25. package/dist/services/users/types.d.ts +32 -0
  26. package/dist/services/users/types.d.ts.map +1 -0
  27. package/dist/services/users/types.js +1 -0
  28. package/dist/services/users/utils.d.ts +2 -0
  29. package/dist/services/users/utils.d.ts.map +1 -0
  30. package/dist/services/users/utils.js +6 -0
  31. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -15,6 +15,7 @@ export * from './services/PortfolioService';
15
15
  export * as AccountsService from './services/accounts';
16
16
  export * as AuthService from './services/auth';
17
17
  export * as PortfoliosService from './services/portfolios';
18
+ export * as UsersService from './services/users';
18
19
  export * from './query/QueryClient';
19
20
  export * from './query/useAuth';
20
21
  export * from './query/usePortfolios';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AAGrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAG3C,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,YAAY,EACb,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAGrB,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAG5C,OAAO,KAAK,eAAe,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,WAAW,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,iBAAiB,MAAM,uBAAuB,CAAC;AAG3D,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AAGrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAG3C,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,YAAY,EACb,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAGrB,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAG5C,OAAO,KAAK,eAAe,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,WAAW,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,iBAAiB,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,YAAY,MAAM,kBAAkB,CAAC;AAGjD,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC"}
package/dist/index.js CHANGED
@@ -19,6 +19,7 @@ export * from './services/PortfolioService';
19
19
  export * as AccountsService from './services/accounts';
20
20
  export * as AuthService from './services/auth';
21
21
  export * as PortfoliosService from './services/portfolios';
22
+ export * as UsersService from './services/users';
22
23
  // React Query integration
23
24
  export * from './query/QueryClient';
24
25
  export * from './query/useAuth';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Users domain API constants
3
+ */
4
+ export declare const API_ENDPOINTS: {
5
+ readonly USER_PROFILES: "/api/user-profiles/";
6
+ };
7
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/services/users/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,eAAO,MAAM,aAAa;;CAGhB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Users domain API constants
3
+ */
4
+ // API Endpoints
5
+ export const API_ENDPOINTS = {
6
+ // User profiles
7
+ USER_PROFILES: '/api/user-profiles/',
8
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Users service exports
3
+ */
4
+ export * from './constants';
5
+ export * from './types';
6
+ export * from './service';
7
+ export * from './utils';
8
+ export * as InvestmentPreferences from './investment_preferences';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/users/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AAGxB,OAAO,KAAK,qBAAqB,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Users service exports
3
+ */
4
+ export * from './constants';
5
+ export * from './types';
6
+ export * from './service';
7
+ export * from './utils';
8
+ // Sub-services
9
+ export * as InvestmentPreferences from './investment_preferences';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Investment preferences API constants
3
+ */
4
+ export declare const API_ENDPOINTS: {
5
+ readonly INVESTMENT_PREFERENCES: "/api/investment-preferences/";
6
+ };
7
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/services/users/investment_preferences/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,eAAO,MAAM,aAAa;;CAEhB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Investment preferences API constants
3
+ */
4
+ // API Endpoints
5
+ export const API_ENDPOINTS = {
6
+ INVESTMENT_PREFERENCES: '/api/investment-preferences/',
7
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Investment preferences service exports
3
+ */
4
+ export * from './constants';
5
+ export * from './types';
6
+ export * from './service';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/users/investment_preferences/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Investment preferences service exports
3
+ */
4
+ export * from './constants';
5
+ export * from './types';
6
+ export * from './service';
@@ -0,0 +1,5 @@
1
+ import type { InvestmentPreference, InvestmentPreferencePayload, PaginatedInvestmentPreferences } from './types';
2
+ export declare const createInvestmentPreference: (data: InvestmentPreferencePayload) => Promise<import("axios").AxiosResponse<InvestmentPreference, any>>;
3
+ export declare const updateInvestmentPreference: (uuid: string, data: Partial<InvestmentPreferencePayload>) => Promise<import("axios").AxiosResponse<InvestmentPreference, any>>;
4
+ export declare const getInvestmentPreferences: () => Promise<import("axios").AxiosResponse<PaginatedInvestmentPreferences, any>>;
5
+ //# sourceMappingURL=service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../src/services/users/investment_preferences/service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAGjH,eAAO,MAAM,0BAA0B,GAAI,MAAM,2BAA2B,sEAE3E,CAAC;AAEF,eAAO,MAAM,0BAA0B,GAAI,MAAM,MAAM,EAAE,MAAM,OAAO,CAAC,2BAA2B,CAAC,sEAElG,CAAC;AAEF,eAAO,MAAM,wBAAwB,mFAEpC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { webApiClient } from '../../../api/apiClient';
2
+ import { API_ENDPOINTS } from './constants';
3
+ // Investment preferences services
4
+ export const createInvestmentPreference = (data) => {
5
+ return webApiClient.post(API_ENDPOINTS.INVESTMENT_PREFERENCES, data);
6
+ };
7
+ export const updateInvestmentPreference = (uuid, data) => {
8
+ return webApiClient.patch(`${API_ENDPOINTS.INVESTMENT_PREFERENCES}${uuid}/`, data);
9
+ };
10
+ export const getInvestmentPreferences = () => {
11
+ return webApiClient.get(API_ENDPOINTS.INVESTMENT_PREFERENCES);
12
+ };
@@ -0,0 +1,23 @@
1
+ export interface InvestmentPreference {
2
+ uuid: string;
3
+ userProfile: string;
4
+ investmentHorizon: string;
5
+ riskTolerance: string;
6
+ investmentExperience: string;
7
+ investmentAmount: string;
8
+ sourceOfFunds: string[];
9
+ }
10
+ export interface InvestmentPreferencePayload {
11
+ investmentHorizon: string;
12
+ riskTolerance: string;
13
+ investmentExperience: string;
14
+ investmentAmount: number;
15
+ sourceOfFunds: string[];
16
+ }
17
+ export interface PaginatedInvestmentPreferences {
18
+ count: number;
19
+ next: string | null;
20
+ previous: string | null;
21
+ results: InvestmentPreference[];
22
+ }
23
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/services/users/investment_preferences/types.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAGD,MAAM,WAAW,2BAA2B;IAC1C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAGD,MAAM,WAAW,8BAA8B;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,oBAAoB,EAAE,CAAC;CACjC"}
@@ -0,0 +1,6 @@
1
+ import type { UserProfile, UserProfilePayload, UserProfileCompletionPayload, PaginatedUserProfiles } from './types';
2
+ export declare const createUserProfile: (data: UserProfilePayload) => Promise<import("axios").AxiosResponse<UserProfile, any>>;
3
+ export declare const updateUserProfile: (uuid: string, data: UserProfilePayload) => Promise<import("axios").AxiosResponse<UserProfile, any>>;
4
+ export declare const updateUserProfileCompletion: (uuid: string, data: UserProfileCompletionPayload) => Promise<import("axios").AxiosResponse<UserProfile, any>>;
5
+ export declare const getUserProfiles: () => Promise<import("axios").AxiosResponse<PaginatedUserProfiles, any>>;
6
+ //# sourceMappingURL=service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/services/users/service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAGpH,eAAO,MAAM,iBAAiB,GAAI,MAAM,kBAAkB,6DAEzD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,EAAE,MAAM,kBAAkB,6DAEvE,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,MAAM,MAAM,EAAE,MAAM,4BAA4B,6DAE3F,CAAC;AAEF,eAAO,MAAM,eAAe,0EAE3B,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { webApiClient } from '../../api/apiClient';
2
+ import { API_ENDPOINTS } from './constants';
3
+ // User profile services
4
+ export const createUserProfile = (data) => {
5
+ return webApiClient.post(API_ENDPOINTS.USER_PROFILES, data);
6
+ };
7
+ export const updateUserProfile = (uuid, data) => {
8
+ return webApiClient.patch(`${API_ENDPOINTS.USER_PROFILES}${uuid}/`, data);
9
+ };
10
+ export const updateUserProfileCompletion = (uuid, data) => {
11
+ return webApiClient.patch(`${API_ENDPOINTS.USER_PROFILES}${uuid}/`, data);
12
+ };
13
+ export const getUserProfiles = () => {
14
+ return webApiClient.get(API_ENDPOINTS.USER_PROFILES);
15
+ };
@@ -0,0 +1,32 @@
1
+ import type { PaginatedResponse } from '../../api/types';
2
+ export interface UserProfile {
3
+ uuid: string;
4
+ citizenshipCountry: string;
5
+ fullName: string;
6
+ dateOfBirth: string;
7
+ residentialAddress: string;
8
+ isPoliticallyExposed: boolean;
9
+ phoneNumber: string;
10
+ investmentGoals: string[];
11
+ riskTolerance: string | null;
12
+ withdrawPreferences: string | null;
13
+ isIdVerified: boolean;
14
+ termsAndConditions: boolean;
15
+ isSignupCompleted: boolean;
16
+ createdAt: string;
17
+ updatedAt: string;
18
+ }
19
+ export interface UserProfilePayload {
20
+ fullName: string;
21
+ dateOfBirth: string;
22
+ citizenshipCountry: string;
23
+ residentialAddress: string;
24
+ isPoliticallyExposed: boolean;
25
+ phoneNumber: string;
26
+ }
27
+ export interface UserProfileCompletionPayload {
28
+ termsAndConditions?: boolean;
29
+ isSignupCompleted?: boolean;
30
+ }
31
+ export type PaginatedUserProfiles = PaginatedResponse<UserProfile>;
32
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/users/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,YAAY,EAAE,OAAO,CAAC;IACtB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,4BAA4B;IAC3C,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const userUtilsPlaceholder: () => void;
2
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/services/users/utils.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB,YAEhC,CAAC"}
@@ -0,0 +1,6 @@
1
+ // This file is reserved for user profile-related utilities
2
+ // Authentication utilities are available in the auth service
3
+ // Placeholder function to make this a proper module
4
+ export const userUtilsPlaceholder = () => {
5
+ // Add user profile utilities here as needed
6
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cranberry-money/shared-services",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Shared API services and client for MyPortfolio platform",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",