-
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.
Refactor add provider logic into service
- Loading branch information
1 parent
ef7ceae
commit a6d3d0d
Showing
32 changed files
with
378 additions
and
210 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
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
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
31 changes: 31 additions & 0 deletions
31
packages/core/types/src/services/workflows/add-provider.workflow.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,31 @@ | ||
import { Effect } from "effect"; | ||
import type { | ||
ProviderMetadata, | ||
FolderMetadata, | ||
AuthenticationError, | ||
} from "../../model"; | ||
import type { FileBasedProviderError } from "../media-provider"; | ||
|
||
/** | ||
* Empty record used to represent the absence of data, either input or output. | ||
*/ | ||
export type Empty = Record<string, never>; | ||
|
||
/** | ||
* Workflow that orchestrates the process of adding a new provider to the application. | ||
*/ | ||
export type IAddProviderWorkflow = { | ||
readonly loadProvider: (metadata: ProviderMetadata) => Effect.Effect<Empty>; | ||
readonly connectToProvider: () => Effect.Effect< | ||
FolderMetadata[], | ||
AuthenticationError | FileBasedProviderError | ||
>; | ||
readonly selectRoot: (rootFolder: FolderMetadata) => Effect.Effect<Empty>; | ||
}; | ||
|
||
/** | ||
* Tag to identify the operations that can be performed by the AddProviderWorkflow. | ||
*/ | ||
export class AddProviderWorkflow extends Effect.Tag( | ||
"@echo/services-add-provider-fsm/AddProviderWorkflow", | ||
)<AddProviderWorkflow, IAddProviderWorkflow>() {} |
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 @@ | ||
export * from "./add-provider.workflow"; |
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 |
---|---|---|
|
@@ -10,6 +10,6 @@ | |
}, | ||
"dependencies": { | ||
"@echo/core-types": "^1.0.0", | ||
"effect": "^3.5.8" | ||
"effect": "^3.6.5" | ||
} | ||
} |
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 |
---|---|---|
|
@@ -10,6 +10,6 @@ | |
}, | ||
"dependencies": { | ||
"@echo/core-types": "^1.0.0", | ||
"effect": "^3.5.8" | ||
"effect": "^3.6.5" | ||
} | ||
} |
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 |
---|---|---|
|
@@ -10,6 +10,6 @@ | |
}, | ||
"dependencies": { | ||
"@echo/core-types": "^1.0.0", | ||
"effect": "^3.2.8" | ||
"effect": "^3.6.5" | ||
} | ||
} |
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.