@archbase/data 3.0.0 → 3.0.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/LICENSE +21 -0
- package/README.md +12 -4
- package/dist/datasource/ArchbaseRemoteDataSource.d.ts +1 -1
- package/dist/datasource/ArchbaseV1V2CompatibilityPattern.d.ts +2 -10
- package/dist/datasource/v2/ArchbaseQueryIntegration.d.ts +0 -7
- package/dist/datasource/v2/ArchbaseQueryProvider.d.ts +2 -7
- package/dist/datasource/v2/ArchbaseTanStackQueryIntegration.d.ts +0 -6
- package/dist/hooks/useArchbaseDataSourceListener.d.ts +2 -2
- package/dist/hooks/useArchbaseRemoteFilterDataSource.d.ts +1 -1
- package/dist/hooks/useArchbaseRemoteServiceApi.d.ts +1 -1
- package/dist/service/ArchbaseRemoteApiService.d.ts +0 -1
- package/package.json +19 -18
- package/dist/archbase-data-3.0.0.tgz +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Edson Martins
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -6,6 +6,10 @@ Data management layer for Archbase React v3 - DataSource, hooks, and API service
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npm install @archbase/data @archbase/core
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @archbase/data @archbase/core
|
|
11
|
+
# or
|
|
12
|
+
yarn add @archbase/data @archbase/core
|
|
9
13
|
```
|
|
10
14
|
|
|
11
15
|
## Features
|
|
@@ -23,9 +27,9 @@ npm install @archbase/data @archbase/core
|
|
|
23
27
|
### DataSource v2 (TanStack Query)
|
|
24
28
|
|
|
25
29
|
```typescript
|
|
26
|
-
import {
|
|
30
|
+
import {
|
|
27
31
|
useArchbaseRemoteDataSourceV2,
|
|
28
|
-
ArchbaseDataSourceProvider
|
|
32
|
+
ArchbaseDataSourceProvider
|
|
29
33
|
} from '@archbase/data';
|
|
30
34
|
|
|
31
35
|
// Remote data source with TanStack Query
|
|
@@ -52,6 +56,10 @@ const dataSource = useArchbaseLocalDataSource({
|
|
|
52
56
|
});
|
|
53
57
|
```
|
|
54
58
|
|
|
55
|
-
##
|
|
59
|
+
## License
|
|
56
60
|
|
|
57
|
-
|
|
61
|
+
MIT © Edson Martins
|
|
62
|
+
|
|
63
|
+
## Documentation
|
|
64
|
+
|
|
65
|
+
For full documentation, visit [https://react.archbase.dev](https://react.archbase.dev)
|
|
@@ -12,6 +12,6 @@ export declare class ArchbaseRemoteDataSource<T, ID> extends ArchbaseDataSource<
|
|
|
12
12
|
applyRemoteFilter(filter: ArchbaseQueryFilter, page: number, _callback?: (() => void) | undefined): any;
|
|
13
13
|
protected getDataWithFilter(currentFilter: ArchbaseQueryFilter, page: number): Promise<any>;
|
|
14
14
|
protected getDataWithoutFilter(page: number): any;
|
|
15
|
-
protected getDataWithQuickFilter(currentFilter: ArchbaseQueryFilter, page: number): Promise<import(
|
|
15
|
+
protected getDataWithQuickFilter(currentFilter: ArchbaseQueryFilter, page: number): Promise<import('..').Page<T>>;
|
|
16
16
|
protected getSortFields(currentFilter: ArchbaseQueryFilter): any;
|
|
17
17
|
}
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Padrão de Compatibilidade V1/V2 para Componentes DataSource
|
|
3
|
-
*
|
|
4
|
-
* Este arquivo define o padrão obrigatório que TODOS os componentes
|
|
5
|
-
* devem seguir para garantir compatibilidade entre V1 e V2.
|
|
6
|
-
*
|
|
7
|
-
* Baseado na implementação bem-sucedida do ArchbaseEdit.
|
|
8
|
-
*/
|
|
9
1
|
import { DataSourceEvent } from './ArchbaseDataSource';
|
|
10
2
|
/**
|
|
11
3
|
* Hook obrigatório para compatibilidade V1/V2
|
|
@@ -18,12 +10,12 @@ export declare function useArchbaseV1V2Compatibility<T>(componentName: string, d
|
|
|
18
10
|
currentValue: T;
|
|
19
11
|
v1State: {
|
|
20
12
|
currentValue: T;
|
|
21
|
-
setCurrentValue: import(
|
|
13
|
+
setCurrentValue: import('react').Dispatch<import('react').SetStateAction<T>>;
|
|
22
14
|
forceUpdate: () => void;
|
|
23
15
|
};
|
|
24
16
|
v2State: {
|
|
25
17
|
v2Value: T;
|
|
26
|
-
setV2Value: import(
|
|
18
|
+
setV2Value: import('react').Dispatch<import('react').SetStateAction<T>>;
|
|
27
19
|
v2ShouldUpdate: number;
|
|
28
20
|
};
|
|
29
21
|
loadDataSourceFieldValue: () => void;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Preparação para integração com TanStack Query
|
|
3
|
-
*
|
|
4
|
-
* Este arquivo define as estruturas e tipos necessários para integrar
|
|
5
|
-
* o ArchbaseDataSourceV2 com TanStack Query para gerenciamento avançado
|
|
6
|
-
* de cache e sincronização de dados remotos.
|
|
7
|
-
*/
|
|
8
1
|
import { ArchbaseRemoteDataSourceV2Config } from './ArchbaseRemoteDataSourceV2';
|
|
9
2
|
import { ArchbaseRemoteApiService } from '../../service/ArchbaseRemoteApiService';
|
|
10
3
|
/**
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* ArchbaseQueryProvider - TanStack Query Provider for Archbase React
|
|
3
|
-
*
|
|
4
|
-
* This provider sets up TanStack Query with optimized defaults for Archbase DataSources
|
|
5
|
-
*/
|
|
6
|
-
import React, { ReactNode } from 'react';
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
7
2
|
import { QueryClient } from '@tanstack/react-query';
|
|
8
3
|
/**
|
|
9
4
|
* Configuration for ArchbaseQueryProvider
|
|
@@ -55,7 +50,7 @@ export declare function useArchbaseQueryStates(): {
|
|
|
55
50
|
stale: number;
|
|
56
51
|
fresh: number;
|
|
57
52
|
};
|
|
58
|
-
queries: import(
|
|
53
|
+
queries: import('@tanstack/query-core').Query<unknown, Error, unknown, readonly unknown[]>[];
|
|
59
54
|
invalidateAll: () => Promise<void>;
|
|
60
55
|
clearAll: () => void;
|
|
61
56
|
refetchAll: () => Promise<void>;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TanStack Query Integration for ArchbaseRemoteDataSourceV2
|
|
3
|
-
*
|
|
4
|
-
* This module provides integration between ArchbaseRemoteDataSourceV2 and TanStack Query
|
|
5
|
-
* for advanced caching, synchronization, and offline capabilities.
|
|
6
|
-
*/
|
|
7
1
|
import { QueryClient } from '@tanstack/react-query';
|
|
8
2
|
import { ArchbaseRemoteDataSourceV2 } from './ArchbaseRemoteDataSourceV2';
|
|
9
3
|
import { ArchbaseRemoteApiService } from '../../service/ArchbaseRemoteApiService';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { DataSourceEvent } from '../datasource/ArchbaseDataSource';
|
|
2
|
+
import { IArchbaseDataSourceBase } from '../datasource/IArchbaseDataSourceBase';
|
|
3
3
|
export type UseArchbaseDataSourceListenerProps<T, ID = any> = {
|
|
4
4
|
dataSource: IArchbaseDataSourceBase<T>;
|
|
5
5
|
listener: (event: DataSourceEvent<T>) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ArchbaseRemoteApiService, Page } from '../service';
|
|
2
2
|
import { ArchbaseRemoteFilterDataSource, RemoteFilter } from '../datasource';
|
|
3
3
|
import { ArchbaseStateValues } from '../types';
|
|
4
4
|
import { IDataSourceValidator } from '../datasource/ArchbaseDataSource';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { interfaces } from 'inversify';
|
|
2
2
|
export declare function useArchbaseRemoteServiceApi<T>(apiId: interfaces.ServiceIdentifier<T>): T;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@archbase/data",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "Data management layer for Archbase React v3 - DataSource, hooks, and API services",
|
|
5
5
|
"author": "Edson Martins <edsonmartins2005@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,41 +20,42 @@
|
|
|
20
20
|
"README.md"
|
|
21
21
|
],
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"
|
|
24
|
-
"react
|
|
25
|
-
"
|
|
23
|
+
"@mantine/core": "8.3.12",
|
|
24
|
+
"react": "^18.3.0 || ^19.2.0",
|
|
25
|
+
"react-dom": "^18.3.0 || ^19.2.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
+
"@archbase/core": "3.0.3",
|
|
28
29
|
"@tanstack/react-query": "^5.81.5",
|
|
29
30
|
"axios": "^1.7.2",
|
|
30
|
-
"zustand": "^5.0.6",
|
|
31
|
-
"immer": "^10.1.1",
|
|
32
|
-
"rxjs": "^7.8.2",
|
|
33
|
-
"react-tracked": "^2.0.1",
|
|
34
|
-
"inversify": "^6.0.3",
|
|
35
|
-
"inversify-react": "^1.1.0",
|
|
36
31
|
"date-fns": "^2.30.0",
|
|
37
32
|
"events": "^3.3.0",
|
|
38
33
|
"i18next": "^23.10.0",
|
|
34
|
+
"immer": "^10.1.1",
|
|
35
|
+
"inversify": "^6.0.3",
|
|
36
|
+
"inversify-react": "^1.1.0",
|
|
39
37
|
"lodash": "^4.17.21",
|
|
38
|
+
"react-tracked": "^2.0.1",
|
|
40
39
|
"reflect-metadata": "^0.2.2",
|
|
41
|
-
"
|
|
40
|
+
"rxjs": "^7.8.2",
|
|
41
|
+
"zustand": "^5.0.6"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@
|
|
44
|
+
"@mantine/hooks": "8.3.12",
|
|
45
|
+
"@testing-library/react": "^16.3.0",
|
|
46
|
+
"@types/react": "^19.0.6",
|
|
45
47
|
"@types/react-dom": "^19.0.2",
|
|
46
48
|
"@vitejs/plugin-react": "^4.3.4",
|
|
47
|
-
"react": "^19.
|
|
48
|
-
"react-dom": "^19.
|
|
49
|
+
"react": "^19.2.3",
|
|
50
|
+
"react-dom": "^19.2.3",
|
|
49
51
|
"typescript": "~5.7.2",
|
|
50
52
|
"vite": "^6.0.3",
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"@testing-library/react": "^16.3.0"
|
|
53
|
+
"vite-plugin-dts": "^4.5.4",
|
|
54
|
+
"vitest": "^2.1.8"
|
|
54
55
|
},
|
|
55
56
|
"scripts": {
|
|
56
57
|
"dev": "NODE_OPTIONS=\"--max-old-space-size=8192\" vite build --watch",
|
|
57
|
-
"build": "rm -rf dist && NODE_OPTIONS=\"--max-old-space-size=8192\" vite build
|
|
58
|
+
"build": "rm -rf dist && NODE_OPTIONS=\"--max-old-space-size=8192\" vite build",
|
|
58
59
|
"test": "vitest run",
|
|
59
60
|
"test:watch": "vitest",
|
|
60
61
|
"test:coverage": "vitest run --coverage",
|
|
Binary file
|