@hortiview/modulebase 0.0.1 → 0.0.17-beta
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 +8 -8
- package/dist/ModuleCore-YCIFN_02.js +14973 -0
- package/dist/QueryClientProvider-Beog9TR7.js +437 -0
- package/dist/{_baseGet-Bh5zJ_C8.js → _baseGet-C6jMXSsQ.js} +448 -448
- package/dist/api-s6E2GJtu.js +458 -0
- package/dist/assets/ModuleCore.css +1 -0
- package/dist/chunk-QMGIS6GS-C4bgXQXY.js +9203 -0
- package/dist/components/ModuleBase.js +20 -681
- package/dist/components/ModuleCore.js +10 -0
- package/dist/hooks/useBreadcrumbTranslation.js +16 -13
- package/dist/hooks/useCustom.js +15 -15
- package/dist/hooks/useCustomMutation.js +23 -0
- package/dist/hooks/useEntity.js +53 -54
- package/dist/hooks/useOffline.js +45 -0
- package/dist/hooks/useOption.js +19 -17
- package/dist/hooks/useServiceBus.js +25 -0
- package/dist/hooks/useStores.js +11 -841
- package/dist/isRestoring-CLuxJVSA.js +281 -0
- package/dist/lib/components/ModuleBase.d.ts +36 -0
- package/dist/lib/components/ModuleCore.d.ts +32 -0
- package/dist/{constants.d.ts → lib/constants.d.ts} +1 -1
- package/dist/{hooks → lib/hooks}/useBreadcrumbTranslation.d.ts +1 -1
- package/dist/lib/hooks/useCustom.d.ts +8 -0
- package/dist/lib/hooks/useCustomMutation.d.ts +9 -0
- package/dist/{hooks → lib/hooks}/useEntity.d.ts +6 -30
- package/dist/lib/hooks/useOffline.d.ts +15 -0
- package/dist/{hooks → lib/hooks}/useOption.d.ts +1 -1
- package/dist/lib/hooks/useServiceBus.d.ts +19 -0
- package/dist/lib/hooks/useStores.d.ts +38 -0
- package/dist/lib/main.d.ts +27 -0
- package/dist/lib/module-router.d.ts +7 -0
- package/dist/{stores → lib/stores}/EnvironmentStore.d.ts +1 -1
- package/dist/lib/types/ActionStorage.d.ts +16 -0
- package/dist/{types → lib/types}/BaseProps.d.ts +14 -2
- package/dist/{types → lib/types}/Deprecated.d.ts +7 -1
- package/dist/lib/types/Entities.d.ts +22 -0
- package/dist/{types → lib/types}/Environment.d.ts +3 -2
- package/dist/lib/types/EnvironmentVariable.d.ts +6 -0
- package/dist/lib/types/ModuleApi.d.ts +163 -0
- package/dist/{types → lib/types}/Requests.d.ts +6 -11
- package/dist/lib/types/ServiceBus.d.ts +17 -0
- package/dist/{utils/fetches.d.ts → lib/utils/api.d.ts} +2 -8
- package/dist/lib/utils/baseFetches.d.ts +19 -0
- package/dist/lib/utils/fetches.d.ts +43 -0
- package/dist/lib/utils/helper.d.ts +29 -0
- package/dist/main.js +224 -17
- package/dist/module-router.js +137 -0
- package/dist/mutation-DSKlaYzY.js +192 -0
- package/dist/omit-C9Qe80rl.js +835 -0
- package/dist/stores/EnvironmentStore.js +9 -3
- package/dist/types/ActionStorage.js +4 -0
- package/dist/types/Entities.js +25 -0
- package/dist/types/EnvironmentVariable.js +1 -0
- package/dist/types/Requests.js +1 -4
- package/dist/types/ServiceBus.js +1 -0
- package/dist/useMutation-zu8uxBak.js +97 -0
- package/dist/{useQuery-znAyMQW1.js → useQuery-Bj9k9zik.js} +106 -108
- package/dist/utils/api.js +9 -0
- package/dist/utils/baseFetches.js +19 -0
- package/dist/utils/fetches.js +20 -14
- package/dist/utils/helper.js +55 -0
- package/dist/utils-DxRR_XLb.js +9 -0
- package/package.json +8 -3
- package/dist/QueryClientProvider-DQv4Y3Qu.js +0 -707
- package/dist/chunk-IR6S3I6Y-BvQXS3A3.js +0 -3908
- package/dist/components/ModuleBase.d.ts +0 -11
- package/dist/fetches-DUCQo_6B.js +0 -477
- package/dist/hooks/useCustom.d.ts +0 -6
- package/dist/hooks/useNavigate.d.ts +0 -5
- package/dist/hooks/useNavigate.js +0 -27
- package/dist/hooks/useStores.d.ts +0 -29
- package/dist/main.d.ts +0 -9
- package/dist/types/ModuleApi.d.ts +0 -80
- /package/dist/{hooks → lib/hooks}/useSignalRMessages.d.ts +0 -0
- /package/dist/{provider → lib/provider}/SignalR/SignalRProvider.d.ts +0 -0
- /package/dist/{provider → lib/provider}/SignalR/signalR.d.ts +0 -0
- /package/dist/{stores → lib/stores}/BasePropsStore.d.ts +0 -0
- /package/dist/{types → lib/types}/AppInsights.d.ts +0 -0
- /package/dist/{types → lib/types}/CommonOptions.d.ts +0 -0
- /package/dist/{types → lib/types}/SystemMessage.d.ts +0 -0
|
@@ -3,14 +3,15 @@ export interface HortiViewEnvironments {
|
|
|
3
3
|
MODULE_AUTH_API: string;
|
|
4
4
|
API_PREFIX: string;
|
|
5
5
|
ENVIRONMENT: string;
|
|
6
|
+
REQ_VERSION: string;
|
|
6
7
|
[customkey: string]: string;
|
|
7
8
|
}
|
|
8
9
|
export interface CustomWindow extends Window {
|
|
9
10
|
__env__?: HortiViewEnvironments;
|
|
10
11
|
}
|
|
11
|
-
export type Environments = '
|
|
12
|
+
export type Environments = 'SDC-DEV' | 'SDC-TEST' | 'SDC-DEMO' | 'BAYER-TES' | 'BAYER-DEM' | 'BAYER-STAG' | 'BAYER-PROD';
|
|
12
13
|
export type EnvConfig = {
|
|
13
|
-
[key in Environments]
|
|
14
|
+
[key in Environments]?: CustomEnv;
|
|
14
15
|
};
|
|
15
16
|
export type CustomEnv = {
|
|
16
17
|
[key: string]: string;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
export type RegisterOption = {
|
|
2
|
+
moduleId: string;
|
|
3
|
+
registeredEntityName: string;
|
|
4
|
+
id: string;
|
|
5
|
+
};
|
|
6
|
+
export interface ModuleEntity {
|
|
7
|
+
season: Season | undefined;
|
|
8
|
+
blockPlantLayout: BlockPlantLayout | undefined;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* the basic interface for the module apis farm organization entities
|
|
12
|
+
*/
|
|
13
|
+
export interface FarmOrgEntity {
|
|
14
|
+
block: Block | undefined;
|
|
15
|
+
farm: Farm | undefined;
|
|
16
|
+
field: Field | undefined;
|
|
17
|
+
farmOrg: {
|
|
18
|
+
id: string;
|
|
19
|
+
} | undefined;
|
|
20
|
+
irrigationStation: {
|
|
21
|
+
id: string;
|
|
22
|
+
} | undefined;
|
|
23
|
+
farmAlertRule: {
|
|
24
|
+
id: string;
|
|
25
|
+
} | undefined;
|
|
26
|
+
id: string;
|
|
27
|
+
}
|
|
28
|
+
export interface FarmOrganization {
|
|
29
|
+
parentOrganizationId: string | null;
|
|
30
|
+
organizationName: string;
|
|
31
|
+
legalForm: string | null;
|
|
32
|
+
primaryContactId: string;
|
|
33
|
+
secondaryContactId: string | null;
|
|
34
|
+
creatorId: string;
|
|
35
|
+
addressId: string;
|
|
36
|
+
ownerId: string;
|
|
37
|
+
description: string | null;
|
|
38
|
+
address: Address;
|
|
39
|
+
id: string;
|
|
40
|
+
}
|
|
41
|
+
export type Block = {
|
|
42
|
+
id: string;
|
|
43
|
+
fieldId: string;
|
|
44
|
+
blockName?: string;
|
|
45
|
+
shortName?: string;
|
|
46
|
+
area?: number;
|
|
47
|
+
fieldPercentage?: number;
|
|
48
|
+
description?: string;
|
|
49
|
+
length?: number;
|
|
50
|
+
width?: number;
|
|
51
|
+
rows?: number;
|
|
52
|
+
/** Stringyfied Position, only used in BE */
|
|
53
|
+
location?: string;
|
|
54
|
+
/**Position will be transformed from the Location string, only internally used*/
|
|
55
|
+
position?: {
|
|
56
|
+
row: number;
|
|
57
|
+
column: number;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* farm dto (only necessary fields - for now)
|
|
62
|
+
*/
|
|
63
|
+
export interface Farm {
|
|
64
|
+
id: string;
|
|
65
|
+
farmName: string;
|
|
66
|
+
description: string;
|
|
67
|
+
fields: Field[];
|
|
68
|
+
longitude: number;
|
|
69
|
+
latitude: number;
|
|
70
|
+
organizationId: string;
|
|
71
|
+
location: string;
|
|
72
|
+
primaryContactId: string;
|
|
73
|
+
secondaryContactId: string;
|
|
74
|
+
address: Address;
|
|
75
|
+
}
|
|
76
|
+
export interface Field {
|
|
77
|
+
farmId: string;
|
|
78
|
+
name: string;
|
|
79
|
+
description: string;
|
|
80
|
+
fieldTechnologyTypeId: string;
|
|
81
|
+
fieldCoverageTypeId: string;
|
|
82
|
+
fieldShadingTypeId: string;
|
|
83
|
+
fieldSowingTypeId: string;
|
|
84
|
+
fieldSubstrateTypeId: string;
|
|
85
|
+
length: number | null;
|
|
86
|
+
width: number | null;
|
|
87
|
+
rows: number | null;
|
|
88
|
+
location: string;
|
|
89
|
+
area: number;
|
|
90
|
+
tag: string | null;
|
|
91
|
+
fieldTypeId: string;
|
|
92
|
+
id: string;
|
|
93
|
+
}
|
|
94
|
+
export interface Season {
|
|
95
|
+
id: string;
|
|
96
|
+
cropSeasonName: string;
|
|
97
|
+
startDate: Date;
|
|
98
|
+
plantingDate: Date | null;
|
|
99
|
+
cropId: string;
|
|
100
|
+
cropTypeId: string;
|
|
101
|
+
cropVarietyId: string;
|
|
102
|
+
rootstockId: string;
|
|
103
|
+
farmId: string;
|
|
104
|
+
fieldId: string;
|
|
105
|
+
seasonStateId?: string;
|
|
106
|
+
}
|
|
107
|
+
export interface BlockPlantLayout {
|
|
108
|
+
id: string;
|
|
109
|
+
blockId: string;
|
|
110
|
+
arrangementType: string | null;
|
|
111
|
+
offsetPlants: number;
|
|
112
|
+
offsetPlantsUnit: string;
|
|
113
|
+
rowLength: number;
|
|
114
|
+
rowLengthUnit: string;
|
|
115
|
+
offsetRows: number;
|
|
116
|
+
offsetRowsUnit: string;
|
|
117
|
+
numberOfRows: number;
|
|
118
|
+
numberOfPlants: number;
|
|
119
|
+
}
|
|
120
|
+
export interface IrrigationStation {
|
|
121
|
+
irrigationStationName: string;
|
|
122
|
+
farmId: string;
|
|
123
|
+
totalArea: number;
|
|
124
|
+
totalAreaUnit: string;
|
|
125
|
+
flow: number;
|
|
126
|
+
flowUnit: string;
|
|
127
|
+
irrigationZoneFields: IrrigationZoneField[];
|
|
128
|
+
id: string;
|
|
129
|
+
}
|
|
130
|
+
export interface FarmAlertRule {
|
|
131
|
+
farmOrganizationId: string;
|
|
132
|
+
moduleId: string;
|
|
133
|
+
farmId: string;
|
|
134
|
+
description: string;
|
|
135
|
+
descriptionTranslationsAsJson: string;
|
|
136
|
+
raisesNotification: boolean;
|
|
137
|
+
ruleAsJson: string;
|
|
138
|
+
recipients: string[];
|
|
139
|
+
id: string;
|
|
140
|
+
}
|
|
141
|
+
interface IrrigationZoneField {
|
|
142
|
+
fieldId: string;
|
|
143
|
+
irrigationZoneFieldBlocks: IrrigationZoneFieldBlock[];
|
|
144
|
+
id: string;
|
|
145
|
+
}
|
|
146
|
+
interface IrrigationZoneFieldBlock {
|
|
147
|
+
blockId: string;
|
|
148
|
+
id: string;
|
|
149
|
+
}
|
|
150
|
+
interface Address {
|
|
151
|
+
addressLine1: string;
|
|
152
|
+
addressLine2: string | null;
|
|
153
|
+
addressLine3: string | null;
|
|
154
|
+
directions: string | null;
|
|
155
|
+
city: string;
|
|
156
|
+
postalCode: string;
|
|
157
|
+
state: string;
|
|
158
|
+
countryId: string;
|
|
159
|
+
longitude: number;
|
|
160
|
+
latitude: number;
|
|
161
|
+
id: string;
|
|
162
|
+
}
|
|
163
|
+
export {};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Expand, Filter, Select } from 'odata-query';
|
|
2
2
|
export type RequestConfig = {
|
|
3
|
-
redirect:
|
|
4
|
-
credentials:
|
|
3
|
+
redirect: 'follow';
|
|
4
|
+
credentials: 'omit';
|
|
5
5
|
headers: RequestHeader;
|
|
6
|
-
method:
|
|
6
|
+
method: httpMethod;
|
|
7
7
|
body?: string | FormData;
|
|
8
8
|
};
|
|
9
9
|
export type RequestHeader = Headers & {
|
|
10
|
-
|
|
10
|
+
'Content-Type'?: 'application/json';
|
|
11
11
|
orgId?: string;
|
|
12
12
|
Authorization?: string;
|
|
13
13
|
Permission?: string;
|
|
14
|
-
|
|
14
|
+
'Api-Version'?: '1.0' | '2.0';
|
|
15
15
|
languageId?: string;
|
|
16
16
|
};
|
|
17
17
|
export type InternalError = {
|
|
@@ -41,9 +41,4 @@ export type BaseResponse<T> = T | T[] | {
|
|
|
41
41
|
} | {
|
|
42
42
|
items: T | T[];
|
|
43
43
|
};
|
|
44
|
-
|
|
45
|
-
* a universal selector that can be used for all fetches
|
|
46
|
-
* @param data - the data to select from
|
|
47
|
-
* @returns
|
|
48
|
-
*/
|
|
49
|
-
export declare const universalSelector: <T>(data: BaseResponse<T>) => T | T[];
|
|
44
|
+
export type httpMethod = 'POST' | 'PATCH' | 'DELETE' | 'PUT' | 'GET';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type AlertServiceBusMessage = {
|
|
2
|
+
farmOrganizationId: string;
|
|
3
|
+
alertRulesDefinitionId: string;
|
|
4
|
+
farmId: string;
|
|
5
|
+
fieldId: string;
|
|
6
|
+
blockId: string;
|
|
7
|
+
/**
|
|
8
|
+
* needs to be an ID that can be received from the common data/api
|
|
9
|
+
*/
|
|
10
|
+
criteriaId: string;
|
|
11
|
+
moduleId: string;
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
export type ServiceBusMessage = AlertServiceBusMessage & {
|
|
15
|
+
deviceId: '62ac8dbc-45bc-407d-9fb4-8efe9747abe0';
|
|
16
|
+
scope: 'FarmOrgMembers';
|
|
17
|
+
};
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import { BaseResponse, Query, RequestConfig } from '../types/Requests';
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const getModuleDependedEntities: <T>(moduleId: string, entityId: string) => Promise<BaseResponse<T>>;
|
|
4
|
-
export declare const fetchFromCustomApi: <T>(endpoint: string, token?: string) => Promise<BaseResponse<T>>;
|
|
5
|
-
export declare const fetchFromModuleApi: <T>(endpoint: string) => Promise<BaseResponse<T>>;
|
|
6
|
-
export declare const fetchFromCommonApi: <T>(endpoint: string) => Promise<BaseResponse<T>>;
|
|
7
|
-
export declare const baseFetch: <T>(url: string, query: Query, customToken?: string) => Promise<BaseResponse<T>>;
|
|
8
|
-
export declare const getConfig: (token: string, organizationId?: string, languageId?: string, method?: "GET" | "POST" | "PATCH" | "DELETE" | "PUT") => RequestConfig;
|
|
1
|
+
import { BaseResponse, httpMethod, Query, RequestConfig } from '../types/Requests';
|
|
2
|
+
export declare const getConfig: (token?: string, organizationId?: string, languageId?: string, method?: httpMethod, customHeaders?: Headers) => RequestConfig;
|
|
9
3
|
/**
|
|
10
4
|
* a fetch function to handle requests and returns the response. if the response is unauthorized, it tries to refresh the token and retries the request
|
|
11
5
|
* @param url - the complete url build by {@link prependBaseUrl}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseResponse, httpMethod, Query } from '../types/Requests';
|
|
2
|
+
/**
|
|
3
|
+
* a fetch function to handle CUD requests and returns the response.
|
|
4
|
+
* @param url endpoint to fetch (CUD) data from
|
|
5
|
+
* @param data data to send
|
|
6
|
+
* @param method method to use (POST, PUT, DELETE, PATCH)
|
|
7
|
+
* @param customToken token to use (default is the modulePermissionToken)
|
|
8
|
+
* @param headers (optional) custom headers to use
|
|
9
|
+
* @returns Promise<BaseResponse<R>> response from the fetch
|
|
10
|
+
*/
|
|
11
|
+
export declare const baseMutation: <T, R>(url: string, data: T, method: Omit<httpMethod, "GET">, customToken?: string, headers?: Headers, noAuth?: boolean) => Promise<BaseResponse<R>>;
|
|
12
|
+
/**
|
|
13
|
+
* a fetch function to handle GET requests and returns the response.
|
|
14
|
+
* @param url url to GET data from
|
|
15
|
+
* @param query query to use for the GET request
|
|
16
|
+
* @param customToken token to use (default is the modulePermissionToken)
|
|
17
|
+
* @returns Promise<BaseResponse<T>> response from the fetch
|
|
18
|
+
*/
|
|
19
|
+
export declare const baseFetch: <T>(url: string, query: Query, customToken?: string, noAuth?: boolean) => Promise<BaseResponse<T>>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { httpMethod } from '../types/Requests';
|
|
2
|
+
export declare const mutateOnCustomApi: <T, R>(endpoint: string, data: T, method?: Omit<httpMethod, "GET">, token?: string, headers?: Headers, noAuth?: boolean) => Promise<import('../main').BaseResponse<R>>;
|
|
3
|
+
/**
|
|
4
|
+
* a fetch function to get a certain farmorganization entity from the moduleApi (will be used in useEntity)
|
|
5
|
+
* @param moduleId moduleID to get the entity from
|
|
6
|
+
* @param entityId entityID of the entity to get
|
|
7
|
+
* @returns entity to get
|
|
8
|
+
*/
|
|
9
|
+
export declare const getFarmOrgEntities: <T>(moduleId: string, entityId: string) => Promise<import('../main').BaseResponse<T>>;
|
|
10
|
+
/**
|
|
11
|
+
* a fetch function to get a certain MODULEDEPENDED entity from the moduleApi (will be used in useEntity)
|
|
12
|
+
* @param moduleId moduleID to get the entity from
|
|
13
|
+
* @param entityId entityID of the entity to get
|
|
14
|
+
* @returns entity to get
|
|
15
|
+
*/
|
|
16
|
+
export declare const getModuleDependedEntities: <T>(moduleId: string, entityId: string) => Promise<import('../main').BaseResponse<T>>;
|
|
17
|
+
/**
|
|
18
|
+
* a fetch function to get a certain MODULEDEPENDED entity from the moduleApi (will be used in useEntity)
|
|
19
|
+
* the data will be returned in a raw format
|
|
20
|
+
* @param moduleId
|
|
21
|
+
* @param entityId
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
export declare const getModuleDependedEntitiesRaw: <T>(moduleId: string, entityId: string) => Promise<import('../main').BaseResponse<T>>;
|
|
25
|
+
/**
|
|
26
|
+
* a fetch function to handle GET requests and returns the response.
|
|
27
|
+
* @param endpoint custom endpoint to GET data from
|
|
28
|
+
* @param token token to use (default is the modulePermissionToken)
|
|
29
|
+
* @returns Promise<BaseResponse<T>> response from the fetch
|
|
30
|
+
*/
|
|
31
|
+
export declare const fetchFromCustomApi: <T>(endpoint: string, token?: string, noAuth?: boolean) => Promise<import('../main').BaseResponse<T>>;
|
|
32
|
+
/**
|
|
33
|
+
* a fetch function to handle GET requests and returns the response.
|
|
34
|
+
* @param endpoint endpoint of moduleApi to fetch data from
|
|
35
|
+
* @returns Promise<BaseResponse<T>> response from the fetch
|
|
36
|
+
*/
|
|
37
|
+
export declare const fetchFromModuleApi: <T>(endpoint: string) => Promise<import('../main').BaseResponse<T>>;
|
|
38
|
+
/**
|
|
39
|
+
* a fetch function to handle GET requests and returns the response.
|
|
40
|
+
* @param endpoint endpoint of commonApi to fetch data from
|
|
41
|
+
* @returns Promise<BaseResponse<T>> response from the fetch
|
|
42
|
+
*/
|
|
43
|
+
export declare const fetchFromCommonApi: <T>(endpoint: string) => Promise<import('../main').BaseResponse<T>>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BaseProps } from '../main';
|
|
2
|
+
import { EnvConfig, Environments, HortiViewEnvironments } from '../types/Environment';
|
|
3
|
+
import { BaseResponse } from '../types/Requests';
|
|
4
|
+
/**
|
|
5
|
+
* Validates the props and checks if the required props are set
|
|
6
|
+
* @param props props to be validated
|
|
7
|
+
* @param requiredProps props that will be validated/checked if they exist
|
|
8
|
+
*/
|
|
9
|
+
export declare const arePropsValid: (props: BaseProps) => boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Checks if a prop exists and throws an error if it does not
|
|
12
|
+
* @param prop prop to be checked
|
|
13
|
+
* @param props props to be checked against
|
|
14
|
+
*/
|
|
15
|
+
export declare const checkIfPropExists: (prop: keyof BaseProps, props: BaseProps) => boolean;
|
|
16
|
+
/**
|
|
17
|
+
* check if hortiview return the __env__ object correctly
|
|
18
|
+
* @returns the environment variables from the window object
|
|
19
|
+
*/
|
|
20
|
+
export declare const getEnvironmentVariables: () => HortiViewEnvironments | undefined;
|
|
21
|
+
export declare const checkVersion: (environmentVariables?: HortiViewEnvironments) => string | null;
|
|
22
|
+
/**
|
|
23
|
+
* a universal selector that can be used for all fetches
|
|
24
|
+
* @param data - the data to select from
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
export declare const universalSelector: <T>(data: BaseResponse<T>) => T | T[];
|
|
28
|
+
export declare const checkConfig: <T extends EnvConfig>(config: T & Record<Exclude<keyof T, Environments>, never>) => T;
|
|
29
|
+
export declare const getModuleQueryKey: (queryKey: (string | undefined)[]) => (string | undefined)[];
|
package/dist/main.js
CHANGED
|
@@ -1,19 +1,226 @@
|
|
|
1
|
-
import { ModuleBase as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { ModuleBase as A } from "./components/ModuleBase.js";
|
|
2
|
+
import { i as S, h as l, b as m } from "./ModuleCore-YCIFN_02.js";
|
|
3
|
+
import { M as U, Q as C } from "./ModuleCore-YCIFN_02.js";
|
|
4
|
+
import { useBreadcrumbTranslation as b } from "./hooks/useBreadcrumbTranslation.js";
|
|
5
|
+
import { useOffline as k } from "./hooks/useOffline.js";
|
|
6
|
+
import { useSignalRMessages as w } from "./hooks/useSignalRMessages.js";
|
|
7
|
+
import { useNavigate as D } from "./module-router.js";
|
|
8
|
+
import { useBaseProps as L, useConfig as Q } from "./hooks/useStores.js";
|
|
9
|
+
import { useCustom as T } from "./hooks/useCustom.js";
|
|
10
|
+
import { useCustomMutation as K } from "./hooks/useCustomMutation.js";
|
|
11
|
+
import { useEntity as z } from "./hooks/useEntity.js";
|
|
12
|
+
import { useOption as j } from "./hooks/useOption.js";
|
|
13
|
+
import { useNotification as J, useServiceBus as X } from "./hooks/useServiceBus.js";
|
|
14
|
+
import { mutateOnCustomApi as Z } from "./utils/fetches.js";
|
|
15
|
+
import { arePropsValid as ee, checkConfig as ae, checkIfPropExists as se, checkVersion as te, getEnvironmentVariables as re, getModuleQueryKey as oe, universalSelector as ie } from "./utils/helper.js";
|
|
16
|
+
import { Q as d, a as E } from "./useQuery-Bj9k9zik.js";
|
|
17
|
+
import { u as ne } from "./useQuery-Bj9k9zik.js";
|
|
18
|
+
import { u as he } from "./useMutation-zu8uxBak.js";
|
|
19
|
+
import { u as fe } from "./QueryClientProvider-Beog9TR7.js";
|
|
20
|
+
import { A as le, B as me, F as de, H as Ee, I as Pe, a as ge, b as pe, L as Fe, c as Ne, M as xe, d as ve, N as Ae, e as _e, f as Ue, O as Ce, P as ye, R as be, g as Me, h as ke, i as Oe, S as we, j as Be, k as De, l as He, m as Le, D as Qe, n as Ie, E as Te, o as Ve, p as Ke, q as We, r as ze, s as Ge, t as je, u as qe, v as Je, V as Xe, w as Ye, x as Ze, y as $e, z as ea, C as aa, G as sa, J as ta, K as ra, Q as oa, T as ia, U as ua, W as na, X as ca, Y as ha, Z as Sa, _ as fa, $ as Ra, a0 as la, a1 as ma, a2 as da, a3 as Ea, a4 as Pa, a5 as ga, a6 as pa, a7 as Fa, a8 as Na, a9 as xa, aa as va, ab as Aa, ac as _a, ad as Ua, ae as Ca, af as ya, ag as ba, ah as Ma, ai as ka, aj as Oa, ak as wa, al as Ba, am as Da, an as Ha, ao as La, ap as Qa, aq as Ia, ar as Ta, as as Va, at as Ka, au as Wa, av as za, aw as Ga, ax as ja, ay as qa, az as Ja, aA as Xa, aB as Ya, aC as Za, aD as $a, aE as es, aF as as, aG as ss, aH as ts, aI as rs, aJ as os, aK as is, aL as us, aM as ns, aN as cs, aO as hs, aP as Ss, aQ as fs, aR as Rs, aS as ls, aT as ms, aU as ds, aV as Es, aW as Ps, aX as gs, aY as ps, aZ as Fs, a_ as Ns, a$ as xs } from "./chunk-QMGIS6GS-C4bgXQXY.js";
|
|
21
|
+
var P = class extends d {
|
|
22
|
+
constructor(e, a) {
|
|
23
|
+
super(e, a);
|
|
24
|
+
}
|
|
25
|
+
bindMethods() {
|
|
26
|
+
super.bindMethods(), this.fetchNextPage = this.fetchNextPage.bind(this), this.fetchPreviousPage = this.fetchPreviousPage.bind(this);
|
|
27
|
+
}
|
|
28
|
+
setOptions(e, a) {
|
|
29
|
+
super.setOptions(
|
|
30
|
+
{
|
|
31
|
+
...e,
|
|
32
|
+
behavior: S()
|
|
33
|
+
},
|
|
34
|
+
a
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
getOptimisticResult(e) {
|
|
38
|
+
return e.behavior = S(), super.getOptimisticResult(e);
|
|
39
|
+
}
|
|
40
|
+
fetchNextPage(e) {
|
|
41
|
+
return this.fetch({
|
|
42
|
+
...e,
|
|
43
|
+
meta: {
|
|
44
|
+
fetchMore: { direction: "forward" }
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
fetchPreviousPage(e) {
|
|
49
|
+
return this.fetch({
|
|
50
|
+
...e,
|
|
51
|
+
meta: {
|
|
52
|
+
fetchMore: { direction: "backward" }
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
createResult(e, a) {
|
|
57
|
+
const { state: t } = e, r = super.createResult(e, a), { isFetching: o, isRefetching: f, isError: i, isRefetchError: R } = r, s = t.fetchMeta?.fetchMore?.direction, u = i && s === "forward", n = o && s === "forward", c = i && s === "backward", h = o && s === "backward";
|
|
58
|
+
return {
|
|
59
|
+
...r,
|
|
60
|
+
fetchNextPage: this.fetchNextPage,
|
|
61
|
+
fetchPreviousPage: this.fetchPreviousPage,
|
|
62
|
+
hasNextPage: l(a, t.data),
|
|
63
|
+
hasPreviousPage: m(a, t.data),
|
|
64
|
+
isFetchNextPageError: u,
|
|
65
|
+
isFetchingNextPage: n,
|
|
66
|
+
isFetchPreviousPageError: c,
|
|
67
|
+
isFetchingPreviousPage: h,
|
|
68
|
+
isRefetchError: R && !u && !c,
|
|
69
|
+
isRefetching: f && !n && !h
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
function N(e, a) {
|
|
74
|
+
return E(
|
|
75
|
+
e,
|
|
76
|
+
P,
|
|
77
|
+
a
|
|
78
|
+
);
|
|
79
|
+
}
|
|
9
80
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
81
|
+
le as Await,
|
|
82
|
+
me as BrowserRouter,
|
|
83
|
+
de as Form,
|
|
84
|
+
Ee as HashRouter,
|
|
85
|
+
Pe as IDLE_BLOCKER,
|
|
86
|
+
ge as IDLE_FETCHER,
|
|
87
|
+
pe as IDLE_NAVIGATION,
|
|
88
|
+
Fe as Link,
|
|
89
|
+
Ne as Links,
|
|
90
|
+
xe as MemoryRouter,
|
|
91
|
+
ve as Meta,
|
|
92
|
+
A as ModuleBase,
|
|
93
|
+
U as ModuleCore,
|
|
94
|
+
Ae as NavLink,
|
|
95
|
+
_e as Navigate,
|
|
96
|
+
Ue as NavigationType,
|
|
97
|
+
Ce as Outlet,
|
|
98
|
+
ye as PrefetchPageLinks,
|
|
99
|
+
C as QueryClient,
|
|
100
|
+
be as Route,
|
|
101
|
+
Me as Router,
|
|
102
|
+
ke as RouterProvider,
|
|
103
|
+
Oe as Routes,
|
|
104
|
+
we as Scripts,
|
|
105
|
+
Be as ScrollRestoration,
|
|
106
|
+
De as ServerRouter,
|
|
107
|
+
He as StaticRouter,
|
|
108
|
+
Le as StaticRouterProvider,
|
|
109
|
+
Qe as UNSAFE_DataRouterContext,
|
|
110
|
+
Ie as UNSAFE_DataRouterStateContext,
|
|
111
|
+
Te as UNSAFE_ErrorResponseImpl,
|
|
112
|
+
Ve as UNSAFE_FetchersContext,
|
|
113
|
+
Ke as UNSAFE_FrameworkContext,
|
|
114
|
+
We as UNSAFE_LocationContext,
|
|
115
|
+
ze as UNSAFE_NavigationContext,
|
|
116
|
+
Ge as UNSAFE_RemixErrorBoundary,
|
|
117
|
+
je as UNSAFE_RouteContext,
|
|
118
|
+
qe as UNSAFE_ServerMode,
|
|
119
|
+
Je as UNSAFE_SingleFetchRedirectSymbol,
|
|
120
|
+
Xe as UNSAFE_ViewTransitionContext,
|
|
121
|
+
Ye as UNSAFE_createBrowserHistory,
|
|
122
|
+
Ze as UNSAFE_createClientRoutes,
|
|
123
|
+
$e as UNSAFE_createClientRoutesWithHMRRevalidationOptOut,
|
|
124
|
+
ea as UNSAFE_createRouter,
|
|
125
|
+
aa as UNSAFE_decodeViaTurboStream,
|
|
126
|
+
sa as UNSAFE_deserializeErrors,
|
|
127
|
+
ta as UNSAFE_getHydrationData,
|
|
128
|
+
ra as UNSAFE_getPatchRoutesOnNavigationFunction,
|
|
129
|
+
oa as UNSAFE_getTurboStreamSingleFetchDataStrategy,
|
|
130
|
+
ia as UNSAFE_hydrationRouteProperties,
|
|
131
|
+
ua as UNSAFE_invariant,
|
|
132
|
+
na as UNSAFE_mapRouteProperties,
|
|
133
|
+
ca as UNSAFE_shouldHydrateRouteLoader,
|
|
134
|
+
ha as UNSAFE_useFogOFWarDiscovery,
|
|
135
|
+
Sa as UNSAFE_useScrollRestoration,
|
|
136
|
+
fa as UNSAFE_withComponentProps,
|
|
137
|
+
Ra as UNSAFE_withErrorBoundaryProps,
|
|
138
|
+
la as UNSAFE_withHydrateFallbackProps,
|
|
139
|
+
ee as arePropsValid,
|
|
140
|
+
ae as checkConfig,
|
|
141
|
+
se as checkIfPropExists,
|
|
142
|
+
te as checkVersion,
|
|
143
|
+
ma as createBrowserRouter,
|
|
144
|
+
da as createCookie,
|
|
145
|
+
Ea as createCookieSessionStorage,
|
|
146
|
+
Pa as createHashRouter,
|
|
147
|
+
ga as createMemoryRouter,
|
|
148
|
+
pa as createMemorySessionStorage,
|
|
149
|
+
Fa as createPath,
|
|
150
|
+
Na as createRequestHandler,
|
|
151
|
+
xa as createRoutesFromChildren,
|
|
152
|
+
va as createRoutesFromElements,
|
|
153
|
+
Aa as createRoutesStub,
|
|
154
|
+
_a as createSearchParams,
|
|
155
|
+
Ua as createSession,
|
|
156
|
+
Ca as createSessionStorage,
|
|
157
|
+
ya as createStaticHandler,
|
|
158
|
+
ba as createStaticRouter,
|
|
159
|
+
Ma as data,
|
|
160
|
+
ka as generatePath,
|
|
161
|
+
re as getEnvironmentVariables,
|
|
162
|
+
oe as getModuleQueryKey,
|
|
163
|
+
Oa as href,
|
|
164
|
+
wa as isCookie,
|
|
165
|
+
Ba as isRouteErrorResponse,
|
|
166
|
+
Da as isSession,
|
|
167
|
+
Ha as matchPath,
|
|
168
|
+
La as matchRoutes,
|
|
169
|
+
Z as mutateOnCustomApi,
|
|
170
|
+
Qa as parsePath,
|
|
171
|
+
Ia as redirect,
|
|
172
|
+
Ta as redirectDocument,
|
|
173
|
+
Va as renderMatches,
|
|
174
|
+
Ka as replace,
|
|
175
|
+
Wa as resolvePath,
|
|
176
|
+
ie as universalSelector,
|
|
177
|
+
za as unstable_HistoryRouter,
|
|
178
|
+
Ga as unstable_RouterContextProvider,
|
|
179
|
+
ja as unstable_createContext,
|
|
180
|
+
qa as unstable_setDevServerHooks,
|
|
181
|
+
Ja as unstable_usePrompt,
|
|
182
|
+
Xa as useActionData,
|
|
183
|
+
Ya as useAsyncError,
|
|
184
|
+
Za as useAsyncValue,
|
|
185
|
+
L as useBaseProps,
|
|
186
|
+
$a as useBeforeUnload,
|
|
187
|
+
es as useBlocker,
|
|
188
|
+
b as useBreadcrumbTranslation,
|
|
189
|
+
Q as useConfig,
|
|
190
|
+
T as useCustom,
|
|
191
|
+
K as useCustomMutation,
|
|
192
|
+
z as useEntity,
|
|
193
|
+
as as useFetcher,
|
|
194
|
+
ss as useFetchers,
|
|
195
|
+
ts as useFormAction,
|
|
196
|
+
rs as useHref,
|
|
197
|
+
os as useInRouterContext,
|
|
198
|
+
N as useInfiniteQuery,
|
|
199
|
+
is as useLinkClickHandler,
|
|
200
|
+
us as useLoaderData,
|
|
201
|
+
ns as useLocation,
|
|
202
|
+
cs as useMatch,
|
|
203
|
+
hs as useMatches,
|
|
204
|
+
he as useMutation,
|
|
205
|
+
D as useNavigate,
|
|
206
|
+
Ss as useNavigation,
|
|
207
|
+
fs as useNavigationType,
|
|
208
|
+
J as useNotification,
|
|
209
|
+
k as useOffline,
|
|
210
|
+
j as useOption,
|
|
211
|
+
Rs as useOutlet,
|
|
212
|
+
ls as useOutletContext,
|
|
213
|
+
ms as useParams,
|
|
214
|
+
ne as useQuery,
|
|
215
|
+
fe as useQueryClient,
|
|
216
|
+
ds as useResolvedPath,
|
|
217
|
+
Es as useRevalidator,
|
|
218
|
+
Ps as useRouteError,
|
|
219
|
+
gs as useRouteLoaderData,
|
|
220
|
+
ps as useRoutes,
|
|
221
|
+
Fs as useSearchParams,
|
|
222
|
+
X as useServiceBus,
|
|
223
|
+
w as useSignalRMessages,
|
|
224
|
+
Ns as useSubmit,
|
|
225
|
+
xs as useViewTransitionState
|
|
19
226
|
};
|