From 92f772fbd4a2b6b70f275ccb4d0d7e7fde156f0a Mon Sep 17 00:00:00 2001 From: "Michael K (Pear)" Date: Mon, 31 Aug 2026 03:34:19 -0400 Subject: [PATCH 1/2] feat(onepassword): add the 1Password SDK --- .gitmodules | 5 + .../.generated-specs/onepassword.json | 3520 +++++++++++++++++ packages/onepassword/package.json | 85 + packages/onepassword/scripts/convert.ts | 33 + packages/onepassword/scripts/generate.ts | 93 + packages/onepassword/src/credentials.ts | 74 + packages/onepassword/src/errors.ts | 50 + packages/onepassword/src/index.ts | 31 + packages/onepassword/src/pagination.ts | 7 + packages/onepassword/src/protocol.ts | 68 + packages/onepassword/src/retry.ts | 56 + packages/onepassword/src/services/index.ts | 2 + .../onepassword/src/services/onepassword.ts | 1640 ++++++++ packages/onepassword/src/traits.ts | 44 + packages/onepassword/tsconfig.json | 14 + packages/onepassword/tsconfig.scripts.json | 17 + stacks/distilled-submodules/SpecRepos.ts | 1 + .../spec-repos/onepassword/fetch-specs.ts | 96 + .../spec-repos/onepassword/package.json | 27 + .../spec-repos/onepassword/readme.md | 34 + tsconfig.json | 226 +- 21 files changed, 6068 insertions(+), 55 deletions(-) create mode 100644 packages/onepassword/.generated-specs/onepassword.json create mode 100644 packages/onepassword/package.json create mode 100644 packages/onepassword/scripts/convert.ts create mode 100644 packages/onepassword/scripts/generate.ts create mode 100644 packages/onepassword/src/credentials.ts create mode 100644 packages/onepassword/src/errors.ts create mode 100644 packages/onepassword/src/index.ts create mode 100644 packages/onepassword/src/pagination.ts create mode 100644 packages/onepassword/src/protocol.ts create mode 100644 packages/onepassword/src/retry.ts create mode 100644 packages/onepassword/src/services/index.ts create mode 100644 packages/onepassword/src/services/onepassword.ts create mode 100644 packages/onepassword/src/traits.ts create mode 100644 packages/onepassword/tsconfig.json create mode 100644 packages/onepassword/tsconfig.scripts.json create mode 100644 stacks/distilled-submodules/spec-repos/onepassword/fetch-specs.ts create mode 100644 stacks/distilled-submodules/spec-repos/onepassword/package.json create mode 100644 stacks/distilled-submodules/spec-repos/onepassword/readme.md diff --git a/.gitmodules b/.gitmodules index b3e72e9d6b..6c3bbdfe62 100644 --- a/.gitmodules +++ b/.gitmodules @@ -128,3 +128,8 @@ url = https://github.com/distilled-mirror/spec-mirror-modal.git ignore = dirty shallow = true +[submodule "packages/onepassword/specs/spec-mirror-onepassword"] + path = packages/onepassword/specs/spec-mirror-onepassword + url = https://github.com/distilled-mirror/spec-mirror-onepassword.git + ignore = dirty + shallow = true diff --git a/packages/onepassword/.generated-specs/onepassword.json b/packages/onepassword/.generated-specs/onepassword.json new file mode 100644 index 0000000000..eaa5db6ed8 --- /dev/null +++ b/packages/onepassword/.generated-specs/onepassword.json @@ -0,0 +1,3520 @@ +{ + "smithy": "2.0", + "metadata": { + "suppressions": [ + { + "id": "HttpUriConflict", + "namespace": "*" + }, + { + "id": "HttpMethodSemantics", + "namespace": "*" + }, + { + "id": "UnreferencedShape", + "namespace": "*" + } + ] + }, + "shapes": { + "com.onepassword.connect#GetApiActivityRequest": { + "type": "structure", + "members": { + "limit": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpQuery": "limit", + "smithy.api#documentation": "How many API Events should be retrieved in a single request." + } + }, + "offset": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpQuery": "offset", + "smithy.api#documentation": "How far into the collection of API Events should the response start" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.onepassword.connect#APIRequest": { + "type": "structure", + "members": { + "requestId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The unique id used to identify a single request." + } + }, + "timestamp": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The time at which the request was processed by the server." + } + }, + "action": { + "target": "com.onepassword.connect#APIRequestAction" + }, + "result": { + "target": "com.onepassword.connect#APIRequestResult" + }, + "actor": { + "target": "com.onepassword.connect#APIRequestActor" + }, + "resource": { + "target": "com.onepassword.connect#APIRequestResource" + } + }, + "traits": { + "smithy.api#documentation": "Represents a request that was made to the API. Including what Token was used and what resource was accessed." + } + }, + "com.onepassword.connect#APIRequestAction": { + "type": "enum", + "members": { + "READ": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "READ" + } + }, + "CREATE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREATE" + } + }, + "UPDATE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPDATE" + } + }, + "DELETE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETE" + } + } + }, + "traits": {} + }, + "com.onepassword.connect#APIRequestResult": { + "type": "enum", + "members": { + "SUCCESS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SUCCESS" + } + }, + "DENY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DENY" + } + } + }, + "traits": {} + }, + "com.onepassword.connect#APIRequestActor": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String" + }, + "account": { + "target": "smithy.api#String" + }, + "jti": { + "target": "smithy.api#String" + }, + "userAgent": { + "target": "smithy.api#String" + }, + "requestIp": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.onepassword.connect#APIRequestResourceType": { + "type": "enum", + "members": { + "ITEM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ITEM" + } + }, + "VAULT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "VAULT" + } + } + }, + "traits": {} + }, + "com.onepassword.connect#APIRequestResourceVault": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.onepassword.connect#APIRequestResourceItem": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.onepassword.connect#APIRequestResource": { + "type": "structure", + "members": { + "type": { + "target": "com.onepassword.connect#APIRequestResourceType" + }, + "vault": { + "target": "com.onepassword.connect#APIRequestResourceVault" + }, + "item": { + "target": "com.onepassword.connect#APIRequestResourceItem" + }, + "itemVersion": { + "target": "smithy.api#Integer" + } + }, + "traits": {} + }, + "com.onepassword.connect#GetApiActivityResponseBodyList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#APIRequest" + }, + "traits": {} + }, + "com.onepassword.connect#GetApiActivityResponse": { + "type": "structure", + "members": { + "body": { + "target": "com.onepassword.connect#GetApiActivityResponseBodyList", + "traits": { + "com.distilled.openapi#rawResponse": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.onepassword.connect#GetApiActivity": { + "type": "operation", + "input": { + "target": "com.onepassword.connect#GetApiActivityRequest" + }, + "output": { + "target": "com.onepassword.connect#GetApiActivityResponse" + }, + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/activity", + "code": 200 + }, + "smithy.api#documentation": "Retrieve a list of API Requests that have been made." + } + }, + "com.onepassword.connect#GetVaultsRequest": { + "type": "structure", + "members": { + "filter": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "filter", + "smithy.api#documentation": "Filter the Vault collection based on Vault name using SCIM eq filter" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.onepassword.connect#Vault": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String" + }, + "name": { + "target": "smithy.api#String" + }, + "description": { + "target": "smithy.api#String" + }, + "attributeVersion": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The vault version" + } + }, + "contentVersion": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The version of the vault contents" + } + }, + "items": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Number of active items in the vault" + } + }, + "type": { + "target": "com.onepassword.connect#VaultType" + }, + "createdAt": { + "target": "smithy.api#String" + }, + "updatedAt": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.onepassword.connect#VaultType": { + "type": "enum", + "members": { + "USER_CREATED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "USER_CREATED" + } + }, + "PERSONAL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PERSONAL" + } + }, + "EVERYONE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EVERYONE" + } + }, + "TRANSFER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TRANSFER" + } + } + }, + "traits": {} + }, + "com.onepassword.connect#GetVaultsResponseBodyList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#Vault" + }, + "traits": {} + }, + "com.onepassword.connect#GetVaultsResponse": { + "type": "structure", + "members": { + "body": { + "target": "com.onepassword.connect#GetVaultsResponseBodyList", + "traits": { + "com.distilled.openapi#rawResponse": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.onepassword.connect#GetVaults": { + "type": "operation", + "input": { + "target": "com.onepassword.connect#GetVaultsRequest" + }, + "output": { + "target": "com.onepassword.connect#GetVaultsResponse" + }, + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/vaults", + "code": 200 + }, + "smithy.api#documentation": "Get all Vaults" + } + }, + "com.onepassword.connect#GetVaultByIdRequest": { + "type": "structure", + "members": { + "vaultUuid": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The UUID of the Vault to fetch Items from" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.onepassword.connect#GetVaultById": { + "type": "operation", + "input": { + "target": "com.onepassword.connect#GetVaultByIdRequest" + }, + "output": { + "target": "com.onepassword.connect#Vault" + }, + "errors": [ + { + "target": "com.onepassword.connect#Forbidden" + }, + { + "target": "com.onepassword.connect#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/vaults/{vaultUuid}", + "code": 200 + }, + "smithy.api#documentation": "Get Vault details and metadata" + } + }, + "com.onepassword.connect#GetVaultItemsRequest": { + "type": "structure", + "members": { + "vaultUuid": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The UUID of the Vault to fetch Items from" + } + }, + "filter": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "filter", + "smithy.api#documentation": "Filter the Item collection based on Item name using SCIM eq filter" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.onepassword.connect#Item": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String" + }, + "title": { + "target": "smithy.api#String" + }, + "vault": { + "target": "com.onepassword.connect#ItemVault", + "traits": { + "smithy.api#required": {} + } + }, + "category": { + "target": "com.onepassword.connect#ItemCategory", + "traits": { + "smithy.api#required": {} + } + }, + "urls": { + "target": "com.onepassword.connect#ItemUrlsList" + }, + "favorite": { + "target": "smithy.api#Boolean" + }, + "tags": { + "target": "com.onepassword.connect#ItemTagsList" + }, + "version": { + "target": "smithy.api#Integer" + }, + "state": { + "target": "com.onepassword.connect#ItemState" + }, + "createdAt": { + "target": "smithy.api#String" + }, + "updatedAt": { + "target": "smithy.api#String" + }, + "lastEditedBy": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.onepassword.connect#ItemVault": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": {} + }, + "com.onepassword.connect#ItemCategory": { + "type": "enum", + "members": { + "LOGIN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LOGIN" + } + }, + "PASSWORD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PASSWORD" + } + }, + "API_CREDENTIAL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "API_CREDENTIAL" + } + }, + "SERVER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SERVER" + } + }, + "DATABASE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DATABASE" + } + }, + "CREDIT_CARD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREDIT_CARD" + } + }, + "MEMBERSHIP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MEMBERSHIP" + } + }, + "PASSPORT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PASSPORT" + } + }, + "SOFTWARE_LICENSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SOFTWARE_LICENSE" + } + }, + "OUTDOOR_LICENSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "OUTDOOR_LICENSE" + } + }, + "SECURE_NOTE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SECURE_NOTE" + } + }, + "WIRELESS_ROUTER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "WIRELESS_ROUTER" + } + }, + "BANK_ACCOUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BANK_ACCOUNT" + } + }, + "DRIVER_LICENSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DRIVER_LICENSE" + } + }, + "IDENTITY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IDENTITY" + } + }, + "REWARD_PROGRAM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "REWARD_PROGRAM" + } + }, + "DOCUMENT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DOCUMENT" + } + }, + "EMAIL_ACCOUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EMAIL_ACCOUNT" + } + }, + "SOCIAL_SECURITY_NUMBER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SOCIAL_SECURITY_NUMBER" + } + }, + "MEDICAL_RECORD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MEDICAL_RECORD" + } + }, + "SSH_KEY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SSH_KEY" + } + }, + "CUSTOM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CUSTOM" + } + } + }, + "traits": {} + }, + "com.onepassword.connect#ItemUrlsItem": { + "type": "structure", + "members": { + "label": { + "target": "smithy.api#String" + }, + "primary": { + "target": "smithy.api#Boolean" + }, + "href": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": {} + }, + "com.onepassword.connect#ItemUrlsList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#ItemUrlsItem" + }, + "traits": {} + }, + "com.onepassword.connect#ItemTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.onepassword.connect#ItemState": { + "type": "enum", + "members": { + "ARCHIVED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ARCHIVED" + } + }, + "DELETED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETED" + } + } + }, + "traits": {} + }, + "com.onepassword.connect#GetVaultItemsResponseBodyList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#Item" + }, + "traits": {} + }, + "com.onepassword.connect#GetVaultItemsResponse": { + "type": "structure", + "members": { + "body": { + "target": "com.onepassword.connect#GetVaultItemsResponseBodyList", + "traits": { + "com.distilled.openapi#rawResponse": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.onepassword.connect#GetVaultItems": { + "type": "operation", + "input": { + "target": "com.onepassword.connect#GetVaultItemsRequest" + }, + "output": { + "target": "com.onepassword.connect#GetVaultItemsResponse" + }, + "errors": [ + { + "target": "com.onepassword.connect#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/vaults/{vaultUuid}/items", + "code": 200 + }, + "smithy.api#documentation": "Get all items for inside a Vault" + } + }, + "com.onepassword.connect#CreateVaultItemRequestVault": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": {} + }, + "com.onepassword.connect#CreateVaultItemRequestCategory": { + "type": "enum", + "members": { + "LOGIN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LOGIN" + } + }, + "PASSWORD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PASSWORD" + } + }, + "API_CREDENTIAL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "API_CREDENTIAL" + } + }, + "SERVER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SERVER" + } + }, + "DATABASE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DATABASE" + } + }, + "CREDIT_CARD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREDIT_CARD" + } + }, + "MEMBERSHIP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MEMBERSHIP" + } + }, + "PASSPORT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PASSPORT" + } + }, + "SOFTWARE_LICENSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SOFTWARE_LICENSE" + } + }, + "OUTDOOR_LICENSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "OUTDOOR_LICENSE" + } + }, + "SECURE_NOTE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SECURE_NOTE" + } + }, + "WIRELESS_ROUTER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "WIRELESS_ROUTER" + } + }, + "BANK_ACCOUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BANK_ACCOUNT" + } + }, + "DRIVER_LICENSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DRIVER_LICENSE" + } + }, + "IDENTITY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IDENTITY" + } + }, + "REWARD_PROGRAM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "REWARD_PROGRAM" + } + }, + "DOCUMENT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DOCUMENT" + } + }, + "EMAIL_ACCOUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EMAIL_ACCOUNT" + } + }, + "SOCIAL_SECURITY_NUMBER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SOCIAL_SECURITY_NUMBER" + } + }, + "MEDICAL_RECORD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MEDICAL_RECORD" + } + }, + "SSH_KEY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SSH_KEY" + } + }, + "CUSTOM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CUSTOM" + } + } + }, + "traits": {} + }, + "com.onepassword.connect#CreateVaultItemRequestUrlsItem": { + "type": "structure", + "members": { + "label": { + "target": "smithy.api#String" + }, + "primary": { + "target": "smithy.api#Boolean" + }, + "href": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": {} + }, + "com.onepassword.connect#CreateVaultItemRequestUrlsList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#CreateVaultItemRequestUrlsItem" + }, + "traits": {} + }, + "com.onepassword.connect#CreateVaultItemRequestTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.onepassword.connect#CreateVaultItemRequestSectionsItem": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String" + }, + "label": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.onepassword.connect#CreateVaultItemRequestSectionsList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#CreateVaultItemRequestSectionsItem" + }, + "traits": {} + }, + "com.onepassword.connect#FieldInput": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "section": { + "target": "com.onepassword.connect#FieldInputSection" + }, + "type": { + "target": "com.onepassword.connect#FieldInputType", + "traits": { + "smithy.api#required": {} + } + }, + "purpose": { + "target": "com.onepassword.connect#FieldInputPurpose", + "traits": { + "smithy.api#documentation": "Some item types, Login and Password, have fields used for autofill. This property indicates that purpose and is required for some item types." + } + }, + "label": { + "target": "smithy.api#String" + }, + "value": { + "target": "smithy.api#String" + }, + "generate": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "If value is not present then a new value should be generated for this field" + } + }, + "recipe": { + "target": "com.onepassword.connect#GeneratorRecipe" + } + }, + "traits": {} + }, + "com.onepassword.connect#FieldInputSection": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.onepassword.connect#FieldInputType": { + "type": "enum", + "members": { + "STRING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "STRING" + } + }, + "EMAIL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EMAIL" + } + }, + "CONCEALED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CONCEALED" + } + }, + "URL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "URL" + } + }, + "TOTP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TOTP" + } + }, + "DATE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DATE" + } + }, + "MONTH_YEAR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MONTH_YEAR" + } + }, + "MENU": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MENU" + } + } + }, + "traits": {} + }, + "com.onepassword.connect#FieldInputPurpose": { + "type": "enum", + "members": { + "VALUE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "" + } + }, + "USERNAME": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "USERNAME" + } + }, + "PASSWORD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PASSWORD" + } + }, + "NOTES": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NOTES" + } + } + }, + "traits": { + "smithy.api#documentation": "Some item types, Login and Password, have fields used for autofill. This property indicates that purpose and is required for some item types." + } + }, + "com.onepassword.connect#GeneratorRecipe": { + "type": "structure", + "members": { + "length": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Length of the generated value" + } + }, + "characterSets": { + "target": "com.onepassword.connect#GeneratorRecipeCharacterSetsList" + }, + "excludeCharacters": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "List of all characters that should be excluded from generated passwords." + } + } + }, + "traits": { + "smithy.api#documentation": "The recipe is used in conjunction with the \"generate\" property to set the character set used to generate a new secure value" + } + }, + "com.onepassword.connect#GeneratorRecipeCharacterSetsItem": { + "type": "enum", + "members": { + "LETTERS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LETTERS" + } + }, + "DIGITS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DIGITS" + } + }, + "SYMBOLS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SYMBOLS" + } + } + }, + "traits": {} + }, + "com.onepassword.connect#GeneratorRecipeCharacterSetsList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#GeneratorRecipeCharacterSetsItem" + }, + "traits": {} + }, + "com.onepassword.connect#CreateVaultItemRequestFieldsList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#FieldInput" + }, + "traits": {} + }, + "com.onepassword.connect#FileInput": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ID of the file" + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name of the file" + } + }, + "size": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Size in bytes of the file" + } + }, + "section": { + "target": "com.onepassword.connect#FileInputSection", + "traits": { + "smithy.api#documentation": "For files that are in a section, this field describes the section." + } + }, + "content": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Base64-encoded contents of the file. Only set if size <= OP_MAX_INLINE_FILE_SIZE_KB kb and `inline_files` is set to `true`." + } + } + }, + "traits": {} + }, + "com.onepassword.connect#FileInputSection": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "For files that are in a section, this field describes the section." + } + }, + "com.onepassword.connect#CreateVaultItemRequestFilesList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#FileInput" + }, + "traits": {} + }, + "com.onepassword.connect#CreateVaultItemRequest": { + "type": "structure", + "members": { + "vaultUuid": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The UUID of the Vault to create an Item in" + } + }, + "id": { + "target": "smithy.api#String" + }, + "title": { + "target": "smithy.api#String" + }, + "vault": { + "target": "com.onepassword.connect#CreateVaultItemRequestVault", + "traits": { + "smithy.api#required": {} + } + }, + "category": { + "target": "com.onepassword.connect#CreateVaultItemRequestCategory", + "traits": { + "smithy.api#required": {} + } + }, + "urls": { + "target": "com.onepassword.connect#CreateVaultItemRequestUrlsList" + }, + "favorite": { + "target": "smithy.api#Boolean" + }, + "tags": { + "target": "com.onepassword.connect#CreateVaultItemRequestTagsList" + }, + "version": { + "target": "smithy.api#Integer" + }, + "sections": { + "target": "com.onepassword.connect#CreateVaultItemRequestSectionsList" + }, + "fields": { + "target": "com.onepassword.connect#CreateVaultItemRequestFieldsList" + }, + "files": { + "target": "com.onepassword.connect#CreateVaultItemRequestFilesList" + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.onepassword.connect#CreateVaultItemResponseVault": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": {} + }, + "com.onepassword.connect#CreateVaultItemResponseCategory": { + "type": "enum", + "members": { + "LOGIN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LOGIN" + } + }, + "PASSWORD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PASSWORD" + } + }, + "API_CREDENTIAL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "API_CREDENTIAL" + } + }, + "SERVER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SERVER" + } + }, + "DATABASE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DATABASE" + } + }, + "CREDIT_CARD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREDIT_CARD" + } + }, + "MEMBERSHIP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MEMBERSHIP" + } + }, + "PASSPORT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PASSPORT" + } + }, + "SOFTWARE_LICENSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SOFTWARE_LICENSE" + } + }, + "OUTDOOR_LICENSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "OUTDOOR_LICENSE" + } + }, + "SECURE_NOTE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SECURE_NOTE" + } + }, + "WIRELESS_ROUTER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "WIRELESS_ROUTER" + } + }, + "BANK_ACCOUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BANK_ACCOUNT" + } + }, + "DRIVER_LICENSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DRIVER_LICENSE" + } + }, + "IDENTITY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IDENTITY" + } + }, + "REWARD_PROGRAM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "REWARD_PROGRAM" + } + }, + "DOCUMENT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DOCUMENT" + } + }, + "EMAIL_ACCOUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EMAIL_ACCOUNT" + } + }, + "SOCIAL_SECURITY_NUMBER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SOCIAL_SECURITY_NUMBER" + } + }, + "MEDICAL_RECORD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MEDICAL_RECORD" + } + }, + "SSH_KEY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SSH_KEY" + } + }, + "CUSTOM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CUSTOM" + } + } + }, + "traits": {} + }, + "com.onepassword.connect#CreateVaultItemResponseUrlsItem": { + "type": "structure", + "members": { + "label": { + "target": "smithy.api#String" + }, + "primary": { + "target": "smithy.api#Boolean" + }, + "href": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": {} + }, + "com.onepassword.connect#CreateVaultItemResponseUrlsList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#CreateVaultItemResponseUrlsItem" + }, + "traits": {} + }, + "com.onepassword.connect#CreateVaultItemResponseTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.onepassword.connect#CreateVaultItemResponseState": { + "type": "enum", + "members": { + "ARCHIVED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ARCHIVED" + } + }, + "DELETED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETED" + } + } + }, + "traits": {} + }, + "com.onepassword.connect#CreateVaultItemResponseSectionsItem": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String" + }, + "label": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.onepassword.connect#CreateVaultItemResponseSectionsList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#CreateVaultItemResponseSectionsItem" + }, + "traits": {} + }, + "com.onepassword.connect#Field": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "section": { + "target": "com.onepassword.connect#FieldSection" + }, + "type": { + "target": "com.onepassword.connect#FieldType", + "traits": { + "smithy.api#required": {} + } + }, + "purpose": { + "target": "com.onepassword.connect#FieldPurpose", + "traits": { + "smithy.api#documentation": "Some item types, Login and Password, have fields used for autofill. This property indicates that purpose and is required for some item types." + } + }, + "label": { + "target": "smithy.api#String" + }, + "value": { + "target": "smithy.api#String" + }, + "generate": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "If value is not present then a new value should be generated for this field" + } + }, + "recipe": { + "target": "com.onepassword.connect#GeneratorRecipe" + }, + "entropy": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "For fields with a purpose of `PASSWORD` this is the entropy of the value" + } + } + }, + "traits": {} + }, + "com.onepassword.connect#FieldSection": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.onepassword.connect#FieldType": { + "type": "enum", + "members": { + "STRING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "STRING" + } + }, + "EMAIL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EMAIL" + } + }, + "CONCEALED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CONCEALED" + } + }, + "URL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "URL" + } + }, + "TOTP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TOTP" + } + }, + "DATE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DATE" + } + }, + "MONTH_YEAR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MONTH_YEAR" + } + }, + "MENU": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MENU" + } + } + }, + "traits": {} + }, + "com.onepassword.connect#FieldPurpose": { + "type": "enum", + "members": { + "VALUE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "" + } + }, + "USERNAME": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "USERNAME" + } + }, + "PASSWORD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PASSWORD" + } + }, + "NOTES": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NOTES" + } + } + }, + "traits": { + "smithy.api#documentation": "Some item types, Login and Password, have fields used for autofill. This property indicates that purpose and is required for some item types." + } + }, + "com.onepassword.connect#CreateVaultItemResponseFieldsList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#Field" + }, + "traits": {} + }, + "com.onepassword.connect#File": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "ID of the file" + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Name of the file" + } + }, + "size": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Size in bytes of the file" + } + }, + "content_path": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Path of the Connect API that can be used to download the contents of this file." + } + }, + "section": { + "target": "com.onepassword.connect#FileSection", + "traits": { + "smithy.api#documentation": "For files that are in a section, this field describes the section." + } + }, + "content": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Base64-encoded contents of the file. Only set if size <= OP_MAX_INLINE_FILE_SIZE_KB kb and `inline_files` is set to `true`." + } + } + }, + "traits": {} + }, + "com.onepassword.connect#FileSection": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "For files that are in a section, this field describes the section." + } + }, + "com.onepassword.connect#CreateVaultItemResponseFilesList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#File" + }, + "traits": {} + }, + "com.onepassword.connect#CreateVaultItemResponse": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String" + }, + "title": { + "target": "smithy.api#String" + }, + "vault": { + "target": "com.onepassword.connect#CreateVaultItemResponseVault", + "traits": { + "smithy.api#required": {} + } + }, + "category": { + "target": "com.onepassword.connect#CreateVaultItemResponseCategory", + "traits": { + "smithy.api#required": {} + } + }, + "urls": { + "target": "com.onepassword.connect#CreateVaultItemResponseUrlsList" + }, + "favorite": { + "target": "smithy.api#Boolean" + }, + "tags": { + "target": "com.onepassword.connect#CreateVaultItemResponseTagsList" + }, + "version": { + "target": "smithy.api#Integer" + }, + "state": { + "target": "com.onepassword.connect#CreateVaultItemResponseState" + }, + "createdAt": { + "target": "smithy.api#String" + }, + "updatedAt": { + "target": "smithy.api#String" + }, + "lastEditedBy": { + "target": "smithy.api#String" + }, + "sections": { + "target": "com.onepassword.connect#CreateVaultItemResponseSectionsList" + }, + "fields": { + "target": "com.onepassword.connect#CreateVaultItemResponseFieldsList" + }, + "files": { + "target": "com.onepassword.connect#CreateVaultItemResponseFilesList" + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.onepassword.connect#CreateVaultItem": { + "type": "operation", + "input": { + "target": "com.onepassword.connect#CreateVaultItemRequest" + }, + "output": { + "target": "com.onepassword.connect#CreateVaultItemResponse" + }, + "errors": [ + { + "target": "com.onepassword.connect#BadRequest" + }, + { + "target": "com.onepassword.connect#Forbidden" + }, + { + "target": "com.onepassword.connect#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "POST", + "uri": "/vaults/{vaultUuid}/items", + "code": 200 + }, + "smithy.api#documentation": "Create a new Item" + } + }, + "com.onepassword.connect#GetVaultItemByIdRequest": { + "type": "structure", + "members": { + "vaultUuid": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The UUID of the Vault to fetch Item from" + } + }, + "itemUuid": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The UUID of the Item to fetch" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.onepassword.connect#GetVaultItemByIdResponseVault": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": {} + }, + "com.onepassword.connect#GetVaultItemByIdResponseCategory": { + "type": "enum", + "members": { + "LOGIN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LOGIN" + } + }, + "PASSWORD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PASSWORD" + } + }, + "API_CREDENTIAL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "API_CREDENTIAL" + } + }, + "SERVER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SERVER" + } + }, + "DATABASE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DATABASE" + } + }, + "CREDIT_CARD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREDIT_CARD" + } + }, + "MEMBERSHIP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MEMBERSHIP" + } + }, + "PASSPORT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PASSPORT" + } + }, + "SOFTWARE_LICENSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SOFTWARE_LICENSE" + } + }, + "OUTDOOR_LICENSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "OUTDOOR_LICENSE" + } + }, + "SECURE_NOTE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SECURE_NOTE" + } + }, + "WIRELESS_ROUTER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "WIRELESS_ROUTER" + } + }, + "BANK_ACCOUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BANK_ACCOUNT" + } + }, + "DRIVER_LICENSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DRIVER_LICENSE" + } + }, + "IDENTITY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IDENTITY" + } + }, + "REWARD_PROGRAM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "REWARD_PROGRAM" + } + }, + "DOCUMENT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DOCUMENT" + } + }, + "EMAIL_ACCOUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EMAIL_ACCOUNT" + } + }, + "SOCIAL_SECURITY_NUMBER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SOCIAL_SECURITY_NUMBER" + } + }, + "MEDICAL_RECORD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MEDICAL_RECORD" + } + }, + "SSH_KEY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SSH_KEY" + } + }, + "CUSTOM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CUSTOM" + } + } + }, + "traits": {} + }, + "com.onepassword.connect#GetVaultItemByIdResponseUrlsItem": { + "type": "structure", + "members": { + "label": { + "target": "smithy.api#String" + }, + "primary": { + "target": "smithy.api#Boolean" + }, + "href": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": {} + }, + "com.onepassword.connect#GetVaultItemByIdResponseUrlsList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#GetVaultItemByIdResponseUrlsItem" + }, + "traits": {} + }, + "com.onepassword.connect#GetVaultItemByIdResponseTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.onepassword.connect#GetVaultItemByIdResponseState": { + "type": "enum", + "members": { + "ARCHIVED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ARCHIVED" + } + }, + "DELETED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETED" + } + } + }, + "traits": {} + }, + "com.onepassword.connect#GetVaultItemByIdResponseSectionsItem": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String" + }, + "label": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.onepassword.connect#GetVaultItemByIdResponseSectionsList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#GetVaultItemByIdResponseSectionsItem" + }, + "traits": {} + }, + "com.onepassword.connect#GetVaultItemByIdResponseFieldsList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#Field" + }, + "traits": {} + }, + "com.onepassword.connect#GetVaultItemByIdResponseFilesList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#File" + }, + "traits": {} + }, + "com.onepassword.connect#GetVaultItemByIdResponse": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String" + }, + "title": { + "target": "smithy.api#String" + }, + "vault": { + "target": "com.onepassword.connect#GetVaultItemByIdResponseVault", + "traits": { + "smithy.api#required": {} + } + }, + "category": { + "target": "com.onepassword.connect#GetVaultItemByIdResponseCategory", + "traits": { + "smithy.api#required": {} + } + }, + "urls": { + "target": "com.onepassword.connect#GetVaultItemByIdResponseUrlsList" + }, + "favorite": { + "target": "smithy.api#Boolean" + }, + "tags": { + "target": "com.onepassword.connect#GetVaultItemByIdResponseTagsList" + }, + "version": { + "target": "smithy.api#Integer" + }, + "state": { + "target": "com.onepassword.connect#GetVaultItemByIdResponseState" + }, + "createdAt": { + "target": "smithy.api#String" + }, + "updatedAt": { + "target": "smithy.api#String" + }, + "lastEditedBy": { + "target": "smithy.api#String" + }, + "sections": { + "target": "com.onepassword.connect#GetVaultItemByIdResponseSectionsList" + }, + "fields": { + "target": "com.onepassword.connect#GetVaultItemByIdResponseFieldsList" + }, + "files": { + "target": "com.onepassword.connect#GetVaultItemByIdResponseFilesList" + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.onepassword.connect#GetVaultItemById": { + "type": "operation", + "input": { + "target": "com.onepassword.connect#GetVaultItemByIdRequest" + }, + "output": { + "target": "com.onepassword.connect#GetVaultItemByIdResponse" + }, + "errors": [ + { + "target": "com.onepassword.connect#Forbidden" + }, + { + "target": "com.onepassword.connect#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/vaults/{vaultUuid}/items/{itemUuid}", + "code": 200 + }, + "smithy.api#documentation": "Get the details of an Item" + } + }, + "com.onepassword.connect#UpdateVaultItemRequestVault": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": {} + }, + "com.onepassword.connect#UpdateVaultItemRequestCategory": { + "type": "enum", + "members": { + "LOGIN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LOGIN" + } + }, + "PASSWORD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PASSWORD" + } + }, + "API_CREDENTIAL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "API_CREDENTIAL" + } + }, + "SERVER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SERVER" + } + }, + "DATABASE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DATABASE" + } + }, + "CREDIT_CARD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREDIT_CARD" + } + }, + "MEMBERSHIP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MEMBERSHIP" + } + }, + "PASSPORT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PASSPORT" + } + }, + "SOFTWARE_LICENSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SOFTWARE_LICENSE" + } + }, + "OUTDOOR_LICENSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "OUTDOOR_LICENSE" + } + }, + "SECURE_NOTE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SECURE_NOTE" + } + }, + "WIRELESS_ROUTER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "WIRELESS_ROUTER" + } + }, + "BANK_ACCOUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BANK_ACCOUNT" + } + }, + "DRIVER_LICENSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DRIVER_LICENSE" + } + }, + "IDENTITY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IDENTITY" + } + }, + "REWARD_PROGRAM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "REWARD_PROGRAM" + } + }, + "DOCUMENT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DOCUMENT" + } + }, + "EMAIL_ACCOUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EMAIL_ACCOUNT" + } + }, + "SOCIAL_SECURITY_NUMBER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SOCIAL_SECURITY_NUMBER" + } + }, + "MEDICAL_RECORD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MEDICAL_RECORD" + } + }, + "SSH_KEY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SSH_KEY" + } + }, + "CUSTOM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CUSTOM" + } + } + }, + "traits": {} + }, + "com.onepassword.connect#UpdateVaultItemRequestUrlsItem": { + "type": "structure", + "members": { + "label": { + "target": "smithy.api#String" + }, + "primary": { + "target": "smithy.api#Boolean" + }, + "href": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": {} + }, + "com.onepassword.connect#UpdateVaultItemRequestUrlsList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#UpdateVaultItemRequestUrlsItem" + }, + "traits": {} + }, + "com.onepassword.connect#UpdateVaultItemRequestTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.onepassword.connect#UpdateVaultItemRequestSectionsItem": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String" + }, + "label": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.onepassword.connect#UpdateVaultItemRequestSectionsList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#UpdateVaultItemRequestSectionsItem" + }, + "traits": {} + }, + "com.onepassword.connect#UpdateVaultItemRequestFieldsList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#FieldInput" + }, + "traits": {} + }, + "com.onepassword.connect#UpdateVaultItemRequestFilesList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#FileInput" + }, + "traits": {} + }, + "com.onepassword.connect#UpdateVaultItemRequest": { + "type": "structure", + "members": { + "vaultUuid": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The UUID of the Item's Vault" + } + }, + "itemUuid": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The UUID of the Item to update" + } + }, + "id": { + "target": "smithy.api#String" + }, + "title": { + "target": "smithy.api#String" + }, + "vault": { + "target": "com.onepassword.connect#UpdateVaultItemRequestVault", + "traits": { + "smithy.api#required": {} + } + }, + "category": { + "target": "com.onepassword.connect#UpdateVaultItemRequestCategory", + "traits": { + "smithy.api#required": {} + } + }, + "urls": { + "target": "com.onepassword.connect#UpdateVaultItemRequestUrlsList" + }, + "favorite": { + "target": "smithy.api#Boolean" + }, + "tags": { + "target": "com.onepassword.connect#UpdateVaultItemRequestTagsList" + }, + "version": { + "target": "smithy.api#Integer" + }, + "sections": { + "target": "com.onepassword.connect#UpdateVaultItemRequestSectionsList" + }, + "fields": { + "target": "com.onepassword.connect#UpdateVaultItemRequestFieldsList" + }, + "files": { + "target": "com.onepassword.connect#UpdateVaultItemRequestFilesList" + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.onepassword.connect#UpdateVaultItemResponseVault": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": {} + }, + "com.onepassword.connect#UpdateVaultItemResponseCategory": { + "type": "enum", + "members": { + "LOGIN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LOGIN" + } + }, + "PASSWORD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PASSWORD" + } + }, + "API_CREDENTIAL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "API_CREDENTIAL" + } + }, + "SERVER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SERVER" + } + }, + "DATABASE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DATABASE" + } + }, + "CREDIT_CARD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREDIT_CARD" + } + }, + "MEMBERSHIP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MEMBERSHIP" + } + }, + "PASSPORT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PASSPORT" + } + }, + "SOFTWARE_LICENSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SOFTWARE_LICENSE" + } + }, + "OUTDOOR_LICENSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "OUTDOOR_LICENSE" + } + }, + "SECURE_NOTE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SECURE_NOTE" + } + }, + "WIRELESS_ROUTER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "WIRELESS_ROUTER" + } + }, + "BANK_ACCOUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BANK_ACCOUNT" + } + }, + "DRIVER_LICENSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DRIVER_LICENSE" + } + }, + "IDENTITY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IDENTITY" + } + }, + "REWARD_PROGRAM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "REWARD_PROGRAM" + } + }, + "DOCUMENT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DOCUMENT" + } + }, + "EMAIL_ACCOUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EMAIL_ACCOUNT" + } + }, + "SOCIAL_SECURITY_NUMBER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SOCIAL_SECURITY_NUMBER" + } + }, + "MEDICAL_RECORD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MEDICAL_RECORD" + } + }, + "SSH_KEY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SSH_KEY" + } + }, + "CUSTOM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CUSTOM" + } + } + }, + "traits": {} + }, + "com.onepassword.connect#UpdateVaultItemResponseUrlsItem": { + "type": "structure", + "members": { + "label": { + "target": "smithy.api#String" + }, + "primary": { + "target": "smithy.api#Boolean" + }, + "href": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": {} + }, + "com.onepassword.connect#UpdateVaultItemResponseUrlsList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#UpdateVaultItemResponseUrlsItem" + }, + "traits": {} + }, + "com.onepassword.connect#UpdateVaultItemResponseTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.onepassword.connect#UpdateVaultItemResponseState": { + "type": "enum", + "members": { + "ARCHIVED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ARCHIVED" + } + }, + "DELETED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETED" + } + } + }, + "traits": {} + }, + "com.onepassword.connect#UpdateVaultItemResponseSectionsItem": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String" + }, + "label": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.onepassword.connect#UpdateVaultItemResponseSectionsList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#UpdateVaultItemResponseSectionsItem" + }, + "traits": {} + }, + "com.onepassword.connect#UpdateVaultItemResponseFieldsList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#Field" + }, + "traits": {} + }, + "com.onepassword.connect#UpdateVaultItemResponseFilesList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#File" + }, + "traits": {} + }, + "com.onepassword.connect#UpdateVaultItemResponse": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String" + }, + "title": { + "target": "smithy.api#String" + }, + "vault": { + "target": "com.onepassword.connect#UpdateVaultItemResponseVault", + "traits": { + "smithy.api#required": {} + } + }, + "category": { + "target": "com.onepassword.connect#UpdateVaultItemResponseCategory", + "traits": { + "smithy.api#required": {} + } + }, + "urls": { + "target": "com.onepassword.connect#UpdateVaultItemResponseUrlsList" + }, + "favorite": { + "target": "smithy.api#Boolean" + }, + "tags": { + "target": "com.onepassword.connect#UpdateVaultItemResponseTagsList" + }, + "version": { + "target": "smithy.api#Integer" + }, + "state": { + "target": "com.onepassword.connect#UpdateVaultItemResponseState" + }, + "createdAt": { + "target": "smithy.api#String" + }, + "updatedAt": { + "target": "smithy.api#String" + }, + "lastEditedBy": { + "target": "smithy.api#String" + }, + "sections": { + "target": "com.onepassword.connect#UpdateVaultItemResponseSectionsList" + }, + "fields": { + "target": "com.onepassword.connect#UpdateVaultItemResponseFieldsList" + }, + "files": { + "target": "com.onepassword.connect#UpdateVaultItemResponseFilesList" + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.onepassword.connect#UpdateVaultItem": { + "type": "operation", + "input": { + "target": "com.onepassword.connect#UpdateVaultItemRequest" + }, + "output": { + "target": "com.onepassword.connect#UpdateVaultItemResponse" + }, + "errors": [ + { + "target": "com.onepassword.connect#BadRequest" + }, + { + "target": "com.onepassword.connect#Forbidden" + }, + { + "target": "com.onepassword.connect#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "PUT", + "uri": "/vaults/{vaultUuid}/items/{itemUuid}", + "code": 200 + }, + "smithy.api#documentation": "Update an Item" + } + }, + "com.onepassword.connect#Patch": { + "type": "list", + "member": { + "target": "com.onepassword.connect#PatchItem" + }, + "traits": {} + }, + "com.onepassword.connect#PatchItemOp": { + "type": "enum", + "members": { + "ADD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "add" + } + }, + "REMOVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "remove" + } + }, + "REPLACE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "replace" + } + } + }, + "traits": {} + }, + "com.onepassword.connect#PatchItem": { + "type": "structure", + "members": { + "op": { + "target": "com.onepassword.connect#PatchItemOp", + "traits": { + "smithy.api#required": {} + } + }, + "path": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "An RFC6901 JSON Pointer pointing to the Item document, an Item Attribute, and Item Field by Field ID, or an Item Field Attribute", + "smithy.api#required": {} + } + }, + "value": { + "target": "smithy.api#Document" + } + }, + "traits": {} + }, + "com.onepassword.connect#PatchVaultItemRequest": { + "type": "structure", + "members": { + "vaultUuid": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The UUID of the Vault the item is in" + } + }, + "itemUuid": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The UUID of the Item to update" + } + }, + "body": { + "target": "com.onepassword.connect#Patch", + "traits": { + "smithy.api#httpPayload": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.onepassword.connect#PatchVaultItemResponseVault": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": {} + }, + "com.onepassword.connect#PatchVaultItemResponseCategory": { + "type": "enum", + "members": { + "LOGIN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LOGIN" + } + }, + "PASSWORD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PASSWORD" + } + }, + "API_CREDENTIAL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "API_CREDENTIAL" + } + }, + "SERVER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SERVER" + } + }, + "DATABASE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DATABASE" + } + }, + "CREDIT_CARD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREDIT_CARD" + } + }, + "MEMBERSHIP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MEMBERSHIP" + } + }, + "PASSPORT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PASSPORT" + } + }, + "SOFTWARE_LICENSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SOFTWARE_LICENSE" + } + }, + "OUTDOOR_LICENSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "OUTDOOR_LICENSE" + } + }, + "SECURE_NOTE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SECURE_NOTE" + } + }, + "WIRELESS_ROUTER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "WIRELESS_ROUTER" + } + }, + "BANK_ACCOUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BANK_ACCOUNT" + } + }, + "DRIVER_LICENSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DRIVER_LICENSE" + } + }, + "IDENTITY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IDENTITY" + } + }, + "REWARD_PROGRAM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "REWARD_PROGRAM" + } + }, + "DOCUMENT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DOCUMENT" + } + }, + "EMAIL_ACCOUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EMAIL_ACCOUNT" + } + }, + "SOCIAL_SECURITY_NUMBER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SOCIAL_SECURITY_NUMBER" + } + }, + "MEDICAL_RECORD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MEDICAL_RECORD" + } + }, + "SSH_KEY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SSH_KEY" + } + }, + "CUSTOM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CUSTOM" + } + } + }, + "traits": {} + }, + "com.onepassword.connect#PatchVaultItemResponseUrlsItem": { + "type": "structure", + "members": { + "label": { + "target": "smithy.api#String" + }, + "primary": { + "target": "smithy.api#Boolean" + }, + "href": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": {} + }, + "com.onepassword.connect#PatchVaultItemResponseUrlsList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#PatchVaultItemResponseUrlsItem" + }, + "traits": {} + }, + "com.onepassword.connect#PatchVaultItemResponseTagsList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": {} + }, + "com.onepassword.connect#PatchVaultItemResponseState": { + "type": "enum", + "members": { + "ARCHIVED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ARCHIVED" + } + }, + "DELETED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETED" + } + } + }, + "traits": {} + }, + "com.onepassword.connect#PatchVaultItemResponseSectionsItem": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String" + }, + "label": { + "target": "smithy.api#String" + } + }, + "traits": {} + }, + "com.onepassword.connect#PatchVaultItemResponseSectionsList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#PatchVaultItemResponseSectionsItem" + }, + "traits": {} + }, + "com.onepassword.connect#PatchVaultItemResponseFieldsList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#Field" + }, + "traits": {} + }, + "com.onepassword.connect#PatchVaultItemResponseFilesList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#File" + }, + "traits": {} + }, + "com.onepassword.connect#PatchVaultItemResponse": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String" + }, + "title": { + "target": "smithy.api#String" + }, + "vault": { + "target": "com.onepassword.connect#PatchVaultItemResponseVault", + "traits": { + "smithy.api#required": {} + } + }, + "category": { + "target": "com.onepassword.connect#PatchVaultItemResponseCategory", + "traits": { + "smithy.api#required": {} + } + }, + "urls": { + "target": "com.onepassword.connect#PatchVaultItemResponseUrlsList" + }, + "favorite": { + "target": "smithy.api#Boolean" + }, + "tags": { + "target": "com.onepassword.connect#PatchVaultItemResponseTagsList" + }, + "version": { + "target": "smithy.api#Integer" + }, + "state": { + "target": "com.onepassword.connect#PatchVaultItemResponseState" + }, + "createdAt": { + "target": "smithy.api#String" + }, + "updatedAt": { + "target": "smithy.api#String" + }, + "lastEditedBy": { + "target": "smithy.api#String" + }, + "sections": { + "target": "com.onepassword.connect#PatchVaultItemResponseSectionsList" + }, + "fields": { + "target": "com.onepassword.connect#PatchVaultItemResponseFieldsList" + }, + "files": { + "target": "com.onepassword.connect#PatchVaultItemResponseFilesList" + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.onepassword.connect#PatchVaultItem": { + "type": "operation", + "input": { + "target": "com.onepassword.connect#PatchVaultItemRequest" + }, + "output": { + "target": "com.onepassword.connect#PatchVaultItemResponse" + }, + "errors": [ + { + "target": "com.onepassword.connect#Forbidden" + }, + { + "target": "com.onepassword.connect#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "PATCH", + "uri": "/vaults/{vaultUuid}/items/{itemUuid}", + "code": 200 + }, + "smithy.api#documentation": "Update a subset of Item attributes\n\nApplies a modified [RFC6902 JSON Patch](https://tools.ietf.org/html/rfc6902) document to an Item or ItemField. This endpoint only supports `add`, `remove` and `replace` operations.\n\nWhen modifying a specific ItemField, the ItemField's ID in the `path` attribute of the operation object: `/fields/{fieldId}`" + } + }, + "com.onepassword.connect#DeleteVaultItemRequest": { + "type": "structure", + "members": { + "vaultUuid": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The UUID of the Vault the item is in" + } + }, + "itemUuid": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The UUID of the Item to update" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.onepassword.connect#DeleteVaultItem": { + "type": "operation", + "input": { + "target": "com.onepassword.connect#DeleteVaultItemRequest" + }, + "output": { + "target": "smithy.api#Unit" + }, + "errors": [ + { + "target": "com.onepassword.connect#Forbidden" + }, + { + "target": "com.onepassword.connect#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "DELETE", + "uri": "/vaults/{vaultUuid}/items/{itemUuid}", + "code": 200 + }, + "smithy.api#documentation": "Delete an Item" + } + }, + "com.onepassword.connect#GetItemFilesRequest": { + "type": "structure", + "members": { + "vaultUuid": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The UUID of the Vault to fetch Items from" + } + }, + "itemUuid": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The UUID of the Item to fetch files from" + } + }, + "inline_files": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#httpQuery": "inline_files", + "smithy.api#documentation": "Tells server to return the base64-encoded file contents in the response." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.onepassword.connect#GetItemFilesResponseBodyList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#File" + }, + "traits": {} + }, + "com.onepassword.connect#GetItemFilesResponse": { + "type": "structure", + "members": { + "body": { + "target": "com.onepassword.connect#GetItemFilesResponseBodyList", + "traits": { + "com.distilled.openapi#rawResponse": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.onepassword.connect#GetItemFiles": { + "type": "operation", + "input": { + "target": "com.onepassword.connect#GetItemFilesRequest" + }, + "output": { + "target": "com.onepassword.connect#GetItemFilesResponse" + }, + "errors": [ + { + "target": "com.onepassword.connect#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/vaults/{vaultUuid}/items/{itemUuid}/files", + "code": 200 + }, + "smithy.api#documentation": "Get all the files inside an Item" + } + }, + "com.onepassword.connect#GetDetailsOfFileByIdRequest": { + "type": "structure", + "members": { + "vaultUuid": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The UUID of the Vault to fetch Item from" + } + }, + "itemUuid": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The UUID of the Item to fetch File from" + } + }, + "fileUuid": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The UUID of the File to fetch" + } + }, + "inline_files": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#httpQuery": "inline_files", + "smithy.api#documentation": "Tells server to return the base64-encoded file contents in the response." + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.onepassword.connect#GetDetailsOfFileById": { + "type": "operation", + "input": { + "target": "com.onepassword.connect#GetDetailsOfFileByIdRequest" + }, + "output": { + "target": "com.onepassword.connect#File" + }, + "errors": [ + { + "target": "com.onepassword.connect#Forbidden" + }, + { + "target": "com.onepassword.connect#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/vaults/{vaultUuid}/items/{itemUuid}/files/{fileUuid}", + "code": 200 + }, + "smithy.api#documentation": "Get the details of a File" + } + }, + "com.onepassword.connect#DownloadFileByIDRequest": { + "type": "structure", + "members": { + "vaultUuid": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The UUID of the Vault the item is in" + } + }, + "itemUuid": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "The UUID of the Item the File is in" + } + }, + "fileUuid": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {}, + "smithy.api#documentation": "UUID of the file to get content from" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.onepassword.connect#DownloadFileByID": { + "type": "operation", + "input": { + "target": "com.onepassword.connect#DownloadFileByIDRequest" + }, + "output": { + "target": "smithy.api#Unit" + }, + "errors": [ + { + "target": "com.onepassword.connect#NotFound" + } + ], + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/vaults/{vaultUuid}/items/{itemUuid}/files/{fileUuid}/content", + "code": 200 + }, + "smithy.api#documentation": "Get the content of a File" + } + }, + "com.onepassword.connect#GetHeartbeat": { + "type": "operation", + "input": { + "target": "smithy.api#Unit" + }, + "output": { + "target": "smithy.api#Unit" + }, + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/heartbeat", + "code": 200 + }, + "smithy.api#documentation": "Ping the server for liveness" + } + }, + "com.onepassword.connect#ServiceDependency": { + "type": "structure", + "members": { + "service": { + "target": "smithy.api#String" + }, + "status": { + "target": "smithy.api#String" + }, + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Human-readable message for explaining the current state." + } + } + }, + "traits": { + "smithy.api#documentation": "The state of a registered server dependency." + } + }, + "com.onepassword.connect#GetServerHealthResponseDependenciesList": { + "type": "list", + "member": { + "target": "com.onepassword.connect#ServiceDependency" + }, + "traits": {} + }, + "com.onepassword.connect#GetServerHealthResponse": { + "type": "structure", + "members": { + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + }, + "version": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The Connect server's version", + "smithy.api#required": {} + } + }, + "dependencies": { + "target": "com.onepassword.connect#GetServerHealthResponseDependenciesList" + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.onepassword.connect#GetServerHealth": { + "type": "operation", + "input": { + "target": "smithy.api#Unit" + }, + "output": { + "target": "com.onepassword.connect#GetServerHealthResponse" + }, + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/health", + "code": 200 + }, + "smithy.api#documentation": "Get state of the server and its dependencies." + } + }, + "com.onepassword.connect#GetPrometheusMetrics": { + "type": "operation", + "input": { + "target": "smithy.api#Unit" + }, + "output": { + "target": "smithy.api#Unit" + }, + "traits": { + "smithy.api#http": { + "method": "GET", + "uri": "/metrics", + "code": 200 + }, + "smithy.api#documentation": "Query server for exposed Prometheus metrics\n\nSee Prometheus documentation for a complete data model." + } + }, + "com.onepassword.connect#Forbidden": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#error": "client", + "smithy.api#httpError": 403, + "com.distilled.openapi#errorMatchers": [ + { + "status": 403 + } + ] + } + }, + "com.onepassword.connect#NotFound": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#error": "client", + "smithy.api#httpError": 404, + "com.distilled.openapi#errorMatchers": [ + { + "status": 404 + } + ] + } + }, + "com.onepassword.connect#BadRequest": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#error": "client", + "smithy.api#httpError": 400, + "com.distilled.openapi#errorMatchers": [ + { + "status": 400 + } + ] + } + }, + "com.onepassword.connect#Onepassword": { + "type": "service", + "version": "1.7.1", + "operations": [ + { + "target": "com.onepassword.connect#GetApiActivity" + }, + { + "target": "com.onepassword.connect#GetVaults" + }, + { + "target": "com.onepassword.connect#GetVaultById" + }, + { + "target": "com.onepassword.connect#GetVaultItems" + }, + { + "target": "com.onepassword.connect#CreateVaultItem" + }, + { + "target": "com.onepassword.connect#GetVaultItemById" + }, + { + "target": "com.onepassword.connect#UpdateVaultItem" + }, + { + "target": "com.onepassword.connect#PatchVaultItem" + }, + { + "target": "com.onepassword.connect#DeleteVaultItem" + }, + { + "target": "com.onepassword.connect#GetItemFiles" + }, + { + "target": "com.onepassword.connect#GetDetailsOfFileById" + }, + { + "target": "com.onepassword.connect#DownloadFileByID" + }, + { + "target": "com.onepassword.connect#GetHeartbeat" + }, + { + "target": "com.onepassword.connect#GetServerHealth" + }, + { + "target": "com.onepassword.connect#GetPrometheusMetrics" + } + ], + "traits": { + "smithy.api#title": "1Password Connect", + "smithy.api#documentation": "REST API interface for 1Password Connect." + } + } + } +} diff --git a/packages/onepassword/package.json b/packages/onepassword/package.json new file mode 100644 index 0000000000..92f8d79b95 --- /dev/null +++ b/packages/onepassword/package.json @@ -0,0 +1,85 @@ +{ + "name": "@distilled.cloud/onepassword", + "version": "1.0.0-rc.8", + "repository": { + "type": "git", + "url": "https://github.com/alchemy-run/distilled", + "directory": "packages/onepassword" + }, + "license": "Apache-2.0", + "type": "module", + "sideEffects": false, + "files": [ + "lib", + "src" + ], + "exports": { + ".": { + "types": "./lib/index.d.ts", + "bun": "./src/index.ts", + "worker": "./src/index.ts", + "default": "./lib/index.js" + }, + "./Credentials": { + "types": "./lib/credentials.d.ts", + "bun": "./src/credentials.ts", + "worker": "./src/credentials.ts", + "default": "./lib/credentials.js" + }, + "./Errors": { + "types": "./lib/errors.d.ts", + "bun": "./src/errors.ts", + "worker": "./src/errors.ts", + "default": "./lib/errors.js" + }, + "./Traits": { + "types": "./lib/traits.d.ts", + "bun": "./src/traits.ts", + "worker": "./src/traits.ts", + "default": "./lib/traits.js" + }, + "./Pagination": { + "types": "./lib/pagination.d.ts", + "bun": "./src/pagination.ts", + "worker": "./src/pagination.ts", + "default": "./lib/pagination.js" + }, + "./Protocol": { + "types": "./lib/protocol.d.ts", + "bun": "./src/protocol.ts", + "worker": "./src/protocol.ts", + "default": "./lib/protocol.js" + }, + "./Retry": { + "types": "./lib/retry.d.ts", + "bun": "./src/retry.ts", + "worker": "./src/retry.ts", + "default": "./lib/retry.js" + }, + "./*": { + "types": "./lib/services/*.d.ts", + "bun": "./src/services/*.ts", + "worker": "./src/services/*.ts", + "default": "./lib/services/*.js" + } + }, + "scripts": { + "build": "tsc -b", + "convert": "bun scripts/convert.ts", + "generate": "bun scripts/convert.ts && bun scripts/generate.ts", + "typecheck": "tsc -p tsconfig.json", + "specs:fetch": "git submodule update --force --init --depth=1 specs/spec-mirror-onepassword", + "specs:update": "git submodule update --remote --force --depth=1 specs/spec-mirror-onepassword" + }, + "dependencies": { + "@distilled.cloud/core": "workspace:*" + }, + "devDependencies": { + "@types/bun": "catalog:tooling", + "@types/node": "catalog:tooling", + "@effect/platform-bun": "catalog:effect" + }, + "peerDependencies": { + "effect": "catalog:effect" + } +} diff --git a/packages/onepassword/scripts/convert.ts b/packages/onepassword/scripts/convert.ts new file mode 100644 index 0000000000..50385b1187 --- /dev/null +++ b/packages/onepassword/scripts/convert.ts @@ -0,0 +1,33 @@ +#!/usr/bin/env bun +/** + * convert — turn the 1Password Connect OpenAPI spec into a Smithy 2.0 JSON + * model. + * + * Input: specs/spec-mirror-onepassword/specs/openapi.json (spec submodule) + * patches/*.patch.json (RFC-6902 patches to the OpenAPI document) + * Output: .generated-specs/onepassword.json + * + * The OpenAPI→Smithy converter lives in + * `@distilled.cloud/core/codegen/openapi`; this script is 1Password's + * pipeline config. `scripts/generate.ts` compiles the model into src/services. + */ +import * as path from "node:path"; +import { runOpenApiConvert } from "@distilled.cloud/core/codegen/openapi-cli"; + +await runOpenApiConvert({ + root: path.resolve(import.meta.dir, ".."), + specs: [ + { + name: "onepassword", + specPath: "specs/spec-mirror-onepassword/specs/openapi.json", + }, + ], + // OpenAPI-document patches (flat patches/*.patch.json). The smithy-model + // patch chain in generate.ts is disabled (`patchesDir: false`). + patchesDir: "patches", + options: { + namespace: "com.onepassword.connect", + serviceName: "Onepassword", + skipDeprecated: true, + }, +}); diff --git a/packages/onepassword/scripts/generate.ts b/packages/onepassword/scripts/generate.ts new file mode 100644 index 0000000000..c48a7b4680 --- /dev/null +++ b/packages/onepassword/scripts/generate.ts @@ -0,0 +1,93 @@ +#!/usr/bin/env bun +/** + * generate — turn the Smithy JSON model in .generated-specs into the + * 1Password Connect Effect SDK. + * + * Input: .generated-specs/onepassword.json (written by scripts/convert.ts) + * Output: src/services/onepassword.ts + src/services/index.ts + * + * The smithy→SDK compiler and CLI pipeline live in + * `@distilled.cloud/core/codegen`; this script is 1Password's provider spec. + * Connect keeps the wire's camelCase member names on the TS surface, so no + * member renaming or wire dictionaries appear here. + */ +import type { SdkSpec } from "@distilled.cloud/core/codegen/generator"; +import { runGeneratorCli } from "@distilled.cloud/core/codegen/cli"; + +const NULLABLE_TRAIT = "com.distilled.openapi#nullable"; +const ERROR_MATCHERS_TRAIT = "com.distilled.openapi#errorMatchers"; +const RAW_RESPONSE_TRAIT = "com.distilled.openapi#rawResponse"; +const SENSITIVE_TRAIT = "smithy.api#sensitive"; + +/** 1Password's provider spec for the shared smithy→SDK compiler. */ +const onepasswordSpec: SdkSpec = { + nullableTrait: NULLABLE_TRAIT, + errorMatchersTrait: ERROR_MATCHERS_TRAIT, + + extraBindings: [ + { + // Sole member of a synthesized wrapper for bare array/scalar response + // bodies; as the response's only member, the response IS the payload. + trait: RAW_RESPONSE_TRAIT, + binding: "rawResponse", + pipe: "T.RawResponse()", + rootPipe: "T.RawResponseRoot()", + }, + ], + + // Sensitive strings (item field values, tokens): the schema member carries + // T.SensitiveValue; the REST protocol delivers Redacted values and accepts + // string | Redacted on input. + memberTraitPipes: { + [SENSITIVE_TRAIT]: "T.SensitiveValue", + }, + memberTsType: (m) => + SENSITIVE_TRAIT in m.traits + ? `string | Redacted.Redacted${m.nullable ? " | null" : ""}` + : undefined, + + // Unions surface as TS type unions over an opaque schema — the REST + // protocol passes union content through verbatim (wire names ARE the TS + // names for Connect), so no runtime case discrimination is needed. + union: ({ name, caseTargets, tsRef }) => [ + `export type ${name} = ${caseTargets.map(tsRef).join(" | ") || "unknown"};`, + `export const ${name} = /*@__PURE__*/ S.Unknown as any as S.Schema<${name}>;\n`, + ], + + // One pagination profile: cursor mode, traversed by core's paginateCursor. + paginationProfiles: { + cursor: { + strategy: "paginateCursor", + itemsFallback: "items", + }, + }, + + operationDecl: { + contextType: "OnepasswordOpContext", + commonErrorType: "OnepasswordOpError", + commonErrorClasses: ["UnknownOnepasswordError"], + protocol: "OnepasswordProtocol", + retry: "Retry.Retry", + }, + + sourceNote: ".generated-specs (specs/spec-mirror-onepassword)", + + // Sensitive member types reference Redacted; pull the import in when used. + postProcess: (code) => + code.includes("Redacted.Redacted<") + ? code.replace( + `import * as S from "@distilled.cloud/core/schema";\n`, + `import * as S from "@distilled.cloud/core/schema";\nimport * as Redacted from "effect/Redacted";\n`, + ) + : code, +}; + +runGeneratorCli({ + description: + "Generate the 1Password Connect Effect SDK from the Smithy model", + root: `${import.meta.dir}/..`, + // patches/ holds OpenAPI-document patches consumed by scripts/convert.ts; + // there is no smithy-model patch chain. + patchesDir: false, + spec: () => onepasswordSpec, +}); diff --git a/packages/onepassword/src/credentials.ts b/packages/onepassword/src/credentials.ts new file mode 100644 index 0000000000..0a319c9f96 --- /dev/null +++ b/packages/onepassword/src/credentials.ts @@ -0,0 +1,74 @@ +/** + * 1Password Connect credentials — hand-written. + * + * The `Credentials` service holds an *effect* that resolves the current + * credentials on every request (the protocol layer resolves it per request + * on the calling fiber). Auth is a Connect access token sent as + * `Authorization: Bearer `. Self-hosted Connect servers override the + * default base URL (`http://localhost:8080/v1`). + */ +import * as Context from "effect/Context"; +import * as Effect from "effect/Effect"; +import * as Layer from "effect/Layer"; +import * as Redacted from "effect/Redacted"; +import { ConfigError } from "@distilled.cloud/core/errors"; + +export const DEFAULT_API_BASE_URL = "http://localhost:8080/v1"; + +export interface Config { + readonly apiKey: Redacted.Redacted; + readonly apiBaseUrl: string; +} + +export class Credentials extends Context.Service< + Credentials, + Effect.Effect +>()("OnepasswordCredentials") {} + +/** Layer from a Connect token + optional base URL. */ +export const fromApiKey = (config: { + readonly apiKey: string; + readonly apiBaseUrl?: string; +}): Layer.Layer => + Layer.succeed( + Credentials, + Effect.succeed({ + apiKey: Redacted.make(config.apiKey), + apiBaseUrl: config.apiBaseUrl ?? DEFAULT_API_BASE_URL, + }), + ); + +const connectHostToBaseUrl = (host: string): string => { + const trimmed = host.replace(/\/+$/, ""); + return /\/v1$/i.test(trimmed) ? trimmed : `${trimmed}/v1`; +}; + +/** + * Reads OP_CONNECT_TOKEN (required) and OP_CONNECT_API_BASE_URL or + * OP_CONNECT_HOST (optional). `OP_CONNECT_HOST` is the official Connect + * host (no `/v1` suffix); `/v1` is appended when missing. + */ +export const CredentialsFromEnv: Layer.Layer = Layer.succeed( + Credentials, + Effect.gen(function* () { + const apiKey = process.env.OP_CONNECT_TOKEN; + + if (!apiKey) { + return yield* new ConfigError({ + message: "OP_CONNECT_TOKEN environment variable is required", + }); + } + + const explicitBase = process.env.OP_CONNECT_API_BASE_URL; + const host = process.env.OP_CONNECT_HOST; + + return { + apiKey: Redacted.make(apiKey), + apiBaseUrl: + explicitBase ?? + (host !== undefined + ? connectHostToBaseUrl(host) + : DEFAULT_API_BASE_URL), + }; + }).pipe(Effect.orDie), +); diff --git a/packages/onepassword/src/errors.ts b/packages/onepassword/src/errors.ts new file mode 100644 index 0000000000..5a1b35e5bc --- /dev/null +++ b/packages/onepassword/src/errors.ts @@ -0,0 +1,50 @@ +/** + * 1Password Connect-specific error types. + * + * Re-exports the common HTTP errors from core and adds the 1Password + * fallback errors. Note the generated service module additionally defines + * its own per-status matcher classes (BadRequest/NotFound/…) for the + * statuses each operation declares — those share `_tag`s with the core + * classes here, so `catchTag` works against either. + */ +export { + BadGateway, + BadRequest, + Conflict, + ConfigError, + Forbidden, + GatewayTimeout, + InternalServerError, + Locked, + NotFound, + ServiceUnavailable, + TooManyRequests, + Unauthorized, + UnprocessableEntity, + HTTP_STATUS_MAP, + DEFAULT_ERRORS, + API_ERRORS, +} from "@distilled.cloud/core/errors"; +export type { DefaultErrors } from "@distilled.cloud/core/errors"; + +import * as Schema from "effect/Schema"; +import * as Category from "@distilled.cloud/core/category"; + +/** Unknown 1Password error — returned when nothing else matches the failure. */ +export class UnknownOnepasswordError extends Schema.TaggedError()( + "UnknownOnepasswordError", + { + code: Schema.optional(Schema.String), + message: Schema.optional(Schema.String), + body: Schema.Unknown, + }, +).pipe(Category.withServerError) {} + +/** Schema parse error wrapper. */ +export class OnepasswordParseError extends Schema.TaggedError()( + "OnepasswordParseError", + { + body: Schema.Unknown, + cause: Schema.Unknown, + }, +).pipe(Category.withParseError) {} diff --git a/packages/onepassword/src/index.ts b/packages/onepassword/src/index.ts new file mode 100644 index 0000000000..fba0813248 --- /dev/null +++ b/packages/onepassword/src/index.ts @@ -0,0 +1,31 @@ +/** + * @distilled.cloud/onepassword — 1Password Connect SDK for Effect. + * + * `./services` is generated by `scripts/generate.ts` from the Smithy model + * in `.generated-specs` (written by `scripts/convert.ts` from the OpenAPI + * spec). Everything else in this folder is hand-written. + * + * @example + * ```ts + * import * as Onepassword from "@distilled.cloud/onepassword"; + * + * const vaults = yield* Onepassword.Services.onepassword.getVaults({}); + * ``` + */ +export * from "./credentials.ts"; +export * from "./errors.ts"; +export * as T from "./traits.ts"; +export { + OnepasswordProtocol, + type OnepasswordOpError, + type OnepasswordOpContext, +} from "./protocol.ts"; +export { paginateCursor } from "./pagination.ts"; +export * as Retry from "./retry.ts"; +export * as Services from "./services/index.ts"; +// Operations (and their request/response types) are importable straight off +// the package root. The service-local typed error classes shadow the +// same-named shared ones from ./errors.ts — the ops actually raise the +// service-local classes. +export * from "./services/onepassword.ts"; +export { BadRequest, Forbidden, NotFound } from "./services/onepassword.ts"; diff --git a/packages/onepassword/src/pagination.ts b/packages/onepassword/src/pagination.ts new file mode 100644 index 0000000000..94194ed897 --- /dev/null +++ b/packages/onepassword/src/pagination.ts @@ -0,0 +1,7 @@ +/** + * 1Password Connect pagination — hand-written. + * + * Generated operations that carry a cursor-mode `smithy.api#paginated` + * trait pass core's {@link paginateCursor} strategy to `API.makePaginated`. + */ +export { paginateCursor } from "@distilled.cloud/core/pagination"; diff --git a/packages/onepassword/src/protocol.ts b/packages/onepassword/src/protocol.ts new file mode 100644 index 0000000000..715094c396 --- /dev/null +++ b/packages/onepassword/src/protocol.ts @@ -0,0 +1,68 @@ +/** + * OnepasswordProtocol — hand-written. + * + * 1Password Connect speaks plain bearer-authenticated JSON REST (no + * response envelope), so the whole protocol is one `makeRestProtocol` call + * from `core/protocol-rest`: + * + * request: credentials → `Authorization: Bearer ` + base URL + * (default http://localhost:8080/v1), resolved from the + * calling fiber on every request + * + * response: 2xx JSON is the payload (sensitive members delivered as + * `Redacted`); non-2xx `{ status?, message }` bodies map to the + * operation's typed error classes by status, then the shared + * HTTP-status classes, then {@link UnknownOnepasswordError}. + */ +import * as Effect from "effect/Effect"; +import type * as Layer from "effect/Layer"; +import * as Redacted from "effect/Redacted"; +import type * as HttpClient from "effect/unstable/http/HttpClient"; +import type * as HttpClientError from "effect/unstable/http/HttpClientError"; +import type * as API from "@distilled.cloud/core/api"; +import { makeRestProtocol } from "@distilled.cloud/core/protocol-rest"; +import type { API_ERRORS, ConfigError } from "@distilled.cloud/core/errors"; +import { Credentials, type Config } from "./credentials.ts"; +import { UnknownOnepasswordError } from "./errors.ts"; + +/** + * Error channel shared by every generated 1Password operation. Generated + * service files annotate operations with `API.OperationMethod` explicitly so the compiler + * never infers these back out of the schema generics. + */ +export type OnepasswordOpError = + | InstanceType<(typeof API_ERRORS)[number]> + | UnknownOnepasswordError + | ConfigError + | HttpClientError.HttpClientError; + +/** Context (requirements) shared by every generated 1Password operation. */ +export type OnepasswordOpContext = Credentials | HttpClient.HttpClient; + +export const OnepasswordProtocol: Layer.Layer = + makeRestProtocol({ + // The Credentials service holds an effect — resolving it here (per + // request, on the calling fiber) picks up context-provided credentials. + credentials: Effect.gen(function* () { + const resolve = yield* Credentials; + return yield* resolve; + }), + baseUrl: (creds) => creds.apiBaseUrl, + headers: (creds) => ({ + Authorization: `Bearer ${Redacted.value(creds.apiKey)}`, + }), + // Connect's error body is `{ status?: number, message: string }` — the + // factory's default lenient envelope covers `message`. + unknownError: ({ code, message, body }) => + new UnknownOnepasswordError({ + code: + typeof code === "string" + ? code + : code !== undefined + ? String(code) + : undefined, + message, + body, + }), + }); diff --git a/packages/onepassword/src/retry.ts b/packages/onepassword/src/retry.ts new file mode 100644 index 0000000000..d191ab44b3 --- /dev/null +++ b/packages/onepassword/src/retry.ts @@ -0,0 +1,56 @@ +/** + * 1Password Connect retry configuration. + * + * Defines the per-SDK `Retry` Context.Service tag that generated operations + * wire into `API.make`. Callers can install a blanket retry policy at the + * layer level and have every 1Password API call below it pick it up: + * + * @example + * ```ts + * import * as Onepassword from "@distilled.cloud/onepassword"; + * + * myEffect.pipe(Onepassword.Retry.transient); + * Effect.provide(myEffect, Layer.succeed(Onepassword.Retry.Retry, customPolicy)); + * ``` + */ +import * as Context from "effect/Context"; +import * as Effect from "effect/Effect"; +import * as Layer from "effect/Layer"; +import { + type Policy, + throttlingFactory, + transientFactory, +} from "@distilled.cloud/core/retry"; + +export { + type Options, + type Factory, + type Policy, + makeDefault, + jittered, + capped, + throttlingOptions, + transientOptions, + throttlingFactory, + transientFactory, +} from "@distilled.cloud/core/retry"; + +/** Context tag for configuring retry behavior of 1Password API calls. */ +export class Retry extends Context.Service()( + "OnepasswordRetry", +) {} + +/** Provides a custom retry policy to every 1Password API call below it. */ +export const policy = (optionsOrFactory: Policy) => + Effect.provide(Layer.succeed(Retry, optionsOrFactory)); + +/** Disables all automatic retries. */ +export const none = Effect.provide( + Layer.succeed(Retry, { while: () => false }), +); + +/** Apply the throttling retry policy (retries throttling errors indefinitely). */ +export const throttling = policy(throttlingFactory); + +/** Apply the transient retry policy (retries all transient errors indefinitely). */ +export const transient = policy(transientFactory); diff --git a/packages/onepassword/src/services/index.ts b/packages/onepassword/src/services/index.ts new file mode 100644 index 0000000000..3b0ec9bb89 --- /dev/null +++ b/packages/onepassword/src/services/index.ts @@ -0,0 +1,2 @@ +// AUTO-GENERATED by scripts/generate.ts. Do not edit. +export * as onepassword from "./onepassword.ts"; diff --git a/packages/onepassword/src/services/onepassword.ts b/packages/onepassword/src/services/onepassword.ts new file mode 100644 index 0000000000..f577b1d2e4 --- /dev/null +++ b/packages/onepassword/src/services/onepassword.ts @@ -0,0 +1,1640 @@ +// AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-onepassword). Do not edit. +import * as S from "@distilled.cloud/core/schema"; +import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; +import * as T from "../traits.ts"; +import { + OnepasswordProtocol, + type OnepasswordOpError, + type OnepasswordOpContext, +} from "../protocol.ts"; +import { UnknownOnepasswordError } from "../errors.ts"; +import * as Retry from "../retry.ts"; + +export type { OnepasswordOpError, OnepasswordOpContext }; + +export class BadRequest + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BadRequest", { + code: S.Number, + message: S.String, + }).pipe(C.withBadRequestError), + [{ status: 400 }], + ) {} + +export class Forbidden + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("Forbidden", { + code: S.Number, + message: S.String, + }).pipe(C.withAuthError), + [{ status: 403 }], + ) {} + +export class NotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotFound", { + code: S.Number, + message: S.String, + }).pipe(C.withBadRequestError), + [{ status: 404 }], + ) {} + +export interface CreateVaultItemRequestVault { + id: string; +} +export const CreateVaultItemRequestVault = /*@__PURE__*/ S.suspend(() => + S.Struct({ + id: S.String, + }), +).annotate({ + identifier: "CreateVaultItemRequestVault", +}) as any as S.Schema; + +export type CreateVaultItemRequestCategory = + | "LOGIN" + | "PASSWORD" + | "API_CREDENTIAL" + | "SERVER" + | "DATABASE" + | "CREDIT_CARD" + | "MEMBERSHIP" + | "PASSPORT" + | "SOFTWARE_LICENSE" + | "OUTDOOR_LICENSE" + | "SECURE_NOTE" + | "WIRELESS_ROUTER" + | "BANK_ACCOUNT" + | "DRIVER_LICENSE" + | "IDENTITY" + | "REWARD_PROGRAM" + | "DOCUMENT" + | "EMAIL_ACCOUNT" + | "SOCIAL_SECURITY_NUMBER" + | "MEDICAL_RECORD" + | "SSH_KEY" + | "CUSTOM"; +export const CreateVaultItemRequestCategory = /*@__PURE__*/ S.String; + +export interface CreateVaultItemRequestUrlsItem { + label?: string; + primary?: boolean; + href: string; +} +export const CreateVaultItemRequestUrlsItem = /*@__PURE__*/ S.suspend(() => + S.Struct({ + label: S.optional(S.String), + primary: S.optional(S.Boolean), + href: S.String, + }), +).annotate({ + identifier: "CreateVaultItemRequestUrlsItem", +}) as any as S.Schema; + +export type CreateVaultItemRequestUrlsList = + Array; +export const CreateVaultItemRequestUrlsList = /*@__PURE__*/ S.Array( + CreateVaultItemRequestUrlsItem, +) as any as S.Schema; + +export type CreateVaultItemRequestTagsList = Array; +export const CreateVaultItemRequestTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +export interface CreateVaultItemRequestSectionsItem { + id?: string; + label?: string; +} +export const CreateVaultItemRequestSectionsItem = /*@__PURE__*/ S.suspend(() => + S.Struct({ + id: S.optional(S.String), + label: S.optional(S.String), + }), +).annotate({ + identifier: "CreateVaultItemRequestSectionsItem", +}) as any as S.Schema; + +export type CreateVaultItemRequestSectionsList = + Array; +export const CreateVaultItemRequestSectionsList = /*@__PURE__*/ S.Array( + CreateVaultItemRequestSectionsItem, +) as any as S.Schema; + +export interface FieldInputSection { + id?: string; +} +export const FieldInputSection = /*@__PURE__*/ S.suspend(() => + S.Struct({ + id: S.optional(S.String), + }), +).annotate({ + identifier: "FieldInputSection", +}) as any as S.Schema; + +export type FieldInputType = + | "STRING" + | "EMAIL" + | "CONCEALED" + | "URL" + | "TOTP" + | "DATE" + | "MONTH_YEAR" + | "MENU"; +export const FieldInputType = /*@__PURE__*/ S.String; + +/** Some item types, Login and Password, have fields used for autofill. This property indicates that purpose and is required for some item types. */ +export type FieldInputPurpose = "" | "USERNAME" | "PASSWORD" | "NOTES"; +export const FieldInputPurpose = /*@__PURE__*/ S.String; + +export type GeneratorRecipeCharacterSetsItem = "LETTERS" | "DIGITS" | "SYMBOLS"; +export const GeneratorRecipeCharacterSetsItem = /*@__PURE__*/ S.String; + +export type GeneratorRecipeCharacterSetsList = Array< + GeneratorRecipeCharacterSetsItem | (string & {}) +>; +export const GeneratorRecipeCharacterSetsList = /*@__PURE__*/ S.Array( + GeneratorRecipeCharacterSetsItem, +) as any as S.Schema; + +/** The recipe is used in conjunction with the "generate" property to set the character set used to generate a new secure value */ +export interface GeneratorRecipe { + /** Length of the generated value */ + length?: number; + characterSets?: GeneratorRecipeCharacterSetsList; + /** List of all characters that should be excluded from generated passwords. */ + excludeCharacters?: string; +} +export const GeneratorRecipe = /*@__PURE__*/ S.suspend(() => + S.Struct({ + length: S.optional(S.Number), + characterSets: S.optional(GeneratorRecipeCharacterSetsList), + excludeCharacters: S.optional(S.String), + }), +).annotate({ + identifier: "GeneratorRecipe", +}) as any as S.Schema; + +export interface FieldInput { + id: string; + section?: FieldInputSection; + type: FieldInputType | (string & {}); + /** Some item types, Login and Password, have fields used for autofill. This property indicates that purpose and is required for some item types. */ + purpose?: FieldInputPurpose | (string & {}); + label?: string; + value?: string; + /** If value is not present then a new value should be generated for this field */ + generate?: boolean; + recipe?: GeneratorRecipe; +} +export const FieldInput = /*@__PURE__*/ S.suspend(() => + S.Struct({ + id: S.String, + section: S.optional(FieldInputSection), + type: FieldInputType, + purpose: S.optional(FieldInputPurpose), + label: S.optional(S.String), + value: S.optional(S.String), + generate: S.optional(S.Boolean), + recipe: S.optional(GeneratorRecipe), + }), +).annotate({ identifier: "FieldInput" }) as any as S.Schema; + +export type CreateVaultItemRequestFieldsList = Array; +export const CreateVaultItemRequestFieldsList = /*@__PURE__*/ S.Array( + FieldInput, +) as any as S.Schema; + +/** For files that are in a section, this field describes the section. */ +export type FileInputSection = FieldInputSection; +export const FileInputSection = FieldInputSection; + +export interface FileInput { + /** ID of the file */ + id?: string; + /** Name of the file */ + name?: string; + /** Size in bytes of the file */ + size?: number; + /** For files that are in a section, this field describes the section. */ + section?: FieldInputSection; + /** Base64-encoded contents of the file. Only set if size <= OP_MAX_INLINE_FILE_SIZE_KB kb and `inline_files` is set to `true`. */ + content?: string; +} +export const FileInput = /*@__PURE__*/ S.suspend(() => + S.Struct({ + id: S.optional(S.String), + name: S.optional(S.String), + size: S.optional(S.Number), + section: S.optional(FieldInputSection), + content: S.optional(S.String), + }), +).annotate({ identifier: "FileInput" }) as any as S.Schema; + +export type CreateVaultItemRequestFilesList = Array; +export const CreateVaultItemRequestFilesList = /*@__PURE__*/ S.Array( + FileInput, +) as any as S.Schema; + +export interface CreateVaultItemRequest { + /** The UUID of the Vault to create an Item in */ + vaultUuid: string; + id?: string; + title?: string; + vault: CreateVaultItemRequestVault; + category: CreateVaultItemRequestCategory | (string & {}); + urls?: CreateVaultItemRequestUrlsList; + favorite?: boolean; + tags?: CreateVaultItemRequestTagsList; + version?: number; + sections?: CreateVaultItemRequestSectionsList; + fields?: CreateVaultItemRequestFieldsList; + files?: CreateVaultItemRequestFilesList; +} +export const CreateVaultItemRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + vaultUuid: S.String.pipe(T.Label()), + id: S.optional(S.String), + title: S.optional(S.String), + vault: CreateVaultItemRequestVault, + category: CreateVaultItemRequestCategory, + urls: S.optional(CreateVaultItemRequestUrlsList), + favorite: S.optional(S.Boolean), + tags: S.optional(CreateVaultItemRequestTagsList), + version: S.optional(S.Number), + sections: S.optional(CreateVaultItemRequestSectionsList), + fields: S.optional(CreateVaultItemRequestFieldsList), + files: S.optional(CreateVaultItemRequestFilesList), + }).pipe( + T.Http({ method: "POST", uri: "/vaults/{vaultUuid}/items", code: 200 }), + ), +).annotate({ + identifier: "CreateVaultItemRequest", +}) as any as S.Schema; + +export type CreateVaultItemResponseVault = CreateVaultItemRequestVault; +export const CreateVaultItemResponseVault = CreateVaultItemRequestVault; + +export type CreateVaultItemResponseCategory = + | "LOGIN" + | "PASSWORD" + | "API_CREDENTIAL" + | "SERVER" + | "DATABASE" + | "CREDIT_CARD" + | "MEMBERSHIP" + | "PASSPORT" + | "SOFTWARE_LICENSE" + | "OUTDOOR_LICENSE" + | "SECURE_NOTE" + | "WIRELESS_ROUTER" + | "BANK_ACCOUNT" + | "DRIVER_LICENSE" + | "IDENTITY" + | "REWARD_PROGRAM" + | "DOCUMENT" + | "EMAIL_ACCOUNT" + | "SOCIAL_SECURITY_NUMBER" + | "MEDICAL_RECORD" + | "SSH_KEY" + | "CUSTOM"; +export const CreateVaultItemResponseCategory = /*@__PURE__*/ S.String; + +export type CreateVaultItemResponseUrlsItem = CreateVaultItemRequestUrlsItem; +export const CreateVaultItemResponseUrlsItem = CreateVaultItemRequestUrlsItem; + +export type CreateVaultItemResponseUrlsList = + Array; +export const CreateVaultItemResponseUrlsList = /*@__PURE__*/ S.Array( + CreateVaultItemRequestUrlsItem, +) as any as S.Schema; + +export type CreateVaultItemResponseTagsList = Array; +export const CreateVaultItemResponseTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +export type CreateVaultItemResponseState = "ARCHIVED" | "DELETED"; +export const CreateVaultItemResponseState = /*@__PURE__*/ S.String; + +export type CreateVaultItemResponseSectionsItem = + CreateVaultItemRequestSectionsItem; +export const CreateVaultItemResponseSectionsItem = + CreateVaultItemRequestSectionsItem; + +export type CreateVaultItemResponseSectionsList = + Array; +export const CreateVaultItemResponseSectionsList = /*@__PURE__*/ S.Array( + CreateVaultItemRequestSectionsItem, +) as any as S.Schema; + +export type FieldSection = FieldInputSection; +export const FieldSection = FieldInputSection; + +export type FieldType = + | "STRING" + | "EMAIL" + | "CONCEALED" + | "URL" + | "TOTP" + | "DATE" + | "MONTH_YEAR" + | "MENU"; +export const FieldType = /*@__PURE__*/ S.String; + +/** Some item types, Login and Password, have fields used for autofill. This property indicates that purpose and is required for some item types. */ +export type FieldPurpose = "" | "USERNAME" | "PASSWORD" | "NOTES"; +export const FieldPurpose = /*@__PURE__*/ S.String; + +export interface Field { + id: string; + section?: FieldInputSection; + type: FieldType; + /** Some item types, Login and Password, have fields used for autofill. This property indicates that purpose and is required for some item types. */ + purpose?: FieldPurpose; + label?: string; + value?: string; + /** If value is not present then a new value should be generated for this field */ + generate?: boolean; + recipe?: GeneratorRecipe; + /** For fields with a purpose of `PASSWORD` this is the entropy of the value */ + entropy?: number; +} +export const Field = /*@__PURE__*/ S.suspend(() => + S.Struct({ + id: S.String, + section: S.optional(FieldInputSection), + type: FieldType, + purpose: S.optional(FieldPurpose), + label: S.optional(S.String), + value: S.optional(S.String), + generate: S.optional(S.Boolean), + recipe: S.optional(GeneratorRecipe), + entropy: S.optional(S.Number), + }), +).annotate({ identifier: "Field" }) as any as S.Schema; + +export type CreateVaultItemResponseFieldsList = Array; +export const CreateVaultItemResponseFieldsList = /*@__PURE__*/ S.Array( + Field, +) as any as S.Schema; + +/** For files that are in a section, this field describes the section. */ +export type FileSection = FieldInputSection; +export const FileSection = FieldInputSection; + +export interface File { + /** ID of the file */ + id?: string; + /** Name of the file */ + name?: string; + /** Size in bytes of the file */ + size?: number; + /** Path of the Connect API that can be used to download the contents of this file. */ + content_path?: string; + /** For files that are in a section, this field describes the section. */ + section?: FieldInputSection; + /** Base64-encoded contents of the file. Only set if size <= OP_MAX_INLINE_FILE_SIZE_KB kb and `inline_files` is set to `true`. */ + content?: string; +} +export const File = /*@__PURE__*/ S.suspend(() => + S.Struct({ + id: S.optional(S.String), + name: S.optional(S.String), + size: S.optional(S.Number), + content_path: S.optional(S.String), + section: S.optional(FieldInputSection), + content: S.optional(S.String), + }), +).annotate({ identifier: "File" }) as any as S.Schema; + +export type CreateVaultItemResponseFilesList = Array; +export const CreateVaultItemResponseFilesList = /*@__PURE__*/ S.Array( + File, +) as any as S.Schema; + +export interface CreateVaultItemResponse { + id?: string; + title?: string; + vault: CreateVaultItemRequestVault; + category: CreateVaultItemResponseCategory; + urls?: CreateVaultItemResponseUrlsList; + favorite?: boolean; + tags?: CreateVaultItemResponseTagsList; + version?: number; + state?: CreateVaultItemResponseState; + createdAt?: string; + updatedAt?: string; + lastEditedBy?: string; + sections?: CreateVaultItemResponseSectionsList; + fields?: CreateVaultItemResponseFieldsList; + files?: CreateVaultItemResponseFilesList; +} +export const CreateVaultItemResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + id: S.optional(S.String), + title: S.optional(S.String), + vault: CreateVaultItemRequestVault, + category: CreateVaultItemResponseCategory, + urls: S.optional(CreateVaultItemResponseUrlsList), + favorite: S.optional(S.Boolean), + tags: S.optional(CreateVaultItemResponseTagsList), + version: S.optional(S.Number), + state: S.optional(CreateVaultItemResponseState), + createdAt: S.optional(S.String), + updatedAt: S.optional(S.String), + lastEditedBy: S.optional(S.String), + sections: S.optional(CreateVaultItemResponseSectionsList), + fields: S.optional(CreateVaultItemResponseFieldsList), + files: S.optional(CreateVaultItemResponseFilesList), + }), +).annotate({ + identifier: "CreateVaultItemResponse", +}) as any as S.Schema; + +export interface DeleteVaultItemRequest { + /** The UUID of the Vault the item is in */ + vaultUuid: string; + /** The UUID of the Item to update */ + itemUuid: string; +} +export const DeleteVaultItemRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + vaultUuid: S.String.pipe(T.Label()), + itemUuid: S.String.pipe(T.Label()), + }).pipe( + T.Http({ + method: "DELETE", + uri: "/vaults/{vaultUuid}/items/{itemUuid}", + code: 200, + }), + ), +).annotate({ + identifier: "DeleteVaultItemRequest", +}) as any as S.Schema; + +export interface DeleteVaultItemResponse {} +export const DeleteVaultItemResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({}), +).annotate({ + identifier: "DeleteVaultItemResponse", +}) as any as S.Schema; + +export interface DownloadFileByIDRequest { + /** The UUID of the Vault the item is in */ + vaultUuid: string; + /** The UUID of the Item the File is in */ + itemUuid: string; + /** UUID of the file to get content from */ + fileUuid: string; +} +export const DownloadFileByIDRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + vaultUuid: S.String.pipe(T.Label()), + itemUuid: S.String.pipe(T.Label()), + fileUuid: S.String.pipe(T.Label()), + }).pipe( + T.Http({ + method: "GET", + uri: "/vaults/{vaultUuid}/items/{itemUuid}/files/{fileUuid}/content", + code: 200, + }), + ), +).annotate({ + identifier: "DownloadFileByIDRequest", +}) as any as S.Schema; + +export interface DownloadFileByIDResponse {} +export const DownloadFileByIDResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({}), +).annotate({ + identifier: "DownloadFileByIDResponse", +}) as any as S.Schema; + +export interface GetApiActivityRequest { + /** How many API Events should be retrieved in a single request. */ + limit?: number; + /** How far into the collection of API Events should the response start */ + offset?: number; +} +export const GetApiActivityRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + limit: S.optional(S.Number.pipe(T.Query())), + offset: S.optional(S.Number.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/activity", code: 200 })), +).annotate({ + identifier: "GetApiActivityRequest", +}) as any as S.Schema; + +export type APIRequestAction = "READ" | "CREATE" | "UPDATE" | "DELETE"; +export const APIRequestAction = /*@__PURE__*/ S.String; + +export type APIRequestResult = "SUCCESS" | "DENY"; +export const APIRequestResult = /*@__PURE__*/ S.String; + +export interface APIRequestActor { + id?: string; + account?: string; + jti?: string; + userAgent?: string; + requestIp?: string; +} +export const APIRequestActor = /*@__PURE__*/ S.suspend(() => + S.Struct({ + id: S.optional(S.String), + account: S.optional(S.String), + jti: S.optional(S.String), + userAgent: S.optional(S.String), + requestIp: S.optional(S.String), + }), +).annotate({ + identifier: "APIRequestActor", +}) as any as S.Schema; + +export type APIRequestResourceType = "ITEM" | "VAULT"; +export const APIRequestResourceType = /*@__PURE__*/ S.String; + +export type APIRequestResourceVault = FieldInputSection; +export const APIRequestResourceVault = FieldInputSection; + +export type APIRequestResourceItem = FieldInputSection; +export const APIRequestResourceItem = FieldInputSection; + +export interface APIRequestResource { + type?: APIRequestResourceType; + vault?: FieldInputSection; + item?: FieldInputSection; + itemVersion?: number; +} +export const APIRequestResource = /*@__PURE__*/ S.suspend(() => + S.Struct({ + type: S.optional(APIRequestResourceType), + vault: S.optional(FieldInputSection), + item: S.optional(FieldInputSection), + itemVersion: S.optional(S.Number), + }), +).annotate({ + identifier: "APIRequestResource", +}) as any as S.Schema; + +/** Represents a request that was made to the API. Including what Token was used and what resource was accessed. */ +export interface APIRequest { + /** The unique id used to identify a single request. */ + requestId?: string; + /** The time at which the request was processed by the server. */ + timestamp?: string; + action?: APIRequestAction; + result?: APIRequestResult; + actor?: APIRequestActor; + resource?: APIRequestResource; +} +export const APIRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + requestId: S.optional(S.String), + timestamp: S.optional(S.String), + action: S.optional(APIRequestAction), + result: S.optional(APIRequestResult), + actor: S.optional(APIRequestActor), + resource: S.optional(APIRequestResource), + }), +).annotate({ identifier: "APIRequest" }) as any as S.Schema; + +export type GetApiActivityResponseBodyList = Array; +export const GetApiActivityResponseBodyList = /*@__PURE__*/ S.Array( + APIRequest, +) as any as S.Schema; + +export type GetApiActivityResponse = GetApiActivityResponseBodyList; +export const GetApiActivityResponse = /*@__PURE__*/ S.suspend(() => + GetApiActivityResponseBodyList.pipe(T.RawResponseRoot()), +).annotate({ + identifier: "GetApiActivityResponse", +}) as any as S.Schema; + +export interface GetDetailsOfFileByIdRequest { + /** The UUID of the Vault to fetch Item from */ + vaultUuid: string; + /** The UUID of the Item to fetch File from */ + itemUuid: string; + /** The UUID of the File to fetch */ + fileUuid: string; + /** Tells server to return the base64-encoded file contents in the response. */ + inline_files?: boolean; +} +export const GetDetailsOfFileByIdRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + vaultUuid: S.String.pipe(T.Label()), + itemUuid: S.String.pipe(T.Label()), + fileUuid: S.String.pipe(T.Label()), + inline_files: S.optional(S.Boolean.pipe(T.Query())), + }).pipe( + T.Http({ + method: "GET", + uri: "/vaults/{vaultUuid}/items/{itemUuid}/files/{fileUuid}", + code: 200, + }), + ), +).annotate({ + identifier: "GetDetailsOfFileByIdRequest", +}) as any as S.Schema; + +export interface GetHeartbeatRequest {} +export const GetHeartbeatRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({}).pipe(T.Http({ method: "GET", uri: "/heartbeat", code: 200 })), +).annotate({ + identifier: "GetHeartbeatRequest", +}) as any as S.Schema; + +export interface GetHeartbeatResponse {} +export const GetHeartbeatResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({}), +).annotate({ + identifier: "GetHeartbeatResponse", +}) as any as S.Schema; + +export interface GetItemFilesRequest { + /** The UUID of the Vault to fetch Items from */ + vaultUuid: string; + /** The UUID of the Item to fetch files from */ + itemUuid: string; + /** Tells server to return the base64-encoded file contents in the response. */ + inline_files?: boolean; +} +export const GetItemFilesRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + vaultUuid: S.String.pipe(T.Label()), + itemUuid: S.String.pipe(T.Label()), + inline_files: S.optional(S.Boolean.pipe(T.Query())), + }).pipe( + T.Http({ + method: "GET", + uri: "/vaults/{vaultUuid}/items/{itemUuid}/files", + code: 200, + }), + ), +).annotate({ + identifier: "GetItemFilesRequest", +}) as any as S.Schema; + +export type GetItemFilesResponseBodyList = Array; +export const GetItemFilesResponseBodyList = /*@__PURE__*/ S.Array( + File, +) as any as S.Schema; + +export type GetItemFilesResponse = GetItemFilesResponseBodyList; +export const GetItemFilesResponse = /*@__PURE__*/ S.suspend(() => + GetItemFilesResponseBodyList.pipe(T.RawResponseRoot()), +).annotate({ + identifier: "GetItemFilesResponse", +}) as any as S.Schema; + +export interface GetPrometheusMetricsRequest {} +export const GetPrometheusMetricsRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({}).pipe(T.Http({ method: "GET", uri: "/metrics", code: 200 })), +).annotate({ + identifier: "GetPrometheusMetricsRequest", +}) as any as S.Schema; + +export interface GetPrometheusMetricsResponse {} +export const GetPrometheusMetricsResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({}), +).annotate({ + identifier: "GetPrometheusMetricsResponse", +}) as any as S.Schema; + +export interface GetServerHealthRequest {} +export const GetServerHealthRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({}).pipe(T.Http({ method: "GET", uri: "/health", code: 200 })), +).annotate({ + identifier: "GetServerHealthRequest", +}) as any as S.Schema; + +/** The state of a registered server dependency. */ +export interface ServiceDependency { + service?: string; + status?: string; + /** Human-readable message for explaining the current state. */ + message?: string; +} +export const ServiceDependency = /*@__PURE__*/ S.suspend(() => + S.Struct({ + service: S.optional(S.String), + status: S.optional(S.String), + message: S.optional(S.String), + }), +).annotate({ + identifier: "ServiceDependency", +}) as any as S.Schema; + +export type GetServerHealthResponseDependenciesList = Array; +export const GetServerHealthResponseDependenciesList = /*@__PURE__*/ S.Array( + ServiceDependency, +) as any as S.Schema; + +export interface GetServerHealthResponse { + name: string; + /** The Connect server's version */ + version: string; + dependencies?: GetServerHealthResponseDependenciesList; +} +export const GetServerHealthResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + name: S.String, + version: S.String, + dependencies: S.optional(GetServerHealthResponseDependenciesList), + }), +).annotate({ + identifier: "GetServerHealthResponse", +}) as any as S.Schema; + +export interface GetVaultByIdRequest { + /** The UUID of the Vault to fetch Items from */ + vaultUuid: string; +} +export const GetVaultByIdRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + vaultUuid: S.String.pipe(T.Label()), + }).pipe(T.Http({ method: "GET", uri: "/vaults/{vaultUuid}", code: 200 })), +).annotate({ + identifier: "GetVaultByIdRequest", +}) as any as S.Schema; + +export type VaultType = "USER_CREATED" | "PERSONAL" | "EVERYONE" | "TRANSFER"; +export const VaultType = /*@__PURE__*/ S.String; + +export interface Vault { + id?: string; + name?: string; + description?: string; + /** The vault version */ + attributeVersion?: number; + /** The version of the vault contents */ + contentVersion?: number; + /** Number of active items in the vault */ + items?: number; + type?: VaultType; + createdAt?: string; + updatedAt?: string; +} +export const Vault = /*@__PURE__*/ S.suspend(() => + S.Struct({ + id: S.optional(S.String), + name: S.optional(S.String), + description: S.optional(S.String), + attributeVersion: S.optional(S.Number), + contentVersion: S.optional(S.Number), + items: S.optional(S.Number), + type: S.optional(VaultType), + createdAt: S.optional(S.String), + updatedAt: S.optional(S.String), + }), +).annotate({ identifier: "Vault" }) as any as S.Schema; + +export interface GetVaultItemByIdRequest { + /** The UUID of the Vault to fetch Item from */ + vaultUuid: string; + /** The UUID of the Item to fetch */ + itemUuid: string; +} +export const GetVaultItemByIdRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + vaultUuid: S.String.pipe(T.Label()), + itemUuid: S.String.pipe(T.Label()), + }).pipe( + T.Http({ + method: "GET", + uri: "/vaults/{vaultUuid}/items/{itemUuid}", + code: 200, + }), + ), +).annotate({ + identifier: "GetVaultItemByIdRequest", +}) as any as S.Schema; + +export type GetVaultItemByIdResponseVault = CreateVaultItemRequestVault; +export const GetVaultItemByIdResponseVault = CreateVaultItemRequestVault; + +export type GetVaultItemByIdResponseCategory = + | "LOGIN" + | "PASSWORD" + | "API_CREDENTIAL" + | "SERVER" + | "DATABASE" + | "CREDIT_CARD" + | "MEMBERSHIP" + | "PASSPORT" + | "SOFTWARE_LICENSE" + | "OUTDOOR_LICENSE" + | "SECURE_NOTE" + | "WIRELESS_ROUTER" + | "BANK_ACCOUNT" + | "DRIVER_LICENSE" + | "IDENTITY" + | "REWARD_PROGRAM" + | "DOCUMENT" + | "EMAIL_ACCOUNT" + | "SOCIAL_SECURITY_NUMBER" + | "MEDICAL_RECORD" + | "SSH_KEY" + | "CUSTOM"; +export const GetVaultItemByIdResponseCategory = /*@__PURE__*/ S.String; + +export type GetVaultItemByIdResponseUrlsItem = CreateVaultItemRequestUrlsItem; +export const GetVaultItemByIdResponseUrlsItem = CreateVaultItemRequestUrlsItem; + +export type GetVaultItemByIdResponseUrlsList = + Array; +export const GetVaultItemByIdResponseUrlsList = /*@__PURE__*/ S.Array( + CreateVaultItemRequestUrlsItem, +) as any as S.Schema; + +export type GetVaultItemByIdResponseTagsList = Array; +export const GetVaultItemByIdResponseTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +export type GetVaultItemByIdResponseState = "ARCHIVED" | "DELETED"; +export const GetVaultItemByIdResponseState = /*@__PURE__*/ S.String; + +export type GetVaultItemByIdResponseSectionsItem = + CreateVaultItemRequestSectionsItem; +export const GetVaultItemByIdResponseSectionsItem = + CreateVaultItemRequestSectionsItem; + +export type GetVaultItemByIdResponseSectionsList = + Array; +export const GetVaultItemByIdResponseSectionsList = /*@__PURE__*/ S.Array( + CreateVaultItemRequestSectionsItem, +) as any as S.Schema; + +export type GetVaultItemByIdResponseFieldsList = Array; +export const GetVaultItemByIdResponseFieldsList = /*@__PURE__*/ S.Array( + Field, +) as any as S.Schema; + +export type GetVaultItemByIdResponseFilesList = Array; +export const GetVaultItemByIdResponseFilesList = /*@__PURE__*/ S.Array( + File, +) as any as S.Schema; + +export interface GetVaultItemByIdResponse { + id?: string; + title?: string; + vault: CreateVaultItemRequestVault; + category: GetVaultItemByIdResponseCategory; + urls?: GetVaultItemByIdResponseUrlsList; + favorite?: boolean; + tags?: GetVaultItemByIdResponseTagsList; + version?: number; + state?: GetVaultItemByIdResponseState; + createdAt?: string; + updatedAt?: string; + lastEditedBy?: string; + sections?: GetVaultItemByIdResponseSectionsList; + fields?: GetVaultItemByIdResponseFieldsList; + files?: GetVaultItemByIdResponseFilesList; +} +export const GetVaultItemByIdResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + id: S.optional(S.String), + title: S.optional(S.String), + vault: CreateVaultItemRequestVault, + category: GetVaultItemByIdResponseCategory, + urls: S.optional(GetVaultItemByIdResponseUrlsList), + favorite: S.optional(S.Boolean), + tags: S.optional(GetVaultItemByIdResponseTagsList), + version: S.optional(S.Number), + state: S.optional(GetVaultItemByIdResponseState), + createdAt: S.optional(S.String), + updatedAt: S.optional(S.String), + lastEditedBy: S.optional(S.String), + sections: S.optional(GetVaultItemByIdResponseSectionsList), + fields: S.optional(GetVaultItemByIdResponseFieldsList), + files: S.optional(GetVaultItemByIdResponseFilesList), + }), +).annotate({ + identifier: "GetVaultItemByIdResponse", +}) as any as S.Schema; + +export interface GetVaultItemsRequest { + /** The UUID of the Vault to fetch Items from */ + vaultUuid: string; + /** Filter the Item collection based on Item name using SCIM eq filter */ + filter?: string; +} +export const GetVaultItemsRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + vaultUuid: S.String.pipe(T.Label()), + filter: S.optional(S.String.pipe(T.Query())), + }).pipe( + T.Http({ method: "GET", uri: "/vaults/{vaultUuid}/items", code: 200 }), + ), +).annotate({ + identifier: "GetVaultItemsRequest", +}) as any as S.Schema; + +export type ItemVault = CreateVaultItemRequestVault; +export const ItemVault = CreateVaultItemRequestVault; + +export type ItemCategory = + | "LOGIN" + | "PASSWORD" + | "API_CREDENTIAL" + | "SERVER" + | "DATABASE" + | "CREDIT_CARD" + | "MEMBERSHIP" + | "PASSPORT" + | "SOFTWARE_LICENSE" + | "OUTDOOR_LICENSE" + | "SECURE_NOTE" + | "WIRELESS_ROUTER" + | "BANK_ACCOUNT" + | "DRIVER_LICENSE" + | "IDENTITY" + | "REWARD_PROGRAM" + | "DOCUMENT" + | "EMAIL_ACCOUNT" + | "SOCIAL_SECURITY_NUMBER" + | "MEDICAL_RECORD" + | "SSH_KEY" + | "CUSTOM"; +export const ItemCategory = /*@__PURE__*/ S.String; + +export type ItemUrlsItem = CreateVaultItemRequestUrlsItem; +export const ItemUrlsItem = CreateVaultItemRequestUrlsItem; + +export type ItemUrlsList = Array; +export const ItemUrlsList = /*@__PURE__*/ S.Array( + CreateVaultItemRequestUrlsItem, +) as any as S.Schema; + +export type ItemTagsList = Array; +export const ItemTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +export type ItemState = "ARCHIVED" | "DELETED"; +export const ItemState = /*@__PURE__*/ S.String; + +export interface Item { + id?: string; + title?: string; + vault: CreateVaultItemRequestVault; + category: ItemCategory; + urls?: ItemUrlsList; + favorite?: boolean; + tags?: ItemTagsList; + version?: number; + state?: ItemState; + createdAt?: string; + updatedAt?: string; + lastEditedBy?: string; +} +export const Item = /*@__PURE__*/ S.suspend(() => + S.Struct({ + id: S.optional(S.String), + title: S.optional(S.String), + vault: CreateVaultItemRequestVault, + category: ItemCategory, + urls: S.optional(ItemUrlsList), + favorite: S.optional(S.Boolean), + tags: S.optional(ItemTagsList), + version: S.optional(S.Number), + state: S.optional(ItemState), + createdAt: S.optional(S.String), + updatedAt: S.optional(S.String), + lastEditedBy: S.optional(S.String), + }), +).annotate({ identifier: "Item" }) as any as S.Schema; + +export type GetVaultItemsResponseBodyList = Array; +export const GetVaultItemsResponseBodyList = /*@__PURE__*/ S.Array( + Item, +) as any as S.Schema; + +export type GetVaultItemsResponse = GetVaultItemsResponseBodyList; +export const GetVaultItemsResponse = /*@__PURE__*/ S.suspend(() => + GetVaultItemsResponseBodyList.pipe(T.RawResponseRoot()), +).annotate({ + identifier: "GetVaultItemsResponse", +}) as any as S.Schema; + +export interface GetVaultsRequest { + /** Filter the Vault collection based on Vault name using SCIM eq filter */ + filter?: string; +} +export const GetVaultsRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + filter: S.optional(S.String.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/vaults", code: 200 })), +).annotate({ + identifier: "GetVaultsRequest", +}) as any as S.Schema; + +export type GetVaultsResponseBodyList = Array; +export const GetVaultsResponseBodyList = /*@__PURE__*/ S.Array( + Vault, +) as any as S.Schema; + +export type GetVaultsResponse = GetVaultsResponseBodyList; +export const GetVaultsResponse = /*@__PURE__*/ S.suspend(() => + GetVaultsResponseBodyList.pipe(T.RawResponseRoot()), +).annotate({ + identifier: "GetVaultsResponse", +}) as any as S.Schema; + +export type PatchItemOp = "add" | "remove" | "replace"; +export const PatchItemOp = /*@__PURE__*/ S.String; + +export interface PatchItem { + op: PatchItemOp | (string & {}); + /** An RFC6901 JSON Pointer pointing to the Item document, an Item Attribute, and Item Field by Field ID, or an Item Field Attribute */ + path: string; + value?: unknown; +} +export const PatchItem = /*@__PURE__*/ S.suspend(() => + S.Struct({ + op: PatchItemOp, + path: S.String, + value: S.optional(S.Unknown), + }), +).annotate({ identifier: "PatchItem" }) as any as S.Schema; + +export type Patch = Array; +export const Patch = /*@__PURE__*/ S.Array(PatchItem) as any as S.Schema; + +export interface PatchVaultItemRequest { + /** The UUID of the Vault the item is in */ + vaultUuid: string; + /** The UUID of the Item to update */ + itemUuid: string; + body?: Patch; +} +export const PatchVaultItemRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + vaultUuid: S.String.pipe(T.Label()), + itemUuid: S.String.pipe(T.Label()), + body: S.optional(Patch.pipe(T.HttpBody())), + }).pipe( + T.Http({ + method: "PATCH", + uri: "/vaults/{vaultUuid}/items/{itemUuid}", + code: 200, + }), + ), +).annotate({ + identifier: "PatchVaultItemRequest", +}) as any as S.Schema; + +export type PatchVaultItemResponseVault = CreateVaultItemRequestVault; +export const PatchVaultItemResponseVault = CreateVaultItemRequestVault; + +export type PatchVaultItemResponseCategory = + | "LOGIN" + | "PASSWORD" + | "API_CREDENTIAL" + | "SERVER" + | "DATABASE" + | "CREDIT_CARD" + | "MEMBERSHIP" + | "PASSPORT" + | "SOFTWARE_LICENSE" + | "OUTDOOR_LICENSE" + | "SECURE_NOTE" + | "WIRELESS_ROUTER" + | "BANK_ACCOUNT" + | "DRIVER_LICENSE" + | "IDENTITY" + | "REWARD_PROGRAM" + | "DOCUMENT" + | "EMAIL_ACCOUNT" + | "SOCIAL_SECURITY_NUMBER" + | "MEDICAL_RECORD" + | "SSH_KEY" + | "CUSTOM"; +export const PatchVaultItemResponseCategory = /*@__PURE__*/ S.String; + +export type PatchVaultItemResponseUrlsItem = CreateVaultItemRequestUrlsItem; +export const PatchVaultItemResponseUrlsItem = CreateVaultItemRequestUrlsItem; + +export type PatchVaultItemResponseUrlsList = + Array; +export const PatchVaultItemResponseUrlsList = /*@__PURE__*/ S.Array( + CreateVaultItemRequestUrlsItem, +) as any as S.Schema; + +export type PatchVaultItemResponseTagsList = Array; +export const PatchVaultItemResponseTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +export type PatchVaultItemResponseState = "ARCHIVED" | "DELETED"; +export const PatchVaultItemResponseState = /*@__PURE__*/ S.String; + +export type PatchVaultItemResponseSectionsItem = + CreateVaultItemRequestSectionsItem; +export const PatchVaultItemResponseSectionsItem = + CreateVaultItemRequestSectionsItem; + +export type PatchVaultItemResponseSectionsList = + Array; +export const PatchVaultItemResponseSectionsList = /*@__PURE__*/ S.Array( + CreateVaultItemRequestSectionsItem, +) as any as S.Schema; + +export type PatchVaultItemResponseFieldsList = Array; +export const PatchVaultItemResponseFieldsList = /*@__PURE__*/ S.Array( + Field, +) as any as S.Schema; + +export type PatchVaultItemResponseFilesList = Array; +export const PatchVaultItemResponseFilesList = /*@__PURE__*/ S.Array( + File, +) as any as S.Schema; + +export interface PatchVaultItemResponse { + id?: string; + title?: string; + vault: CreateVaultItemRequestVault; + category: PatchVaultItemResponseCategory; + urls?: PatchVaultItemResponseUrlsList; + favorite?: boolean; + tags?: PatchVaultItemResponseTagsList; + version?: number; + state?: PatchVaultItemResponseState; + createdAt?: string; + updatedAt?: string; + lastEditedBy?: string; + sections?: PatchVaultItemResponseSectionsList; + fields?: PatchVaultItemResponseFieldsList; + files?: PatchVaultItemResponseFilesList; +} +export const PatchVaultItemResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + id: S.optional(S.String), + title: S.optional(S.String), + vault: CreateVaultItemRequestVault, + category: PatchVaultItemResponseCategory, + urls: S.optional(PatchVaultItemResponseUrlsList), + favorite: S.optional(S.Boolean), + tags: S.optional(PatchVaultItemResponseTagsList), + version: S.optional(S.Number), + state: S.optional(PatchVaultItemResponseState), + createdAt: S.optional(S.String), + updatedAt: S.optional(S.String), + lastEditedBy: S.optional(S.String), + sections: S.optional(PatchVaultItemResponseSectionsList), + fields: S.optional(PatchVaultItemResponseFieldsList), + files: S.optional(PatchVaultItemResponseFilesList), + }), +).annotate({ + identifier: "PatchVaultItemResponse", +}) as any as S.Schema; + +export type UpdateVaultItemRequestVault = CreateVaultItemRequestVault; +export const UpdateVaultItemRequestVault = CreateVaultItemRequestVault; + +export type UpdateVaultItemRequestCategory = + | "LOGIN" + | "PASSWORD" + | "API_CREDENTIAL" + | "SERVER" + | "DATABASE" + | "CREDIT_CARD" + | "MEMBERSHIP" + | "PASSPORT" + | "SOFTWARE_LICENSE" + | "OUTDOOR_LICENSE" + | "SECURE_NOTE" + | "WIRELESS_ROUTER" + | "BANK_ACCOUNT" + | "DRIVER_LICENSE" + | "IDENTITY" + | "REWARD_PROGRAM" + | "DOCUMENT" + | "EMAIL_ACCOUNT" + | "SOCIAL_SECURITY_NUMBER" + | "MEDICAL_RECORD" + | "SSH_KEY" + | "CUSTOM"; +export const UpdateVaultItemRequestCategory = /*@__PURE__*/ S.String; + +export type UpdateVaultItemRequestUrlsItem = CreateVaultItemRequestUrlsItem; +export const UpdateVaultItemRequestUrlsItem = CreateVaultItemRequestUrlsItem; + +export type UpdateVaultItemRequestUrlsList = + Array; +export const UpdateVaultItemRequestUrlsList = /*@__PURE__*/ S.Array( + CreateVaultItemRequestUrlsItem, +) as any as S.Schema; + +export type UpdateVaultItemRequestTagsList = Array; +export const UpdateVaultItemRequestTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +export type UpdateVaultItemRequestSectionsItem = + CreateVaultItemRequestSectionsItem; +export const UpdateVaultItemRequestSectionsItem = + CreateVaultItemRequestSectionsItem; + +export type UpdateVaultItemRequestSectionsList = + Array; +export const UpdateVaultItemRequestSectionsList = /*@__PURE__*/ S.Array( + CreateVaultItemRequestSectionsItem, +) as any as S.Schema; + +export type UpdateVaultItemRequestFieldsList = Array; +export const UpdateVaultItemRequestFieldsList = /*@__PURE__*/ S.Array( + FieldInput, +) as any as S.Schema; + +export type UpdateVaultItemRequestFilesList = Array; +export const UpdateVaultItemRequestFilesList = /*@__PURE__*/ S.Array( + FileInput, +) as any as S.Schema; + +export interface UpdateVaultItemRequest { + /** The UUID of the Item's Vault */ + vaultUuid: string; + /** The UUID of the Item to update */ + itemUuid: string; + id?: string; + title?: string; + vault: CreateVaultItemRequestVault; + category: UpdateVaultItemRequestCategory | (string & {}); + urls?: UpdateVaultItemRequestUrlsList; + favorite?: boolean; + tags?: UpdateVaultItemRequestTagsList; + version?: number; + sections?: UpdateVaultItemRequestSectionsList; + fields?: UpdateVaultItemRequestFieldsList; + files?: UpdateVaultItemRequestFilesList; +} +export const UpdateVaultItemRequest = /*@__PURE__*/ S.suspend(() => + S.Struct({ + vaultUuid: S.String.pipe(T.Label()), + itemUuid: S.String.pipe(T.Label()), + id: S.optional(S.String), + title: S.optional(S.String), + vault: CreateVaultItemRequestVault, + category: UpdateVaultItemRequestCategory, + urls: S.optional(UpdateVaultItemRequestUrlsList), + favorite: S.optional(S.Boolean), + tags: S.optional(UpdateVaultItemRequestTagsList), + version: S.optional(S.Number), + sections: S.optional(UpdateVaultItemRequestSectionsList), + fields: S.optional(UpdateVaultItemRequestFieldsList), + files: S.optional(UpdateVaultItemRequestFilesList), + }).pipe( + T.Http({ + method: "PUT", + uri: "/vaults/{vaultUuid}/items/{itemUuid}", + code: 200, + }), + ), +).annotate({ + identifier: "UpdateVaultItemRequest", +}) as any as S.Schema; + +export type UpdateVaultItemResponseVault = CreateVaultItemRequestVault; +export const UpdateVaultItemResponseVault = CreateVaultItemRequestVault; + +export type UpdateVaultItemResponseCategory = + | "LOGIN" + | "PASSWORD" + | "API_CREDENTIAL" + | "SERVER" + | "DATABASE" + | "CREDIT_CARD" + | "MEMBERSHIP" + | "PASSPORT" + | "SOFTWARE_LICENSE" + | "OUTDOOR_LICENSE" + | "SECURE_NOTE" + | "WIRELESS_ROUTER" + | "BANK_ACCOUNT" + | "DRIVER_LICENSE" + | "IDENTITY" + | "REWARD_PROGRAM" + | "DOCUMENT" + | "EMAIL_ACCOUNT" + | "SOCIAL_SECURITY_NUMBER" + | "MEDICAL_RECORD" + | "SSH_KEY" + | "CUSTOM"; +export const UpdateVaultItemResponseCategory = /*@__PURE__*/ S.String; + +export type UpdateVaultItemResponseUrlsItem = CreateVaultItemRequestUrlsItem; +export const UpdateVaultItemResponseUrlsItem = CreateVaultItemRequestUrlsItem; + +export type UpdateVaultItemResponseUrlsList = + Array; +export const UpdateVaultItemResponseUrlsList = /*@__PURE__*/ S.Array( + CreateVaultItemRequestUrlsItem, +) as any as S.Schema; + +export type UpdateVaultItemResponseTagsList = Array; +export const UpdateVaultItemResponseTagsList = /*@__PURE__*/ S.Array( + S.String, +) as any as S.Schema; + +export type UpdateVaultItemResponseState = "ARCHIVED" | "DELETED"; +export const UpdateVaultItemResponseState = /*@__PURE__*/ S.String; + +export type UpdateVaultItemResponseSectionsItem = + CreateVaultItemRequestSectionsItem; +export const UpdateVaultItemResponseSectionsItem = + CreateVaultItemRequestSectionsItem; + +export type UpdateVaultItemResponseSectionsList = + Array; +export const UpdateVaultItemResponseSectionsList = /*@__PURE__*/ S.Array( + CreateVaultItemRequestSectionsItem, +) as any as S.Schema; + +export type UpdateVaultItemResponseFieldsList = Array; +export const UpdateVaultItemResponseFieldsList = /*@__PURE__*/ S.Array( + Field, +) as any as S.Schema; + +export type UpdateVaultItemResponseFilesList = Array; +export const UpdateVaultItemResponseFilesList = /*@__PURE__*/ S.Array( + File, +) as any as S.Schema; + +export interface UpdateVaultItemResponse { + id?: string; + title?: string; + vault: CreateVaultItemRequestVault; + category: UpdateVaultItemResponseCategory; + urls?: UpdateVaultItemResponseUrlsList; + favorite?: boolean; + tags?: UpdateVaultItemResponseTagsList; + version?: number; + state?: UpdateVaultItemResponseState; + createdAt?: string; + updatedAt?: string; + lastEditedBy?: string; + sections?: UpdateVaultItemResponseSectionsList; + fields?: UpdateVaultItemResponseFieldsList; + files?: UpdateVaultItemResponseFilesList; +} +export const UpdateVaultItemResponse = /*@__PURE__*/ S.suspend(() => + S.Struct({ + id: S.optional(S.String), + title: S.optional(S.String), + vault: CreateVaultItemRequestVault, + category: UpdateVaultItemResponseCategory, + urls: S.optional(UpdateVaultItemResponseUrlsList), + favorite: S.optional(S.Boolean), + tags: S.optional(UpdateVaultItemResponseTagsList), + version: S.optional(S.Number), + state: S.optional(UpdateVaultItemResponseState), + createdAt: S.optional(S.String), + updatedAt: S.optional(S.String), + lastEditedBy: S.optional(S.String), + sections: S.optional(UpdateVaultItemResponseSectionsList), + fields: S.optional(UpdateVaultItemResponseFieldsList), + files: S.optional(UpdateVaultItemResponseFilesList), + }), +).annotate({ + identifier: "UpdateVaultItemResponse", +}) as any as S.Schema; + +export type CreateVaultItemError = + | BadRequest + | Forbidden + | NotFound + | OnepasswordOpError; +/** Create a new Item */ +export const createVaultItem: API.OperationMethod< + CreateVaultItemRequest, + CreateVaultItemResponse, + CreateVaultItemError, + OnepasswordOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: CreateVaultItemRequest, + output: CreateVaultItemResponse, + errors: [BadRequest, Forbidden, NotFound, UnknownOnepasswordError], + protocol: OnepasswordProtocol, + retry: Retry.Retry, +})); + +export type DeleteVaultItemError = Forbidden | NotFound | OnepasswordOpError; +/** Delete an Item */ +export const deleteVaultItem: API.OperationMethod< + DeleteVaultItemRequest, + DeleteVaultItemResponse, + DeleteVaultItemError, + OnepasswordOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: DeleteVaultItemRequest, + output: DeleteVaultItemResponse, + errors: [Forbidden, NotFound, UnknownOnepasswordError], + protocol: OnepasswordProtocol, + retry: Retry.Retry, +})); + +export type DownloadFileByIDError = NotFound | OnepasswordOpError; +/** Get the content of a File */ +export const downloadFileByID: API.OperationMethod< + DownloadFileByIDRequest, + DownloadFileByIDResponse, + DownloadFileByIDError, + OnepasswordOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: DownloadFileByIDRequest, + output: DownloadFileByIDResponse, + errors: [NotFound, UnknownOnepasswordError], + protocol: OnepasswordProtocol, + retry: Retry.Retry, +})); + +export type GetApiActivityError = OnepasswordOpError; +/** Retrieve a list of API Requests that have been made. */ +export const getApiActivity: API.OperationMethod< + GetApiActivityRequest, + GetApiActivityResponse, + GetApiActivityError, + OnepasswordOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetApiActivityRequest, + output: GetApiActivityResponse, + errors: [UnknownOnepasswordError], + protocol: OnepasswordProtocol, + retry: Retry.Retry, +})); + +export type GetDetailsOfFileByIdError = + | Forbidden + | NotFound + | OnepasswordOpError; +/** Get the details of a File */ +export const getDetailsOfFileById: API.OperationMethod< + GetDetailsOfFileByIdRequest, + File, + GetDetailsOfFileByIdError, + OnepasswordOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetDetailsOfFileByIdRequest, + output: File, + errors: [Forbidden, NotFound, UnknownOnepasswordError], + protocol: OnepasswordProtocol, + retry: Retry.Retry, +})); + +export type GetHeartbeatError = OnepasswordOpError; +/** Ping the server for liveness */ +export const getHeartbeat: API.OperationMethod< + GetHeartbeatRequest, + GetHeartbeatResponse, + GetHeartbeatError, + OnepasswordOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetHeartbeatRequest, + output: GetHeartbeatResponse, + errors: [UnknownOnepasswordError], + protocol: OnepasswordProtocol, + retry: Retry.Retry, +})); + +export type GetItemFilesError = NotFound | OnepasswordOpError; +/** Get all the files inside an Item */ +export const getItemFiles: API.OperationMethod< + GetItemFilesRequest, + GetItemFilesResponse, + GetItemFilesError, + OnepasswordOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetItemFilesRequest, + output: GetItemFilesResponse, + errors: [NotFound, UnknownOnepasswordError], + protocol: OnepasswordProtocol, + retry: Retry.Retry, +})); + +export type GetPrometheusMetricsError = OnepasswordOpError; +/** Query server for exposed Prometheus metrics See Prometheus documentation for a complete data model. */ +export const getPrometheusMetrics: API.OperationMethod< + GetPrometheusMetricsRequest, + GetPrometheusMetricsResponse, + GetPrometheusMetricsError, + OnepasswordOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetPrometheusMetricsRequest, + output: GetPrometheusMetricsResponse, + errors: [UnknownOnepasswordError], + protocol: OnepasswordProtocol, + retry: Retry.Retry, +})); + +export type GetServerHealthError = OnepasswordOpError; +/** Get state of the server and its dependencies. */ +export const getServerHealth: API.OperationMethod< + GetServerHealthRequest, + GetServerHealthResponse, + GetServerHealthError, + OnepasswordOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetServerHealthRequest, + output: GetServerHealthResponse, + errors: [UnknownOnepasswordError], + protocol: OnepasswordProtocol, + retry: Retry.Retry, +})); + +export type GetVaultByIdError = Forbidden | NotFound | OnepasswordOpError; +/** Get Vault details and metadata */ +export const getVaultById: API.OperationMethod< + GetVaultByIdRequest, + Vault, + GetVaultByIdError, + OnepasswordOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetVaultByIdRequest, + output: Vault, + errors: [Forbidden, NotFound, UnknownOnepasswordError], + protocol: OnepasswordProtocol, + retry: Retry.Retry, +})); + +export type GetVaultItemByIdError = Forbidden | NotFound | OnepasswordOpError; +/** Get the details of an Item */ +export const getVaultItemById: API.OperationMethod< + GetVaultItemByIdRequest, + GetVaultItemByIdResponse, + GetVaultItemByIdError, + OnepasswordOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetVaultItemByIdRequest, + output: GetVaultItemByIdResponse, + errors: [Forbidden, NotFound, UnknownOnepasswordError], + protocol: OnepasswordProtocol, + retry: Retry.Retry, +})); + +export type GetVaultItemsError = NotFound | OnepasswordOpError; +/** Get all items for inside a Vault */ +export const getVaultItems: API.OperationMethod< + GetVaultItemsRequest, + GetVaultItemsResponse, + GetVaultItemsError, + OnepasswordOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetVaultItemsRequest, + output: GetVaultItemsResponse, + errors: [NotFound, UnknownOnepasswordError], + protocol: OnepasswordProtocol, + retry: Retry.Retry, +})); + +export type GetVaultsError = OnepasswordOpError; +/** Get all Vaults */ +export const getVaults: API.OperationMethod< + GetVaultsRequest, + GetVaultsResponse, + GetVaultsError, + OnepasswordOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: GetVaultsRequest, + output: GetVaultsResponse, + errors: [UnknownOnepasswordError], + protocol: OnepasswordProtocol, + retry: Retry.Retry, +})); + +export type PatchVaultItemError = Forbidden | NotFound | OnepasswordOpError; +/** Update a subset of Item attributes Applies a modified [RFC6902 JSON Patch](https://tools.ietf.org/html/rfc6902) document to an Item or ItemField. This endpoint only supports `add`, `remove` and `replace` operations. When modifying a specific ItemField, the ItemField's ID in the `path` attribute of the operation object: `/fields/{fieldId}` */ +export const patchVaultItem: API.OperationMethod< + PatchVaultItemRequest, + PatchVaultItemResponse, + PatchVaultItemError, + OnepasswordOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: PatchVaultItemRequest, + output: PatchVaultItemResponse, + errors: [Forbidden, NotFound, UnknownOnepasswordError], + protocol: OnepasswordProtocol, + retry: Retry.Retry, +})); + +export type UpdateVaultItemError = + | BadRequest + | Forbidden + | NotFound + | OnepasswordOpError; +/** Update an Item */ +export const updateVaultItem: API.OperationMethod< + UpdateVaultItemRequest, + UpdateVaultItemResponse, + UpdateVaultItemError, + OnepasswordOpContext +> = /*@__PURE__*/ API.make(() => ({ + input: UpdateVaultItemRequest, + output: UpdateVaultItemResponse, + errors: [BadRequest, Forbidden, NotFound, UnknownOnepasswordError], + protocol: OnepasswordProtocol, + retry: Retry.Retry, +})); diff --git a/packages/onepassword/src/traits.ts b/packages/onepassword/src/traits.ts new file mode 100644 index 0000000000..86eaa4c819 --- /dev/null +++ b/packages/onepassword/src/traits.ts @@ -0,0 +1,44 @@ +/** + * 1Password Connect SDK trait surface — hand-written. + * + * Re-exports the generic protocol traits from core (so generated operations + * import everything from one place). Connect has no envelope of its own; + * the REST-protocol traits (SensitiveValue / RawResponse) come from + * `core/protocol-rest`. + */ +export { + Body, + Header, + Query, + Label, + Http, + ResponseCode, + HttpBody, + FormDataFile, + KeyDictionary, + UnionCases, + applyErrorMatchers, + getErrorMatchers, + type HttpTrait, + type ErrorMatcher, + bodySymbol, + headerSymbol, + querySymbol, + labelSymbol, + httpSymbol, + responseCodeSymbol, + httpBodySymbol, + formDataFileSymbol, + keyDictionarySymbol, + unionCasesSymbol, + errorMatchersSymbol, +} from "@distilled.cloud/core/trait"; + +export { + SensitiveValue, + RawResponse, + RawResponseRoot, + sensitiveValueSymbol, + rawResponseSymbol, + rawResponseRootSymbol, +} from "@distilled.cloud/core/protocol-rest"; diff --git a/packages/onepassword/tsconfig.json b/packages/onepassword/tsconfig.json new file mode 100644 index 0000000000..56b16e575f --- /dev/null +++ b/packages/onepassword/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["src/**/*.ts"], + "compilerOptions": { + "composite": true, + "noEmit": false, + "outDir": "./lib", + "rootDir": "./src", + "paths": { + "@distilled.cloud/core/*": ["../core/src/*"] + } + }, + "references": [{ "path": "../core" }] +} diff --git a/packages/onepassword/tsconfig.scripts.json b/packages/onepassword/tsconfig.scripts.json new file mode 100644 index 0000000000..be37c34749 --- /dev/null +++ b/packages/onepassword/tsconfig.scripts.json @@ -0,0 +1,17 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["scripts/**/*.ts"], + "compilerOptions": { + "composite": true, + "noEmit": false, + "emitDeclarationOnly": true, + "outDir": "./.scripts-types", + "rootDir": "./scripts", + "tsBuildInfoFile": "./.scripts-types/tsconfig.scripts.tsbuildinfo", + // Resolve @distilled.cloud/core/* to src (the bun condition), matching + // how the scripts actually run under bun. + "rewriteRelativeImportExtensions": false, + "customConditions": ["bun"] + }, + "references": [{ "path": "../core" }] +} diff --git a/stacks/distilled-submodules/SpecRepos.ts b/stacks/distilled-submodules/SpecRepos.ts index 97e991a7bc..e87daf1601 100644 --- a/stacks/distilled-submodules/SpecRepos.ts +++ b/stacks/distilled-submodules/SpecRepos.ts @@ -65,6 +65,7 @@ export const SPEC_REPOS: readonly SpecRepo[] = [ { package: "mongodb-atlas" }, { package: "modal" }, { package: "neon" }, + { package: "onepassword" }, { package: "planetscale" }, { package: "posthog" }, { package: "prisma-postgres" }, diff --git a/stacks/distilled-submodules/spec-repos/onepassword/fetch-specs.ts b/stacks/distilled-submodules/spec-repos/onepassword/fetch-specs.ts new file mode 100644 index 0000000000..a7dd8f53eb --- /dev/null +++ b/stacks/distilled-submodules/spec-repos/onepassword/fetch-specs.ts @@ -0,0 +1,96 @@ +#!/usr/bin/env bun +/** + * Fetches the 1Password Connect OpenAPI spec and vendor docs to ../specs/. + * + * 1Password publishes the Connect REST API as OpenAPI 3.0.2 in the + * 1Password/connect repository. Vendor docs pages are snapshotted next to + * it so generate never has to crawl developer.1password.com live. + * + * Usage: + * bun run fetch-specs.ts + * + * Written to: + * ../specs/openapi.json + * ../specs/docs/*.md + */ + +const OPENAPI_SPEC_URL = + "https://raw.githubusercontent.com/1Password/connect/main/docs/openapi/spec.yaml"; +const SPECS_DIR = "../specs"; +const OUTPUT_PATH = `${SPECS_DIR}/openapi.json`; + +const DOCS: ReadonlyArray<{ url: string; output: string }> = [ + { + url: "https://www.1password.dev/connect/api-reference.md", + output: "docs/api-reference.md", + }, + { + url: "https://www.1password.dev/connect/get-started.md", + output: "docs/get-started.md", + }, + { + url: "https://www.1password.dev/connect/overview.md", + output: "docs/overview.md", + }, +]; + +import { mkdirSync } from "fs"; + +mkdirSync(SPECS_DIR, { recursive: true }); +mkdirSync(`${SPECS_DIR}/docs`, { recursive: true }); + +const headers = { + accept: "text/yaml, application/yaml, text/plain, text/markdown, */*", + "user-agent": "distilled.cloud-onepassword-spec-mirror", +}; + +async function fetchText(url: string): Promise { + const response = await fetch(url, { headers }); + if (!response.ok) { + throw new Error( + `Failed to fetch ${url}: ${response.status} ${response.statusText}`, + ); + } + return await response.text(); +} + +async function main() { + console.log(`Fetching OpenAPI spec from ${OPENAPI_SPEC_URL}...`); + + const yaml = await fetchText(OPENAPI_SPEC_URL); + const spec = Bun.YAML.parse(yaml) as Record; + + // Fail here rather than three steps later in the generator: a login page + // or a gutted response is still valid YAML, but it is not an OpenAPI + // document. + if (typeof spec.openapi !== "string" || spec.paths === undefined) { + throw new Error( + `${OPENAPI_SPEC_URL} returned YAML without \`openapi\`/\`paths\` — not an OpenAPI document`, + ); + } + + console.log(`Writing spec to ${OUTPUT_PATH}...`); + await Bun.write(OUTPUT_PATH, JSON.stringify(spec, null, 2) + "\n"); + + for (const doc of DOCS) { + console.log(`Fetching ${doc.url}...`); + const body = await fetchText(doc.url); + if (body.trim().length === 0 || /^\s*<(!DOCTYPE|html)/i.test(body)) { + throw new Error( + `${doc.url} returned an empty or HTML body — not vendor docs`, + ); + } + const outputPath = `${SPECS_DIR}/${doc.output}`; + console.log(`Writing ${outputPath}...`); + await Bun.write(outputPath, body.endsWith("\n") ? body : body + "\n"); + } + + console.log( + `Done! OpenAPI ${spec.openapi} — ${Object.keys(spec.paths as object).length} paths`, + ); +} + +main().catch((err) => { + console.error("Fatal error:", err); + process.exit(1); +}); diff --git a/stacks/distilled-submodules/spec-repos/onepassword/package.json b/stacks/distilled-submodules/spec-repos/onepassword/package.json new file mode 100644 index 0000000000..c1ef23376b --- /dev/null +++ b/stacks/distilled-submodules/spec-repos/onepassword/package.json @@ -0,0 +1,27 @@ +{ + "name": "onepassword-spec", + "private": true, + "type": "module", + "scripts": { + "fetch-specs": "bun run fetch-specs.ts", + "tsc": "tsc --noEmit", + "lint": "oxlint .", + "fmt": "oxfmt --write .", + "fmt:check": "oxfmt --check .", + "check": "bun run tsc && bun run lint && bun run fmt:check" + }, + "workspaces": { + "catalog": { + "@typescript/native-preview": "latest", + "oxfmt": "0.21.0", + "oxlint": "1.36.0" + } + }, + "dependencies": { + "@typescript/native-preview": "catalog:" + }, + "devDependencies": { + "oxfmt": "catalog:", + "oxlint": "catalog:" + } +} diff --git a/stacks/distilled-submodules/spec-repos/onepassword/readme.md b/stacks/distilled-submodules/spec-repos/onepassword/readme.md new file mode 100644 index 0000000000..e24d8ee033 --- /dev/null +++ b/stacks/distilled-submodules/spec-repos/onepassword/readme.md @@ -0,0 +1,34 @@ +# spec-mirror-onepassword + +A git mirror of the 1Password Connect [OpenAPI spec](https://github.com/1Password/connect/blob/main/docs/openapi/spec.yaml), reduced to exactly the file the +[`@distilled.cloud/onepassword`](https://github.com/alchemy-run/distilled) generator reads: + +- `specs/openapi.json` — Connect REST API (parsed from upstream YAML) +- `specs/docs/` — vendor Connect API docs snapshotted at fetch time + +Nothing else from `1Password/connect` is mirrored, so this repository stays small +enough to use as a git submodule — the upstream repository is never cloned. + +The mirror is updated every 24 hours by +[`.github/workflows/update-specs.yml`](./.github/workflows/update-specs.yml). + +## Usage as a submodule + +```sh +git submodule add https://github.com/distilled-mirror/spec-mirror-onepassword.git +``` + +## Updating specs + +From `.meta/`: + +```sh +bun install +bun run fetch-specs +``` + +--- + +This repository is managed by the `distilled-submodules` Alchemy stack in +[alchemy-run/distilled](https://github.com/alchemy-run/distilled) (`stacks/distilled-submodules`). +Its scaffolding is generated — edit it there, not here. diff --git a/tsconfig.json b/tsconfig.json index 7289e61be0..9631e21a9b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,60 +1,176 @@ { "files": [], "references": [ - { "path": "./packages/core/tsconfig.json" }, - { "path": "./packages/cloudflare/tsconfig.json" }, - { "path": "./packages/cloudflare/tsconfig.scripts.json" }, - { "path": "./packages/aws/tsconfig.json" }, - { "path": "./packages/aws/tsconfig.scripts.json" }, - { "path": "./packages/axiom/tsconfig.json" }, - { "path": "./packages/axiom/tsconfig.scripts.json" }, - { "path": "./packages/azure/tsconfig.json" }, - { "path": "./packages/azure/tsconfig.scripts.json" }, - { "path": "./packages/coinbase/tsconfig.json" }, - { "path": "./packages/coinbase/tsconfig.scripts.json" }, - { "path": "./packages/discord/tsconfig.json" }, - { "path": "./packages/discord/tsconfig.scripts.json" }, - { "path": "./packages/expo-eas/tsconfig.json" }, - { "path": "./packages/expo-eas/tsconfig.scripts.json" }, - { "path": "./packages/fly-io/tsconfig.json" }, - { "path": "./packages/fly-io/tsconfig.scripts.json" }, - { "path": "./packages/gcp/tsconfig.json" }, - { "path": "./packages/gcp/tsconfig.scripts.json" }, - { "path": "./packages/github/tsconfig.json" }, - { "path": "./packages/github/tsconfig.scripts.json" }, - { "path": "./packages/hetzner/tsconfig.json" }, - { "path": "./packages/hetzner/tsconfig.scripts.json" }, - { "path": "./packages/huggingface/tsconfig.json" }, - { "path": "./packages/huggingface/tsconfig.scripts.json" }, - { "path": "./packages/kubernetes/tsconfig.json" }, - { "path": "./packages/kubernetes/tsconfig.scripts.json" }, - { "path": "./packages/mongodb-atlas/tsconfig.json" }, - { "path": "./packages/mongodb-atlas/tsconfig.scripts.json" }, - { "path": "./packages/modal/tsconfig.json" }, - { "path": "./packages/modal/tsconfig.scripts.json" }, - { "path": "./packages/neon/tsconfig.json" }, - { "path": "./packages/neon/tsconfig.scripts.json" }, - { "path": "./packages/planetscale/tsconfig.json" }, - { "path": "./packages/planetscale/tsconfig.scripts.json" }, - { "path": "./packages/posthog/tsconfig.json" }, - { "path": "./packages/posthog/tsconfig.scripts.json" }, - { "path": "./packages/prisma-postgres/tsconfig.json" }, - { "path": "./packages/prisma-postgres/tsconfig.scripts.json" }, - { "path": "./packages/railway/tsconfig.json" }, - { "path": "./packages/railway/tsconfig.scripts.json" }, - { "path": "./packages/stripe/tsconfig.json" }, - { "path": "./packages/stripe/tsconfig.scripts.json" }, - { "path": "./packages/supabase/tsconfig.json" }, - { "path": "./packages/supabase/tsconfig.scripts.json" }, - { "path": "./packages/turso/tsconfig.json" }, - { "path": "./packages/turso/tsconfig.scripts.json" }, - { "path": "./packages/typesense/tsconfig.json" }, - { "path": "./packages/typesense/tsconfig.scripts.json" }, - { "path": "./packages/vercel/tsconfig.json" }, - { "path": "./packages/vercel/tsconfig.scripts.json" }, - { "path": "./packages/whop/tsconfig.json" }, - { "path": "./packages/whop/tsconfig.scripts.json" }, - { "path": "./packages/workos/tsconfig.json" }, - { "path": "./packages/workos/tsconfig.scripts.json" } + { + "path": "./packages/core/tsconfig.json" + }, + { + "path": "./packages/cloudflare/tsconfig.json" + }, + { + "path": "./packages/cloudflare/tsconfig.scripts.json" + }, + { + "path": "./packages/aws/tsconfig.json" + }, + { + "path": "./packages/aws/tsconfig.scripts.json" + }, + { + "path": "./packages/axiom/tsconfig.json" + }, + { + "path": "./packages/axiom/tsconfig.scripts.json" + }, + { + "path": "./packages/azure/tsconfig.json" + }, + { + "path": "./packages/azure/tsconfig.scripts.json" + }, + { + "path": "./packages/coinbase/tsconfig.json" + }, + { + "path": "./packages/coinbase/tsconfig.scripts.json" + }, + { + "path": "./packages/discord/tsconfig.json" + }, + { + "path": "./packages/discord/tsconfig.scripts.json" + }, + { + "path": "./packages/expo-eas/tsconfig.json" + }, + { + "path": "./packages/expo-eas/tsconfig.scripts.json" + }, + { + "path": "./packages/fly-io/tsconfig.json" + }, + { + "path": "./packages/fly-io/tsconfig.scripts.json" + }, + { + "path": "./packages/gcp/tsconfig.json" + }, + { + "path": "./packages/gcp/tsconfig.scripts.json" + }, + { + "path": "./packages/github/tsconfig.json" + }, + { + "path": "./packages/github/tsconfig.scripts.json" + }, + { + "path": "./packages/hetzner/tsconfig.json" + }, + { + "path": "./packages/hetzner/tsconfig.scripts.json" + }, + { + "path": "./packages/huggingface/tsconfig.json" + }, + { + "path": "./packages/huggingface/tsconfig.scripts.json" + }, + { + "path": "./packages/kubernetes/tsconfig.json" + }, + { + "path": "./packages/kubernetes/tsconfig.scripts.json" + }, + { + "path": "./packages/modal/tsconfig.json" + }, + { + "path": "./packages/modal/tsconfig.scripts.json" + }, + { + "path": "./packages/mongodb-atlas/tsconfig.json" + }, + { + "path": "./packages/mongodb-atlas/tsconfig.scripts.json" + }, + { + "path": "./packages/neon/tsconfig.json" + }, + { + "path": "./packages/neon/tsconfig.scripts.json" + }, + { + "path": "./packages/onepassword/tsconfig.json" + }, + { + "path": "./packages/onepassword/tsconfig.scripts.json" + }, + { + "path": "./packages/planetscale/tsconfig.json" + }, + { + "path": "./packages/planetscale/tsconfig.scripts.json" + }, + { + "path": "./packages/posthog/tsconfig.json" + }, + { + "path": "./packages/posthog/tsconfig.scripts.json" + }, + { + "path": "./packages/prisma-postgres/tsconfig.json" + }, + { + "path": "./packages/prisma-postgres/tsconfig.scripts.json" + }, + { + "path": "./packages/railway/tsconfig.json" + }, + { + "path": "./packages/railway/tsconfig.scripts.json" + }, + { + "path": "./packages/stripe/tsconfig.json" + }, + { + "path": "./packages/stripe/tsconfig.scripts.json" + }, + { + "path": "./packages/supabase/tsconfig.json" + }, + { + "path": "./packages/supabase/tsconfig.scripts.json" + }, + { + "path": "./packages/turso/tsconfig.json" + }, + { + "path": "./packages/turso/tsconfig.scripts.json" + }, + { + "path": "./packages/typesense/tsconfig.json" + }, + { + "path": "./packages/typesense/tsconfig.scripts.json" + }, + { + "path": "./packages/vercel/tsconfig.json" + }, + { + "path": "./packages/vercel/tsconfig.scripts.json" + }, + { + "path": "./packages/whop/tsconfig.json" + }, + { + "path": "./packages/whop/tsconfig.scripts.json" + }, + { + "path": "./packages/workos/tsconfig.json" + }, + { + "path": "./packages/workos/tsconfig.scripts.json" + } ] } From 53b1339067f30af0d548c26c8d6dc90ee947a307 Mon Sep 17 00:00:00 2001 From: "Michael K (Pear)" Date: Mon, 31 Aug 2026 04:17:27 -0400 Subject: [PATCH 2/2] build(onepassword): add workspace package to pnpm-lock.yaml --- pnpm-lock.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6a5b177f15..c5262a7d42 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -446,6 +446,25 @@ importers: specifier: catalog:tooling version: 26.4.0 + packages/onepassword: + dependencies: + '@distilled.cloud/core': + specifier: workspace:* + version: link:../core + effect: + specifier: catalog:effect + version: 4.0.0-rc.112 + devDependencies: + '@effect/platform-bun': + specifier: catalog:effect + version: 4.0.0-rc.112(effect@4.0.0-rc.112) + '@types/bun': + specifier: catalog:tooling + version: 1.4.0 + '@types/node': + specifier: catalog:tooling + version: 26.4.0 + packages/planetscale: dependencies: '@distilled.cloud/core':