From 538d4fcf3afc1c24e043b12239841bb006d438e9 Mon Sep 17 00:00:00 2001 From: Mohammad Cheikh Date: Thu, 12 Dec 2024 10:42:35 -0500 Subject: [PATCH] update api endpoints --- .changeset/shiny-coats-scream.md | 7 ++ .../public/v1/public_api.client.ts | 36 +++++++ .../public/v1/public_api.fetcher.ts | 52 ++++++++++ .../public/v1/public_api.swagger.json | 89 +++++++++++++++++- .../coordinator/public/v1/public_api.types.ts | 49 +++++++++- .../src/__generated__/sdk-client-base.ts | 26 +++++ .../src/__generated__/sdk_api_types.ts | 11 +++ .../src/__inputs__/public_api.swagger.json | 94 ++++++++++++++++++- .../src/__inputs__/public_api.types.ts | 51 +++++++++- .../src/__generated__/sdk-client-base.ts | 26 +++++ .../src/__generated__/sdk_api_types.ts | 11 +++ .../src/__inputs__/public_api.swagger.json | 89 +++++++++++++++++- .../src/__inputs__/public_api.types.ts | 49 +++++++++- 13 files changed, 578 insertions(+), 12 deletions(-) create mode 100644 .changeset/shiny-coats-scream.md diff --git a/.changeset/shiny-coats-scream.md b/.changeset/shiny-coats-scream.md new file mode 100644 index 000000000..d21a4e4de --- /dev/null +++ b/.changeset/shiny-coats-scream.md @@ -0,0 +1,7 @@ +--- +"@turnkey/sdk-browser": patch +"@turnkey/sdk-server": patch +"@turnkey/http": patch +--- + +Update api endpoints - NEW: User verification, SMS customization params diff --git a/packages/http/src/__generated__/services/coordinator/public/v1/public_api.client.ts b/packages/http/src/__generated__/services/coordinator/public/v1/public_api.client.ts index f57e3ae9f..bb52d2d09 100644 --- a/packages/http/src/__generated__/services/coordinator/public/v1/public_api.client.ts +++ b/packages/http/src/__generated__/services/coordinator/public/v1/public_api.client.ts @@ -74,6 +74,10 @@ import type { TListUserTagsResponse, } from "./public_api.fetcher"; import type { TGetUsersBody, TGetUsersResponse } from "./public_api.fetcher"; +import type { + TGetVerifiedSubOrgIdsBody, + TGetVerifiedSubOrgIdsResponse, +} from "./public_api.fetcher"; import type { TGetWalletAccountsBody, TGetWalletAccountsResponse, @@ -927,6 +931,38 @@ export class TurnkeyClient { }; }; + /** + * Get all email or phone verified suborg IDs associated given a parent org ID. + * + * Sign the provided `TGetVerifiedSubOrgIdsBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/list_verified_suborgs). + * + * See also {@link stampGetVerifiedSubOrgIds}. + */ + getVerifiedSubOrgIds = async ( + input: TGetVerifiedSubOrgIdsBody + ): Promise => { + return this.request("/public/v1/query/list_verified_suborgs", input); + }; + + /** + * Produce a `SignedRequest` from `TGetVerifiedSubOrgIdsBody` by using the client's `stamp` function. + * + * See also {@link GetVerifiedSubOrgIds}. + */ + stampGetVerifiedSubOrgIds = async ( + input: TGetVerifiedSubOrgIdsBody + ): Promise => { + const fullUrl = + this.config.baseUrl + "/public/v1/query/list_verified_suborgs"; + const body = JSON.stringify(input); + const stamp = await this.stamper.stamp(body); + return { + body: body, + stamp: stamp, + url: fullUrl, + }; + }; + /** * List all Accounts wirhin a Wallet * 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 09d3e3804..3c156463b 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 @@ -967,6 +967,58 @@ export const signGetUsers = ( options, }); +/** + * `POST /public/v1/query/list_verified_suborgs` + */ +export type TGetVerifiedSubOrgIdsResponse = + operations["PublicApiService_GetVerifiedSubOrgIds"]["responses"]["200"]["schema"]; + +/** + * `POST /public/v1/query/list_verified_suborgs` + */ +export type TGetVerifiedSubOrgIdsInput = { body: TGetVerifiedSubOrgIdsBody }; + +/** + * `POST /public/v1/query/list_verified_suborgs` + */ +export type TGetVerifiedSubOrgIdsBody = + operations["PublicApiService_GetVerifiedSubOrgIds"]["parameters"]["body"]["body"]; + +/** + * Get Verified Suborgs + * + * Get all email or phone verified suborg IDs associated given a parent org ID. + * + * `POST /public/v1/query/list_verified_suborgs` + */ +export const getVerifiedSubOrgIds = (input: TGetVerifiedSubOrgIdsInput) => + request< + TGetVerifiedSubOrgIdsResponse, + TGetVerifiedSubOrgIdsBody, + never, + never, + never + >({ + uri: "/public/v1/query/list_verified_suborgs", + method: "POST", + body: input.body, + }); + +/** + * Request a WebAuthn assertion and return a signed `GetVerifiedSubOrgIds` request, ready to be POSTed to Turnkey. + * + * See {@link GetVerifiedSubOrgIds} + */ +export const signGetVerifiedSubOrgIds = ( + input: TGetVerifiedSubOrgIdsInput, + options?: TurnkeyCredentialRequestOptions +) => + signedRequest({ + uri: "/public/v1/query/list_verified_suborgs", + body: input.body, + options, + }); + /** * `POST /public/v1/query/list_wallet_accounts` */ 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 de05730ee..6e83430da 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 @@ -708,6 +708,38 @@ "tags": ["Users"] } }, + "/public/v1/query/list_verified_suborgs": { + "post": { + "summary": "Get Verified Suborgs", + "description": "Get all email or phone verified suborg IDs associated given a parent org ID.", + "operationId": "PublicApiService_GetVerifiedSubOrgIds", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetVerifiedSubOrgIdsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetVerifiedSubOrgIdsRequest" + } + } + ], + "tags": ["Organizations"] + } + }, "/public/v1/query/list_wallet_accounts": { "post": { "summary": "List Wallets Accounts", @@ -3003,7 +3035,8 @@ "ADDRESS_FORMAT_DOGE_MAINNET", "ADDRESS_FORMAT_DOGE_TESTNET", "ADDRESS_FORMAT_TON_V3R2", - "ADDRESS_FORMAT_TON_V4R2" + "ADDRESS_FORMAT_TON_V4R2", + "ADDRESS_FORMAT_XRP" ] }, "v1ApiKey": { @@ -5968,7 +6001,7 @@ }, "filterType": { "type": "string", - "description": "Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'OIDC_TOKEN' or 'PUBLIC_KEY'" + "description": "Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN' or 'PUBLIC_KEY'" }, "filterValue": { "type": "string", @@ -6042,6 +6075,41 @@ }, "required": ["users"] }, + "v1GetVerifiedSubOrgIdsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for the parent Organization. This is used to find sub-organizations within it." + }, + "filterType": { + "type": "string", + "description": "Specifies the type of filter to apply, i.e 'EMAIL', 'PHONE_NUMBER'" + }, + "filterValue": { + "type": "string", + "description": "The value of the filter to apply for the specified type. For example, a specific email or phone number string." + }, + "paginationOptions": { + "$ref": "#/definitions/v1Pagination", + "description": "Parameters used for cursor-based pagination." + } + }, + "required": ["organizationId"] + }, + "v1GetVerifiedSubOrgIdsResponse": { + "type": "object", + "properties": { + "organizationIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of unique identifiers for the matching sub-organizations." + } + }, + "required": ["organizationIds"] + }, "v1GetWalletAccountsRequest": { "type": "object", "properties": { @@ -6397,6 +6465,14 @@ "emailCustomization": { "$ref": "#/definitions/v1EmailCustomizationParams", "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "smsCustomization": { + "$ref": "#/definitions/v1SmsCustomizationParams", + "description": "Optional parameters for customizing SMS message. If not provided, the default sms message will be used." + }, + "userIdentifier": { + "type": "string", + "description": "Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address." } }, "required": ["otpType", "contact"] @@ -8135,6 +8211,15 @@ } } }, + "v1SmsCustomizationParams": { + "type": "object", + "properties": { + "template": { + "type": "string", + "description": "Template containing references to .OtpCode i.e Your OTP is {{.OtpCode}}" + } + } + }, "v1TagType": { "type": "string", "enum": ["TAG_TYPE_USER", "TAG_TYPE_PRIVATE_KEY"] 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 304c25c07..4a9ba03b3 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 @@ -84,6 +84,10 @@ export type paths = { /** List all Users within an Organization */ post: operations["PublicApiService_GetUsers"]; }; + "/public/v1/query/list_verified_suborgs": { + /** Get all email or phone verified suborg IDs associated given a parent org ID. */ + post: operations["PublicApiService_GetVerifiedSubOrgIds"]; + }; "/public/v1/query/list_wallet_accounts": { /** List all Accounts wirhin a Wallet */ post: operations["PublicApiService_GetWalletAccounts"]; @@ -584,7 +588,8 @@ export type definitions = { | "ADDRESS_FORMAT_DOGE_MAINNET" | "ADDRESS_FORMAT_DOGE_TESTNET" | "ADDRESS_FORMAT_TON_V3R2" - | "ADDRESS_FORMAT_TON_V4R2"; + | "ADDRESS_FORMAT_TON_V4R2" + | "ADDRESS_FORMAT_XRP"; v1ApiKey: { /** @description A User credential that can be used to authenticate to Turnkey. */ credential: definitions["externaldatav1Credential"]; @@ -1750,7 +1755,7 @@ export type definitions = { v1GetSubOrgIdsRequest: { /** @description Unique identifier for the parent Organization. This is used to find sub-organizations within it. */ organizationId: string; - /** @description Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'OIDC_TOKEN' or 'PUBLIC_KEY' */ + /** @description Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN' or 'PUBLIC_KEY' */ filterType?: string; /** @description The value of the filter to apply for the specified type. For example, a specific email or name string. */ filterValue?: string; @@ -1779,6 +1784,20 @@ export type definitions = { /** @description A list of Users. */ users: definitions["v1User"][]; }; + v1GetVerifiedSubOrgIdsRequest: { + /** @description Unique identifier for the parent Organization. This is used to find sub-organizations within it. */ + organizationId: string; + /** @description Specifies the type of filter to apply, i.e 'EMAIL', 'PHONE_NUMBER' */ + filterType?: string; + /** @description The value of the filter to apply for the specified type. For example, a specific email or phone number string. */ + filterValue?: string; + /** @description Parameters used for cursor-based pagination. */ + paginationOptions?: definitions["v1Pagination"]; + }; + v1GetVerifiedSubOrgIdsResponse: { + /** @description List of unique identifiers for the matching sub-organizations. */ + organizationIds: string[]; + }; v1GetWalletAccountsRequest: { /** @description Unique identifier for a given Organization. */ organizationId: string; @@ -1922,6 +1941,10 @@ export type definitions = { contact: string; /** @description Optional parameters for customizing emails. If not provided, the default email will be used. */ emailCustomization?: definitions["v1EmailCustomizationParams"]; + /** @description Optional parameters for customizing SMS message. If not provided, the default sms message will be used. */ + smsCustomization?: definitions["v1SmsCustomizationParams"]; + /** @description Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address. */ + userIdentifier?: string; }; v1InitOtpAuthRequest: { /** @enum {string} */ @@ -2565,6 +2588,10 @@ export type definitions = { appidExclude?: boolean; credProps?: definitions["v1CredPropsAuthenticationExtensionsClientOutputs"]; }; + v1SmsCustomizationParams: { + /** @description Template containing references to .OtpCode i.e Your OTP is {{.OtpCode}} */ + template?: string; + }; /** @enum {string} */ v1TagType: "TAG_TYPE_USER" | "TAG_TYPE_PRIVATE_KEY"; /** @enum {string} */ @@ -3189,6 +3216,24 @@ export type operations = { }; }; }; + /** Get all email or phone verified suborg IDs associated given a parent org ID. */ + PublicApiService_GetVerifiedSubOrgIds: { + parameters: { + body: { + body: definitions["v1GetVerifiedSubOrgIdsRequest"]; + }; + }; + responses: { + /** A successful response. */ + 200: { + schema: definitions["v1GetVerifiedSubOrgIdsResponse"]; + }; + /** An unexpected error response. */ + default: { + schema: definitions["rpcStatus"]; + }; + }; + }; /** List all Accounts wirhin a Wallet */ PublicApiService_GetWalletAccounts: { parameters: { diff --git a/packages/sdk-browser/src/__generated__/sdk-client-base.ts b/packages/sdk-browser/src/__generated__/sdk-client-base.ts index 6ac33571e..ec9d9a2f6 100644 --- a/packages/sdk-browser/src/__generated__/sdk-client-base.ts +++ b/packages/sdk-browser/src/__generated__/sdk-client-base.ts @@ -651,6 +651,32 @@ export class TurnkeySDKClientBase { }; }; + getVerifiedSubOrgIds = async ( + input: SdkApiTypes.TGetVerifiedSubOrgIdsBody + ): Promise => { + return this.request("/public/v1/query/list_verified_suborgs", { + ...input, + organizationId: input.organizationId ?? this.config.organizationId, + }); + }; + + stampGetVerifiedSubOrgIds = async ( + input: SdkApiTypes.TGetVerifiedSubOrgIdsBody + ): Promise => { + if (!this.config.stamper) { + return undefined; + } + const fullUrl = + this.config.apiBaseUrl + "/public/v1/query/list_verified_suborgs"; + const body = JSON.stringify(input); + const stamp = await this.config.stamper.stamp(body); + return { + body: body, + stamp: stamp, + url: fullUrl, + }; + }; + getWalletAccounts = async ( input: SdkApiTypes.TGetWalletAccountsBody ): Promise => { diff --git a/packages/sdk-browser/src/__generated__/sdk_api_types.ts b/packages/sdk-browser/src/__generated__/sdk_api_types.ts index acc36539b..e8140142d 100644 --- a/packages/sdk-browser/src/__generated__/sdk_api_types.ts +++ b/packages/sdk-browser/src/__generated__/sdk_api_types.ts @@ -231,6 +231,17 @@ export type TGetUsersBody = Omit< > & queryOverrideParams; +export type TGetVerifiedSubOrgIdsResponse = + operations["PublicApiService_GetVerifiedSubOrgIds"]["responses"]["200"]["schema"]; + +export type TGetVerifiedSubOrgIdsInput = { body: TGetVerifiedSubOrgIdsBody }; + +export type TGetVerifiedSubOrgIdsBody = Omit< + operations["PublicApiService_GetVerifiedSubOrgIds"]["parameters"]["body"]["body"], + "organizationId" +> & + queryOverrideParams; + export type TGetWalletAccountsResponse = operations["PublicApiService_GetWalletAccounts"]["responses"]["200"]["schema"]; diff --git a/packages/sdk-browser/src/__inputs__/public_api.swagger.json b/packages/sdk-browser/src/__inputs__/public_api.swagger.json index 091551dd1..6e83430da 100644 --- a/packages/sdk-browser/src/__inputs__/public_api.swagger.json +++ b/packages/sdk-browser/src/__inputs__/public_api.swagger.json @@ -708,6 +708,38 @@ "tags": ["Users"] } }, + "/public/v1/query/list_verified_suborgs": { + "post": { + "summary": "Get Verified Suborgs", + "description": "Get all email or phone verified suborg IDs associated given a parent org ID.", + "operationId": "PublicApiService_GetVerifiedSubOrgIds", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetVerifiedSubOrgIdsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetVerifiedSubOrgIdsRequest" + } + } + ], + "tags": ["Organizations"] + } + }, "/public/v1/query/list_wallet_accounts": { "post": { "summary": "List Wallets Accounts", @@ -3003,7 +3035,8 @@ "ADDRESS_FORMAT_DOGE_MAINNET", "ADDRESS_FORMAT_DOGE_TESTNET", "ADDRESS_FORMAT_TON_V3R2", - "ADDRESS_FORMAT_TON_V4R2" + "ADDRESS_FORMAT_TON_V4R2", + "ADDRESS_FORMAT_XRP" ] }, "v1ApiKey": { @@ -5968,7 +6001,7 @@ }, "filterType": { "type": "string", - "description": "Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'OIDC_TOKEN' or 'PUBLIC_KEY'" + "description": "Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN' or 'PUBLIC_KEY'" }, "filterValue": { "type": "string", @@ -6042,6 +6075,41 @@ }, "required": ["users"] }, + "v1GetVerifiedSubOrgIdsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for the parent Organization. This is used to find sub-organizations within it." + }, + "filterType": { + "type": "string", + "description": "Specifies the type of filter to apply, i.e 'EMAIL', 'PHONE_NUMBER'" + }, + "filterValue": { + "type": "string", + "description": "The value of the filter to apply for the specified type. For example, a specific email or phone number string." + }, + "paginationOptions": { + "$ref": "#/definitions/v1Pagination", + "description": "Parameters used for cursor-based pagination." + } + }, + "required": ["organizationId"] + }, + "v1GetVerifiedSubOrgIdsResponse": { + "type": "object", + "properties": { + "organizationIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of unique identifiers for the matching sub-organizations." + } + }, + "required": ["organizationIds"] + }, "v1GetWalletAccountsRequest": { "type": "object", "properties": { @@ -6397,6 +6465,14 @@ "emailCustomization": { "$ref": "#/definitions/v1EmailCustomizationParams", "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "smsCustomization": { + "$ref": "#/definitions/v1SmsCustomizationParams", + "description": "Optional parameters for customizing SMS message. If not provided, the default sms message will be used." + }, + "userIdentifier": { + "type": "string", + "description": "Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address." } }, "required": ["otpType", "contact"] @@ -8135,6 +8211,15 @@ } } }, + "v1SmsCustomizationParams": { + "type": "object", + "properties": { + "template": { + "type": "string", + "description": "Template containing references to .OtpCode i.e Your OTP is {{.OtpCode}}" + } + } + }, "v1TagType": { "type": "string", "enum": ["TAG_TYPE_USER", "TAG_TYPE_PRIVATE_KEY"] @@ -8686,6 +8771,10 @@ "v1WalletAccount": { "type": "object", "properties": { + "walletAccountId": { + "type": "string", + "description": "Unique identifier for a given Wallet Account." + }, "organizationId": { "type": "string", "description": "The Organization the Account belongs to." @@ -8722,6 +8811,7 @@ } }, "required": [ + "walletAccountId", "organizationId", "walletId", "curve", diff --git a/packages/sdk-browser/src/__inputs__/public_api.types.ts b/packages/sdk-browser/src/__inputs__/public_api.types.ts index 3445fdad9..4a9ba03b3 100644 --- a/packages/sdk-browser/src/__inputs__/public_api.types.ts +++ b/packages/sdk-browser/src/__inputs__/public_api.types.ts @@ -84,6 +84,10 @@ export type paths = { /** List all Users within an Organization */ post: operations["PublicApiService_GetUsers"]; }; + "/public/v1/query/list_verified_suborgs": { + /** Get all email or phone verified suborg IDs associated given a parent org ID. */ + post: operations["PublicApiService_GetVerifiedSubOrgIds"]; + }; "/public/v1/query/list_wallet_accounts": { /** List all Accounts wirhin a Wallet */ post: operations["PublicApiService_GetWalletAccounts"]; @@ -584,7 +588,8 @@ export type definitions = { | "ADDRESS_FORMAT_DOGE_MAINNET" | "ADDRESS_FORMAT_DOGE_TESTNET" | "ADDRESS_FORMAT_TON_V3R2" - | "ADDRESS_FORMAT_TON_V4R2"; + | "ADDRESS_FORMAT_TON_V4R2" + | "ADDRESS_FORMAT_XRP"; v1ApiKey: { /** @description A User credential that can be used to authenticate to Turnkey. */ credential: definitions["externaldatav1Credential"]; @@ -1750,7 +1755,7 @@ export type definitions = { v1GetSubOrgIdsRequest: { /** @description Unique identifier for the parent Organization. This is used to find sub-organizations within it. */ organizationId: string; - /** @description Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'OIDC_TOKEN' or 'PUBLIC_KEY' */ + /** @description Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN' or 'PUBLIC_KEY' */ filterType?: string; /** @description The value of the filter to apply for the specified type. For example, a specific email or name string. */ filterValue?: string; @@ -1779,6 +1784,20 @@ export type definitions = { /** @description A list of Users. */ users: definitions["v1User"][]; }; + v1GetVerifiedSubOrgIdsRequest: { + /** @description Unique identifier for the parent Organization. This is used to find sub-organizations within it. */ + organizationId: string; + /** @description Specifies the type of filter to apply, i.e 'EMAIL', 'PHONE_NUMBER' */ + filterType?: string; + /** @description The value of the filter to apply for the specified type. For example, a specific email or phone number string. */ + filterValue?: string; + /** @description Parameters used for cursor-based pagination. */ + paginationOptions?: definitions["v1Pagination"]; + }; + v1GetVerifiedSubOrgIdsResponse: { + /** @description List of unique identifiers for the matching sub-organizations. */ + organizationIds: string[]; + }; v1GetWalletAccountsRequest: { /** @description Unique identifier for a given Organization. */ organizationId: string; @@ -1922,6 +1941,10 @@ export type definitions = { contact: string; /** @description Optional parameters for customizing emails. If not provided, the default email will be used. */ emailCustomization?: definitions["v1EmailCustomizationParams"]; + /** @description Optional parameters for customizing SMS message. If not provided, the default sms message will be used. */ + smsCustomization?: definitions["v1SmsCustomizationParams"]; + /** @description Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address. */ + userIdentifier?: string; }; v1InitOtpAuthRequest: { /** @enum {string} */ @@ -2565,6 +2588,10 @@ export type definitions = { appidExclude?: boolean; credProps?: definitions["v1CredPropsAuthenticationExtensionsClientOutputs"]; }; + v1SmsCustomizationParams: { + /** @description Template containing references to .OtpCode i.e Your OTP is {{.OtpCode}} */ + template?: string; + }; /** @enum {string} */ v1TagType: "TAG_TYPE_USER" | "TAG_TYPE_PRIVATE_KEY"; /** @enum {string} */ @@ -2771,6 +2798,8 @@ export type definitions = { imported: boolean; }; v1WalletAccount: { + /** @description Unique identifier for a given Wallet Account. */ + walletAccountId: string; /** @description The Organization the Account belongs to. */ organizationId: string; /** @description The Wallet the Account was derived from. */ @@ -3187,6 +3216,24 @@ export type operations = { }; }; }; + /** Get all email or phone verified suborg IDs associated given a parent org ID. */ + PublicApiService_GetVerifiedSubOrgIds: { + parameters: { + body: { + body: definitions["v1GetVerifiedSubOrgIdsRequest"]; + }; + }; + responses: { + /** A successful response. */ + 200: { + schema: definitions["v1GetVerifiedSubOrgIdsResponse"]; + }; + /** An unexpected error response. */ + default: { + schema: definitions["rpcStatus"]; + }; + }; + }; /** List all Accounts wirhin a Wallet */ PublicApiService_GetWalletAccounts: { parameters: { diff --git a/packages/sdk-server/src/__generated__/sdk-client-base.ts b/packages/sdk-server/src/__generated__/sdk-client-base.ts index 45d532b55..61ff59069 100644 --- a/packages/sdk-server/src/__generated__/sdk-client-base.ts +++ b/packages/sdk-server/src/__generated__/sdk-client-base.ts @@ -642,6 +642,32 @@ export class TurnkeySDKClientBase { }; }; + getVerifiedSubOrgIds = async ( + input: SdkApiTypes.TGetVerifiedSubOrgIdsBody + ): Promise => { + return this.request("/public/v1/query/list_verified_suborgs", { + ...input, + organizationId: input.organizationId ?? this.config.organizationId, + }); + }; + + stampGetVerifiedSubOrgIds = async ( + input: SdkApiTypes.TGetVerifiedSubOrgIdsBody + ): Promise => { + if (!this.config.stamper) { + return undefined; + } + const fullUrl = + this.config.apiBaseUrl + "/public/v1/query/list_verified_suborgs"; + const body = JSON.stringify(input); + const stamp = await this.config.stamper.stamp(body); + return { + body: body, + stamp: stamp, + url: fullUrl, + }; + }; + getWalletAccounts = async ( input: SdkApiTypes.TGetWalletAccountsBody ): Promise => { diff --git a/packages/sdk-server/src/__generated__/sdk_api_types.ts b/packages/sdk-server/src/__generated__/sdk_api_types.ts index acc36539b..e8140142d 100644 --- a/packages/sdk-server/src/__generated__/sdk_api_types.ts +++ b/packages/sdk-server/src/__generated__/sdk_api_types.ts @@ -231,6 +231,17 @@ export type TGetUsersBody = Omit< > & queryOverrideParams; +export type TGetVerifiedSubOrgIdsResponse = + operations["PublicApiService_GetVerifiedSubOrgIds"]["responses"]["200"]["schema"]; + +export type TGetVerifiedSubOrgIdsInput = { body: TGetVerifiedSubOrgIdsBody }; + +export type TGetVerifiedSubOrgIdsBody = Omit< + operations["PublicApiService_GetVerifiedSubOrgIds"]["parameters"]["body"]["body"], + "organizationId" +> & + queryOverrideParams; + export type TGetWalletAccountsResponse = operations["PublicApiService_GetWalletAccounts"]["responses"]["200"]["schema"]; diff --git a/packages/sdk-server/src/__inputs__/public_api.swagger.json b/packages/sdk-server/src/__inputs__/public_api.swagger.json index de05730ee..6e83430da 100644 --- a/packages/sdk-server/src/__inputs__/public_api.swagger.json +++ b/packages/sdk-server/src/__inputs__/public_api.swagger.json @@ -708,6 +708,38 @@ "tags": ["Users"] } }, + "/public/v1/query/list_verified_suborgs": { + "post": { + "summary": "Get Verified Suborgs", + "description": "Get all email or phone verified suborg IDs associated given a parent org ID.", + "operationId": "PublicApiService_GetVerifiedSubOrgIds", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetVerifiedSubOrgIdsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetVerifiedSubOrgIdsRequest" + } + } + ], + "tags": ["Organizations"] + } + }, "/public/v1/query/list_wallet_accounts": { "post": { "summary": "List Wallets Accounts", @@ -3003,7 +3035,8 @@ "ADDRESS_FORMAT_DOGE_MAINNET", "ADDRESS_FORMAT_DOGE_TESTNET", "ADDRESS_FORMAT_TON_V3R2", - "ADDRESS_FORMAT_TON_V4R2" + "ADDRESS_FORMAT_TON_V4R2", + "ADDRESS_FORMAT_XRP" ] }, "v1ApiKey": { @@ -5968,7 +6001,7 @@ }, "filterType": { "type": "string", - "description": "Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'OIDC_TOKEN' or 'PUBLIC_KEY'" + "description": "Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN' or 'PUBLIC_KEY'" }, "filterValue": { "type": "string", @@ -6042,6 +6075,41 @@ }, "required": ["users"] }, + "v1GetVerifiedSubOrgIdsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for the parent Organization. This is used to find sub-organizations within it." + }, + "filterType": { + "type": "string", + "description": "Specifies the type of filter to apply, i.e 'EMAIL', 'PHONE_NUMBER'" + }, + "filterValue": { + "type": "string", + "description": "The value of the filter to apply for the specified type. For example, a specific email or phone number string." + }, + "paginationOptions": { + "$ref": "#/definitions/v1Pagination", + "description": "Parameters used for cursor-based pagination." + } + }, + "required": ["organizationId"] + }, + "v1GetVerifiedSubOrgIdsResponse": { + "type": "object", + "properties": { + "organizationIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of unique identifiers for the matching sub-organizations." + } + }, + "required": ["organizationIds"] + }, "v1GetWalletAccountsRequest": { "type": "object", "properties": { @@ -6397,6 +6465,14 @@ "emailCustomization": { "$ref": "#/definitions/v1EmailCustomizationParams", "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "smsCustomization": { + "$ref": "#/definitions/v1SmsCustomizationParams", + "description": "Optional parameters for customizing SMS message. If not provided, the default sms message will be used." + }, + "userIdentifier": { + "type": "string", + "description": "Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address." } }, "required": ["otpType", "contact"] @@ -8135,6 +8211,15 @@ } } }, + "v1SmsCustomizationParams": { + "type": "object", + "properties": { + "template": { + "type": "string", + "description": "Template containing references to .OtpCode i.e Your OTP is {{.OtpCode}}" + } + } + }, "v1TagType": { "type": "string", "enum": ["TAG_TYPE_USER", "TAG_TYPE_PRIVATE_KEY"] diff --git a/packages/sdk-server/src/__inputs__/public_api.types.ts b/packages/sdk-server/src/__inputs__/public_api.types.ts index 304c25c07..4a9ba03b3 100644 --- a/packages/sdk-server/src/__inputs__/public_api.types.ts +++ b/packages/sdk-server/src/__inputs__/public_api.types.ts @@ -84,6 +84,10 @@ export type paths = { /** List all Users within an Organization */ post: operations["PublicApiService_GetUsers"]; }; + "/public/v1/query/list_verified_suborgs": { + /** Get all email or phone verified suborg IDs associated given a parent org ID. */ + post: operations["PublicApiService_GetVerifiedSubOrgIds"]; + }; "/public/v1/query/list_wallet_accounts": { /** List all Accounts wirhin a Wallet */ post: operations["PublicApiService_GetWalletAccounts"]; @@ -584,7 +588,8 @@ export type definitions = { | "ADDRESS_FORMAT_DOGE_MAINNET" | "ADDRESS_FORMAT_DOGE_TESTNET" | "ADDRESS_FORMAT_TON_V3R2" - | "ADDRESS_FORMAT_TON_V4R2"; + | "ADDRESS_FORMAT_TON_V4R2" + | "ADDRESS_FORMAT_XRP"; v1ApiKey: { /** @description A User credential that can be used to authenticate to Turnkey. */ credential: definitions["externaldatav1Credential"]; @@ -1750,7 +1755,7 @@ export type definitions = { v1GetSubOrgIdsRequest: { /** @description Unique identifier for the parent Organization. This is used to find sub-organizations within it. */ organizationId: string; - /** @description Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'OIDC_TOKEN' or 'PUBLIC_KEY' */ + /** @description Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN' or 'PUBLIC_KEY' */ filterType?: string; /** @description The value of the filter to apply for the specified type. For example, a specific email or name string. */ filterValue?: string; @@ -1779,6 +1784,20 @@ export type definitions = { /** @description A list of Users. */ users: definitions["v1User"][]; }; + v1GetVerifiedSubOrgIdsRequest: { + /** @description Unique identifier for the parent Organization. This is used to find sub-organizations within it. */ + organizationId: string; + /** @description Specifies the type of filter to apply, i.e 'EMAIL', 'PHONE_NUMBER' */ + filterType?: string; + /** @description The value of the filter to apply for the specified type. For example, a specific email or phone number string. */ + filterValue?: string; + /** @description Parameters used for cursor-based pagination. */ + paginationOptions?: definitions["v1Pagination"]; + }; + v1GetVerifiedSubOrgIdsResponse: { + /** @description List of unique identifiers for the matching sub-organizations. */ + organizationIds: string[]; + }; v1GetWalletAccountsRequest: { /** @description Unique identifier for a given Organization. */ organizationId: string; @@ -1922,6 +1941,10 @@ export type definitions = { contact: string; /** @description Optional parameters for customizing emails. If not provided, the default email will be used. */ emailCustomization?: definitions["v1EmailCustomizationParams"]; + /** @description Optional parameters for customizing SMS message. If not provided, the default sms message will be used. */ + smsCustomization?: definitions["v1SmsCustomizationParams"]; + /** @description Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address. */ + userIdentifier?: string; }; v1InitOtpAuthRequest: { /** @enum {string} */ @@ -2565,6 +2588,10 @@ export type definitions = { appidExclude?: boolean; credProps?: definitions["v1CredPropsAuthenticationExtensionsClientOutputs"]; }; + v1SmsCustomizationParams: { + /** @description Template containing references to .OtpCode i.e Your OTP is {{.OtpCode}} */ + template?: string; + }; /** @enum {string} */ v1TagType: "TAG_TYPE_USER" | "TAG_TYPE_PRIVATE_KEY"; /** @enum {string} */ @@ -3189,6 +3216,24 @@ export type operations = { }; }; }; + /** Get all email or phone verified suborg IDs associated given a parent org ID. */ + PublicApiService_GetVerifiedSubOrgIds: { + parameters: { + body: { + body: definitions["v1GetVerifiedSubOrgIdsRequest"]; + }; + }; + responses: { + /** A successful response. */ + 200: { + schema: definitions["v1GetVerifiedSubOrgIdsResponse"]; + }; + /** An unexpected error response. */ + default: { + schema: definitions["rpcStatus"]; + }; + }; + }; /** List all Accounts wirhin a Wallet */ PublicApiService_GetWalletAccounts: { parameters: {