( options: WorkOSVaultPluginOptions | undefined, )
| 42 | type WorkosVaultPluginStore = WorkosVaultStore; |
| 43 | |
| 44 | const buildClient = ( |
| 45 | options: WorkOSVaultPluginOptions | undefined, |
| 46 | ): Effect.Effect<WorkOSVaultClient, WorkOSVaultClientInstantiationError, never> => { |
| 47 | if (options?.client) return Effect.succeed(options.client); |
| 48 | if (options?.credentials) { |
| 49 | return makeConfiguredWorkOSVaultClient(options.credentials); |
| 50 | } |
| 51 | return Effect.fail( |
| 52 | new WorkOSVaultClientInstantiationError({ |
| 53 | cause: "workosVaultPlugin requires either `client` or `credentials` to be provided", |
| 54 | }), |
| 55 | ); |
| 56 | }; |
| 57 | |
| 58 | export const workosVaultPlugin = definePlugin((options?: WorkOSVaultPluginOptions) => ({ |
| 59 | id: "workosVault" as const, |
no test coverage detected