@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.
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/services/users/constants.d.ts +7 -0
- package/dist/services/users/constants.d.ts.map +1 -0
- package/dist/services/users/constants.js +8 -0
- package/dist/services/users/index.d.ts +9 -0
- package/dist/services/users/index.d.ts.map +1 -0
- package/dist/services/users/index.js +9 -0
- package/dist/services/users/investment_preferences/constants.d.ts +7 -0
- package/dist/services/users/investment_preferences/constants.d.ts.map +1 -0
- package/dist/services/users/investment_preferences/constants.js +7 -0
- package/dist/services/users/investment_preferences/index.d.ts +7 -0
- package/dist/services/users/investment_preferences/index.d.ts.map +1 -0
- package/dist/services/users/investment_preferences/index.js +6 -0
- package/dist/services/users/investment_preferences/service.d.ts +5 -0
- package/dist/services/users/investment_preferences/service.d.ts.map +1 -0
- package/dist/services/users/investment_preferences/service.js +12 -0
- package/dist/services/users/investment_preferences/types.d.ts +23 -0
- package/dist/services/users/investment_preferences/types.d.ts.map +1 -0
- package/dist/services/users/investment_preferences/types.js +1 -0
- package/dist/services/users/service.d.ts +6 -0
- package/dist/services/users/service.d.ts.map +1 -0
- package/dist/services/users/service.js +15 -0
- package/dist/services/users/types.d.ts +32 -0
- package/dist/services/users/types.d.ts.map +1 -0
- package/dist/services/users/types.js +1 -0
- package/dist/services/users/utils.d.ts +2 -0
- package/dist/services/users/utils.d.ts.map +1 -0
- package/dist/services/users/utils.js +6 -0
- 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';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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;
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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,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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
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
|
+
};
|