@cranberry-money/shared-services 10.0.3 → 10.0.4
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/accounts.d.ts +12 -0
- package/dist/accounts.d.ts.map +1 -0
- package/dist/accounts.js +28 -0
- package/dist/accounts.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-agnostic account service functions.
|
|
3
|
+
* Works with any axios-compatible API client.
|
|
4
|
+
*/
|
|
5
|
+
import { AxiosInstance } from 'axios';
|
|
6
|
+
import type { Account, CreateAccount, UpdateAccount, PaginatedResponse } from '@cranberry-money/shared-types';
|
|
7
|
+
export declare const configureAccounts: (apiClient: AxiosInstance) => void;
|
|
8
|
+
export declare const getAccounts: () => Promise<import("axios").AxiosResponse<PaginatedResponse<Account>, any>>;
|
|
9
|
+
export declare const createAccount: (data: CreateAccount) => Promise<import("axios").AxiosResponse<Account, any>>;
|
|
10
|
+
export declare const updateAccount: (uuid: string, data: UpdateAccount) => Promise<import("axios").AxiosResponse<Account, any>>;
|
|
11
|
+
export declare const getAccountByUuid: (uuid: string) => Promise<import("axios").AxiosResponse<Account, any>>;
|
|
12
|
+
//# sourceMappingURL=accounts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../src/accounts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAI9G,eAAO,MAAM,iBAAiB,GAAI,WAAW,aAAa,KAAG,IAE5D,CAAC;AAWF,eAAO,MAAM,WAAW,+EAEvB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,MAAM,aAAa,yDAEhD,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,EAAE,MAAM,aAAa,yDAE9D,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,yDAE5C,CAAC"}
|
package/dist/accounts.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-agnostic account service functions.
|
|
3
|
+
* Works with any axios-compatible API client.
|
|
4
|
+
*/
|
|
5
|
+
import { ACCOUNT_ENDPOINTS } from '@cranberry-money/shared-constants';
|
|
6
|
+
let configuredApiClient = null;
|
|
7
|
+
export const configureAccounts = (apiClient) => {
|
|
8
|
+
configuredApiClient = apiClient;
|
|
9
|
+
};
|
|
10
|
+
const getConfiguredClient = () => {
|
|
11
|
+
if (!configuredApiClient) {
|
|
12
|
+
throw new Error('Accounts service not configured. Call configureAccounts(apiClient) before using account functions.');
|
|
13
|
+
}
|
|
14
|
+
return configuredApiClient;
|
|
15
|
+
};
|
|
16
|
+
export const getAccounts = () => {
|
|
17
|
+
return getConfiguredClient().get(ACCOUNT_ENDPOINTS.BASE);
|
|
18
|
+
};
|
|
19
|
+
export const createAccount = (data) => {
|
|
20
|
+
return getConfiguredClient().post(ACCOUNT_ENDPOINTS.BASE, data);
|
|
21
|
+
};
|
|
22
|
+
export const updateAccount = (uuid, data) => {
|
|
23
|
+
return getConfiguredClient().patch(`${ACCOUNT_ENDPOINTS.BASE}${uuid}/`, data);
|
|
24
|
+
};
|
|
25
|
+
export const getAccountByUuid = (uuid) => {
|
|
26
|
+
return getConfiguredClient().get(`${ACCOUNT_ENDPOINTS.BASE}${uuid}/`);
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=accounts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.js","sourceRoot":"","sources":["../src/accounts.ts"],"names":[],"mappings":"AAAA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{ configureAuth, signin, signout, signup, verifyEmail, resendVerificationCode, refreshToken, } from './auth';
|
|
6
|
+
export { configureAccounts, getAccounts, createAccount, updateAccount, getAccountByUuid, } from './accounts';
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,aAAa,EACb,MAAM,EACN,OAAO,EACP,MAAM,EACN,WAAW,EACX,sBAAsB,EACtB,YAAY,GACb,MAAM,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,aAAa,EACb,MAAM,EACN,OAAO,EACP,MAAM,EACN,WAAW,EACX,sBAAsB,EACtB,YAAY,GACb,MAAM,QAAQ,CAAC;AAGhB,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,aAAa,EACb,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,4 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
// Authentication services
|
|
6
6
|
export { configureAuth, signin, signout, signup, verifyEmail, resendVerificationCode, refreshToken, } from './auth';
|
|
7
|
+
// Account services
|
|
8
|
+
export { configureAccounts, getAccounts, createAccount, updateAccount, getAccountByUuid, } from './accounts';
|
|
7
9
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,0BAA0B;AAC1B,OAAO,EACL,aAAa,EACb,MAAM,EACN,OAAO,EACP,MAAM,EACN,WAAW,EACX,sBAAsB,EACtB,YAAY,GACb,MAAM,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,0BAA0B;AAC1B,OAAO,EACL,aAAa,EACb,MAAM,EACN,OAAO,EACP,MAAM,EACN,WAAW,EACX,sBAAsB,EACtB,YAAY,GACb,MAAM,QAAQ,CAAC;AAEhB,mBAAmB;AACnB,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,aAAa,EACb,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cranberry-money/shared-services",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.4",
|
|
4
4
|
"description": "Platform-agnostic API services with pure functions and dependency injection. Includes auth, portfolios, instruments, countries, sectors, and more.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|