From 740a3e0b2b5d42c4436ec947d96319f11153d132 Mon Sep 17 00:00:00 2001 From: Arnaud Brousseau Date: Wed, 14 Jun 2023 18:14:04 -0500 Subject: [PATCH 1/2] Sync protos from mono --- .../public/v1/public_api.fetcher.ts | 191 +++++ .../public/v1/public_api.swagger.json | 706 +++++++++++++++++- .../coordinator/public/v1/public_api.types.ts | 398 +++++++++- 3 files changed, 1261 insertions(+), 34 deletions(-) diff --git a/packages/http/src/__generated__/services/coordinator/public/v1/public_api.fetcher.ts b/packages/http/src/__generated__/services/coordinator/public/v1/public_api.fetcher.ts index e99d40ad8..9fd3579fc 100644 --- a/packages/http/src/__generated__/services/coordinator/public/v1/public_api.fetcher.ts +++ b/packages/http/src/__generated__/services/coordinator/public/v1/public_api.fetcher.ts @@ -337,6 +337,43 @@ export const postGetWhoami = (input: TPostGetWhoamiInput) => body: input.body, }); +/** + * `POST /public/v1/submit/approve_activity` + */ +type TPostApproveActivityBody = + operations["PublicApiService_ApproveActivity"]["parameters"]["body"]["body"]; + +/** + * `POST /public/v1/submit/approve_activity` + */ +export type TPostApproveActivityResponse = + operations["PublicApiService_ApproveActivity"]["responses"]["200"]["schema"]; + +/** + * `POST /public/v1/submit/approve_activity` + */ +export type TPostApproveActivityInput = { body: TPostApproveActivityBody }; + +/** + * Approve Activity + * + * Approve an Activity + * + * `POST /public/v1/submit/approve_activity` + */ +export const postApproveActivity = (input: TPostApproveActivityInput) => + request< + TPostApproveActivityResponse, + TPostApproveActivityBody, + never, + never, + never + >({ + uri: "/public/v1/submit/approve_activity", + method: "POST", + body: input.body, + }); + /** * `POST /public/v1/submit/create_api_keys` */ @@ -413,6 +450,47 @@ export const postCreateApiOnlyUsers = (input: TPostCreateApiOnlyUsersInput) => body: input.body, }); +/** + * `POST /public/v1/submit/create_authenticators` + */ +type TPostCreateAuthenticatorsBody = + operations["PublicApiService_CreateAuthenticators"]["parameters"]["body"]["body"]; + +/** + * `POST /public/v1/submit/create_authenticators` + */ +export type TPostCreateAuthenticatorsResponse = + operations["PublicApiService_CreateAuthenticators"]["responses"]["200"]["schema"]; + +/** + * `POST /public/v1/submit/create_authenticators` + */ +export type TPostCreateAuthenticatorsInput = { + body: TPostCreateAuthenticatorsBody; +}; + +/** + * Create Authenticators + * + * Create Authenticators to authenticate requests to Turnkey + * + * `POST /public/v1/submit/create_authenticators` + */ +export const postCreateAuthenticators = ( + input: TPostCreateAuthenticatorsInput +) => + request< + TPostCreateAuthenticatorsResponse, + TPostCreateAuthenticatorsBody, + never, + never, + never + >({ + uri: "/public/v1/submit/create_authenticators", + method: "POST", + body: input.body, + }); + /** * `POST /public/v1/submit/create_invitations` */ @@ -674,6 +752,43 @@ export const postDeletePolicy = (input: TPostDeletePolicyInput) => body: input.body, }); +/** + * `POST /public/v1/submit/reject_activity` + */ +type TPostRejectActivityBody = + operations["PublicApiService_RejectActivity"]["parameters"]["body"]["body"]; + +/** + * `POST /public/v1/submit/reject_activity` + */ +export type TPostRejectActivityResponse = + operations["PublicApiService_RejectActivity"]["responses"]["200"]["schema"]; + +/** + * `POST /public/v1/submit/reject_activity` + */ +export type TPostRejectActivityInput = { body: TPostRejectActivityBody }; + +/** + * Reject Activity + * + * Reject an Activity + * + * `POST /public/v1/submit/reject_activity` + */ +export const postRejectActivity = (input: TPostRejectActivityInput) => + request< + TPostRejectActivityResponse, + TPostRejectActivityBody, + never, + never, + never + >({ + uri: "/public/v1/submit/reject_activity", + method: "POST", + body: input.body, + }); + /** * `POST /public/v1/submit/sign_raw_payload` */ @@ -748,6 +863,82 @@ export const postSignTransaction = (input: TPostSignTransactionInput) => body: input.body, }); +/** + * `POST /public/v1/submit/update_private_key_tag` + */ +type TPostUpdatePrivateKeyTagBody = + operations["PublicApiService_UpdatePrivateKeyTag"]["parameters"]["body"]["body"]; + +/** + * `POST /public/v1/submit/update_private_key_tag` + */ +export type TPostUpdatePrivateKeyTagResponse = + operations["PublicApiService_UpdatePrivateKeyTag"]["responses"]["200"]["schema"]; + +/** + * `POST /public/v1/submit/update_private_key_tag` + */ +export type TPostUpdatePrivateKeyTagInput = { + body: TPostUpdatePrivateKeyTagBody; +}; + +/** + * Update Private Key Tag + * + * Update human-readable name or associated private keys. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail. + * + * `POST /public/v1/submit/update_private_key_tag` + */ +export const postUpdatePrivateKeyTag = (input: TPostUpdatePrivateKeyTagInput) => + request< + TPostUpdatePrivateKeyTagResponse, + TPostUpdatePrivateKeyTagBody, + never, + never, + never + >({ + uri: "/public/v1/submit/update_private_key_tag", + method: "POST", + body: input.body, + }); + +/** + * `POST /public/v1/submit/update_user_tag` + */ +type TPostUpdateUserTagBody = + operations["PublicApiService_UpdateUserTag"]["parameters"]["body"]["body"]; + +/** + * `POST /public/v1/submit/update_user_tag` + */ +export type TPostUpdateUserTagResponse = + operations["PublicApiService_UpdateUserTag"]["responses"]["200"]["schema"]; + +/** + * `POST /public/v1/submit/update_user_tag` + */ +export type TPostUpdateUserTagInput = { body: TPostUpdateUserTagBody }; + +/** + * Update User Tag + * + * Update human-readable name or associated users. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail. + * + * `POST /public/v1/submit/update_user_tag` + */ +export const postUpdateUserTag = (input: TPostUpdateUserTagInput) => + request< + TPostUpdateUserTagResponse, + TPostUpdateUserTagBody, + never, + never, + never + >({ + uri: "/public/v1/submit/update_user_tag", + method: "POST", + body: input.body, + }); + /** * `POST /tkhq/public/v1/query/get_private_key` * diff --git a/packages/http/src/__generated__/services/coordinator/public/v1/public_api.swagger.json b/packages/http/src/__generated__/services/coordinator/public/v1/public_api.swagger.json index 9e6a79679..a5c80ec15 100644 --- a/packages/http/src/__generated__/services/coordinator/public/v1/public_api.swagger.json +++ b/packages/http/src/__generated__/services/coordinator/public/v1/public_api.swagger.json @@ -549,6 +549,59 @@ } } }, + "/public/v1/submit/approve_activity": { + "post": { + "summary": "Approve Activity", + "description": "Approve an Activity", + "operationId": "PublicApiService_ApproveActivity", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ApproveActivityRequest" + } + } + ], + "tags": ["Activities"], + "x-readme": { + "code-samples": [ + { + "code": "turnkey request --host coordinator-beta.turnkey.io --path /public/v1/submit/approve_activity --body '{\n\t\"timestampMs\": \"'\"$(date +%s)\"'000\",\n\t\"type\": \"ACTIVITY_TYPE_APPROVE_ACTIVITY\",\n\t\"organizationId\": \"'\"$ORGANIZATION_ID\"'\",\n\t\"parameters\": {\n\t\t\"fingerprint\": \"\"\n\t}\n}'", + "install": "brew tap tkhq/tap \u0026\u0026 brew install turnkey", + "language": "curl", + "name": "Turnkey CLI" + } + ] + } + } + }, "/public/v1/submit/create_api_keys": { "post": { "summary": "Create API Keys", @@ -655,6 +708,59 @@ } } }, + "/public/v1/submit/create_authenticators": { + "post": { + "summary": "Create Authenticators", + "description": "Create Authenticators to authenticate requests to Turnkey", + "operationId": "PublicApiService_CreateAuthenticators", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateAuthenticatorsRequest" + } + } + ], + "tags": ["Authenticators"], + "x-readme": { + "code-samples": [ + { + "code": "turnkey request --host coordinator-beta.turnkey.io --path /public/v1/submit/create_authenticators --body '{\n\t\"type\": \"ACTIVITY_TYPE_CREATE_AUTHENTICATORS\",\n\t\"timestampMs\": \"'\"$(date +%s)\"'000\",\n\t\"organizationId\": \"'\"$ORGANIZATION_ID\"'\",\n\t\"parameters\": {\n\t\t\"userId\": \"\",\n\t\t\"authenticators\": [\n\t\t\t{\n\t\t\t\t\"authenticatorName\": \"\",\n\t\t\t\t\"userId\": \"\",\n\t\t\t\t\"challenge\": \"\",\n\t\t\t\t\"attestation\": {\n\t\t\t\t\t\"id\": \"\",\n\t\t\t\t\t\"type\": \"\",\n\t\t\t\t\t\"rawId\": \"\",\n\t\t\t\t\t\"authenticatorAttachment\": \"cross-\"\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t}\n}\n'", + "install": "brew tap tkhq/tap \u0026\u0026 brew install turnkey", + "language": "curl", + "name": "Turnkey CLI" + } + ] + } + } + }, "/public/v1/submit/create_invitations": { "post": { "summary": "Create Invitations", @@ -752,7 +858,7 @@ "x-readme": { "code-samples": [ { - "code": "turnkey request --host coordinator-beta.turnkey.io --path /public/v1/submit/create_policy --body '{\n\t\"timestampMs\": \"'\"$(date +%s)\"'000\",\n\t\"type\": \"ACTIVITY_TYPE_CREATE_POLICY\",\n\t\"organizationId\": \"'\"$ORGANIZATION_ID\"'\",\n\t\"parameters\": {\n\t\t\"policyName\": \"\",\n\t\t\"selectors\": [],\n\t\t\"effect\": \"\",\n\t\t\"notes\": \"\"\n\t}\n}'", + "code": "turnkey request --host coordinator-beta.turnkey.io --path /public/v1/submit/create_policy --body '{\n\t\"timestampMs\": \"'\"$(date +%s)\"'000\",\n\t\"type\": \"ACTIVITY_TYPE_CREATE_POLICY\",\n\t\"organizationId\": \"'\"$ORGANIZATION_ID\"'\",\n\t\"parameters\": {\n\t\t\"policyName\": \"\",\n\t\t\"effect\": \"\",\n\t\t\"notes\": \"\"\n\t}\n}'", "install": "brew tap tkhq/tap \u0026\u0026 brew install turnkey", "language": "curl", "name": "Turnkey CLI" @@ -1027,6 +1133,59 @@ } } }, + "/public/v1/submit/reject_activity": { + "post": { + "summary": "Reject Activity", + "description": "Reject an Activity", + "operationId": "PublicApiService_RejectActivity", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1RejectActivityRequest" + } + } + ], + "tags": ["Activities"], + "x-readme": { + "code-samples": [ + { + "code": "turnkey request --host coordinator-beta.turnkey.io --path /public/v1/submit/reject_activity --body '{\n\t\"timestampMs\": \"'\"$(date +%s)\"'000\",\n\t\"type\": \"ACTIVITY_TYPE_REJECT_ACTIVITY\",\n\t\"organizationId\": \"'\"$ORGANIZATION_ID\"'\",\n\t\"parameters\": {\n\t\t\"fingerprint\": \"\"\n\t}\n}'", + "install": "brew tap tkhq/tap \u0026\u0026 brew install turnkey", + "language": "curl", + "name": "Turnkey CLI" + } + ] + } + } + }, "/public/v1/submit/sign_raw_payload": { "post": { "summary": "Sign Raw Payload", @@ -1133,6 +1292,112 @@ } } }, + "/public/v1/submit/update_private_key_tag": { + "post": { + "summary": "Update Private Key Tag", + "description": "Update human-readable name or associated private keys. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail.", + "operationId": "PublicApiService_UpdatePrivateKeyTag", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdatePrivateKeyTagRequest" + } + } + ], + "tags": ["Private Key Tags"], + "x-readme": { + "code-samples": [ + { + "code": "turnkey request --host coordinator-beta.turnkey.io --path /public/v1/submit/private_key_tags/update --body '{\n\t\"timestampMs\": \"'\"$(date +%s)\"'000\",\n\t\"type\": \"ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG\",\n\t\"organizationId\": \"'\"$ORGANIZATION_ID\"'\",\n\t\"parameters\": {\n\t\t\"privateKeyTagId\": \"'\"$PRIVATE_KEY_TAG_ID\"'\",\n\t\t\"privateKeyTagName\": \"\",\n\t\t\"addPrivateKeyTagIds\": \"\",\n\t\t\"removePrivateKeyTagIds\": \"\"\n\t}\n}'", + "install": "brew tap tkhq/tap \u0026\u0026 brew install turnkey", + "language": "curl", + "name": "Turnkey CLI" + } + ] + } + } + }, + "/public/v1/submit/update_user_tag": { + "post": { + "summary": "Update User Tag", + "description": "Update human-readable name or associated users. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail.", + "operationId": "PublicApiService_UpdateUserTag", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdateUserTagRequest" + } + } + ], + "tags": ["User Tags"], + "x-readme": { + "code-samples": [ + { + "code": "turnkey request --host coordinator-beta.turnkey.io --path /public/v1/submit/user_tags/update --body '{\n\t\"timestampMs\": \"'\"$(date +%s)\"'000\",\n\t\"type\": \"ACTIVITY_TYPE_UPDATE_USER_TAG\",\n\t\"organizationId\": \"'\"$ORGANIZATION_ID\"'\",\n\t\"parameters\": {\n\t\t\"userTagId\": \"'\"$USER_TAG_ID\"'\",\n\t\t\"userTagName\": \"\",\n\t\t\"addUserIds\": \"\",\n\t\t\"removeUserIds\": \"\"\n\t}\n}'", + "install": "brew tap tkhq/tap \u0026\u0026 brew install turnkey", + "language": "curl", + "name": "Turnkey CLI" + } + ] + } + } + }, "/tkhq/public/v1/query/get_private_key": { "post": { "summary": "Get Private Key", @@ -1248,7 +1513,7 @@ }, "externaldatav1Curve": { "type": "string", - "enum": ["CURVE_SECP256K1"], + "enum": ["CURVE_SECP256K1", "CURVE_ED25519"], "description": "Cryptographic Curve used to generate a given Private Key." }, "externaldatav1Effect": { @@ -1307,7 +1572,7 @@ }, "immutableactivityv1Curve": { "type": "string", - "enum": ["CURVE_SECP256K1"], + "enum": ["CURVE_SECP256K1", "CURVE_ED25519"], "description": "Cryptographic Curve used to generate a given Private Key." }, "immutableactivityv1Effect": { @@ -1405,6 +1670,25 @@ }, "required": ["invitationId", "userId", "authenticator"] }, + "v1AcceptInvitationIntentV2": { + "type": "object", + "properties": { + "invitationId": { + "type": "string", + "description": "Unique identifier for a given Invitation object.", + "title": "@inject_tag: validate:\"required,uuid\"" + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User.", + "title": "@inject_tag: validate:\"required,uuid\"" + }, + "authenticator": { + "$ref": "#/definitions/v1AuthenticatorParamsV2" + } + }, + "required": ["invitationId", "userId", "authenticator"] + }, "v1AcceptInvitationResult": { "type": "object", "properties": { @@ -1556,7 +1840,13 @@ "ACTIVITY_TYPE_CREATE_POLICY_V2", "ACTIVITY_TYPE_CREATE_POLICY_V3", "ACTIVITY_TYPE_CREATE_API_ONLY_USERS", - "ACTIVITY_TYPE_UPDATE_ROOT_QUORUM" + "ACTIVITY_TYPE_UPDATE_ROOT_QUORUM", + "ACTIVITY_TYPE_UPDATE_USER_TAG", + "ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG", + "ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2", + "ACTIVITY_TYPE_CREATE_ORGANIZATION_V2", + "ACTIVITY_TYPE_CREATE_USERS_V2", + "ACTIVITY_TYPE_ACCEPT_INVITATION_V2" ], "description": "Type of Activity, such as Add User, or Sign Transaction." }, @@ -1648,6 +1938,60 @@ }, "required": ["fingerprint"] }, + "v1ApproveActivityRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_APPROVE_ACTIVITY"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1ApproveActivityIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1Attestation": { + "type": "object", + "properties": { + "credentialId": { + "type": "string", + "description": "The cbor encoded then base64 url encoded id of the credential.", + "title": "@inject_tag: validate:\"required,max=256\"" + }, + "clientDataJson": { + "type": "string", + "description": "A base64 url encoded payload containing metadata about the signing context and the challenge.", + "title": "@inject_tag: validate:\"required\"" + }, + "attestationObject": { + "type": "string", + "description": "A base64 url encoded payload containing authenticator data and any attestation the webauthn provider chooses.", + "title": "@inject_tag: validate:\"required\"" + }, + "transports": { + "type": "array", + "items": { + "$ref": "#/definitions/immutablewebauthnv1AuthenticatorTransport" + }, + "description": "The type of authenticator transports." + } + }, + "required": [ + "credentialId", + "clientDataJson", + "attestationObject", + "transports" + ] + }, "v1Authenticator": { "type": "object", "properties": { @@ -1732,9 +2076,33 @@ "x-nullable": true } }, - "required": ["clientDataJson", "attestationObject"] + "required": ["clientDataJson", "attestationObject"] + }, + "v1AuthenticatorParams": { + "type": "object", + "properties": { + "authenticatorName": { + "type": "string", + "description": "Human-readable name for an Authenticator.", + "title": "@inject_tag: validate:\"required,tk_label_length,tk_label\"" + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User.", + "title": "@inject_tag: validate:\"required,uuid\"" + }, + "attestation": { + "$ref": "#/definitions/v1PublicKeyCredentialWithAttestation" + }, + "challenge": { + "type": "string", + "description": "Challenge presented for authentication purposes.", + "title": "@inject_tag: validate:\"required,max=256\"" + } + }, + "required": ["authenticatorName", "userId", "attestation", "challenge"] }, - "v1AuthenticatorParams": { + "v1AuthenticatorParamsV2": { "type": "object", "properties": { "authenticatorName": { @@ -1742,21 +2110,16 @@ "description": "Human-readable name for an Authenticator.", "title": "@inject_tag: validate:\"required,tk_label_length,tk_label\"" }, - "userId": { - "type": "string", - "description": "Unique identifier for a given User.", - "title": "@inject_tag: validate:\"required,uuid\"" - }, - "attestation": { - "$ref": "#/definitions/v1PublicKeyCredentialWithAttestation" - }, "challenge": { "type": "string", "description": "Challenge presented for authentication purposes.", "title": "@inject_tag: validate:\"required,max=256\"" + }, + "attestation": { + "$ref": "#/definitions/v1Attestation" } }, - "required": ["authenticatorName", "userId", "attestation", "challenge"] + "required": ["authenticatorName", "challenge", "attestation"] }, "v1CreateApiKeysIntent": { "type": "object", @@ -1878,6 +2241,46 @@ }, "required": ["authenticators", "userId"] }, + "v1CreateAuthenticatorsIntentV2": { + "type": "object", + "properties": { + "authenticators": { + "type": "array", + "items": { + "$ref": "#/definitions/v1AuthenticatorParamsV2" + }, + "description": "A list of Authenticators.", + "title": "@inject_tag: validate:\"dive,required\"" + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User.", + "title": "@inject_tag: validate:\"required,uuid\"" + } + }, + "required": ["authenticators", "userId"] + }, + "v1CreateAuthenticatorsRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateAuthenticatorsIntentV2" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, "v1CreateAuthenticatorsResult": { "type": "object", "properties": { @@ -1963,6 +2366,30 @@ }, "required": ["organizationName", "rootEmail", "rootAuthenticator"] }, + "v1CreateOrganizationIntentV2": { + "type": "object", + "properties": { + "organizationName": { + "type": "string", + "description": "Human-readable name for an Organization.", + "title": "@inject_tag: validate:\"required,tk_label_length\"" + }, + "rootEmail": { + "type": "string", + "description": "The root user's email address.", + "title": "@inject_tag: validate:\"required,email,tk_email\"" + }, + "rootAuthenticator": { + "$ref": "#/definitions/v1AuthenticatorParamsV2" + }, + "rootUserId": { + "type": "string", + "description": "Unique identifier for the root user object.", + "title": "@inject_tag: validate:\"uuid\"" + } + }, + "required": ["organizationName", "rootEmail", "rootAuthenticator"] + }, "v1CreateOrganizationResult": { "type": "object", "properties": { @@ -2213,12 +2640,26 @@ }, "required": ["users"] }, + "v1CreateUsersIntentV2": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/v1UserParamsV2" + }, + "description": "A list of Users.", + "title": "@inject_tag: validate:\"required,dive,required\"" + } + }, + "required": ["users"] + }, "v1CreateUsersRequest": { "type": "object", "properties": { "type": { "type": "string", - "enum": ["ACTIVITY_TYPE_CREATE_USERS"] + "enum": ["ACTIVITY_TYPE_CREATE_USERS_V2"] }, "timestampMs": { "type": "string", @@ -2229,7 +2670,7 @@ "description": "Unique identifier for a given Organization." }, "parameters": { - "$ref": "#/definitions/v1CreateUsersIntent" + "$ref": "#/definitions/v1CreateUsersIntentV2" } }, "required": ["type", "timestampMs", "organizationId", "parameters"] @@ -2343,7 +2784,7 @@ "type": "string" }, "description": "A list of Authenticator IDs.", - "title": "@inject_tag: validate:\"required,div,required,uuid\"" + "title": "@inject_tag: validate:\"required,dive,required,uuid\"" } }, "required": ["userId", "authenticatorIds"] @@ -2617,7 +3058,7 @@ "description": "Array of Activity Statuses filtering which Activities will be listed in the response." }, "paginationOptions": { - "$ref": "#/definitions/v1PaginationOptions" + "$ref": "#/definitions/v1Pagination" } }, "required": ["organizationId"] @@ -2843,9 +3284,10 @@ "enum": [ "HASH_FUNCTION_NO_OP", "HASH_FUNCTION_SHA256", - "HASH_FUNCTION_KECCAK256" + "HASH_FUNCTION_KECCAK256", + "HASH_FUNCTION_NOT_APPLICABLE" ], - "description": " - HASH_FUNCTION_UNSPECIFIED: Default value if hash function is not set explicitly\n - HASH_FUNCTION_NO_OP: No-op function. Useful if you want to pass raw bytes to sign\n - HASH_FUNCTION_SHA256: Standard SHA-256\n - HASH_FUNCTION_KECCAK256: Keccak-256 (not the same as NIST SHA-3!).\nThis is the hash function used in the Ethereum ecosystem." + "description": " - HASH_FUNCTION_UNSPECIFIED: Default value if a hash function is not set explicitly.\n - HASH_FUNCTION_NO_OP: No-op function. Useful if you want to pass raw digests to sign (ECDSA-only)\n - HASH_FUNCTION_SHA256: Standard SHA-256. Used in the Bitcoin ecosystem.\n - HASH_FUNCTION_KECCAK256: Keccak-256 (not the same as NIST SHA-3!).\nThis is the hash function used in the Ethereum ecosystem.\n - HASH_FUNCTION_NOT_APPLICABLE: Callers must use this enum value when signing with ed25519 keys.\nThis is because, unlike ECDSA, EdDSA's API does not support signing raw digests (see RFC 8032)." }, "v1Intent": { "type": "object", @@ -2939,6 +3381,24 @@ }, "updateRootQuorumIntent": { "$ref": "#/definitions/v1UpdateRootQuorumIntent" + }, + "updateUserTagIntent": { + "$ref": "#/definitions/v1UpdateUserTagIntent" + }, + "updatePrivateKeyTagIntent": { + "$ref": "#/definitions/v1UpdatePrivateKeyTagIntent" + }, + "createAuthenticatorsIntentV2": { + "$ref": "#/definitions/v1CreateAuthenticatorsIntentV2" + }, + "acceptInvitationIntentV2": { + "$ref": "#/definitions/v1AcceptInvitationIntentV2" + }, + "createOrganizationIntentV2": { + "$ref": "#/definitions/v1CreateOrganizationIntentV2" + }, + "createUsersIntentV2": { + "$ref": "#/definitions/v1CreateUsersIntentV2" } }, "description": "Intent object crafted by Turnkey based on the user request, used to assess the permissibility of an action.", @@ -3125,7 +3585,7 @@ }, "description": "This proto definition is used in our external-facing APIs.\nIt's important to leverage annotations because they're used in our external interfaces." }, - "v1PaginationOptions": { + "v1Pagination": { "type": "object", "properties": { "limit": { @@ -3321,6 +3781,27 @@ }, "required": ["fingerprint"] }, + "v1RejectActivityRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_REJECT_ACTIVITY"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1RejectActivityIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, "v1Result": { "type": "object", "properties": { @@ -3401,6 +3882,12 @@ }, "updateRootQuorumResult": { "$ref": "#/definitions/v1UpdateRootQuorumResult" + }, + "updateUserTagResult": { + "$ref": "#/definitions/v1UpdateUserTagResult" + }, + "updatePrivateKeyTagResult": { + "$ref": "#/definitions/v1UpdatePrivateKeyTagResult" } }, "description": "Result of the intended action." @@ -3623,6 +4110,69 @@ }, "required": ["seconds", "nanos"] }, + "v1UpdatePrivateKeyTagIntent": { + "type": "object", + "properties": { + "privateKeyTagId": { + "type": "string", + "description": "Unique identifier for a given Private Key Tag.", + "title": "@inject_tag: validate:\"uuid\"" + }, + "newPrivateKeyTagName": { + "type": "string", + "description": "The new, human-readable name for the tag with the given ID.", + "title": "@inject_tag: validate:\"omitempty,tk_label,tk_label_length\"" + }, + "addPrivateKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Private Keys IDs to add this tag to.", + "title": "@inject_tag: validate:\"dive,uuid\"" + }, + "removePrivateKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Private Key IDs to remove this tag from.", + "title": "@inject_tag: validate:\"dive,uuid\"" + } + }, + "required": ["privateKeyTagId", "addPrivateKeyIds", "removePrivateKeyIds"] + }, + "v1UpdatePrivateKeyTagRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1UpdatePrivateKeyTagIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1UpdatePrivateKeyTagResult": { + "type": "object", + "properties": { + "privateKeyTagId": { + "type": "string", + "description": "Unique identifier for a given Private Key Tag." + } + }, + "required": ["privateKeyTagId"] + }, "v1UpdateRootQuorumIntent": { "type": "object", "properties": { @@ -3646,6 +4196,69 @@ "v1UpdateRootQuorumResult": { "type": "object" }, + "v1UpdateUserTagIntent": { + "type": "object", + "properties": { + "userTagId": { + "type": "string", + "description": "Unique identifier for a given User Tag.", + "title": "@inject_tag: validate:\"uuid\"" + }, + "newUserTagName": { + "type": "string", + "description": "The new, human-readable name for the tag with the given ID.", + "title": "@inject_tag: validate:\"omitempty,tk_label,tk_label_length\"" + }, + "addUserIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User IDs to add this tag to.", + "title": "@inject_tag: validate:\"dive,uuid\"" + }, + "removeUserIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User IDs to remove this tag from.", + "title": "@inject_tag: validate:\"dive,uuid\"" + } + }, + "required": ["userTagId", "addUserIds", "removeUserIds"] + }, + "v1UpdateUserTagRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_USER_TAG"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1UpdateUserTagIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1UpdateUserTagResult": { + "type": "object", + "properties": { + "userTagId": { + "type": "string", + "description": "Unique identifier for a given User Tag." + } + }, + "required": ["userTagId"] + }, "v1User": { "type": "object", "properties": { @@ -3753,6 +4366,55 @@ "userTags" ] }, + "v1UserParamsV2": { + "type": "object", + "properties": { + "userName": { + "type": "string", + "description": "Human-readable name for a User.", + "title": "@inject_tag: validate:\"required,tk_label_length,tk_label\"" + }, + "userEmail": { + "type": "string", + "description": "The user's email address.", + "title": "@inject_tag: validate:\"omitempty,email,tk_email\"" + }, + "accessType": { + "$ref": "#/definitions/immutableactivityv1AccessType" + }, + "apiKeys": { + "type": "array", + "items": { + "$ref": "#/definitions/v1ApiKeyParams" + }, + "description": "A list of API Key parameters.", + "title": "@inject_tag: validate:\"dive,uuid\"" + }, + "authenticators": { + "type": "array", + "items": { + "$ref": "#/definitions/v1AuthenticatorParamsV2" + }, + "description": "A list of Authenticator parameters.", + "title": "@inject_tag: validate:\"dive\"" + }, + "userTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User Tag IDs.", + "title": "@inject_tag: validate:\"dive,uuid\"" + } + }, + "required": [ + "userName", + "accessType", + "apiKeys", + "authenticators", + "userTags" + ] + }, "v1Vote": { "type": "object", "properties": { diff --git a/packages/http/src/__generated__/services/coordinator/public/v1/public_api.types.ts b/packages/http/src/__generated__/services/coordinator/public/v1/public_api.types.ts index bdcbe0eaa..49436412d 100644 --- a/packages/http/src/__generated__/services/coordinator/public/v1/public_api.types.ts +++ b/packages/http/src/__generated__/services/coordinator/public/v1/public_api.types.ts @@ -44,6 +44,10 @@ export type paths = { /** Get basic information about your current API user and your organization */ post: operations["PublicApiService_GetWhoami"]; }; + "/public/v1/submit/approve_activity": { + /** Approve an Activity */ + post: operations["PublicApiService_ApproveActivity"]; + }; "/public/v1/submit/create_api_keys": { /** Add api keys to an existing User */ post: operations["PublicApiService_CreateApiKeys"]; @@ -52,6 +56,10 @@ export type paths = { /** Create API-only Users in an existing Organization */ post: operations["PublicApiService_CreateApiOnlyUsers"]; }; + "/public/v1/submit/create_authenticators": { + /** Create Authenticators to authenticate requests to Turnkey */ + post: operations["PublicApiService_CreateAuthenticators"]; + }; "/public/v1/submit/create_invitations": { /** Create Invitations to join an existing Organization */ post: operations["PublicApiService_CreateInvitations"]; @@ -80,6 +88,10 @@ export type paths = { /** Delete an existing Policy */ post: operations["PublicApiService_DeletePolicy"]; }; + "/public/v1/submit/reject_activity": { + /** Reject an Activity */ + post: operations["PublicApiService_RejectActivity"]; + }; "/public/v1/submit/sign_raw_payload": { /** Sign a raw payload with a Private Key */ post: operations["PublicApiService_SignRawPayload"]; @@ -88,6 +100,14 @@ export type paths = { /** Sign a transaction with a Private Key */ post: operations["PublicApiService_SignTransaction"]; }; + "/public/v1/submit/update_private_key_tag": { + /** Update human-readable name or associated private keys. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail. */ + post: operations["PublicApiService_UpdatePrivateKeyTag"]; + }; + "/public/v1/submit/update_user_tag": { + /** Update human-readable name or associated users. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail. */ + post: operations["PublicApiService_UpdateUserTag"]; + }; "/tkhq/public/v1/query/get_private_key": { /** Get details about a Private Key */ post: operations["PublicApiService_GetPrivateKeyBackwardsCompat"]; @@ -134,7 +154,7 @@ export type definitions = { * @description Cryptographic Curve used to generate a given Private Key. * @enum {string} */ - externaldatav1Curve: "CURVE_SECP256K1"; + externaldatav1Curve: "CURVE_SECP256K1" | "CURVE_ED25519"; /** @enum {string} */ externaldatav1Effect: "EFFECT_ALLOW" | "EFFECT_DENY"; /** @@ -179,7 +199,7 @@ export type definitions = { * @description Cryptographic Curve used to generate a given Private Key. * @enum {string} */ - immutableactivityv1Curve: "CURVE_SECP256K1"; + immutableactivityv1Curve: "CURVE_SECP256K1" | "CURVE_ED25519"; /** @enum {string} */ immutableactivityv1Effect: "EFFECT_ALLOW" | "EFFECT_DENY"; /** @enum {string} */ @@ -234,6 +254,19 @@ export type definitions = { userId: string; authenticator: definitions["v1AuthenticatorParams"]; }; + v1AcceptInvitationIntentV2: { + /** + * @inject_tag: validate:"required,uuid" + * @description Unique identifier for a given Invitation object. + */ + invitationId: string; + /** + * @inject_tag: validate:"required,uuid" + * @description Unique identifier for a given User. + */ + userId: string; + authenticator: definitions["v1AuthenticatorParamsV2"]; + }; v1AcceptInvitationResult: { /** @description Unique identifier for a given Invitation. */ invitationId: string; @@ -318,7 +351,13 @@ export type definitions = { | "ACTIVITY_TYPE_CREATE_POLICY_V2" | "ACTIVITY_TYPE_CREATE_POLICY_V3" | "ACTIVITY_TYPE_CREATE_API_ONLY_USERS" - | "ACTIVITY_TYPE_UPDATE_ROOT_QUORUM"; + | "ACTIVITY_TYPE_UPDATE_ROOT_QUORUM" + | "ACTIVITY_TYPE_UPDATE_USER_TAG" + | "ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG" + | "ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2" + | "ACTIVITY_TYPE_CREATE_ORGANIZATION_V2" + | "ACTIVITY_TYPE_CREATE_USERS_V2" + | "ACTIVITY_TYPE_ACCEPT_INVITATION_V2"; v1ApiKey: { credential: definitions["v1Credential"]; /** @description Unique identifier for a given API Key. */ @@ -369,6 +408,34 @@ export type definitions = { */ fingerprint: string; }; + v1ApproveActivityRequest: { + /** @enum {string} */ + type: "ACTIVITY_TYPE_APPROVE_ACTIVITY"; + /** @description Timestamp (in milliseconds) of the request, used to verify liveness of user requests. */ + timestampMs: string; + /** @description Unique identifier for a given Organization. */ + organizationId: string; + parameters: definitions["v1ApproveActivityIntent"]; + }; + v1Attestation: { + /** + * @inject_tag: validate:"required,max=256" + * @description The cbor encoded then base64 url encoded id of the credential. + */ + credentialId: string; + /** + * @inject_tag: validate:"required" + * @description A base64 url encoded payload containing metadata about the signing context and the challenge. + */ + clientDataJson: string; + /** + * @inject_tag: validate:"required" + * @description A base64 url encoded payload containing authenticator data and any attestation the webauthn provider chooses. + */ + attestationObject: string; + /** @description The type of authenticator transports. */ + transports: definitions["immutablewebauthnv1AuthenticatorTransport"][]; + }; v1Authenticator: { /** @description Types of transports that may be used by an Authenticator (e.g., USB, NFC, BLE). */ transports: definitions["externaldatav1AuthenticatorTransport"][]; @@ -416,6 +483,19 @@ export type definitions = { */ challenge: string; }; + v1AuthenticatorParamsV2: { + /** + * @inject_tag: validate:"required,tk_label_length,tk_label" + * @description Human-readable name for an Authenticator. + */ + authenticatorName: string; + /** + * @inject_tag: validate:"required,max=256" + * @description Challenge presented for authentication purposes. + */ + challenge: string; + attestation: definitions["v1Attestation"]; + }; v1CreateApiKeysIntent: { /** * @inject_tag: validate:"dive,required" @@ -473,6 +553,27 @@ export type definitions = { */ userId: string; }; + v1CreateAuthenticatorsIntentV2: { + /** + * @inject_tag: validate:"dive,required" + * @description A list of Authenticators. + */ + authenticators: definitions["v1AuthenticatorParamsV2"][]; + /** + * @inject_tag: validate:"required,uuid" + * @description Unique identifier for a given User. + */ + userId: string; + }; + v1CreateAuthenticatorsRequest: { + /** @enum {string} */ + type: "ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2"; + /** @description Timestamp (in milliseconds) of the request, used to verify liveness of user requests. */ + timestampMs: string; + /** @description Unique identifier for a given Organization. */ + organizationId: string; + parameters: definitions["v1CreateAuthenticatorsIntentV2"]; + }; v1CreateAuthenticatorsResult: { /** @description A list of Authenticator IDs. */ authenticatorIds: string[]; @@ -515,6 +616,24 @@ export type definitions = { */ rootUserId?: string; }; + v1CreateOrganizationIntentV2: { + /** + * @inject_tag: validate:"required,tk_label_length" + * @description Human-readable name for an Organization. + */ + organizationName: string; + /** + * @inject_tag: validate:"required,email,tk_email" + * @description The root user's email address. + */ + rootEmail: string; + rootAuthenticator: definitions["v1AuthenticatorParamsV2"]; + /** + * @inject_tag: validate:"uuid" + * @description Unique identifier for the root user object. + */ + rootUserId?: string; + }; v1CreateOrganizationResult: { /** @description Unique identifier for a given Organization. */ organizationId: string; @@ -636,14 +755,21 @@ export type definitions = { */ users: definitions["v1UserParams"][]; }; + v1CreateUsersIntentV2: { + /** + * @inject_tag: validate:"required,dive,required" + * @description A list of Users. + */ + users: definitions["v1UserParamsV2"][]; + }; v1CreateUsersRequest: { /** @enum {string} */ - type: "ACTIVITY_TYPE_CREATE_USERS"; + type: "ACTIVITY_TYPE_CREATE_USERS_V2"; /** @description Timestamp (in milliseconds) of the request, used to verify liveness of user requests. */ timestampMs: string; /** @description Unique identifier for a given Organization. */ organizationId: string; - parameters: definitions["v1CreateUsersIntent"]; + parameters: definitions["v1CreateUsersIntentV2"]; }; v1CreateUsersResult: { /** @description A list of User IDs. */ @@ -693,7 +819,7 @@ export type definitions = { */ userId: string; /** - * @inject_tag: validate:"required,div,required,uuid" + * @inject_tag: validate:"required,dive,required,uuid" * @description A list of Authenticator IDs. */ authenticatorIds: string[]; @@ -814,7 +940,7 @@ export type definitions = { organizationId: string; /** @description Array of Activity Statuses filtering which Activities will be listed in the response. */ filterByStatus?: definitions["v1ActivityStatus"][]; - paginationOptions?: definitions["v1PaginationOptions"]; + paginationOptions?: definitions["v1Pagination"]; }; v1GetActivitiesResponse: { /** @description A list of Activities. */ @@ -899,17 +1025,20 @@ export type definitions = { username: string; }; /** - * @description - HASH_FUNCTION_UNSPECIFIED: Default value if hash function is not set explicitly - * - HASH_FUNCTION_NO_OP: No-op function. Useful if you want to pass raw bytes to sign - * - HASH_FUNCTION_SHA256: Standard SHA-256 + * @description - HASH_FUNCTION_UNSPECIFIED: Default value if a hash function is not set explicitly. + * - HASH_FUNCTION_NO_OP: No-op function. Useful if you want to pass raw digests to sign (ECDSA-only) + * - HASH_FUNCTION_SHA256: Standard SHA-256. Used in the Bitcoin ecosystem. * - HASH_FUNCTION_KECCAK256: Keccak-256 (not the same as NIST SHA-3!). * This is the hash function used in the Ethereum ecosystem. + * - HASH_FUNCTION_NOT_APPLICABLE: Callers must use this enum value when signing with ed25519 keys. + * This is because, unlike ECDSA, EdDSA's API does not support signing raw digests (see RFC 8032). * @enum {string} */ v1HashFunction: | "HASH_FUNCTION_NO_OP" | "HASH_FUNCTION_SHA256" - | "HASH_FUNCTION_KECCAK256"; + | "HASH_FUNCTION_KECCAK256" + | "HASH_FUNCTION_NOT_APPLICABLE"; /** @description Intent object crafted by Turnkey based on the user request, used to assess the permissibility of an action. */ v1Intent: { createOrganizationIntent: definitions["v1CreateOrganizationIntent"]; @@ -942,6 +1071,12 @@ export type definitions = { createPolicyIntentV3?: definitions["v1CreatePolicyIntentV3"]; createApiOnlyUsersIntent?: definitions["v1CreateApiOnlyUsersIntent"]; updateRootQuorumIntent?: definitions["v1UpdateRootQuorumIntent"]; + updateUserTagIntent?: definitions["v1UpdateUserTagIntent"]; + updatePrivateKeyTagIntent?: definitions["v1UpdatePrivateKeyTagIntent"]; + createAuthenticatorsIntentV2?: definitions["v1CreateAuthenticatorsIntentV2"]; + acceptInvitationIntentV2?: definitions["v1AcceptInvitationIntentV2"]; + createOrganizationIntentV2?: definitions["v1CreateOrganizationIntentV2"]; + createUsersIntentV2?: definitions["v1CreateUsersIntentV2"]; }; v1Invitation: { /** @description Unique identifier for a given Invitation object. */ @@ -1007,7 +1142,7 @@ export type definitions = { deletedAuthenticators?: definitions["v1Authenticator"][]; deletedTags?: definitions["datav1Tag"][]; }; - v1PaginationOptions: { + v1Pagination: { /** * Format: int32 * @description A limit of the number of object to be returned, between 1 and 100. Defaults to 10 if omitted or set to 0. @@ -1100,6 +1235,15 @@ export type definitions = { */ fingerprint: string; }; + v1RejectActivityRequest: { + /** @enum {string} */ + type: "ACTIVITY_TYPE_REJECT_ACTIVITY"; + /** @description Timestamp (in milliseconds) of the request, used to verify liveness of user requests. */ + timestampMs: string; + /** @description Unique identifier for a given Organization. */ + organizationId: string; + parameters: definitions["v1RejectActivityIntent"]; + }; /** @description Result of the intended action. */ v1Result: { createOrganizationResult?: definitions["v1CreateOrganizationResult"]; @@ -1128,6 +1272,8 @@ export type definitions = { deletePaymentMethodResult?: definitions["v1DeletePaymentMethodResult"]; createApiOnlyUsersResult?: definitions["v1CreateApiOnlyUsersResult"]; updateRootQuorumResult?: definitions["v1UpdateRootQuorumResult"]; + updateUserTagResult?: definitions["v1UpdateUserTagResult"]; + updatePrivateKeyTagResult?: definitions["v1UpdatePrivateKeyTagResult"]; }; v1SelectorV2: { subject?: string; @@ -1241,6 +1387,41 @@ export type definitions = { seconds: string; nanos: string; }; + v1UpdatePrivateKeyTagIntent: { + /** + * @inject_tag: validate:"uuid" + * @description Unique identifier for a given Private Key Tag. + */ + privateKeyTagId: string; + /** + * @inject_tag: validate:"omitempty,tk_label,tk_label_length" + * @description The new, human-readable name for the tag with the given ID. + */ + newPrivateKeyTagName?: string; + /** + * @inject_tag: validate:"dive,uuid" + * @description A list of Private Keys IDs to add this tag to. + */ + addPrivateKeyIds: string[]; + /** + * @inject_tag: validate:"dive,uuid" + * @description A list of Private Key IDs to remove this tag from. + */ + removePrivateKeyIds: string[]; + }; + v1UpdatePrivateKeyTagRequest: { + /** @enum {string} */ + type: "ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG"; + /** @description Timestamp (in milliseconds) of the request, used to verify liveness of user requests. */ + timestampMs: string; + /** @description Unique identifier for a given Organization. */ + organizationId: string; + parameters: definitions["v1UpdatePrivateKeyTagIntent"]; + }; + v1UpdatePrivateKeyTagResult: { + /** @description Unique identifier for a given Private Key Tag. */ + privateKeyTagId: string; + }; v1UpdateRootQuorumIntent: { /** * @inject_tag: validate:"required" @@ -1255,6 +1436,41 @@ export type definitions = { userIds: string[]; }; v1UpdateRootQuorumResult: { [key: string]: unknown }; + v1UpdateUserTagIntent: { + /** + * @inject_tag: validate:"uuid" + * @description Unique identifier for a given User Tag. + */ + userTagId: string; + /** + * @inject_tag: validate:"omitempty,tk_label,tk_label_length" + * @description The new, human-readable name for the tag with the given ID. + */ + newUserTagName?: string; + /** + * @inject_tag: validate:"dive,uuid" + * @description A list of User IDs to add this tag to. + */ + addUserIds: string[]; + /** + * @inject_tag: validate:"dive,uuid" + * @description A list of User IDs to remove this tag from. + */ + removeUserIds: string[]; + }; + v1UpdateUserTagRequest: { + /** @enum {string} */ + type: "ACTIVITY_TYPE_UPDATE_USER_TAG"; + /** @description Timestamp (in milliseconds) of the request, used to verify liveness of user requests. */ + timestampMs: string; + /** @description Unique identifier for a given Organization. */ + organizationId: string; + parameters: definitions["v1UpdateUserTagIntent"]; + }; + v1UpdateUserTagResult: { + /** @description Unique identifier for a given User Tag. */ + userTagId: string; + }; v1User: { /** @description Unique identifier for a given User. */ userId: string; @@ -1303,6 +1519,34 @@ export type definitions = { */ userTags: string[]; }; + v1UserParamsV2: { + /** + * @inject_tag: validate:"required,tk_label_length,tk_label" + * @description Human-readable name for a User. + */ + userName: string; + /** + * @inject_tag: validate:"omitempty,email,tk_email" + * @description The user's email address. + */ + userEmail?: string; + accessType: definitions["immutableactivityv1AccessType"]; + /** + * @inject_tag: validate:"dive,uuid" + * @description A list of API Key parameters. + */ + apiKeys: definitions["v1ApiKeyParams"][]; + /** + * @inject_tag: validate:"dive" + * @description A list of Authenticator parameters. + */ + authenticators: definitions["v1AuthenticatorParamsV2"][]; + /** + * @inject_tag: validate:"dive,uuid" + * @description A list of User Tag IDs. + */ + userTags: string[]; + }; /** @description Object representing a particular User's approval or rejection of a Consensus request, including all relevant metadata. */ v1Vote: { /** @description Unique identifier for a given Vote object. */ @@ -1587,6 +1831,32 @@ export type operations = { }; }; }; + /** Approve an Activity */ + PublicApiService_ApproveActivity: { + parameters: { + body: { + body: definitions["v1ApproveActivityRequest"]; + }; + }; + responses: { + /** A successful response. */ + 200: { + schema: definitions["v1ActivityResponse"]; + }; + /** Returned when the user does not have permission to access the resource. */ + 403: { + schema: unknown; + }; + /** Returned when the resource does not exist. */ + 404: { + schema: string; + }; + /** An unexpected error response. */ + default: { + schema: definitions["rpcStatus"]; + }; + }; + }; /** Add api keys to an existing User */ PublicApiService_CreateApiKeys: { parameters: { @@ -1639,6 +1909,32 @@ export type operations = { }; }; }; + /** Create Authenticators to authenticate requests to Turnkey */ + PublicApiService_CreateAuthenticators: { + parameters: { + body: { + body: definitions["v1CreateAuthenticatorsRequest"]; + }; + }; + responses: { + /** A successful response. */ + 200: { + schema: definitions["v1ActivityResponse"]; + }; + /** Returned when the user does not have permission to access the resource. */ + 403: { + schema: unknown; + }; + /** Returned when the resource does not exist. */ + 404: { + schema: string; + }; + /** An unexpected error response. */ + default: { + schema: definitions["rpcStatus"]; + }; + }; + }; /** Create Invitations to join an existing Organization */ PublicApiService_CreateInvitations: { parameters: { @@ -1821,6 +2117,32 @@ export type operations = { }; }; }; + /** Reject an Activity */ + PublicApiService_RejectActivity: { + parameters: { + body: { + body: definitions["v1RejectActivityRequest"]; + }; + }; + responses: { + /** A successful response. */ + 200: { + schema: definitions["v1ActivityResponse"]; + }; + /** Returned when the user does not have permission to access the resource. */ + 403: { + schema: unknown; + }; + /** Returned when the resource does not exist. */ + 404: { + schema: string; + }; + /** An unexpected error response. */ + default: { + schema: definitions["rpcStatus"]; + }; + }; + }; /** Sign a raw payload with a Private Key */ PublicApiService_SignRawPayload: { parameters: { @@ -1873,6 +2195,58 @@ export type operations = { }; }; }; + /** Update human-readable name or associated private keys. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail. */ + PublicApiService_UpdatePrivateKeyTag: { + parameters: { + body: { + body: definitions["v1UpdatePrivateKeyTagRequest"]; + }; + }; + responses: { + /** A successful response. */ + 200: { + schema: definitions["v1ActivityResponse"]; + }; + /** Returned when the user does not have permission to access the resource. */ + 403: { + schema: unknown; + }; + /** Returned when the resource does not exist. */ + 404: { + schema: string; + }; + /** An unexpected error response. */ + default: { + schema: definitions["rpcStatus"]; + }; + }; + }; + /** Update human-readable name or associated users. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail. */ + PublicApiService_UpdateUserTag: { + parameters: { + body: { + body: definitions["v1UpdateUserTagRequest"]; + }; + }; + responses: { + /** A successful response. */ + 200: { + schema: definitions["v1ActivityResponse"]; + }; + /** Returned when the user does not have permission to access the resource. */ + 403: { + schema: unknown; + }; + /** Returned when the resource does not exist. */ + 404: { + schema: string; + }; + /** An unexpected error response. */ + default: { + schema: definitions["rpcStatus"]; + }; + }; + }; /** Get details about a Private Key */ PublicApiService_GetPrivateKeyBackwardsCompat: { parameters: { From f1de50c88efef22b96aca1c905ab6472b1f7cf55 Mon Sep 17 00:00:00 2001 From: Arnaud Brousseau Date: Wed, 14 Jun 2023 18:14:12 -0500 Subject: [PATCH 2/2] Add changeset --- .changeset/2023-06-14-sync-protos.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changeset/2023-06-14-sync-protos.md diff --git a/.changeset/2023-06-14-sync-protos.md b/.changeset/2023-06-14-sync-protos.md new file mode 100644 index 000000000..5d3c60e92 --- /dev/null +++ b/.changeset/2023-06-14-sync-protos.md @@ -0,0 +1,7 @@ +--- +"@turnkey/http": minor +"@turnkey/cosmjs": minor +"@turnkey/ethers": minor +--- + +Sync SDK with latest protos