@twin.org/identity-rest-client 0.9.3-next.1 → 0.9.3-next.3
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.
|
@@ -48,7 +48,7 @@ export class IdentityProfileRestClient extends BaseRestClient {
|
|
|
48
48
|
* @returns The identity and the items properties.
|
|
49
49
|
*/
|
|
50
50
|
async get(publicPropertyNames, privatePropertyNames, identity) {
|
|
51
|
-
if (
|
|
51
|
+
if (Is.notEmpty(identity)) {
|
|
52
52
|
Guards.string(IdentityProfileRestClient.CLASS_NAME, "identity", identity);
|
|
53
53
|
const response = await this.fetch("/:userIdentity", HttpMethod.GET, {
|
|
54
54
|
pathParams: {
|
|
@@ -103,7 +103,7 @@ export class IdentityProfileRestClient extends BaseRestClient {
|
|
|
103
103
|
* @returns A promise that resolves when the profile has been updated.
|
|
104
104
|
*/
|
|
105
105
|
async update(publicProfile, privateProfile, identity) {
|
|
106
|
-
if (
|
|
106
|
+
if (Is.notEmpty(identity)) {
|
|
107
107
|
Guards.string(IdentityProfileRestClient.CLASS_NAME, "identity", identity);
|
|
108
108
|
await this.fetch("/:userIdentity", HttpMethod.PUT, {
|
|
109
109
|
pathParams: {
|
|
@@ -129,7 +129,7 @@ export class IdentityProfileRestClient extends BaseRestClient {
|
|
|
129
129
|
* @returns A promise that resolves when the profile has been removed.
|
|
130
130
|
*/
|
|
131
131
|
async remove(identity) {
|
|
132
|
-
if (
|
|
132
|
+
if (Is.notEmpty(identity)) {
|
|
133
133
|
Guards.string(IdentityProfileRestClient.CLASS_NAME, "identity", identity);
|
|
134
134
|
await this.fetch("/:userIdentity", HttpMethod.DELETE, {
|
|
135
135
|
pathParams: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identityProfileRestClient.js","sourceRoot":"","sources":["../../src/identityProfileRestClient.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAA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,MAAM;SAC5B,CAAC;IACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseRestClient } from \"@twin.org/api-core\";\nimport { HttpParameterHelper, type IBaseRestClientConfig } from \"@twin.org/api-models\";\nimport { Coerce, Guards, Is } from \"@twin.org/core\";\nimport type { IJsonLdDocument } from \"@twin.org/data-json-ld\";\nimport type {\n\tIIdentityProfileAdminGetRequest,\n\tIIdentityProfileAdminListRequest,\n\tIIdentityProfileAdminListResponse,\n\tIIdentityProfileAdminRemoveRequest,\n\tIIdentityProfileAdminUpdateRequest,\n\tIIdentityProfileComponent,\n\tIIdentityProfileCreateRequest,\n\tIIdentityProfileGetPublicRequest,\n\tIIdentityProfileGetPublicResponse,\n\tIIdentityProfileGetRequest,\n\tIIdentityProfileGetResponse,\n\tIIdentityProfileListRequest,\n\tIIdentityProfileListResponse,\n\tIIdentityProfileUpdateRequest\n} from \"@twin.org/identity-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { HttpMethod } from \"@twin.org/web\";\n\n/**\n * Client for performing identity profile operations through REST endpoints.\n */\nexport class IdentityProfileRestClient<\n\tT extends IJsonLdDocument = IJsonLdDocument,\n\tU extends IJsonLdDocument = IJsonLdDocument\n>\n\textends BaseRestClient\n\timplements IIdentityProfileComponent<T, U>\n{\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<IdentityProfileRestClient>();\n\n\t/**\n\t * Create a new instance of IdentityProfileRestClient.\n\t * @param config The configuration for the client.\n\t */\n\tconstructor(config: IBaseRestClientConfig) {\n\t\tsuper(nameof<IdentityProfileRestClient>(), config, \"identity/profile\");\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn IdentityProfileRestClient.CLASS_NAME;\n\t}\n\n\t/**\n\t * Create the profile properties for an identity.\n\t * @param publicProfile The public profile data as JSON-LD.\n\t * @param privateProfile The private profile data as JSON-LD.\n\t * @returns A promise that resolves when the profile has been created.\n\t */\n\tpublic async create(publicProfile?: T, privateProfile?: U): Promise<void> {\n\t\tawait this.fetch<IIdentityProfileCreateRequest, never>(\"/\", HttpMethod.POST, {\n\t\t\tbody: {\n\t\t\t\tpublicProfile,\n\t\t\t\tprivateProfile\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Get the profile properties for an identity.\n\t * @param publicPropertyNames The public properties to get for the profile, defaults to all.\n\t * @param privatePropertyNames The private properties to get for the profile, defaults to all.\n\t * @param identity The identity to perform the profile operation on, defaults to the current user.\n\t * @returns The identity and the items properties.\n\t */\n\tpublic async get(\n\t\tpublicPropertyNames?: (keyof T)[],\n\t\tprivatePropertyNames?: (keyof U)[],\n\t\tidentity?: string\n\t): Promise<{\n\t\tidentity: string;\n\t\tpublicProfile?: Partial<T>;\n\t\tprivateProfile?: Partial<U>;\n\t}> {\n\t\tif (!Is.empty(identity)) {\n\t\t\tGuards.string(IdentityProfileRestClient.CLASS_NAME, nameof(identity), identity);\n\t\t\tconst response = await this.fetch<\n\t\t\t\tIIdentityProfileAdminGetRequest,\n\t\t\t\tIIdentityProfileGetResponse\n\t\t\t>(\"/:userIdentity\", HttpMethod.GET, {\n\t\t\t\tpathParams: {\n\t\t\t\t\tuserIdentity: identity\n\t\t\t\t},\n\t\t\t\tquery: {\n\t\t\t\t\tpublicPropertyNames: HttpParameterHelper.arrayToString(publicPropertyNames),\n\t\t\t\t\tprivatePropertyNames: HttpParameterHelper.arrayToString(privatePropertyNames)\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tidentity: response.body.identity,\n\t\t\t\tpublicProfile: response.body.publicProfile as T,\n\t\t\t\tprivateProfile: response.body.privateProfile as U\n\t\t\t};\n\t\t}\n\t\tconst response = await this.fetch<IIdentityProfileGetRequest, IIdentityProfileGetResponse>(\n\t\t\t\"/\",\n\t\t\tHttpMethod.GET,\n\t\t\t{\n\t\t\t\tquery: {\n\t\t\t\t\tpublicPropertyNames: HttpParameterHelper.arrayToString(publicPropertyNames),\n\t\t\t\t\tprivatePropertyNames: HttpParameterHelper.arrayToString(privatePropertyNames)\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn {\n\t\t\tidentity: response.body.identity,\n\t\t\tpublicProfile: response.body.publicProfile as T,\n\t\t\tprivateProfile: response.body.privateProfile as U\n\t\t};\n\t}\n\n\t/**\n\t * Get the public profile properties for an identity.\n\t * @param identity The identity to perform the profile operation on.\n\t * @param propertyNames The public properties to get for the profile, defaults to all.\n\t * @returns The items properties.\n\t */\n\tpublic async getPublic(identity: string, propertyNames?: (keyof T)[]): Promise<Partial<T>> {\n\t\tGuards.string(IdentityProfileRestClient.CLASS_NAME, nameof(identity), identity);\n\n\t\tconst response = await this.fetch<\n\t\t\tIIdentityProfileGetPublicRequest,\n\t\t\tIIdentityProfileGetPublicResponse\n\t\t>(\"/:identity/public\", HttpMethod.GET, {\n\t\t\tpathParams: {\n\t\t\t\tidentity\n\t\t\t},\n\t\t\tquery: {\n\t\t\t\tpropertyNames: HttpParameterHelper.arrayToString(propertyNames)\n\t\t\t}\n\t\t});\n\n\t\treturn response.body as Partial<T>;\n\t}\n\n\t/**\n\t * Update the profile properties of an identity.\n\t * @param publicProfile The public profile data as JSON-LD.\n\t * @param privateProfile The private profile data as JSON-LD.\n\t * @param identity The identity to perform the profile operation on, defaults to the current user.\n\t * @returns A promise that resolves when the profile has been updated.\n\t */\n\tpublic async update(publicProfile?: T, privateProfile?: U, identity?: string): Promise<void> {\n\t\tif (!Is.empty(identity)) {\n\t\t\tGuards.string(IdentityProfileRestClient.CLASS_NAME, nameof(identity), identity);\n\t\t\tawait this.fetch<IIdentityProfileAdminUpdateRequest, never>(\n\t\t\t\t\"/:userIdentity\",\n\t\t\t\tHttpMethod.PUT,\n\t\t\t\t{\n\t\t\t\t\tpathParams: {\n\t\t\t\t\t\tuserIdentity: identity\n\t\t\t\t\t},\n\t\t\t\t\tbody: {\n\t\t\t\t\t\tpublicProfile,\n\t\t\t\t\t\tprivateProfile\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tawait this.fetch<IIdentityProfileUpdateRequest, never>(\"/\", HttpMethod.PUT, {\n\t\t\tbody: {\n\t\t\t\tpublicProfile,\n\t\t\t\tprivateProfile\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Delete the profile for an identity.\n\t * @param identity The identity to perform the profile operation on, defaults to the current user.\n\t * @returns A promise that resolves when the profile has been removed.\n\t */\n\tpublic async remove(identity?: string): Promise<void> {\n\t\tif (!Is.empty(identity)) {\n\t\t\tGuards.string(IdentityProfileRestClient.CLASS_NAME, nameof(identity), identity);\n\t\t\tawait this.fetch<IIdentityProfileAdminRemoveRequest, never>(\n\t\t\t\t\"/:userIdentity\",\n\t\t\t\tHttpMethod.DELETE,\n\t\t\t\t{\n\t\t\t\t\tpathParams: {\n\t\t\t\t\t\tuserIdentity: identity\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tawait this.fetch<never, never>(\"/\", HttpMethod.DELETE);\n\t}\n\n\t/**\n\t * Get a list of the requested identities.\n\t * @param publicFilters The filters to apply to the identities public profiles.\n\t * @param publicPropertyNames The public properties to get for the profile, defaults to all.\n\t * @param cursor The cursor for paged requests.\n\t * @param limit The maximum number of items in a page.\n\t * @returns The list of items and cursor for paging.\n\t */\n\tpublic async list(\n\t\tpublicFilters?: {\n\t\t\tpropertyName: string;\n\t\t\tpropertyValue: unknown;\n\t\t}[],\n\t\tpublicPropertyNames?: (keyof T)[],\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The identities.\n\t\t */\n\t\titems: {\n\t\t\tidentity: string;\n\t\t\tpublicProfile?: Partial<T>;\n\t\t}[];\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more entities.\n\t\t */\n\t\tcursor?: string;\n\t}> {\n\t\tconst response = await this.fetch<IIdentityProfileListRequest, IIdentityProfileListResponse>(\n\t\t\t\"/query\",\n\t\t\tHttpMethod.GET,\n\t\t\t{\n\t\t\t\tquery: {\n\t\t\t\t\tpublicFilters: HttpParameterHelper.arrayToString(\n\t\t\t\t\t\tpublicFilters?.map(f => `${f.propertyName}:${Coerce.string(f.propertyValue) ?? \"\"}`)\n\t\t\t\t\t),\n\t\t\t\t\tpublicPropertyNames: HttpParameterHelper.arrayToString(publicPropertyNames),\n\t\t\t\t\tcursor,\n\t\t\t\t\tlimit: Coerce.string(limit)\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t\treturn {\n\t\t\titems: response.body.items as {\n\t\t\t\tidentity: string;\n\t\t\t\tpublicProfile?: Partial<T>;\n\t\t\t}[],\n\t\t\tcursor: response.body.cursor\n\t\t};\n\t}\n\n\t/**\n\t * Get the list of identity profiles including private properties.\n\t * @param publicFilters The filters to apply to the identities public profiles.\n\t * @param privateFilters The filters to apply to the identities private profiles.\n\t * @param publicPropertyNames The public properties to get for the profile, defaults to all.\n\t * @param privatePropertyNames The private properties to get for the profile, defaults to none.\n\t * @param cursor The cursor for paged requests.\n\t * @param limit The maximum number of items in a page.\n\t * @returns The list of items and cursor for paging.\n\t */\n\tpublic async listAdmin(\n\t\tpublicFilters?: {\n\t\t\tpropertyName: string;\n\t\t\tpropertyValue: unknown;\n\t\t}[],\n\t\tprivateFilters?: {\n\t\t\tpropertyName: string;\n\t\t\tpropertyValue: unknown;\n\t\t}[],\n\t\tpublicPropertyNames?: (keyof T)[],\n\t\tprivatePropertyNames?: (keyof U)[],\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\titems: {\n\t\t\tidentity: string;\n\t\t\tpublicProfile?: Partial<T>;\n\t\t\tprivateProfile?: Partial<U>;\n\t\t}[];\n\t\tcursor?: string;\n\t}> {\n\t\tconst response = await this.fetch<\n\t\t\tIIdentityProfileAdminListRequest,\n\t\t\tIIdentityProfileAdminListResponse\n\t\t>(\"/admin/query\", HttpMethod.GET, {\n\t\t\tquery: {\n\t\t\t\tpublicFilters: HttpParameterHelper.arrayToString(\n\t\t\t\t\tpublicFilters?.map(f => `${f.propertyName}:${Coerce.string(f.propertyValue) ?? \"\"}`)\n\t\t\t\t),\n\t\t\t\tprivateFilters: HttpParameterHelper.arrayToString(\n\t\t\t\t\tprivateFilters?.map(f => `${f.propertyName}:${Coerce.string(f.propertyValue) ?? \"\"}`)\n\t\t\t\t),\n\t\t\t\tpublicPropertyNames: HttpParameterHelper.arrayToString(publicPropertyNames),\n\t\t\t\tprivatePropertyNames: HttpParameterHelper.arrayToString(privatePropertyNames),\n\t\t\t\tcursor,\n\t\t\t\tlimit: Coerce.string(limit)\n\t\t\t}\n\t\t});\n\t\treturn {\n\t\t\titems: response.body.items as {\n\t\t\t\tidentity: string;\n\t\t\t\tpublicProfile?: Partial<T>;\n\t\t\t\tprivateProfile?: Partial<U>;\n\t\t\t}[],\n\t\t\tcursor: response.body.cursor\n\t\t};\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"identityProfileRestClient.js","sourceRoot":"","sources":["../../src/identityProfileRestClient.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAA8B,MAAM,sBAAsB,CAAC;AACvF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAmBpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C;;GAEG;AACH,MAAM,OAAO,yBAIZ,SAAQ,cAAc;IAGtB;;OAEG;IACI,MAAM,CAAU,UAAU,+BAA+C;IAEhF;;;OAGG;IACH,YAAY,MAA6B;QACxC,KAAK,8BAAsC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACxE,CAAC;IAED;;;OAGG;IACI,SAAS;QACf,OAAO,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AAI,CAAC,KAAK,CAG/B,cAAc,EAAE,UAAU,CAAC,GAAG,EAAE;YACjC,KAAK,EAAE;gBACN,aAAa,EAAE,mBAAmB,CAAC,aAAa,CAC/C,aAAa,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,YAAY,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC,CACpF;gBACD,cAAc,EAAE,mBAAmB,CAAC,aAAa,CAChD,cAAc,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,YAAY,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC,CACrF;gBACD,mBAAmB,EAAE,mBAAmB,CAAC,aAAa,CAAC,mBAAmB,CAAC;gBAC3E,oBAAoB,EAAE,mBAAmB,CAAC,aAAa,CAAC,oBAAoB,CAAC;gBAC7E,MAAM;gBACN,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;aAC3B;SACD,CAAC,CAAC;QACH,OAAO;YACN,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,KAIlB;YACH,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM;SAC5B,CAAC;IACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseRestClient } from \"@twin.org/api-core\";\nimport { HttpParameterHelper, type IBaseRestClientConfig } from \"@twin.org/api-models\";\nimport { Coerce, Guards, Is } from \"@twin.org/core\";\nimport type { IJsonLdDocument } from \"@twin.org/data-json-ld\";\nimport type {\n\tIIdentityProfileAdminGetRequest,\n\tIIdentityProfileAdminListRequest,\n\tIIdentityProfileAdminListResponse,\n\tIIdentityProfileAdminRemoveRequest,\n\tIIdentityProfileAdminUpdateRequest,\n\tIIdentityProfileComponent,\n\tIIdentityProfileCreateRequest,\n\tIIdentityProfileGetPublicRequest,\n\tIIdentityProfileGetPublicResponse,\n\tIIdentityProfileGetRequest,\n\tIIdentityProfileGetResponse,\n\tIIdentityProfileListRequest,\n\tIIdentityProfileListResponse,\n\tIIdentityProfileUpdateRequest\n} from \"@twin.org/identity-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { HttpMethod } from \"@twin.org/web\";\n\n/**\n * Client for performing identity profile operations through REST endpoints.\n */\nexport class IdentityProfileRestClient<\n\tT extends IJsonLdDocument = IJsonLdDocument,\n\tU extends IJsonLdDocument = IJsonLdDocument\n>\n\textends BaseRestClient\n\timplements IIdentityProfileComponent<T, U>\n{\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<IdentityProfileRestClient>();\n\n\t/**\n\t * Create a new instance of IdentityProfileRestClient.\n\t * @param config The configuration for the client.\n\t */\n\tconstructor(config: IBaseRestClientConfig) {\n\t\tsuper(nameof<IdentityProfileRestClient>(), config, \"identity/profile\");\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn IdentityProfileRestClient.CLASS_NAME;\n\t}\n\n\t/**\n\t * Create the profile properties for an identity.\n\t * @param publicProfile The public profile data as JSON-LD.\n\t * @param privateProfile The private profile data as JSON-LD.\n\t * @returns A promise that resolves when the profile has been created.\n\t */\n\tpublic async create(publicProfile?: T, privateProfile?: U): Promise<void> {\n\t\tawait this.fetch<IIdentityProfileCreateRequest, never>(\"/\", HttpMethod.POST, {\n\t\t\tbody: {\n\t\t\t\tpublicProfile,\n\t\t\t\tprivateProfile\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Get the profile properties for an identity.\n\t * @param publicPropertyNames The public properties to get for the profile, defaults to all.\n\t * @param privatePropertyNames The private properties to get for the profile, defaults to all.\n\t * @param identity The identity to perform the profile operation on, defaults to the current user.\n\t * @returns The identity and the items properties.\n\t */\n\tpublic async get(\n\t\tpublicPropertyNames?: (keyof T)[],\n\t\tprivatePropertyNames?: (keyof U)[],\n\t\tidentity?: string\n\t): Promise<{\n\t\tidentity: string;\n\t\tpublicProfile?: Partial<T>;\n\t\tprivateProfile?: Partial<U>;\n\t}> {\n\t\tif (Is.notEmpty(identity)) {\n\t\t\tGuards.string(IdentityProfileRestClient.CLASS_NAME, nameof(identity), identity);\n\t\t\tconst response = await this.fetch<\n\t\t\t\tIIdentityProfileAdminGetRequest,\n\t\t\t\tIIdentityProfileGetResponse\n\t\t\t>(\"/:userIdentity\", HttpMethod.GET, {\n\t\t\t\tpathParams: {\n\t\t\t\t\tuserIdentity: identity\n\t\t\t\t},\n\t\t\t\tquery: {\n\t\t\t\t\tpublicPropertyNames: HttpParameterHelper.arrayToString(publicPropertyNames),\n\t\t\t\t\tprivatePropertyNames: HttpParameterHelper.arrayToString(privatePropertyNames)\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tidentity: response.body.identity,\n\t\t\t\tpublicProfile: response.body.publicProfile as T,\n\t\t\t\tprivateProfile: response.body.privateProfile as U\n\t\t\t};\n\t\t}\n\t\tconst response = await this.fetch<IIdentityProfileGetRequest, IIdentityProfileGetResponse>(\n\t\t\t\"/\",\n\t\t\tHttpMethod.GET,\n\t\t\t{\n\t\t\t\tquery: {\n\t\t\t\t\tpublicPropertyNames: HttpParameterHelper.arrayToString(publicPropertyNames),\n\t\t\t\t\tprivatePropertyNames: HttpParameterHelper.arrayToString(privatePropertyNames)\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn {\n\t\t\tidentity: response.body.identity,\n\t\t\tpublicProfile: response.body.publicProfile as T,\n\t\t\tprivateProfile: response.body.privateProfile as U\n\t\t};\n\t}\n\n\t/**\n\t * Get the public profile properties for an identity.\n\t * @param identity The identity to perform the profile operation on.\n\t * @param propertyNames The public properties to get for the profile, defaults to all.\n\t * @returns The items properties.\n\t */\n\tpublic async getPublic(identity: string, propertyNames?: (keyof T)[]): Promise<Partial<T>> {\n\t\tGuards.string(IdentityProfileRestClient.CLASS_NAME, nameof(identity), identity);\n\n\t\tconst response = await this.fetch<\n\t\t\tIIdentityProfileGetPublicRequest,\n\t\t\tIIdentityProfileGetPublicResponse\n\t\t>(\"/:identity/public\", HttpMethod.GET, {\n\t\t\tpathParams: {\n\t\t\t\tidentity\n\t\t\t},\n\t\t\tquery: {\n\t\t\t\tpropertyNames: HttpParameterHelper.arrayToString(propertyNames)\n\t\t\t}\n\t\t});\n\n\t\treturn response.body as Partial<T>;\n\t}\n\n\t/**\n\t * Update the profile properties of an identity.\n\t * @param publicProfile The public profile data as JSON-LD.\n\t * @param privateProfile The private profile data as JSON-LD.\n\t * @param identity The identity to perform the profile operation on, defaults to the current user.\n\t * @returns A promise that resolves when the profile has been updated.\n\t */\n\tpublic async update(publicProfile?: T, privateProfile?: U, identity?: string): Promise<void> {\n\t\tif (Is.notEmpty(identity)) {\n\t\t\tGuards.string(IdentityProfileRestClient.CLASS_NAME, nameof(identity), identity);\n\t\t\tawait this.fetch<IIdentityProfileAdminUpdateRequest, never>(\n\t\t\t\t\"/:userIdentity\",\n\t\t\t\tHttpMethod.PUT,\n\t\t\t\t{\n\t\t\t\t\tpathParams: {\n\t\t\t\t\t\tuserIdentity: identity\n\t\t\t\t\t},\n\t\t\t\t\tbody: {\n\t\t\t\t\t\tpublicProfile,\n\t\t\t\t\t\tprivateProfile\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tawait this.fetch<IIdentityProfileUpdateRequest, never>(\"/\", HttpMethod.PUT, {\n\t\t\tbody: {\n\t\t\t\tpublicProfile,\n\t\t\t\tprivateProfile\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Delete the profile for an identity.\n\t * @param identity The identity to perform the profile operation on, defaults to the current user.\n\t * @returns A promise that resolves when the profile has been removed.\n\t */\n\tpublic async remove(identity?: string): Promise<void> {\n\t\tif (Is.notEmpty(identity)) {\n\t\t\tGuards.string(IdentityProfileRestClient.CLASS_NAME, nameof(identity), identity);\n\t\t\tawait this.fetch<IIdentityProfileAdminRemoveRequest, never>(\n\t\t\t\t\"/:userIdentity\",\n\t\t\t\tHttpMethod.DELETE,\n\t\t\t\t{\n\t\t\t\t\tpathParams: {\n\t\t\t\t\t\tuserIdentity: identity\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tawait this.fetch<never, never>(\"/\", HttpMethod.DELETE);\n\t}\n\n\t/**\n\t * Get a list of the requested identities.\n\t * @param publicFilters The filters to apply to the identities public profiles.\n\t * @param publicPropertyNames The public properties to get for the profile, defaults to all.\n\t * @param cursor The cursor for paged requests.\n\t * @param limit The maximum number of items in a page.\n\t * @returns The list of items and cursor for paging.\n\t */\n\tpublic async list(\n\t\tpublicFilters?: {\n\t\t\tpropertyName: string;\n\t\t\tpropertyValue: unknown;\n\t\t}[],\n\t\tpublicPropertyNames?: (keyof T)[],\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The identities.\n\t\t */\n\t\titems: {\n\t\t\tidentity: string;\n\t\t\tpublicProfile?: Partial<T>;\n\t\t}[];\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more entities.\n\t\t */\n\t\tcursor?: string;\n\t}> {\n\t\tconst response = await this.fetch<IIdentityProfileListRequest, IIdentityProfileListResponse>(\n\t\t\t\"/query\",\n\t\t\tHttpMethod.GET,\n\t\t\t{\n\t\t\t\tquery: {\n\t\t\t\t\tpublicFilters: HttpParameterHelper.arrayToString(\n\t\t\t\t\t\tpublicFilters?.map(f => `${f.propertyName}:${Coerce.string(f.propertyValue) ?? \"\"}`)\n\t\t\t\t\t),\n\t\t\t\t\tpublicPropertyNames: HttpParameterHelper.arrayToString(publicPropertyNames),\n\t\t\t\t\tcursor,\n\t\t\t\t\tlimit: Coerce.string(limit)\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t\treturn {\n\t\t\titems: response.body.items as {\n\t\t\t\tidentity: string;\n\t\t\t\tpublicProfile?: Partial<T>;\n\t\t\t}[],\n\t\t\tcursor: response.body.cursor\n\t\t};\n\t}\n\n\t/**\n\t * Get the list of identity profiles including private properties.\n\t * @param publicFilters The filters to apply to the identities public profiles.\n\t * @param privateFilters The filters to apply to the identities private profiles.\n\t * @param publicPropertyNames The public properties to get for the profile, defaults to all.\n\t * @param privatePropertyNames The private properties to get for the profile, defaults to none.\n\t * @param cursor The cursor for paged requests.\n\t * @param limit The maximum number of items in a page.\n\t * @returns The list of items and cursor for paging.\n\t */\n\tpublic async listAdmin(\n\t\tpublicFilters?: {\n\t\t\tpropertyName: string;\n\t\t\tpropertyValue: unknown;\n\t\t}[],\n\t\tprivateFilters?: {\n\t\t\tpropertyName: string;\n\t\t\tpropertyValue: unknown;\n\t\t}[],\n\t\tpublicPropertyNames?: (keyof T)[],\n\t\tprivatePropertyNames?: (keyof U)[],\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\titems: {\n\t\t\tidentity: string;\n\t\t\tpublicProfile?: Partial<T>;\n\t\t\tprivateProfile?: Partial<U>;\n\t\t}[];\n\t\tcursor?: string;\n\t}> {\n\t\tconst response = await this.fetch<\n\t\t\tIIdentityProfileAdminListRequest,\n\t\t\tIIdentityProfileAdminListResponse\n\t\t>(\"/admin/query\", HttpMethod.GET, {\n\t\t\tquery: {\n\t\t\t\tpublicFilters: HttpParameterHelper.arrayToString(\n\t\t\t\t\tpublicFilters?.map(f => `${f.propertyName}:${Coerce.string(f.propertyValue) ?? \"\"}`)\n\t\t\t\t),\n\t\t\t\tprivateFilters: HttpParameterHelper.arrayToString(\n\t\t\t\t\tprivateFilters?.map(f => `${f.propertyName}:${Coerce.string(f.propertyValue) ?? \"\"}`)\n\t\t\t\t),\n\t\t\t\tpublicPropertyNames: HttpParameterHelper.arrayToString(publicPropertyNames),\n\t\t\t\tprivatePropertyNames: HttpParameterHelper.arrayToString(privatePropertyNames),\n\t\t\t\tcursor,\n\t\t\t\tlimit: Coerce.string(limit)\n\t\t\t}\n\t\t});\n\t\treturn {\n\t\t\titems: response.body.items as {\n\t\t\t\tidentity: string;\n\t\t\t\tpublicProfile?: Partial<T>;\n\t\t\t\tprivateProfile?: Partial<U>;\n\t\t\t}[],\n\t\t\tcursor: response.body.cursor\n\t\t};\n\t}\n}\n"]}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.9.3-next.3](https://github.com/iotaledger/twin-identity/compare/identity-rest-client-v0.9.3-next.2...identity-rest-client-v0.9.3-next.3) (2026-09-07)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **identity-rest-client:** Synchronize repo versions
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/identity-models bumped from 0.9.3-next.2 to 0.9.3-next.3
|
|
16
|
+
|
|
17
|
+
## [0.9.3-next.2](https://github.com/iotaledger/twin-identity/compare/identity-rest-client-v0.9.3-next.1...identity-rest-client-v0.9.3-next.2) (2026-09-04)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* did resolver caching ([#220](https://github.com/iotaledger/twin-identity/issues/220)) ([fdcbf65](https://github.com/iotaledger/twin-identity/commit/fdcbf65fb6f9deef82e8c32a98835edaf6608e90))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Dependencies
|
|
26
|
+
|
|
27
|
+
* The following workspace dependencies were updated
|
|
28
|
+
* dependencies
|
|
29
|
+
* @twin.org/identity-models bumped from 0.9.3-next.1 to 0.9.3-next.2
|
|
30
|
+
|
|
3
31
|
## [0.9.3-next.1](https://github.com/iotaledger/twin-identity/compare/identity-rest-client-v0.9.3-next.0...identity-rest-client-v0.9.3-next.1) (2026-08-26)
|
|
4
32
|
|
|
5
33
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/identity-rest-client",
|
|
3
|
-
"version": "0.9.3-next.
|
|
3
|
+
"version": "0.9.3-next.3",
|
|
4
4
|
"description": "Client library for consuming identity REST endpoints through shared request and response contracts.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@twin.org/data-core": "next",
|
|
21
21
|
"@twin.org/data-json-ld": "next",
|
|
22
22
|
"@twin.org/entity": "next",
|
|
23
|
-
"@twin.org/identity-models": "0.9.3-next.
|
|
23
|
+
"@twin.org/identity-models": "0.9.3-next.3",
|
|
24
24
|
"@twin.org/nameof": "next",
|
|
25
25
|
"@twin.org/standards-w3c-did": "next",
|
|
26
26
|
"@twin.org/web": "next"
|