@passgage/sdk-react-native 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,7 @@
1
1
  import { AxiosRequestConfig } from 'axios';
2
2
  import React, { ReactNode } from 'react';
3
+ import * as zustand from 'zustand';
4
+ import { GeoError, GeoOptions } from 'react-native-geolocation-service';
3
5
 
4
6
  /**
5
7
  * Common types and interfaces used across the SDK
@@ -969,11 +971,41 @@ interface UseLocationReturn {
969
971
  }
970
972
  declare function useLocation(options?: UseLocationOptions): UseLocationReturn;
971
973
 
974
+ interface AuthStoreType {
975
+ loading: boolean;
976
+ error: string | null;
977
+ authStatus: boolean;
978
+ user: User | null;
979
+ restoreAuth: () => void;
980
+ login: (credentials: LoginCredentials, resolve?: (user?: User) => void, reject?: (error: string) => void) => void;
981
+ loginWithAzure: (credentials: AzureLoginCredentials, resolve?: (user?: User) => void, reject?: (error: string) => void) => void;
982
+ logout: (resolve?: () => void) => Promise<void>;
983
+ }
984
+ declare const useAuthStore: zustand.UseBoundStore<zustand.StoreApi<AuthStoreType>>;
985
+
986
+ interface LocationStoreType {
987
+ location: Coordinates | null;
988
+ error: GeoError | null;
989
+ loading: boolean;
990
+ refreshLocation: (config?: GeoOptions) => void;
991
+ }
992
+ declare const locationStore: zustand.UseBoundStore<zustand.StoreApi<LocationStoreType>>;
993
+
994
+ interface QrStoreType {
995
+ loading: boolean;
996
+ error: string | null;
997
+ qrDevices: QrDevice[];
998
+ qrAccessDevices: string[];
999
+ handleQrAccess: () => void;
1000
+ fetchQrDevicesAndAccess: () => void;
1001
+ }
1002
+ declare const qrScannerStore: zustand.UseBoundStore<zustand.StoreApi<QrStoreType>>;
1003
+
972
1004
  /**
973
1005
  * Passgage Access SDK - React Native Package
974
1006
  * Complete SDK with core functionality and React Native integration
975
1007
  */
976
1008
 
977
- declare const SDK_VERSION = "1.0.4";
1009
+ declare const SDK_VERSION = "1.0.7";
978
1010
 
979
- export { type APIError, ApiClient, type ApiClientConfig, AuthService, type AuthState, type AuthTokens, type AzureLoginCredentials, type AzureLoginResponse, type BaseResponse, type Branch, type CompanyInfo, type Coordinates, type CreateEntranceFromQRRequest, type CreateEntranceRequest, type Device, type DeviceAccessRequest, DeviceAccessService, DeviceDirection, DeviceUsage, endpoints as Endpoints, type Entrance, type EntranceQueryParams, EntranceType, type FlowResponseType, LocationService, type LocationVerificationLog, type LoginCredentials, type LoginRequest, type LoginResponse, type LoginResult, type NFCValidationOptions, type NFCValidationResult, type NearbyBranchesRequest, NfcAccessService, type PaginationMeta, PassgageAccessProvider, type PassgageAccessProviderProps, QRAccessService, type QRValidationOptions, type QRValidationResult, type QrAccessResponse, type QrDevice, type RefreshTokenRequest, type RefreshTokenResponse, type RefreshTokenResult, type ReqCreateEntrance, type RequestOptions, SDK_VERSION, type TokenInfo, type TokenStorage, type UseLocationOptions, type UseLocationReturn, type UsePassgageNFCScannerOptions, type UsePassgageNFCScannerReturn, type UsePassgageQRScanner, type UsePassgageQRScannerReturn, type User, addQrReadRecord, calculateDistance, checkOnLocation, checkRepetitiveRead, clearReadRecords, createApiClient, formatDate, formatDateTime, formatISO, formatTime, parseISO, reversedHexToDec, shouldValidateLocation, useLocation, usePassgageAccessContext, usePassgageNFCScanner, usePassgageQRScanner, validateCoordinates, validateDeviceId, validateLocation, validateNFCCode, validateQRCode };
1011
+ export { type APIError, ApiClient, type ApiClientConfig, AuthService, type AuthState, type AuthTokens, type AzureLoginCredentials, type AzureLoginResponse, type BaseResponse, type Branch, type CompanyInfo, type Coordinates, type CreateEntranceFromQRRequest, type CreateEntranceRequest, type Device, type DeviceAccessRequest, DeviceAccessService, DeviceDirection, DeviceUsage, endpoints as Endpoints, type Entrance, type EntranceQueryParams, EntranceType, type FlowResponseType, LocationService, type LocationVerificationLog, type LoginCredentials, type LoginRequest, type LoginResponse, type LoginResult, type NFCValidationOptions, type NFCValidationResult, type NearbyBranchesRequest, NfcAccessService, type PaginationMeta, PassgageAccessProvider, type PassgageAccessProviderProps, QRAccessService, type QRValidationOptions, type QRValidationResult, type QrAccessResponse, type QrDevice, type RefreshTokenRequest, type RefreshTokenResponse, type RefreshTokenResult, type ReqCreateEntrance, type RequestOptions, SDK_VERSION, type TokenInfo, type TokenStorage, type UseLocationOptions, type UseLocationReturn, type UsePassgageNFCScannerOptions, type UsePassgageNFCScannerReturn, type UsePassgageQRScanner, type UsePassgageQRScannerReturn, type User, addQrReadRecord, calculateDistance, checkOnLocation, checkRepetitiveRead, clearReadRecords, createApiClient, formatDate, formatDateTime, formatISO, formatTime, locationStore, parseISO, qrScannerStore, reversedHexToDec, shouldValidateLocation, useAuthStore, useLocation, usePassgageAccessContext, usePassgageNFCScanner, usePassgageQRScanner, validateCoordinates, validateDeviceId, validateLocation, validateNFCCode, validateQRCode };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import { AxiosRequestConfig } from 'axios';
2
2
  import React, { ReactNode } from 'react';
3
+ import * as zustand from 'zustand';
4
+ import { GeoError, GeoOptions } from 'react-native-geolocation-service';
3
5
 
4
6
  /**
5
7
  * Common types and interfaces used across the SDK
@@ -969,11 +971,41 @@ interface UseLocationReturn {
969
971
  }
970
972
  declare function useLocation(options?: UseLocationOptions): UseLocationReturn;
971
973
 
974
+ interface AuthStoreType {
975
+ loading: boolean;
976
+ error: string | null;
977
+ authStatus: boolean;
978
+ user: User | null;
979
+ restoreAuth: () => void;
980
+ login: (credentials: LoginCredentials, resolve?: (user?: User) => void, reject?: (error: string) => void) => void;
981
+ loginWithAzure: (credentials: AzureLoginCredentials, resolve?: (user?: User) => void, reject?: (error: string) => void) => void;
982
+ logout: (resolve?: () => void) => Promise<void>;
983
+ }
984
+ declare const useAuthStore: zustand.UseBoundStore<zustand.StoreApi<AuthStoreType>>;
985
+
986
+ interface LocationStoreType {
987
+ location: Coordinates | null;
988
+ error: GeoError | null;
989
+ loading: boolean;
990
+ refreshLocation: (config?: GeoOptions) => void;
991
+ }
992
+ declare const locationStore: zustand.UseBoundStore<zustand.StoreApi<LocationStoreType>>;
993
+
994
+ interface QrStoreType {
995
+ loading: boolean;
996
+ error: string | null;
997
+ qrDevices: QrDevice[];
998
+ qrAccessDevices: string[];
999
+ handleQrAccess: () => void;
1000
+ fetchQrDevicesAndAccess: () => void;
1001
+ }
1002
+ declare const qrScannerStore: zustand.UseBoundStore<zustand.StoreApi<QrStoreType>>;
1003
+
972
1004
  /**
973
1005
  * Passgage Access SDK - React Native Package
974
1006
  * Complete SDK with core functionality and React Native integration
975
1007
  */
976
1008
 
977
- declare const SDK_VERSION = "1.0.4";
1009
+ declare const SDK_VERSION = "1.0.7";
978
1010
 
979
- export { type APIError, ApiClient, type ApiClientConfig, AuthService, type AuthState, type AuthTokens, type AzureLoginCredentials, type AzureLoginResponse, type BaseResponse, type Branch, type CompanyInfo, type Coordinates, type CreateEntranceFromQRRequest, type CreateEntranceRequest, type Device, type DeviceAccessRequest, DeviceAccessService, DeviceDirection, DeviceUsage, endpoints as Endpoints, type Entrance, type EntranceQueryParams, EntranceType, type FlowResponseType, LocationService, type LocationVerificationLog, type LoginCredentials, type LoginRequest, type LoginResponse, type LoginResult, type NFCValidationOptions, type NFCValidationResult, type NearbyBranchesRequest, NfcAccessService, type PaginationMeta, PassgageAccessProvider, type PassgageAccessProviderProps, QRAccessService, type QRValidationOptions, type QRValidationResult, type QrAccessResponse, type QrDevice, type RefreshTokenRequest, type RefreshTokenResponse, type RefreshTokenResult, type ReqCreateEntrance, type RequestOptions, SDK_VERSION, type TokenInfo, type TokenStorage, type UseLocationOptions, type UseLocationReturn, type UsePassgageNFCScannerOptions, type UsePassgageNFCScannerReturn, type UsePassgageQRScanner, type UsePassgageQRScannerReturn, type User, addQrReadRecord, calculateDistance, checkOnLocation, checkRepetitiveRead, clearReadRecords, createApiClient, formatDate, formatDateTime, formatISO, formatTime, parseISO, reversedHexToDec, shouldValidateLocation, useLocation, usePassgageAccessContext, usePassgageNFCScanner, usePassgageQRScanner, validateCoordinates, validateDeviceId, validateLocation, validateNFCCode, validateQRCode };
1011
+ export { type APIError, ApiClient, type ApiClientConfig, AuthService, type AuthState, type AuthTokens, type AzureLoginCredentials, type AzureLoginResponse, type BaseResponse, type Branch, type CompanyInfo, type Coordinates, type CreateEntranceFromQRRequest, type CreateEntranceRequest, type Device, type DeviceAccessRequest, DeviceAccessService, DeviceDirection, DeviceUsage, endpoints as Endpoints, type Entrance, type EntranceQueryParams, EntranceType, type FlowResponseType, LocationService, type LocationVerificationLog, type LoginCredentials, type LoginRequest, type LoginResponse, type LoginResult, type NFCValidationOptions, type NFCValidationResult, type NearbyBranchesRequest, NfcAccessService, type PaginationMeta, PassgageAccessProvider, type PassgageAccessProviderProps, QRAccessService, type QRValidationOptions, type QRValidationResult, type QrAccessResponse, type QrDevice, type RefreshTokenRequest, type RefreshTokenResponse, type RefreshTokenResult, type ReqCreateEntrance, type RequestOptions, SDK_VERSION, type TokenInfo, type TokenStorage, type UseLocationOptions, type UseLocationReturn, type UsePassgageNFCScannerOptions, type UsePassgageNFCScannerReturn, type UsePassgageQRScanner, type UsePassgageQRScannerReturn, type User, addQrReadRecord, calculateDistance, checkOnLocation, checkRepetitiveRead, clearReadRecords, createApiClient, formatDate, formatDateTime, formatISO, formatTime, locationStore, parseISO, qrScannerStore, reversedHexToDec, shouldValidateLocation, useAuthStore, useLocation, usePassgageAccessContext, usePassgageNFCScanner, usePassgageQRScanner, validateCoordinates, validateDeviceId, validateLocation, validateNFCCode, validateQRCode };
package/dist/index.js CHANGED
@@ -1092,7 +1092,7 @@ var SecureStorage = {
1092
1092
  await SecureStorage.clearUser();
1093
1093
  }
1094
1094
  };
1095
- var qrScannerStore = zustand.create((set, get) => ({
1095
+ var qrScannerStore = zustand.create((set) => ({
1096
1096
  loading: false,
1097
1097
  error: null,
1098
1098
  qrDevices: [],
@@ -1119,7 +1119,7 @@ var qrScannerStore = zustand.create((set, get) => ({
1119
1119
  }
1120
1120
  }
1121
1121
  }));
1122
- var locationStore = zustand.create((set, get) => ({
1122
+ var locationStore = zustand.create((set) => ({
1123
1123
  location: null,
1124
1124
  error: null,
1125
1125
  loading: false,
@@ -1701,7 +1701,7 @@ function useLocation(options = {}) {
1701
1701
  }
1702
1702
 
1703
1703
  // src/index.ts
1704
- var SDK_VERSION = "1.0.4";
1704
+ var SDK_VERSION = "1.0.7";
1705
1705
 
1706
1706
  exports.ApiClient = ApiClient;
1707
1707
  exports.AuthService = AuthService;
@@ -1725,9 +1725,12 @@ exports.formatDate = formatDate;
1725
1725
  exports.formatDateTime = formatDateTime;
1726
1726
  exports.formatISO = formatISO;
1727
1727
  exports.formatTime = formatTime;
1728
+ exports.locationStore = locationStore;
1728
1729
  exports.parseISO = parseISO;
1730
+ exports.qrScannerStore = qrScannerStore;
1729
1731
  exports.reversedHexToDec = reversedHexToDec;
1730
1732
  exports.shouldValidateLocation = shouldValidateLocation;
1733
+ exports.useAuthStore = useAuthStore;
1731
1734
  exports.useLocation = useLocation;
1732
1735
  exports.usePassgageAccessContext = usePassgageAccessContext;
1733
1736
  exports.usePassgageNFCScanner = usePassgageNFCScanner;
package/dist/index.mjs CHANGED
@@ -1063,7 +1063,7 @@ var SecureStorage = {
1063
1063
  await SecureStorage.clearUser();
1064
1064
  }
1065
1065
  };
1066
- var qrScannerStore = create((set, get) => ({
1066
+ var qrScannerStore = create((set) => ({
1067
1067
  loading: false,
1068
1068
  error: null,
1069
1069
  qrDevices: [],
@@ -1090,7 +1090,7 @@ var qrScannerStore = create((set, get) => ({
1090
1090
  }
1091
1091
  }
1092
1092
  }));
1093
- var locationStore = create((set, get) => ({
1093
+ var locationStore = create((set) => ({
1094
1094
  location: null,
1095
1095
  error: null,
1096
1096
  loading: false,
@@ -1672,6 +1672,6 @@ function useLocation(options = {}) {
1672
1672
  }
1673
1673
 
1674
1674
  // src/index.ts
1675
- var SDK_VERSION = "1.0.4";
1675
+ var SDK_VERSION = "1.0.7";
1676
1676
 
1677
- export { ApiClient, AuthService, DeviceAccessService, DeviceDirection, DeviceUsage, endpoints_exports as Endpoints, EntranceType, LocationService, NfcAccessService, PassgageAccessProvider, QRAccessService, SDK_VERSION, addQrReadRecord, calculateDistance, checkOnLocation, checkRepetitiveRead, clearReadRecords, createApiClient, formatDate, formatDateTime, formatISO, formatTime, parseISO, reversedHexToDec, shouldValidateLocation, useLocation, usePassgageAccessContext, usePassgageNFCScanner, usePassgageQRScanner, validateCoordinates, validateDeviceId, validateLocation, validateNFCCode, validateQRCode };
1677
+ export { ApiClient, AuthService, DeviceAccessService, DeviceDirection, DeviceUsage, endpoints_exports as Endpoints, EntranceType, LocationService, NfcAccessService, PassgageAccessProvider, QRAccessService, SDK_VERSION, addQrReadRecord, calculateDistance, checkOnLocation, checkRepetitiveRead, clearReadRecords, createApiClient, formatDate, formatDateTime, formatISO, formatTime, locationStore, parseISO, qrScannerStore, reversedHexToDec, shouldValidateLocation, useAuthStore, useLocation, usePassgageAccessContext, usePassgageNFCScanner, usePassgageQRScanner, validateCoordinates, validateDeviceId, validateLocation, validateNFCCode, validateQRCode };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@passgage/sdk-react-native",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Passgage Access SDK - React Native wrapper with components and hooks",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -51,18 +51,16 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "axios": "^1.6.0",
54
+ "big-integer": "^1.6.52",
54
55
  "react-native-geolocation-service": "^5.3.1",
56
+ "react-native-keychain": "^8.0.0",
57
+ "react-native-nfc-manager": "^3.14.0",
55
58
  "react-native-permissions": "^5.4.4",
56
59
  "zustand": "^5.0.9"
57
60
  },
58
61
  "peerDependencies": {
59
- "big-integer": "^1.6.52",
60
62
  "react": ">=18.0.0",
61
- "react-native": ">=0.70.0",
62
- "react-native-geolocation-service": "^5.3.1",
63
- "react-native-keychain": "^8.0.0",
64
- "react-native-nfc-manager": "^3.14.0",
65
- "react-native-permissions": "^5.4.4"
63
+ "react-native": ">=0.70.0"
66
64
  },
67
65
  "devDependencies": {
68
66
  "@react-native-community/geolocation": "^3.4.0",