@minimaltech/ra-core-infra 0.0.1 → 0.0.2-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/README.md +0 -1
- package/dist/base/applications/base.application.d.ts +1 -1
- package/dist/base/providers/base.provider.d.ts +2 -2
- package/dist/base/providers/base.provider.js +1 -1
- package/dist/base/providers/count-rest-data.provider.d.ts +2 -2
- package/dist/base/providers/count-rest-data.provider.js +1 -1
- package/dist/base/providers/default-auth.provider.d.ts +2 -2
- package/dist/base/providers/default-auth.provider.js +2 -2
- package/dist/base/providers/default-i18n.provider.d.ts +1 -1
- package/dist/base/providers/default-i18n.provider.js +1 -1
- package/dist/base/providers/default-rest-data.provider.d.ts +2 -2
- package/dist/base/providers/default-rest-data.provider.js +3 -3
- package/dist/base/services/base-crud.service.d.ts +2 -2
- package/dist/base/services/base-crud.service.js +2 -2
- package/dist/base/services/base-network-request.service.d.ts +1 -1
- package/dist/base/services/base-network-request.service.js +2 -2
- package/dist/base/services/default-auth.service.js +1 -1
- package/dist/base/services/default-network-data.service.d.ts +1 -1
- package/dist/base/services/default-network-data.service.js +2 -2
- package/dist/helpers/logger.helper.js +1 -1
- package/dist/helpers/network.helper.d.ts +1 -1
- package/dist/helpers/network.helper.js +2 -2
- package/dist/ui/components/CoreRaApplication.js +2 -2
- package/dist/ui/context.d.ts +1 -1
- package/dist/ui/hooks/use-application-context.js +1 -1
- package/dist/ui/hooks/use-debounce.js +2 -2
- package/dist/ui/hooks/use-injectable.d.ts +1 -1
- package/dist/ui/hooks/use-injectable.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -95,7 +95,6 @@ declare module '@minimaltech/ra-core-infra' {
|
|
|
95
95
|
|
|
96
96
|
- **Base Applications**: Abstract application classes with DI
|
|
97
97
|
- **Providers**: Data providers, auth providers, i18n providers
|
|
98
|
-
<!-- - **UI Components**: Custom React Admin components -->
|
|
99
98
|
- **Services**: Network services, CRUD services
|
|
100
99
|
- **Utilities**: Helper functions and utilities
|
|
101
100
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BindingTag, Constructor, Context, DynamicValueProviderClass } from '@loopback/context';
|
|
2
|
-
import { ICoreRaApplication, ValueOrPromise } from '
|
|
2
|
+
import { ICoreRaApplication, ValueOrPromise } from '../../common';
|
|
3
3
|
export declare abstract class AbstractRaApplication extends Context implements ICoreRaApplication {
|
|
4
4
|
abstract bindContext(): ValueOrPromise<void>;
|
|
5
5
|
preConfigure(): ValueOrPromise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Provider } from '@loopback/context';
|
|
2
|
-
import { ValueOrPromise } from '
|
|
3
|
-
import { Logger } from '
|
|
2
|
+
import { ValueOrPromise } from '../../common';
|
|
3
|
+
import { Logger } from '../../helpers';
|
|
4
4
|
export declare abstract class BaseProvider<T> implements Provider<T> {
|
|
5
5
|
protected logger: Logger;
|
|
6
6
|
constructor(opts: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RaRecord } from '
|
|
2
|
-
import { AnyType, TRequestMethod, TRequestType } from '
|
|
1
|
+
import { RaRecord } from 'ra-core';
|
|
2
|
+
import { AnyType, TRequestMethod, TRequestType } from '../../common';
|
|
3
3
|
import { DefaultRestDataProvider } from './default-rest-data.provider';
|
|
4
4
|
export declare class CountRestDataProvider<TResource extends string = string> extends DefaultRestDataProvider<TResource> {
|
|
5
5
|
getListHelper<RecordType extends RaRecord = AnyType>(opts: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DefaultAuthService } from '
|
|
2
|
-
import { AnyType, IAuthProvider, IAuthProviderOptions, IDataProvider, ValueOrPromise } from '
|
|
1
|
+
import { DefaultAuthService } from '../../base/services';
|
|
2
|
+
import { AnyType, IAuthProvider, IAuthProviderOptions, IDataProvider, ValueOrPromise } from '../../common';
|
|
3
3
|
import { BaseProvider } from './base.provider';
|
|
4
4
|
export declare class DefaultAuthProvider<TResource extends string = string> extends BaseProvider<IAuthProvider> {
|
|
5
5
|
protected restDataProvider: IDataProvider<TResource>;
|
|
@@ -12,8 +12,8 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
12
12
|
};
|
|
13
13
|
var DefaultAuthProvider_1;
|
|
14
14
|
import { inject } from '@loopback/context';
|
|
15
|
-
import { DefaultAuthService } from '
|
|
16
|
-
import { CoreBindings, RequestMethods, } from '
|
|
15
|
+
import { DefaultAuthService } from '../../base/services';
|
|
16
|
+
import { CoreBindings, RequestMethods, } from '../../common';
|
|
17
17
|
import { BaseProvider } from './base.provider';
|
|
18
18
|
let DefaultAuthProvider = DefaultAuthProvider_1 = class DefaultAuthProvider extends BaseProvider {
|
|
19
19
|
restDataProvider;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { I18nProvider } from 'ra-core';
|
|
2
|
-
import { II18nProviderOptions, ValueOrPromise } from '
|
|
2
|
+
import { II18nProviderOptions, ValueOrPromise } from '../../common';
|
|
3
3
|
import { BaseProvider } from './base.provider';
|
|
4
4
|
export declare class DefaultI18nProvider extends BaseProvider<I18nProvider> {
|
|
5
5
|
protected i18nProviderOptions: II18nProviderOptions;
|
|
@@ -13,7 +13,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
var DefaultI18nProvider_1;
|
|
14
14
|
import { inject } from '@loopback/context';
|
|
15
15
|
import polyglotI18nProvider from 'ra-i18n-polyglot';
|
|
16
|
-
import { CoreBindings, englishMessages, } from '
|
|
16
|
+
import { CoreBindings, englishMessages, } from '../../common';
|
|
17
17
|
import { BaseProvider } from './base.provider';
|
|
18
18
|
const [language] = (navigator?.language || 'en-US').split('-');
|
|
19
19
|
let DefaultI18nProvider = DefaultI18nProvider_1 = class DefaultI18nProvider extends BaseProvider {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CreateParams, CreateResult, DeleteManyParams, DeleteManyResult, DeleteParams, DeleteResult, GetListParams, GetListResult, GetManyParams, GetManyReferenceParams, GetManyReferenceResult, GetManyResult, GetOneParams, GetOneResult, Identifier, QueryFunctionContext, RaRecord, UpdateManyParams, UpdateManyResult, UpdateParams, UpdateResult } from 'ra-core';
|
|
2
|
-
import { DefaultNetworkRequestService } from '
|
|
3
|
-
import { AnyType, ICustomParams, IDataProvider, IRestDataProviderOptions, ISendParams, ISendResponse, TRequestMethod, TRequestType, ValueOrPromise } from '
|
|
2
|
+
import { DefaultNetworkRequestService } from '../../base/services';
|
|
3
|
+
import { AnyType, ICustomParams, IDataProvider, IRestDataProviderOptions, ISendParams, ISendResponse, TRequestMethod, TRequestType, ValueOrPromise } from '../../common';
|
|
4
4
|
import { BaseProvider } from './base.provider';
|
|
5
5
|
export declare class DefaultRestDataProvider<TResource extends string = string> extends BaseProvider<IDataProvider<TResource>> {
|
|
6
6
|
protected restDataProviderOptions: IRestDataProviderOptions;
|
|
@@ -13,9 +13,9 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
var DefaultRestDataProvider_1;
|
|
14
14
|
import { inject } from '@loopback/context';
|
|
15
15
|
import omit from 'lodash/omit';
|
|
16
|
-
import { DefaultNetworkRequestService } from '
|
|
17
|
-
import { CoreBindings, RequestMethods, RequestTypes, } from '
|
|
18
|
-
import { getError } from '
|
|
16
|
+
import { DefaultNetworkRequestService } from '../../base/services';
|
|
17
|
+
import { CoreBindings, RequestMethods, RequestTypes, } from '../../common';
|
|
18
|
+
import { getError } from '../../utilities';
|
|
19
19
|
import { BaseProvider } from './base.provider';
|
|
20
20
|
let DefaultRestDataProvider = DefaultRestDataProvider_1 = class DefaultRestDataProvider extends BaseProvider {
|
|
21
21
|
restDataProviderOptions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Filter, Where } from '@loopback/filter';
|
|
2
|
-
import { EntityRelationType, ICrudService, IDataProvider, IdType } from '
|
|
3
|
-
import { Logger } from '
|
|
2
|
+
import { EntityRelationType, ICrudService, IDataProvider, IdType } from '../../common';
|
|
3
|
+
import { Logger } from '../../helpers';
|
|
4
4
|
export interface ICrudServiceOptions {
|
|
5
5
|
basePath: string;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import isEmpty from 'lodash/isEmpty';
|
|
2
|
-
import { NetworkHelper } from '
|
|
3
|
-
import { getError } from '
|
|
2
|
+
import { NetworkHelper } from '../../helpers';
|
|
3
|
+
import { getError } from '../../utilities';
|
|
4
4
|
export class BaseNetworkRequestService {
|
|
5
5
|
baseUrl;
|
|
6
6
|
networkService;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyType, IGetRequestPropsParams, IGetRequestPropsResult, TRequestMethod, TRequestType } from '
|
|
1
|
+
import { AnyType, IGetRequestPropsParams, IGetRequestPropsResult, TRequestMethod, TRequestType } from '../../common';
|
|
2
2
|
import { BaseNetworkRequestService } from './base-network-request.service';
|
|
3
3
|
export declare class DefaultNetworkRequestService extends BaseNetworkRequestService {
|
|
4
4
|
protected authToken?: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import isEmpty from 'lodash/isEmpty';
|
|
2
|
-
import { App, LocalStorageKeys, RequestBodyTypes, RequestMethods, RequestTypes, } from '
|
|
3
|
-
import { getError } from '
|
|
2
|
+
import { App, LocalStorageKeys, RequestBodyTypes, RequestMethods, RequestTypes, } from '../../common';
|
|
3
|
+
import { getError } from '../../utilities';
|
|
4
4
|
import { BaseNetworkRequestService } from './base-network-request.service';
|
|
5
5
|
export class DefaultNetworkRequestService extends BaseNetworkRequestService {
|
|
6
6
|
authToken;
|
|
@@ -3,8 +3,8 @@ import React from 'react';
|
|
|
3
3
|
import { CoreAdmin, CustomRoutes, Resource } from 'ra-core';
|
|
4
4
|
import { Provider as ReduxProvider } from 'react-redux';
|
|
5
5
|
import { Route } from 'react-router-dom';
|
|
6
|
-
import { CoreBindings } from '
|
|
7
|
-
import { Logger } from '
|
|
6
|
+
import { CoreBindings } from '../../common';
|
|
7
|
+
import { Logger } from '../../helpers';
|
|
8
8
|
import { ApplicationContext } from '../context';
|
|
9
9
|
const Wrapper = ({ applicationName = 'CoreRaApplication', context, reduxStore, suspense, enableDebug = false, children, }) => {
|
|
10
10
|
return (_jsx(ApplicationContext.Provider, { value: {
|
package/dist/ui/context.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { App } from '
|
|
3
|
-
import { isBrowser } from '
|
|
2
|
+
import { App } from '../../common/constants';
|
|
3
|
+
import { isBrowser } from '../../utilities/boolean.utility';
|
|
4
4
|
export const useDebounce = (params) => {
|
|
5
5
|
const { value, delay, disabled } = params;
|
|
6
6
|
const [debouncedValue, setDebouncedValue] = React.useState(value);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context } from '@loopback/context';
|
|
2
|
-
import { CoreBindings, ValueOf } from '
|
|
2
|
+
import { CoreBindings, ValueOf } from '../../common';
|
|
3
3
|
export interface IUseInjectableKeysOverrides {
|
|
4
4
|
}
|
|
5
5
|
export type TUseInjectableKeysDefault = Extract<ValueOf<typeof CoreBindings>, string>;
|
package/package.json
CHANGED