@executor-js/plugin-onepassword 0.0.1 → 0.1.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 +30 -10
- package/dist/api/group.d.ts +19 -20
- package/dist/api/handlers.d.ts +2 -2
- package/dist/chunk-2NSVLCQP.js +446 -0
- package/dist/chunk-2NSVLCQP.js.map +1 -0
- package/dist/core.js +3 -1
- package/dist/index.js +1 -1
- package/dist/promise.d.ts +4 -0
- package/dist/react/OnePasswordSettings.d.ts +1 -0
- package/dist/react/atoms.d.ts +22 -0
- package/dist/react/client.d.ts +16 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/plugin-client.d.ts +2 -0
- package/dist/react/secret-provider-plugin.d.ts +2 -0
- package/dist/sdk/errors.d.ts +4 -6
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/plugin.d.ts +43 -13
- package/dist/sdk/plugin.test.d.ts +1 -0
- package/dist/sdk/service.d.ts +1 -1
- package/dist/sdk/types.d.ts +23 -68
- package/package.json +8 -13
- package/dist/chunk-57NB4OW6.js +0 -311
- package/dist/chunk-57NB4OW6.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/sdk/errors.ts","../src/sdk/types.ts","../src/sdk/service.ts","../src/sdk/plugin.ts","../src/api/group.ts","../src/api/handlers.ts"],"sourcesContent":["import { Schema } from \"effect\";\n\nexport class OnePasswordError extends Schema.TaggedErrorClass<OnePasswordError>()(\n \"OnePasswordError\",\n {\n operation: Schema.String,\n message: Schema.String,\n },\n { httpApiStatus: 502 },\n) {}\n","import { Schema } from \"effect\";\n\n// ---------------------------------------------------------------------------\n// Auth — how to talk to 1Password\n// ---------------------------------------------------------------------------\n\nexport class DesktopAppAuth extends Schema.Class<DesktopAppAuth>(\"DesktopAppAuth\")({\n kind: Schema.Literal(\"desktop-app\"),\n /** 1Password account domain, e.g. \"my.1password.com\" */\n accountName: Schema.String,\n}) {}\n\nexport class ServiceAccountAuth extends Schema.Class<ServiceAccountAuth>(\"ServiceAccountAuth\")({\n kind: Schema.Literal(\"service-account\"),\n /** The service account token (stored as a secret) */\n tokenSecretId: Schema.String,\n}) {}\n\nexport const OnePasswordAuth = Schema.Union([DesktopAppAuth, ServiceAccountAuth]);\nexport type OnePasswordAuth = typeof OnePasswordAuth.Type;\n\n// ---------------------------------------------------------------------------\n// Stored config — persisted via KV\n// ---------------------------------------------------------------------------\n\nexport class OnePasswordConfig extends Schema.Class<OnePasswordConfig>(\"OnePasswordConfig\")({\n auth: OnePasswordAuth,\n /** Vault to scope operations to */\n vaultId: Schema.String,\n /** Human label */\n name: Schema.String,\n}) {}\n\n// ---------------------------------------------------------------------------\n// Vault\n// ---------------------------------------------------------------------------\n\nexport class Vault extends Schema.Class<Vault>(\"Vault\")({\n id: Schema.String,\n name: Schema.String,\n}) {}\n\n// ---------------------------------------------------------------------------\n// Connection status\n// ---------------------------------------------------------------------------\n\nexport class ConnectionStatus extends Schema.Class<ConnectionStatus>(\"ConnectionStatus\")({\n connected: Schema.Boolean,\n vaultName: Schema.optional(Schema.String),\n error: Schema.optional(Schema.String),\n}) {}\n","import { Context, Duration, Effect } from \"effect\";\nimport * as op from \"@1password/op-js\";\n\nimport { OnePasswordError } from \"./errors\";\n\n// ---------------------------------------------------------------------------\n// Canonical service interface — all backends (SDK, CLI) implement this\n// ---------------------------------------------------------------------------\n\nexport interface OnePasswordVault {\n readonly id: string;\n readonly title: string;\n}\n\nexport interface OnePasswordItem {\n readonly id: string;\n readonly title: string;\n}\n\nexport interface OnePasswordService {\n /** Resolve a secret by op:// URI */\n readonly resolveSecret: (uri: string) => Effect.Effect<string, OnePasswordError>;\n\n /** List accessible vaults */\n readonly listVaults: () => Effect.Effect<ReadonlyArray<OnePasswordVault>, OnePasswordError>;\n\n /** List items in a vault */\n readonly listItems: (\n vaultId: string,\n ) => Effect.Effect<ReadonlyArray<OnePasswordItem>, OnePasswordError>;\n}\n\nexport class OnePasswordServiceTag extends Context.Service<\n OnePasswordServiceTag,\n OnePasswordService\n>()(\"@executor-js/plugin-onepassword/OnePasswordService\") {}\n\n// ---------------------------------------------------------------------------\n// Resolved auth — raw credentials ready for any backend\n// ---------------------------------------------------------------------------\n\nexport type ResolvedAuth =\n | { readonly kind: \"desktop-app\"; readonly accountName: string }\n | { readonly kind: \"service-account\"; readonly token: string };\n\n// ---------------------------------------------------------------------------\n// SDK backend — uses @1password/sdk native IPC\n// ---------------------------------------------------------------------------\n\nconst DEFAULT_TIMEOUT_MS = 15_000;\ntype OnePasswordSdkModule = typeof import(\"@1password/sdk\");\n\nconst loadOnePasswordSdk = (): Effect.Effect<OnePasswordSdkModule, OnePasswordError> =>\n Effect.tryPromise({\n try: () => import(\"@1password/sdk\"),\n catch: (cause) =>\n new OnePasswordError({\n operation: \"sdk module load\",\n message: cause instanceof Error ? cause.message : String(cause),\n }),\n });\n\nconst makeTimeoutMessage = (operation: string, timeoutMs: number): string =>\n [\n `${operation}: timed out after ${Math.floor(timeoutMs / 1000)}s.`,\n \"Troubleshooting:\",\n \"1. Make sure the 1Password desktop app is open and unlocked\",\n \"2. Check for an approval prompt in the 1Password app — it may be behind other windows\",\n \"3. Ensure 'Developer > Connect with 1Password CLI' is enabled in 1Password Settings\",\n \"4. Make sure no other app or terminal is waiting for 1Password approval (only one prompt at a time)\",\n \"5. Try quitting 1Password completely and reopening it, then retry\",\n ].join(\"\\n\");\n\nconst timeoutWithOnePasswordError = (operation: string, timeoutMs: number) =>\n Effect.timeoutOrElse({\n duration: Duration.millis(timeoutMs),\n orElse: () =>\n Effect.fail(\n new OnePasswordError({\n operation,\n message: makeTimeoutMessage(operation, timeoutMs),\n }),\n ),\n });\n\nexport const makeNativeSdkService = (\n auth: ResolvedAuth,\n timeoutMs: number = DEFAULT_TIMEOUT_MS,\n): Effect.Effect<OnePasswordService, OnePasswordError> =>\n Effect.gen(function* () {\n const sdk = yield* loadOnePasswordSdk().pipe(\n timeoutWithOnePasswordError(\"sdk module load\", timeoutMs),\n );\n\n const client = yield* Effect.tryPromise({\n try: () =>\n sdk.createClient({\n auth: auth.kind === \"desktop-app\" ? new sdk.DesktopAuth(auth.accountName) : auth.token,\n integrationName: \"Executor\",\n integrationVersion: \"0.0.0\",\n }),\n catch: (cause) =>\n new OnePasswordError({\n operation: \"client setup\",\n message: cause instanceof Error ? cause.message : String(cause),\n }),\n }).pipe(\n timeoutWithOnePasswordError(\"client setup\", timeoutMs),\n );\n\n const wrap = <A>(fn: () => Promise<A>, operation: string): Effect.Effect<A, OnePasswordError> =>\n Effect.tryPromise({\n try: fn,\n catch: (cause) =>\n new OnePasswordError({\n operation,\n message: cause instanceof Error ? cause.message : String(cause),\n }),\n }).pipe(\n timeoutWithOnePasswordError(operation, timeoutMs),\n Effect.withSpan(`onepassword.sdk.${operation}`),\n );\n\n return OnePasswordServiceTag.of({\n resolveSecret: (uri) => wrap(() => client.secrets.resolve(uri), \"secret resolution\"),\n\n listVaults: () =>\n wrap(() => client.vaults.list({ decryptDetails: true }), \"vault listing\").pipe(\n Effect.map((vaults) => vaults.map((v) => ({ id: v.id, title: v.title }))),\n ),\n\n listItems: (vaultId) =>\n wrap(() => client.items.list(vaultId), \"item listing\").pipe(\n Effect.map((items) => items.map((i) => ({ id: i.id, title: i.title }))),\n ),\n });\n }).pipe(Effect.withSpan(\"onepassword.sdk.make_service\"));\n\n// ---------------------------------------------------------------------------\n// CLI backend — uses @1password/op-js (shells out to `op` CLI)\n// ---------------------------------------------------------------------------\n\nexport const makeCliService = (\n auth: ResolvedAuth,\n): Effect.Effect<OnePasswordService, OnePasswordError> =>\n Effect.sync(() => {\n // Configure auth\n if (auth.kind === \"service-account\") {\n op.setServiceAccount(auth.token);\n } else {\n op.setGlobalFlags({ account: auth.accountName });\n }\n\n const wrapSync = <A>(fn: () => A, operation: string): Effect.Effect<A, OnePasswordError> =>\n Effect.try({\n try: fn,\n catch: (cause) =>\n new OnePasswordError({\n operation,\n message: cause instanceof Error ? cause.message : String(cause),\n }),\n }).pipe(Effect.withSpan(`onepassword.cli.${operation}`));\n\n return OnePasswordServiceTag.of({\n resolveSecret: (uri) => wrapSync(() => op.read.parse(uri), \"secret resolution\"),\n\n listVaults: () =>\n wrapSync(() => op.vault.list(), \"vault listing\").pipe(\n Effect.map((vaults) => vaults.map((v) => ({ id: v.id, title: v.name }))),\n ),\n\n listItems: (vaultId) =>\n wrapSync(() => op.item.list({ vault: vaultId }), \"item listing\").pipe(\n Effect.map((items) => items.map((i) => ({ id: i.id, title: i.title }))),\n ),\n });\n }).pipe(Effect.withSpan(\"onepassword.cli.make_service\"));\n\n// ---------------------------------------------------------------------------\n// Smart factory — tries CLI first (avoids IPC hang), falls back to SDK\n// ---------------------------------------------------------------------------\n\nexport const makeOnePasswordService = (\n auth: ResolvedAuth,\n options?: { readonly preferSdk?: boolean; readonly timeoutMs?: number },\n): Effect.Effect<OnePasswordService, OnePasswordError> => {\n const timeoutMs = options?.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n\n if (options?.preferSdk) {\n return makeNativeSdkService(auth, timeoutMs);\n }\n\n // Default: prefer CLI to avoid the IPC hang bug\n return makeCliService(auth).pipe(\n Effect.catch((cliError: OnePasswordError) =>\n // CLI unavailable (e.g. `op` not installed) — fall back to SDK\n makeNativeSdkService(auth, timeoutMs).pipe(Effect.mapError(() => cliError)),\n ),\n );\n};\n","import { Effect, Schema } from \"effect\";\n\nimport {\n definePlugin,\n StorageError,\n type PluginCtx,\n type PluginBlobStore,\n type SecretProvider,\n type StorageFailure,\n} from \"@executor-js/sdk/core\";\n\nimport { OnePasswordGroup } from \"../api/group\";\nimport {\n OnePasswordExtensionService,\n OnePasswordHandlers,\n} from \"../api/handlers\";\n\nimport { OnePasswordConfig, Vault, ConnectionStatus } from \"./types\";\nimport type { OnePasswordAuth } from \"./types\";\nimport { OnePasswordError } from \"./errors\";\nimport {\n makeOnePasswordService,\n type ResolvedAuth,\n type OnePasswordService,\n} from \"./service\";\n\n// ---------------------------------------------------------------------------\n// Constants\n// ---------------------------------------------------------------------------\n\nconst CREDENTIAL_FIELD = \"credential\";\nconst DEFAULT_TIMEOUT_MS = 15_000;\nconst CONFIG_KEY = \"config\";\n\n// ---------------------------------------------------------------------------\n// Shared failure alias.\n//\n// Every extension method either touches storage (`ctx.storage` blobs or\n// `ctx.secrets`) or reaches the 1Password backend. Storage I/O surfaces\n// as `StorageFailure`; the HTTP edge (`withCapture`) translates\n// `StorageError` to `InternalError({ traceId })`. Domain problems (not\n// configured, service-account token missing, backend RPC failure) stay\n// as `OnePasswordError` and encode to 502 via the schema annotation on\n// the class.\n// ---------------------------------------------------------------------------\n\nexport type OnePasswordExtensionFailure = OnePasswordError | StorageFailure;\n\n// ---------------------------------------------------------------------------\n// Plugin extension — public API on executor.onepassword\n// ---------------------------------------------------------------------------\n\nexport interface OnePasswordExtension {\n /** Configure the 1Password connection */\n readonly configure: (\n config: OnePasswordConfig,\n ) => Effect.Effect<void, StorageFailure>;\n\n /** Get current configuration (if any) */\n readonly getConfig: () => Effect.Effect<\n OnePasswordConfig | null,\n OnePasswordExtensionFailure\n >;\n\n /** Remove the 1Password configuration */\n readonly removeConfig: () => Effect.Effect<void, StorageFailure>;\n\n /** Check connection status */\n readonly status: () => Effect.Effect<\n ConnectionStatus,\n OnePasswordExtensionFailure\n >;\n\n /** List accessible vaults (requires auth) */\n readonly listVaults: (\n auth: OnePasswordAuth,\n ) => Effect.Effect<ReadonlyArray<Vault>, OnePasswordExtensionFailure>;\n\n /** Resolve a secret directly by op:// URI */\n readonly resolve: (\n uri: string,\n ) => Effect.Effect<string, OnePasswordExtensionFailure>;\n}\n\n// ---------------------------------------------------------------------------\n// Typed config store — single blob, JSON encoded. Blob I/O failures surface\n// as `StorageError` (HTTP edge translates to `InternalError`); decode\n// failures stay `OnePasswordError` — the blob's contents are a plugin\n// concern, not an infrastructure one.\n// ---------------------------------------------------------------------------\n\nexport interface OnePasswordStore {\n readonly getConfig: () => Effect.Effect<\n OnePasswordConfig | null,\n StorageError | OnePasswordError\n >;\n readonly saveConfig: (\n config: OnePasswordConfig,\n ) => Effect.Effect<void, StorageError>;\n readonly deleteConfig: () => Effect.Effect<void, StorageError>;\n}\n\nconst decodeConfig = Schema.decodeUnknownSync(OnePasswordConfig);\n\nconst blobStorageError = (operation: string) =>\n (cause: unknown): StorageError =>\n new StorageError({\n message: `onepassword blob ${operation}: ${\n cause instanceof Error ? cause.message : String(cause)\n }`,\n cause,\n });\n\nexport const makeOnePasswordStore = (\n blobs: PluginBlobStore,\n /** Scope id that owns the single 1Password config blob. Default is the\n * outermost scope (org/workspace) so the config is visible across\n * every per-user scope via the blob store's fall-through read. */\n writeScope: string,\n): OnePasswordStore => ({\n getConfig: () =>\n blobs.get(CONFIG_KEY).pipe(\n Effect.mapError(blobStorageError(\"read\")),\n Effect.flatMap((raw) => {\n if (raw === null) return Effect.succeed(null);\n return Effect.try({\n try: () => decodeConfig(JSON.parse(raw)),\n catch: (cause) =>\n new OnePasswordError({\n operation: \"config decode\",\n message: cause instanceof Error ? cause.message : String(cause),\n }),\n });\n }),\n ),\n\n saveConfig: (config) =>\n blobs\n .put(\n CONFIG_KEY,\n JSON.stringify({\n auth: config.auth,\n vaultId: config.vaultId,\n name: config.name,\n }),\n { scope: writeScope },\n )\n .pipe(Effect.mapError(blobStorageError(\"write\"))),\n\n deleteConfig: () =>\n blobs\n .delete(CONFIG_KEY, { scope: writeScope })\n .pipe(Effect.mapError(blobStorageError(\"delete\"))),\n});\n\n// ---------------------------------------------------------------------------\n// Helpers — auth resolution + service construction\n// ---------------------------------------------------------------------------\n\nconst resolveAuth = (\n auth: OnePasswordAuth,\n ctx: PluginCtx<OnePasswordStore>,\n): Effect.Effect<ResolvedAuth, OnePasswordError | StorageFailure> => {\n if (auth.kind === \"desktop-app\") {\n return Effect.succeed({\n kind: \"desktop-app\" as const,\n accountName: auth.accountName,\n });\n }\n return ctx.secrets.get(auth.tokenSecretId).pipe(\n Effect.mapError((err) =>\n \"_tag\" in err && err._tag === \"SecretOwnedByConnectionError\"\n ? new OnePasswordError({\n operation: \"auth resolution\",\n message: `Service account token secret \"${auth.tokenSecretId}\" not found`,\n })\n : err,\n ),\n Effect.flatMap((token) => {\n if (token === null) {\n return Effect.fail(\n new OnePasswordError({\n operation: \"auth resolution\",\n message: `Service account token secret \"${auth.tokenSecretId}\" not found`,\n }),\n );\n }\n return Effect.succeed({\n kind: \"service-account\" as const,\n token,\n });\n }),\n );\n};\n\nconst getServiceFromConfig = (\n config: OnePasswordConfig,\n ctx: PluginCtx<OnePasswordStore>,\n timeoutMs: number,\n preferSdk: boolean | undefined,\n): Effect.Effect<OnePasswordService, OnePasswordError | StorageFailure> =>\n resolveAuth(config.auth, ctx).pipe(\n Effect.flatMap((resolved) =>\n makeOnePasswordService(resolved, { timeoutMs, preferSdk }),\n ),\n );\n\n// ---------------------------------------------------------------------------\n// SecretProvider — read-only, resolves op:// URIs or vaultId-based lookups\n// ---------------------------------------------------------------------------\n\nconst makeProvider = (\n ctx: PluginCtx<OnePasswordStore>,\n timeoutMs: number,\n preferSdk: boolean | undefined,\n): SecretProvider => ({\n key: \"onepassword\",\n writable: false,\n\n // 1Password vaults are named in the stored config; the executor-scope\n // arg isn't used for routing here. A future refactor could let the\n // plugin store per-scope vault bindings and pick based on `scope`.\n get: (secretId, _scope) =>\n ctx.storage.getConfig().pipe(\n Effect.flatMap((config) => {\n if (!config) return Effect.succeed(null as string | null);\n\n const uri = secretId.startsWith(\"op://\")\n ? secretId\n : `op://${config.vaultId}/${secretId}/${CREDENTIAL_FIELD}`;\n\n return getServiceFromConfig(config, ctx, timeoutMs, preferSdk).pipe(\n Effect.flatMap((svc) => svc.resolveSecret(uri)),\n Effect.map((v): string | null => v),\n Effect.orElseSucceed(() => null),\n );\n }),\n Effect.orElseSucceed(() => null),\n ),\n\n list: () =>\n ctx.storage.getConfig().pipe(\n Effect.flatMap((config) => {\n if (!config)\n return Effect.succeed(\n [] as ReadonlyArray<{ id: string; name: string }>,\n );\n return getServiceFromConfig(config, ctx, timeoutMs, preferSdk).pipe(\n Effect.flatMap((svc) => svc.listItems(config.vaultId)),\n Effect.map(\n (items): ReadonlyArray<{ id: string; name: string }> =>\n items.map((item) => ({ id: item.id, name: item.title })),\n ),\n );\n }),\n Effect.orElseSucceed(\n () => [] as ReadonlyArray<{ id: string; name: string }>,\n ),\n ),\n});\n\n// ---------------------------------------------------------------------------\n// Plugin factory\n// ---------------------------------------------------------------------------\n\nexport interface OnePasswordPluginOptions {\n /** Request timeout in ms (default: 15000) */\n readonly timeoutMs?: number;\n /** Force use of the native SDK instead of the CLI (default: false) */\n readonly preferSdk?: boolean;\n}\n\nexport const onepasswordPlugin = definePlugin(\n (options?: OnePasswordPluginOptions) => {\n const timeoutMs = options?.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n const preferSdk = options?.preferSdk;\n\n return {\n id: \"onepassword\" as const,\n packageName: \"@executor-js/plugin-onepassword\",\n storage: ({ blobs, scopes }) =>\n makeOnePasswordStore(blobs, scopes.at(-1)!.id as string),\n\n extension: (ctx) => {\n return {\n configure: (config) => ctx.storage.saveConfig(config),\n\n getConfig: () => ctx.storage.getConfig(),\n\n removeConfig: () => ctx.storage.deleteConfig(),\n\n status: () =>\n Effect.gen(function* () {\n const config = yield* ctx.storage.getConfig();\n if (!config) {\n return new ConnectionStatus({\n connected: false,\n error: \"Not configured\",\n });\n }\n const svc = yield* getServiceFromConfig(\n config,\n ctx,\n timeoutMs,\n preferSdk,\n );\n const vaults = yield* svc.listVaults();\n const vault = vaults.find((v) => v.id === config.vaultId);\n return new ConnectionStatus({\n connected: true,\n vaultName: vault?.title,\n });\n }),\n\n listVaults: (auth) =>\n Effect.gen(function* () {\n const resolved = yield* resolveAuth(auth, ctx);\n const svc = yield* makeOnePasswordService(resolved, {\n timeoutMs,\n preferSdk,\n });\n const vaults = yield* svc.listVaults();\n return vaults\n .map((v) => new Vault({ id: v.id, name: v.title }))\n .sort((a, b) => a.name.localeCompare(b.name));\n }),\n\n resolve: (uri) =>\n Effect.gen(function* () {\n const config = yield* ctx.storage.getConfig();\n if (!config) {\n return yield* Effect.fail(\n new OnePasswordError({\n operation: \"resolve\",\n message: \"1Password is not configured\",\n }),\n );\n }\n const svc = yield* getServiceFromConfig(\n config,\n ctx,\n timeoutMs,\n preferSdk,\n );\n return yield* svc.resolveSecret(uri);\n }),\n } satisfies OnePasswordExtension;\n },\n\n secretProviders: (ctx) => [makeProvider(ctx, timeoutMs, preferSdk)],\n\n routes: () => OnePasswordGroup,\n handlers: () => OnePasswordHandlers,\n extensionService: OnePasswordExtensionService,\n };\n },\n);\n","import { HttpApiEndpoint, HttpApiGroup } from \"effect/unstable/httpapi\";\nimport { Schema } from \"effect\";\nimport { ScopeId } from \"@executor-js/sdk/core\";\nimport { InternalError } from \"@executor-js/api\";\n\nimport { OnePasswordError } from \"../sdk/errors\";\nimport { OnePasswordConfig, Vault, ConnectionStatus } from \"../sdk/types\";\n\n// ---------------------------------------------------------------------------\n// Params\n// ---------------------------------------------------------------------------\n\nconst ScopeParams = { scopeId: ScopeId };\n\n// ---------------------------------------------------------------------------\n// Payloads\n// ---------------------------------------------------------------------------\n\nconst ConfigurePayload = OnePasswordConfig;\n\nconst ListVaultsParams = Schema.Struct({\n authKind: Schema.Literals([\"desktop-app\", \"service-account\"]),\n account: Schema.String,\n});\n\n// ---------------------------------------------------------------------------\n// Responses\n// ---------------------------------------------------------------------------\n\nconst ListVaultsResponse = Schema.Struct({\n vaults: Schema.Array(Vault),\n});\n\nconst GetConfigResponse = Schema.NullOr(OnePasswordConfig);\n\n// ---------------------------------------------------------------------------\n// Group\n//\n// Plugin SDK errors (OnePasswordError) are declared once at the group level\n// via `.addError(...)` — every endpoint inherits. The error carries its own\n// 502 status via `HttpApiSchema.annotations` in errors.ts.\n//\n// `InternalError` is the shared opaque 500 schema translated at the HTTP\n// edge by `withCapture` (see observability.ts). Storage failures on\n// `ctx.storage`/`ctx.secrets` flow through as `StorageFailure` in the\n// typed channel and are captured + downgraded to `InternalError({ traceId })`\n// at Layer composition. No per-handler translation.\n// ---------------------------------------------------------------------------\n\nexport const OnePasswordGroup = HttpApiGroup.make(\"onepassword\")\n .add(\n HttpApiEndpoint.get(\"getConfig\", \"/scopes/:scopeId/onepassword/config\", {\n params: ScopeParams,\n success: GetConfigResponse,\n error: [InternalError, OnePasswordError],\n }),\n )\n .add(\n HttpApiEndpoint.put(\"configure\", \"/scopes/:scopeId/onepassword/config\", {\n params: ScopeParams,\n payload: ConfigurePayload,\n success: Schema.Void,\n error: [InternalError, OnePasswordError],\n }),\n )\n .add(\n HttpApiEndpoint.delete(\"removeConfig\", \"/scopes/:scopeId/onepassword/config\", {\n params: ScopeParams,\n success: Schema.Void,\n error: [InternalError, OnePasswordError],\n }),\n )\n .add(\n HttpApiEndpoint.get(\"status\", \"/scopes/:scopeId/onepassword/status\", {\n params: ScopeParams,\n success: ConnectionStatus,\n error: [InternalError, OnePasswordError],\n }),\n )\n .add(\n HttpApiEndpoint.get(\"listVaults\", \"/scopes/:scopeId/onepassword/vaults\", {\n params: ScopeParams,\n query: ListVaultsParams,\n success: ListVaultsResponse,\n error: [InternalError, OnePasswordError],\n }),\n );\n","import { HttpApiBuilder } from \"effect/unstable/httpapi\";\nimport { Context, Effect } from \"effect\";\n\nimport { addGroup, capture } from \"@executor-js/api\";\nimport type { OnePasswordExtension } from \"../sdk/plugin\";\nimport { OnePasswordGroup } from \"./group\";\n\n// ---------------------------------------------------------------------------\n// Service tag\n//\n// Holds the `Captured` shape — every method's `StorageFailure` channel has\n// been swapped for `InternalError({ traceId })`. The host provides an\n// already-wrapped extension via\n// `Layer.succeed(OnePasswordExtensionService, withCapture(executor).onepassword)`.\n// Handlers see `InternalError` in the error union, which matches\n// `.addError(InternalError)` on the group — no per-handler translation.\n// ---------------------------------------------------------------------------\n\nexport class OnePasswordExtensionService extends Context.Service<OnePasswordExtensionService, OnePasswordExtension\n>()(\"OnePasswordExtensionService\") {}\n\n// ---------------------------------------------------------------------------\n// Composed API — core + onepassword group\n// ---------------------------------------------------------------------------\n\nconst ExecutorApiWithOnePassword = addGroup(OnePasswordGroup);\n\n// ---------------------------------------------------------------------------\n// Handlers\n//\n// Each handler is exactly: yield the extension service, call the method,\n// return. Plugin SDK errors flow through the typed channel and are\n// schema-encoded (OnePasswordError -> 502) by HttpApi. Defects bubble up\n// and are captured + downgraded to `InternalError(traceId)` by the\n// observability middleware.\n// ---------------------------------------------------------------------------\n\nexport const OnePasswordHandlers = HttpApiBuilder.group(\n ExecutorApiWithOnePassword,\n \"onepassword\",\n (handlers) =>\n handlers\n .handle(\"getConfig\", () =>\n capture(Effect.gen(function* () {\n const ext = yield* OnePasswordExtensionService;\n return yield* ext.getConfig();\n })),\n )\n .handle(\"configure\", ({ payload }) =>\n capture(Effect.gen(function* () {\n const ext = yield* OnePasswordExtensionService;\n yield* ext.configure(payload);\n })),\n )\n .handle(\"removeConfig\", () =>\n capture(Effect.gen(function* () {\n const ext = yield* OnePasswordExtensionService;\n yield* ext.removeConfig();\n })),\n )\n .handle(\"status\", () =>\n capture(Effect.gen(function* () {\n const ext = yield* OnePasswordExtensionService;\n return yield* ext.status();\n })),\n )\n .handle(\"listVaults\", ({ query: urlParams }) =>\n capture(Effect.gen(function* () {\n const ext = yield* OnePasswordExtensionService;\n const auth =\n urlParams.authKind === \"desktop-app\"\n ? { kind: \"desktop-app\" as const, accountName: urlParams.account }\n : { kind: \"service-account\" as const, tokenSecretId: urlParams.account };\n const vaults = yield* ext.listVaults(auth);\n return { vaults: [...vaults] };\n })),\n ),\n);\n"],"mappings":";AAAA,SAAS,cAAc;AAEhB,IAAM,mBAAN,cAA+B,OAAO,iBAAmC;AAAA,EAC9E;AAAA,EACA;AAAA,IACE,WAAW,OAAO;AAAA,IAClB,SAAS,OAAO;AAAA,EAClB;AAAA,EACA,EAAE,eAAe,IAAI;AACvB,EAAE;AAAC;;;ACTH,SAAS,UAAAA,eAAc;AAMhB,IAAM,iBAAN,cAA6BA,QAA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SACXF,QAAO,IAAI,aAAa;AACtB,kBAAM,WAAW,OAAO,YAAY,MAAM,GAAG;AAC7C,kBAAM,MAAM,OAAO,uBAAuB,UAAU;AAAA,cAClD;AAAA,cACA;AAAA,YACF,CAAC;AACD,kBAAM,SAAS,OAAO,IAAI,WAAW;AACrC,mBAAO,OACJ,IAAI,CAAC,MAAM,IAAI,MAAM,EAAE,IAAI,EAAE,IAAI,MAAM,EAAE,MAAM,CAAC,CAAC,EACjD,KAAK,CAAC,GAAG,MAAM,EAAE,KAAK,cAAc,EAAE,IAAI,CAAC;AAAA,UAChD,CAAC;AAAA,UAEH,SAAS,CAAC,QACRA,QAAO,IAAI,aAAa;AACtB,kBAAM,SAAS,OAAO,IAAI,QAAQ,UAAU;AAC5C,gBAAI,CAAC,QAAQ;AACX,qBAAO,OAAOA,QAAO;AAAA,gBACnB,IAAI,iBAAiB;AAAA,kBACnB,WAAW;AAAA,kBACX,SAAS;AAAA,gBACX,CAAC;AAAA,cACH;AAAA,YACF;AACA,kBAAM,MAAM,OAAO;AAAA,cACjB;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,YACF;AACA,mBAAO,OAAO,IAAI,cAAc,GAAG;AAAA,UACrC,CAAC;AAAA,QACL;AAAA,MACF;AAAA,MAEA,iBAAiB,CAAC,QAAQ,CAAC,aAAa,KAAK,WAAW,SAAS,CAAC;AAAA,MAElE,QAAQ,MAAM;AAAA,MACd,UAAU,MAAM;AAAA,MAChB,kBAAkB;AAAA,IACpB;AAAA,EACF;AACF;","names":["Schema","Effect","Schema","Schema","Schema","Context","Effect","Context","Effect","DEFAULT_TIMEOUT_MS","Schema","Effect","item","vault"]}
|
package/dist/core.js
CHANGED
|
@@ -10,8 +10,9 @@ import {
|
|
|
10
10
|
makeCliService,
|
|
11
11
|
makeNativeSdkService,
|
|
12
12
|
makeOnePasswordService,
|
|
13
|
+
makeOnePasswordStore,
|
|
13
14
|
onepasswordPlugin
|
|
14
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-2NSVLCQP.js";
|
|
15
16
|
export {
|
|
16
17
|
ConnectionStatus,
|
|
17
18
|
DesktopAppAuth,
|
|
@@ -24,6 +25,7 @@ export {
|
|
|
24
25
|
makeCliService,
|
|
25
26
|
makeNativeSdkService,
|
|
26
27
|
makeOnePasswordService,
|
|
28
|
+
makeOnePasswordStore,
|
|
27
29
|
onepasswordPlugin
|
|
28
30
|
};
|
|
29
31
|
//# sourceMappingURL=core.js.map
|
package/dist/index.js
CHANGED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { onepasswordPlugin } from "./sdk/plugin";
|
|
2
|
+
export type { OnePasswordExtension, OnePasswordPluginOptions } from "./sdk/plugin";
|
|
3
|
+
export { OnePasswordConfig, ConnectionStatus, Vault, OnePasswordAuth, DesktopAppAuth, ServiceAccountAuth, } from "./sdk/types";
|
|
4
|
+
export { OnePasswordError } from "./sdk/errors";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function OnePasswordSettings(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ScopeId } from "@executor-js/sdk/core";
|
|
2
|
+
export declare const onepasswordWriteKeys: readonly ["secrets"];
|
|
3
|
+
export declare const onepasswordConfigAtom: (scopeId: ScopeId) => import("effect/unstable/reactivity/Atom").Atom<import("effect/unstable/reactivity/AsyncResult").AsyncResult<import("../promise").OnePasswordConfig | null, import("@executor-js/api").InternalError | import("../promise").OnePasswordError>>;
|
|
4
|
+
export declare const onepasswordStatusAtom: (scopeId: ScopeId) => import("effect/unstable/reactivity/Atom").Atom<import("effect/unstable/reactivity/AsyncResult").AsyncResult<import("../promise").ConnectionStatus, import("@executor-js/api").InternalError | import("../promise").OnePasswordError>>;
|
|
5
|
+
export declare const onepasswordVaultsAtom: (authKind: "desktop-app" | "service-account", account: string, scopeId: ScopeId) => import("effect/unstable/reactivity/Atom").Atom<import("effect/unstable/reactivity/AsyncResult").AsyncResult<{
|
|
6
|
+
readonly vaults: readonly import("../promise").Vault[];
|
|
7
|
+
}, import("@executor-js/api").InternalError | import("../promise").OnePasswordError>>;
|
|
8
|
+
export declare const configureOnePassword: import("effect/unstable/reactivity/Atom").AtomResultFn<{
|
|
9
|
+
readonly params: {
|
|
10
|
+
readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
|
|
11
|
+
};
|
|
12
|
+
readonly payload: import("../promise").OnePasswordConfig;
|
|
13
|
+
readonly responseMode?: "decoded-only" | undefined;
|
|
14
|
+
readonly reactivityKeys?: readonly unknown[] | import("effect/Record").ReadonlyRecord<string, readonly unknown[]> | undefined;
|
|
15
|
+
}, void, import("@executor-js/api").InternalError | import("../promise").OnePasswordError>;
|
|
16
|
+
export declare const removeOnePasswordConfig: import("effect/unstable/reactivity/Atom").AtomResultFn<{
|
|
17
|
+
readonly params: {
|
|
18
|
+
readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
|
|
19
|
+
};
|
|
20
|
+
readonly responseMode?: "decoded-only" | undefined;
|
|
21
|
+
readonly reactivityKeys?: readonly unknown[] | import("effect/Record").ReadonlyRecord<string, readonly unknown[]> | undefined;
|
|
22
|
+
}, void, import("@executor-js/api").InternalError | import("../promise").OnePasswordError>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const OnePasswordClient: import("effect/unstable/reactivity/AtomHttpApi").AtomHttpApiClient<"Plugin_onepasswordClient", `Plugin_${string}Client`, import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"onepassword", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getConfig", "GET", "/scopes/:scopeId/onepassword/config", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
2
|
+
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
3
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").NullOr<typeof import("../promise").OnePasswordConfig>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof import("../promise").OnePasswordError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"configure", "PUT", "/scopes/:scopeId/onepassword/config", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
4
|
+
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
5
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("../promise").OnePasswordConfig>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Void>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof import("../promise").OnePasswordError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"removeConfig", "DELETE", "/scopes/:scopeId/onepassword/config", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
6
|
+
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
7
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Void>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof import("../promise").OnePasswordError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"status", "GET", "/scopes/:scopeId/onepassword/status", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
8
|
+
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
9
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("../promise").ConnectionStatus>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof import("../promise").OnePasswordError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"listVaults", "GET", "/scopes/:scopeId/onepassword/vaults", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
10
|
+
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
11
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
12
|
+
readonly authKind: import("effect/Schema").Literals<readonly ["desktop-app", "service-account"]>;
|
|
13
|
+
readonly account: import("effect/Schema").String;
|
|
14
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
15
|
+
readonly vaults: import("effect/Schema").$Array<typeof import("../promise").Vault>;
|
|
16
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof import("../promise").OnePasswordError>, never, never>, false>>;
|
package/dist/sdk/errors.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
declare const OnePasswordError_base: Schema.
|
|
3
|
-
readonly
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
message: typeof Schema.String;
|
|
7
|
-
}>;
|
|
2
|
+
declare const OnePasswordError_base: Schema.Class<OnePasswordError, Schema.TaggedStruct<"OnePasswordError", {
|
|
3
|
+
readonly operation: Schema.String;
|
|
4
|
+
readonly message: Schema.String;
|
|
5
|
+
}>, import("effect/Cause").YieldableError>;
|
|
8
6
|
export declare class OnePasswordError extends OnePasswordError_base {
|
|
9
7
|
}
|
|
10
8
|
export {};
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { onepasswordPlugin, type OnePasswordExtension, type OnePasswordPluginOptions, } from "./plugin";
|
|
1
|
+
export { onepasswordPlugin, makeOnePasswordStore, type OnePasswordExtension, type OnePasswordPluginOptions, type OnePasswordStore, } from "./plugin";
|
|
2
2
|
export { OnePasswordConfig, Vault, ConnectionStatus, OnePasswordAuth, DesktopAppAuth, ServiceAccountAuth, } from "./types";
|
|
3
3
|
export { OnePasswordError } from "./errors";
|
|
4
4
|
export { makeOnePasswordService, makeNativeSdkService, makeCliService, OnePasswordServiceTag, type OnePasswordService, type ResolvedAuth, } from "./service";
|
package/dist/sdk/plugin.d.ts
CHANGED
|
@@ -1,30 +1,60 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
|
-
import { type
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
|
+
import { StorageError, type PluginBlobStore, type StorageFailure } from "@executor-js/sdk/core";
|
|
3
|
+
import { OnePasswordExtensionService } from "../api/handlers";
|
|
3
4
|
import { OnePasswordConfig, Vault, ConnectionStatus } from "./types";
|
|
4
5
|
import type { OnePasswordAuth } from "./types";
|
|
5
6
|
import { OnePasswordError } from "./errors";
|
|
6
|
-
|
|
7
|
+
export type OnePasswordExtensionFailure = OnePasswordError | StorageFailure;
|
|
7
8
|
export interface OnePasswordExtension {
|
|
8
9
|
/** Configure the 1Password connection */
|
|
9
|
-
readonly configure: (config: OnePasswordConfig) => Effect.Effect<void,
|
|
10
|
+
readonly configure: (config: OnePasswordConfig) => Effect.Effect<void, StorageFailure>;
|
|
10
11
|
/** Get current configuration (if any) */
|
|
11
|
-
readonly getConfig: () => Effect.Effect<OnePasswordConfig | null,
|
|
12
|
+
readonly getConfig: () => Effect.Effect<OnePasswordConfig | null, OnePasswordExtensionFailure>;
|
|
12
13
|
/** Remove the 1Password configuration */
|
|
13
|
-
readonly removeConfig: () => Effect.Effect<void>;
|
|
14
|
+
readonly removeConfig: () => Effect.Effect<void, StorageFailure>;
|
|
14
15
|
/** Check connection status */
|
|
15
|
-
readonly status: () => Effect.Effect<ConnectionStatus,
|
|
16
|
+
readonly status: () => Effect.Effect<ConnectionStatus, OnePasswordExtensionFailure>;
|
|
16
17
|
/** List accessible vaults (requires auth) */
|
|
17
|
-
readonly listVaults: (auth: OnePasswordAuth) => Effect.Effect<ReadonlyArray<Vault>,
|
|
18
|
+
readonly listVaults: (auth: OnePasswordAuth) => Effect.Effect<ReadonlyArray<Vault>, OnePasswordExtensionFailure>;
|
|
18
19
|
/** Resolve a secret directly by op:// URI */
|
|
19
|
-
readonly resolve: (uri: string) => Effect.Effect<string,
|
|
20
|
+
readonly resolve: (uri: string) => Effect.Effect<string, OnePasswordExtensionFailure>;
|
|
20
21
|
}
|
|
22
|
+
export interface OnePasswordStore {
|
|
23
|
+
readonly getConfig: () => Effect.Effect<OnePasswordConfig | null, StorageError | OnePasswordError>;
|
|
24
|
+
readonly saveConfig: (config: OnePasswordConfig) => Effect.Effect<void, StorageError>;
|
|
25
|
+
readonly deleteConfig: () => Effect.Effect<void, StorageError>;
|
|
26
|
+
}
|
|
27
|
+
export declare const makeOnePasswordStore: (blobs: PluginBlobStore,
|
|
28
|
+
/** Scope id that owns the single 1Password config blob. Default is the
|
|
29
|
+
* outermost scope (org/workspace) so the config is visible across
|
|
30
|
+
* every per-user scope via the blob store's fall-through read. */
|
|
31
|
+
writeScope: string) => OnePasswordStore;
|
|
21
32
|
export interface OnePasswordPluginOptions {
|
|
22
|
-
/** Scoped KV for persisting config (provided by server) */
|
|
23
|
-
readonly kv: ScopedKv;
|
|
24
33
|
/** Request timeout in ms (default: 15000) */
|
|
25
34
|
readonly timeoutMs?: number;
|
|
26
35
|
/** Force use of the native SDK instead of the CLI (default: false) */
|
|
27
36
|
readonly preferSdk?: boolean;
|
|
28
37
|
}
|
|
29
|
-
export declare const onepasswordPlugin: (
|
|
30
|
-
|
|
38
|
+
export declare const onepasswordPlugin: import("@executor-js/sdk/core").ConfiguredPlugin<"onepassword", {
|
|
39
|
+
configure: (config: OnePasswordConfig) => Effect.Effect<void, StorageError, never>;
|
|
40
|
+
getConfig: () => Effect.Effect<OnePasswordConfig | null, StorageError | OnePasswordError, never>;
|
|
41
|
+
removeConfig: () => Effect.Effect<void, StorageError, never>;
|
|
42
|
+
status: () => Effect.Effect<ConnectionStatus, StorageFailure | OnePasswordError, never>;
|
|
43
|
+
listVaults: (auth: import("./types").DesktopAppAuth | import("./types").ServiceAccountAuth) => Effect.Effect<Vault[], StorageFailure | OnePasswordError, never>;
|
|
44
|
+
resolve: (uri: string) => Effect.Effect<string, StorageFailure | OnePasswordError, never>;
|
|
45
|
+
}, OnePasswordStore, OnePasswordPluginOptions, undefined, typeof OnePasswordExtensionService, import("effect/Layer").Layer<import("effect/unstable/httpapi/HttpApiGroup").ApiGroup<"executor", "onepassword">, never, import("effect/unstable/http/HttpRouter").Request<"Requires", OnePasswordExtensionService>>, import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"onepassword", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getConfig", "GET", "/scopes/:scopeId/onepassword/config", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<Schema.Struct<{
|
|
46
|
+
scopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
47
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<Schema.NullOr<typeof OnePasswordConfig>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof OnePasswordError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"configure", "PUT", "/scopes/:scopeId/onepassword/config", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<Schema.Struct<{
|
|
48
|
+
scopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
49
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof OnePasswordConfig>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<Schema.Void>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof OnePasswordError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"removeConfig", "DELETE", "/scopes/:scopeId/onepassword/config", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<Schema.Struct<{
|
|
50
|
+
scopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
51
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<Schema.Void>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof OnePasswordError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"status", "GET", "/scopes/:scopeId/onepassword/status", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<Schema.Struct<{
|
|
52
|
+
scopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
53
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof ConnectionStatus>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof OnePasswordError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"listVaults", "GET", "/scopes/:scopeId/onepassword/vaults", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<Schema.Struct<{
|
|
54
|
+
scopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
55
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<Schema.Struct<{
|
|
56
|
+
readonly authKind: Schema.Literals<readonly ["desktop-app", "service-account"]>;
|
|
57
|
+
readonly account: Schema.String;
|
|
58
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<Schema.Struct<{
|
|
59
|
+
readonly vaults: Schema.$Array<typeof Vault>;
|
|
60
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof OnePasswordError>, never, never>, false>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/sdk/service.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface OnePasswordService {
|
|
|
16
16
|
/** List items in a vault */
|
|
17
17
|
readonly listItems: (vaultId: string) => Effect.Effect<ReadonlyArray<OnePasswordItem>, OnePasswordError>;
|
|
18
18
|
}
|
|
19
|
-
declare const OnePasswordServiceTag_base: Context.
|
|
19
|
+
declare const OnePasswordServiceTag_base: Context.ServiceClass<OnePasswordServiceTag, "@executor-js/plugin-onepassword/OnePasswordService", OnePasswordService>;
|
|
20
20
|
export declare class OnePasswordServiceTag extends OnePasswordServiceTag_base {
|
|
21
21
|
}
|
|
22
22
|
export type ResolvedAuth = {
|
package/dist/sdk/types.d.ts
CHANGED
|
@@ -1,85 +1,40 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
declare const DesktopAppAuth_base: Schema.Class<DesktopAppAuth, {
|
|
3
|
-
kind: Schema.Literal<
|
|
2
|
+
declare const DesktopAppAuth_base: Schema.Class<DesktopAppAuth, Schema.Struct<{
|
|
3
|
+
readonly kind: Schema.Literal<"desktop-app">;
|
|
4
4
|
/** 1Password account domain, e.g. "my.1password.com" */
|
|
5
|
-
accountName:
|
|
6
|
-
}
|
|
7
|
-
kind: Schema.Literal<["desktop-app"]>;
|
|
8
|
-
/** 1Password account domain, e.g. "my.1password.com" */
|
|
9
|
-
accountName: typeof Schema.String;
|
|
10
|
-
}>, never, {
|
|
11
|
-
readonly kind: "desktop-app";
|
|
12
|
-
} & {
|
|
13
|
-
readonly accountName: string;
|
|
14
|
-
}, {}, {}>;
|
|
5
|
+
readonly accountName: Schema.String;
|
|
6
|
+
}>, {}>;
|
|
15
7
|
export declare class DesktopAppAuth extends DesktopAppAuth_base {
|
|
16
8
|
}
|
|
17
|
-
declare const ServiceAccountAuth_base: Schema.Class<ServiceAccountAuth, {
|
|
18
|
-
kind: Schema.Literal<
|
|
19
|
-
/** The service account token (stored as a secret) */
|
|
20
|
-
tokenSecretId: typeof Schema.String;
|
|
21
|
-
}, Schema.Struct.Encoded<{
|
|
22
|
-
kind: Schema.Literal<["service-account"]>;
|
|
9
|
+
declare const ServiceAccountAuth_base: Schema.Class<ServiceAccountAuth, Schema.Struct<{
|
|
10
|
+
readonly kind: Schema.Literal<"service-account">;
|
|
23
11
|
/** The service account token (stored as a secret) */
|
|
24
|
-
tokenSecretId:
|
|
25
|
-
}>,
|
|
26
|
-
readonly kind: "service-account";
|
|
27
|
-
} & {
|
|
28
|
-
readonly tokenSecretId: string;
|
|
29
|
-
}, {}, {}>;
|
|
12
|
+
readonly tokenSecretId: Schema.String;
|
|
13
|
+
}>, {}>;
|
|
30
14
|
export declare class ServiceAccountAuth extends ServiceAccountAuth_base {
|
|
31
15
|
}
|
|
32
|
-
export declare const OnePasswordAuth: Schema.Union<[typeof DesktopAppAuth, typeof ServiceAccountAuth]>;
|
|
16
|
+
export declare const OnePasswordAuth: Schema.Union<readonly [typeof DesktopAppAuth, typeof ServiceAccountAuth]>;
|
|
33
17
|
export type OnePasswordAuth = typeof OnePasswordAuth.Type;
|
|
34
|
-
declare const OnePasswordConfig_base: Schema.Class<OnePasswordConfig, {
|
|
35
|
-
auth: Schema.Union<[typeof DesktopAppAuth, typeof ServiceAccountAuth]>;
|
|
36
|
-
/** Vault to scope operations to */
|
|
37
|
-
vaultId: typeof Schema.String;
|
|
38
|
-
/** Human label */
|
|
39
|
-
name: typeof Schema.String;
|
|
40
|
-
}, Schema.Struct.Encoded<{
|
|
41
|
-
auth: Schema.Union<[typeof DesktopAppAuth, typeof ServiceAccountAuth]>;
|
|
18
|
+
declare const OnePasswordConfig_base: Schema.Class<OnePasswordConfig, Schema.Struct<{
|
|
19
|
+
readonly auth: Schema.Union<readonly [typeof DesktopAppAuth, typeof ServiceAccountAuth]>;
|
|
42
20
|
/** Vault to scope operations to */
|
|
43
|
-
vaultId:
|
|
21
|
+
readonly vaultId: Schema.String;
|
|
44
22
|
/** Human label */
|
|
45
|
-
name:
|
|
46
|
-
}>,
|
|
47
|
-
readonly name: string;
|
|
48
|
-
} & {
|
|
49
|
-
readonly auth: DesktopAppAuth | ServiceAccountAuth;
|
|
50
|
-
} & {
|
|
51
|
-
readonly vaultId: string;
|
|
52
|
-
}, {}, {}>;
|
|
23
|
+
readonly name: Schema.String;
|
|
24
|
+
}>, {}>;
|
|
53
25
|
export declare class OnePasswordConfig extends OnePasswordConfig_base {
|
|
54
26
|
}
|
|
55
|
-
declare const Vault_base: Schema.Class<Vault, {
|
|
56
|
-
id:
|
|
57
|
-
name:
|
|
58
|
-
}
|
|
59
|
-
id: typeof Schema.String;
|
|
60
|
-
name: typeof Schema.String;
|
|
61
|
-
}>, never, {
|
|
62
|
-
readonly id: string;
|
|
63
|
-
} & {
|
|
64
|
-
readonly name: string;
|
|
65
|
-
}, {}, {}>;
|
|
27
|
+
declare const Vault_base: Schema.Class<Vault, Schema.Struct<{
|
|
28
|
+
readonly id: Schema.String;
|
|
29
|
+
readonly name: Schema.String;
|
|
30
|
+
}>, {}>;
|
|
66
31
|
export declare class Vault extends Vault_base {
|
|
67
32
|
}
|
|
68
|
-
declare const ConnectionStatus_base: Schema.Class<ConnectionStatus, {
|
|
69
|
-
connected:
|
|
70
|
-
vaultName: Schema.optional<
|
|
71
|
-
error: Schema.optional<
|
|
72
|
-
}
|
|
73
|
-
connected: typeof Schema.Boolean;
|
|
74
|
-
vaultName: Schema.optional<typeof Schema.String>;
|
|
75
|
-
error: Schema.optional<typeof Schema.String>;
|
|
76
|
-
}>, never, {
|
|
77
|
-
readonly error?: string | undefined;
|
|
78
|
-
} & {
|
|
79
|
-
readonly connected: boolean;
|
|
80
|
-
} & {
|
|
81
|
-
readonly vaultName?: string | undefined;
|
|
82
|
-
}, {}, {}>;
|
|
33
|
+
declare const ConnectionStatus_base: Schema.Class<ConnectionStatus, Schema.Struct<{
|
|
34
|
+
readonly connected: Schema.Boolean;
|
|
35
|
+
readonly vaultName: Schema.optional<Schema.String>;
|
|
36
|
+
readonly error: Schema.optional<Schema.String>;
|
|
37
|
+
}>, {}>;
|
|
83
38
|
export declare class ConnectionStatus extends ConnectionStatus_base {
|
|
84
39
|
}
|
|
85
40
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@executor-js/plugin-onepassword",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"homepage": "https://github.com/RhysSullivan/executor/tree/main/packages/plugins/onepassword",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/RhysSullivan/executor/issues"
|
|
@@ -42,33 +42,28 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@1password/op-js": "^0.1.13",
|
|
44
44
|
"@1password/sdk": "^0.4.1-beta.1",
|
|
45
|
-
"@effect
|
|
46
|
-
"@
|
|
47
|
-
"
|
|
48
|
-
"@executor-js/sdk": "0.0.1",
|
|
49
|
-
"effect": "^3.21.0"
|
|
45
|
+
"@effect/atom-react": "4.0.0-beta.59",
|
|
46
|
+
"@executor-js/sdk": "0.1.0",
|
|
47
|
+
"effect": "4.0.0-beta.59"
|
|
50
48
|
},
|
|
51
49
|
"devDependencies": {
|
|
50
|
+
"@effect/vitest": "4.0.0-beta.59",
|
|
52
51
|
"@types/node": "^24.3.1",
|
|
53
52
|
"@types/react": "^19.1.0",
|
|
54
53
|
"bun-types": "^1.2.22",
|
|
55
54
|
"react": "^19.1.0",
|
|
56
55
|
"tsup": "^8.5.0",
|
|
57
|
-
"vitest": "^4.1.
|
|
56
|
+
"vitest": "^4.1.5"
|
|
58
57
|
},
|
|
59
58
|
"peerDependencies": {
|
|
60
|
-
"@effect
|
|
61
|
-
"@executor/react": "1.4.3",
|
|
59
|
+
"@effect/atom-react": "4.0.0-beta.59",
|
|
62
60
|
"react": ">=18"
|
|
63
61
|
},
|
|
64
62
|
"peerDependenciesMeta": {
|
|
65
63
|
"react": {
|
|
66
64
|
"optional": true
|
|
67
65
|
},
|
|
68
|
-
"@effect
|
|
69
|
-
"optional": true
|
|
70
|
-
},
|
|
71
|
-
"@executor/react": {
|
|
66
|
+
"@effect/atom-react": {
|
|
72
67
|
"optional": true
|
|
73
68
|
}
|
|
74
69
|
}
|