@safercity/sdk-react 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,9 +1,11 @@
1
- import { ProxyModeConfig, DirectModeConfig, CookieModeConfig, SaferCityClientOptions, SaferCityClient, AuthMode, ApiResponse, SaferCityApiError, PanicInformationRecord, ServerSentEvent } from '@safercity/sdk';
1
+ import * as _safercity_sdk from '@safercity/sdk';
2
+ import { ProxyModeConfig, DirectModeConfig, CookieModeConfig, SaferCityClientOptions, SaferCityClient as SaferCityClient$1, AuthMode, SaferCityApiError, ServerSentEvent } from '@safercity/sdk';
2
3
  export * from '@safercity/sdk';
3
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
5
  import { ReactNode } from 'react';
5
6
  import * as _tanstack_react_query from '@tanstack/react-query';
6
7
  import { QueryClient, UseQueryOptions, UseMutationOptions } from '@tanstack/react-query';
8
+ import * as _safercity_sdk_core from '@safercity/sdk-core';
7
9
 
8
10
  /**
9
11
  * Session state for cookie-based auth
@@ -20,7 +22,7 @@ interface SessionState {
20
22
  * Context value for SaferCity provider
21
23
  */
22
24
  interface SaferCityContextValue {
23
- client: SaferCityClient;
25
+ client: SaferCityClient$1;
24
26
  mode: AuthMode;
25
27
  session: SessionState;
26
28
  /** Create session from external JWT (cookie mode only) */
@@ -102,7 +104,7 @@ declare function useSaferCity(): SaferCityContextValue;
102
104
  /**
103
105
  * Hook to access the SaferCity client
104
106
  */
105
- declare function useSaferCityClient(): SaferCityClient;
107
+ declare function useSaferCityClient(): SaferCityClient$1;
106
108
  /**
107
109
  * Hook to access session state (cookie mode)
108
110
  */
@@ -123,6 +125,9 @@ declare function useSessionManager(): {
123
125
  isLoading: boolean;
124
126
  };
125
127
 
128
+ type SaferCityClient = ReturnType<typeof useSaferCityClient>;
129
+ type QueryOptionsFor<T extends (...args: any) => any> = Omit<UseQueryOptions<Awaited<ReturnType<T>>, SaferCityApiError>, 'queryKey' | 'queryFn'>;
130
+ type MutationOptionsFor<T extends (...args: any) => any, TVariables = Parameters<T>[0]> = UseMutationOptions<Awaited<ReturnType<T>>, SaferCityApiError, TVariables>;
126
131
  declare const saferCityKeys: {
127
132
  all: readonly ["safercity"];
128
133
  health: () => readonly ["safercity", "health"];
@@ -158,428 +163,290 @@ declare const saferCityKeys: {
158
163
  crimesTypes: () => readonly ["safercity", "crimes", "types"];
159
164
  crimeCategoriesWithTypes: () => readonly ["safercity", "crimes", "categoriesWithTypes"];
160
165
  };
161
- declare function useHealthCheck(options?: Omit<UseQueryOptions<ApiResponse<{
162
- status: string;
163
- timestamp: string;
164
- }>, SaferCityApiError>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<ApiResponse<{
166
+ declare function useHealthCheck(options?: QueryOptionsFor<SaferCityClient['health']['check']>): _tanstack_react_query.UseQueryResult<_safercity_sdk_core.ApiResponse<{
165
167
  status: string;
166
168
  timestamp: string;
167
169
  }>, SaferCityApiError>;
168
- declare function useWhoAmI(options?: Omit<UseQueryOptions<ApiResponse<{
169
- tenantId: string | null;
170
- environment: string;
171
- scopes: string[];
172
- sessionId: string;
173
- }>, SaferCityApiError>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<ApiResponse<{
170
+ declare function useWhoAmI(options?: QueryOptionsFor<SaferCityClient['auth']['whoami']>): _tanstack_react_query.UseQueryResult<_safercity_sdk_core.ApiResponse<{
174
171
  tenantId: string | null;
175
172
  environment: string;
176
- scopes: string[];
173
+ scopes: Array<string>;
177
174
  sessionId: string;
178
175
  }>, SaferCityApiError>;
179
- declare function useUser(userId: string, options?: Omit<UseQueryOptions<ApiResponse<{
180
- id: string;
181
- email?: string;
182
- phone?: string;
183
- firstName?: string;
184
- lastName?: string;
185
- status: string;
186
- metadata?: Record<string, unknown>;
187
- }>, SaferCityApiError>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<ApiResponse<{
188
- id: string;
189
- email?: string;
190
- phone?: string;
191
- firstName?: string;
192
- lastName?: string;
193
- status: string;
194
- metadata?: Record<string, unknown>;
176
+ declare function useUser(userId: string, options?: QueryOptionsFor<SaferCityClient['users']['get']>): _tanstack_react_query.UseQueryResult<_safercity_sdk_core.ApiResponse<{
177
+ success: boolean;
178
+ data: {
179
+ id: string;
180
+ emailAddress: string | null;
181
+ firstName: string | null;
182
+ lastName: string | null;
183
+ phoneNumber: string | null;
184
+ status: string;
185
+ createdAt: string;
186
+ updatedAt: string;
187
+ };
195
188
  }>, SaferCityApiError>;
196
- declare function useCreateUser(options?: UseMutationOptions<ApiResponse<{
197
- id: string;
198
- email?: string;
199
- phone?: string;
200
- }>, SaferCityApiError, {
201
- email?: string;
202
- phone?: string;
203
- firstName?: string;
204
- lastName?: string;
205
- metadata?: Record<string, unknown>;
206
- }>): _tanstack_react_query.UseMutationResult<ApiResponse<{
207
- id: string;
208
- email?: string;
209
- phone?: string;
210
- }>, SaferCityApiError, {
211
- email?: string;
212
- phone?: string;
213
- firstName?: string;
214
- lastName?: string;
215
- metadata?: Record<string, unknown>;
216
- }, unknown>;
217
- declare function useUpdateUser(options?: UseMutationOptions<ApiResponse<{
218
- id: string;
219
- }>, SaferCityApiError, {
220
- userId: string;
189
+ declare function useCreateUser(options?: MutationOptionsFor<SaferCityClient['users']['create']>): _tanstack_react_query.UseMutationResult<_safercity_sdk_core.ApiResponse<{
190
+ success: boolean;
221
191
  data: {
222
- email?: string;
223
- phone?: string;
224
- firstName?: string;
225
- lastName?: string;
226
- metadata?: Record<string, unknown>;
192
+ id: string;
193
+ emailAddress: string | null;
194
+ firstName: string | null;
195
+ lastName: string | null;
196
+ phoneNumber: string | null;
197
+ status: string;
198
+ createdAt: string;
199
+ updatedAt: string;
227
200
  };
228
- }>): _tanstack_react_query.UseMutationResult<ApiResponse<{
229
- id: string;
230
- }>, SaferCityApiError, {
231
- userId: string;
201
+ message: string;
202
+ }>, SaferCityApiError, _safercity_sdk.UserCreateBody, unknown>;
203
+ declare function useUpdateUser(options?: MutationOptionsFor<SaferCityClient['users']['update'], {
204
+ userId: Parameters<SaferCityClient['users']['update']>[0];
205
+ data: Parameters<SaferCityClient['users']['update']>[1];
206
+ }>): _tanstack_react_query.UseMutationResult<_safercity_sdk_core.ApiResponse<{
207
+ success: boolean;
232
208
  data: {
233
- email?: string;
234
- phone?: string;
235
- firstName?: string;
236
- lastName?: string;
237
- metadata?: Record<string, unknown>;
209
+ id: string;
210
+ emailAddress: string | null;
211
+ firstName: string | null;
212
+ lastName: string | null;
213
+ phoneNumber: string | null;
214
+ status: string;
215
+ createdAt: string;
216
+ updatedAt: string;
238
217
  };
218
+ }>, SaferCityApiError, {
219
+ userId: Parameters<SaferCityClient["users"]["update"]>[0];
220
+ data: Parameters<SaferCityClient["users"]["update"]>[1];
239
221
  }, unknown>;
240
222
  declare function usePanic(panicId: string, query?: {
241
223
  userId?: string;
242
- }, options?: Omit<UseQueryOptions<ApiResponse<{
243
- id: string;
244
- userId: string;
245
- status: string;
246
- latitude: number;
247
- longitude: number;
248
- createdAt: string;
249
- updatedAt?: string;
250
- }>, SaferCityApiError>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<ApiResponse<{
251
- id: string;
252
- userId: string;
253
- status: string;
254
- latitude: number;
255
- longitude: number;
256
- createdAt: string;
257
- updatedAt?: string;
258
- }>, SaferCityApiError>;
259
- declare function useCreatePanic(options?: UseMutationOptions<ApiResponse<{
260
- id: string;
261
- status: string;
262
- createdAt: string;
263
- }>, SaferCityApiError, {
264
- userId: string;
265
- panicTypeId?: string;
266
- latitude: number;
267
- longitude: number;
268
- accuracy?: number;
269
- metadata?: Record<string, unknown>;
270
- }>): _tanstack_react_query.UseMutationResult<ApiResponse<{
271
- id: string;
272
- status: string;
273
- createdAt: string;
274
- }>, SaferCityApiError, {
275
- userId: string;
276
- panicTypeId?: string;
277
- latitude: number;
278
- longitude: number;
279
- accuracy?: number;
280
- metadata?: Record<string, unknown>;
224
+ }, options?: QueryOptionsFor<SaferCityClient['panics']['get']>): _tanstack_react_query.UseQueryResult<_safercity_sdk_core.ApiResponse<_safercity_sdk.PanicResponse>, SaferCityApiError>;
225
+ declare function useCreatePanic(options?: MutationOptionsFor<SaferCityClient['panics']['create']>): _tanstack_react_query.UseMutationResult<_safercity_sdk_core.ApiResponse<_safercity_sdk.PanicCreatedResponse>, SaferCityApiError, Omit<_safercity_sdk.CreatePanicBody, "userId"> & {
226
+ userId?: string;
281
227
  }, unknown>;
282
- declare function useUpdatePanicLocation(options?: UseMutationOptions<ApiResponse<{
283
- id: string;
284
- latitude: number;
285
- longitude: number;
286
- }>, SaferCityApiError, {
287
- panicId: string;
288
- data: {
289
- userId: string;
290
- latitude: number;
291
- longitude: number;
292
- accuracy?: number;
293
- };
294
- }>): _tanstack_react_query.UseMutationResult<ApiResponse<{
295
- id: string;
296
- latitude: number;
297
- longitude: number;
298
- }>, SaferCityApiError, {
299
- panicId: string;
300
- data: {
301
- userId: string;
302
- latitude: number;
303
- longitude: number;
304
- accuracy?: number;
305
- };
228
+ declare function useUpdatePanicLocation(options?: MutationOptionsFor<SaferCityClient['panics']['updateLocation'], {
229
+ panicId: Parameters<SaferCityClient['panics']['updateLocation']>[0];
230
+ data: Parameters<SaferCityClient['panics']['updateLocation']>[1];
231
+ }>): _tanstack_react_query.UseMutationResult<_safercity_sdk_core.ApiResponse<_safercity_sdk.LocationUpdateResponse>, SaferCityApiError, {
232
+ panicId: Parameters<SaferCityClient["panics"]["updateLocation"]>[0];
233
+ data: Parameters<SaferCityClient["panics"]["updateLocation"]>[1];
306
234
  }, unknown>;
307
- declare function useCancelPanic(options?: UseMutationOptions<ApiResponse<{
308
- id: string;
309
- status: string;
310
- cancelledAt: string;
311
- }>, SaferCityApiError, {
312
- panicId: string;
313
- data: {
314
- userId: string;
315
- reason?: string;
316
- };
317
- }>): _tanstack_react_query.UseMutationResult<ApiResponse<{
318
- id: string;
319
- status: string;
320
- cancelledAt: string;
321
- }>, SaferCityApiError, {
322
- panicId: string;
323
- data: {
324
- userId: string;
325
- reason?: string;
326
- };
235
+ declare function useCancelPanic(options?: MutationOptionsFor<SaferCityClient['panics']['cancel'], {
236
+ panicId: Parameters<SaferCityClient['panics']['cancel']>[0];
237
+ data: Parameters<SaferCityClient['panics']['cancel']>[1];
238
+ }>): _tanstack_react_query.UseMutationResult<_safercity_sdk_core.ApiResponse<_safercity_sdk.PanicCancelledResponse>, SaferCityApiError, {
239
+ panicId: Parameters<SaferCityClient["panics"]["cancel"]>[0];
240
+ data: Parameters<SaferCityClient["panics"]["cancel"]>[1];
327
241
  }, unknown>;
328
- declare function usePanicTypes(userId: string, options?: Omit<UseQueryOptions<ApiResponse<{
329
- types: Array<{
330
- id: string;
331
- name: string;
332
- description?: string;
333
- }>;
334
- }>, SaferCityApiError>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<ApiResponse<{
242
+ declare function usePanicTypes(userId: string, options?: QueryOptionsFor<SaferCityClient['panics']['types']>): _tanstack_react_query.UseQueryResult<_safercity_sdk_core.ApiResponse<{
335
243
  types: Array<{
336
244
  id: string;
337
245
  name: string;
338
246
  description?: string;
339
247
  }>;
340
248
  }>, SaferCityApiError>;
341
- declare function usePanicInformation(id: string, options?: Omit<UseQueryOptions<ApiResponse<{
342
- success: boolean;
343
- data: PanicInformationRecord;
344
- }>, SaferCityApiError>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<ApiResponse<{
345
- success: boolean;
346
- data: PanicInformationRecord;
347
- }>, SaferCityApiError>;
348
- declare function usePanicInformationByUser(userId: string, options?: Omit<UseQueryOptions<ApiResponse<{
349
- success: boolean;
350
- data: PanicInformationRecord;
351
- }>, SaferCityApiError>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<ApiResponse<{
352
- success: boolean;
353
- data: PanicInformationRecord;
354
- }>, SaferCityApiError>;
355
- declare function usePanicEligibility(userId: string, options?: Omit<UseQueryOptions<ApiResponse<{
249
+ declare function usePanicInformation(id: string, options?: QueryOptionsFor<SaferCityClient['panicInformation']['get']>): _tanstack_react_query.UseQueryResult<_safercity_sdk_core.ApiResponse<_safercity_sdk.PanicInformationResponse>, SaferCityApiError>;
250
+ declare function usePanicInformationByUser(userId: string, options?: QueryOptionsFor<SaferCityClient['panicInformation']['getByUser']>): _tanstack_react_query.UseQueryResult<_safercity_sdk_core.ApiResponse<_safercity_sdk.PanicInformationResponse>, SaferCityApiError>;
251
+ declare function usePanicEligibility(userId: string, options?: QueryOptionsFor<SaferCityClient['panicInformation']['validateEligibility']>): _tanstack_react_query.UseQueryResult<_safercity_sdk_core.ApiResponse<{
356
252
  success: boolean;
357
253
  data: {
358
254
  eligible: boolean;
359
255
  subscriptionActive: boolean;
360
256
  profileComplete: boolean;
361
- reasons: string[];
362
- panicInformation: PanicInformationRecord | null;
363
- subscriptionDetails: {
364
- usedSeats: number;
365
- userHasActiveSubscription: boolean;
257
+ reasons: Array<string>;
258
+ panicInformation: {
259
+ id: string;
260
+ tenantId: string;
261
+ userId: string;
262
+ phoneNumber: string;
263
+ firstName: string;
264
+ lastName: string;
265
+ idNumber: string;
266
+ duressCode: string;
267
+ emergencyContacts: string | null;
268
+ scaExternalId: string | null;
269
+ scbExternalId: string | null;
270
+ sccExternalId: string | null;
271
+ createdAt: string;
272
+ updatedAt: string;
366
273
  } | null;
367
- };
368
- }>, SaferCityApiError>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<ApiResponse<{
369
- success: boolean;
370
- data: {
371
- eligible: boolean;
372
- subscriptionActive: boolean;
373
- profileComplete: boolean;
374
- reasons: string[];
375
- panicInformation: PanicInformationRecord | null;
376
274
  subscriptionDetails: {
275
+ isPremium: boolean;
276
+ subscriptionName: string;
277
+ totalSeats: number;
377
278
  usedSeats: number;
279
+ availableSeats: number;
378
280
  userHasActiveSubscription: boolean;
379
281
  } | null;
380
282
  };
381
283
  }>, SaferCityApiError>;
382
- declare function useCreatePanicInformation(options?: UseMutationOptions<ApiResponse<{
383
- success: boolean;
384
- data: PanicInformationRecord;
385
- message: string;
386
- }>, SaferCityApiError, {
387
- userId: string;
388
- phoneNumber: string;
389
- firstName: string;
390
- lastName: string;
391
- idNumber: string;
392
- duressCode?: string;
393
- emergencyContacts?: Array<{
394
- name: string;
395
- phoneNumber: string;
396
- relationship?: string;
397
- }>;
398
- }>): _tanstack_react_query.UseMutationResult<ApiResponse<{
399
- success: boolean;
400
- data: PanicInformationRecord;
401
- message: string;
402
- }>, SaferCityApiError, {
403
- userId: string;
404
- phoneNumber: string;
405
- firstName: string;
406
- lastName: string;
407
- idNumber: string;
408
- duressCode?: string;
409
- emergencyContacts?: Array<{
410
- name: string;
411
- phoneNumber: string;
412
- relationship?: string;
413
- }>;
284
+ declare function useCreatePanicInformation(options?: MutationOptionsFor<SaferCityClient['panicInformation']['create']>): _tanstack_react_query.UseMutationResult<_safercity_sdk_core.ApiResponse<_safercity_sdk.PanicInformationCreatedResponse>, SaferCityApiError, Omit<_safercity_sdk.CreatePanicInformationBody, "userId"> & {
285
+ userId?: string;
414
286
  }, unknown>;
415
- declare function useUpdatePanicInformation(options?: UseMutationOptions<ApiResponse<{
416
- success: boolean;
417
- data: PanicInformationRecord;
418
- message: string;
419
- }>, SaferCityApiError, {
420
- id: string;
421
- data: {
422
- phoneNumber?: string;
423
- firstName?: string;
424
- lastName?: string;
425
- idNumber?: string;
426
- duressCode?: string;
427
- emergencyContacts?: Array<{
428
- name: string;
429
- phoneNumber: string;
430
- relationship?: string;
431
- }>;
432
- };
433
- }>): _tanstack_react_query.UseMutationResult<ApiResponse<{
434
- success: boolean;
435
- data: PanicInformationRecord;
436
- message: string;
437
- }>, SaferCityApiError, {
438
- id: string;
439
- data: {
440
- phoneNumber?: string;
441
- firstName?: string;
442
- lastName?: string;
443
- idNumber?: string;
444
- duressCode?: string;
445
- emergencyContacts?: Array<{
446
- name: string;
447
- phoneNumber: string;
448
- relationship?: string;
449
- }>;
450
- };
287
+ declare function useUpdatePanicInformation(options?: MutationOptionsFor<SaferCityClient['panicInformation']['update'], {
288
+ id: Parameters<SaferCityClient['panicInformation']['update']>[0];
289
+ data: Parameters<SaferCityClient['panicInformation']['update']>[1];
290
+ }>): _tanstack_react_query.UseMutationResult<_safercity_sdk_core.ApiResponse<_safercity_sdk.PanicInformationCreatedResponse>, SaferCityApiError, {
291
+ id: Parameters<SaferCityClient["panicInformation"]["update"]>[0];
292
+ data: Parameters<SaferCityClient["panicInformation"]["update"]>[1];
451
293
  }, unknown>;
452
- declare function useDeletePanicInformation(options?: UseMutationOptions<ApiResponse<{
453
- success: boolean;
454
- message: string;
455
- }>, SaferCityApiError, string>): _tanstack_react_query.UseMutationResult<ApiResponse<{
294
+ declare function useDeletePanicInformation(options?: MutationOptionsFor<SaferCityClient['panicInformation']['delete']>): _tanstack_react_query.UseMutationResult<_safercity_sdk_core.ApiResponse<{
456
295
  success: boolean;
457
296
  message: string;
458
297
  }>, SaferCityApiError, string, unknown>;
459
- declare function useSubscriptionTypes(options?: Omit<UseQueryOptions<ApiResponse<{
460
- types: Array<{
298
+ declare function useSubscriptionTypes(options?: QueryOptionsFor<SaferCityClient['subscriptions']['listTypes']>): _tanstack_react_query.UseQueryResult<_safercity_sdk_core.ApiResponse<{
299
+ data: Array<{
300
+ tenantId: string;
461
301
  id: string;
462
302
  name: string;
463
- description?: string;
464
- price?: number;
465
- }>;
466
- }>, SaferCityApiError>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<ApiResponse<{
467
- types: Array<{
468
- id: string;
469
- name: string;
470
- description?: string;
471
- price?: number;
303
+ isPremium: number;
304
+ createdAt: string;
305
+ updatedAt: string;
472
306
  }>;
473
307
  }>, SaferCityApiError>;
474
308
  declare function useSubscriptions(filters?: {
475
309
  userId?: string;
476
310
  status?: string;
477
311
  limit?: number;
478
- }, options?: Omit<UseQueryOptions<ApiResponse<{
479
- subscriptions: Array<{
480
- id: string;
481
- userId: string;
482
- subscriptionTypeId: string;
483
- status: string;
484
- }>;
485
- }>, SaferCityApiError>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<ApiResponse<{
486
- subscriptions: Array<{
312
+ }, options?: QueryOptionsFor<SaferCityClient['subscriptions']['list']>): _tanstack_react_query.UseQueryResult<_safercity_sdk_core.ApiResponse<{
313
+ data: Array<{
314
+ tenantId: string;
487
315
  id: string;
488
316
  userId: string;
489
- subscriptionTypeId: string;
317
+ tenantSubscriptionId: string;
318
+ tenantSubscriptionName?: string;
319
+ globalSubscriptionTypeName?: string;
490
320
  status: string;
321
+ createdAt: string;
322
+ updatedAt: string;
323
+ startDate?: string;
324
+ endDate?: string;
325
+ amount?: string;
326
+ billingCycle?: string;
491
327
  }>;
328
+ pagination: {
329
+ nextCursor: string | null;
330
+ hasNextPage: boolean;
331
+ total: number | null;
332
+ };
492
333
  }>, SaferCityApiError>;
493
- declare function useCreateSubscription(options?: UseMutationOptions<ApiResponse<{
494
- id: string;
495
- userId: string;
496
- subscriptionTypeId: string;
497
- status: string;
498
- }>, SaferCityApiError, {
499
- userId: string;
500
- subscriptionTypeId: string;
501
- status?: string;
502
- }>): _tanstack_react_query.UseMutationResult<ApiResponse<{
334
+ declare function useCreateSubscription(options?: MutationOptionsFor<SaferCityClient['subscriptions']['create']>): _tanstack_react_query.UseMutationResult<_safercity_sdk_core.ApiResponse<{
335
+ tenantId: string;
503
336
  id: string;
504
337
  userId: string;
505
- subscriptionTypeId: string;
338
+ tenantSubscriptionId: string;
506
339
  status: string;
340
+ createdAt: string;
341
+ updatedAt: string;
342
+ member?: {
343
+ id: string;
344
+ userId: string;
345
+ role: string;
346
+ status: string;
347
+ joinedAt: string;
348
+ };
507
349
  }>, SaferCityApiError, {
508
- userId: string;
350
+ userId?: string;
509
351
  subscriptionTypeId: string;
510
352
  status?: string;
511
353
  }, unknown>;
512
- declare function useSubscribeUser(options?: UseMutationOptions<ApiResponse<{
354
+ declare function useSubscribeUser(options?: MutationOptionsFor<SaferCityClient['subscriptions']['subscribeUser']>): _tanstack_react_query.UseMutationResult<_safercity_sdk_core.ApiResponse<{
355
+ tenantId: string;
513
356
  id: string;
514
357
  userId: string;
515
- subscriptionTypeId: string;
516
- status: string;
517
- }>, SaferCityApiError, {
518
- userId: string;
519
- subscriptionTypeId: string;
520
- }>): _tanstack_react_query.UseMutationResult<ApiResponse<{
521
- id: string;
522
- userId: string;
523
- subscriptionTypeId: string;
524
- status: string;
525
- }>, SaferCityApiError, {
358
+ tenantSubscriptionId: string;
359
+ tenantSubscriptionName?: string;
360
+ globalSubscriptionTypeName?: string;
361
+ isPremium: boolean;
362
+ createdAt: string;
363
+ updatedAt: string;
364
+ startDate?: string;
365
+ endDate?: string;
366
+ }>, SaferCityApiError, Omit<{
526
367
  userId: string;
527
- subscriptionTypeId: string;
368
+ isPremium: boolean;
369
+ startDate?: string;
370
+ endDate?: string;
371
+ notes?: string;
372
+ }, "userId"> & {
373
+ userId?: string;
528
374
  }, unknown>;
529
- declare function useBulkTriggerNotifications(options?: UseMutationOptions<ApiResponse<{
530
- transactionIds: string[];
531
- status: string;
532
- }>, SaferCityApiError, {
533
- userIds: string[];
534
- workflowId: string;
535
- payload?: Record<string, unknown>;
536
- }>): _tanstack_react_query.UseMutationResult<ApiResponse<{
537
- transactionIds: string[];
538
- status: string;
375
+ declare function useBulkTriggerNotifications(options?: MutationOptionsFor<SaferCityClient['notifications']['bulkTrigger']>): _tanstack_react_query.UseMutationResult<_safercity_sdk_core.ApiResponse<{
376
+ success: boolean;
377
+ errors?: Array<string>;
539
378
  }>, SaferCityApiError, {
540
379
  userIds: string[];
541
380
  workflowId: string;
542
381
  payload?: Record<string, unknown>;
543
382
  }, unknown>;
544
- declare function useLocationSafety(latitude: number, longitude: number, radius?: number, options?: Omit<UseQueryOptions<ApiResponse<{
545
- safetyScore: number;
546
- riskLevel: string;
547
- factors: Array<{
548
- type: string;
549
- impact: number;
550
- }>;
551
- }>, SaferCityApiError>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<ApiResponse<{
552
- safetyScore: number;
383
+ declare function useLocationSafety(latitude: number, longitude: number, radius?: number, options?: QueryOptionsFor<SaferCityClient['locationSafety']['check']>): _tanstack_react_query.UseQueryResult<_safercity_sdk_core.ApiResponse<{
384
+ status: string;
385
+ riskScore: number;
553
386
  riskLevel: string;
554
- factors: Array<{
555
- type: string;
556
- impact: number;
557
- }>;
387
+ message: string;
388
+ locationInfo: {
389
+ latitude: number;
390
+ longitude: number;
391
+ radiusMeters: number;
392
+ h3Index9: string | null;
393
+ };
394
+ crimeAnalysis: {
395
+ totalCrimes: number;
396
+ recentCrimes: number;
397
+ criticalCrimes: number;
398
+ dominantCrimeTypes: Array<string>;
399
+ oldestCrimeDate: string | null;
400
+ newestCrimeDate: string | null;
401
+ };
402
+ notificationSent: boolean;
403
+ timestamp: string;
558
404
  }>, SaferCityApiError>;
559
405
  declare function useBanner(body: {
560
406
  latitude: number;
561
407
  longitude: number;
562
408
  radius?: number;
563
- }, options?: Omit<UseQueryOptions<ApiResponse<{
564
- success: boolean;
565
- data: {
566
- totalCrimes: number;
567
- categories: Array<{
568
- name: string;
569
- count: number;
570
- }>;
571
- period: string;
409
+ }, options?: QueryOptionsFor<SaferCityClient['banner']['get']>): _tanstack_react_query.UseQueryResult<_safercity_sdk_core.ApiResponse<{
410
+ location: {
411
+ latitude: number;
412
+ longitude: number;
413
+ radiusKm: number;
414
+ locationName: string;
572
415
  };
573
- }>, SaferCityApiError>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<ApiResponse<{
574
- success: boolean;
575
- data: {
416
+ period: {
417
+ startDate: string;
418
+ endDate: string;
419
+ days: number;
420
+ };
421
+ summary: {
576
422
  totalCrimes: number;
577
- categories: Array<{
578
- name: string;
579
- count: number;
580
- }>;
581
- period: string;
423
+ averagePerDay: number;
424
+ highestSeverityCount: number;
425
+ locationsCovered: number;
582
426
  };
427
+ crimesByType: Array<{
428
+ crimeTypeId: string;
429
+ crimeTypeName: string;
430
+ crimeCategoryId: string;
431
+ crimeCategoryName: string;
432
+ count: number;
433
+ percentage: number;
434
+ severity: string;
435
+ trend: string;
436
+ trendPercentage: number;
437
+ }>;
438
+ crimesByCategory: Array<{
439
+ crimeCategoryId: string;
440
+ crimeCategoryName: string;
441
+ count: number;
442
+ percentage: number;
443
+ types: Array<string>;
444
+ }>;
445
+ topCrimeTypes: Array<{
446
+ crimeTypeId: string;
447
+ crimeTypeName: string;
448
+ count: number;
449
+ }>;
583
450
  }>, SaferCityApiError>;
584
451
  declare function useCrimes(filters?: {
585
452
  latitude?: number;
@@ -589,57 +456,67 @@ declare function useCrimes(filters?: {
589
456
  from?: string;
590
457
  to?: string;
591
458
  limit?: number;
592
- }, options?: Omit<UseQueryOptions<ApiResponse<{
593
- crimes: Array<{
459
+ }, options?: QueryOptionsFor<SaferCityClient['crimes']['list']>): _tanstack_react_query.UseQueryResult<_safercity_sdk_core.ApiResponse<{
460
+ data: Array<{
594
461
  id: string;
595
- type: string;
596
- latitude: number;
597
- longitude: number;
462
+ tenantId: string;
463
+ userId: string | unknown;
464
+ crimeTypeId: string;
465
+ severity: string;
466
+ locationIndexId: string | unknown;
467
+ latitude: string | unknown;
468
+ longitude: string | unknown;
469
+ locationAddress: string | unknown;
470
+ locationDescription: string | unknown;
471
+ title: string;
472
+ description: string | unknown;
473
+ evidenceUrls: unknown;
598
474
  occurredAt: string;
475
+ createdAt: string;
476
+ updatedAt: string;
477
+ distanceKm?: number;
599
478
  }>;
600
- }>, SaferCityApiError>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<ApiResponse<{
601
- crimes: Array<{
602
- id: string;
603
- type: string;
604
- latitude: number;
605
- longitude: number;
606
- occurredAt: string;
607
- }>;
608
- }>, SaferCityApiError>;
609
- declare function useCrimeCategories(options?: Omit<UseQueryOptions<ApiResponse<{
610
- categories: Array<{
611
- id: string;
612
- name: string;
613
- }>;
614
- }>, SaferCityApiError>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<ApiResponse<{
615
- categories: Array<{
616
- id: string;
617
- name: string;
618
- }>;
479
+ pagination: {
480
+ limit: number;
481
+ offset: number;
482
+ total: number;
483
+ };
484
+ filters: {
485
+ startDate: string;
486
+ endDate: string | unknown;
487
+ crimeTypeId: string | unknown;
488
+ crimeCategoryId: string | unknown;
489
+ location: {
490
+ latitude: number;
491
+ longitude: number;
492
+ radiusKm: number;
493
+ } | unknown;
494
+ };
619
495
  }>, SaferCityApiError>;
620
- declare function useCrimeTypes(options?: Omit<UseQueryOptions<ApiResponse<{
621
- types: Array<{
496
+ declare function useCrimeCategories(options?: QueryOptionsFor<SaferCityClient['crimes']['categories']>): _tanstack_react_query.UseQueryResult<_safercity_sdk_core.ApiResponse<{
497
+ data: Array<{
622
498
  id: string;
623
499
  name: string;
624
- categoryId: string;
625
- }>;
626
- }>, SaferCityApiError>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<ApiResponse<{
627
- types: Array<{
628
- id: string;
629
- name: string;
630
- categoryId: string;
500
+ createdAt: unknown | string | number;
501
+ updatedAt: unknown | string | number;
631
502
  }>;
503
+ total: number;
632
504
  }>, SaferCityApiError>;
633
- declare function useCrimeCategoriesWithTypes(options?: Omit<UseQueryOptions<ApiResponse<{
634
- categories: Array<{
505
+ declare function useCrimeTypes(options?: QueryOptionsFor<SaferCityClient['crimes']['types']>): _tanstack_react_query.UseQueryResult<_safercity_sdk_core.ApiResponse<{
506
+ data: Array<{
635
507
  id: string;
508
+ crimeCategoryId: string;
636
509
  name: string;
637
- types: Array<{
510
+ createdAt: unknown | string | number;
511
+ updatedAt: unknown | string | number;
512
+ category: {
638
513
  id: string;
639
514
  name: string;
640
- }>;
515
+ } | unknown;
641
516
  }>;
642
- }>, SaferCityApiError>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<ApiResponse<{
517
+ total: number;
518
+ }>, SaferCityApiError>;
519
+ declare function useCrimeCategoriesWithTypes(options?: QueryOptionsFor<SaferCityClient['crimes']['categoriesWithTypes']>): _tanstack_react_query.UseQueryResult<_safercity_sdk_core.ApiResponse<{
643
520
  categories: Array<{
644
521
  id: string;
645
522
  name: string;