@hortiview/modulebase 0.0.15690 → 0.0.20436
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/dist/ModuleCore-DpwHP0IU.js +14973 -0
- package/dist/{QueryClientProvider-VtJdNkDw.js → QueryClientProvider-Beog9TR7.js} +25 -23
- package/dist/{_baseGet-B7FwMMGI.js → _baseGet-C6jMXSsQ.js} +447 -447
- package/dist/api-CogBuK0n.js +473 -0
- package/dist/components/ModuleBase.js +1 -1
- package/dist/components/ModuleCore.js +9 -14698
- package/dist/constants.js +1 -1
- package/dist/enum/ActionStorage.js +4 -0
- package/dist/hooks/useCustom.js +15 -18
- package/dist/hooks/useCustomMutation.js +12 -11
- package/dist/hooks/useEntity.js +48 -60
- package/dist/hooks/useOffline.js +57 -0
- package/dist/hooks/useOption.js +15 -15
- package/dist/hooks/useServiceBus.js +1 -1
- package/dist/hooks/useStores.js +1 -1
- package/dist/{query-CFoO2uy7.js → isRestoring-CLuxJVSA.js} +21 -17
- package/dist/lib/constants.d.ts +1 -1
- package/dist/lib/enum/ActionStorage.d.ts +7 -0
- package/dist/lib/hooks/useCustom.d.ts +3 -2
- package/dist/lib/hooks/useCustomMutation.d.ts +2 -1
- package/dist/lib/hooks/useEntity.d.ts +9 -23
- package/dist/lib/hooks/useOffline.d.ts +15 -0
- package/dist/lib/hooks/useStores.d.ts +10 -2
- package/dist/lib/main.d.ts +4 -0
- package/dist/lib/types/ActionStorage.d.ts +8 -0
- package/dist/lib/types/BaseProps.d.ts +10 -1
- package/dist/lib/types/CommonOptions.d.ts +2 -1
- package/dist/lib/types/Deprecated.d.ts +4 -0
- package/dist/lib/types/Entities.d.ts +22 -0
- package/dist/lib/utils/IndexedDbService.d.ts +33 -0
- package/dist/lib/utils/api.d.ts +1 -1
- package/dist/lib/utils/baseFetches.d.ts +2 -2
- package/dist/lib/utils/fetches.d.ts +2 -2
- package/dist/lib/utils/helper.d.ts +1 -0
- package/dist/main.js +218 -144
- package/dist/{mutation-CnKIetRs.js → mutation-DSKlaYzY.js} +1 -1
- package/dist/{omit-B7MWDtHq.js → omit-C9Qe80rl.js} +1 -1
- package/dist/types/ActionStorage.js +1 -0
- package/dist/types/CommonOptions.js +1 -1
- package/dist/types/Entities.js +25 -0
- package/dist/{useMutation-Num57Ulc.js → useMutation-zu8uxBak.js} +16 -16
- package/dist/{useQuery-XBGd5Kep.js → useQuery-Bj9k9zik.js} +39 -39
- package/dist/utils/IndexedDbService.js +43 -0
- package/dist/utils/api.js +1 -1
- package/dist/utils/baseFetches.js +15 -15
- package/dist/utils/fetches.js +10 -10
- package/dist/utils/helper.js +25 -20
- package/package.json +7 -3
- package/dist/api-D9Lmqe6S.js +0 -458
|
@@ -42,6 +42,10 @@ export type DeprecatedBaseProps = {
|
|
|
42
42
|
* @deprecated Use `navigateInHortiview` instead
|
|
43
43
|
*/
|
|
44
44
|
navigateTo?: (path: string) => void;
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated modules need to call their own rules directly
|
|
47
|
+
*/
|
|
48
|
+
alertRules?: string;
|
|
45
49
|
};
|
|
46
50
|
/**
|
|
47
51
|
* @deprecated should not be used anymore
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Block, BlockPlantLayout, Farm, FarmAlertRule, FarmOrganization, Field, IrrigationStation, Season } from '../types/ModuleApi';
|
|
2
|
+
export type HortiviewDataAreaGroup = 'FarmOrganization' | 'FarmMember';
|
|
3
|
+
export type ModuleDataAreaGroup = 'ModuleDepended';
|
|
4
|
+
export type FarmOrganizationEntities = 'farms' | 'fields' | 'zones' | 'irrigation_stations' | 'farm_organizations' | 'alert_rules';
|
|
5
|
+
export type FarmMemberEntities = 'farm_members';
|
|
6
|
+
export type ModuleDependendEntities = 'Season' | 'BlockPlantLayout' | (string & {});
|
|
7
|
+
export type HortiviewDataAreaEntity<T extends HortiviewDataAreaGroup | ModuleDataAreaGroup> = T extends 'FarmOrganization' ? FarmOrganizationEntities : T extends 'FarmMember' ? FarmMemberEntities : T extends 'ModuleDepended' ? ModuleDependendEntities : never;
|
|
8
|
+
export type ResultMap<T extends FarmMemberEntities | FarmOrganizationEntities | ModuleDependendEntities> = T extends 'zones' ? Block : T extends 'fields' ? Field : T extends 'farms' ? Farm : T extends 'irrigation_stations' ? IrrigationStation : T extends 'farm_organizations' ? FarmOrganization : T extends 'alert_rules' ? FarmAlertRule : T extends 'Season' ? Season : T extends 'BlockPlantLayout' ? BlockPlantLayout : unknown;
|
|
9
|
+
export declare const FarmOrgEntitiesTypeResultMap: Record<FarmOrganizationEntities, string>;
|
|
10
|
+
export declare const FarmMemberEntitiesTypeResultMap: Record<FarmMemberEntities, string>;
|
|
11
|
+
export declare const ModuleDependedEntityTypeResultMap: Record<ModuleDependendEntities, string>;
|
|
12
|
+
export declare const AllEntitiesTypeResultMap: {
|
|
13
|
+
Season: string;
|
|
14
|
+
BlockPlantLayout: string;
|
|
15
|
+
farm_members: string;
|
|
16
|
+
farms: string;
|
|
17
|
+
fields: string;
|
|
18
|
+
zones: string;
|
|
19
|
+
irrigation_stations: string;
|
|
20
|
+
farm_organizations: string;
|
|
21
|
+
alert_rules: string;
|
|
22
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The interface for the IndexedDb communication object.
|
|
3
|
+
* It is used in the TanstackQuery Persistent Query Provider.
|
|
4
|
+
*
|
|
5
|
+
* @see TanstackQuery {@link https://tanstack.com/query}
|
|
6
|
+
*/
|
|
7
|
+
interface IndexedDbStorage {
|
|
8
|
+
/**
|
|
9
|
+
* the getter takes a key and returns the value behind the key from the IndexedDB
|
|
10
|
+
* @param key
|
|
11
|
+
* @returns a Promise containing the data behind the key or null
|
|
12
|
+
*/
|
|
13
|
+
getItem: (key: string) => Promise<string | undefined | null>;
|
|
14
|
+
/**
|
|
15
|
+
* the setter adds some values to the IndexedDB with the given key as the key in the IndexedDB.
|
|
16
|
+
* @param key
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
setItem: (key: string, value: string) => Promise<unknown>;
|
|
20
|
+
/**
|
|
21
|
+
* the remove fundtion takes a key and deletes the value behind the key from the IndexedDB
|
|
22
|
+
* @param key
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
removeItem: (key: string) => Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* This object is the implementation of the {@link IndexedDbStorage} interface using the idb-keyval package
|
|
29
|
+
*
|
|
30
|
+
* @see idb-keyval {@link https://www.npmjs.com/package/idb-keyval?activeTab=readme}
|
|
31
|
+
*/
|
|
32
|
+
export declare const indexedDbStorage: IndexedDbStorage;
|
|
33
|
+
export {};
|
package/dist/lib/utils/api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseResponse, httpMethod, Query, RequestConfig } from '../types/Requests';
|
|
2
|
-
export declare const getConfig: (token
|
|
2
|
+
export declare const getConfig: (token?: string, organizationId?: string, languageId?: string, method?: httpMethod, customHeaders?: Headers) => RequestConfig;
|
|
3
3
|
/**
|
|
4
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
|
|
5
5
|
* @param url - the complete url build by {@link prependBaseUrl}
|
|
@@ -8,7 +8,7 @@ import { BaseResponse, httpMethod, Query } from '../types/Requests';
|
|
|
8
8
|
* @param headers (optional) custom headers to use
|
|
9
9
|
* @returns Promise<BaseResponse<R>> response from the fetch
|
|
10
10
|
*/
|
|
11
|
-
export declare const baseMutation: <T, R>(url: string, data: T, method: Omit<httpMethod, "GET">, customToken?: string, headers?: Headers) => Promise<BaseResponse<R>>;
|
|
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
12
|
/**
|
|
13
13
|
* a fetch function to handle GET requests and returns the response.
|
|
14
14
|
* @param url url to GET data from
|
|
@@ -16,4 +16,4 @@ export declare const baseMutation: <T, R>(url: string, data: T, method: Omit<htt
|
|
|
16
16
|
* @param customToken token to use (default is the modulePermissionToken)
|
|
17
17
|
* @returns Promise<BaseResponse<T>> response from the fetch
|
|
18
18
|
*/
|
|
19
|
-
export declare const baseFetch: <T>(url: string, query: Query, customToken?: string) => Promise<BaseResponse<T>>;
|
|
19
|
+
export declare const baseFetch: <T>(url: string, query: Query, customToken?: string, noAuth?: boolean) => Promise<BaseResponse<T>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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) => Promise<import('../main').BaseResponse<R>>;
|
|
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
3
|
/**
|
|
4
4
|
* a fetch function to get a certain farmorganization entity from the moduleApi (will be used in useEntity)
|
|
5
5
|
* @param moduleId moduleID to get the entity from
|
|
@@ -28,7 +28,7 @@ export declare const getModuleDependedEntitiesRaw: <T>(moduleId: string, entityI
|
|
|
28
28
|
* @param token token to use (default is the modulePermissionToken)
|
|
29
29
|
* @returns Promise<BaseResponse<T>> response from the fetch
|
|
30
30
|
*/
|
|
31
|
-
export declare const fetchFromCustomApi: <T>(endpoint: string, token?: string) => Promise<import('../main').BaseResponse<T>>;
|
|
31
|
+
export declare const fetchFromCustomApi: <T>(endpoint: string, token?: string, noAuth?: boolean) => Promise<import('../main').BaseResponse<T>>;
|
|
32
32
|
/**
|
|
33
33
|
* a fetch function to handle GET requests and returns the response.
|
|
34
34
|
* @param endpoint endpoint of moduleApi to fetch data from
|
|
@@ -26,3 +26,4 @@ export declare const checkVersion: (environmentVariables?: HortiViewEnvironments
|
|
|
26
26
|
*/
|
|
27
27
|
export declare const universalSelector: <T>(data: BaseResponse<T>) => T | T[];
|
|
28
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,146 +1,220 @@
|
|
|
1
|
-
import { ModuleBase as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
1
|
+
import { ModuleBase as A } from "./components/ModuleBase.js";
|
|
2
|
+
import { i as f, h as m, b as l } from "./ModuleCore-DpwHP0IU.js";
|
|
3
|
+
import { M as C, Q as U } from "./ModuleCore-DpwHP0IU.js";
|
|
4
|
+
import { ActionState as M } from "./enum/ActionStorage.js";
|
|
5
|
+
import { useBreadcrumbTranslation as k } from "./hooks/useBreadcrumbTranslation.js";
|
|
6
|
+
import { useOffline as L } from "./hooks/useOffline.js";
|
|
7
|
+
import { useSignalRMessages as B } from "./hooks/useSignalRMessages.js";
|
|
8
|
+
import { useNavigate as H } from "./module-router.js";
|
|
9
|
+
import { useBaseProps as I, useConfig as T } from "./hooks/useStores.js";
|
|
10
|
+
import { useCustom as K } from "./hooks/useCustom.js";
|
|
11
|
+
import { useCustomMutation as G } from "./hooks/useCustomMutation.js";
|
|
12
|
+
import { useEntity as j } from "./hooks/useEntity.js";
|
|
13
|
+
import { useOption as J } from "./hooks/useOption.js";
|
|
14
|
+
import { useNotification as Y, useServiceBus as Z } from "./hooks/useServiceBus.js";
|
|
15
|
+
import { mutateOnCustomApi as ee } from "./utils/fetches.js";
|
|
16
|
+
import { arePropsValid as se, checkConfig as te, checkIfPropExists as re, checkVersion as oe, getEnvironmentVariables as ie, getModuleQueryKey as ue, universalSelector as ne } from "./utils/helper.js";
|
|
17
|
+
import { Q as g, a as d } from "./useQuery-Bj9k9zik.js";
|
|
18
|
+
import { u as he } from "./useQuery-Bj9k9zik.js";
|
|
19
|
+
import { u as Se } from "./useMutation-zu8uxBak.js";
|
|
20
|
+
import { u as me } from "./QueryClientProvider-Beog9TR7.js";
|
|
21
|
+
import { A as ge, B as de, F as pe, H as Ee, I as Pe, a as Ne, b as Fe, L as xe, c as ve, M as Ae, d as _e, N as Ce, e as Ue, f as ye, O as Me, P as be, R as ke, g as Oe, h as Le, i as we, S as Be, j as De, k as He, l as Qe, m as Ie, D as Te, n as Ve, E as Ke, o as ze, p as Ge, q as We, r as je, s as qe, t as Je, u as Xe, v as Ye, V as Ze, w as $e, x as ea, y as aa, z as sa, C as ta, G as ra, J as oa, K as ia, Q as ua, T as na, U as ca, W as ha, X as fa, Y as Sa, Z as Ra, _ as ma, $ as la, a0 as ga, a1 as da, a2 as pa, a3 as Ea, a4 as Pa, a5 as Na, a6 as Fa, a7 as xa, a8 as va, a9 as Aa, aa as _a, ab as Ca, ac as Ua, ad as ya, ae as Ma, af as ba, ag as ka, ah as Oa, ai as La, aj as wa, ak as Ba, al as Da, am as Ha, an as Qa, ao as Ia, ap as Ta, aq as Va, ar as Ka, as as za, at as Ga, au as Wa, av as ja, aw as qa, ax as Ja, ay as Xa, az as Ya, aA as Za, aB as $a, aC as es, aD as as, aE as ss, aF as ts, aG as rs, aH as os, aI as is, aJ as us, aK as ns, aL as cs, aM as hs, aN as fs, aO as Ss, aP as Rs, aQ as ms, aR as ls, aS as gs, aT as ds } from "./chunk-IR6S3I6Y-BmDdD3SP.js";
|
|
22
|
+
var p = class extends g {
|
|
23
|
+
constructor(e, a) {
|
|
24
|
+
super(e, a);
|
|
25
|
+
}
|
|
26
|
+
bindMethods() {
|
|
27
|
+
super.bindMethods(), this.fetchNextPage = this.fetchNextPage.bind(this), this.fetchPreviousPage = this.fetchPreviousPage.bind(this);
|
|
28
|
+
}
|
|
29
|
+
setOptions(e, a) {
|
|
30
|
+
super.setOptions(
|
|
31
|
+
{
|
|
32
|
+
...e,
|
|
33
|
+
behavior: f()
|
|
34
|
+
},
|
|
35
|
+
a
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
getOptimisticResult(e) {
|
|
39
|
+
return e.behavior = f(), super.getOptimisticResult(e);
|
|
40
|
+
}
|
|
41
|
+
fetchNextPage(e) {
|
|
42
|
+
return this.fetch({
|
|
43
|
+
...e,
|
|
44
|
+
meta: {
|
|
45
|
+
fetchMore: { direction: "forward" }
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
fetchPreviousPage(e) {
|
|
50
|
+
return this.fetch({
|
|
51
|
+
...e,
|
|
52
|
+
meta: {
|
|
53
|
+
fetchMore: { direction: "backward" }
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
createResult(e, a) {
|
|
58
|
+
const { state: t } = e, r = super.createResult(e, a), { isFetching: o, isRefetching: S, 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";
|
|
59
|
+
return {
|
|
60
|
+
...r,
|
|
61
|
+
fetchNextPage: this.fetchNextPage,
|
|
62
|
+
fetchPreviousPage: this.fetchPreviousPage,
|
|
63
|
+
hasNextPage: m(a, t.data),
|
|
64
|
+
hasPreviousPage: l(a, t.data),
|
|
65
|
+
isFetchNextPageError: u,
|
|
66
|
+
isFetchingNextPage: n,
|
|
67
|
+
isFetchPreviousPageError: c,
|
|
68
|
+
isFetchingPreviousPage: h,
|
|
69
|
+
isRefetchError: R && !u && !c,
|
|
70
|
+
isRefetching: S && !n && !h
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
function F(e, a) {
|
|
75
|
+
return d(
|
|
76
|
+
e,
|
|
77
|
+
p,
|
|
78
|
+
a
|
|
79
|
+
);
|
|
80
|
+
}
|
|
15
81
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
ne as
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
82
|
+
M as ActionState,
|
|
83
|
+
ge as Await,
|
|
84
|
+
de as BrowserRouter,
|
|
85
|
+
pe as Form,
|
|
86
|
+
Ee as HashRouter,
|
|
87
|
+
Pe as IDLE_BLOCKER,
|
|
88
|
+
Ne as IDLE_FETCHER,
|
|
89
|
+
Fe as IDLE_NAVIGATION,
|
|
90
|
+
xe as Link,
|
|
91
|
+
ve as Links,
|
|
92
|
+
Ae as MemoryRouter,
|
|
93
|
+
_e as Meta,
|
|
94
|
+
A as ModuleBase,
|
|
95
|
+
C as ModuleCore,
|
|
96
|
+
Ce as NavLink,
|
|
97
|
+
Ue as Navigate,
|
|
98
|
+
ye as NavigationType,
|
|
99
|
+
Me as Outlet,
|
|
100
|
+
be as PrefetchPageLinks,
|
|
101
|
+
U as QueryClient,
|
|
102
|
+
ke as Route,
|
|
103
|
+
Oe as Router,
|
|
104
|
+
Le as RouterProvider,
|
|
105
|
+
we as Routes,
|
|
106
|
+
Be as Scripts,
|
|
107
|
+
De as ScrollRestoration,
|
|
108
|
+
He as ServerRouter,
|
|
109
|
+
Qe as StaticRouter,
|
|
110
|
+
Ie as StaticRouterProvider,
|
|
111
|
+
Te as UNSAFE_DataRouterContext,
|
|
112
|
+
Ve as UNSAFE_DataRouterStateContext,
|
|
113
|
+
Ke as UNSAFE_ErrorResponseImpl,
|
|
114
|
+
ze as UNSAFE_FetchersContext,
|
|
115
|
+
Ge as UNSAFE_FrameworkContext,
|
|
116
|
+
We as UNSAFE_LocationContext,
|
|
117
|
+
je as UNSAFE_NavigationContext,
|
|
118
|
+
qe as UNSAFE_RemixErrorBoundary,
|
|
119
|
+
Je as UNSAFE_RouteContext,
|
|
120
|
+
Xe as UNSAFE_ServerMode,
|
|
121
|
+
Ye as UNSAFE_SingleFetchRedirectSymbol,
|
|
122
|
+
Ze as UNSAFE_ViewTransitionContext,
|
|
123
|
+
$e as UNSAFE_createBrowserHistory,
|
|
124
|
+
ea as UNSAFE_createClientRoutes,
|
|
125
|
+
aa as UNSAFE_createClientRoutesWithHMRRevalidationOptOut,
|
|
126
|
+
sa as UNSAFE_createRouter,
|
|
127
|
+
ta as UNSAFE_decodeViaTurboStream,
|
|
128
|
+
ra as UNSAFE_deserializeErrors,
|
|
129
|
+
oa as UNSAFE_getPatchRoutesOnNavigationFunction,
|
|
130
|
+
ia as UNSAFE_getSingleFetchDataStrategy,
|
|
131
|
+
ua as UNSAFE_invariant,
|
|
132
|
+
na as UNSAFE_mapRouteProperties,
|
|
133
|
+
ca as UNSAFE_shouldHydrateRouteLoader,
|
|
134
|
+
ha as UNSAFE_useFogOFWarDiscovery,
|
|
135
|
+
fa as UNSAFE_useScrollRestoration,
|
|
136
|
+
se as arePropsValid,
|
|
137
|
+
te as checkConfig,
|
|
138
|
+
re as checkIfPropExists,
|
|
139
|
+
oe as checkVersion,
|
|
140
|
+
Sa as createBrowserRouter,
|
|
141
|
+
Ra as createCookie,
|
|
142
|
+
ma as createCookieSessionStorage,
|
|
143
|
+
la as createHashRouter,
|
|
144
|
+
ga as createMemoryRouter,
|
|
145
|
+
da as createMemorySessionStorage,
|
|
146
|
+
pa as createPath,
|
|
147
|
+
Ea as createRequestHandler,
|
|
148
|
+
Pa as createRoutesFromChildren,
|
|
149
|
+
Na as createRoutesFromElements,
|
|
150
|
+
Fa as createRoutesStub,
|
|
151
|
+
xa as createSearchParams,
|
|
152
|
+
va as createSession,
|
|
153
|
+
Aa as createSessionStorage,
|
|
154
|
+
_a as createStaticHandler,
|
|
155
|
+
Ca as createStaticRouter,
|
|
156
|
+
Ua as data,
|
|
157
|
+
ya as generatePath,
|
|
158
|
+
ie as getEnvironmentVariables,
|
|
159
|
+
ue as getModuleQueryKey,
|
|
160
|
+
Ma as isCookie,
|
|
161
|
+
ba as isRouteErrorResponse,
|
|
162
|
+
ka as isSession,
|
|
163
|
+
Oa as matchPath,
|
|
164
|
+
La as matchRoutes,
|
|
165
|
+
ee as mutateOnCustomApi,
|
|
166
|
+
wa as parsePath,
|
|
167
|
+
Ba as redirect,
|
|
168
|
+
Da as redirectDocument,
|
|
169
|
+
Ha as renderMatches,
|
|
170
|
+
Qa as replace,
|
|
171
|
+
Ia as resolvePath,
|
|
172
|
+
ne as universalSelector,
|
|
173
|
+
Ta as unstable_HistoryRouter,
|
|
174
|
+
Va as unstable_setDevServerHooks,
|
|
175
|
+
Ka as unstable_usePrompt,
|
|
176
|
+
za as useActionData,
|
|
177
|
+
Ga as useAsyncError,
|
|
178
|
+
Wa as useAsyncValue,
|
|
179
|
+
I as useBaseProps,
|
|
180
|
+
ja as useBeforeUnload,
|
|
181
|
+
qa as useBlocker,
|
|
182
|
+
k as useBreadcrumbTranslation,
|
|
183
|
+
T as useConfig,
|
|
184
|
+
K as useCustom,
|
|
185
|
+
G as useCustomMutation,
|
|
186
|
+
j as useEntity,
|
|
187
|
+
Ja as useFetcher,
|
|
188
|
+
Xa as useFetchers,
|
|
189
|
+
Ya as useFormAction,
|
|
190
|
+
Za as useHref,
|
|
191
|
+
$a as useInRouterContext,
|
|
192
|
+
F as useInfiniteQuery,
|
|
193
|
+
es as useLinkClickHandler,
|
|
194
|
+
as as useLoaderData,
|
|
195
|
+
ss as useLocation,
|
|
196
|
+
ts as useMatch,
|
|
197
|
+
rs as useMatches,
|
|
198
|
+
Se as useMutation,
|
|
199
|
+
H as useNavigate,
|
|
200
|
+
os as useNavigation,
|
|
201
|
+
is as useNavigationType,
|
|
202
|
+
Y as useNotification,
|
|
203
|
+
L as useOffline,
|
|
204
|
+
J as useOption,
|
|
205
|
+
us as useOutlet,
|
|
206
|
+
ns as useOutletContext,
|
|
207
|
+
cs as useParams,
|
|
208
|
+
he as useQuery,
|
|
209
|
+
me as useQueryClient,
|
|
210
|
+
hs as useResolvedPath,
|
|
211
|
+
fs as useRevalidator,
|
|
212
|
+
Ss as useRouteError,
|
|
213
|
+
Rs as useRouteLoaderData,
|
|
214
|
+
ms as useRoutes,
|
|
215
|
+
ls as useSearchParams,
|
|
216
|
+
Z as useServiceBus,
|
|
217
|
+
B as useSignalRMessages,
|
|
218
|
+
gs as useSubmit,
|
|
219
|
+
ds as useViewTransitionState
|
|
146
220
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as hn } from "./_commonjsHelpers-BkfeUUK-.js";
|
|
2
|
-
import { i as te, j as pn, k as qn, l as dn, m as An, b as Pt, f as B, d as wt, e as Sn, r as Tn, c as xt, n as ne, g as Kt, o as Lt, p as Rn, q as Et, a as ae, s as ie, t as Ft, u as Bt, h as In, v as Mt, w as On, x as mn, y as Cn } from "./_baseGet-
|
|
2
|
+
import { i as te, j as pn, k as qn, l as dn, m as An, b as Pt, f as B, d as wt, e as Sn, r as Tn, c as xt, n as ne, g as Kt, o as Lt, p as Rn, q as Et, a as ae, s as ie, t as Ft, u as Bt, h as In, v as Mt, w as On, x as mn, y as Cn } from "./_baseGet-C6jMXSsQ.js";
|
|
3
3
|
var H, pe;
|
|
4
4
|
function jn() {
|
|
5
5
|
if (pe) return H;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var e = /* @__PURE__ */ ((a) => (a[a.Category = 0] = "Category", a[a.Requirement = 1] = "Requirement", a[a.Country = 2] = "Country", a[a.CountryCode = 3] = "CountryCode", a[a.Crop = 4] = "Crop", a[a.CropType = 5] = "CropType", a[a.CropVariety = 6] = "CropVariety", a[a.Currency = 7] = "Currency", a[a.DataAreaEntity = 8] = "DataAreaEntity", a[a.DataAreaGroup = 9] = "DataAreaGroup", a[a.FieldAutomationLevelType = 10] = "FieldAutomationLevelType", a[a.FieldCoverageType = 11] = "FieldCoverageType", a[a.FieldSecurityLevelType = 12] = "FieldSecurityLevelType", a[a.FieldShadingType = 13] = "FieldShadingType", a[a.FieldSowingType = 14] = "FieldSowingType", a[a.FieldSubstrateType = 15] = "FieldSubstrateType", a[a.FieldTechnologyType = 16] = "FieldTechnologyType", a[a.Gender = 17] = "Gender", a[a.GrowingEnvironment = 18] = "GrowingEnvironment", a[a.Language = 19] = "Language", a[a.ModuleHostingType = 20] = "ModuleHostingType", a[a.ModuleType = 21] = "ModuleType", a[a.ModuleState = 22] = "ModuleState", a[a.Region = 23] = "Region", a[a.Rootstock = 24] = "Rootstock", a[a.Salutation = 25] = "Salutation", a[a.SeasonState = 26] = "SeasonState", a[a.SensorName = 27] = "SensorName", a[a.SensorState = 28] = "SensorState", a[a.TermAndCondition = 29] = "TermAndCondition", a[a.PackageState = 30] = "PackageState", a[a.DocumentType = 31] = "DocumentType", a[a.ModuleFederationType = 32] = "ModuleFederationType", a[a.PaymentCycle = 33] = "PaymentCycle", a[a.PaymentMethod = 34] = "PaymentMethod", a[a.PlantFamily = 35] = "PlantFamily", a[a.AlertCriteriaName = 36] = "AlertCriteriaName", a))(e || {});
|
|
1
|
+
var e = /* @__PURE__ */ ((a) => (a[a.Category = 0] = "Category", a[a.Requirement = 1] = "Requirement", a[a.Country = 2] = "Country", a[a.CountryCode = 3] = "CountryCode", a[a.Crop = 4] = "Crop", a[a.CropType = 5] = "CropType", a[a.CropVariety = 6] = "CropVariety", a[a.Currency = 7] = "Currency", a[a.DataAreaEntity = 8] = "DataAreaEntity", a[a.DataAreaGroup = 9] = "DataAreaGroup", a[a.FieldAutomationLevelType = 10] = "FieldAutomationLevelType", a[a.FieldCoverageType = 11] = "FieldCoverageType", a[a.FieldSecurityLevelType = 12] = "FieldSecurityLevelType", a[a.FieldShadingType = 13] = "FieldShadingType", a[a.FieldSowingType = 14] = "FieldSowingType", a[a.FieldSubstrateType = 15] = "FieldSubstrateType", a[a.FieldTechnologyType = 16] = "FieldTechnologyType", a[a.Gender = 17] = "Gender", a[a.GrowingEnvironment = 18] = "GrowingEnvironment", a[a.Language = 19] = "Language", a[a.ModuleHostingType = 20] = "ModuleHostingType", a[a.ModuleType = 21] = "ModuleType", a[a.ModuleState = 22] = "ModuleState", a[a.Region = 23] = "Region", a[a.Rootstock = 24] = "Rootstock", a[a.Salutation = 25] = "Salutation", a[a.SeasonState = 26] = "SeasonState", a[a.SensorName = 27] = "SensorName", a[a.SensorState = 28] = "SensorState", a[a.TermAndCondition = 29] = "TermAndCondition", a[a.PackageState = 30] = "PackageState", a[a.DocumentType = 31] = "DocumentType", a[a.ModuleFederationType = 32] = "ModuleFederationType", a[a.PaymentCycle = 33] = "PaymentCycle", a[a.PaymentMethod = 34] = "PaymentMethod", a[a.PlantFamily = 35] = "PlantFamily", a[a.AlertCriteriaName = 36] = "AlertCriteriaName", a[a.ProductionPurpose = 37] = "ProductionPurpose", a))(e || {});
|
|
2
2
|
export {
|
|
3
3
|
e as CommonOptionType
|
|
4
4
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
farms: "farm",
|
|
3
|
+
fields: "field",
|
|
4
|
+
zones: "block",
|
|
5
|
+
irrigation_stations: "irrigationStation",
|
|
6
|
+
farm_organizations: "farmOrg",
|
|
7
|
+
alert_rules: "farmAlertRule"
|
|
8
|
+
}, t = {
|
|
9
|
+
farm_members: "member"
|
|
10
|
+
}, a = {
|
|
11
|
+
Season: "season",
|
|
12
|
+
BlockPlantLayout: "blockPlantLayout",
|
|
13
|
+
Record: "recordLight",
|
|
14
|
+
Scouting: "scouting"
|
|
15
|
+
}, r = {
|
|
16
|
+
...e,
|
|
17
|
+
...t,
|
|
18
|
+
...a
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
r as AllEntitiesTypeResultMap,
|
|
22
|
+
t as FarmMemberEntitiesTypeResultMap,
|
|
23
|
+
e as FarmOrgEntitiesTypeResultMap,
|
|
24
|
+
a as ModuleDependedEntityTypeResultMap
|
|
25
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { g as l } from "./mutation-
|
|
3
|
-
import { S as d,
|
|
1
|
+
import * as o from "react";
|
|
2
|
+
import { g as l } from "./mutation-DSKlaYzY.js";
|
|
3
|
+
import { S as d, s as p, h, n as a, u as b } from "./QueryClientProvider-Beog9TR7.js";
|
|
4
4
|
import { n as m, s as f } from "./utils-DxRR_XLb.js";
|
|
5
5
|
var v = class extends d {
|
|
6
6
|
#e;
|
|
@@ -25,13 +25,13 @@ var v = class extends d {
|
|
|
25
25
|
this.hasListeners() || this.#t?.removeObserver(this);
|
|
26
26
|
}
|
|
27
27
|
onMutationUpdate(t) {
|
|
28
|
-
this.#r(), this.#
|
|
28
|
+
this.#r(), this.#o(t);
|
|
29
29
|
}
|
|
30
30
|
getCurrentResult() {
|
|
31
31
|
return this.#i;
|
|
32
32
|
}
|
|
33
33
|
reset() {
|
|
34
|
-
this.#t?.removeObserver(this), this.#t = void 0, this.#r(), this.#
|
|
34
|
+
this.#t?.removeObserver(this), this.#t = void 0, this.#r(), this.#o();
|
|
35
35
|
}
|
|
36
36
|
mutate(t, s) {
|
|
37
37
|
return this.#s = s, this.#t?.removeObserver(this), this.#t = this.#e.getMutationCache().build(this.#e, this.options), this.#t.addObserver(this), this.#t.execute(t);
|
|
@@ -48,7 +48,7 @@ var v = class extends d {
|
|
|
48
48
|
reset: this.reset
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
#
|
|
51
|
+
#o(t) {
|
|
52
52
|
a.batch(() => {
|
|
53
53
|
if (this.#s && this.hasListeners()) {
|
|
54
54
|
const s = this.#i.variables, i = this.#i.context;
|
|
@@ -65,26 +65,26 @@ var v = class extends d {
|
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
-
function
|
|
69
|
-
const i = b(), [e] =
|
|
68
|
+
function M(t, s) {
|
|
69
|
+
const i = b(s), [e] = o.useState(
|
|
70
70
|
() => new v(
|
|
71
71
|
i,
|
|
72
72
|
t
|
|
73
73
|
)
|
|
74
74
|
);
|
|
75
|
-
|
|
75
|
+
o.useEffect(() => {
|
|
76
76
|
e.setOptions(t);
|
|
77
77
|
}, [e, t]);
|
|
78
|
-
const r =
|
|
79
|
-
|
|
80
|
-
(
|
|
78
|
+
const r = o.useSyncExternalStore(
|
|
79
|
+
o.useCallback(
|
|
80
|
+
(n) => e.subscribe(a.batchCalls(n)),
|
|
81
81
|
[e]
|
|
82
82
|
),
|
|
83
83
|
() => e.getCurrentResult(),
|
|
84
84
|
() => e.getCurrentResult()
|
|
85
|
-
), u =
|
|
86
|
-
(
|
|
87
|
-
e.mutate(
|
|
85
|
+
), u = o.useCallback(
|
|
86
|
+
(n, c) => {
|
|
87
|
+
e.mutate(n, c).catch(m);
|
|
88
88
|
},
|
|
89
89
|
[e]
|
|
90
90
|
);
|
|
@@ -93,5 +93,5 @@ function C(t, s) {
|
|
|
93
93
|
return { ...r, mutate: u, mutateAsync: r.mutate };
|
|
94
94
|
}
|
|
95
95
|
export {
|
|
96
|
-
|
|
96
|
+
M as u
|
|
97
97
|
};
|