@stamprally/core 0.20.1 → 0.21.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/README.md +9 -4
- package/dist/index.cjs +13 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -5
- package/dist/index.d.ts +25 -5
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -348,10 +348,30 @@ declare function rebuildUserStateLog(baseline: UserRallyState, operations: Reado
|
|
|
348
348
|
type QueueOperationStatus = "PENDING" | "IN_FLIGHT" | "ACCEPTED" | "REJECTED_PERMANENT" | "FAILED_RETRYABLE";
|
|
349
349
|
type OfflineStorageCapability = "indexeddb" | "localstorage" | "memory" | "custom" | "volatile_single_tab";
|
|
350
350
|
type MultiTabSyncCapability = "supported_web_locks" | "disabled_unsafe_environment";
|
|
351
|
-
|
|
352
|
-
|
|
351
|
+
type QueueCapabilityMode = "persistent" | "volatile_memory";
|
|
352
|
+
type LegacyQueueCapability = "persistent" | "volatile";
|
|
353
|
+
interface QueueCapability {
|
|
354
|
+
/** 永続性の状態。永続ストレージの種類は `storage` で確認できます。 */
|
|
355
|
+
readonly mode: QueueCapabilityMode;
|
|
356
|
+
/** 複数タブ排他同期の対応レベル。 */
|
|
353
357
|
readonly multiTabSync: MultiTabSyncCapability;
|
|
358
|
+
/**
|
|
359
|
+
* @deprecated `mode === "persistent"` を使用してください。永続ストレージを利用できるかを
|
|
360
|
+
* 示す移行用の互換フラグです。
|
|
361
|
+
*/
|
|
362
|
+
readonly isPersistent: boolean;
|
|
363
|
+
/**
|
|
364
|
+
* @deprecated `mode` と `multiTabSync` を使用してください。`persistent` は
|
|
365
|
+
* `mode === "persistent"`、`volatile` は `mode === "volatile_memory"` に対応します。
|
|
366
|
+
*/
|
|
367
|
+
readonly legacy: LegacyQueueCapability;
|
|
368
|
+
/** 実際に選択されたストレージの種類。 */
|
|
369
|
+
readonly storage: OfflineStorageCapability;
|
|
354
370
|
}
|
|
371
|
+
/** @deprecated Use QueueCapability. */
|
|
372
|
+
type OfflineQueueCapability = QueueCapability;
|
|
373
|
+
/** @deprecated Use `capability.mode` and `capability.multiTabSync`. */
|
|
374
|
+
declare function getLegacyQueueCapability(capability: QueueCapability): LegacyQueueCapability;
|
|
355
375
|
type OfflineOperation = {
|
|
356
376
|
readonly kind: "checkIn";
|
|
357
377
|
readonly request: CheckInRequest;
|
|
@@ -478,7 +498,7 @@ declare class OfflineQueue {
|
|
|
478
498
|
constructor(options?: OfflineQueueOptions);
|
|
479
499
|
get syncState(): SyncState;
|
|
480
500
|
get pendingCount(): number;
|
|
481
|
-
get queueCapability():
|
|
501
|
+
get queueCapability(): QueueCapability;
|
|
482
502
|
get storageCapability(): OfflineStorageCapability;
|
|
483
503
|
get isStoragePersistent(): boolean;
|
|
484
504
|
get rejectedHistory(): ReadonlyArray<RejectedOperationHistoryEntry>;
|
|
@@ -782,7 +802,7 @@ declare class StampRallyClient {
|
|
|
782
802
|
get pendingCount(): number;
|
|
783
803
|
get rejectedHistory(): ReadonlyArray<RejectedOperationHistoryEntry>;
|
|
784
804
|
getSyncRevision(): number;
|
|
785
|
-
get queueCapability():
|
|
805
|
+
get queueCapability(): QueueCapability;
|
|
786
806
|
get storageCapability(): OfflineStorageCapability;
|
|
787
807
|
get isStoragePersistent(): boolean;
|
|
788
808
|
discardRejected(operationId: string): Promise<boolean>;
|
|
@@ -911,4 +931,4 @@ type SnapshotTokenVerification<T extends SnapshotTokenPayload = SnapshotTokenPay
|
|
|
911
931
|
declare function createSignedSnapshotToken<T extends SnapshotTokenPayload>(payload: T, secretKey: SnapshotSecretKey): Promise<string>;
|
|
912
932
|
declare function verifySnapshotToken<T extends SnapshotTokenPayload = SnapshotTokenPayload>(token: string, secretKey: SnapshotSecretKey, now?: number): Promise<SnapshotTokenVerification<T>>;
|
|
913
933
|
|
|
914
|
-
export { type AdminRallyConfig, type CheckInCondition, type CheckInOptions, type CheckInRequest, type CheckInResult, type CheckInSuccess, type ClaimOptions, type ClaimRequest, type ClaimResult, type ClaimSuccess, type ClaimTicketOptions, type ClientError, type ClientEvent, type ClientEventListener, type ClientListener, type ClientOptions, type CompositeConditionFailure, type ConditionMatch, type ConditionMismatch, ConfigValidationError, type ConflictResolutionPolicy, type ConsumeResult, type ConsumeRewardParams, type CustomValidationContext, type CustomValidator, DEFAULT_SHEET_THEME, type DetectorError, type DetectorErrorCode, type DetectorKind, type DetectorResult, type ExternalReference, type FontFamily, type GeoDetectorOptions, type GeoVerificationContext, MemoryQueueStorage as InMemoryOfflineQueueStorage, InMemoryStorage, IndexedDBAdapter, type IndexedDBAdapterOptions, type IndexedDBOfflineQueueOptions, IndexedDBOfflineQueueStorage, type InventoryAggregationMode, LocalStorageAdapter, type LocalStorageAdapterOptions, type LocalStorageFailureMode, type LocaleDictionary, type LocalizedString, type LocalizedText, type MultiTabSyncCapability, type NfcDetectorOptions, type NfcVerificationContext, type OfflineConflictResult, type OfflineOperation, type OfflineOperationError, type OfflineOperationLifecycleStatus, type OfflineOperationResponse, type OfflineOperationStatus, OfflineQueue, type OfflineQueueCapability, type OfflineQueueCapabilityWarning, type OfflineQueueChangeListener, type OfflineQueueOptions, type OfflineQueueStorage, type OfflineResult, type OfflineSender, type OfflineStorageCapability, type OfflineSyncResultEvent, type OfflineSyncResultListener, type ParseResult, type PasscodeCondition$1 as PasscodeCondition, type ProcessStampValue, type PublicCheckInCondition, type PublicConfigSafety, type PublicRallyConfig, type PublicReward, type PublicSpotItem, type QrDetectorOptions, type QrVerificationContext, type QueueOperationStatus, type RallyConfig, type RallyInventory, type RallyInventoryState, type RallySnapshot, type RebuildUserStateOptions, type RebuildUserStateResult, type RedemptionMethod, type RejectedOperation, type RejectedOperationHistoryEntry, type Result, type Reward, type RewardConsumeError, type RewardState, type RewardStatus, type RewardType, type RewardUnlockCondition, type SecureTokenError, type SecureTokenErrorCode, type SecureTokenOptions, type SecureTokenPayload, type SecureTokenSecretKey, type SecureTokenVerification, type SheetTheme, type SlotShape, type SnapshotSecretKey, type SnapshotTokenError, type SnapshotTokenErrorCode, type SnapshotTokenPayload, type SnapshotTokenVerification, type SpotItem, type SpotStatus, type StampError, StampRallyClient, type StampRallyProgress, type StampRallyState, type StampRecord, type StampStorage, StorageAdapterError, type StorageAdapterErrorCode, type StorageLike, type StorageOperation, type StorageWarningHandler, type SupportedLocale, type SyncAdapter, type SyncConflictPolicy, type SyncEventListener, type SyncLifecycleEvent, type SyncOperationAction, type SyncOperationResult, type SyncProgressResponse, type SyncRetryOptions, type SyncState, THEME_PRESETS, type ThemePreset, type ThemePresetId, type UserRallyState, type ValidationError, type Validator, type VerificationContext, assertPublicConfig, calculateDistanceMeters, calculateProgress, consumeReward, createAnonymousSessionId, createClaimTicketNumber, createSecureToken, createSignedSnapshotToken, createUniqueClaimTicketNumber, evaluateCondition, evaluateConditionDetailed, evaluateSpotStatus, exportProgressToken, getCurrentGeoContext, getOrderedSpots, getSpotStatus, importProgressToken, isGeolocationSupported, isNfcSupported, isPublicConfig, isQrSupported, isRewardState, isStampRallyState, issueClaimTicketNumber, normalizePasscode, offlineOperationId, parseAdminConfig, parsePublicConfig, processStamp, readNfcContext, readQrContext, rebuildUserStateFromLog, rebuildUserStateLog, reconcileRewardStates, resolveLocalizedText, resolveRallyStateConflict, rollbackOptimisticOperation, safeParseAdminConfig, safeParsePublicConfig, sanitizeAdminConfig, storageKey, toLocalizedString, toPublicConfig, updateLocalizedField, validatePublicConfigSafety, validateRallyConfigRelations, verifyPasscode, verifySecureToken, verifySnapshotToken };
|
|
934
|
+
export { type AdminRallyConfig, type CheckInCondition, type CheckInOptions, type CheckInRequest, type CheckInResult, type CheckInSuccess, type ClaimOptions, type ClaimRequest, type ClaimResult, type ClaimSuccess, type ClaimTicketOptions, type ClientError, type ClientEvent, type ClientEventListener, type ClientListener, type ClientOptions, type CompositeConditionFailure, type ConditionMatch, type ConditionMismatch, ConfigValidationError, type ConflictResolutionPolicy, type ConsumeResult, type ConsumeRewardParams, type CustomValidationContext, type CustomValidator, DEFAULT_SHEET_THEME, type DetectorError, type DetectorErrorCode, type DetectorKind, type DetectorResult, type ExternalReference, type FontFamily, type GeoDetectorOptions, type GeoVerificationContext, MemoryQueueStorage as InMemoryOfflineQueueStorage, InMemoryStorage, IndexedDBAdapter, type IndexedDBAdapterOptions, type IndexedDBOfflineQueueOptions, IndexedDBOfflineQueueStorage, type InventoryAggregationMode, type LegacyQueueCapability, LocalStorageAdapter, type LocalStorageAdapterOptions, type LocalStorageFailureMode, type LocaleDictionary, type LocalizedString, type LocalizedText, type MultiTabSyncCapability, type NfcDetectorOptions, type NfcVerificationContext, type OfflineConflictResult, type OfflineOperation, type OfflineOperationError, type OfflineOperationLifecycleStatus, type OfflineOperationResponse, type OfflineOperationStatus, OfflineQueue, type OfflineQueueCapability, type OfflineQueueCapabilityWarning, type OfflineQueueChangeListener, type OfflineQueueOptions, type OfflineQueueStorage, type OfflineResult, type OfflineSender, type OfflineStorageCapability, type OfflineSyncResultEvent, type OfflineSyncResultListener, type ParseResult, type PasscodeCondition$1 as PasscodeCondition, type ProcessStampValue, type PublicCheckInCondition, type PublicConfigSafety, type PublicRallyConfig, type PublicReward, type PublicSpotItem, type QrDetectorOptions, type QrVerificationContext, type QueueCapability, type QueueCapabilityMode, type QueueOperationStatus, type RallyConfig, type RallyInventory, type RallyInventoryState, type RallySnapshot, type RebuildUserStateOptions, type RebuildUserStateResult, type RedemptionMethod, type RejectedOperation, type RejectedOperationHistoryEntry, type Result, type Reward, type RewardConsumeError, type RewardState, type RewardStatus, type RewardType, type RewardUnlockCondition, type SecureTokenError, type SecureTokenErrorCode, type SecureTokenOptions, type SecureTokenPayload, type SecureTokenSecretKey, type SecureTokenVerification, type SheetTheme, type SlotShape, type SnapshotSecretKey, type SnapshotTokenError, type SnapshotTokenErrorCode, type SnapshotTokenPayload, type SnapshotTokenVerification, type SpotItem, type SpotStatus, type StampError, StampRallyClient, type StampRallyProgress, type StampRallyState, type StampRecord, type StampStorage, StorageAdapterError, type StorageAdapterErrorCode, type StorageLike, type StorageOperation, type StorageWarningHandler, type SupportedLocale, type SyncAdapter, type SyncConflictPolicy, type SyncEventListener, type SyncLifecycleEvent, type SyncOperationAction, type SyncOperationResult, type SyncProgressResponse, type SyncRetryOptions, type SyncState, THEME_PRESETS, type ThemePreset, type ThemePresetId, type UserRallyState, type ValidationError, type Validator, type VerificationContext, assertPublicConfig, calculateDistanceMeters, calculateProgress, consumeReward, createAnonymousSessionId, createClaimTicketNumber, createSecureToken, createSignedSnapshotToken, createUniqueClaimTicketNumber, evaluateCondition, evaluateConditionDetailed, evaluateSpotStatus, exportProgressToken, getCurrentGeoContext, getLegacyQueueCapability, getOrderedSpots, getSpotStatus, importProgressToken, isGeolocationSupported, isNfcSupported, isPublicConfig, isQrSupported, isRewardState, isStampRallyState, issueClaimTicketNumber, normalizePasscode, offlineOperationId, parseAdminConfig, parsePublicConfig, processStamp, readNfcContext, readQrContext, rebuildUserStateFromLog, rebuildUserStateLog, reconcileRewardStates, resolveLocalizedText, resolveRallyStateConflict, rollbackOptimisticOperation, safeParseAdminConfig, safeParsePublicConfig, sanitizeAdminConfig, storageKey, toLocalizedString, toPublicConfig, updateLocalizedField, validatePublicConfigSafety, validateRallyConfigRelations, verifyPasscode, verifySecureToken, verifySnapshotToken };
|
package/dist/index.d.ts
CHANGED
|
@@ -348,10 +348,30 @@ declare function rebuildUserStateLog(baseline: UserRallyState, operations: Reado
|
|
|
348
348
|
type QueueOperationStatus = "PENDING" | "IN_FLIGHT" | "ACCEPTED" | "REJECTED_PERMANENT" | "FAILED_RETRYABLE";
|
|
349
349
|
type OfflineStorageCapability = "indexeddb" | "localstorage" | "memory" | "custom" | "volatile_single_tab";
|
|
350
350
|
type MultiTabSyncCapability = "supported_web_locks" | "disabled_unsafe_environment";
|
|
351
|
-
|
|
352
|
-
|
|
351
|
+
type QueueCapabilityMode = "persistent" | "volatile_memory";
|
|
352
|
+
type LegacyQueueCapability = "persistent" | "volatile";
|
|
353
|
+
interface QueueCapability {
|
|
354
|
+
/** 永続性の状態。永続ストレージの種類は `storage` で確認できます。 */
|
|
355
|
+
readonly mode: QueueCapabilityMode;
|
|
356
|
+
/** 複数タブ排他同期の対応レベル。 */
|
|
353
357
|
readonly multiTabSync: MultiTabSyncCapability;
|
|
358
|
+
/**
|
|
359
|
+
* @deprecated `mode === "persistent"` を使用してください。永続ストレージを利用できるかを
|
|
360
|
+
* 示す移行用の互換フラグです。
|
|
361
|
+
*/
|
|
362
|
+
readonly isPersistent: boolean;
|
|
363
|
+
/**
|
|
364
|
+
* @deprecated `mode` と `multiTabSync` を使用してください。`persistent` は
|
|
365
|
+
* `mode === "persistent"`、`volatile` は `mode === "volatile_memory"` に対応します。
|
|
366
|
+
*/
|
|
367
|
+
readonly legacy: LegacyQueueCapability;
|
|
368
|
+
/** 実際に選択されたストレージの種類。 */
|
|
369
|
+
readonly storage: OfflineStorageCapability;
|
|
354
370
|
}
|
|
371
|
+
/** @deprecated Use QueueCapability. */
|
|
372
|
+
type OfflineQueueCapability = QueueCapability;
|
|
373
|
+
/** @deprecated Use `capability.mode` and `capability.multiTabSync`. */
|
|
374
|
+
declare function getLegacyQueueCapability(capability: QueueCapability): LegacyQueueCapability;
|
|
355
375
|
type OfflineOperation = {
|
|
356
376
|
readonly kind: "checkIn";
|
|
357
377
|
readonly request: CheckInRequest;
|
|
@@ -478,7 +498,7 @@ declare class OfflineQueue {
|
|
|
478
498
|
constructor(options?: OfflineQueueOptions);
|
|
479
499
|
get syncState(): SyncState;
|
|
480
500
|
get pendingCount(): number;
|
|
481
|
-
get queueCapability():
|
|
501
|
+
get queueCapability(): QueueCapability;
|
|
482
502
|
get storageCapability(): OfflineStorageCapability;
|
|
483
503
|
get isStoragePersistent(): boolean;
|
|
484
504
|
get rejectedHistory(): ReadonlyArray<RejectedOperationHistoryEntry>;
|
|
@@ -782,7 +802,7 @@ declare class StampRallyClient {
|
|
|
782
802
|
get pendingCount(): number;
|
|
783
803
|
get rejectedHistory(): ReadonlyArray<RejectedOperationHistoryEntry>;
|
|
784
804
|
getSyncRevision(): number;
|
|
785
|
-
get queueCapability():
|
|
805
|
+
get queueCapability(): QueueCapability;
|
|
786
806
|
get storageCapability(): OfflineStorageCapability;
|
|
787
807
|
get isStoragePersistent(): boolean;
|
|
788
808
|
discardRejected(operationId: string): Promise<boolean>;
|
|
@@ -911,4 +931,4 @@ type SnapshotTokenVerification<T extends SnapshotTokenPayload = SnapshotTokenPay
|
|
|
911
931
|
declare function createSignedSnapshotToken<T extends SnapshotTokenPayload>(payload: T, secretKey: SnapshotSecretKey): Promise<string>;
|
|
912
932
|
declare function verifySnapshotToken<T extends SnapshotTokenPayload = SnapshotTokenPayload>(token: string, secretKey: SnapshotSecretKey, now?: number): Promise<SnapshotTokenVerification<T>>;
|
|
913
933
|
|
|
914
|
-
export { type AdminRallyConfig, type CheckInCondition, type CheckInOptions, type CheckInRequest, type CheckInResult, type CheckInSuccess, type ClaimOptions, type ClaimRequest, type ClaimResult, type ClaimSuccess, type ClaimTicketOptions, type ClientError, type ClientEvent, type ClientEventListener, type ClientListener, type ClientOptions, type CompositeConditionFailure, type ConditionMatch, type ConditionMismatch, ConfigValidationError, type ConflictResolutionPolicy, type ConsumeResult, type ConsumeRewardParams, type CustomValidationContext, type CustomValidator, DEFAULT_SHEET_THEME, type DetectorError, type DetectorErrorCode, type DetectorKind, type DetectorResult, type ExternalReference, type FontFamily, type GeoDetectorOptions, type GeoVerificationContext, MemoryQueueStorage as InMemoryOfflineQueueStorage, InMemoryStorage, IndexedDBAdapter, type IndexedDBAdapterOptions, type IndexedDBOfflineQueueOptions, IndexedDBOfflineQueueStorage, type InventoryAggregationMode, LocalStorageAdapter, type LocalStorageAdapterOptions, type LocalStorageFailureMode, type LocaleDictionary, type LocalizedString, type LocalizedText, type MultiTabSyncCapability, type NfcDetectorOptions, type NfcVerificationContext, type OfflineConflictResult, type OfflineOperation, type OfflineOperationError, type OfflineOperationLifecycleStatus, type OfflineOperationResponse, type OfflineOperationStatus, OfflineQueue, type OfflineQueueCapability, type OfflineQueueCapabilityWarning, type OfflineQueueChangeListener, type OfflineQueueOptions, type OfflineQueueStorage, type OfflineResult, type OfflineSender, type OfflineStorageCapability, type OfflineSyncResultEvent, type OfflineSyncResultListener, type ParseResult, type PasscodeCondition$1 as PasscodeCondition, type ProcessStampValue, type PublicCheckInCondition, type PublicConfigSafety, type PublicRallyConfig, type PublicReward, type PublicSpotItem, type QrDetectorOptions, type QrVerificationContext, type QueueOperationStatus, type RallyConfig, type RallyInventory, type RallyInventoryState, type RallySnapshot, type RebuildUserStateOptions, type RebuildUserStateResult, type RedemptionMethod, type RejectedOperation, type RejectedOperationHistoryEntry, type Result, type Reward, type RewardConsumeError, type RewardState, type RewardStatus, type RewardType, type RewardUnlockCondition, type SecureTokenError, type SecureTokenErrorCode, type SecureTokenOptions, type SecureTokenPayload, type SecureTokenSecretKey, type SecureTokenVerification, type SheetTheme, type SlotShape, type SnapshotSecretKey, type SnapshotTokenError, type SnapshotTokenErrorCode, type SnapshotTokenPayload, type SnapshotTokenVerification, type SpotItem, type SpotStatus, type StampError, StampRallyClient, type StampRallyProgress, type StampRallyState, type StampRecord, type StampStorage, StorageAdapterError, type StorageAdapterErrorCode, type StorageLike, type StorageOperation, type StorageWarningHandler, type SupportedLocale, type SyncAdapter, type SyncConflictPolicy, type SyncEventListener, type SyncLifecycleEvent, type SyncOperationAction, type SyncOperationResult, type SyncProgressResponse, type SyncRetryOptions, type SyncState, THEME_PRESETS, type ThemePreset, type ThemePresetId, type UserRallyState, type ValidationError, type Validator, type VerificationContext, assertPublicConfig, calculateDistanceMeters, calculateProgress, consumeReward, createAnonymousSessionId, createClaimTicketNumber, createSecureToken, createSignedSnapshotToken, createUniqueClaimTicketNumber, evaluateCondition, evaluateConditionDetailed, evaluateSpotStatus, exportProgressToken, getCurrentGeoContext, getOrderedSpots, getSpotStatus, importProgressToken, isGeolocationSupported, isNfcSupported, isPublicConfig, isQrSupported, isRewardState, isStampRallyState, issueClaimTicketNumber, normalizePasscode, offlineOperationId, parseAdminConfig, parsePublicConfig, processStamp, readNfcContext, readQrContext, rebuildUserStateFromLog, rebuildUserStateLog, reconcileRewardStates, resolveLocalizedText, resolveRallyStateConflict, rollbackOptimisticOperation, safeParseAdminConfig, safeParsePublicConfig, sanitizeAdminConfig, storageKey, toLocalizedString, toPublicConfig, updateLocalizedField, validatePublicConfigSafety, validateRallyConfigRelations, verifyPasscode, verifySecureToken, verifySnapshotToken };
|
|
934
|
+
export { type AdminRallyConfig, type CheckInCondition, type CheckInOptions, type CheckInRequest, type CheckInResult, type CheckInSuccess, type ClaimOptions, type ClaimRequest, type ClaimResult, type ClaimSuccess, type ClaimTicketOptions, type ClientError, type ClientEvent, type ClientEventListener, type ClientListener, type ClientOptions, type CompositeConditionFailure, type ConditionMatch, type ConditionMismatch, ConfigValidationError, type ConflictResolutionPolicy, type ConsumeResult, type ConsumeRewardParams, type CustomValidationContext, type CustomValidator, DEFAULT_SHEET_THEME, type DetectorError, type DetectorErrorCode, type DetectorKind, type DetectorResult, type ExternalReference, type FontFamily, type GeoDetectorOptions, type GeoVerificationContext, MemoryQueueStorage as InMemoryOfflineQueueStorage, InMemoryStorage, IndexedDBAdapter, type IndexedDBAdapterOptions, type IndexedDBOfflineQueueOptions, IndexedDBOfflineQueueStorage, type InventoryAggregationMode, type LegacyQueueCapability, LocalStorageAdapter, type LocalStorageAdapterOptions, type LocalStorageFailureMode, type LocaleDictionary, type LocalizedString, type LocalizedText, type MultiTabSyncCapability, type NfcDetectorOptions, type NfcVerificationContext, type OfflineConflictResult, type OfflineOperation, type OfflineOperationError, type OfflineOperationLifecycleStatus, type OfflineOperationResponse, type OfflineOperationStatus, OfflineQueue, type OfflineQueueCapability, type OfflineQueueCapabilityWarning, type OfflineQueueChangeListener, type OfflineQueueOptions, type OfflineQueueStorage, type OfflineResult, type OfflineSender, type OfflineStorageCapability, type OfflineSyncResultEvent, type OfflineSyncResultListener, type ParseResult, type PasscodeCondition$1 as PasscodeCondition, type ProcessStampValue, type PublicCheckInCondition, type PublicConfigSafety, type PublicRallyConfig, type PublicReward, type PublicSpotItem, type QrDetectorOptions, type QrVerificationContext, type QueueCapability, type QueueCapabilityMode, type QueueOperationStatus, type RallyConfig, type RallyInventory, type RallyInventoryState, type RallySnapshot, type RebuildUserStateOptions, type RebuildUserStateResult, type RedemptionMethod, type RejectedOperation, type RejectedOperationHistoryEntry, type Result, type Reward, type RewardConsumeError, type RewardState, type RewardStatus, type RewardType, type RewardUnlockCondition, type SecureTokenError, type SecureTokenErrorCode, type SecureTokenOptions, type SecureTokenPayload, type SecureTokenSecretKey, type SecureTokenVerification, type SheetTheme, type SlotShape, type SnapshotSecretKey, type SnapshotTokenError, type SnapshotTokenErrorCode, type SnapshotTokenPayload, type SnapshotTokenVerification, type SpotItem, type SpotStatus, type StampError, StampRallyClient, type StampRallyProgress, type StampRallyState, type StampRecord, type StampStorage, StorageAdapterError, type StorageAdapterErrorCode, type StorageLike, type StorageOperation, type StorageWarningHandler, type SupportedLocale, type SyncAdapter, type SyncConflictPolicy, type SyncEventListener, type SyncLifecycleEvent, type SyncOperationAction, type SyncOperationResult, type SyncProgressResponse, type SyncRetryOptions, type SyncState, THEME_PRESETS, type ThemePreset, type ThemePresetId, type UserRallyState, type ValidationError, type Validator, type VerificationContext, assertPublicConfig, calculateDistanceMeters, calculateProgress, consumeReward, createAnonymousSessionId, createClaimTicketNumber, createSecureToken, createSignedSnapshotToken, createUniqueClaimTicketNumber, evaluateCondition, evaluateConditionDetailed, evaluateSpotStatus, exportProgressToken, getCurrentGeoContext, getLegacyQueueCapability, getOrderedSpots, getSpotStatus, importProgressToken, isGeolocationSupported, isNfcSupported, isPublicConfig, isQrSupported, isRewardState, isStampRallyState, issueClaimTicketNumber, normalizePasscode, offlineOperationId, parseAdminConfig, parsePublicConfig, processStamp, readNfcContext, readQrContext, rebuildUserStateFromLog, rebuildUserStateLog, reconcileRewardStates, resolveLocalizedText, resolveRallyStateConflict, rollbackOptimisticOperation, safeParseAdminConfig, safeParsePublicConfig, sanitizeAdminConfig, storageKey, toLocalizedString, toPublicConfig, updateLocalizedField, validatePublicConfigSafety, validateRallyConfigRelations, verifyPasscode, verifySecureToken, verifySnapshotToken };
|
package/dist/index.js
CHANGED
|
@@ -1005,6 +1005,9 @@ var IndexedDBAdapter = class {
|
|
|
1005
1005
|
};
|
|
1006
1006
|
|
|
1007
1007
|
// src/client/offlineQueue.ts
|
|
1008
|
+
function getLegacyQueueCapability(capability) {
|
|
1009
|
+
return capability.isPersistent ? "persistent" : "volatile";
|
|
1010
|
+
}
|
|
1008
1011
|
function rollbackOptimisticOperation(state, operation) {
|
|
1009
1012
|
const previous = operation.request.state;
|
|
1010
1013
|
if (operation.kind === "checkIn") {
|
|
@@ -1263,9 +1266,13 @@ var OfflineQueue = class {
|
|
|
1263
1266
|
return this.#operations.length;
|
|
1264
1267
|
}
|
|
1265
1268
|
get queueCapability() {
|
|
1269
|
+
const isPersistent = this.#queueCapability !== "memory";
|
|
1266
1270
|
return {
|
|
1267
1271
|
storage: this.#queueCapability,
|
|
1268
|
-
|
|
1272
|
+
mode: isPersistent ? "persistent" : "volatile_memory",
|
|
1273
|
+
multiTabSync: this.#hasWebLocks() ? "supported_web_locks" : "disabled_unsafe_environment",
|
|
1274
|
+
isPersistent,
|
|
1275
|
+
legacy: isPersistent ? "persistent" : "volatile"
|
|
1269
1276
|
};
|
|
1270
1277
|
}
|
|
1271
1278
|
get storageCapability() {
|
|
@@ -1989,7 +1996,10 @@ var StampRallyClient = class {
|
|
|
1989
1996
|
get queueCapability() {
|
|
1990
1997
|
return this.#offlineQueue?.queueCapability ?? {
|
|
1991
1998
|
storage: "custom",
|
|
1992
|
-
|
|
1999
|
+
mode: "persistent",
|
|
2000
|
+
multiTabSync: "disabled_unsafe_environment",
|
|
2001
|
+
isPersistent: true,
|
|
2002
|
+
legacy: "persistent"
|
|
1993
2003
|
};
|
|
1994
2004
|
}
|
|
1995
2005
|
get storageCapability() {
|
|
@@ -3454,6 +3464,6 @@ async function verifySnapshotToken(token, secretKey, now = Date.now()) {
|
|
|
3454
3464
|
}
|
|
3455
3465
|
}
|
|
3456
3466
|
|
|
3457
|
-
export { ConfigValidationError, DEFAULT_SHEET_THEME, MemoryQueueStorage as InMemoryOfflineQueueStorage, InMemoryStorage, IndexedDBAdapter, IndexedDBOfflineQueueStorage, LocalStorageAdapter, OfflineQueue, StampRallyClient, StorageAdapterError, THEME_PRESETS, assertPublicConfig, calculateDistanceMeters, calculateProgress, consumeReward, createAnonymousSessionId, createClaimTicketNumber, createSecureToken, createSignedSnapshotToken, createUniqueClaimTicketNumber, evaluateCondition, evaluateConditionDetailed, evaluateSpotStatus, exportProgressToken, getCurrentGeoContext, getOrderedSpots, getSpotStatus, importProgressToken, isGeolocationSupported, isNfcSupported, isPublicConfig, isQrSupported, isRewardState, isStampRallyState, issueClaimTicketNumber, normalizePasscode, offlineOperationId, parseAdminConfig, parsePublicConfig, processStamp, readNfcContext, readQrContext, rebuildUserStateFromLog, rebuildUserStateLog, reconcileRewardStates, resolveLocalizedText, resolveRallyStateConflict, rollbackOptimisticOperation, safeParseAdminConfig, safeParsePublicConfig, sanitizeAdminConfig, storageKey, toLocalizedString, toPublicConfig, updateLocalizedField, validatePublicConfigSafety, validateRallyConfigRelations, verifyPasscode, verifySecureToken, verifySnapshotToken };
|
|
3467
|
+
export { ConfigValidationError, DEFAULT_SHEET_THEME, MemoryQueueStorage as InMemoryOfflineQueueStorage, InMemoryStorage, IndexedDBAdapter, IndexedDBOfflineQueueStorage, LocalStorageAdapter, OfflineQueue, StampRallyClient, StorageAdapterError, THEME_PRESETS, assertPublicConfig, calculateDistanceMeters, calculateProgress, consumeReward, createAnonymousSessionId, createClaimTicketNumber, createSecureToken, createSignedSnapshotToken, createUniqueClaimTicketNumber, evaluateCondition, evaluateConditionDetailed, evaluateSpotStatus, exportProgressToken, getCurrentGeoContext, getLegacyQueueCapability, getOrderedSpots, getSpotStatus, importProgressToken, isGeolocationSupported, isNfcSupported, isPublicConfig, isQrSupported, isRewardState, isStampRallyState, issueClaimTicketNumber, normalizePasscode, offlineOperationId, parseAdminConfig, parsePublicConfig, processStamp, readNfcContext, readQrContext, rebuildUserStateFromLog, rebuildUserStateLog, reconcileRewardStates, resolveLocalizedText, resolveRallyStateConflict, rollbackOptimisticOperation, safeParseAdminConfig, safeParsePublicConfig, sanitizeAdminConfig, storageKey, toLocalizedString, toPublicConfig, updateLocalizedField, validatePublicConfigSafety, validateRallyConfigRelations, verifyPasscode, verifySecureToken, verifySnapshotToken };
|
|
3458
3468
|
//# sourceMappingURL=index.js.map
|
|
3459
3469
|
//# sourceMappingURL=index.js.map
|