@adventurelabs/scout-core 2.0.3 → 2.0.4
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 +5 -0
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +2 -2
- package/dist/helpers/compliance.d.ts +17 -1
- package/dist/helpers/compliance.js +48 -0
- package/dist/helpers/compliance.queries.d.ts +17 -1
- package/dist/helpers/compliance.queries.js +76 -0
- package/dist/helpers/operating_contexts.d.ts +4 -1
- package/dist/helpers/operating_contexts.js +9 -0
- package/dist/helpers/operating_contexts.queries.d.ts +4 -1
- package/dist/helpers/operating_contexts.queries.js +9 -0
- package/dist/hooks/useScoutRealtimeOperatingContexts.d.ts +5 -5
- package/dist/hooks/useScoutRealtimeOperatingContexts.js +9 -0
- package/dist/hooks/useScoutRefresh.d.ts +7 -1
- package/dist/hooks/useScoutRefresh.js +149 -52
- package/dist/providers/ScoutRefreshProvider.js +221 -51
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +2 -2
- package/dist/types/db.d.ts +36 -1
- package/dist/types/jwt_mint.js +3 -3
- package/dist/types/supabase.d.ts +361 -0
- package/package.json +1 -1
|
@@ -24,6 +24,9 @@ function shouldRefreshMint(mint, ttlSec, refreshBeforeExpirySec) {
|
|
|
24
24
|
const nowSec = Math.floor(Date.now() / 1000);
|
|
25
25
|
return mintExpiresAt(mint, ttlSec) <= nowSec + refreshBeforeExpirySec;
|
|
26
26
|
}
|
|
27
|
+
function isBrowserOffline() {
|
|
28
|
+
return typeof navigator === "undefined" || !navigator.onLine;
|
|
29
|
+
}
|
|
27
30
|
function useScoutRefreshContext() {
|
|
28
31
|
const ctx = useContext(ScoutRefreshContext);
|
|
29
32
|
if (!ctx) {
|
|
@@ -74,32 +77,71 @@ function useCachedPublicKeys(supabase, publicKeysCacheTtlMs, fetchKeys) {
|
|
|
74
77
|
return data;
|
|
75
78
|
}, [supabase, publicKeysCacheTtlMs, fetchKeys]);
|
|
76
79
|
}
|
|
77
|
-
function useJwtMintLifecycle({ enabled, supabase, cacheKey, ttlSec, refreshBeforeExpirySec, loadPublicKeys, mintToken, verifyToken, }) {
|
|
80
|
+
function useJwtMintLifecycle({ enabled, supabase, identity, cacheKey, ttlSec, refreshBeforeExpirySec, loadPublicKeys, mintToken, verifyToken, }) {
|
|
81
|
+
const { offlineUserId, validatedUserId, onUserValidated } = identity;
|
|
78
82
|
const [mint, setMint] = useState(null);
|
|
79
83
|
const [inFlight, setInFlight] = useState(false);
|
|
80
84
|
const [error, setError] = useState(null);
|
|
81
85
|
const refreshIdRef = useRef(0);
|
|
82
86
|
const authUserIdRef = useRef(null);
|
|
87
|
+
const cacheHydrationIdRef = useRef(0);
|
|
88
|
+
const signedOutRef = useRef(false);
|
|
89
|
+
const mintRef = useRef(null);
|
|
90
|
+
const offlineUserIdRef = useRef(offlineUserId);
|
|
91
|
+
const supabaseRef = useRef(supabase);
|
|
92
|
+
const updateMint = useCallback((nextMint) => {
|
|
93
|
+
mintRef.current = nextMint;
|
|
94
|
+
setMint(nextMint);
|
|
95
|
+
}, []);
|
|
96
|
+
const notifyUserValidated = useCallback((userId) => {
|
|
97
|
+
try {
|
|
98
|
+
onUserValidated?.(userId);
|
|
99
|
+
}
|
|
100
|
+
catch (validationError) {
|
|
101
|
+
console.error("[ScoutRefreshProvider] User validation callback failed:", validationError);
|
|
102
|
+
}
|
|
103
|
+
}, [onUserValidated]);
|
|
83
104
|
const status = useMemo(() => derive_jwt_mint_status(enabled, mint, inFlight, error), [enabled, mint, inFlight, error]);
|
|
84
|
-
const refreshMint = useCallback(async () => {
|
|
85
|
-
if (!enabled)
|
|
105
|
+
const refreshMint = useCallback(async (force = true) => {
|
|
106
|
+
if (!enabled || isBrowserOffline())
|
|
86
107
|
return;
|
|
108
|
+
cacheHydrationIdRef.current++;
|
|
87
109
|
const refreshId = ++refreshIdRef.current;
|
|
88
110
|
const isCurrent = () => refreshIdRef.current === refreshId;
|
|
89
111
|
setInFlight(true);
|
|
90
112
|
setError(null);
|
|
91
113
|
try {
|
|
92
|
-
const { data:
|
|
114
|
+
const { data, error: authError } = await supabase.auth.getUser();
|
|
115
|
+
if (authError) {
|
|
116
|
+
throw authError;
|
|
117
|
+
}
|
|
93
118
|
if (!isCurrent())
|
|
94
119
|
return;
|
|
95
|
-
if (!
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
120
|
+
if (!data.user) {
|
|
121
|
+
throw new Error("No authenticated user");
|
|
122
|
+
}
|
|
123
|
+
const userId = data.user.id;
|
|
124
|
+
notifyUserValidated(userId);
|
|
125
|
+
const userChanged = authUserIdRef.current !== userId;
|
|
126
|
+
if (userChanged) {
|
|
127
|
+
updateMint(null);
|
|
99
128
|
}
|
|
100
|
-
const userId = session.user.id;
|
|
101
129
|
authUserIdRef.current = userId;
|
|
102
130
|
await scoutCache.setScope(userId);
|
|
131
|
+
if (!isCurrent() || authUserIdRef.current !== userId)
|
|
132
|
+
return;
|
|
133
|
+
if (userChanged) {
|
|
134
|
+
const cached = await scoutCache.getJwtMint(cacheKey, userId);
|
|
135
|
+
if (!isCurrent() || authUserIdRef.current !== userId)
|
|
136
|
+
return;
|
|
137
|
+
updateMint(cached.data);
|
|
138
|
+
}
|
|
139
|
+
const currentMint = mintRef.current;
|
|
140
|
+
if (!force &&
|
|
141
|
+
currentMint &&
|
|
142
|
+
!shouldRefreshMint(currentMint, ttlSec, refreshBeforeExpirySec)) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
103
145
|
const mintResponse = await mintToken(supabase);
|
|
104
146
|
if (!isCurrent() || authUserIdRef.current !== userId)
|
|
105
147
|
return;
|
|
@@ -119,7 +161,7 @@ function useJwtMintLifecycle({ enabled, supabase, cacheKey, ttlSec, refreshBefor
|
|
|
119
161
|
}
|
|
120
162
|
if (!isCurrent() || authUserIdRef.current !== userId)
|
|
121
163
|
return;
|
|
122
|
-
|
|
164
|
+
updateMint(verified);
|
|
123
165
|
try {
|
|
124
166
|
await scoutCache.setJwtMint(cacheKey, verified, userId);
|
|
125
167
|
}
|
|
@@ -128,7 +170,7 @@ function useJwtMintLifecycle({ enabled, supabase, cacheKey, ttlSec, refreshBefor
|
|
|
128
170
|
}
|
|
129
171
|
}
|
|
130
172
|
catch (e) {
|
|
131
|
-
if (isCurrent()) {
|
|
173
|
+
if (isCurrent() && !isBrowserOffline()) {
|
|
132
174
|
setError(e instanceof Error ? e.message : "mint failed");
|
|
133
175
|
}
|
|
134
176
|
}
|
|
@@ -137,77 +179,157 @@ function useJwtMintLifecycle({ enabled, supabase, cacheKey, ttlSec, refreshBefor
|
|
|
137
179
|
setInFlight(false);
|
|
138
180
|
}
|
|
139
181
|
}
|
|
140
|
-
}, [
|
|
182
|
+
}, [
|
|
183
|
+
enabled,
|
|
184
|
+
supabase,
|
|
185
|
+
cacheKey,
|
|
186
|
+
ttlSec,
|
|
187
|
+
refreshBeforeExpirySec,
|
|
188
|
+
loadPublicKeys,
|
|
189
|
+
mintToken,
|
|
190
|
+
verifyToken,
|
|
191
|
+
updateMint,
|
|
192
|
+
notifyUserValidated,
|
|
193
|
+
]);
|
|
141
194
|
useEffect(() => {
|
|
195
|
+
const offlineIdentityChanged = offlineUserIdRef.current !== offlineUserId;
|
|
196
|
+
const supabaseChanged = supabaseRef.current !== supabase;
|
|
197
|
+
const identityChanged = offlineIdentityChanged || supabaseChanged;
|
|
198
|
+
offlineUserIdRef.current = offlineUserId;
|
|
199
|
+
supabaseRef.current = supabase;
|
|
200
|
+
if (identityChanged) {
|
|
201
|
+
authUserIdRef.current = null;
|
|
202
|
+
cacheHydrationIdRef.current++;
|
|
203
|
+
refreshIdRef.current++;
|
|
204
|
+
updateMint(null);
|
|
205
|
+
setInFlight(false);
|
|
206
|
+
}
|
|
142
207
|
if (!enabled) {
|
|
143
|
-
|
|
208
|
+
updateMint(null);
|
|
209
|
+
setError(null);
|
|
210
|
+
setInFlight(false);
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
if (validatedUserId === undefined &&
|
|
214
|
+
(supabaseChanged || (offlineIdentityChanged && offlineUserId))) {
|
|
215
|
+
signedOutRef.current = false;
|
|
216
|
+
}
|
|
217
|
+
if (validatedUserId === null) {
|
|
218
|
+
signedOutRef.current = true;
|
|
219
|
+
authUserIdRef.current = null;
|
|
220
|
+
cacheHydrationIdRef.current++;
|
|
221
|
+
refreshIdRef.current++;
|
|
222
|
+
updateMint(null);
|
|
144
223
|
setError(null);
|
|
224
|
+
setInFlight(false);
|
|
145
225
|
return;
|
|
146
226
|
}
|
|
227
|
+
if (validatedUserId) {
|
|
228
|
+
signedOutRef.current = false;
|
|
229
|
+
}
|
|
147
230
|
let cancelled = false;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
231
|
+
setError(null);
|
|
232
|
+
setInFlight(false);
|
|
233
|
+
const initializeMint = async (userIdOverride, forceRefresh = false) => {
|
|
234
|
+
if (cancelled || signedOutRef.current)
|
|
235
|
+
return;
|
|
236
|
+
const hydrationId = ++cacheHydrationIdRef.current;
|
|
237
|
+
const isCurrentHydration = () => cacheHydrationIdRef.current === hydrationId;
|
|
238
|
+
let userId = userIdOverride ??
|
|
239
|
+
validatedUserId ??
|
|
240
|
+
offlineUserId ??
|
|
241
|
+
authUserIdRef.current;
|
|
242
|
+
if (!userId) {
|
|
243
|
+
try {
|
|
244
|
+
const sessionResult = await supabase.auth.getSession();
|
|
245
|
+
if (cancelled ||
|
|
246
|
+
signedOutRef.current ||
|
|
247
|
+
!isCurrentHydration()) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
userId = sessionResult.data.session?.user?.id ?? null;
|
|
154
251
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
return;
|
|
252
|
+
catch (sessionError) {
|
|
253
|
+
console.warn("[ScoutRefreshProvider] Session cache lookup failed:", sessionError);
|
|
158
254
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
255
|
+
}
|
|
256
|
+
if (cancelled ||
|
|
257
|
+
signedOutRef.current ||
|
|
258
|
+
!isCurrentHydration()) {
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
if (userId) {
|
|
262
|
+
const userChanged = authUserIdRef.current !== userId;
|
|
263
|
+
if (userChanged) {
|
|
264
|
+
updateMint(null);
|
|
167
265
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
266
|
+
authUserIdRef.current = userId;
|
|
267
|
+
try {
|
|
268
|
+
await scoutCache.setScope(userId);
|
|
269
|
+
const cached = await scoutCache.getJwtMint(cacheKey, userId);
|
|
270
|
+
if (cancelled ||
|
|
271
|
+
signedOutRef.current ||
|
|
272
|
+
!isCurrentHydration() ||
|
|
273
|
+
authUserIdRef.current !== userId) {
|
|
171
274
|
return;
|
|
172
275
|
}
|
|
276
|
+
updateMint(cached.data);
|
|
277
|
+
}
|
|
278
|
+
catch (cacheError) {
|
|
279
|
+
console.warn(`[ScoutRefreshProvider] ${cacheKey} cache load failed:`, cacheError);
|
|
173
280
|
}
|
|
174
281
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
await refreshMint();
|
|
282
|
+
if (!cancelled &&
|
|
283
|
+
!signedOutRef.current &&
|
|
284
|
+
isCurrentHydration() &&
|
|
285
|
+
!isBrowserOffline()) {
|
|
286
|
+
await refreshMint(forceRefresh);
|
|
180
287
|
}
|
|
181
288
|
};
|
|
182
289
|
void initializeMint();
|
|
183
290
|
const unsubscribeAuth = subscribeToSupabaseAuth(supabase, (event, session) => {
|
|
184
291
|
if (event === "SIGNED_OUT") {
|
|
185
|
-
|
|
292
|
+
signedOutRef.current = true;
|
|
186
293
|
authUserIdRef.current = null;
|
|
294
|
+
cacheHydrationIdRef.current++;
|
|
187
295
|
refreshIdRef.current++;
|
|
188
|
-
|
|
296
|
+
updateMint(null);
|
|
189
297
|
setError(null);
|
|
190
298
|
setInFlight(false);
|
|
191
299
|
return;
|
|
192
300
|
}
|
|
193
301
|
if (event === "SIGNED_IN" || event === "TOKEN_REFRESHED") {
|
|
194
|
-
|
|
195
|
-
authUserIdRef.current = session?.user?.id ?? null;
|
|
302
|
+
signedOutRef.current = false;
|
|
196
303
|
refreshIdRef.current++;
|
|
197
|
-
|
|
304
|
+
setInFlight(false);
|
|
305
|
+
const userId = session?.user?.id;
|
|
306
|
+
if (userId) {
|
|
307
|
+
void initializeMint(userId, true);
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
void refreshMint();
|
|
311
|
+
}
|
|
198
312
|
}
|
|
199
313
|
});
|
|
314
|
+
const handleOnline = () => {
|
|
315
|
+
void refreshMint(false);
|
|
316
|
+
};
|
|
317
|
+
window.addEventListener("online", handleOnline);
|
|
200
318
|
return () => {
|
|
201
319
|
cancelled = true;
|
|
320
|
+
cacheHydrationIdRef.current++;
|
|
321
|
+
refreshIdRef.current++;
|
|
202
322
|
unsubscribeAuth();
|
|
323
|
+
window.removeEventListener("online", handleOnline);
|
|
203
324
|
};
|
|
204
325
|
}, [
|
|
205
326
|
enabled,
|
|
206
327
|
supabase,
|
|
328
|
+
offlineUserId,
|
|
329
|
+
validatedUserId,
|
|
207
330
|
cacheKey,
|
|
208
|
-
ttlSec,
|
|
209
|
-
refreshBeforeExpirySec,
|
|
210
331
|
refreshMint,
|
|
332
|
+
updateMint,
|
|
211
333
|
]);
|
|
212
334
|
useEffect(() => {
|
|
213
335
|
if (!enabled || !mint) {
|
|
@@ -224,12 +346,13 @@ function useJwtMintLifecycle({ enabled, supabase, cacheKey, ttlSec, refreshBefor
|
|
|
224
346
|
}, [enabled, mint, ttlSec, refreshBeforeExpirySec, refreshMint]);
|
|
225
347
|
return useMemo(() => ({ mint, status, error, refreshMint }), [mint, status, error, refreshMint]);
|
|
226
348
|
}
|
|
227
|
-
function useClientAbilitiesMintLifecycle(supabase, config) {
|
|
349
|
+
function useClientAbilitiesMintLifecycle(supabase, config, identity) {
|
|
228
350
|
const { mintClientAbilitiesToken: enabled, clientAbilitiesTokenTtlSec: ttlSec, refreshBeforeExpirySec, publicKeysCacheTtlMs, } = config;
|
|
229
351
|
const loadPublicKeys = useCachedPublicKeys(supabase, publicKeysCacheTtlMs, get_client_abilities_jwt_public_keys);
|
|
230
352
|
return useJwtMintLifecycle({
|
|
231
353
|
enabled,
|
|
232
354
|
supabase,
|
|
355
|
+
identity,
|
|
233
356
|
cacheKey: "client_abilities",
|
|
234
357
|
ttlSec,
|
|
235
358
|
refreshBeforeExpirySec,
|
|
@@ -238,12 +361,13 @@ function useClientAbilitiesMintLifecycle(supabase, config) {
|
|
|
238
361
|
verifyToken: verify_client_abilities_token,
|
|
239
362
|
});
|
|
240
363
|
}
|
|
241
|
-
function usePubsubTokenMintLifecycle(supabase, config) {
|
|
364
|
+
function usePubsubTokenMintLifecycle(supabase, config, identity) {
|
|
242
365
|
const { mintPubsubToken: enabled, pubsubTokenTtlSec: ttlSec, refreshBeforeExpirySec, publicKeysCacheTtlMs, } = config;
|
|
243
366
|
const loadPublicKeys = useCachedPublicKeys(supabase, publicKeysCacheTtlMs, get_pubsub_jwt_public_keys);
|
|
244
367
|
return useJwtMintLifecycle({
|
|
245
368
|
enabled,
|
|
246
369
|
supabase,
|
|
370
|
+
identity,
|
|
247
371
|
cacheKey: "pubsub",
|
|
248
372
|
ttlSec,
|
|
249
373
|
refreshBeforeExpirySec,
|
|
@@ -252,6 +376,51 @@ function usePubsubTokenMintLifecycle(supabase, config) {
|
|
|
252
376
|
verifyToken: verify_pubsub_token,
|
|
253
377
|
});
|
|
254
378
|
}
|
|
379
|
+
function useScoutIdentity(supabase, offlineUserId) {
|
|
380
|
+
const [validatedIdentity, setValidatedIdentity] = useState();
|
|
381
|
+
const validatedUserId = validatedIdentity?.supabase === supabase &&
|
|
382
|
+
validatedIdentity.offlineUserId === offlineUserId
|
|
383
|
+
? validatedIdentity.userId
|
|
384
|
+
: undefined;
|
|
385
|
+
const currentUserId = validatedUserId !== undefined ? validatedUserId : offlineUserId;
|
|
386
|
+
const [renderedIdentity, setRenderedIdentity] = useState({
|
|
387
|
+
supabase,
|
|
388
|
+
offlineUserId,
|
|
389
|
+
userId: currentUserId,
|
|
390
|
+
});
|
|
391
|
+
const scopeChanged = renderedIdentity.supabase !== supabase ||
|
|
392
|
+
renderedIdentity.offlineUserId !== offlineUserId;
|
|
393
|
+
const identityChanged = scopeChanged || renderedIdentity.userId !== currentUserId;
|
|
394
|
+
const hideChildren = scopeChanged ||
|
|
395
|
+
(renderedIdentity.userId !== undefined &&
|
|
396
|
+
renderedIdentity.userId !== currentUserId);
|
|
397
|
+
const onUserValidated = useCallback((userId) => {
|
|
398
|
+
setValidatedIdentity((current) => {
|
|
399
|
+
if (current?.supabase === supabase &&
|
|
400
|
+
current.offlineUserId === offlineUserId &&
|
|
401
|
+
current.userId === userId) {
|
|
402
|
+
return current;
|
|
403
|
+
}
|
|
404
|
+
return { supabase, offlineUserId, userId };
|
|
405
|
+
});
|
|
406
|
+
}, [supabase, offlineUserId]);
|
|
407
|
+
const identity = useMemo(() => ({ offlineUserId, validatedUserId, onUserValidated }), [offlineUserId, validatedUserId, onUserValidated]);
|
|
408
|
+
useEffect(() => {
|
|
409
|
+
if (identityChanged) {
|
|
410
|
+
setRenderedIdentity({
|
|
411
|
+
supabase,
|
|
412
|
+
offlineUserId,
|
|
413
|
+
userId: currentUserId,
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
}, [
|
|
417
|
+
identityChanged,
|
|
418
|
+
supabase,
|
|
419
|
+
offlineUserId,
|
|
420
|
+
currentUserId,
|
|
421
|
+
]);
|
|
422
|
+
return { identity, renderChildren: !hideChildren };
|
|
423
|
+
}
|
|
255
424
|
export function ScoutRefreshProvider({ children, abilityParams, supabase: supabaseOption, ...refreshOptions }) {
|
|
256
425
|
const internalSupabaseRef = useRef(null);
|
|
257
426
|
if (!supabaseOption && !internalSupabaseRef.current) {
|
|
@@ -262,9 +431,10 @@ export function ScoutRefreshProvider({ children, abilityParams, supabase: supaba
|
|
|
262
431
|
throw new Error("ScoutRefreshProvider could not initialize Supabase");
|
|
263
432
|
}
|
|
264
433
|
const abilitiesConfig = useMemo(() => resolveAbilityParams(abilityParams), [abilityParams]);
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
const
|
|
434
|
+
const { identity, renderChildren } = useScoutIdentity(supabase, refreshOptions.offlineUserId);
|
|
435
|
+
useScoutRefresh({ ...refreshOptions, supabase }, identity);
|
|
436
|
+
const abilities = useClientAbilitiesMintLifecycle(supabase, abilitiesConfig, identity);
|
|
437
|
+
const pubsub = usePubsubTokenMintLifecycle(supabase, abilitiesConfig, identity);
|
|
268
438
|
const value = useMemo(() => ({ supabase, abilities, pubsub }), [supabase, abilities, pubsub]);
|
|
269
|
-
return (_jsx(ScoutRefreshContext.Provider, { value: value, children: children }));
|
|
439
|
+
return (_jsx(ScoutRefreshContext.Provider, { value: value, children: renderChildren ? children : null }));
|
|
270
440
|
}
|
package/dist/server/index.d.ts
CHANGED
|
@@ -36,9 +36,9 @@ export { server_create_issuer as create_issuer, server_get_issuer_by_id as get_i
|
|
|
36
36
|
export { server_get_layers_by_herd_ids as get_layers_by_herd_ids, server_get_layers_by_herd as get_layers_by_herd, } from "../helpers/layers";
|
|
37
37
|
export { server_create_localization as create_localization, server_get_localization_by_id as get_localization_by_id, server_get_localizations as get_localizations, server_update_localization as update_localization, } from "../helpers/localizations";
|
|
38
38
|
export { server_create_manufacturer as create_manufacturer, server_get_manufacturer_by_id as get_manufacturer_by_id, server_get_manufacturers as get_manufacturers, server_update_manufacturer as update_manufacturer, } from "../helpers/manufacturers";
|
|
39
|
-
export { server_create_compliance_resource as create_compliance_resource, server_create_compliance_resource_type as create_compliance_resource_type, server_create_contact_type as create_contact_type, server_create_herd_operating_permission as create_herd_operating_permission, server_create_operating_context_contact as create_operating_context_contact, server_create_operating_context_point_of_interest as create_operating_context_point_of_interest, server_create_operating_context_point_of_interest_type as create_operating_context_point_of_interest_type, server_create_operating_permission as create_operating_permission, server_get_compliance_resource_types as get_compliance_resource_types, server_get_compliance_resources_by_localization as get_compliance_resources_by_localization, server_get_contact_types_by_localization as get_contact_types_by_localization, server_get_herd_operating_permissions_by_herd as get_herd_operating_permissions_by_herd, server_get_operating_context_contacts_by_operating_context as get_operating_context_contacts_by_operating_context, server_get_operating_context_point_of_interest_types_by_localization as get_operating_context_point_of_interest_types_by_localization, server_get_operating_context_points_of_interest_by_operating_context as get_operating_context_points_of_interest_by_operating_context, server_get_operating_permissions_by_localization as get_operating_permissions_by_localization, server_update_compliance_resource as update_compliance_resource, server_update_compliance_resource_type as update_compliance_resource_type, server_update_contact_type as update_contact_type, server_update_herd_operating_permission as update_herd_operating_permission, server_update_operating_context_contact as update_operating_context_contact, server_update_operating_context_point_of_interest as update_operating_context_point_of_interest, server_update_operating_context_point_of_interest_type as update_operating_context_point_of_interest_type, server_update_operating_permission as update_operating_permission, } from "../helpers/compliance";
|
|
39
|
+
export { server_create_compliance_resource as create_compliance_resource, server_create_compliance_resource_type as create_compliance_resource_type, server_create_conflict_type as create_conflict_type, server_create_contact_type as create_contact_type, server_create_herd_operating_permission as create_herd_operating_permission, server_create_operating_context_contact as create_operating_context_contact, server_create_operating_context_point_of_interest as create_operating_context_point_of_interest, server_create_operating_context_point_of_interest_type as create_operating_context_point_of_interest_type, server_create_operating_context_region_conflict_contact as create_operating_context_region_conflict_contact, server_create_operating_permission as create_operating_permission, server_create_operating_permission_conflict_type as create_operating_permission_conflict_type, server_create_operating_permission_document_condition as create_operating_permission_document_condition, server_create_risk_recommendation as create_risk_recommendation, server_delete_operating_permission_conflict_type as delete_operating_permission_conflict_type, server_delete_operating_permission_document_condition as delete_operating_permission_document_condition, server_get_compliance_resource_types as get_compliance_resource_types, server_get_compliance_resources_by_localization as get_compliance_resources_by_localization, server_get_conflict_types_by_localization as get_conflict_types_by_localization, server_get_contact_types_by_localization as get_contact_types_by_localization, server_get_herd_operating_permissions_by_herd as get_herd_operating_permissions_by_herd, server_get_operating_context_contacts_by_operating_context as get_operating_context_contacts_by_operating_context, server_get_operating_context_point_of_interest_types_by_localization as get_operating_context_point_of_interest_types_by_localization, server_get_operating_context_points_of_interest_by_operating_context as get_operating_context_points_of_interest_by_operating_context, server_get_operating_context_region_conflict_contacts_by_conflict as get_operating_context_region_conflict_contacts_by_conflict, server_get_operating_permission_conflict_types_by_permission as get_operating_permission_conflict_types_by_permission, server_get_operating_permission_document_conditions_by_permission as get_operating_permission_document_conditions_by_permission, server_get_operating_permissions_by_localization as get_operating_permissions_by_localization, server_get_risk_recommendations_by_conflict_type as get_risk_recommendations_by_conflict_type, server_get_risk_recommendations_by_document_condition as get_risk_recommendations_by_document_condition, server_update_compliance_resource as update_compliance_resource, server_update_compliance_resource_type as update_compliance_resource_type, server_update_conflict_type as update_conflict_type, server_update_contact_type as update_contact_type, server_update_herd_operating_permission as update_herd_operating_permission, server_update_operating_context_contact as update_operating_context_contact, server_update_operating_context_point_of_interest as update_operating_context_point_of_interest, server_update_operating_context_point_of_interest_type as update_operating_context_point_of_interest_type, server_update_operating_context_region_conflict_contact as update_operating_context_region_conflict_contact, server_update_operating_permission as update_operating_permission, server_update_risk_recommendation as update_risk_recommendation, } from "../helpers/compliance";
|
|
40
40
|
export { server_create_models_per_jobs_per_herd as create_models_per_jobs_per_herd, server_delete_models_per_jobs_per_herd_by_ids as delete_models_per_jobs_per_herd_by_ids, server_get_model_by_id as get_model_by_id, server_get_models_by_ids as get_models_by_ids, server_get_models_per_jobs_per_herd_by_herd as get_models_per_jobs_per_herd_by_herd, server_get_models as get_models, server_update_models_per_jobs_per_herd as update_models_per_jobs_per_herd, } from "../helpers/models";
|
|
41
|
-
export { server_create_document_condition as create_document_condition, server_create_operating_context_device as create_operating_context_device, server_create_operating_context_equipment_category as create_operating_context_equipment_category, server_create_operating_context_equipment_item as create_operating_context_equipment_item, server_create_operating_context_equipment_requirement as create_operating_context_equipment_requirement, server_create_operating_context_payload as create_operating_context_payload, server_create_operating_context as create_operating_context, server_create_operating_context_region as create_operating_context_region, server_create_operating_context_risk as create_operating_context_risk, server_create_operating_context_role_assignment as create_operating_context_role_assignment, server_create_operating_context_role as create_operating_context_role, server_create_operating_context_type as create_operating_context_type, server_get_document_conditions_by_localization as get_document_conditions_by_localization, server_get_operating_context_by_id as get_operating_context_by_id, server_get_operating_context_devices_by_operating_context as get_operating_context_devices_by_operating_context, server_get_operating_context_equipment_categories_by_localization as get_operating_context_equipment_categories_by_localization, server_get_operating_context_equipment_items_by_category as get_operating_context_equipment_items_by_category, server_get_operating_context_equipment_requirements_by_operating_context as get_operating_context_equipment_requirements_by_operating_context, server_get_operating_context_payloads_by_operating_context as get_operating_context_payloads_by_operating_context, server_get_operating_context_regions_by_operating_context as get_operating_context_regions_by_operating_context, server_get_operating_context_risks_by_operating_context as get_operating_context_risks_by_operating_context, server_get_operating_context_role_assignments_by_operating_context as get_operating_context_role_assignments_by_operating_context, server_get_operating_context_roles_by_localization as get_operating_context_roles_by_localization, server_get_operating_context_types_by_localization as get_operating_context_types_by_localization, server_get_operating_context_weather_snapshots as get_operating_context_weather_snapshots, server_get_operating_contexts_by_herd as get_operating_contexts_by_herd, server_update_document_condition as update_document_condition, server_update_operating_context_device as update_operating_context_device, server_update_operating_context_equipment_category as update_operating_context_equipment_category, server_update_operating_context_equipment_item as update_operating_context_equipment_item, server_update_operating_context_equipment_requirement as update_operating_context_equipment_requirement, server_update_operating_context_payload as update_operating_context_payload, server_update_operating_context as update_operating_context, server_update_operating_context_region as update_operating_context_region, server_update_operating_context_risk as update_operating_context_risk, server_update_operating_context_role_assignment as update_operating_context_role_assignment, server_update_operating_context_role as update_operating_context_role, server_update_operating_context_type as update_operating_context_type, } from "../helpers/operating_contexts";
|
|
41
|
+
export { server_create_document_condition as create_document_condition, server_create_operating_context_device as create_operating_context_device, server_create_operating_context_equipment_category as create_operating_context_equipment_category, server_create_operating_context_equipment_item as create_operating_context_equipment_item, server_create_operating_context_equipment_requirement as create_operating_context_equipment_requirement, server_create_operating_context_payload as create_operating_context_payload, server_create_operating_context as create_operating_context, server_create_operating_context_region as create_operating_context_region, server_create_operating_context_region_conflict as create_operating_context_region_conflict, server_create_operating_context_risk as create_operating_context_risk, server_create_operating_context_role_assignment as create_operating_context_role_assignment, server_create_operating_context_role as create_operating_context_role, server_create_operating_context_type as create_operating_context_type, server_get_document_conditions_by_localization as get_document_conditions_by_localization, server_get_operating_context_by_id as get_operating_context_by_id, server_get_operating_context_devices_by_operating_context as get_operating_context_devices_by_operating_context, server_get_operating_context_equipment_categories_by_localization as get_operating_context_equipment_categories_by_localization, server_get_operating_context_equipment_items_by_category as get_operating_context_equipment_items_by_category, server_get_operating_context_equipment_requirements_by_operating_context as get_operating_context_equipment_requirements_by_operating_context, server_get_operating_context_payloads_by_operating_context as get_operating_context_payloads_by_operating_context, server_get_operating_context_region_conflicts_by_region as get_operating_context_region_conflicts_by_region, server_get_operating_context_regions_by_operating_context as get_operating_context_regions_by_operating_context, server_get_operating_context_risks_by_operating_context as get_operating_context_risks_by_operating_context, server_get_operating_context_role_assignments_by_operating_context as get_operating_context_role_assignments_by_operating_context, server_get_operating_context_roles_by_localization as get_operating_context_roles_by_localization, server_get_operating_context_types_by_localization as get_operating_context_types_by_localization, server_get_operating_context_weather_snapshots as get_operating_context_weather_snapshots, server_get_operating_contexts_by_herd as get_operating_contexts_by_herd, server_update_document_condition as update_document_condition, server_update_operating_context_device as update_operating_context_device, server_update_operating_context_equipment_category as update_operating_context_equipment_category, server_update_operating_context_equipment_item as update_operating_context_equipment_item, server_update_operating_context_equipment_requirement as update_operating_context_equipment_requirement, server_update_operating_context_payload as update_operating_context_payload, server_update_operating_context as update_operating_context, server_update_operating_context_region as update_operating_context_region, server_update_operating_context_region_conflict as update_operating_context_region_conflict, server_update_operating_context_risk as update_operating_context_risk, server_update_operating_context_role_assignment as update_operating_context_role_assignment, server_update_operating_context_role as update_operating_context_role, server_update_operating_context_type as update_operating_context_type, } from "../helpers/operating_contexts";
|
|
42
42
|
export { server_get_operators_by_session_id_filtered as get_operators_by_session_id_filtered, server_get_operators_by_session_id as get_operators_by_session_id, server_get_operators_by_user_id as get_operators_by_user_id, } from "../helpers/operators";
|
|
43
43
|
export { server_create_plans as create_plans, server_delete_plans_by_ids as delete_plans_by_ids, server_get_plans_by_herd_ids as get_plans_by_herd_ids, server_get_plans_by_herd as get_plans_by_herd, } from "../helpers/plans";
|
|
44
44
|
export { server_create_product_compatibility as create_product_compatibility, server_delete_product_compatibility as delete_product_compatibility, server_get_auto_assign_accessory_product_number as get_auto_assign_accessory_product_number, server_get_product_compatibilities as get_product_compatibilities, server_update_product_compatibility as update_product_compatibility, } from "../helpers/product_compatibilities";
|
package/dist/server/index.js
CHANGED
|
@@ -36,9 +36,9 @@ export { server_create_issuer as create_issuer, server_get_issuer_by_id as get_i
|
|
|
36
36
|
export { server_get_layers_by_herd_ids as get_layers_by_herd_ids, server_get_layers_by_herd as get_layers_by_herd, } from "../helpers/layers";
|
|
37
37
|
export { server_create_localization as create_localization, server_get_localization_by_id as get_localization_by_id, server_get_localizations as get_localizations, server_update_localization as update_localization, } from "../helpers/localizations";
|
|
38
38
|
export { server_create_manufacturer as create_manufacturer, server_get_manufacturer_by_id as get_manufacturer_by_id, server_get_manufacturers as get_manufacturers, server_update_manufacturer as update_manufacturer, } from "../helpers/manufacturers";
|
|
39
|
-
export { server_create_compliance_resource as create_compliance_resource, server_create_compliance_resource_type as create_compliance_resource_type, server_create_contact_type as create_contact_type, server_create_herd_operating_permission as create_herd_operating_permission, server_create_operating_context_contact as create_operating_context_contact, server_create_operating_context_point_of_interest as create_operating_context_point_of_interest, server_create_operating_context_point_of_interest_type as create_operating_context_point_of_interest_type, server_create_operating_permission as create_operating_permission, server_get_compliance_resource_types as get_compliance_resource_types, server_get_compliance_resources_by_localization as get_compliance_resources_by_localization, server_get_contact_types_by_localization as get_contact_types_by_localization, server_get_herd_operating_permissions_by_herd as get_herd_operating_permissions_by_herd, server_get_operating_context_contacts_by_operating_context as get_operating_context_contacts_by_operating_context, server_get_operating_context_point_of_interest_types_by_localization as get_operating_context_point_of_interest_types_by_localization, server_get_operating_context_points_of_interest_by_operating_context as get_operating_context_points_of_interest_by_operating_context, server_get_operating_permissions_by_localization as get_operating_permissions_by_localization, server_update_compliance_resource as update_compliance_resource, server_update_compliance_resource_type as update_compliance_resource_type, server_update_contact_type as update_contact_type, server_update_herd_operating_permission as update_herd_operating_permission, server_update_operating_context_contact as update_operating_context_contact, server_update_operating_context_point_of_interest as update_operating_context_point_of_interest, server_update_operating_context_point_of_interest_type as update_operating_context_point_of_interest_type, server_update_operating_permission as update_operating_permission, } from "../helpers/compliance";
|
|
39
|
+
export { server_create_compliance_resource as create_compliance_resource, server_create_compliance_resource_type as create_compliance_resource_type, server_create_conflict_type as create_conflict_type, server_create_contact_type as create_contact_type, server_create_herd_operating_permission as create_herd_operating_permission, server_create_operating_context_contact as create_operating_context_contact, server_create_operating_context_point_of_interest as create_operating_context_point_of_interest, server_create_operating_context_point_of_interest_type as create_operating_context_point_of_interest_type, server_create_operating_context_region_conflict_contact as create_operating_context_region_conflict_contact, server_create_operating_permission as create_operating_permission, server_create_operating_permission_conflict_type as create_operating_permission_conflict_type, server_create_operating_permission_document_condition as create_operating_permission_document_condition, server_create_risk_recommendation as create_risk_recommendation, server_delete_operating_permission_conflict_type as delete_operating_permission_conflict_type, server_delete_operating_permission_document_condition as delete_operating_permission_document_condition, server_get_compliance_resource_types as get_compliance_resource_types, server_get_compliance_resources_by_localization as get_compliance_resources_by_localization, server_get_conflict_types_by_localization as get_conflict_types_by_localization, server_get_contact_types_by_localization as get_contact_types_by_localization, server_get_herd_operating_permissions_by_herd as get_herd_operating_permissions_by_herd, server_get_operating_context_contacts_by_operating_context as get_operating_context_contacts_by_operating_context, server_get_operating_context_point_of_interest_types_by_localization as get_operating_context_point_of_interest_types_by_localization, server_get_operating_context_points_of_interest_by_operating_context as get_operating_context_points_of_interest_by_operating_context, server_get_operating_context_region_conflict_contacts_by_conflict as get_operating_context_region_conflict_contacts_by_conflict, server_get_operating_permission_conflict_types_by_permission as get_operating_permission_conflict_types_by_permission, server_get_operating_permission_document_conditions_by_permission as get_operating_permission_document_conditions_by_permission, server_get_operating_permissions_by_localization as get_operating_permissions_by_localization, server_get_risk_recommendations_by_conflict_type as get_risk_recommendations_by_conflict_type, server_get_risk_recommendations_by_document_condition as get_risk_recommendations_by_document_condition, server_update_compliance_resource as update_compliance_resource, server_update_compliance_resource_type as update_compliance_resource_type, server_update_conflict_type as update_conflict_type, server_update_contact_type as update_contact_type, server_update_herd_operating_permission as update_herd_operating_permission, server_update_operating_context_contact as update_operating_context_contact, server_update_operating_context_point_of_interest as update_operating_context_point_of_interest, server_update_operating_context_point_of_interest_type as update_operating_context_point_of_interest_type, server_update_operating_context_region_conflict_contact as update_operating_context_region_conflict_contact, server_update_operating_permission as update_operating_permission, server_update_risk_recommendation as update_risk_recommendation, } from "../helpers/compliance";
|
|
40
40
|
export { server_create_models_per_jobs_per_herd as create_models_per_jobs_per_herd, server_delete_models_per_jobs_per_herd_by_ids as delete_models_per_jobs_per_herd_by_ids, server_get_model_by_id as get_model_by_id, server_get_models_by_ids as get_models_by_ids, server_get_models_per_jobs_per_herd_by_herd as get_models_per_jobs_per_herd_by_herd, server_get_models as get_models, server_update_models_per_jobs_per_herd as update_models_per_jobs_per_herd, } from "../helpers/models";
|
|
41
|
-
export { server_create_document_condition as create_document_condition, server_create_operating_context_device as create_operating_context_device, server_create_operating_context_equipment_category as create_operating_context_equipment_category, server_create_operating_context_equipment_item as create_operating_context_equipment_item, server_create_operating_context_equipment_requirement as create_operating_context_equipment_requirement, server_create_operating_context_payload as create_operating_context_payload, server_create_operating_context as create_operating_context, server_create_operating_context_region as create_operating_context_region, server_create_operating_context_risk as create_operating_context_risk, server_create_operating_context_role_assignment as create_operating_context_role_assignment, server_create_operating_context_role as create_operating_context_role, server_create_operating_context_type as create_operating_context_type, server_get_document_conditions_by_localization as get_document_conditions_by_localization, server_get_operating_context_by_id as get_operating_context_by_id, server_get_operating_context_devices_by_operating_context as get_operating_context_devices_by_operating_context, server_get_operating_context_equipment_categories_by_localization as get_operating_context_equipment_categories_by_localization, server_get_operating_context_equipment_items_by_category as get_operating_context_equipment_items_by_category, server_get_operating_context_equipment_requirements_by_operating_context as get_operating_context_equipment_requirements_by_operating_context, server_get_operating_context_payloads_by_operating_context as get_operating_context_payloads_by_operating_context, server_get_operating_context_regions_by_operating_context as get_operating_context_regions_by_operating_context, server_get_operating_context_risks_by_operating_context as get_operating_context_risks_by_operating_context, server_get_operating_context_role_assignments_by_operating_context as get_operating_context_role_assignments_by_operating_context, server_get_operating_context_roles_by_localization as get_operating_context_roles_by_localization, server_get_operating_context_types_by_localization as get_operating_context_types_by_localization, server_get_operating_context_weather_snapshots as get_operating_context_weather_snapshots, server_get_operating_contexts_by_herd as get_operating_contexts_by_herd, server_update_document_condition as update_document_condition, server_update_operating_context_device as update_operating_context_device, server_update_operating_context_equipment_category as update_operating_context_equipment_category, server_update_operating_context_equipment_item as update_operating_context_equipment_item, server_update_operating_context_equipment_requirement as update_operating_context_equipment_requirement, server_update_operating_context_payload as update_operating_context_payload, server_update_operating_context as update_operating_context, server_update_operating_context_region as update_operating_context_region, server_update_operating_context_risk as update_operating_context_risk, server_update_operating_context_role_assignment as update_operating_context_role_assignment, server_update_operating_context_role as update_operating_context_role, server_update_operating_context_type as update_operating_context_type, } from "../helpers/operating_contexts";
|
|
41
|
+
export { server_create_document_condition as create_document_condition, server_create_operating_context_device as create_operating_context_device, server_create_operating_context_equipment_category as create_operating_context_equipment_category, server_create_operating_context_equipment_item as create_operating_context_equipment_item, server_create_operating_context_equipment_requirement as create_operating_context_equipment_requirement, server_create_operating_context_payload as create_operating_context_payload, server_create_operating_context as create_operating_context, server_create_operating_context_region as create_operating_context_region, server_create_operating_context_region_conflict as create_operating_context_region_conflict, server_create_operating_context_risk as create_operating_context_risk, server_create_operating_context_role_assignment as create_operating_context_role_assignment, server_create_operating_context_role as create_operating_context_role, server_create_operating_context_type as create_operating_context_type, server_get_document_conditions_by_localization as get_document_conditions_by_localization, server_get_operating_context_by_id as get_operating_context_by_id, server_get_operating_context_devices_by_operating_context as get_operating_context_devices_by_operating_context, server_get_operating_context_equipment_categories_by_localization as get_operating_context_equipment_categories_by_localization, server_get_operating_context_equipment_items_by_category as get_operating_context_equipment_items_by_category, server_get_operating_context_equipment_requirements_by_operating_context as get_operating_context_equipment_requirements_by_operating_context, server_get_operating_context_payloads_by_operating_context as get_operating_context_payloads_by_operating_context, server_get_operating_context_region_conflicts_by_region as get_operating_context_region_conflicts_by_region, server_get_operating_context_regions_by_operating_context as get_operating_context_regions_by_operating_context, server_get_operating_context_risks_by_operating_context as get_operating_context_risks_by_operating_context, server_get_operating_context_role_assignments_by_operating_context as get_operating_context_role_assignments_by_operating_context, server_get_operating_context_roles_by_localization as get_operating_context_roles_by_localization, server_get_operating_context_types_by_localization as get_operating_context_types_by_localization, server_get_operating_context_weather_snapshots as get_operating_context_weather_snapshots, server_get_operating_contexts_by_herd as get_operating_contexts_by_herd, server_update_document_condition as update_document_condition, server_update_operating_context_device as update_operating_context_device, server_update_operating_context_equipment_category as update_operating_context_equipment_category, server_update_operating_context_equipment_item as update_operating_context_equipment_item, server_update_operating_context_equipment_requirement as update_operating_context_equipment_requirement, server_update_operating_context_payload as update_operating_context_payload, server_update_operating_context as update_operating_context, server_update_operating_context_region as update_operating_context_region, server_update_operating_context_region_conflict as update_operating_context_region_conflict, server_update_operating_context_risk as update_operating_context_risk, server_update_operating_context_role_assignment as update_operating_context_role_assignment, server_update_operating_context_role as update_operating_context_role, server_update_operating_context_type as update_operating_context_type, } from "../helpers/operating_contexts";
|
|
42
42
|
export { server_get_operators_by_session_id_filtered as get_operators_by_session_id_filtered, server_get_operators_by_session_id as get_operators_by_session_id, server_get_operators_by_user_id as get_operators_by_user_id, } from "../helpers/operators";
|
|
43
43
|
export { server_create_plans as create_plans, server_delete_plans_by_ids as delete_plans_by_ids, server_get_plans_by_herd_ids as get_plans_by_herd_ids, server_get_plans_by_herd as get_plans_by_herd, } from "../helpers/plans";
|
|
44
44
|
export { server_create_product_compatibility as create_product_compatibility, server_delete_product_compatibility as delete_product_compatibility, server_get_auto_assign_accessory_product_number as get_auto_assign_accessory_product_number, server_get_product_compatibilities as get_product_compatibilities, server_update_product_compatibility as update_product_compatibility, } from "../helpers/product_compatibilities";
|
package/dist/types/db.d.ts
CHANGED
|
@@ -94,6 +94,12 @@ export type IOperatingContextPointOfInterestType = Database["public"]["Tables"][
|
|
|
94
94
|
export type IOperatingContextPointOfInterest = Database["public"]["Tables"]["operating_context_points_of_interest"]["Row"];
|
|
95
95
|
export type IOperatingPermission = Database["public"]["Tables"]["operating_permissions"]["Row"];
|
|
96
96
|
export type IOperatingContextContact = Database["public"]["Tables"]["operating_context_contacts"]["Row"];
|
|
97
|
+
export type IConflictType = Database["public"]["Tables"]["conflict_types"]["Row"];
|
|
98
|
+
export type IRiskRecommendation = Database["public"]["Tables"]["risk_recommendations"]["Row"];
|
|
99
|
+
export type IOperatingContextRegionConflict = Database["public"]["Tables"]["operating_context_region_conflicts"]["Row"];
|
|
100
|
+
export type IOperatingContextRegionConflictContact = Database["public"]["Tables"]["operating_context_region_conflict_contacts"]["Row"];
|
|
101
|
+
export type IOperatingPermissionDocumentCondition = Database["public"]["Tables"]["operating_permission_document_conditions"]["Row"];
|
|
102
|
+
export type IOperatingPermissionConflictType = Database["public"]["Tables"]["operating_permission_conflict_types"]["Row"];
|
|
97
103
|
export type OperatingContextPayloadType = Database["public"]["Enums"]["operating_context_payload_type"];
|
|
98
104
|
export type OperatingContextRiskProbability = Database["public"]["Enums"]["operating_context_risk_probability"];
|
|
99
105
|
export type OperatingContextRiskSeverity = Database["public"]["Enums"]["operating_context_risk_severity"];
|
|
@@ -148,8 +154,25 @@ export type ContactTypeCreateInput = Pick<ContactTypeInsert, "localization_id" |
|
|
|
148
154
|
export type ContactTypeUpdateInput = Partial<ContactTypeCreateInput> & LifecyclePatch;
|
|
149
155
|
export type OperatingContextPointOfInterestTypeCreateInput = Pick<OperatingContextPointOfInterestTypeInsert, "localization_id" | "system_name" | "name" | "num_required">;
|
|
150
156
|
export type OperatingContextPointOfInterestTypeUpdateInput = Partial<OperatingContextPointOfInterestTypeCreateInput> & LifecyclePatch;
|
|
151
|
-
export type OperatingPermissionCreateInput = Pick<OperatingPermissionInsert, "localization_id" | "name" | "description">;
|
|
157
|
+
export type OperatingPermissionCreateInput = Pick<OperatingPermissionInsert, "localization_id" | "name" | "description" | "payload_types">;
|
|
152
158
|
export type OperatingPermissionUpdateInput = Partial<OperatingPermissionCreateInput> & LifecyclePatch;
|
|
159
|
+
export type ConflictTypeCreateInput = Pick<ConflictTypeInsert, "localization_id" | "system_name" | "name">;
|
|
160
|
+
export type ConflictTypeUpdateInput = Partial<ConflictTypeCreateInput> & LifecyclePatch;
|
|
161
|
+
export type RiskRecommendationCreateInput = Pick<RiskRecommendationInsert, "conflict_type_id" | "document_condition_id" | "hazard" | "mitigation" | "severity_before" | "probability_before" | "severity_after" | "probability_after">;
|
|
162
|
+
export type RiskRecommendationUpdateInput = Partial<RiskRecommendationCreateInput> & LifecyclePatch;
|
|
163
|
+
export interface OperatingContextRegionConflictCreateInput {
|
|
164
|
+
operating_context_region_id: number;
|
|
165
|
+
herd_id: number;
|
|
166
|
+
conflict_type_id: number;
|
|
167
|
+
name: string;
|
|
168
|
+
description?: string | null;
|
|
169
|
+
location?: GeographyPoint | GeographyPolygon | string | null;
|
|
170
|
+
}
|
|
171
|
+
export type OperatingContextRegionConflictUpdateInput = Partial<Omit<OperatingContextRegionConflictCreateInput, "operating_context_region_id" | "herd_id">> & LifecyclePatch;
|
|
172
|
+
export type OperatingContextRegionConflictContactCreateInput = Pick<OperatingContextRegionConflictContactInsert, "operating_context_region_conflict_id" | "contact_id" | "herd_id">;
|
|
173
|
+
export type OperatingContextRegionConflictContactUpdateInput = Partial<Pick<OperatingContextRegionConflictContactCreateInput, "contact_id">> & LifecyclePatch;
|
|
174
|
+
export type OperatingPermissionDocumentConditionCreateInput = Pick<OperatingPermissionDocumentConditionInsert, "operating_permission_id" | "document_condition_id">;
|
|
175
|
+
export type OperatingPermissionConflictTypeCreateInput = Pick<OperatingPermissionConflictTypeInsert, "operating_permission_id" | "conflict_type_id">;
|
|
153
176
|
export type ComplianceResourceTypeCreateInput = Pick<ComplianceResourceTypeInsert, "system_name" | "name" | "description">;
|
|
154
177
|
export type ComplianceResourceTypeUpdateInput = Partial<ComplianceResourceTypeCreateInput> & LifecyclePatch;
|
|
155
178
|
export type ComplianceResourceCreateInput = Pick<ComplianceResourceInsert, "localization_id" | "compliance_resource_type_id" | "name" | "description" | "url" | "file_uri" | "published_at">;
|
|
@@ -283,6 +306,18 @@ export type OperatingPermissionInsert = Database["public"]["Tables"]["operating_
|
|
|
283
306
|
export type OperatingPermissionUpdate = Database["public"]["Tables"]["operating_permissions"]["Update"];
|
|
284
307
|
export type OperatingContextContactInsert = Database["public"]["Tables"]["operating_context_contacts"]["Insert"];
|
|
285
308
|
export type OperatingContextContactUpdate = Database["public"]["Tables"]["operating_context_contacts"]["Update"];
|
|
309
|
+
export type ConflictTypeInsert = Database["public"]["Tables"]["conflict_types"]["Insert"];
|
|
310
|
+
export type ConflictTypeUpdate = Database["public"]["Tables"]["conflict_types"]["Update"];
|
|
311
|
+
export type RiskRecommendationInsert = Database["public"]["Tables"]["risk_recommendations"]["Insert"];
|
|
312
|
+
export type RiskRecommendationUpdate = Database["public"]["Tables"]["risk_recommendations"]["Update"];
|
|
313
|
+
export type OperatingContextRegionConflictInsert = Database["public"]["Tables"]["operating_context_region_conflicts"]["Insert"];
|
|
314
|
+
export type OperatingContextRegionConflictUpdate = Database["public"]["Tables"]["operating_context_region_conflicts"]["Update"];
|
|
315
|
+
export type OperatingContextRegionConflictContactInsert = Database["public"]["Tables"]["operating_context_region_conflict_contacts"]["Insert"];
|
|
316
|
+
export type OperatingContextRegionConflictContactUpdate = Database["public"]["Tables"]["operating_context_region_conflict_contacts"]["Update"];
|
|
317
|
+
export type OperatingPermissionDocumentConditionInsert = Database["public"]["Tables"]["operating_permission_document_conditions"]["Insert"];
|
|
318
|
+
export type OperatingPermissionDocumentConditionUpdate = Database["public"]["Tables"]["operating_permission_document_conditions"]["Update"];
|
|
319
|
+
export type OperatingPermissionConflictTypeInsert = Database["public"]["Tables"]["operating_permission_conflict_types"]["Insert"];
|
|
320
|
+
export type OperatingPermissionConflictTypeUpdate = Database["public"]["Tables"]["operating_permission_conflict_types"]["Update"];
|
|
286
321
|
export interface CredentialQueryArgs {
|
|
287
322
|
type?: string;
|
|
288
323
|
}
|
package/dist/types/jwt_mint.js
CHANGED
|
@@ -16,11 +16,11 @@ export function derive_jwt_mint_status(enabled, mint, inFlight, error) {
|
|
|
16
16
|
if (inFlight && mint?.token) {
|
|
17
17
|
return EnumJwtMintStatus.REFRESHING;
|
|
18
18
|
}
|
|
19
|
-
if (error) {
|
|
20
|
-
return EnumJwtMintStatus.ERROR;
|
|
21
|
-
}
|
|
22
19
|
if (mint?.token) {
|
|
23
20
|
return EnumJwtMintStatus.READY;
|
|
24
21
|
}
|
|
22
|
+
if (error) {
|
|
23
|
+
return EnumJwtMintStatus.ERROR;
|
|
24
|
+
}
|
|
25
25
|
return EnumJwtMintStatus.LOADING;
|
|
26
26
|
}
|