-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix!: add missing storage type to prepare for cookies management
BREAKING CHANGE: - Add `storageType` to all operations - Many types are renamed
- Loading branch information
1 parent
637adc0
commit c08ee28
Showing
7 changed files
with
47 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
export enum LocalStorageMigrationOperationType { | ||
export enum OperationType { | ||
DeleteKey = "DeleteKey", | ||
RenameJsonValuePropertyKey = "RenameJsonValuePropertyKey", | ||
RenameKey = "RenameKey", | ||
UpdateJsonPropertyValue = "UpdateJsonPropertyValue", | ||
} | ||
|
||
export enum StorageType { | ||
LocalStorage = "LocalStorage", | ||
} | ||
|
||
export const LAST_MIGRATION_VERSION_KEY = | ||
"localStorageMigrator:lastMigrationVersion" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,42 @@ | ||
import type { LocalStorageMigrationOperationType } from "./constants" | ||
import type { OperationType, StorageType } from "./constants" | ||
|
||
export type LocalStorageMigration = { | ||
description: string | ||
operations: LocalStorageMigrationOperation[] | ||
operations: Operation[] | ||
} | ||
|
||
export type LocalStorageMigrationOperation = | ||
export type Operation = | ||
| DeleteKey | ||
| RenameKey | ||
| RenameJsonValuePropertyKey | ||
| UpdateJsonValuePropertyValue | ||
|
||
export type DeleteKey = { | ||
key: string | ||
type: LocalStorageMigrationOperationType.DeleteKey | ||
type: OperationType.DeleteKey | ||
storageType: StorageType | ||
} | ||
|
||
export type RenameKey = { | ||
from: string | ||
to: string | ||
type: LocalStorageMigrationOperationType.RenameKey | ||
storageType: StorageType | ||
type: OperationType.RenameKey | ||
} | ||
|
||
export type RenameJsonValuePropertyKey = { | ||
key: string | ||
newJsonKey: string | ||
oldJsonKey: string | ||
type: LocalStorageMigrationOperationType.RenameJsonValuePropertyKey | ||
storageType: StorageType | ||
type: OperationType.RenameJsonValuePropertyKey | ||
} | ||
|
||
export type UpdateJsonValuePropertyValue = { | ||
jsonKey: string | ||
key: string | ||
newJsonValue: string | number | boolean | null | ||
oldJsonValue: string | number | boolean | null | ||
type: LocalStorageMigrationOperationType.UpdateJsonPropertyValue | ||
storageType: StorageType | ||
type: OperationType.UpdateJsonPropertyValue | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters