@bloque/sdk-identity 0.0.49 → 0.1.1

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.
@@ -0,0 +1,26 @@
1
+ import { BaseClient } from '@bloque/sdk-core';
2
+ import type { ApiKeyInfo, CreateApiKeyParams, CreateApiKeyResult, ExchangeApiKeyParams, ExchangeApiKeyResult, RotateApiKeyResult } from './types';
3
+ export declare class ApiKeysClient extends BaseClient {
4
+ /**
5
+ * Create a new API key.
6
+ *
7
+ * The response includes the secret key, which is shown only once.
8
+ * Store it securely -- it cannot be retrieved later.
9
+ */
10
+ create(params: CreateApiKeyParams): Promise<CreateApiKeyResult>;
11
+ /** List all API keys for the authenticated identity. */
12
+ list(): Promise<ApiKeyInfo[]>;
13
+ /** Get a single API key by ID. */
14
+ get(id: string): Promise<ApiKeyInfo>;
15
+ /**
16
+ * Exchange an API secret key for a short-lived JWT.
17
+ *
18
+ * This endpoint is unauthenticated and rate-limited.
19
+ * The returned JWT is valid for `expiresIn` seconds (default 900 = 15 min).
20
+ */
21
+ exchange(params: ExchangeApiKeyParams): Promise<ExchangeApiKeyResult>;
22
+ /** Revoke an API key. */
23
+ revoke(id: string): Promise<void>;
24
+ /** Rotate an API key secret. Returns the new secret key (shown only once). */
25
+ rotate(id: string): Promise<RotateApiKeyResult>;
26
+ }
@@ -0,0 +1,35 @@
1
+ export type { ExchangeApiKeyParams, ExchangeApiKeyResult, } from '@bloque/sdk-core';
2
+ export type ApiKeyStatus = 'active' | 'revoked' | 'expired';
3
+ export interface CreateApiKeyParams {
4
+ name: string;
5
+ scopes: string[];
6
+ domains: string[];
7
+ /** 'never' or seconds as string */
8
+ expiration: string;
9
+ metadata?: Record<string, unknown>;
10
+ }
11
+ /**
12
+ * Result of creating an API key.
13
+ * The secret key is shown only once -- store it securely.
14
+ */
15
+ export interface CreateApiKeyResult {
16
+ keyId: string;
17
+ secretKey: string;
18
+ publishableKey: string;
19
+ }
20
+ export interface ApiKeyInfo {
21
+ id: string;
22
+ keyId: string;
23
+ publishableKey: string;
24
+ name: string;
25
+ scopes: string[];
26
+ domains: string[];
27
+ status: ApiKeyStatus;
28
+ expiration: string;
29
+ metadata: Record<string, unknown>;
30
+ lastUsedAt?: string | null;
31
+ createdAt: string;
32
+ }
33
+ export interface RotateApiKeyResult {
34
+ secretKey: string;
35
+ }
@@ -1,11 +1,64 @@
1
1
  import type { HttpClient } from '@bloque/sdk-core';
2
2
  import { AliasesClient } from './aliases/aliases-client';
3
+ import { ApiKeysClient } from './api-keys/api-keys-client';
3
4
  import { OriginsClient } from './origins/origins-client';
4
- import type { IdentityMe } from './types';
5
+ import type { IdentityAlias, IdentityMe, UpdateIdentityParams } from './types';
5
6
  export declare class IdentityClient {
6
7
  private readonly httpClient;
7
8
  readonly aliases: AliasesClient;
9
+ readonly apiKeys: ApiKeysClient;
8
10
  readonly origins: OriginsClient;
9
11
  constructor(httpClient: HttpClient);
12
+ /**
13
+ * Get the current authenticated user's identity
14
+ *
15
+ * @returns Current user identity
16
+ */
10
17
  me(): Promise<IdentityMe>;
18
+ /**
19
+ * Update the current authenticated user's identity
20
+ *
21
+ * Profile and metadata fields are merged with existing values
22
+ * (only the provided fields are updated).
23
+ *
24
+ * @param params - Fields to update
25
+ * @returns Updated identity
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * const updated = await bloque.identity.updateMe({
30
+ * profile: { city: 'New York', state: 'NY' },
31
+ * metadata: { preference: 'dark_mode' },
32
+ * });
33
+ * ```
34
+ */
35
+ updateMe(params: UpdateIdentityParams): Promise<IdentityMe>;
36
+ /**
37
+ * Get the current user's aliases
38
+ *
39
+ * @returns Array of aliases
40
+ */
41
+ myAliases(): Promise<IdentityAlias[]>;
42
+ /**
43
+ * Get an identity by URN
44
+ *
45
+ * @param urn - Identity URN
46
+ * @returns Identity details
47
+ */
48
+ get(urn: string): Promise<IdentityMe>;
49
+ /**
50
+ * Update an identity by URN
51
+ *
52
+ * @param urn - Identity URN
53
+ * @param params - Fields to update
54
+ * @returns Updated identity
55
+ */
56
+ update(urn: string, params: UpdateIdentityParams): Promise<IdentityMe>;
57
+ /**
58
+ * Get aliases for a specific identity
59
+ *
60
+ * @param urn - Identity URN
61
+ * @returns Array of aliases
62
+ */
63
+ getAliases(urn: string): Promise<IdentityAlias[]>;
11
64
  }
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__,{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=${e}`})}}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 r,n=i.assertionResult,a="API_KEY"===n.challengeType?{alias:n.alias,challengeType:"API_KEY",value:{api_key:n.value.apiKey,alias:e},originalChallengeParams:n.originalChallengeParams}:{alias:e,challengeType:n.challengeType,value:n.value,originalChallengeParams:n.originalChallengeParams};return r="individual"===i.type?{assertion_result:a,extra_context:i.extraContext,type:"individual",profile:this._mapUserProfile(i.profile)}:{assertion_result:a,extra_context:i.extraContext,type:"business",profile:this._mapBusinessProfile(i.profile)},{accessToken:(await this.httpClient.request({method:"POST",path:`/api/origins/${t}/register`,body:r})).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;origins;constructor(e){this.httpClient=e,this.aliases=new AliasesClient(this.httpClient),this.origins=new OriginsClient(this.httpClient)}async me(){return await this.httpClient.request({method:"GET",path:"/api/identities/me"})}}for(var __rspack_i in exports.AliasesClient=__webpack_exports__.AliasesClient,exports.IdentityClient=__webpack_exports__.IdentityClient,exports.OriginClient=__webpack_exports__.OriginClient,exports.OriginsClient=__webpack_exports__.OriginsClient,__webpack_exports__)-1===["AliasesClient","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=${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});
package/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export * from './aliases/aliases-client';
2
2
  export * from './aliases/types';
3
+ export * from './api-keys/api-keys-client';
4
+ export * from './api-keys/types';
3
5
  export * from './identity-client';
4
6
  export * from './origins/origin-client';
5
7
  export * from './origins/origins-client';
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=${e}`})}}class i 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 a extends e{whatsapp;email;constructor(e){super(e),this.whatsapp=new i(e,"bloque-whatsapp"),this.email=new i(e,"bloque-email")}custom(e){return new i(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 s{httpClient;aliases;origins;constructor(e){this.httpClient=e,this.aliases=new t(this.httpClient),this.origins=new a(this.httpClient)}async me(){return await this.httpClient.request({method:"GET",path:"/api/identities/me"})}}export{t as AliasesClient,s as IdentityClient,i as OriginClient,a 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=${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};
package/dist/types.d.ts CHANGED
@@ -1,5 +1,23 @@
1
1
  import type { BusinessRegisterParams, IndividualRegisterParams } from './origins/types';
2
2
  export type CreateIdentityParams = Pick<IndividualRegisterParams, 'extraContext' | 'type' | 'profile'> | Pick<BusinessRegisterParams, 'extraContext' | 'type' | 'profile'>;
3
+ /**
4
+ * Parameters for updating the current user's identity
5
+ */
6
+ export interface UpdateIdentityParams {
7
+ /** Partial profile fields to update (merged with existing) */
8
+ profile?: Partial<IdentityMeProfile>;
9
+ /** Partial metadata to update (merged with existing) */
10
+ metadata?: Record<string, unknown>;
11
+ }
12
+ /**
13
+ * Alias information
14
+ */
15
+ export interface IdentityAlias {
16
+ alias: string;
17
+ type: string;
18
+ verified: boolean;
19
+ primary: boolean;
20
+ }
3
21
  export interface IdentityMeProfile {
4
22
  city: string;
5
23
  email: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bloque/sdk-identity",
3
- "version": "0.0.49",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "keywords": [
6
6
  "bloque",