@safercity/sdk-react 0.3.0 → 0.3.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/README.md +6 -1
- package/dist/index.d.cts +46 -47
- package/dist/index.d.ts +46 -47
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,11 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
React hooks and components for SaferCity SDK with TanStack Query integration.
|
|
4
4
|
|
|
5
|
+
## What's New in v0.3.1
|
|
6
|
+
|
|
7
|
+
- **Simplified Hook Data** - Hook `data` now reflects the API response body directly (no `ApiResponse` wrapper). Access `data.status` for health, `data.data.firstName` for user responses with API envelopes.
|
|
8
|
+
- **Typed Hook Errors** - All hooks use `SaferCityApiError` as the error type. Access `error.status`, `error.message`, `error.error` directly in `isError` blocks or `onError` callbacks.
|
|
9
|
+
|
|
5
10
|
## What's New in v0.3.0
|
|
6
11
|
|
|
7
12
|
- **Typed SDK Alignment** - Hooks now use the auto-generated types from `@safercity/sdk`, ensuring 1:1 alignment with the API schema.
|
|
8
13
|
- **Correct Field Names** - Mutations now use the exact API field names (`emailAddress`, `panicType`, `phoneNumber`).
|
|
9
|
-
- **
|
|
14
|
+
- **Simplified Return Types** - Domain methods now return the API body directly (no more `ApiResponse<T>` wrapper). Hook data reflects the API response structure directly (e.g., `user.data.firstName`).
|
|
10
15
|
|
|
11
16
|
## What's New in v0.2.0
|
|
12
17
|
|
package/dist/index.d.cts
CHANGED
|
@@ -5,7 +5,6 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
5
5
|
import { ReactNode } from 'react';
|
|
6
6
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
7
7
|
import { QueryClient, UseQueryOptions, UseMutationOptions } from '@tanstack/react-query';
|
|
8
|
-
import * as _safercity_sdk_core from '@safercity/sdk-core';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* Session state for cookie-based auth
|
|
@@ -163,17 +162,17 @@ declare const saferCityKeys: {
|
|
|
163
162
|
crimesTypes: () => readonly ["safercity", "crimes", "types"];
|
|
164
163
|
crimeCategoriesWithTypes: () => readonly ["safercity", "crimes", "categoriesWithTypes"];
|
|
165
164
|
};
|
|
166
|
-
declare function useHealthCheck(options?: QueryOptionsFor<SaferCityClient['health']['check']>): _tanstack_react_query.UseQueryResult<
|
|
165
|
+
declare function useHealthCheck(options?: QueryOptionsFor<SaferCityClient['health']['check']>): _tanstack_react_query.UseQueryResult<{
|
|
167
166
|
status: string;
|
|
168
167
|
timestamp: string;
|
|
169
|
-
}
|
|
170
|
-
declare function useWhoAmI(options?: QueryOptionsFor<SaferCityClient['auth']['whoami']>): _tanstack_react_query.UseQueryResult<
|
|
168
|
+
}, SaferCityApiError>;
|
|
169
|
+
declare function useWhoAmI(options?: QueryOptionsFor<SaferCityClient['auth']['whoami']>): _tanstack_react_query.UseQueryResult<{
|
|
171
170
|
tenantId: string | null;
|
|
172
171
|
environment: string;
|
|
173
172
|
scopes: Array<string>;
|
|
174
173
|
sessionId: string;
|
|
175
|
-
}
|
|
176
|
-
declare function useUser(userId: string, options?: QueryOptionsFor<SaferCityClient['users']['get']>): _tanstack_react_query.UseQueryResult<
|
|
174
|
+
}, SaferCityApiError>;
|
|
175
|
+
declare function useUser(userId: string, options?: QueryOptionsFor<SaferCityClient['users']['get']>): _tanstack_react_query.UseQueryResult<{
|
|
177
176
|
success: boolean;
|
|
178
177
|
data: {
|
|
179
178
|
id: string;
|
|
@@ -185,8 +184,8 @@ declare function useUser(userId: string, options?: QueryOptionsFor<SaferCityClie
|
|
|
185
184
|
createdAt: string;
|
|
186
185
|
updatedAt: string;
|
|
187
186
|
};
|
|
188
|
-
}
|
|
189
|
-
declare function useCreateUser(options?: MutationOptionsFor<SaferCityClient['users']['create']>): _tanstack_react_query.UseMutationResult<
|
|
187
|
+
}, SaferCityApiError>;
|
|
188
|
+
declare function useCreateUser(options?: MutationOptionsFor<SaferCityClient['users']['create']>): _tanstack_react_query.UseMutationResult<{
|
|
190
189
|
success: boolean;
|
|
191
190
|
data: {
|
|
192
191
|
id: string;
|
|
@@ -199,11 +198,11 @@ declare function useCreateUser(options?: MutationOptionsFor<SaferCityClient['use
|
|
|
199
198
|
updatedAt: string;
|
|
200
199
|
};
|
|
201
200
|
message: string;
|
|
202
|
-
}
|
|
201
|
+
}, SaferCityApiError, _safercity_sdk.UserCreateBody, unknown>;
|
|
203
202
|
declare function useUpdateUser(options?: MutationOptionsFor<SaferCityClient['users']['update'], {
|
|
204
203
|
userId: Parameters<SaferCityClient['users']['update']>[0];
|
|
205
204
|
data: Parameters<SaferCityClient['users']['update']>[1];
|
|
206
|
-
}>): _tanstack_react_query.UseMutationResult<
|
|
205
|
+
}>): _tanstack_react_query.UseMutationResult<{
|
|
207
206
|
success: boolean;
|
|
208
207
|
data: {
|
|
209
208
|
id: string;
|
|
@@ -215,40 +214,40 @@ declare function useUpdateUser(options?: MutationOptionsFor<SaferCityClient['use
|
|
|
215
214
|
createdAt: string;
|
|
216
215
|
updatedAt: string;
|
|
217
216
|
};
|
|
218
|
-
}
|
|
217
|
+
}, SaferCityApiError, {
|
|
219
218
|
userId: Parameters<SaferCityClient["users"]["update"]>[0];
|
|
220
219
|
data: Parameters<SaferCityClient["users"]["update"]>[1];
|
|
221
220
|
}, unknown>;
|
|
222
221
|
declare function usePanic(panicId: string, query?: {
|
|
223
222
|
userId?: string;
|
|
224
|
-
}, options?: QueryOptionsFor<SaferCityClient['panics']['get']>): _tanstack_react_query.UseQueryResult<
|
|
225
|
-
declare function useCreatePanic(options?: MutationOptionsFor<SaferCityClient['panics']['create']>): _tanstack_react_query.UseMutationResult<
|
|
223
|
+
}, options?: QueryOptionsFor<SaferCityClient['panics']['get']>): _tanstack_react_query.UseQueryResult<_safercity_sdk.PanicResponse, SaferCityApiError>;
|
|
224
|
+
declare function useCreatePanic(options?: MutationOptionsFor<SaferCityClient['panics']['create']>): _tanstack_react_query.UseMutationResult<_safercity_sdk.PanicCreatedResponse, SaferCityApiError, Omit<_safercity_sdk.CreatePanicBody, "userId"> & {
|
|
226
225
|
userId?: string;
|
|
227
226
|
}, unknown>;
|
|
228
227
|
declare function useUpdatePanicLocation(options?: MutationOptionsFor<SaferCityClient['panics']['updateLocation'], {
|
|
229
228
|
panicId: Parameters<SaferCityClient['panics']['updateLocation']>[0];
|
|
230
229
|
data: Parameters<SaferCityClient['panics']['updateLocation']>[1];
|
|
231
|
-
}>): _tanstack_react_query.UseMutationResult<
|
|
230
|
+
}>): _tanstack_react_query.UseMutationResult<_safercity_sdk.LocationUpdateResponse, SaferCityApiError, {
|
|
232
231
|
panicId: Parameters<SaferCityClient["panics"]["updateLocation"]>[0];
|
|
233
232
|
data: Parameters<SaferCityClient["panics"]["updateLocation"]>[1];
|
|
234
233
|
}, unknown>;
|
|
235
234
|
declare function useCancelPanic(options?: MutationOptionsFor<SaferCityClient['panics']['cancel'], {
|
|
236
235
|
panicId: Parameters<SaferCityClient['panics']['cancel']>[0];
|
|
237
236
|
data: Parameters<SaferCityClient['panics']['cancel']>[1];
|
|
238
|
-
}>): _tanstack_react_query.UseMutationResult<
|
|
237
|
+
}>): _tanstack_react_query.UseMutationResult<_safercity_sdk.PanicCancelledResponse, SaferCityApiError, {
|
|
239
238
|
panicId: Parameters<SaferCityClient["panics"]["cancel"]>[0];
|
|
240
239
|
data: Parameters<SaferCityClient["panics"]["cancel"]>[1];
|
|
241
240
|
}, unknown>;
|
|
242
|
-
declare function usePanicTypes(userId: string, options?: QueryOptionsFor<SaferCityClient['panics']['types']>): _tanstack_react_query.UseQueryResult<
|
|
241
|
+
declare function usePanicTypes(userId: string, options?: QueryOptionsFor<SaferCityClient['panics']['types']>): _tanstack_react_query.UseQueryResult<{
|
|
243
242
|
types: Array<{
|
|
244
243
|
id: string;
|
|
245
244
|
name: string;
|
|
246
245
|
description?: string;
|
|
247
246
|
}>;
|
|
248
|
-
}
|
|
249
|
-
declare function usePanicInformation(id: string, options?: QueryOptionsFor<SaferCityClient['panicInformation']['get']>): _tanstack_react_query.UseQueryResult<
|
|
250
|
-
declare function usePanicInformationByUser(userId: string, options?: QueryOptionsFor<SaferCityClient['panicInformation']['getByUser']>): _tanstack_react_query.UseQueryResult<
|
|
251
|
-
declare function usePanicEligibility(userId: string, options?: QueryOptionsFor<SaferCityClient['panicInformation']['validateEligibility']>): _tanstack_react_query.UseQueryResult<
|
|
247
|
+
}, SaferCityApiError>;
|
|
248
|
+
declare function usePanicInformation(id: string, options?: QueryOptionsFor<SaferCityClient['panicInformation']['get']>): _tanstack_react_query.UseQueryResult<_safercity_sdk.PanicInformationResponse, SaferCityApiError>;
|
|
249
|
+
declare function usePanicInformationByUser(userId: string, options?: QueryOptionsFor<SaferCityClient['panicInformation']['getByUser']>): _tanstack_react_query.UseQueryResult<_safercity_sdk.PanicInformationResponse, SaferCityApiError>;
|
|
250
|
+
declare function usePanicEligibility(userId: string, options?: QueryOptionsFor<SaferCityClient['panicInformation']['validateEligibility']>): _tanstack_react_query.UseQueryResult<{
|
|
252
251
|
success: boolean;
|
|
253
252
|
data: {
|
|
254
253
|
eligible: boolean;
|
|
@@ -280,22 +279,22 @@ declare function usePanicEligibility(userId: string, options?: QueryOptionsFor<S
|
|
|
280
279
|
userHasActiveSubscription: boolean;
|
|
281
280
|
} | null;
|
|
282
281
|
};
|
|
283
|
-
}
|
|
284
|
-
declare function useCreatePanicInformation(options?: MutationOptionsFor<SaferCityClient['panicInformation']['create']>): _tanstack_react_query.UseMutationResult<
|
|
282
|
+
}, SaferCityApiError>;
|
|
283
|
+
declare function useCreatePanicInformation(options?: MutationOptionsFor<SaferCityClient['panicInformation']['create']>): _tanstack_react_query.UseMutationResult<_safercity_sdk.PanicInformationCreatedResponse, SaferCityApiError, Omit<_safercity_sdk.CreatePanicInformationBody, "userId"> & {
|
|
285
284
|
userId?: string;
|
|
286
285
|
}, unknown>;
|
|
287
286
|
declare function useUpdatePanicInformation(options?: MutationOptionsFor<SaferCityClient['panicInformation']['update'], {
|
|
288
287
|
id: Parameters<SaferCityClient['panicInformation']['update']>[0];
|
|
289
288
|
data: Parameters<SaferCityClient['panicInformation']['update']>[1];
|
|
290
|
-
}>): _tanstack_react_query.UseMutationResult<
|
|
289
|
+
}>): _tanstack_react_query.UseMutationResult<_safercity_sdk.PanicInformationCreatedResponse, SaferCityApiError, {
|
|
291
290
|
id: Parameters<SaferCityClient["panicInformation"]["update"]>[0];
|
|
292
291
|
data: Parameters<SaferCityClient["panicInformation"]["update"]>[1];
|
|
293
292
|
}, unknown>;
|
|
294
|
-
declare function useDeletePanicInformation(options?: MutationOptionsFor<SaferCityClient['panicInformation']['delete']>): _tanstack_react_query.UseMutationResult<
|
|
293
|
+
declare function useDeletePanicInformation(options?: MutationOptionsFor<SaferCityClient['panicInformation']['delete']>): _tanstack_react_query.UseMutationResult<{
|
|
295
294
|
success: boolean;
|
|
296
295
|
message: string;
|
|
297
|
-
}
|
|
298
|
-
declare function useSubscriptionTypes(options?: QueryOptionsFor<SaferCityClient['subscriptions']['listTypes']>): _tanstack_react_query.UseQueryResult<
|
|
296
|
+
}, SaferCityApiError, string, unknown>;
|
|
297
|
+
declare function useSubscriptionTypes(options?: QueryOptionsFor<SaferCityClient['subscriptions']['listTypes']>): _tanstack_react_query.UseQueryResult<{
|
|
299
298
|
data: Array<{
|
|
300
299
|
tenantId: string;
|
|
301
300
|
id: string;
|
|
@@ -304,12 +303,12 @@ declare function useSubscriptionTypes(options?: QueryOptionsFor<SaferCityClient[
|
|
|
304
303
|
createdAt: string;
|
|
305
304
|
updatedAt: string;
|
|
306
305
|
}>;
|
|
307
|
-
}
|
|
306
|
+
}, SaferCityApiError>;
|
|
308
307
|
declare function useSubscriptions(filters?: {
|
|
309
308
|
userId?: string;
|
|
310
309
|
status?: string;
|
|
311
310
|
limit?: number;
|
|
312
|
-
}, options?: QueryOptionsFor<SaferCityClient['subscriptions']['list']>): _tanstack_react_query.UseQueryResult<
|
|
311
|
+
}, options?: QueryOptionsFor<SaferCityClient['subscriptions']['list']>): _tanstack_react_query.UseQueryResult<{
|
|
313
312
|
data: Array<{
|
|
314
313
|
tenantId: string;
|
|
315
314
|
id: string;
|
|
@@ -330,8 +329,8 @@ declare function useSubscriptions(filters?: {
|
|
|
330
329
|
hasNextPage: boolean;
|
|
331
330
|
total: number | null;
|
|
332
331
|
};
|
|
333
|
-
}
|
|
334
|
-
declare function useCreateSubscription(options?: MutationOptionsFor<SaferCityClient['subscriptions']['create']>): _tanstack_react_query.UseMutationResult<
|
|
332
|
+
}, SaferCityApiError>;
|
|
333
|
+
declare function useCreateSubscription(options?: MutationOptionsFor<SaferCityClient['subscriptions']['create']>): _tanstack_react_query.UseMutationResult<{
|
|
335
334
|
tenantId: string;
|
|
336
335
|
id: string;
|
|
337
336
|
userId: string;
|
|
@@ -346,12 +345,12 @@ declare function useCreateSubscription(options?: MutationOptionsFor<SaferCityCli
|
|
|
346
345
|
status: string;
|
|
347
346
|
joinedAt: string;
|
|
348
347
|
};
|
|
349
|
-
}
|
|
348
|
+
}, SaferCityApiError, {
|
|
350
349
|
userId?: string;
|
|
351
350
|
subscriptionTypeId: string;
|
|
352
351
|
status?: string;
|
|
353
352
|
}, unknown>;
|
|
354
|
-
declare function useSubscribeUser(options?: MutationOptionsFor<SaferCityClient['subscriptions']['subscribeUser']>): _tanstack_react_query.UseMutationResult<
|
|
353
|
+
declare function useSubscribeUser(options?: MutationOptionsFor<SaferCityClient['subscriptions']['subscribeUser']>): _tanstack_react_query.UseMutationResult<{
|
|
355
354
|
tenantId: string;
|
|
356
355
|
id: string;
|
|
357
356
|
userId: string;
|
|
@@ -363,7 +362,7 @@ declare function useSubscribeUser(options?: MutationOptionsFor<SaferCityClient['
|
|
|
363
362
|
updatedAt: string;
|
|
364
363
|
startDate?: string;
|
|
365
364
|
endDate?: string;
|
|
366
|
-
}
|
|
365
|
+
}, SaferCityApiError, Omit<{
|
|
367
366
|
userId: string;
|
|
368
367
|
isPremium: boolean;
|
|
369
368
|
startDate?: string;
|
|
@@ -372,15 +371,15 @@ declare function useSubscribeUser(options?: MutationOptionsFor<SaferCityClient['
|
|
|
372
371
|
}, "userId"> & {
|
|
373
372
|
userId?: string;
|
|
374
373
|
}, unknown>;
|
|
375
|
-
declare function useBulkTriggerNotifications(options?: MutationOptionsFor<SaferCityClient['notifications']['bulkTrigger']>): _tanstack_react_query.UseMutationResult<
|
|
374
|
+
declare function useBulkTriggerNotifications(options?: MutationOptionsFor<SaferCityClient['notifications']['bulkTrigger']>): _tanstack_react_query.UseMutationResult<{
|
|
376
375
|
success: boolean;
|
|
377
376
|
errors?: Array<string>;
|
|
378
|
-
}
|
|
377
|
+
}, SaferCityApiError, {
|
|
379
378
|
userIds: string[];
|
|
380
379
|
workflowId: string;
|
|
381
380
|
payload?: Record<string, unknown>;
|
|
382
381
|
}, unknown>;
|
|
383
|
-
declare function useLocationSafety(latitude: number, longitude: number, radius?: number, options?: QueryOptionsFor<SaferCityClient['locationSafety']['check']>): _tanstack_react_query.UseQueryResult<
|
|
382
|
+
declare function useLocationSafety(latitude: number, longitude: number, radius?: number, options?: QueryOptionsFor<SaferCityClient['locationSafety']['check']>): _tanstack_react_query.UseQueryResult<{
|
|
384
383
|
status: string;
|
|
385
384
|
riskScore: number;
|
|
386
385
|
riskLevel: string;
|
|
@@ -401,12 +400,12 @@ declare function useLocationSafety(latitude: number, longitude: number, radius?:
|
|
|
401
400
|
};
|
|
402
401
|
notificationSent: boolean;
|
|
403
402
|
timestamp: string;
|
|
404
|
-
}
|
|
403
|
+
}, SaferCityApiError>;
|
|
405
404
|
declare function useBanner(body: {
|
|
406
405
|
latitude: number;
|
|
407
406
|
longitude: number;
|
|
408
407
|
radius?: number;
|
|
409
|
-
}, options?: QueryOptionsFor<SaferCityClient['banner']['get']>): _tanstack_react_query.UseQueryResult<
|
|
408
|
+
}, options?: QueryOptionsFor<SaferCityClient['banner']['get']>): _tanstack_react_query.UseQueryResult<{
|
|
410
409
|
location: {
|
|
411
410
|
latitude: number;
|
|
412
411
|
longitude: number;
|
|
@@ -447,7 +446,7 @@ declare function useBanner(body: {
|
|
|
447
446
|
crimeTypeName: string;
|
|
448
447
|
count: number;
|
|
449
448
|
}>;
|
|
450
|
-
}
|
|
449
|
+
}, SaferCityApiError>;
|
|
451
450
|
declare function useCrimes(filters?: {
|
|
452
451
|
latitude?: number;
|
|
453
452
|
longitude?: number;
|
|
@@ -456,7 +455,7 @@ declare function useCrimes(filters?: {
|
|
|
456
455
|
from?: string;
|
|
457
456
|
to?: string;
|
|
458
457
|
limit?: number;
|
|
459
|
-
}, options?: QueryOptionsFor<SaferCityClient['crimes']['list']>): _tanstack_react_query.UseQueryResult<
|
|
458
|
+
}, options?: QueryOptionsFor<SaferCityClient['crimes']['list']>): _tanstack_react_query.UseQueryResult<{
|
|
460
459
|
data: Array<{
|
|
461
460
|
id: string;
|
|
462
461
|
tenantId: string;
|
|
@@ -492,8 +491,8 @@ declare function useCrimes(filters?: {
|
|
|
492
491
|
radiusKm: number;
|
|
493
492
|
} | unknown;
|
|
494
493
|
};
|
|
495
|
-
}
|
|
496
|
-
declare function useCrimeCategories(options?: QueryOptionsFor<SaferCityClient['crimes']['categories']>): _tanstack_react_query.UseQueryResult<
|
|
494
|
+
}, SaferCityApiError>;
|
|
495
|
+
declare function useCrimeCategories(options?: QueryOptionsFor<SaferCityClient['crimes']['categories']>): _tanstack_react_query.UseQueryResult<{
|
|
497
496
|
data: Array<{
|
|
498
497
|
id: string;
|
|
499
498
|
name: string;
|
|
@@ -501,8 +500,8 @@ declare function useCrimeCategories(options?: QueryOptionsFor<SaferCityClient['c
|
|
|
501
500
|
updatedAt: unknown | string | number;
|
|
502
501
|
}>;
|
|
503
502
|
total: number;
|
|
504
|
-
}
|
|
505
|
-
declare function useCrimeTypes(options?: QueryOptionsFor<SaferCityClient['crimes']['types']>): _tanstack_react_query.UseQueryResult<
|
|
503
|
+
}, SaferCityApiError>;
|
|
504
|
+
declare function useCrimeTypes(options?: QueryOptionsFor<SaferCityClient['crimes']['types']>): _tanstack_react_query.UseQueryResult<{
|
|
506
505
|
data: Array<{
|
|
507
506
|
id: string;
|
|
508
507
|
crimeCategoryId: string;
|
|
@@ -515,8 +514,8 @@ declare function useCrimeTypes(options?: QueryOptionsFor<SaferCityClient['crimes
|
|
|
515
514
|
} | unknown;
|
|
516
515
|
}>;
|
|
517
516
|
total: number;
|
|
518
|
-
}
|
|
519
|
-
declare function useCrimeCategoriesWithTypes(options?: QueryOptionsFor<SaferCityClient['crimes']['categoriesWithTypes']>): _tanstack_react_query.UseQueryResult<
|
|
517
|
+
}, SaferCityApiError>;
|
|
518
|
+
declare function useCrimeCategoriesWithTypes(options?: QueryOptionsFor<SaferCityClient['crimes']['categoriesWithTypes']>): _tanstack_react_query.UseQueryResult<{
|
|
520
519
|
categories: Array<{
|
|
521
520
|
id: string;
|
|
522
521
|
name: string;
|
|
@@ -525,7 +524,7 @@ declare function useCrimeCategoriesWithTypes(options?: QueryOptionsFor<SaferCity
|
|
|
525
524
|
name: string;
|
|
526
525
|
}>;
|
|
527
526
|
}>;
|
|
528
|
-
}
|
|
527
|
+
}, SaferCityApiError>;
|
|
529
528
|
|
|
530
529
|
/**
|
|
531
530
|
* State for streaming hooks
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
5
5
|
import { ReactNode } from 'react';
|
|
6
6
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
7
7
|
import { QueryClient, UseQueryOptions, UseMutationOptions } from '@tanstack/react-query';
|
|
8
|
-
import * as _safercity_sdk_core from '@safercity/sdk-core';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* Session state for cookie-based auth
|
|
@@ -163,17 +162,17 @@ declare const saferCityKeys: {
|
|
|
163
162
|
crimesTypes: () => readonly ["safercity", "crimes", "types"];
|
|
164
163
|
crimeCategoriesWithTypes: () => readonly ["safercity", "crimes", "categoriesWithTypes"];
|
|
165
164
|
};
|
|
166
|
-
declare function useHealthCheck(options?: QueryOptionsFor<SaferCityClient['health']['check']>): _tanstack_react_query.UseQueryResult<
|
|
165
|
+
declare function useHealthCheck(options?: QueryOptionsFor<SaferCityClient['health']['check']>): _tanstack_react_query.UseQueryResult<{
|
|
167
166
|
status: string;
|
|
168
167
|
timestamp: string;
|
|
169
|
-
}
|
|
170
|
-
declare function useWhoAmI(options?: QueryOptionsFor<SaferCityClient['auth']['whoami']>): _tanstack_react_query.UseQueryResult<
|
|
168
|
+
}, SaferCityApiError>;
|
|
169
|
+
declare function useWhoAmI(options?: QueryOptionsFor<SaferCityClient['auth']['whoami']>): _tanstack_react_query.UseQueryResult<{
|
|
171
170
|
tenantId: string | null;
|
|
172
171
|
environment: string;
|
|
173
172
|
scopes: Array<string>;
|
|
174
173
|
sessionId: string;
|
|
175
|
-
}
|
|
176
|
-
declare function useUser(userId: string, options?: QueryOptionsFor<SaferCityClient['users']['get']>): _tanstack_react_query.UseQueryResult<
|
|
174
|
+
}, SaferCityApiError>;
|
|
175
|
+
declare function useUser(userId: string, options?: QueryOptionsFor<SaferCityClient['users']['get']>): _tanstack_react_query.UseQueryResult<{
|
|
177
176
|
success: boolean;
|
|
178
177
|
data: {
|
|
179
178
|
id: string;
|
|
@@ -185,8 +184,8 @@ declare function useUser(userId: string, options?: QueryOptionsFor<SaferCityClie
|
|
|
185
184
|
createdAt: string;
|
|
186
185
|
updatedAt: string;
|
|
187
186
|
};
|
|
188
|
-
}
|
|
189
|
-
declare function useCreateUser(options?: MutationOptionsFor<SaferCityClient['users']['create']>): _tanstack_react_query.UseMutationResult<
|
|
187
|
+
}, SaferCityApiError>;
|
|
188
|
+
declare function useCreateUser(options?: MutationOptionsFor<SaferCityClient['users']['create']>): _tanstack_react_query.UseMutationResult<{
|
|
190
189
|
success: boolean;
|
|
191
190
|
data: {
|
|
192
191
|
id: string;
|
|
@@ -199,11 +198,11 @@ declare function useCreateUser(options?: MutationOptionsFor<SaferCityClient['use
|
|
|
199
198
|
updatedAt: string;
|
|
200
199
|
};
|
|
201
200
|
message: string;
|
|
202
|
-
}
|
|
201
|
+
}, SaferCityApiError, _safercity_sdk.UserCreateBody, unknown>;
|
|
203
202
|
declare function useUpdateUser(options?: MutationOptionsFor<SaferCityClient['users']['update'], {
|
|
204
203
|
userId: Parameters<SaferCityClient['users']['update']>[0];
|
|
205
204
|
data: Parameters<SaferCityClient['users']['update']>[1];
|
|
206
|
-
}>): _tanstack_react_query.UseMutationResult<
|
|
205
|
+
}>): _tanstack_react_query.UseMutationResult<{
|
|
207
206
|
success: boolean;
|
|
208
207
|
data: {
|
|
209
208
|
id: string;
|
|
@@ -215,40 +214,40 @@ declare function useUpdateUser(options?: MutationOptionsFor<SaferCityClient['use
|
|
|
215
214
|
createdAt: string;
|
|
216
215
|
updatedAt: string;
|
|
217
216
|
};
|
|
218
|
-
}
|
|
217
|
+
}, SaferCityApiError, {
|
|
219
218
|
userId: Parameters<SaferCityClient["users"]["update"]>[0];
|
|
220
219
|
data: Parameters<SaferCityClient["users"]["update"]>[1];
|
|
221
220
|
}, unknown>;
|
|
222
221
|
declare function usePanic(panicId: string, query?: {
|
|
223
222
|
userId?: string;
|
|
224
|
-
}, options?: QueryOptionsFor<SaferCityClient['panics']['get']>): _tanstack_react_query.UseQueryResult<
|
|
225
|
-
declare function useCreatePanic(options?: MutationOptionsFor<SaferCityClient['panics']['create']>): _tanstack_react_query.UseMutationResult<
|
|
223
|
+
}, options?: QueryOptionsFor<SaferCityClient['panics']['get']>): _tanstack_react_query.UseQueryResult<_safercity_sdk.PanicResponse, SaferCityApiError>;
|
|
224
|
+
declare function useCreatePanic(options?: MutationOptionsFor<SaferCityClient['panics']['create']>): _tanstack_react_query.UseMutationResult<_safercity_sdk.PanicCreatedResponse, SaferCityApiError, Omit<_safercity_sdk.CreatePanicBody, "userId"> & {
|
|
226
225
|
userId?: string;
|
|
227
226
|
}, unknown>;
|
|
228
227
|
declare function useUpdatePanicLocation(options?: MutationOptionsFor<SaferCityClient['panics']['updateLocation'], {
|
|
229
228
|
panicId: Parameters<SaferCityClient['panics']['updateLocation']>[0];
|
|
230
229
|
data: Parameters<SaferCityClient['panics']['updateLocation']>[1];
|
|
231
|
-
}>): _tanstack_react_query.UseMutationResult<
|
|
230
|
+
}>): _tanstack_react_query.UseMutationResult<_safercity_sdk.LocationUpdateResponse, SaferCityApiError, {
|
|
232
231
|
panicId: Parameters<SaferCityClient["panics"]["updateLocation"]>[0];
|
|
233
232
|
data: Parameters<SaferCityClient["panics"]["updateLocation"]>[1];
|
|
234
233
|
}, unknown>;
|
|
235
234
|
declare function useCancelPanic(options?: MutationOptionsFor<SaferCityClient['panics']['cancel'], {
|
|
236
235
|
panicId: Parameters<SaferCityClient['panics']['cancel']>[0];
|
|
237
236
|
data: Parameters<SaferCityClient['panics']['cancel']>[1];
|
|
238
|
-
}>): _tanstack_react_query.UseMutationResult<
|
|
237
|
+
}>): _tanstack_react_query.UseMutationResult<_safercity_sdk.PanicCancelledResponse, SaferCityApiError, {
|
|
239
238
|
panicId: Parameters<SaferCityClient["panics"]["cancel"]>[0];
|
|
240
239
|
data: Parameters<SaferCityClient["panics"]["cancel"]>[1];
|
|
241
240
|
}, unknown>;
|
|
242
|
-
declare function usePanicTypes(userId: string, options?: QueryOptionsFor<SaferCityClient['panics']['types']>): _tanstack_react_query.UseQueryResult<
|
|
241
|
+
declare function usePanicTypes(userId: string, options?: QueryOptionsFor<SaferCityClient['panics']['types']>): _tanstack_react_query.UseQueryResult<{
|
|
243
242
|
types: Array<{
|
|
244
243
|
id: string;
|
|
245
244
|
name: string;
|
|
246
245
|
description?: string;
|
|
247
246
|
}>;
|
|
248
|
-
}
|
|
249
|
-
declare function usePanicInformation(id: string, options?: QueryOptionsFor<SaferCityClient['panicInformation']['get']>): _tanstack_react_query.UseQueryResult<
|
|
250
|
-
declare function usePanicInformationByUser(userId: string, options?: QueryOptionsFor<SaferCityClient['panicInformation']['getByUser']>): _tanstack_react_query.UseQueryResult<
|
|
251
|
-
declare function usePanicEligibility(userId: string, options?: QueryOptionsFor<SaferCityClient['panicInformation']['validateEligibility']>): _tanstack_react_query.UseQueryResult<
|
|
247
|
+
}, SaferCityApiError>;
|
|
248
|
+
declare function usePanicInformation(id: string, options?: QueryOptionsFor<SaferCityClient['panicInformation']['get']>): _tanstack_react_query.UseQueryResult<_safercity_sdk.PanicInformationResponse, SaferCityApiError>;
|
|
249
|
+
declare function usePanicInformationByUser(userId: string, options?: QueryOptionsFor<SaferCityClient['panicInformation']['getByUser']>): _tanstack_react_query.UseQueryResult<_safercity_sdk.PanicInformationResponse, SaferCityApiError>;
|
|
250
|
+
declare function usePanicEligibility(userId: string, options?: QueryOptionsFor<SaferCityClient['panicInformation']['validateEligibility']>): _tanstack_react_query.UseQueryResult<{
|
|
252
251
|
success: boolean;
|
|
253
252
|
data: {
|
|
254
253
|
eligible: boolean;
|
|
@@ -280,22 +279,22 @@ declare function usePanicEligibility(userId: string, options?: QueryOptionsFor<S
|
|
|
280
279
|
userHasActiveSubscription: boolean;
|
|
281
280
|
} | null;
|
|
282
281
|
};
|
|
283
|
-
}
|
|
284
|
-
declare function useCreatePanicInformation(options?: MutationOptionsFor<SaferCityClient['panicInformation']['create']>): _tanstack_react_query.UseMutationResult<
|
|
282
|
+
}, SaferCityApiError>;
|
|
283
|
+
declare function useCreatePanicInformation(options?: MutationOptionsFor<SaferCityClient['panicInformation']['create']>): _tanstack_react_query.UseMutationResult<_safercity_sdk.PanicInformationCreatedResponse, SaferCityApiError, Omit<_safercity_sdk.CreatePanicInformationBody, "userId"> & {
|
|
285
284
|
userId?: string;
|
|
286
285
|
}, unknown>;
|
|
287
286
|
declare function useUpdatePanicInformation(options?: MutationOptionsFor<SaferCityClient['panicInformation']['update'], {
|
|
288
287
|
id: Parameters<SaferCityClient['panicInformation']['update']>[0];
|
|
289
288
|
data: Parameters<SaferCityClient['panicInformation']['update']>[1];
|
|
290
|
-
}>): _tanstack_react_query.UseMutationResult<
|
|
289
|
+
}>): _tanstack_react_query.UseMutationResult<_safercity_sdk.PanicInformationCreatedResponse, SaferCityApiError, {
|
|
291
290
|
id: Parameters<SaferCityClient["panicInformation"]["update"]>[0];
|
|
292
291
|
data: Parameters<SaferCityClient["panicInformation"]["update"]>[1];
|
|
293
292
|
}, unknown>;
|
|
294
|
-
declare function useDeletePanicInformation(options?: MutationOptionsFor<SaferCityClient['panicInformation']['delete']>): _tanstack_react_query.UseMutationResult<
|
|
293
|
+
declare function useDeletePanicInformation(options?: MutationOptionsFor<SaferCityClient['panicInformation']['delete']>): _tanstack_react_query.UseMutationResult<{
|
|
295
294
|
success: boolean;
|
|
296
295
|
message: string;
|
|
297
|
-
}
|
|
298
|
-
declare function useSubscriptionTypes(options?: QueryOptionsFor<SaferCityClient['subscriptions']['listTypes']>): _tanstack_react_query.UseQueryResult<
|
|
296
|
+
}, SaferCityApiError, string, unknown>;
|
|
297
|
+
declare function useSubscriptionTypes(options?: QueryOptionsFor<SaferCityClient['subscriptions']['listTypes']>): _tanstack_react_query.UseQueryResult<{
|
|
299
298
|
data: Array<{
|
|
300
299
|
tenantId: string;
|
|
301
300
|
id: string;
|
|
@@ -304,12 +303,12 @@ declare function useSubscriptionTypes(options?: QueryOptionsFor<SaferCityClient[
|
|
|
304
303
|
createdAt: string;
|
|
305
304
|
updatedAt: string;
|
|
306
305
|
}>;
|
|
307
|
-
}
|
|
306
|
+
}, SaferCityApiError>;
|
|
308
307
|
declare function useSubscriptions(filters?: {
|
|
309
308
|
userId?: string;
|
|
310
309
|
status?: string;
|
|
311
310
|
limit?: number;
|
|
312
|
-
}, options?: QueryOptionsFor<SaferCityClient['subscriptions']['list']>): _tanstack_react_query.UseQueryResult<
|
|
311
|
+
}, options?: QueryOptionsFor<SaferCityClient['subscriptions']['list']>): _tanstack_react_query.UseQueryResult<{
|
|
313
312
|
data: Array<{
|
|
314
313
|
tenantId: string;
|
|
315
314
|
id: string;
|
|
@@ -330,8 +329,8 @@ declare function useSubscriptions(filters?: {
|
|
|
330
329
|
hasNextPage: boolean;
|
|
331
330
|
total: number | null;
|
|
332
331
|
};
|
|
333
|
-
}
|
|
334
|
-
declare function useCreateSubscription(options?: MutationOptionsFor<SaferCityClient['subscriptions']['create']>): _tanstack_react_query.UseMutationResult<
|
|
332
|
+
}, SaferCityApiError>;
|
|
333
|
+
declare function useCreateSubscription(options?: MutationOptionsFor<SaferCityClient['subscriptions']['create']>): _tanstack_react_query.UseMutationResult<{
|
|
335
334
|
tenantId: string;
|
|
336
335
|
id: string;
|
|
337
336
|
userId: string;
|
|
@@ -346,12 +345,12 @@ declare function useCreateSubscription(options?: MutationOptionsFor<SaferCityCli
|
|
|
346
345
|
status: string;
|
|
347
346
|
joinedAt: string;
|
|
348
347
|
};
|
|
349
|
-
}
|
|
348
|
+
}, SaferCityApiError, {
|
|
350
349
|
userId?: string;
|
|
351
350
|
subscriptionTypeId: string;
|
|
352
351
|
status?: string;
|
|
353
352
|
}, unknown>;
|
|
354
|
-
declare function useSubscribeUser(options?: MutationOptionsFor<SaferCityClient['subscriptions']['subscribeUser']>): _tanstack_react_query.UseMutationResult<
|
|
353
|
+
declare function useSubscribeUser(options?: MutationOptionsFor<SaferCityClient['subscriptions']['subscribeUser']>): _tanstack_react_query.UseMutationResult<{
|
|
355
354
|
tenantId: string;
|
|
356
355
|
id: string;
|
|
357
356
|
userId: string;
|
|
@@ -363,7 +362,7 @@ declare function useSubscribeUser(options?: MutationOptionsFor<SaferCityClient['
|
|
|
363
362
|
updatedAt: string;
|
|
364
363
|
startDate?: string;
|
|
365
364
|
endDate?: string;
|
|
366
|
-
}
|
|
365
|
+
}, SaferCityApiError, Omit<{
|
|
367
366
|
userId: string;
|
|
368
367
|
isPremium: boolean;
|
|
369
368
|
startDate?: string;
|
|
@@ -372,15 +371,15 @@ declare function useSubscribeUser(options?: MutationOptionsFor<SaferCityClient['
|
|
|
372
371
|
}, "userId"> & {
|
|
373
372
|
userId?: string;
|
|
374
373
|
}, unknown>;
|
|
375
|
-
declare function useBulkTriggerNotifications(options?: MutationOptionsFor<SaferCityClient['notifications']['bulkTrigger']>): _tanstack_react_query.UseMutationResult<
|
|
374
|
+
declare function useBulkTriggerNotifications(options?: MutationOptionsFor<SaferCityClient['notifications']['bulkTrigger']>): _tanstack_react_query.UseMutationResult<{
|
|
376
375
|
success: boolean;
|
|
377
376
|
errors?: Array<string>;
|
|
378
|
-
}
|
|
377
|
+
}, SaferCityApiError, {
|
|
379
378
|
userIds: string[];
|
|
380
379
|
workflowId: string;
|
|
381
380
|
payload?: Record<string, unknown>;
|
|
382
381
|
}, unknown>;
|
|
383
|
-
declare function useLocationSafety(latitude: number, longitude: number, radius?: number, options?: QueryOptionsFor<SaferCityClient['locationSafety']['check']>): _tanstack_react_query.UseQueryResult<
|
|
382
|
+
declare function useLocationSafety(latitude: number, longitude: number, radius?: number, options?: QueryOptionsFor<SaferCityClient['locationSafety']['check']>): _tanstack_react_query.UseQueryResult<{
|
|
384
383
|
status: string;
|
|
385
384
|
riskScore: number;
|
|
386
385
|
riskLevel: string;
|
|
@@ -401,12 +400,12 @@ declare function useLocationSafety(latitude: number, longitude: number, radius?:
|
|
|
401
400
|
};
|
|
402
401
|
notificationSent: boolean;
|
|
403
402
|
timestamp: string;
|
|
404
|
-
}
|
|
403
|
+
}, SaferCityApiError>;
|
|
405
404
|
declare function useBanner(body: {
|
|
406
405
|
latitude: number;
|
|
407
406
|
longitude: number;
|
|
408
407
|
radius?: number;
|
|
409
|
-
}, options?: QueryOptionsFor<SaferCityClient['banner']['get']>): _tanstack_react_query.UseQueryResult<
|
|
408
|
+
}, options?: QueryOptionsFor<SaferCityClient['banner']['get']>): _tanstack_react_query.UseQueryResult<{
|
|
410
409
|
location: {
|
|
411
410
|
latitude: number;
|
|
412
411
|
longitude: number;
|
|
@@ -447,7 +446,7 @@ declare function useBanner(body: {
|
|
|
447
446
|
crimeTypeName: string;
|
|
448
447
|
count: number;
|
|
449
448
|
}>;
|
|
450
|
-
}
|
|
449
|
+
}, SaferCityApiError>;
|
|
451
450
|
declare function useCrimes(filters?: {
|
|
452
451
|
latitude?: number;
|
|
453
452
|
longitude?: number;
|
|
@@ -456,7 +455,7 @@ declare function useCrimes(filters?: {
|
|
|
456
455
|
from?: string;
|
|
457
456
|
to?: string;
|
|
458
457
|
limit?: number;
|
|
459
|
-
}, options?: QueryOptionsFor<SaferCityClient['crimes']['list']>): _tanstack_react_query.UseQueryResult<
|
|
458
|
+
}, options?: QueryOptionsFor<SaferCityClient['crimes']['list']>): _tanstack_react_query.UseQueryResult<{
|
|
460
459
|
data: Array<{
|
|
461
460
|
id: string;
|
|
462
461
|
tenantId: string;
|
|
@@ -492,8 +491,8 @@ declare function useCrimes(filters?: {
|
|
|
492
491
|
radiusKm: number;
|
|
493
492
|
} | unknown;
|
|
494
493
|
};
|
|
495
|
-
}
|
|
496
|
-
declare function useCrimeCategories(options?: QueryOptionsFor<SaferCityClient['crimes']['categories']>): _tanstack_react_query.UseQueryResult<
|
|
494
|
+
}, SaferCityApiError>;
|
|
495
|
+
declare function useCrimeCategories(options?: QueryOptionsFor<SaferCityClient['crimes']['categories']>): _tanstack_react_query.UseQueryResult<{
|
|
497
496
|
data: Array<{
|
|
498
497
|
id: string;
|
|
499
498
|
name: string;
|
|
@@ -501,8 +500,8 @@ declare function useCrimeCategories(options?: QueryOptionsFor<SaferCityClient['c
|
|
|
501
500
|
updatedAt: unknown | string | number;
|
|
502
501
|
}>;
|
|
503
502
|
total: number;
|
|
504
|
-
}
|
|
505
|
-
declare function useCrimeTypes(options?: QueryOptionsFor<SaferCityClient['crimes']['types']>): _tanstack_react_query.UseQueryResult<
|
|
503
|
+
}, SaferCityApiError>;
|
|
504
|
+
declare function useCrimeTypes(options?: QueryOptionsFor<SaferCityClient['crimes']['types']>): _tanstack_react_query.UseQueryResult<{
|
|
506
505
|
data: Array<{
|
|
507
506
|
id: string;
|
|
508
507
|
crimeCategoryId: string;
|
|
@@ -515,8 +514,8 @@ declare function useCrimeTypes(options?: QueryOptionsFor<SaferCityClient['crimes
|
|
|
515
514
|
} | unknown;
|
|
516
515
|
}>;
|
|
517
516
|
total: number;
|
|
518
|
-
}
|
|
519
|
-
declare function useCrimeCategoriesWithTypes(options?: QueryOptionsFor<SaferCityClient['crimes']['categoriesWithTypes']>): _tanstack_react_query.UseQueryResult<
|
|
517
|
+
}, SaferCityApiError>;
|
|
518
|
+
declare function useCrimeCategoriesWithTypes(options?: QueryOptionsFor<SaferCityClient['crimes']['categoriesWithTypes']>): _tanstack_react_query.UseQueryResult<{
|
|
520
519
|
categories: Array<{
|
|
521
520
|
id: string;
|
|
522
521
|
name: string;
|
|
@@ -525,7 +524,7 @@ declare function useCrimeCategoriesWithTypes(options?: QueryOptionsFor<SaferCity
|
|
|
525
524
|
name: string;
|
|
526
525
|
}>;
|
|
527
526
|
}>;
|
|
528
|
-
}
|
|
527
|
+
}, SaferCityApiError>;
|
|
529
528
|
|
|
530
529
|
/**
|
|
531
530
|
* State for streaming hooks
|