@bloque/sdk-identity 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const __rslib_import_meta_url__="u"<typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,t)=>{for(var i in t)__webpack_require__.o(t,i)&&!__webpack_require__.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{ApiKeysClient:()=>ApiKeysClient,OriginClient:()=>OriginClient,AliasesClient:()=>AliasesClient,IdentityClient:()=>IdentityClient,OriginsClient:()=>OriginsClient});const sdk_core_namespaceObject=require("@bloque/sdk-core");class AliasesClient extends sdk_core_namespaceObject.BaseClient{async get(e){return await this.httpClient.request({method:"GET",path:`/api/aliases?alias=${encodeURIComponent(e)}`})}}function mapApiKeyWire(e){return{id:e.id,keyId:e.key_id,publishableKey:e.publishable_key,name:e.name,scopes:e.scopes,domains:e.domains,status:e.status,expiration:e.expiration,metadata:e.metadata,lastUsedAt:e.last_used_at,createdAt:e.created_at}}class ApiKeysClient extends sdk_core_namespaceObject.BaseClient{async create(e){let t={name:e.name,scopes:e.scopes,domains:e.domains,expiration:e.expiration,metadata:e.metadata},i=await this.httpClient.request({method:"POST",path:"/api/api-keys",body:t});return{keyId:i.key_id,secretKey:i.secret_key,publishableKey:i.publishable_key}}async list(){return(await this.httpClient.request({method:"GET",path:"/api/api-keys"})).map(mapApiKeyWire)}async get(e){return mapApiKeyWire(await this.httpClient.request({method:"GET",path:`/api/api-keys/${e}`}))}async exchange(e){let t=await this.httpClient.request({method:"POST",path:"/api/api-keys/exchange",body:{key:e.key,scopes:e.scopes}});return{accessToken:t.access_token,expiresIn:t.expires_in,tokenType:t.token_type}}async revoke(e){await this.httpClient.request({method:"DELETE",path:`/api/api-keys/${e}`})}async rotate(e){return{secretKey:(await this.httpClient.request({method:"POST",path:`/api/api-keys/${e}/rotate`})).secret_key}}}class OriginClient extends sdk_core_namespaceObject.BaseClient{origin;constructor(e,t){super(e),this.origin=t}async assert(e){return await this.httpClient.request({method:"GET",path:`/api/origins/${this.origin}/assert?alias=${e}`})}}class OriginsClient extends sdk_core_namespaceObject.BaseClient{whatsapp;email;constructor(e){super(e),this.whatsapp=new OriginClient(e,"bloque-whatsapp"),this.email=new OriginClient(e,"bloque-email")}custom(e){return new OriginClient(this.httpClient,e)}async list(){return await this.httpClient.request({method:"GET",path:"/api/origins"})}async register(e,t,i){let a,s=i.assertionResult,n="API_KEY"===s.challengeType?{alias:s.alias,challengeType:"API_KEY",value:{api_key:s.value.apiKey,alias:e},originalChallengeParams:s.originalChallengeParams}:{alias:e,challengeType:s.challengeType,value:s.value,originalChallengeParams:s.originalChallengeParams};return a="individual"===i.type?{assertion_result:n,extra_context:i.extraContext,type:"individual",profile:this._mapUserProfile(i.profile)}:{assertion_result:n,extra_context:i.extraContext,type:"business",profile:this._mapBusinessProfile(i.profile)},{accessToken:(await this.httpClient.request({method:"POST",path:`/api/origins/${t}/register`,body:a})).result.access_token}}_mapUserProfile(e){return{first_name:e.firstName,last_name:e.lastName,birthdate:e.birthdate,email:e.email,phone:e.phone,gender:e.gender,address_line1:e.addressLine1,address_line2:e.addressLine2,city:e.city,state:e.state,postal_code:e.postalCode,neighborhood:e.neighborhood,country_of_birth_code:e.countryOfBirthCode,country_of_residence_code:e.countryOfResidenceCode,personal_id_type:e.personalIdType,personal_id_number:e.personalIdNumber}}_mapBusinessProfile(e){return{address_line1:e.addressLine1,city:e.city,country:e.country,incorporation_date:e.incorporationDate,legal_name:e.legalName,name:e.name,postal_code:e.postalCode,state:e.state,tax_id:e.taxId,type:e.type,address_line2:e.addressLine2,country_code:e.countryCode,email:e.email,logo:e.logo,owner_address_line1:e.ownerAddressLine1,owner_address_line2:e.ownerAddressLine2,owner_city:e.ownerCity,owner_country_code:e.ownerCountryCode,owner_id_number:e.ownerIdNumber,owner_id_type:e.ownerIdType,owner_name:e.ownerName,owner_postal_code:e.ownerPostalCode,owner_state:e.ownerState,phone:e.phone}}}class IdentityClient{httpClient;aliases;apiKeys;origins;constructor(e){this.httpClient=e,this.aliases=new AliasesClient(this.httpClient),this.apiKeys=new ApiKeysClient(this.httpClient),this.origins=new OriginsClient(this.httpClient)}async me(){return await this.httpClient.request({method:"GET",path:"/api/identities/me"})}async updateMe(e){return(await this.httpClient.request({method:"PATCH",path:"/api/identities/me",body:e})).result.identity}async myAliases(){return await this.httpClient.request({method:"GET",path:"/api/identities/me/aliases"})}async get(e){return await this.httpClient.request({method:"GET",path:`/api/identities/${e}`})}async update(e,t){return(await this.httpClient.request({method:"PATCH",path:`/api/identities/${e}`,body:t})).result.identity}async getAliases(e){return await this.httpClient.request({method:"GET",path:`/api/identities/${e}/aliases`})}}for(var __rspack_i in exports.AliasesClient=__webpack_exports__.AliasesClient,exports.ApiKeysClient=__webpack_exports__.ApiKeysClient,exports.IdentityClient=__webpack_exports__.IdentityClient,exports.OriginClient=__webpack_exports__.OriginClient,exports.OriginsClient=__webpack_exports__.OriginsClient,__webpack_exports__)-1===["AliasesClient","ApiKeysClient","IdentityClient","OriginClient","OriginsClient"].indexOf(__rspack_i)&&(exports[__rspack_i]=__webpack_exports__[__rspack_i]);Object.defineProperty(exports,"__esModule",{value:!0});
1
+ "use strict";const __rslib_import_meta_url__="u"<typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,t)=>{for(var i in t)__webpack_require__.o(t,i)&&!__webpack_require__.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{ApiKeysClient:()=>ApiKeysClient,OriginClient:()=>OriginClient,AliasesClient:()=>AliasesClient,IdentityClient:()=>IdentityClient,OriginsClient:()=>OriginsClient});const sdk_core_namespaceObject=require("@bloque/sdk-core");class AliasesClient extends sdk_core_namespaceObject.BaseClient{async get(e){return await this.httpClient.request({method:"GET",path:`/api/aliases?alias=${encodeURIComponent(e)}`})}}function mapApiKeyWire(e){return{id:e.id,keyId:e.key_id,publishableKey:e.publishable_key,name:e.name,scopes:e.scopes,domains:e.domains,status:e.status,expiration:e.expiration,metadata:e.metadata,lastUsedAt:e.last_used_at,createdAt:e.created_at}}class ApiKeysClient extends sdk_core_namespaceObject.BaseClient{async create(e){let t={name:e.name,scopes:e.scopes,domains:e.domains,expiration:e.expiration,metadata:e.metadata},i=await this.httpClient.request({method:"POST",path:"/api/api-keys",body:t});return{keyId:i.key_id,secretKey:i.secret_key,publishableKey:i.publishable_key}}async list(){return(await this.httpClient.request({method:"GET",path:"/api/api-keys"})).map(mapApiKeyWire)}async get(e){return mapApiKeyWire(await this.httpClient.request({method:"GET",path:`/api/api-keys/${e}`}))}async exchange(e){let t=await this.httpClient.request({method:"POST",path:"/api/api-keys/exchange",body:{key:e.key,scopes:e.scopes}});return{accessToken:t.access_token,expiresIn:t.expires_in,tokenType:t.token_type}}async revoke(e){await this.httpClient.request({method:"DELETE",path:`/api/api-keys/${e}`})}async rotate(e){return{secretKey:(await this.httpClient.request({method:"POST",path:`/api/api-keys/${e}/rotate`})).secret_key}}}class OriginClient extends sdk_core_namespaceObject.BaseClient{origin;constructor(e,t){super(e),this.origin=t}async assert(e){return await this.httpClient.request({method:"GET",path:`/api/origins/${this.origin}/assert?alias=${e}`})}}class OriginsClient extends sdk_core_namespaceObject.BaseClient{whatsapp;email;constructor(e){super(e),this.whatsapp=new OriginClient(e,"bloque-whatsapp"),this.email=new OriginClient(e,"bloque-email")}custom(e){return new OriginClient(this.httpClient,e)}async list(){return await this.httpClient.request({method:"GET",path:"/api/origins"})}async register(e,t,i){let a,s=i.assertionResult,n="API_KEY"===s.challengeType?{alias:s.alias,challengeType:"API_KEY",value:{api_key:s.value.apiKey,alias:e},originalChallengeParams:s.originalChallengeParams}:{alias:e,challengeType:s.challengeType,value:s.value,originalChallengeParams:s.originalChallengeParams};return a="individual"===i.type?{assertion_result:n,extra_context:i.extraContext,type:"individual",profile:this._mapUserProfile(i.profile)}:{assertion_result:n,extra_context:i.extraContext,type:"business",profile:this._mapBusinessProfile(i.profile)},{accessToken:(await this.httpClient.request({method:"POST",path:`/api/origins/${t}/register`,body:a})).result.access_token}}async updateMetadata(e){let t={};void 0!==e.metadata.company&&(t.company=e.metadata.company),void 0!==e.metadata.tosGateShowHome&&(t.tos_gate_show_home=e.metadata.tosGateShowHome),void 0!==e.metadata.gateAccentColor&&(t.gate_accent_color=e.metadata.gateAccentColor),void 0!==e.metadata.verificationGateReturnUrlAllowlist&&(t.verification_gate_return_url_allowlist=e.metadata.verificationGateReturnUrlAllowlist);let i=await this.httpClient.request({method:"PATCH",path:`/api/origins/${e.originName}/metadata`,body:{api_key:e.apiKey,metadata:t},_skipExchange:!0});return{originName:i.origin_name,metadata:i.metadata,updated:!0}}_mapUserProfile(e){return{first_name:e.firstName,last_name:e.lastName,birthdate:e.birthdate,email:e.email,phone:e.phone,gender:e.gender,address_line1:e.addressLine1,address_line2:e.addressLine2,city:e.city,state:e.state,postal_code:e.postalCode,neighborhood:e.neighborhood,country_of_birth_code:e.countryOfBirthCode,country_of_residence_code:e.countryOfResidenceCode,personal_id_type:e.personalIdType,personal_id_number:e.personalIdNumber}}_mapBusinessProfile(e){return{address_line1:e.addressLine1,city:e.city,country:e.country,incorporation_date:e.incorporationDate,legal_name:e.legalName,name:e.name,postal_code:e.postalCode,state:e.state,tax_id:e.taxId,type:e.type,address_line2:e.addressLine2,country_code:e.countryCode,email:e.email,logo:e.logo,owner_address_line1:e.ownerAddressLine1,owner_address_line2:e.ownerAddressLine2,owner_city:e.ownerCity,owner_country_code:e.ownerCountryCode,owner_id_number:e.ownerIdNumber,owner_id_type:e.ownerIdType,owner_name:e.ownerName,owner_postal_code:e.ownerPostalCode,owner_state:e.ownerState,phone:e.phone}}}class IdentityClient{httpClient;aliases;apiKeys;origins;constructor(e){this.httpClient=e,this.aliases=new AliasesClient(this.httpClient),this.apiKeys=new ApiKeysClient(this.httpClient),this.origins=new OriginsClient(this.httpClient)}async me(){return await this.httpClient.request({method:"GET",path:"/api/identities/me"})}async updateMe(e){return(await this.httpClient.request({method:"PATCH",path:"/api/identities/me",body:e})).result.identity}async myAliases(){return await this.httpClient.request({method:"GET",path:"/api/identities/me/aliases"})}async get(e){return await this.httpClient.request({method:"GET",path:`/api/identities/${e}`})}async update(e,t){return(await this.httpClient.request({method:"PATCH",path:`/api/identities/${e}`,body:t})).result.identity}async getAliases(e){return await this.httpClient.request({method:"GET",path:`/api/identities/${e}/aliases`})}}for(var __rspack_i in exports.AliasesClient=__webpack_exports__.AliasesClient,exports.ApiKeysClient=__webpack_exports__.ApiKeysClient,exports.IdentityClient=__webpack_exports__.IdentityClient,exports.OriginClient=__webpack_exports__.OriginClient,exports.OriginsClient=__webpack_exports__.OriginsClient,__webpack_exports__)-1===["AliasesClient","ApiKeysClient","IdentityClient","OriginClient","OriginsClient"].indexOf(__rspack_i)&&(exports[__rspack_i]=__webpack_exports__[__rspack_i]);Object.defineProperty(exports,"__esModule",{value:!0});
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{BaseClient as e}from"@bloque/sdk-core";class t extends e{async get(e){return await this.httpClient.request({method:"GET",path:`/api/aliases?alias=${encodeURIComponent(e)}`})}}function a(e){return{id:e.id,keyId:e.key_id,publishableKey:e.publishable_key,name:e.name,scopes:e.scopes,domains:e.domains,status:e.status,expiration:e.expiration,metadata:e.metadata,lastUsedAt:e.last_used_at,createdAt:e.created_at}}class i extends e{async create(e){let t={name:e.name,scopes:e.scopes,domains:e.domains,expiration:e.expiration,metadata:e.metadata},a=await this.httpClient.request({method:"POST",path:"/api/api-keys",body:t});return{keyId:a.key_id,secretKey:a.secret_key,publishableKey:a.publishable_key}}async list(){return(await this.httpClient.request({method:"GET",path:"/api/api-keys"})).map(a)}async get(e){return a(await this.httpClient.request({method:"GET",path:`/api/api-keys/${e}`}))}async exchange(e){let t=await this.httpClient.request({method:"POST",path:"/api/api-keys/exchange",body:{key:e.key,scopes:e.scopes}});return{accessToken:t.access_token,expiresIn:t.expires_in,tokenType:t.token_type}}async revoke(e){await this.httpClient.request({method:"DELETE",path:`/api/api-keys/${e}`})}async rotate(e){return{secretKey:(await this.httpClient.request({method:"POST",path:`/api/api-keys/${e}/rotate`})).secret_key}}}class s extends e{origin;constructor(e,t){super(e),this.origin=t}async assert(e){return await this.httpClient.request({method:"GET",path:`/api/origins/${this.origin}/assert?alias=${e}`})}}class n extends e{whatsapp;email;constructor(e){super(e),this.whatsapp=new s(e,"bloque-whatsapp"),this.email=new s(e,"bloque-email")}custom(e){return new s(this.httpClient,e)}async list(){return await this.httpClient.request({method:"GET",path:"/api/origins"})}async register(e,t,a){let i,s=a.assertionResult,n="API_KEY"===s.challengeType?{alias:s.alias,challengeType:"API_KEY",value:{api_key:s.value.apiKey,alias:e},originalChallengeParams:s.originalChallengeParams}:{alias:e,challengeType:s.challengeType,value:s.value,originalChallengeParams:s.originalChallengeParams};return i="individual"===a.type?{assertion_result:n,extra_context:a.extraContext,type:"individual",profile:this._mapUserProfile(a.profile)}:{assertion_result:n,extra_context:a.extraContext,type:"business",profile:this._mapBusinessProfile(a.profile)},{accessToken:(await this.httpClient.request({method:"POST",path:`/api/origins/${t}/register`,body:i})).result.access_token}}_mapUserProfile(e){return{first_name:e.firstName,last_name:e.lastName,birthdate:e.birthdate,email:e.email,phone:e.phone,gender:e.gender,address_line1:e.addressLine1,address_line2:e.addressLine2,city:e.city,state:e.state,postal_code:e.postalCode,neighborhood:e.neighborhood,country_of_birth_code:e.countryOfBirthCode,country_of_residence_code:e.countryOfResidenceCode,personal_id_type:e.personalIdType,personal_id_number:e.personalIdNumber}}_mapBusinessProfile(e){return{address_line1:e.addressLine1,city:e.city,country:e.country,incorporation_date:e.incorporationDate,legal_name:e.legalName,name:e.name,postal_code:e.postalCode,state:e.state,tax_id:e.taxId,type:e.type,address_line2:e.addressLine2,country_code:e.countryCode,email:e.email,logo:e.logo,owner_address_line1:e.ownerAddressLine1,owner_address_line2:e.ownerAddressLine2,owner_city:e.ownerCity,owner_country_code:e.ownerCountryCode,owner_id_number:e.ownerIdNumber,owner_id_type:e.ownerIdType,owner_name:e.ownerName,owner_postal_code:e.ownerPostalCode,owner_state:e.ownerState,phone:e.phone}}}class r{httpClient;aliases;apiKeys;origins;constructor(e){this.httpClient=e,this.aliases=new t(this.httpClient),this.apiKeys=new i(this.httpClient),this.origins=new n(this.httpClient)}async me(){return await this.httpClient.request({method:"GET",path:"/api/identities/me"})}async updateMe(e){return(await this.httpClient.request({method:"PATCH",path:"/api/identities/me",body:e})).result.identity}async myAliases(){return await this.httpClient.request({method:"GET",path:"/api/identities/me/aliases"})}async get(e){return await this.httpClient.request({method:"GET",path:`/api/identities/${e}`})}async update(e,t){return(await this.httpClient.request({method:"PATCH",path:`/api/identities/${e}`,body:t})).result.identity}async getAliases(e){return await this.httpClient.request({method:"GET",path:`/api/identities/${e}/aliases`})}}export{t as AliasesClient,i as ApiKeysClient,r as IdentityClient,s as OriginClient,n as OriginsClient};
1
+ import{BaseClient as e}from"@bloque/sdk-core";class t extends e{async get(e){return await this.httpClient.request({method:"GET",path:`/api/aliases?alias=${encodeURIComponent(e)}`})}}function a(e){return{id:e.id,keyId:e.key_id,publishableKey:e.publishable_key,name:e.name,scopes:e.scopes,domains:e.domains,status:e.status,expiration:e.expiration,metadata:e.metadata,lastUsedAt:e.last_used_at,createdAt:e.created_at}}class i extends e{async create(e){let t={name:e.name,scopes:e.scopes,domains:e.domains,expiration:e.expiration,metadata:e.metadata},a=await this.httpClient.request({method:"POST",path:"/api/api-keys",body:t});return{keyId:a.key_id,secretKey:a.secret_key,publishableKey:a.publishable_key}}async list(){return(await this.httpClient.request({method:"GET",path:"/api/api-keys"})).map(a)}async get(e){return a(await this.httpClient.request({method:"GET",path:`/api/api-keys/${e}`}))}async exchange(e){let t=await this.httpClient.request({method:"POST",path:"/api/api-keys/exchange",body:{key:e.key,scopes:e.scopes}});return{accessToken:t.access_token,expiresIn:t.expires_in,tokenType:t.token_type}}async revoke(e){await this.httpClient.request({method:"DELETE",path:`/api/api-keys/${e}`})}async rotate(e){return{secretKey:(await this.httpClient.request({method:"POST",path:`/api/api-keys/${e}/rotate`})).secret_key}}}class s extends e{origin;constructor(e,t){super(e),this.origin=t}async assert(e){return await this.httpClient.request({method:"GET",path:`/api/origins/${this.origin}/assert?alias=${e}`})}}class n extends e{whatsapp;email;constructor(e){super(e),this.whatsapp=new s(e,"bloque-whatsapp"),this.email=new s(e,"bloque-email")}custom(e){return new s(this.httpClient,e)}async list(){return await this.httpClient.request({method:"GET",path:"/api/origins"})}async register(e,t,a){let i,s=a.assertionResult,n="API_KEY"===s.challengeType?{alias:s.alias,challengeType:"API_KEY",value:{api_key:s.value.apiKey,alias:e},originalChallengeParams:s.originalChallengeParams}:{alias:e,challengeType:s.challengeType,value:s.value,originalChallengeParams:s.originalChallengeParams};return i="individual"===a.type?{assertion_result:n,extra_context:a.extraContext,type:"individual",profile:this._mapUserProfile(a.profile)}:{assertion_result:n,extra_context:a.extraContext,type:"business",profile:this._mapBusinessProfile(a.profile)},{accessToken:(await this.httpClient.request({method:"POST",path:`/api/origins/${t}/register`,body:i})).result.access_token}}async updateMetadata(e){let t={};void 0!==e.metadata.company&&(t.company=e.metadata.company),void 0!==e.metadata.tosGateShowHome&&(t.tos_gate_show_home=e.metadata.tosGateShowHome),void 0!==e.metadata.gateAccentColor&&(t.gate_accent_color=e.metadata.gateAccentColor),void 0!==e.metadata.verificationGateReturnUrlAllowlist&&(t.verification_gate_return_url_allowlist=e.metadata.verificationGateReturnUrlAllowlist);let a=await this.httpClient.request({method:"PATCH",path:`/api/origins/${e.originName}/metadata`,body:{api_key:e.apiKey,metadata:t},_skipExchange:!0});return{originName:a.origin_name,metadata:a.metadata,updated:!0}}_mapUserProfile(e){return{first_name:e.firstName,last_name:e.lastName,birthdate:e.birthdate,email:e.email,phone:e.phone,gender:e.gender,address_line1:e.addressLine1,address_line2:e.addressLine2,city:e.city,state:e.state,postal_code:e.postalCode,neighborhood:e.neighborhood,country_of_birth_code:e.countryOfBirthCode,country_of_residence_code:e.countryOfResidenceCode,personal_id_type:e.personalIdType,personal_id_number:e.personalIdNumber}}_mapBusinessProfile(e){return{address_line1:e.addressLine1,city:e.city,country:e.country,incorporation_date:e.incorporationDate,legal_name:e.legalName,name:e.name,postal_code:e.postalCode,state:e.state,tax_id:e.taxId,type:e.type,address_line2:e.addressLine2,country_code:e.countryCode,email:e.email,logo:e.logo,owner_address_line1:e.ownerAddressLine1,owner_address_line2:e.ownerAddressLine2,owner_city:e.ownerCity,owner_country_code:e.ownerCountryCode,owner_id_number:e.ownerIdNumber,owner_id_type:e.ownerIdType,owner_name:e.ownerName,owner_postal_code:e.ownerPostalCode,owner_state:e.ownerState,phone:e.phone}}}class r{httpClient;aliases;apiKeys;origins;constructor(e){this.httpClient=e,this.aliases=new t(this.httpClient),this.apiKeys=new i(this.httpClient),this.origins=new n(this.httpClient)}async me(){return await this.httpClient.request({method:"GET",path:"/api/identities/me"})}async updateMe(e){return(await this.httpClient.request({method:"PATCH",path:"/api/identities/me",body:e})).result.identity}async myAliases(){return await this.httpClient.request({method:"GET",path:"/api/identities/me/aliases"})}async get(e){return await this.httpClient.request({method:"GET",path:`/api/identities/${e}`})}async update(e,t){return(await this.httpClient.request({method:"PATCH",path:`/api/identities/${e}`,body:t})).result.identity}async getAliases(e){return await this.httpClient.request({method:"GET",path:`/api/identities/${e}/aliases`})}}export{t as AliasesClient,i as ApiKeysClient,r as IdentityClient,s as OriginClient,n as OriginsClient};
@@ -2,7 +2,7 @@ import type { HttpClient } from '@bloque/sdk-core';
2
2
  import { BaseClient } from '@bloque/sdk-core';
3
3
  import type { Origin, OTPAssertion, OTPAssertionEmail, OTPAssertionWhatsApp } from '../internal/wire-types';
4
4
  import { OriginClient } from './origin-client';
5
- import type { RegisterParams, RegisterResult } from './types';
5
+ import type { RegisterParams, RegisterResult, UpdateOriginMetadataParams, UpdateOriginMetadataResult } from './types';
6
6
  export declare class OriginsClient extends BaseClient {
7
7
  readonly whatsapp: OriginClient<OTPAssertionWhatsApp>;
8
8
  readonly email: OriginClient<OTPAssertionEmail>;
@@ -120,6 +120,36 @@ export declare class OriginsClient extends BaseClient {
120
120
  * ```
121
121
  */
122
122
  register(alias: string, origin: string, params: RegisterParams): Promise<RegisterResult>;
123
+ /**
124
+ * Self-service update of an API-key origin's own presentation metadata:
125
+ * `company`, `tosGateShowHome`, `gateAccentColor`, and
126
+ * `verificationGateReturnUrlAllowlist`. Authenticated purely by the
127
+ * origin's own `apiKey` in the request body — no session/JWT involved,
128
+ * and works even before you've ever called `connect()`/`register()`.
129
+ *
130
+ * This is a one-time, deploy-script-shaped call, not something you run
131
+ * per-request or per-user. Fields you omit from `metadata` are left
132
+ * untouched on the origin (shallow merge) — the response echoes the full
133
+ * post-merge metadata so you can confirm what actually took effect.
134
+ *
135
+ * @param params - Origin to patch, its own secret key, and the metadata patch
136
+ * @returns Promise resolving to the origin's full metadata after the merge
137
+ *
138
+ * @example
139
+ * ```typescript
140
+ * const result = await bloque.identity.origins.updateMetadata({
141
+ * originName: 'acme',
142
+ * apiKey: process.env.ACME_ORIGIN_KEY!,
143
+ * metadata: {
144
+ * company: 'Acme Inc.',
145
+ * gateAccentColor: '#1a73e8',
146
+ * verificationGateReturnUrlAllowlist: ['https://app.acme.example.com'],
147
+ * },
148
+ * });
149
+ * console.log(result.updated); // true
150
+ * ```
151
+ */
152
+ updateMetadata(params: UpdateOriginMetadataParams): Promise<UpdateOriginMetadataResult>;
123
153
  private _mapUserProfile;
124
154
  private _mapBusinessProfile;
125
155
  }
@@ -192,4 +192,58 @@ export interface RegisterResult {
192
192
  */
193
193
  accessToken: string;
194
194
  }
195
+ /**
196
+ * Self-serviceable presentation metadata for an API-key origin. This is the
197
+ * complete allowlist accepted by `OriginsClient.updateMetadata()` — any other
198
+ * field on `Origin.metadata` (e.g. `contactEmail`) is owned by other systems
199
+ * and can't be set through this surface.
200
+ */
201
+ export interface OriginMetadataPatch {
202
+ /**
203
+ * Developer-facing display name substituted as `{{developer_name}}` into
204
+ * the hosted TOS document. Non-empty, at most 200 characters.
205
+ */
206
+ company?: string;
207
+ /** Skip the hosted TOS gate's intro screens. */
208
+ tosGateShowHome?: boolean;
209
+ /**
210
+ * Brand accent color applied to both hosted gates' `--accent` CSS
211
+ * variable. Strict 3- or 6-digit CSS hex (e.g. `#f80` or `#ff8800`) —
212
+ * anything else is silently dropped server-side, never partially applied.
213
+ */
214
+ gateAccentColor?: string;
215
+ /**
216
+ * Bare origins (scheme + host + port, no path or trailing slash) allowed
217
+ * as `returnUrl` on `compliance.verificationGate.start()`, in addition to
218
+ * the deployment-wide `VERIFICATION_GATE_RETURN_URL_ALLOWLIST` env var —
219
+ * either being satisfied is enough. Replaces the whole array; it does not
220
+ * append to whatever is already configured.
221
+ */
222
+ verificationGateReturnUrlAllowlist?: string[];
223
+ }
224
+ export interface UpdateOriginMetadataParams {
225
+ /**
226
+ * Origin namespace to patch — the same value passed as `origin` to
227
+ * `new SDK(...)`.
228
+ */
229
+ originName: string;
230
+ /**
231
+ * The origin's own provisioned secret key (`sk_live_...`/`sk_test_...`),
232
+ * verified server-side against `origin_key_values` — not a
233
+ * dashboard-issued API key.
234
+ */
235
+ apiKey: string;
236
+ /**
237
+ * Shallow-merged into the origin's existing metadata: fields you omit are
238
+ * left untouched.
239
+ */
240
+ metadata: OriginMetadataPatch;
241
+ }
242
+ export interface UpdateOriginMetadataResult {
243
+ /** Origin namespace that was updated. */
244
+ originName: string;
245
+ /** The origin's full metadata after the patch was merged in. */
246
+ metadata: Record<string, unknown>;
247
+ updated: true;
248
+ }
195
249
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bloque/sdk-identity",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "keywords": [
6
6
  "bloque",