-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(API): switch lcp (renew,return,unlock) to redux-saga logic
delete LCP API (FIxes #1992)
- Loading branch information
Showing
18 changed files
with
272 additions
and
175 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// ==LICENSE-BEGIN== | ||
// Copyright 2017 European Digital Reading Lab. All rights reserved. | ||
// Licensed to the Readium Foundation under one or more contributor license agreements. | ||
// Use of this source code is governed by a BSD-style license | ||
// that can be found in the LICENSE file exposed on Github (readium) in the project repository. | ||
// ==LICENSE-END== | ||
|
||
import { Action } from "readium-desktop/common/models/redux"; | ||
|
||
export const ID = "LCP_RENEW_PUBLICATION_LICENSE"; | ||
|
||
export interface Payload { | ||
publicationIdentifier: string; | ||
} | ||
|
||
export function build( | ||
publicationIdentifier: string, | ||
): | ||
Action<typeof ID, Payload> { | ||
|
||
return { | ||
type: ID, | ||
payload: { | ||
publicationIdentifier, | ||
}, | ||
}; | ||
} | ||
build.toString = () => ID; // Redux StringableActionCreator | ||
export type TAction = ReturnType<typeof build>; |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// ==LICENSE-BEGIN== | ||
// Copyright 2017 European Digital Reading Lab. All rights reserved. | ||
// Licensed to the Readium Foundation under one or more contributor license agreements. | ||
// Use of this source code is governed by a BSD-style license | ||
// that can be found in the LICENSE file exposed on Github (readium) in the project repository. | ||
// ==LICENSE-END== | ||
|
||
import { Action } from "readium-desktop/common/models/redux"; | ||
|
||
export const ID = "LCP_RETURN_PUBLICATION"; | ||
|
||
export interface Payload { | ||
publicationIdentifier: string; | ||
} | ||
|
||
export function build( | ||
publicationIdentifier: string, | ||
): | ||
Action<typeof ID, Payload> { | ||
|
||
return { | ||
type: ID, | ||
payload: { | ||
publicationIdentifier, | ||
}, | ||
}; | ||
} | ||
build.toString = () => ID; // Redux StringableActionCreator | ||
export type TAction = ReturnType<typeof build>; |
32 changes: 32 additions & 0 deletions
32
src/common/redux/actions/lcp/unlockPublicationWithPassphrase.ts
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// ==LICENSE-BEGIN== | ||
// Copyright 2017 European Digital Reading Lab. All rights reserved. | ||
// Licensed to the Readium Foundation under one or more contributor license agreements. | ||
// Use of this source code is governed by a BSD-style license | ||
// that can be found in the LICENSE file exposed on Github (readium) in the project repository. | ||
// ==LICENSE-END== | ||
|
||
import { Action } from "readium-desktop/common/models/redux"; | ||
|
||
export const ID = "LCP_UNLOCK_PUBLICATION_WITH_PASS"; | ||
|
||
export interface Payload { | ||
publicationIdentifier: string; | ||
passphrase: string; | ||
} | ||
|
||
export function build( | ||
publicationIdentifier: string, | ||
passphrase: string, | ||
): | ||
Action<typeof ID, Payload> { | ||
|
||
return { | ||
type: ID, | ||
payload: { | ||
publicationIdentifier, | ||
passphrase, | ||
}, | ||
}; | ||
} | ||
build.toString = () => ID; // Redux StringableActionCreator | ||
export type TAction = ReturnType<typeof build>; |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.