@passgage/sdk-react-native 1.0.5 → 1.0.6
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 +34 -2
- package/dist/index.d.ts +34 -2
- package/dist/index.js +6 -3
- package/dist/index.mjs +4 -4
- package/package.json +1 -1
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.
|
|
1009
|
+
declare const SDK_VERSION = "1.0.6";
|
|
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.
|
|
1009
|
+
declare const SDK_VERSION = "1.0.6";
|
|
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
|
|
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
|
|
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.
|
|
1704
|
+
var SDK_VERSION = "1.0.6";
|
|
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
|
|
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
|
|
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.
|
|
1675
|
+
var SDK_VERSION = "1.0.6";
|
|
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 };
|