@venizia/ardor-admin 0.4.8-2 → 0.4.8-3
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 +1 -1
- package/dist/common/types.d.ts +6 -3
- package/dist/hooks/use-document-title.d.ts +1 -0
- package/dist/hooks/use-request-header-locale.d.ts +1 -0
- package/dist/providers/list-filter.d.ts +0 -2
- package/dist/providers/list-filter.js +1 -1
- package/dist/providers/rest-data.d.ts +2 -2
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ The [react-admin](https://marmelab.com/react-admin/) adapter of
|
|
|
4
4
|
[ARDOR](https://github.com/VENIZIA-AI/ardor): every place the framework touches `ra-core`.
|
|
5
5
|
|
|
6
6
|
```bash
|
|
7
|
-
bun add @venizia/ardor-admin @venizia/ardor-kernel @venizia/ardor-react @venizia/ignis-inversion @venizia/ignis-filter @venizia/ignis-kernel @venizia/ignis-helpers reflect-metadata ra-core ra-i18n-polyglot
|
|
7
|
+
bun add @venizia/ardor-admin @venizia/ardor-kernel @venizia/ardor-react @venizia/ignis-inversion @venizia/ignis-filter @venizia/ignis-kernel @venizia/ignis-helpers reflect-metadata ra-core ra-i18n-polyglot react react-dom react-redux react-router-dom @reduxjs/toolkit @tanstack/react-query
|
|
8
8
|
```
|
|
9
9
|
|
|
10
10
|
Most applications install [`@venizia/ardor`](https://www.npmjs.com/package/@venizia/ardor) instead,
|
package/dist/common/types.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { TExtraRequest } from '@venizia/ignis-kernel/repository';
|
|
|
5
5
|
import type { AuthProvider, CoreAdminProps, DataProvider, Locale, ResourceProps } from 'ra-core';
|
|
6
6
|
import type { ReactNode } from 'react';
|
|
7
7
|
import type { RouteProps } from 'react-router-dom';
|
|
8
|
-
import type { DefaultNetworkRequestService, IDataSourceAuth,
|
|
8
|
+
import type { DefaultNetworkRequestService, IDataSourceAuth, INetworkResponse, ISendParams, RequestCountData, TConstValue, TRequestMethod, TRequestType } from '@venizia/ardor-kernel';
|
|
9
9
|
import type { TFeature } from '../features/feature.js';
|
|
10
10
|
/** What `DefaultRestDataProvider.request` sends: every react-admin method goes through it. */
|
|
11
11
|
export interface IRestRequestOptions<TResource extends string = string> {
|
|
@@ -37,12 +37,13 @@ export interface IRestRequestOptions<TResource extends string = string> {
|
|
|
37
37
|
}
|
|
38
38
|
/** The nine data methods of react-admin, as ra-core declares them. */
|
|
39
39
|
export type IReactAdminDataProvider<TResource extends string = string> = Pick<DataProvider<TResource>, 'getList' | 'getOne' | 'getMany' | 'getManyReference' | 'update' | 'updateMany' | 'create' | 'delete' | 'deleteMany'>;
|
|
40
|
+
/** react-admin's data provider with a free-form `send` and access to the network service and its auth. */
|
|
40
41
|
export interface IDataProvider<TResource extends string = string> extends IReactAdminDataProvider<TResource> {
|
|
41
42
|
/** A request outside react-admin's methods: the same headers and auth, the method and body of `params`. */
|
|
42
43
|
send: <TResult = unknown>(opts: {
|
|
43
44
|
resource: TResource;
|
|
44
45
|
params: ISendParams;
|
|
45
|
-
}) => Promise<
|
|
46
|
+
}) => Promise<INetworkResponse<TResult>>;
|
|
46
47
|
/** The network service every request goes through. */
|
|
47
48
|
getNetworkService(): DefaultNetworkRequestService;
|
|
48
49
|
/** Spread into an `HttpDataSource`: the repository then sends what this provider sends. */
|
|
@@ -60,6 +61,7 @@ export interface IAuthRejection {
|
|
|
60
61
|
logoutUser?: boolean;
|
|
61
62
|
message?: string | false;
|
|
62
63
|
}
|
|
64
|
+
/** The auth provider of an ARDOR application: react-admin's methods, the user's roles and a token refresh. */
|
|
63
65
|
export interface IAuthProvider extends IReactAdminAuthProvider {
|
|
64
66
|
/** The roles of the signed-in user. */
|
|
65
67
|
getRoles: (params?: unknown) => Promise<Set<string>>;
|
|
@@ -72,6 +74,7 @@ export interface IAuthProvider extends IReactAdminAuthProvider {
|
|
|
72
74
|
* is the messages). A loader that fails leaves that locale on the English messages.
|
|
73
75
|
*/
|
|
74
76
|
export type TI18nSource = object | (() => Promise<object>);
|
|
77
|
+
/** What `DefaultI18nProvider` is built from: the message sources and the languages on offer. */
|
|
75
78
|
export interface II18nProviderOptions {
|
|
76
79
|
/**
|
|
77
80
|
* Messages by locale: the application's own over the features', English for a locale with no source or whose loader failed.
|
|
@@ -89,7 +92,7 @@ export interface IApplication extends Omit<CoreAdminProps, 'children'> {
|
|
|
89
92
|
/** The container the providers and the features are resolved from. */
|
|
90
93
|
container: Container;
|
|
91
94
|
/**
|
|
92
|
-
* The logger `useApplicationLogger()` returns. Absent, a console logger named
|
|
95
|
+
* The logger `useApplicationLogger()` returns. Absent, a console logger named `ArdorApplication`
|
|
93
96
|
* (IGNIS's, so a provider registered with `LoggerFactory.use` is the one behind it).
|
|
94
97
|
*/
|
|
95
98
|
logger?: ILogger;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
type TDocumentTitleSegment = string | false | null | undefined;
|
|
2
|
+
/** What `useDocumentTitle` writes into the tab title, and when. */
|
|
2
3
|
export interface IUseDocumentTitleOptions {
|
|
3
4
|
/** The screen title, or a list of segments in order; `false`, `null`, `undefined` and empty segments are dropped. */
|
|
4
5
|
title: TDocumentTitleSegment | Array<TDocumentTitleSegment>;
|
|
@@ -9,8 +9,6 @@ export interface IListFilter {
|
|
|
9
9
|
limit?: number;
|
|
10
10
|
/** IGNIS's offset; `ListFilterBuilder.build` sets this one. */
|
|
11
11
|
skip?: number;
|
|
12
|
-
/** An alias of `skip`. */
|
|
13
|
-
offset?: number;
|
|
14
12
|
include?: unknown;
|
|
15
13
|
fields?: unknown;
|
|
16
14
|
/** Not part of the filter sent: `ListFilterBuilder.build` moves it into the query string. */
|
|
@@ -37,7 +37,7 @@ export class ListFilterBuilder {
|
|
|
37
37
|
}
|
|
38
38
|
else {
|
|
39
39
|
const { page = 1, perPage = 0 } = pagination ?? {};
|
|
40
|
-
// No `perPage` is no limit. `skip` is IGNIS's offset
|
|
40
|
+
// No `perPage` is no limit. `skip` is IGNIS's offset.
|
|
41
41
|
if (perPage > 0) {
|
|
42
42
|
filter['limit'] = perPage;
|
|
43
43
|
filter['skip'] = (Math.max(page, 1) - 1) * perPage;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Container } from '@venizia/ignis-inversion';
|
|
2
2
|
import type { CreateParams, CreateResult, DeleteManyParams, DeleteManyResult, DeleteParams, DeleteResult, GetListParams, GetListResult, GetManyParams, GetManyReferenceParams, GetManyReferenceResult, GetManyResult, GetOneParams, GetOneResult, Identifier, QueryFunctionContext, RaRecord, UpdateManyParams, UpdateManyResult, UpdateParams, UpdateResult } from 'ra-core';
|
|
3
|
-
import { BaseProvider, DefaultNetworkRequestService, type IApplicationInfo, type INetworkResponse, type ICustomParams, type IRestDataProviderOptions, type ISendParams, type
|
|
3
|
+
import { BaseProvider, DefaultNetworkRequestService, type IApplicationInfo, type INetworkResponse, type ICustomParams, type IRestDataProviderOptions, type ISendParams, type TRequestType } from '@venizia/ardor-kernel';
|
|
4
4
|
import type { TExtraRequest } from '@venizia/ignis-kernel/repository';
|
|
5
5
|
import type { IDataProvider, IRestRequestOptions } from '../common/index.js';
|
|
6
6
|
import { type IListFilter } from './list-filter.js';
|
|
@@ -172,7 +172,7 @@ export declare class DefaultRestDataProvider<TResource extends string = string>
|
|
|
172
172
|
send<TResult = unknown>(opts: {
|
|
173
173
|
resource: TResource;
|
|
174
174
|
params: ISendParams;
|
|
175
|
-
}): Promise<
|
|
175
|
+
}): Promise<INetworkResponse<TResult>>;
|
|
176
176
|
/**
|
|
177
177
|
* react-admin's data provider contract takes positional arguments, `(resource, params)`: the one
|
|
178
178
|
* place this class does not take an `opts` object. Each method hands them to the `opts` method.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venizia/ardor-admin",
|
|
3
|
-
"version": "0.4.8-
|
|
3
|
+
"version": "0.4.8-3",
|
|
4
4
|
"description": "ARDOR react-admin adapter - the REST data provider, auth provider and i18n provider wired through IGNIS inversion, the ArdorApplication root component, the translate and notify hooks, and the English and Vietnamese message bundles.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"admin",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"prepublishOnly": "make rebuild"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@venizia/ardor-kernel": "0.4.8-
|
|
65
|
-
"@venizia/ardor-react": "0.4.8-
|
|
64
|
+
"@venizia/ardor-kernel": "0.4.8-3",
|
|
65
|
+
"@venizia/ardor-react": "0.4.8-3"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@happy-dom/global-registrator": "^21.0.4",
|
|
@@ -72,11 +72,11 @@
|
|
|
72
72
|
"@testing-library/react": "^16.3.3",
|
|
73
73
|
"@types/bun": "^1.4.3",
|
|
74
74
|
"@types/react": "^19",
|
|
75
|
-
"@venizia/dev-configs": "^0.4.8-
|
|
76
|
-
"@venizia/ignis-filter": "^0.4.7-
|
|
77
|
-
"@venizia/ignis-helpers": "^0.4.8-
|
|
78
|
-
"@venizia/ignis-inversion": "^0.4.7-
|
|
79
|
-
"@venizia/ignis-kernel": "^0.4.8-
|
|
75
|
+
"@venizia/dev-configs": "^0.4.8-2",
|
|
76
|
+
"@venizia/ignis-filter": "^0.4.7-2",
|
|
77
|
+
"@venizia/ignis-helpers": "^0.4.8-2",
|
|
78
|
+
"@venizia/ignis-inversion": "^0.4.7-2",
|
|
79
|
+
"@venizia/ignis-kernel": "^0.4.8-2",
|
|
80
80
|
"eslint": "^10.13.0",
|
|
81
81
|
"oxlint": "1.89.0",
|
|
82
82
|
"oxlint-tsgolint": "7.0.2004",
|
|
@@ -94,10 +94,10 @@
|
|
|
94
94
|
"peerDependencies": {
|
|
95
95
|
"@reduxjs/toolkit": ">=2.13.0",
|
|
96
96
|
"@tanstack/react-query": ">=5.104.5",
|
|
97
|
-
"@venizia/ignis-filter": "^0.4.7-
|
|
98
|
-
"@venizia/ignis-helpers": "^0.4.8-
|
|
99
|
-
"@venizia/ignis-inversion": "^0.4.7-
|
|
100
|
-
"@venizia/ignis-kernel": "^0.4.8-
|
|
97
|
+
"@venizia/ignis-filter": "^0.4.7-2",
|
|
98
|
+
"@venizia/ignis-helpers": "^0.4.8-2",
|
|
99
|
+
"@venizia/ignis-inversion": "^0.4.7-2",
|
|
100
|
+
"@venizia/ignis-kernel": "^0.4.8-2",
|
|
101
101
|
"ra-core": ">=5.15.5",
|
|
102
102
|
"ra-i18n-polyglot": ">=5.15.5",
|
|
103
103
|
"react": ">=19.3.1",
|