@litusarchieve18/agricore-utils 1.0.1
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/index.d.mts +470 -0
- package/dist/index.d.ts +470 -0
- package/dist/index.js +894 -0
- package/dist/index.mjs +803 -0
- package/package.json +27 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
type PermissionLevel = 'WRITE' | 'READ' | 'NONE';
|
|
2
|
+
/**
|
|
3
|
+
* Deep map of scope IDs to resource paths and their permission levels.
|
|
4
|
+
* Example: { "uuid-123": { "farm.records": "WRITE" } }
|
|
5
|
+
*/
|
|
6
|
+
interface ResourceOverrides {
|
|
7
|
+
[scopeId: string]: Record<string, PermissionLevel>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The canonical Session object used throughout the AgriCore ecosystem.
|
|
11
|
+
* All backend logic and frontend components should rely on THIS shape.
|
|
12
|
+
*/
|
|
13
|
+
interface AgriCoreSession {
|
|
14
|
+
userId: string;
|
|
15
|
+
companyId: string;
|
|
16
|
+
activeScopeId: string | null;
|
|
17
|
+
role: string;
|
|
18
|
+
privileges: string[];
|
|
19
|
+
enabledModules: string[];
|
|
20
|
+
readScopes: string[];
|
|
21
|
+
writeScopes: string[];
|
|
22
|
+
resourceOverrides: ResourceOverrides;
|
|
23
|
+
}
|
|
24
|
+
interface ResolvedError {
|
|
25
|
+
title: string;
|
|
26
|
+
text: string;
|
|
27
|
+
module: string;
|
|
28
|
+
moduleLabel: string;
|
|
29
|
+
status: number;
|
|
30
|
+
catAct: string;
|
|
31
|
+
isSubscriptionIssue: boolean;
|
|
32
|
+
isPermissionIssue: boolean;
|
|
33
|
+
}
|
|
34
|
+
interface AuthScopeFields {
|
|
35
|
+
facilityId?: string;
|
|
36
|
+
legalEntityId?: string;
|
|
37
|
+
companyId?: string;
|
|
38
|
+
}
|
|
39
|
+
interface TabConfig {
|
|
40
|
+
resourceId?: string;
|
|
41
|
+
allowedRoles?: string[];
|
|
42
|
+
requiredPrivileges?: string[];
|
|
43
|
+
}
|
|
44
|
+
interface FormMeta {
|
|
45
|
+
label: string;
|
|
46
|
+
menuUrl: string;
|
|
47
|
+
module: string;
|
|
48
|
+
}
|
|
49
|
+
interface TaskTypeConfig {
|
|
50
|
+
label: string;
|
|
51
|
+
targetEntity: string;
|
|
52
|
+
description: string;
|
|
53
|
+
mimeTypes: string[];
|
|
54
|
+
icon: string;
|
|
55
|
+
approveAction: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
declare const AgriLogger: {
|
|
59
|
+
log(level: "INFO" | "WARN" | "ERROR", message: string, meta: any): void;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Automatically logs the start, end, duration, and errors of a function.
|
|
63
|
+
*/
|
|
64
|
+
declare function withAgriLogging<T extends (...args: any[]) => Promise<any>>(fn: T, functionName: string, session?: AgriCoreSession): T;
|
|
65
|
+
|
|
66
|
+
declare const Validator: {
|
|
67
|
+
/** * 1. Email: The classic. Uses a standard RFC 5322 regex.
|
|
68
|
+
*/
|
|
69
|
+
isEmail: (val: string) => boolean;
|
|
70
|
+
/** * 2. UUID v4: Critical for your canonicalId and authScopeId checks.
|
|
71
|
+
*/
|
|
72
|
+
isUUID: (value: string | null | undefined) => boolean;
|
|
73
|
+
/** * 3. ISO Date String: Ensures dates are stored in UTC/ISO format.
|
|
74
|
+
*/
|
|
75
|
+
isIsoDate: (val: string) => boolean;
|
|
76
|
+
isPositiveNumber: (value: number | null | undefined) => boolean;
|
|
77
|
+
/** * 4. Strong Password: Min 8 chars, 1 uppercase, 1 lowercase, 1 number, 1 special char.
|
|
78
|
+
*/
|
|
79
|
+
isStrongPassword: (val: string) => boolean;
|
|
80
|
+
/** * 5. Phone Number (E.164): The international standard (e.g., +61400123456).
|
|
81
|
+
*/
|
|
82
|
+
isE164Phone: (val: string) => boolean;
|
|
83
|
+
/** * 6. Range Checker: Useful for temperature sensors or quantity limits.
|
|
84
|
+
*/
|
|
85
|
+
isInRange: (val: number, min: number, max: number) => boolean;
|
|
86
|
+
/** * 7. URL: Basic validation for external documentation links.
|
|
87
|
+
*/
|
|
88
|
+
isValidUrl: (val: string) => boolean;
|
|
89
|
+
/** * 8. Slug: Useful for URL-friendly names (e.g. "sunset-farm-01").
|
|
90
|
+
*/
|
|
91
|
+
isSlug: (val: string) => boolean;
|
|
92
|
+
isNotEmpty: (value: string | null | undefined) => boolean;
|
|
93
|
+
/** * 9. Is Non-Empty Array: Ensures you don't save an empty list of IDs.
|
|
94
|
+
*/
|
|
95
|
+
hasItems: (val: any) => boolean;
|
|
96
|
+
/** * 10. Coordinates: Validate GPS Latitude/Longitude for Farm maps.
|
|
97
|
+
*/
|
|
98
|
+
isValidCoordinate: (lat: number, lng: number) => boolean;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
declare const Converter: {
|
|
102
|
+
/**
|
|
103
|
+
* Hectares to Acres
|
|
104
|
+
* Formula: $Acres = Hectares \times 2.47105$
|
|
105
|
+
*/
|
|
106
|
+
haToAcre: (ha: number, precision?: number) => number;
|
|
107
|
+
/**
|
|
108
|
+
* Acres to Hectares
|
|
109
|
+
* Formula: $Hectares = Acres \div 2.47105$
|
|
110
|
+
*/
|
|
111
|
+
acreToHa: (acre: number, precision?: number) => number;
|
|
112
|
+
/**
|
|
113
|
+
* Liters to US Gallons
|
|
114
|
+
* Formula: $Gallons = Liters \times 0.264172$
|
|
115
|
+
*/
|
|
116
|
+
literToGal: (liters: number, precision?: number) => number;
|
|
117
|
+
/**
|
|
118
|
+
* US Gallons to Liters
|
|
119
|
+
* Formula: $Liters = Gallons \div 0.264172$
|
|
120
|
+
*/
|
|
121
|
+
galToLiter: (gal: number, precision?: number) => number;
|
|
122
|
+
/**
|
|
123
|
+
* Kilograms to Pounds (useful for yield/harvest data)
|
|
124
|
+
*/
|
|
125
|
+
kgToLbs: (kg: number, precision?: number) => number;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
declare const MOD: {
|
|
129
|
+
readonly OPERATIONS: "OPR";
|
|
130
|
+
readonly EQUIPMENT: "EQP";
|
|
131
|
+
readonly PACKHOUSE: "PCK";
|
|
132
|
+
readonly FARM: "FRM";
|
|
133
|
+
readonly SAFETY: "SAF";
|
|
134
|
+
readonly TEAM_HR: "THR";
|
|
135
|
+
readonly RECORDS: "REC";
|
|
136
|
+
readonly ADMIN: "ADM";
|
|
137
|
+
readonly DOCUMENTS: "DOC";
|
|
138
|
+
readonly ALERTS: "ALT";
|
|
139
|
+
readonly INFRA: "INF";
|
|
140
|
+
readonly SESSION: "SES";
|
|
141
|
+
};
|
|
142
|
+
type ModCode = typeof MOD[keyof typeof MOD];
|
|
143
|
+
declare const CAT: {
|
|
144
|
+
readonly SUBSCRIPTION: "1";
|
|
145
|
+
readonly PERMISSION: "2";
|
|
146
|
+
readonly VALIDATION: "3";
|
|
147
|
+
readonly INTEGRITY: "4";
|
|
148
|
+
};
|
|
149
|
+
declare const ACT: {
|
|
150
|
+
readonly GENERIC: "00";
|
|
151
|
+
readonly VIEW: "01";
|
|
152
|
+
readonly CREATE: "02";
|
|
153
|
+
readonly EDIT: "03";
|
|
154
|
+
readonly DELETE: "04";
|
|
155
|
+
readonly UPLOAD: "05";
|
|
156
|
+
};
|
|
157
|
+
declare const SENTINEL_UUID = "00000000-0000-0000-0000-000000000000";
|
|
158
|
+
declare class AppError extends Error {
|
|
159
|
+
status: number;
|
|
160
|
+
appCode: string;
|
|
161
|
+
isOperational: boolean;
|
|
162
|
+
constructor(status: number, mod: string, cat: string, act: string, message: string);
|
|
163
|
+
}
|
|
164
|
+
declare const ErrorFactory: {
|
|
165
|
+
unauthorized: (mod: string, msg?: string) => AppError;
|
|
166
|
+
forbidden: (mod: string, act: string, msg?: string) => AppError;
|
|
167
|
+
badRequest: (mod: string, act: string, msg?: string) => AppError;
|
|
168
|
+
notFound: (mod: string, act?: "00", msg?: string) => AppError;
|
|
169
|
+
conflict: (mod: string, act: string, msg?: string) => AppError;
|
|
170
|
+
integrity: (mod: string, act?: "00", msg?: string) => AppError;
|
|
171
|
+
subscription: (mod: string, msg?: string) => AppError;
|
|
172
|
+
internal: (mod: string, msg?: string) => AppError;
|
|
173
|
+
};
|
|
174
|
+
declare const handleAppErrorResponse: (error: unknown, mod?: string) => Response;
|
|
175
|
+
declare const MODULE_LABELS: Record<string, string>;
|
|
176
|
+
declare const ERROR_DICTIONARY: Record<string, {
|
|
177
|
+
title: string;
|
|
178
|
+
text: string;
|
|
179
|
+
}>;
|
|
180
|
+
declare const resolveAppError: (appCode: string) => ResolvedError;
|
|
181
|
+
declare const extractAppCode: (error: unknown) => string | null;
|
|
182
|
+
declare const resolveError: (error: unknown) => ResolvedError;
|
|
183
|
+
declare function generateCanonicalId(): string;
|
|
184
|
+
/**
|
|
185
|
+
* Resolves authScopeId using the standard priority chain:
|
|
186
|
+
* facilityId → legalEntityId → companyId → SENTINEL_UUID
|
|
187
|
+
*
|
|
188
|
+
* This matches the documented rule:
|
|
189
|
+
* "Set to facilityId if available, else legalEntityId, else companyId."
|
|
190
|
+
*/
|
|
191
|
+
declare function resolveAuthScopeId(fields?: AuthScopeFields): string;
|
|
192
|
+
declare function withSaveMiddleware<T extends Record<string, any>>(data: T): T & {
|
|
193
|
+
canonicalId: any;
|
|
194
|
+
authScopeId: any;
|
|
195
|
+
};
|
|
196
|
+
declare function buildRlsFilter(session: AgriCoreSession, extra?: Record<string, any>): {
|
|
197
|
+
authScopeId: {
|
|
198
|
+
$in: string[];
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
declare function canRead(session: AgriCoreSession, authScopeId: string): boolean;
|
|
202
|
+
declare function canWrite(session: AgriCoreSession, authScopeId: string, resourcePath: string): boolean;
|
|
203
|
+
/**
|
|
204
|
+
* Hard-throws if the user cannot write.
|
|
205
|
+
* Use this on the backend (inside Deno functions) to enforce server-side.
|
|
206
|
+
*/
|
|
207
|
+
declare function assertCanWrite(session: AgriCoreSession, authScopeId: string, resourcePath: string): void;
|
|
208
|
+
/**
|
|
209
|
+
* Full resolution: DB override → static config fallback → public default.
|
|
210
|
+
* Returns 'NONE' | 'READ' | 'WRITE'.
|
|
211
|
+
*/
|
|
212
|
+
declare function resolveAccess(session: AgriCoreSession, activeScopeId: string, tabConfig: TabConfig): 'NONE' | 'READ' | 'WRITE';
|
|
213
|
+
declare function resolveMenuVisibility(session: AgriCoreSession, authScopeId: string, resourcePath: string): 'hidden' | 'read_only' | 'active';
|
|
214
|
+
declare function isTabVisible(session: AgriCoreSession, activeScopeId: string, tabConfig: TabConfig): boolean;
|
|
215
|
+
declare function isTabWritable(session: AgriCoreSession, activeScopeId: string, tabConfig: TabConfig): boolean;
|
|
216
|
+
declare const UserRole: {
|
|
217
|
+
readonly OWNER: "owner";
|
|
218
|
+
readonly MANAGER: "manager";
|
|
219
|
+
readonly SUPERVISOR: "supervisor";
|
|
220
|
+
readonly LEADING_HAND: "leadingHand";
|
|
221
|
+
readonly WORKER: "worker";
|
|
222
|
+
};
|
|
223
|
+
declare const UserPrivilege: {
|
|
224
|
+
readonly FINANCE: "finance";
|
|
225
|
+
readonly HR: "hr";
|
|
226
|
+
readonly MECHANIC: "mechanic";
|
|
227
|
+
readonly AUDIT_COMPLIANCE: "auditCompliance";
|
|
228
|
+
readonly ADMIN: "admin";
|
|
229
|
+
};
|
|
230
|
+
declare const AccessLevel: {
|
|
231
|
+
readonly NONE: "NONE";
|
|
232
|
+
readonly READ: "READ";
|
|
233
|
+
readonly WRITE: "WRITE";
|
|
234
|
+
};
|
|
235
|
+
declare const EnabledModule: {
|
|
236
|
+
readonly FARM_MANAGEMENT: "farm_management";
|
|
237
|
+
readonly PACKHOUSE: "packhouse";
|
|
238
|
+
readonly ACCOMMODATION: "accommodation";
|
|
239
|
+
};
|
|
240
|
+
declare const FacilityType: {
|
|
241
|
+
readonly FARM: "farm";
|
|
242
|
+
readonly PACKHOUSE: "packhouse";
|
|
243
|
+
readonly ACCOMMODATION: "accommodation";
|
|
244
|
+
};
|
|
245
|
+
declare const LinkedStatus: {
|
|
246
|
+
readonly NOT_LINKED: "not_linked";
|
|
247
|
+
readonly PENDING_LINK: "pending_link";
|
|
248
|
+
readonly LINKED: "linked";
|
|
249
|
+
};
|
|
250
|
+
declare const RelationshipType: {
|
|
251
|
+
readonly SUPPLIER: "supplier";
|
|
252
|
+
readonly CUSTOMER: "customer";
|
|
253
|
+
readonly BOTH: "both";
|
|
254
|
+
};
|
|
255
|
+
declare const ApprovalType: {
|
|
256
|
+
readonly ROLE: "role";
|
|
257
|
+
readonly PRIVILEGE: "privilege";
|
|
258
|
+
readonly SPECIFIC_USERS: "specific_users";
|
|
259
|
+
};
|
|
260
|
+
declare const TransactionType: {
|
|
261
|
+
readonly PURCHASE_ORDER: "purchase_order";
|
|
262
|
+
readonly SALES_ORDER: "sales_order";
|
|
263
|
+
readonly REPAIR: "repair";
|
|
264
|
+
readonly FUEL: "fuel";
|
|
265
|
+
readonly OTHER: "other";
|
|
266
|
+
};
|
|
267
|
+
declare const ApprovalStatus: {
|
|
268
|
+
readonly PENDING: "pending";
|
|
269
|
+
readonly APPROVED: "approved";
|
|
270
|
+
readonly REJECTED: "rejected";
|
|
271
|
+
};
|
|
272
|
+
declare const OrderStatus: {
|
|
273
|
+
readonly DRAFT: "draft";
|
|
274
|
+
readonly PENDING_FINANCE: "pending_finance";
|
|
275
|
+
readonly NEW: "new";
|
|
276
|
+
readonly ACKNOWLEDGED: "acknowledged";
|
|
277
|
+
readonly IN_PROGRESS: "in_progress";
|
|
278
|
+
readonly SHIPPED: "shipped";
|
|
279
|
+
readonly RECEIVED: "received";
|
|
280
|
+
readonly CANCELLED: "cancelled";
|
|
281
|
+
};
|
|
282
|
+
declare const NotificationMode: {
|
|
283
|
+
readonly INTERNAL: "internal";
|
|
284
|
+
readonly EXTERNAL_EMAIL: "external_email";
|
|
285
|
+
readonly NONE: "none";
|
|
286
|
+
};
|
|
287
|
+
declare const TaskType: {
|
|
288
|
+
readonly KML_PARSE: "KML_PARSE";
|
|
289
|
+
readonly INVOICE_OCR: "INVOICE_OCR";
|
|
290
|
+
readonly AUDIT_UPLOAD: "AUDIT_UPLOAD";
|
|
291
|
+
readonly REPORT_GEN: "REPORT_GEN";
|
|
292
|
+
};
|
|
293
|
+
declare const TaskStatus: {
|
|
294
|
+
readonly PENDING: "PENDING";
|
|
295
|
+
readonly PROCESSING: "PROCESSING";
|
|
296
|
+
readonly COMPLETED: "COMPLETED";
|
|
297
|
+
readonly FAILED: "FAILED";
|
|
298
|
+
readonly AWAITING_REVIEW: "AWAITING_REVIEW";
|
|
299
|
+
readonly VERIFIED: "VERIFIED";
|
|
300
|
+
readonly REJECTED: "REJECTED";
|
|
301
|
+
};
|
|
302
|
+
declare const MimeType: {
|
|
303
|
+
readonly KML: "application/vnd.google-earth.kml+xml";
|
|
304
|
+
readonly KMZ: "application/vnd.google-earth.kmz";
|
|
305
|
+
readonly PDF: "application/pdf";
|
|
306
|
+
readonly XLSX: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
307
|
+
readonly XLS: "application/vnd.ms-excel";
|
|
308
|
+
readonly JPEG: "image/jpeg";
|
|
309
|
+
readonly PNG: "image/png";
|
|
310
|
+
};
|
|
311
|
+
declare const TargetEntityType: {
|
|
312
|
+
readonly FARM: "FARM";
|
|
313
|
+
readonly ZONE: "ZONE";
|
|
314
|
+
readonly BLOCK: "BLOCK";
|
|
315
|
+
readonly FUEL_SITE: "FUEL_SITE";
|
|
316
|
+
readonly WORKSHOP: "WORKSHOP";
|
|
317
|
+
readonly AUTO: "AUTO";
|
|
318
|
+
};
|
|
319
|
+
declare const AuditType: {
|
|
320
|
+
readonly FRESHCARE: "Freshcare";
|
|
321
|
+
readonly HACCP: "HACCP";
|
|
322
|
+
readonly WHS: "WHS";
|
|
323
|
+
readonly CUSTOM: "Custom";
|
|
324
|
+
};
|
|
325
|
+
declare const AuditStatus: {
|
|
326
|
+
readonly DRAFT: "DRAFT";
|
|
327
|
+
readonly IN_REVIEW: "IN_REVIEW";
|
|
328
|
+
readonly FINALIZED: "FINALIZED";
|
|
329
|
+
};
|
|
330
|
+
declare const SoilTexture: {
|
|
331
|
+
readonly SAND: "SAND";
|
|
332
|
+
readonly LOAMY_SAND: "LOAMY_SAND";
|
|
333
|
+
readonly SANDY_LOAM: "SANDY_LOAM";
|
|
334
|
+
readonly LOAM: "LOAM";
|
|
335
|
+
readonly SILT_LOAM: "SILT_LOAM";
|
|
336
|
+
readonly SILT: "SILT";
|
|
337
|
+
readonly SANDY_CLAY_LOAM: "SANDY_CLAY_LOAM";
|
|
338
|
+
readonly CLAY_LOAM: "CLAY_LOAM";
|
|
339
|
+
readonly SILTY_CLAY_LOAM: "SILTY_CLAY_LOAM";
|
|
340
|
+
readonly SANDY_CLAY: "SANDY_CLAY";
|
|
341
|
+
readonly SILTY_CLAY: "SILTY_CLAY";
|
|
342
|
+
readonly CLAY: "CLAY";
|
|
343
|
+
};
|
|
344
|
+
declare const MicroclimateZone: {
|
|
345
|
+
readonly STANDARD: "STANDARD";
|
|
346
|
+
readonly FROST_POCKET: "FROST_POCKET";
|
|
347
|
+
readonly WIND_CORRIDOR: "WIND_CORRIDOR";
|
|
348
|
+
readonly EXPOSED_RIDGE: "EXPOSED_RIDGE";
|
|
349
|
+
readonly HEAT_TRAP: "HEAT_TRAP";
|
|
350
|
+
readonly RIPARIAN: "RIPARIAN";
|
|
351
|
+
};
|
|
352
|
+
declare const PlantingMethod: {
|
|
353
|
+
readonly SQUARE: "SQUARE";
|
|
354
|
+
readonly RECTANGULAR: "RECTANGULAR";
|
|
355
|
+
readonly HEXAGONAL: "HEXAGONAL";
|
|
356
|
+
readonly QUINCUNX: "QUINCUNX";
|
|
357
|
+
readonly CONTOUR: "CONTOUR";
|
|
358
|
+
};
|
|
359
|
+
declare const RowOrientation: {
|
|
360
|
+
readonly NORTH_SOUTH: "NORTH_SOUTH";
|
|
361
|
+
readonly EAST_WEST: "EAST_WEST";
|
|
362
|
+
readonly NORTHEAST_SOUTHWEST: "NORTHEAST_SOUTHWEST";
|
|
363
|
+
readonly NORTHWEST_SOUTHEAST: "NORTHWEST_SOUTHEAST";
|
|
364
|
+
};
|
|
365
|
+
declare const EmitterType: {
|
|
366
|
+
readonly SURFACE_DRIP: "SURFACE_DRIP";
|
|
367
|
+
readonly SUBSURFACE_DRIP: "SUBSURFACE_DRIP";
|
|
368
|
+
readonly MICRO_SPRINKLER: "MICRO_SPRINKLER";
|
|
369
|
+
readonly JET_SPRAY: "JET_SPRAY";
|
|
370
|
+
readonly INLINE_DRIPPER: "INLINE_DRIPPER";
|
|
371
|
+
readonly PRESSURE_COMPENSATED: "PRESSURE_COMPENSATED";
|
|
372
|
+
};
|
|
373
|
+
declare const TrellisType: {
|
|
374
|
+
readonly NONE: "NONE";
|
|
375
|
+
readonly VERTICAL_AXIS: "VERTICAL_AXIS";
|
|
376
|
+
readonly TWO_D_PLANE: "2D_PLANE";
|
|
377
|
+
readonly V_TRELLIS: "V_TRELLIS";
|
|
378
|
+
readonly T_BAR: "T_BAR";
|
|
379
|
+
readonly PERGOLA: "PERGOLA";
|
|
380
|
+
readonly Y_TRELLIS: "Y_TRELLIS";
|
|
381
|
+
};
|
|
382
|
+
declare const NettingType: {
|
|
383
|
+
readonly NONE: "NONE";
|
|
384
|
+
readonly OVERHEAD_HAIL: "OVERHEAD_HAIL";
|
|
385
|
+
readonly SIDE_BIRD: "SIDE_BIRD";
|
|
386
|
+
readonly FULL_EXCLUSION: "FULL_EXCLUSION";
|
|
387
|
+
readonly SHADE_30: "SHADE_30";
|
|
388
|
+
readonly SHADE_50: "SHADE_50";
|
|
389
|
+
readonly CROSS_OVER: "CROSS_OVER";
|
|
390
|
+
};
|
|
391
|
+
declare const HarvestMethod: {
|
|
392
|
+
readonly HAND: "HAND";
|
|
393
|
+
readonly MACHINE: "MACHINE";
|
|
394
|
+
};
|
|
395
|
+
declare const VigorRating: {
|
|
396
|
+
readonly VERY_LOW: "VERY_LOW";
|
|
397
|
+
readonly LOW: "LOW";
|
|
398
|
+
readonly MODERATE: "MODERATE";
|
|
399
|
+
readonly HIGH: "HIGH";
|
|
400
|
+
readonly VERY_HIGH: "VERY_HIGH";
|
|
401
|
+
};
|
|
402
|
+
declare const CropCycleStatus: {
|
|
403
|
+
readonly NEW: "NEW";
|
|
404
|
+
readonly CONFIRMED: "CONFIRMED";
|
|
405
|
+
readonly ACTIVE: "ACTIVE";
|
|
406
|
+
readonly COMPLETED: "COMPLETED";
|
|
407
|
+
};
|
|
408
|
+
declare const WaterSource: {
|
|
409
|
+
readonly BORE_WELL: "BORE_WELL";
|
|
410
|
+
readonly RIVER_STREAM: "RIVER_STREAM";
|
|
411
|
+
readonly ON_FARM_DAM: "ON_FARM_DAM";
|
|
412
|
+
readonly IRRIGATION_SCHEME: "IRRIGATION_SCHEME";
|
|
413
|
+
readonly MUNICIPAL: "MUNICIPAL";
|
|
414
|
+
readonly RECLAIMED_WASTE: "RECLAIMED_WASTE";
|
|
415
|
+
readonly RAINWATER: "RAINWATER";
|
|
416
|
+
};
|
|
417
|
+
declare const PhysicalState: {
|
|
418
|
+
readonly LIQUID: "LIQUID";
|
|
419
|
+
readonly GAS: "GAS";
|
|
420
|
+
};
|
|
421
|
+
declare const FORM_REGISTRY: Record<string, FormMeta>;
|
|
422
|
+
declare function getFormMeta(componentId: string): FormMeta | null;
|
|
423
|
+
declare function getFormsGroupedByModule(): Record<string, Array<{
|
|
424
|
+
id: string;
|
|
425
|
+
} & FormMeta>>;
|
|
426
|
+
declare const TASK_TYPE_REGISTRY: Record<string, TaskTypeConfig>;
|
|
427
|
+
declare const getTaskTypeOptions: () => {
|
|
428
|
+
value: string;
|
|
429
|
+
label: string;
|
|
430
|
+
description: string;
|
|
431
|
+
mimeTypes: string[];
|
|
432
|
+
icon: string;
|
|
433
|
+
}[];
|
|
434
|
+
declare const getAcceptedMimeTypes: (taskType: string) => string;
|
|
435
|
+
declare const getApproveAction: (taskType: string) => string | null;
|
|
436
|
+
declare const RESOURCE_PATHS: {
|
|
437
|
+
dashboard: string;
|
|
438
|
+
operations: string;
|
|
439
|
+
equipment: string;
|
|
440
|
+
safety: string;
|
|
441
|
+
team: string;
|
|
442
|
+
records: string;
|
|
443
|
+
adminSettings: string;
|
|
444
|
+
documentHub: string;
|
|
445
|
+
documentHubTemplates: string;
|
|
446
|
+
documentHubFolder: string;
|
|
447
|
+
documentHubExtraction: string;
|
|
448
|
+
documentHubQueue: string;
|
|
449
|
+
analytics: string;
|
|
450
|
+
adminUserRoster: string;
|
|
451
|
+
adminRolesPermissions: string;
|
|
452
|
+
adminBlueprintsSites: string;
|
|
453
|
+
adminCompanySettings: string;
|
|
454
|
+
farmManagement: string;
|
|
455
|
+
packhouse: string;
|
|
456
|
+
accommodation: string;
|
|
457
|
+
equipPreStart: string;
|
|
458
|
+
equipMaintenance: string;
|
|
459
|
+
equipFuelRegister: string;
|
|
460
|
+
equipCalibration: string;
|
|
461
|
+
equipFleet: string;
|
|
462
|
+
safetyAuditing: string;
|
|
463
|
+
safetyFood: string;
|
|
464
|
+
safetyWhs: string;
|
|
465
|
+
safetyCleaning: string;
|
|
466
|
+
teamStaff: string;
|
|
467
|
+
teamTraining: string;
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
export { ACT, AccessLevel, type AgriCoreSession, AgriLogger, AppError, ApprovalStatus, ApprovalType, AuditStatus, AuditType, type AuthScopeFields, CAT, Converter, CropCycleStatus, ERROR_DICTIONARY, EmitterType, EnabledModule, ErrorFactory, FORM_REGISTRY, FacilityType, type FormMeta, HarvestMethod, LinkedStatus, MOD, MODULE_LABELS, MicroclimateZone, MimeType, type ModCode, NettingType, NotificationMode, OrderStatus, type PermissionLevel, PhysicalState, PlantingMethod, RESOURCE_PATHS, RelationshipType, type ResolvedError, type ResourceOverrides, RowOrientation, SENTINEL_UUID, SoilTexture, TASK_TYPE_REGISTRY, type TabConfig, TargetEntityType, TaskStatus, TaskType, type TaskTypeConfig, TransactionType, TrellisType, UserPrivilege, UserRole, Validator, VigorRating, WaterSource, assertCanWrite, buildRlsFilter, canRead, canWrite, extractAppCode, generateCanonicalId, getAcceptedMimeTypes, getApproveAction, getFormMeta, getFormsGroupedByModule, getTaskTypeOptions, handleAppErrorResponse, isTabVisible, isTabWritable, resolveAccess, resolveAppError, resolveAuthScopeId, resolveError, resolveMenuVisibility, withAgriLogging, withSaveMiddleware };
|