@open-tender/cloud 0.0.2 → 0.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.
@@ -4,7 +4,7 @@ declare class OpenTenderAPI {
4
4
  clientId?: string;
5
5
  baseUrl?: string;
6
6
  authUrl?: string;
7
- constructor(config: ConfigApp | null);
7
+ constructor(config: Partial<ConfigApp> | null);
8
8
  request(endpoint: string, method?: string, data?: any, timeout?: number | null, token?: string | null): Promise<unknown>;
9
9
  authRequest(endpoint: string, data: any): Promise<unknown>;
10
10
  post(endpoint: string, data: Record<string, unknown>): Promise<unknown>;
@@ -17,10 +17,10 @@ export declare enum ConfigActionType {
17
17
  FetchConfig = "config/getConfig"
18
18
  }
19
19
  export declare const fetchConfig: import("@reduxjs/toolkit").AsyncThunk<ConfigState, {
20
- baseUrl: string;
21
- authUrl: string;
22
- clientId: string;
23
- brandId: string;
20
+ baseUrl?: string | undefined;
21
+ authUrl?: string | undefined;
22
+ clientId?: string | undefined;
23
+ brandId?: string | undefined;
24
24
  callback?: (() => void) | undefined;
25
25
  }, {
26
26
  state: AppState;
@@ -56,4 +56,5 @@ export declare const authCustomerThanx: import("@reduxjs/toolkit").AsyncThunk<Au
56
56
  }>;
57
57
  export declare const resetCustomer: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetLoginError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, fulfillLoginCustomer: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>;
58
58
  export declare const selectToken: (state: AppState) => string | null;
59
+ export declare const selectCustomer: (state: AppState) => AccountState;
59
60
  export declare const accountReducer: import("redux").Reducer<AccountState, AnyAction>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.accountReducer = exports.selectToken = exports.fulfillLoginCustomer = exports.resetLoginError = exports.resetCustomer = exports.authCustomerThanx = exports.loginCustomerThanx = exports.sendCustomerVerificationEmail = exports.updateCustomer = exports.linkPosToken = exports.logoutCustomer = exports.loginCustomer = exports.fetchCustomer = exports.checkAuth = exports.AccountActionType = void 0;
4
+ exports.accountReducer = exports.selectCustomer = exports.selectToken = exports.fulfillLoginCustomer = exports.resetLoginError = exports.resetCustomer = exports.authCustomerThanx = exports.loginCustomerThanx = exports.sendCustomerVerificationEmail = exports.updateCustomer = exports.linkPosToken = exports.logoutCustomer = exports.loginCustomer = exports.fetchCustomer = exports.checkAuth = exports.AccountActionType = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const toolkit_1 = require("@reduxjs/toolkit");
7
7
  const types_1 = require("../types");
@@ -285,4 +285,6 @@ const accountSlice = (0, toolkit_1.createSlice)({
285
285
  _a = accountSlice.actions, exports.resetCustomer = _a.resetCustomer, exports.resetLoginError = _a.resetLoginError, exports.fulfillLoginCustomer = _a.fulfillLoginCustomer;
286
286
  const selectToken = (state) => state.customer.account.auth ? state.customer.account.auth.access_token : null;
287
287
  exports.selectToken = selectToken;
288
+ const selectCustomer = (state) => state.customer.account;
289
+ exports.selectCustomer = selectCustomer;
288
290
  exports.accountReducer = accountSlice.reducer;
@@ -4,7 +4,7 @@ declare class OpenTenderAPI {
4
4
  clientId?: string;
5
5
  baseUrl?: string;
6
6
  authUrl?: string;
7
- constructor(config: ConfigApp | null);
7
+ constructor(config: Partial<ConfigApp> | null);
8
8
  request(endpoint: string, method?: string, data?: any, timeout?: number | null, token?: string | null): Promise<unknown>;
9
9
  authRequest(endpoint: string, data: any): Promise<unknown>;
10
10
  post(endpoint: string, data: Record<string, unknown>): Promise<unknown>;
@@ -17,10 +17,10 @@ export declare enum ConfigActionType {
17
17
  FetchConfig = "config/getConfig"
18
18
  }
19
19
  export declare const fetchConfig: import("@reduxjs/toolkit").AsyncThunk<ConfigState, {
20
- baseUrl: string;
21
- authUrl: string;
22
- clientId: string;
23
- brandId: string;
20
+ baseUrl?: string | undefined;
21
+ authUrl?: string | undefined;
22
+ clientId?: string | undefined;
23
+ brandId?: string | undefined;
24
24
  callback?: (() => void) | undefined;
25
25
  }, {
26
26
  state: AppState;
@@ -56,4 +56,5 @@ export declare const authCustomerThanx: import("@reduxjs/toolkit").AsyncThunk<Au
56
56
  }>;
57
57
  export declare const resetCustomer: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetLoginError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, fulfillLoginCustomer: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>;
58
58
  export declare const selectToken: (state: AppState) => string | null;
59
+ export declare const selectCustomer: (state: AppState) => AccountState;
59
60
  export declare const accountReducer: import("redux").Reducer<AccountState, AnyAction>;
@@ -279,4 +279,5 @@ const accountSlice = createSlice({
279
279
  });
280
280
  export const { resetCustomer, resetLoginError, fulfillLoginCustomer } = accountSlice.actions;
281
281
  export const selectToken = (state) => state.customer.account.auth ? state.customer.account.auth.access_token : null;
282
+ export const selectCustomer = (state) => state.customer.account;
282
283
  export const accountReducer = accountSlice.reducer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/cloud",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our cloud-based Order API.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",