@alfresco/js-api 10.1.0-16743363738 → 10.1.0-16756253889
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/esm2015/package.json +1 -1
- package/esm2015/src/api/content-rest-api/api/people.api.js +4 -0
- package/esm2015/src/api/content-rest-api/api/people.api.js.map +1 -1
- package/esm5/package.json +1 -1
- package/esm5/src/api/content-rest-api/api/people.api.js +4 -0
- package/esm5/src/api/content-rest-api/api/people.api.js.map +1 -1
- package/package.json +1 -1
- package/src/api/content-rest-api/api/people.api.js +4 -0
- package/src/api/content-rest-api/api/people.api.js.map +1 -1
- package/typings/package.json +1 -1
- package/typings/src/api/content-rest-api/api/people.api.d.ts +11 -0
package/esm2015/package.json
CHANGED
@@ -130,6 +130,10 @@ export class PeopleApi extends BaseApi {
|
|
130
130
|
contentTypes
|
131
131
|
});
|
132
132
|
}
|
133
|
+
getAvatarImageUrl(personId) {
|
134
|
+
const ticket = this.alfrescoApi.contentClient.getAlfTicket(undefined);
|
135
|
+
return `${this.apiClient.basePath}/people/${personId}/avatar?placeholder=true${ticket}`;
|
136
|
+
}
|
133
137
|
updatePerson(personId, personBodyUpdate, opts) {
|
134
138
|
throwIfNotDefined(personId, 'personId');
|
135
139
|
throwIfNotDefined(personBodyUpdate, 'personBodyUpdate');
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"people.api.js","sourceRoot":"","sources":["people.api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAqE,WAAW,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxH,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAMlE,MAAM,OAAO,SAAU,SAAQ,OAAO;IAUlC,YAAY,CAAC,gBAAkC,EAAE,I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,UAAU,EAAE,WAAW;SAC1B,CAAC,CAAC;IACP,CAAC;CACJ","sourcesContent":["/*!\n * @license\n * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ClientBody, PasswordResetBody, PersonBodyCreate, PersonBodyUpdate, PersonEntry, PersonPaging } from '../model';\nimport { BaseApi } from './base.api';\nimport { throwIfNotDefined } from '../../../assert';\nimport { buildCollectionParam } from '../../../alfrescoApiClient';\nimport { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types';\n\n/**\n * People service.\n */\nexport class PeopleApi extends BaseApi {\n /**\n * Create person\n *\n * **Note:** this endpoint is available in Alfresco 5.2 and newer versions.\n * **Note:** setting properties of type d:content and d:category are not supported.\n * @param personBodyCreate The person details.\n * @param opts Optional parameters\n * @returns Promise<PersonEntry>\n */\n createPerson(personBodyCreate: PersonBodyCreate, opts?: ContentFieldsQuery): Promise<PersonEntry> {\n throwIfNotDefined(personBodyCreate, 'personBodyCreate');\n\n const queryParams = {\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.post({\n path: '/people',\n queryParams,\n bodyParam: personBodyCreate,\n returnType: PersonEntry\n });\n }\n\n /**\n * Delete avatar image\n *\n * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.\n *\n * Deletes the avatar image related to person **personId**.\n * You must be the person or have admin rights to update a person's avatar.\n * You can use the -me- string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @returns Promise<{}>\n */\n deleteAvatarImage(personId: string): Promise<void> {\n throwIfNotDefined(personId, 'personId');\n\n const pathParams = {\n personId\n };\n\n return this.delete({\n path: '/people/{personId}/avatar',\n pathParams\n });\n }\n\n /**\n * Get avatar image\n *\n * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.\n *\n * Gets the avatar image related to the person **personId**. If the person has no related avatar then\n * the **placeholder** query parameter can be optionally used to request a placeholder image to be returned.\n *\n * You can use the -me- string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @param opts Optional parameters\n * @param opts.attachment **true** enables a web browser to download the file as an attachment.\n * **false** means a web browser may preview the file in a new tab or window, but not download the file.\n * You can only set this parameter to **false** if the content type of the file is in the supported list;\n * for example, certain image files and PDF files.\n * If the content type is not supported for preview, then a value of **false** is ignored, and\n * the attachment will be returned in the response. (default to true)\n * @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided.\n * Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT.\n * @param opts.placeholder If **true** and there is no avatar for this **personId**\n * then the placeholder image is returned, rather than a 404 response. (default to true)\n * @returns Promise<Blob>\n */\n getAvatarImage(personId: string, opts?: { attachment?: boolean; placeholder?: boolean; ifModifiedSince?: string }): Promise<Blob> {\n throwIfNotDefined(personId, 'personId');\n\n const pathParams = {\n personId\n };\n\n const queryParams = {\n attachment: opts?.attachment,\n placeholder: opts?.placeholder\n };\n\n const headerParams = {\n 'If-Modified-Since': opts?.ifModifiedSince\n };\n\n const accepts = ['application/octet-stream'];\n\n return this.get({\n path: '/people/{personId}/avatar',\n pathParams,\n queryParams,\n headerParams,\n accepts,\n returnType: 'blob'\n });\n }\n\n /**\n * Get a person\n *\n * You can use the `-me-` string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @param opts Optional parameters\n * @returns Promise<PersonEntry>\n */\n getPerson(personId: string, opts?: ContentFieldsQuery): Promise<PersonEntry> {\n throwIfNotDefined(personId, 'personId');\n\n const pathParams = {\n personId\n };\n\n const queryParams = {\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.get({\n path: '/people/{personId}',\n pathParams,\n queryParams,\n returnType: PersonEntry\n });\n }\n\n /**\n * List people\n *\n * **Note:** this endpoint is available in Alfresco 5.2 and newer versions.\n *\n * List people.\n *\n * You can use the **include** parameter to return any additional information.\n *\n * The default sort order for the returned list is for people to be sorted by ascending id.\n * You can override the default by using the **orderBy** parameter.\n *\n * You can use any of the following fields to order the results:\n * - id\n * - firstName\n * - lastName\n * @param opts Optional parameters\n * @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to\n * sort the list by one or more fields.\n *\n * Each field has a default sort order, which is normally ascending order. Read the API method implementation notes\n * above to check if any fields used in this method have a descending default search order.\n *\n * To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.\n * @returns Promise<PersonPaging>\n */\n listPeople(\n opts?: {\n orderBy?: string[];\n } & ContentPagingQuery &\n ContentIncludeQuery &\n ContentFieldsQuery\n ): Promise<PersonPaging> {\n const queryParams = {\n skipCount: opts?.skipCount,\n maxItems: opts?.maxItems,\n orderBy: buildCollectionParam(opts?.orderBy, 'csv'),\n include: buildCollectionParam(opts?.include, 'csv'),\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.get({\n path: '/people',\n queryParams,\n returnType: PersonPaging\n });\n }\n\n /**\n * Request password reset\n *\n * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.\n * **Note:** No authentication is required to call this endpoint.\n * @param personId The identifier of a person.\n * @param clientBody The client name to send email with app-specific url.\n * @returns Promise<{}>\n */\n requestPasswordReset(personId: string, clientBody: ClientBody): Promise<any> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(clientBody, 'clientBody');\n\n const pathParams = {\n personId\n };\n\n return this.post({\n path: '/people/{personId}/request-password-reset',\n pathParams,\n bodyParam: clientBody\n });\n }\n\n /**\n * Reset password\n *\n * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.\n * **Note:** No authentication is required to call this endpoint.\n * @param personId The identifier of a person.\n * @param passwordResetBody The reset password details\n * @returns Promise<{}>\n */\n resetPassword(personId: string, passwordResetBody: PasswordResetBody): Promise<any> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(passwordResetBody, 'passwordResetBody');\n\n const pathParams = {\n personId\n };\n\n return this.post({\n path: '/people/{personId}/reset-password',\n pathParams,\n bodyParam: passwordResetBody\n });\n }\n\n /**\n * Update avatar image\n *\n * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.\n *\n * Updates the avatar image related to the person **personId**.\n *\n * The request body should be the binary stream for the avatar image. The content type of the file\n * should be an image file. This will be used to generate an \\\"avatar\\\" thumbnail rendition.\n *\n * You must be the person or have admin rights to update a person's avatar.\n *\n * You can use the -me- string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @param contentBodyUpdate The binary content\n * @returns Promise<{}>\n */\n updateAvatarImage(personId: string, contentBodyUpdate: string): Promise<any> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(contentBodyUpdate, 'contentBodyUpdate');\n\n const pathParams = {\n personId\n };\n\n const contentTypes = ['application/octet-stream'];\n\n return this.put({\n path: '/people/{personId}/avatar',\n pathParams,\n bodyParam: contentBodyUpdate,\n contentTypes\n });\n }\n\n /**\n * Update person\n *\n * **Note:** this endpoint is available in Alfresco 5.2 and newer versions.\n *\n * You can use the `-me-` string in place of <personId> to specify the currently authenticated user.\n * If applicable, the given person's login access can also be optionally disabled or re-enabled.\n * You must have admin rights to update a person — unless updating your own details.\n * If you are changing your password, as a non-admin user, then the existing password must also\n * be supplied (using the oldPassword field in addition to the new password value).\n *\n * Admin users cannot be disabled by setting enabled to false.\n * Non-admin users may not disable themselves.\n * **Note:** setting properties of type d:content and d:category are not supported.\n * @param personId The identifier of a person.\n * @param personBodyUpdate The person details.\n * @param opts Optional parameters\n * @returns Promise<PersonEntry>\n */\n updatePerson(personId: string, personBodyUpdate: PersonBodyUpdate, opts?: ContentFieldsQuery): Promise<PersonEntry> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(personBodyUpdate, 'personBodyUpdate');\n\n const pathParams = {\n personId\n };\n\n const queryParams = {\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.put({\n path: '/people/{personId}',\n pathParams,\n queryParams,\n bodyParam: personBodyUpdate,\n returnType: PersonEntry\n });\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"people.api.js","sourceRoot":"","sources":["people.api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAqE,WAAW,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxH,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAMlE,MAAM,OAAO,SAAU,SAAQ,OAAO;IAUlC,YAAY,CAAC,gBAAkC,EAAE,IAAyB;QACtE,iBAAiB,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;QAExD,MAAM,WAAW,GAAG;YAChB,MAAM,EAAE,oBAAoB,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,EAAE,KAAK,CAAC;SACpD,CAAC;QAEF,OAAO,IAAI,CAAC,IAAI,CAAC;YACb,IAAI,EAAE,SAAS;YACf,WAAW;YACX,SAAS,EAAE,gBAAgB;YAC3B,UAAU,EAAE,WAAW;SAC1B,CAAC,CAAC;IACP,CAAC;IAaD,iBAAiB,CAAC,QAAgB;QAC9B,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QAExC,MAAM,UAAU,GAAG;YACf,QAAQ;SACX,CAAC;QAEF,OAAO,IAAI,CAAC,MAAM,CAAC;YACf,IAAI,EAAE,2BAA2B;YACjC,UAAU;SACb,CAAC,CAAC;IACP,CAAC;IAyBD,cAAc,CAAC,QAAgB,EAAE,IAAgF;QAC7G,iBAAiB,CAA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;QAElD,OAAO,IAAI,CAAC,GAAG,CAAC;YACZ,IAAI,EAAE,2BAA2B;YACjC,UAAU;YACV,SAAS,EAAE,iBAAiB;YAC5B,YAAY;SACf,CAAC,CAAC;IACP,CAAC;IAYD,iBAAiB,CAAC,QAAgB;QAC9B,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QACtE,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,WAAW,QAAQ,2BAA2B,MAAM,EAAE,CAAC;IAC5F,CAAC;IAqBD,YAAY,CAAC,QAAgB,EAAE,gBAAkC,EAAE,IAAyB;QACxF,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QACxC,iBAAiB,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;QAExD,MAAM,UAAU,GAAG;YACf,QAAQ;SACX,CAAC;QAEF,MAAM,WAAW,GAAG;YAChB,MAAM,EAAE,oBAAoB,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,EAAE,KAAK,CAAC;SACpD,CAAC;QAEF,OAAO,IAAI,CAAC,GAAG,CAAC;YACZ,IAAI,EAAE,oBAAoB;YAC1B,UAAU;YACV,WAAW;YACX,SAAS,EAAE,gBAAgB;YAC3B,UAAU,EAAE,WAAW;SAC1B,CAAC,CAAC;IACP,CAAC;CACJ","sourcesContent":["/*!\n * @license\n * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ClientBody, PasswordResetBody, PersonBodyCreate, PersonBodyUpdate, PersonEntry, PersonPaging } from '../model';\nimport { BaseApi } from './base.api';\nimport { throwIfNotDefined } from '../../../assert';\nimport { buildCollectionParam } from '../../../alfrescoApiClient';\nimport { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types';\n\n/**\n * People service.\n */\nexport class PeopleApi extends BaseApi {\n /**\n * Create person\n *\n * **Note:** this endpoint is available in Alfresco 5.2 and newer versions.\n * **Note:** setting properties of type d:content and d:category are not supported.\n * @param personBodyCreate The person details.\n * @param opts Optional parameters\n * @returns Promise<PersonEntry>\n */\n createPerson(personBodyCreate: PersonBodyCreate, opts?: ContentFieldsQuery): Promise<PersonEntry> {\n throwIfNotDefined(personBodyCreate, 'personBodyCreate');\n\n const queryParams = {\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.post({\n path: '/people',\n queryParams,\n bodyParam: personBodyCreate,\n returnType: PersonEntry\n });\n }\n\n /**\n * Delete avatar image\n *\n * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.\n *\n * Deletes the avatar image related to person **personId**.\n * You must be the person or have admin rights to update a person's avatar.\n * You can use the -me- string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @returns Promise<{}>\n */\n deleteAvatarImage(personId: string): Promise<void> {\n throwIfNotDefined(personId, 'personId');\n\n const pathParams = {\n personId\n };\n\n return this.delete({\n path: '/people/{personId}/avatar',\n pathParams\n });\n }\n\n /**\n * Get avatar image\n *\n * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.\n *\n * Gets the avatar image related to the person **personId**. If the person has no related avatar then\n * the **placeholder** query parameter can be optionally used to request a placeholder image to be returned.\n *\n * You can use the -me- string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @param opts Optional parameters\n * @param opts.attachment **true** enables a web browser to download the file as an attachment.\n * **false** means a web browser may preview the file in a new tab or window, but not download the file.\n * You can only set this parameter to **false** if the content type of the file is in the supported list;\n * for example, certain image files and PDF files.\n * If the content type is not supported for preview, then a value of **false** is ignored, and\n * the attachment will be returned in the response. (default to true)\n * @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided.\n * Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT.\n * @param opts.placeholder If **true** and there is no avatar for this **personId**\n * then the placeholder image is returned, rather than a 404 response. (default to true)\n * @returns Promise<Blob>\n */\n getAvatarImage(personId: string, opts?: { attachment?: boolean; placeholder?: boolean; ifModifiedSince?: string }): Promise<Blob> {\n throwIfNotDefined(personId, 'personId');\n\n const pathParams = {\n personId\n };\n\n const queryParams = {\n attachment: opts?.attachment,\n placeholder: opts?.placeholder\n };\n\n const headerParams = {\n 'If-Modified-Since': opts?.ifModifiedSince\n };\n\n const accepts = ['application/octet-stream'];\n\n return this.get({\n path: '/people/{personId}/avatar',\n pathParams,\n queryParams,\n headerParams,\n accepts,\n returnType: 'blob'\n });\n }\n\n /**\n * Get a person\n *\n * You can use the `-me-` string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @param opts Optional parameters\n * @returns Promise<PersonEntry>\n */\n getPerson(personId: string, opts?: ContentFieldsQuery): Promise<PersonEntry> {\n throwIfNotDefined(personId, 'personId');\n\n const pathParams = {\n personId\n };\n\n const queryParams = {\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.get({\n path: '/people/{personId}',\n pathParams,\n queryParams,\n returnType: PersonEntry\n });\n }\n\n /**\n * List people\n *\n * **Note:** this endpoint is available in Alfresco 5.2 and newer versions.\n *\n * List people.\n *\n * You can use the **include** parameter to return any additional information.\n *\n * The default sort order for the returned list is for people to be sorted by ascending id.\n * You can override the default by using the **orderBy** parameter.\n *\n * You can use any of the following fields to order the results:\n * - id\n * - firstName\n * - lastName\n * @param opts Optional parameters\n * @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to\n * sort the list by one or more fields.\n *\n * Each field has a default sort order, which is normally ascending order. Read the API method implementation notes\n * above to check if any fields used in this method have a descending default search order.\n *\n * To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.\n * @returns Promise<PersonPaging>\n */\n listPeople(\n opts?: {\n orderBy?: string[];\n } & ContentPagingQuery &\n ContentIncludeQuery &\n ContentFieldsQuery\n ): Promise<PersonPaging> {\n const queryParams = {\n skipCount: opts?.skipCount,\n maxItems: opts?.maxItems,\n orderBy: buildCollectionParam(opts?.orderBy, 'csv'),\n include: buildCollectionParam(opts?.include, 'csv'),\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.get({\n path: '/people',\n queryParams,\n returnType: PersonPaging\n });\n }\n\n /**\n * Request password reset\n *\n * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.\n * **Note:** No authentication is required to call this endpoint.\n * @param personId The identifier of a person.\n * @param clientBody The client name to send email with app-specific url.\n * @returns Promise<{}>\n */\n requestPasswordReset(personId: string, clientBody: ClientBody): Promise<any> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(clientBody, 'clientBody');\n\n const pathParams = {\n personId\n };\n\n return this.post({\n path: '/people/{personId}/request-password-reset',\n pathParams,\n bodyParam: clientBody\n });\n }\n\n /**\n * Reset password\n *\n * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.\n * **Note:** No authentication is required to call this endpoint.\n * @param personId The identifier of a person.\n * @param passwordResetBody The reset password details\n * @returns Promise<{}>\n */\n resetPassword(personId: string, passwordResetBody: PasswordResetBody): Promise<any> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(passwordResetBody, 'passwordResetBody');\n\n const pathParams = {\n personId\n };\n\n return this.post({\n path: '/people/{personId}/reset-password',\n pathParams,\n bodyParam: passwordResetBody\n });\n }\n\n /**\n * Update avatar image\n *\n * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.\n *\n * Updates the avatar image related to the person **personId**.\n *\n * The request body should be the binary stream for the avatar image. The content type of the file\n * should be an image file. This will be used to generate an \\\"avatar\\\" thumbnail rendition.\n *\n * You must be the person or have admin rights to update a person's avatar.\n *\n * You can use the -me- string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @param contentBodyUpdate The binary content\n * @returns Promise<{}>\n */\n updateAvatarImage(personId: string, contentBodyUpdate: string): Promise<any> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(contentBodyUpdate, 'contentBodyUpdate');\n\n const pathParams = {\n personId\n };\n\n const contentTypes = ['application/octet-stream'];\n\n return this.put({\n path: '/people/{personId}/avatar',\n pathParams,\n bodyParam: contentBodyUpdate,\n contentTypes\n });\n }\n\n /**\n * Get avatar image URL\n *\n * Builds and returns the direct URL to fetch the avatar image for the person `personId`.\n * This includes the current authentication ticket in the URL to allow secure access.\n *\n * You can use the `-me-` string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @returns A string URL to the user's avatar image.\n */\n getAvatarImageUrl(personId: string): string {\n const ticket = this.alfrescoApi.contentClient.getAlfTicket(undefined);\n return `${this.apiClient.basePath}/people/${personId}/avatar?placeholder=true${ticket}`;\n }\n\n /**\n * Update person\n *\n * **Note:** this endpoint is available in Alfresco 5.2 and newer versions.\n *\n * You can use the `-me-` string in place of <personId> to specify the currently authenticated user.\n * If applicable, the given person's login access can also be optionally disabled or re-enabled.\n * You must have admin rights to update a person — unless updating your own details.\n * If you are changing your password, as a non-admin user, then the existing password must also\n * be supplied (using the oldPassword field in addition to the new password value).\n *\n * Admin users cannot be disabled by setting enabled to false.\n * Non-admin users may not disable themselves.\n * **Note:** setting properties of type d:content and d:category are not supported.\n * @param personId The identifier of a person.\n * @param personBodyUpdate The person details.\n * @param opts Optional parameters\n * @returns Promise<PersonEntry>\n */\n updatePerson(personId: string, personBodyUpdate: PersonBodyUpdate, opts?: ContentFieldsQuery): Promise<PersonEntry> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(personBodyUpdate, 'personBodyUpdate');\n\n const pathParams = {\n personId\n };\n\n const queryParams = {\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.put({\n path: '/people/{personId}',\n pathParams,\n queryParams,\n bodyParam: personBodyUpdate,\n returnType: PersonEntry\n });\n }\n}\n"]}
|
package/esm5/package.json
CHANGED
@@ -130,6 +130,10 @@ export class PeopleApi extends BaseApi {
|
|
130
130
|
contentTypes
|
131
131
|
});
|
132
132
|
}
|
133
|
+
getAvatarImageUrl(personId) {
|
134
|
+
const ticket = this.alfrescoApi.contentClient.getAlfTicket(undefined);
|
135
|
+
return `${this.apiClient.basePath}/people/${personId}/avatar?placeholder=true${ticket}`;
|
136
|
+
}
|
133
137
|
updatePerson(personId, personBodyUpdate, opts) {
|
134
138
|
throwIfNotDefined(personId, 'personId');
|
135
139
|
throwIfNotDefined(personBodyUpdate, 'personBodyUpdate');
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"people.api.js","sourceRoot":"","sources":["people.api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAqE,WAAW,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxH,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAMlE,MAAM,OAAO,SAAU,SAAQ,OAAO;IAUlC,YAAY,CAAC,gBAAkC,EAAE,IAAyB;QACtE,iBAAiB,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;QAExD,MAAM,WAAW,GAAG;YAChB,MAAM,EAAE,oBAAoB,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,EAAE,KAAK,CAAC;SACpD,CAAC;QAEF,OAAO,IAAI,CAAC,IAAI,CAAC;YACb,IAAI,EAAE,SAAS;YACf,WAAW;YACX,SAAS,EAAE,gBAAgB;YAC3B,UAAU,EAAE,WAAW;SAC1B,CAAC,CAAC;IACP,CAAC;IAaD,iBAAiB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/B,CAAC,CAAC;IACP,CAAC;IAmBD,iBAAiB,CAAC,QAAgB,EAAE,iBAAyB;QACzD,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QACxC,iBAAiB,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAAC;QAE1D,MAAM,UAAU,GAAG;YACf,QAAQ;SACX,CAAC;QAEF,MAAM,YAAY,GAAG,CAAC,0BAA0B,CAAC,CAAC;QAElD,OAAO,IAAI,CAAC,GAAG,CAAC;YACZ,IAAI,EAAE,2BAA2B;YACjC,UAAU;YACV,SAAS,EAAE,iBAAiB;YAC5B,YAAY;SACf,CAAC,CAAC;IACP,CAAC;IAqBD,YAAY,CAAC,QAAgB,EAAE,gBAAkC,EAAE,IAAyB;QACxF,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QACxC,iBAAiB,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;QAExD,MAAM,UAAU,GAAG;YACf,QAAQ;SACX,CAAC;QAEF,MAAM,WAAW,GAAG;YAChB,MAAM,EAAE,oBAAoB,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,EAAE,KAAK,CAAC;SACpD,CAAC;QAEF,OAAO,IAAI,CAAC,GAAG,CAAC;YACZ,IAAI,EAAE,oBAAoB;YAC1B,UAAU;YACV,WAAW;YACX,SAAS,EAAE,gBAAgB;YAC3B,UAAU,EAAE,WAAW;SAC1B,CAAC,CAAC;IACP,CAAC;CACJ","sourcesContent":["/*!\n * @license\n * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ClientBody, PasswordResetBody, PersonBodyCreate, PersonBodyUpdate, PersonEntry, PersonPaging } from '../model';\nimport { BaseApi } from './base.api';\nimport { throwIfNotDefined } from '../../../assert';\nimport { buildCollectionParam } from '../../../alfrescoApiClient';\nimport { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types';\n\n/**\n * People service.\n */\nexport class PeopleApi extends BaseApi {\n /**\n * Create person\n *\n * **Note:** this endpoint is available in Alfresco 5.2 and newer versions.\n * **Note:** setting properties of type d:content and d:category are not supported.\n * @param personBodyCreate The person details.\n * @param opts Optional parameters\n * @returns Promise<PersonEntry>\n */\n createPerson(personBodyCreate: PersonBodyCreate, opts?: ContentFieldsQuery): Promise<PersonEntry> {\n throwIfNotDefined(personBodyCreate, 'personBodyCreate');\n\n const queryParams = {\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.post({\n path: '/people',\n queryParams,\n bodyParam: personBodyCreate,\n returnType: PersonEntry\n });\n }\n\n /**\n * Delete avatar image\n *\n * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.\n *\n * Deletes the avatar image related to person **personId**.\n * You must be the person or have admin rights to update a person's avatar.\n * You can use the -me- string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @returns Promise<{}>\n */\n deleteAvatarImage(personId: string): Promise<void> {\n throwIfNotDefined(personId, 'personId');\n\n const pathParams = {\n personId\n };\n\n return this.delete({\n path: '/people/{personId}/avatar',\n pathParams\n });\n }\n\n /**\n * Get avatar image\n *\n * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.\n *\n * Gets the avatar image related to the person **personId**. If the person has no related avatar then\n * the **placeholder** query parameter can be optionally used to request a placeholder image to be returned.\n *\n * You can use the -me- string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @param opts Optional parameters\n * @param opts.attachment **true** enables a web browser to download the file as an attachment.\n * **false** means a web browser may preview the file in a new tab or window, but not download the file.\n * You can only set this parameter to **false** if the content type of the file is in the supported list;\n * for example, certain image files and PDF files.\n * If the content type is not supported for preview, then a value of **false** is ignored, and\n * the attachment will be returned in the response. (default to true)\n * @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided.\n * Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT.\n * @param opts.placeholder If **true** and there is no avatar for this **personId**\n * then the placeholder image is returned, rather than a 404 response. (default to true)\n * @returns Promise<Blob>\n */\n getAvatarImage(personId: string, opts?: { attachment?: boolean; placeholder?: boolean; ifModifiedSince?: string }): Promise<Blob> {\n throwIfNotDefined(personId, 'personId');\n\n const pathParams = {\n personId\n };\n\n const queryParams = {\n attachment: opts?.attachment,\n placeholder: opts?.placeholder\n };\n\n const headerParams = {\n 'If-Modified-Since': opts?.ifModifiedSince\n };\n\n const accepts = ['application/octet-stream'];\n\n return this.get({\n path: '/people/{personId}/avatar',\n pathParams,\n queryParams,\n headerParams,\n accepts,\n returnType: 'blob'\n });\n }\n\n /**\n * Get a person\n *\n * You can use the `-me-` string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @param opts Optional parameters\n * @returns Promise<PersonEntry>\n */\n getPerson(personId: string, opts?: ContentFieldsQuery): Promise<PersonEntry> {\n throwIfNotDefined(personId, 'personId');\n\n const pathParams = {\n personId\n };\n\n const queryParams = {\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.get({\n path: '/people/{personId}',\n pathParams,\n queryParams,\n returnType: PersonEntry\n });\n }\n\n /**\n * List people\n *\n * **Note:** this endpoint is available in Alfresco 5.2 and newer versions.\n *\n * List people.\n *\n * You can use the **include** parameter to return any additional information.\n *\n * The default sort order for the returned list is for people to be sorted by ascending id.\n * You can override the default by using the **orderBy** parameter.\n *\n * You can use any of the following fields to order the results:\n * - id\n * - firstName\n * - lastName\n * @param opts Optional parameters\n * @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to\n * sort the list by one or more fields.\n *\n * Each field has a default sort order, which is normally ascending order. Read the API method implementation notes\n * above to check if any fields used in this method have a descending default search order.\n *\n * To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.\n * @returns Promise<PersonPaging>\n */\n listPeople(\n opts?: {\n orderBy?: string[];\n } & ContentPagingQuery &\n ContentIncludeQuery &\n ContentFieldsQuery\n ): Promise<PersonPaging> {\n const queryParams = {\n skipCount: opts?.skipCount,\n maxItems: opts?.maxItems,\n orderBy: buildCollectionParam(opts?.orderBy, 'csv'),\n include: buildCollectionParam(opts?.include, 'csv'),\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.get({\n path: '/people',\n queryParams,\n returnType: PersonPaging\n });\n }\n\n /**\n * Request password reset\n *\n * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.\n * **Note:** No authentication is required to call this endpoint.\n * @param personId The identifier of a person.\n * @param clientBody The client name to send email with app-specific url.\n * @returns Promise<{}>\n */\n requestPasswordReset(personId: string, clientBody: ClientBody): Promise<any> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(clientBody, 'clientBody');\n\n const pathParams = {\n personId\n };\n\n return this.post({\n path: '/people/{personId}/request-password-reset',\n pathParams,\n bodyParam: clientBody\n });\n }\n\n /**\n * Reset password\n *\n * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.\n * **Note:** No authentication is required to call this endpoint.\n * @param personId The identifier of a person.\n * @param passwordResetBody The reset password details\n * @returns Promise<{}>\n */\n resetPassword(personId: string, passwordResetBody: PasswordResetBody): Promise<any> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(passwordResetBody, 'passwordResetBody');\n\n const pathParams = {\n personId\n };\n\n return this.post({\n path: '/people/{personId}/reset-password',\n pathParams,\n bodyParam: passwordResetBody\n });\n }\n\n /**\n * Update avatar image\n *\n * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.\n *\n * Updates the avatar image related to the person **personId**.\n *\n * The request body should be the binary stream for the avatar image. The content type of the file\n * should be an image file. This will be used to generate an \\\"avatar\\\" thumbnail rendition.\n *\n * You must be the person or have admin rights to update a person's avatar.\n *\n * You can use the -me- string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @param contentBodyUpdate The binary content\n * @returns Promise<{}>\n */\n updateAvatarImage(personId: string, contentBodyUpdate: string): Promise<any> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(contentBodyUpdate, 'contentBodyUpdate');\n\n const pathParams = {\n personId\n };\n\n const contentTypes = ['application/octet-stream'];\n\n return this.put({\n path: '/people/{personId}/avatar',\n pathParams,\n bodyParam: contentBodyUpdate,\n contentTypes\n });\n }\n\n /**\n * Update person\n *\n * **Note:** this endpoint is available in Alfresco 5.2 and newer versions.\n *\n * You can use the `-me-` string in place of <personId> to specify the currently authenticated user.\n * If applicable, the given person's login access can also be optionally disabled or re-enabled.\n * You must have admin rights to update a person — unless updating your own details.\n * If you are changing your password, as a non-admin user, then the existing password must also\n * be supplied (using the oldPassword field in addition to the new password value).\n *\n * Admin users cannot be disabled by setting enabled to false.\n * Non-admin users may not disable themselves.\n * **Note:** setting properties of type d:content and d:category are not supported.\n * @param personId The identifier of a person.\n * @param personBodyUpdate The person details.\n * @param opts Optional parameters\n * @returns Promise<PersonEntry>\n */\n updatePerson(personId: string, personBodyUpdate: PersonBodyUpdate, opts?: ContentFieldsQuery): Promise<PersonEntry> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(personBodyUpdate, 'personBodyUpdate');\n\n const pathParams = {\n personId\n };\n\n const queryParams = {\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.put({\n path: '/people/{personId}',\n pathParams,\n queryParams,\n bodyParam: personBodyUpdate,\n returnType: PersonEntry\n });\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"people.api.js","sourceRoot":"","sources":["people.api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAqE,WAAW,EAAE,YAAY,EAAE,MA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CAAC;IAqBD,YAAY,CAAC,QAAgB,EAAE,gBAAkC,EAAE,IAAyB;QACxF,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QACxC,iBAAiB,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;QAExD,MAAM,UAAU,GAAG;YACf,QAAQ;SACX,CAAC;QAEF,MAAM,WAAW,GAAG;YAChB,MAAM,EAAE,oBAAoB,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,EAAE,KAAK,CAAC;SACpD,CAAC;QAEF,OAAO,IAAI,CAAC,GAAG,CAAC;YACZ,IAAI,EAAE,oBAAoB;YAC1B,UAAU;YACV,WAAW;YACX,SAAS,EAAE,gBAAgB;YAC3B,UAAU,EAAE,WAAW;SAC1B,CAAC,CAAC;IACP,CAAC;CACJ","sourcesContent":["/*!\n * @license\n * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ClientBody, PasswordResetBody, PersonBodyCreate, PersonBodyUpdate, PersonEntry, PersonPaging } from '../model';\nimport { BaseApi } from './base.api';\nimport { throwIfNotDefined } from '../../../assert';\nimport { buildCollectionParam } from '../../../alfrescoApiClient';\nimport { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types';\n\n/**\n * People service.\n */\nexport class PeopleApi extends BaseApi {\n /**\n * Create person\n *\n * **Note:** this endpoint is available in Alfresco 5.2 and newer versions.\n * **Note:** setting properties of type d:content and d:category are not supported.\n * @param personBodyCreate The person details.\n * @param opts Optional parameters\n * @returns Promise<PersonEntry>\n */\n createPerson(personBodyCreate: PersonBodyCreate, opts?: ContentFieldsQuery): Promise<PersonEntry> {\n throwIfNotDefined(personBodyCreate, 'personBodyCreate');\n\n const queryParams = {\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.post({\n path: '/people',\n queryParams,\n bodyParam: personBodyCreate,\n returnType: PersonEntry\n });\n }\n\n /**\n * Delete avatar image\n *\n * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.\n *\n * Deletes the avatar image related to person **personId**.\n * You must be the person or have admin rights to update a person's avatar.\n * You can use the -me- string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @returns Promise<{}>\n */\n deleteAvatarImage(personId: string): Promise<void> {\n throwIfNotDefined(personId, 'personId');\n\n const pathParams = {\n personId\n };\n\n return this.delete({\n path: '/people/{personId}/avatar',\n pathParams\n });\n }\n\n /**\n * Get avatar image\n *\n * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.\n *\n * Gets the avatar image related to the person **personId**. If the person has no related avatar then\n * the **placeholder** query parameter can be optionally used to request a placeholder image to be returned.\n *\n * You can use the -me- string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @param opts Optional parameters\n * @param opts.attachment **true** enables a web browser to download the file as an attachment.\n * **false** means a web browser may preview the file in a new tab or window, but not download the file.\n * You can only set this parameter to **false** if the content type of the file is in the supported list;\n * for example, certain image files and PDF files.\n * If the content type is not supported for preview, then a value of **false** is ignored, and\n * the attachment will be returned in the response. (default to true)\n * @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided.\n * Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT.\n * @param opts.placeholder If **true** and there is no avatar for this **personId**\n * then the placeholder image is returned, rather than a 404 response. (default to true)\n * @returns Promise<Blob>\n */\n getAvatarImage(personId: string, opts?: { attachment?: boolean; placeholder?: boolean; ifModifiedSince?: string }): Promise<Blob> {\n throwIfNotDefined(personId, 'personId');\n\n const pathParams = {\n personId\n };\n\n const queryParams = {\n attachment: opts?.attachment,\n placeholder: opts?.placeholder\n };\n\n const headerParams = {\n 'If-Modified-Since': opts?.ifModifiedSince\n };\n\n const accepts = ['application/octet-stream'];\n\n return this.get({\n path: '/people/{personId}/avatar',\n pathParams,\n queryParams,\n headerParams,\n accepts,\n returnType: 'blob'\n });\n }\n\n /**\n * Get a person\n *\n * You can use the `-me-` string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @param opts Optional parameters\n * @returns Promise<PersonEntry>\n */\n getPerson(personId: string, opts?: ContentFieldsQuery): Promise<PersonEntry> {\n throwIfNotDefined(personId, 'personId');\n\n const pathParams = {\n personId\n };\n\n const queryParams = {\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.get({\n path: '/people/{personId}',\n pathParams,\n queryParams,\n returnType: PersonEntry\n });\n }\n\n /**\n * List people\n *\n * **Note:** this endpoint is available in Alfresco 5.2 and newer versions.\n *\n * List people.\n *\n * You can use the **include** parameter to return any additional information.\n *\n * The default sort order for the returned list is for people to be sorted by ascending id.\n * You can override the default by using the **orderBy** parameter.\n *\n * You can use any of the following fields to order the results:\n * - id\n * - firstName\n * - lastName\n * @param opts Optional parameters\n * @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to\n * sort the list by one or more fields.\n *\n * Each field has a default sort order, which is normally ascending order. Read the API method implementation notes\n * above to check if any fields used in this method have a descending default search order.\n *\n * To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.\n * @returns Promise<PersonPaging>\n */\n listPeople(\n opts?: {\n orderBy?: string[];\n } & ContentPagingQuery &\n ContentIncludeQuery &\n ContentFieldsQuery\n ): Promise<PersonPaging> {\n const queryParams = {\n skipCount: opts?.skipCount,\n maxItems: opts?.maxItems,\n orderBy: buildCollectionParam(opts?.orderBy, 'csv'),\n include: buildCollectionParam(opts?.include, 'csv'),\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.get({\n path: '/people',\n queryParams,\n returnType: PersonPaging\n });\n }\n\n /**\n * Request password reset\n *\n * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.\n * **Note:** No authentication is required to call this endpoint.\n * @param personId The identifier of a person.\n * @param clientBody The client name to send email with app-specific url.\n * @returns Promise<{}>\n */\n requestPasswordReset(personId: string, clientBody: ClientBody): Promise<any> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(clientBody, 'clientBody');\n\n const pathParams = {\n personId\n };\n\n return this.post({\n path: '/people/{personId}/request-password-reset',\n pathParams,\n bodyParam: clientBody\n });\n }\n\n /**\n * Reset password\n *\n * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.\n * **Note:** No authentication is required to call this endpoint.\n * @param personId The identifier of a person.\n * @param passwordResetBody The reset password details\n * @returns Promise<{}>\n */\n resetPassword(personId: string, passwordResetBody: PasswordResetBody): Promise<any> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(passwordResetBody, 'passwordResetBody');\n\n const pathParams = {\n personId\n };\n\n return this.post({\n path: '/people/{personId}/reset-password',\n pathParams,\n bodyParam: passwordResetBody\n });\n }\n\n /**\n * Update avatar image\n *\n * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.\n *\n * Updates the avatar image related to the person **personId**.\n *\n * The request body should be the binary stream for the avatar image. The content type of the file\n * should be an image file. This will be used to generate an \\\"avatar\\\" thumbnail rendition.\n *\n * You must be the person or have admin rights to update a person's avatar.\n *\n * You can use the -me- string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @param contentBodyUpdate The binary content\n * @returns Promise<{}>\n */\n updateAvatarImage(personId: string, contentBodyUpdate: string): Promise<any> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(contentBodyUpdate, 'contentBodyUpdate');\n\n const pathParams = {\n personId\n };\n\n const contentTypes = ['application/octet-stream'];\n\n return this.put({\n path: '/people/{personId}/avatar',\n pathParams,\n bodyParam: contentBodyUpdate,\n contentTypes\n });\n }\n\n /**\n * Get avatar image URL\n *\n * Builds and returns the direct URL to fetch the avatar image for the person `personId`.\n * This includes the current authentication ticket in the URL to allow secure access.\n *\n * You can use the `-me-` string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @returns A string URL to the user's avatar image.\n */\n getAvatarImageUrl(personId: string): string {\n const ticket = this.alfrescoApi.contentClient.getAlfTicket(undefined);\n return `${this.apiClient.basePath}/people/${personId}/avatar?placeholder=true${ticket}`;\n }\n\n /**\n * Update person\n *\n * **Note:** this endpoint is available in Alfresco 5.2 and newer versions.\n *\n * You can use the `-me-` string in place of <personId> to specify the currently authenticated user.\n * If applicable, the given person's login access can also be optionally disabled or re-enabled.\n * You must have admin rights to update a person — unless updating your own details.\n * If you are changing your password, as a non-admin user, then the existing password must also\n * be supplied (using the oldPassword field in addition to the new password value).\n *\n * Admin users cannot be disabled by setting enabled to false.\n * Non-admin users may not disable themselves.\n * **Note:** setting properties of type d:content and d:category are not supported.\n * @param personId The identifier of a person.\n * @param personBodyUpdate The person details.\n * @param opts Optional parameters\n * @returns Promise<PersonEntry>\n */\n updatePerson(personId: string, personBodyUpdate: PersonBodyUpdate, opts?: ContentFieldsQuery): Promise<PersonEntry> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(personBodyUpdate, 'personBodyUpdate');\n\n const pathParams = {\n personId\n };\n\n const queryParams = {\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.put({\n path: '/people/{personId}',\n pathParams,\n queryParams,\n bodyParam: personBodyUpdate,\n returnType: PersonEntry\n });\n }\n}\n"]}
|
package/package.json
CHANGED
@@ -133,6 +133,10 @@ class PeopleApi extends base_api_1.BaseApi {
|
|
133
133
|
contentTypes
|
134
134
|
});
|
135
135
|
}
|
136
|
+
getAvatarImageUrl(personId) {
|
137
|
+
const ticket = this.alfrescoApi.contentClient.getAlfTicket(undefined);
|
138
|
+
return `${this.apiClient.basePath}/people/${personId}/avatar?placeholder=true${ticket}`;
|
139
|
+
}
|
136
140
|
updatePerson(personId, personBodyUpdate, opts) {
|
137
141
|
(0, assert_1.throwIfNotDefined)(personId, 'personId');
|
138
142
|
(0, assert_1.throwIfNotDefined)(personBodyUpdate, 'personBodyUpdate');
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"people.api.js","sourceRoot":"","sources":["people.api.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH,oCAAwH;AACxH,yCAAqC;AACrC,4CAAoD;AACpD,kEAAkE;AAMlE,MAAa,SAAU,SAAQ,kBAAO;IAUlC,YAAY,CAAC,gBAAkC,EAAE,IAAyB;QACtE,IAAA,0BAAiB,EAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;QAExD,MAAM,WAAW,GAAG;YAChB,MAAM,EAAE,IAAA,wCAAoB,EAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,EAAE,KAAK,CAAC;SACpD,CAAC;QAEF,OAAO,IAAI,CAAC,IAAI,CAAC;YACb,IAAI,EAAE,SAAS;YACf,WAAW;YACX,SAAS,EAAE,gBAAgB;YAC3B,UAAU,EAAE,mBAAW;SAC1B,CAAC,CAAC;IACP,CAAC;IAaD,iBAAiB,CAAC,QAAgB;QAC9B,IAAA,0BAAiB,EAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QAExC,MAAM,UAAU,GAAG;YACf,QAAQ;SACX,CAAC;QAEF,OAAO,IAAI,CAAC,MAAM,CAAC;YACf,IAAI,EAAE,2BAA2B;YACjC,UAAU;SACb,CAAC,CAAC;IACP,CAAC;IAyBD,cAAc,CAAC,QAAgB,EAAE,IAAgF;QAC7G,IAAA,0BAAiB,EAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QAExC,MAAM,UAAU,GAAG;YACf,QAAQ;SACX,CAAC;QAEF,MAAM,WAAW,GAAG;YAChB,UAAU,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU;YAC5B,WAAW,EAAE,IAAI,a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AAC;IACP,CAAC;IAqBD,YAAY,CAAC,QAAgB,EAAE,gBAAkC,EAAE,IAAyB;QACxF,IAAA,0BAAiB,EAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QACxC,IAAA,0BAAiB,EAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;QAExD,MAAM,UAAU,GAAG;YACf,QAAQ;SACX,CAAC;QAEF,MAAM,WAAW,GAAG;YAChB,MAAM,EAAE,IAAA,wCAAoB,EAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,EAAE,KAAK,CAAC;SACpD,CAAC;QAEF,OAAO,IAAI,CAAC,GAAG,CAAC;YACZ,IAAI,EAAE,oBAAoB;YAC1B,UAAU;YACV,WAAW;YACX,SAAS,EAAE,gBAAgB;YAC3B,UAAU,EAAE,mBAAW;SAC1B,CAAC,CAAC;IACP,CAAC;CACJ;AAzSD,8BAySC","sourcesContent":["/*!\n * @license\n * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ClientBody, PasswordResetBody, PersonBodyCreate, PersonBodyUpdate, PersonEntry, PersonPaging } from '../model';\nimport { BaseApi } from './base.api';\nimport { throwIfNotDefined } from '../../../assert';\nimport { buildCollectionParam } from '../../../alfrescoApiClient';\nimport { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types';\n\n/**\n * People service.\n */\nexport class PeopleApi extends BaseApi {\n /**\n * Create person\n *\n * **Note:** this endpoint is available in Alfresco 5.2 and newer versions.\n * **Note:** setting properties of type d:content and d:category are not supported.\n * @param personBodyCreate The person details.\n * @param opts Optional parameters\n * @returns Promise<PersonEntry>\n */\n createPerson(personBodyCreate: PersonBodyCreate, opts?: ContentFieldsQuery): Promise<PersonEntry> {\n throwIfNotDefined(personBodyCreate, 'personBodyCreate');\n\n const queryParams = {\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.post({\n path: '/people',\n queryParams,\n bodyParam: personBodyCreate,\n returnType: PersonEntry\n });\n }\n\n /**\n * Delete avatar image\n *\n * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.\n *\n * Deletes the avatar image related to person **personId**.\n * You must be the person or have admin rights to update a person's avatar.\n * You can use the -me- string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @returns Promise<{}>\n */\n deleteAvatarImage(personId: string): Promise<void> {\n throwIfNotDefined(personId, 'personId');\n\n const pathParams = {\n personId\n };\n\n return this.delete({\n path: '/people/{personId}/avatar',\n pathParams\n });\n }\n\n /**\n * Get avatar image\n *\n * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.\n *\n * Gets the avatar image related to the person **personId**. If the person has no related avatar then\n * the **placeholder** query parameter can be optionally used to request a placeholder image to be returned.\n *\n * You can use the -me- string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @param opts Optional parameters\n * @param opts.attachment **true** enables a web browser to download the file as an attachment.\n * **false** means a web browser may preview the file in a new tab or window, but not download the file.\n * You can only set this parameter to **false** if the content type of the file is in the supported list;\n * for example, certain image files and PDF files.\n * If the content type is not supported for preview, then a value of **false** is ignored, and\n * the attachment will be returned in the response. (default to true)\n * @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided.\n * Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT.\n * @param opts.placeholder If **true** and there is no avatar for this **personId**\n * then the placeholder image is returned, rather than a 404 response. (default to true)\n * @returns Promise<Blob>\n */\n getAvatarImage(personId: string, opts?: { attachment?: boolean; placeholder?: boolean; ifModifiedSince?: string }): Promise<Blob> {\n throwIfNotDefined(personId, 'personId');\n\n const pathParams = {\n personId\n };\n\n const queryParams = {\n attachment: opts?.attachment,\n placeholder: opts?.placeholder\n };\n\n const headerParams = {\n 'If-Modified-Since': opts?.ifModifiedSince\n };\n\n const accepts = ['application/octet-stream'];\n\n return this.get({\n path: '/people/{personId}/avatar',\n pathParams,\n queryParams,\n headerParams,\n accepts,\n returnType: 'blob'\n });\n }\n\n /**\n * Get a person\n *\n * You can use the `-me-` string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @param opts Optional parameters\n * @returns Promise<PersonEntry>\n */\n getPerson(personId: string, opts?: ContentFieldsQuery): Promise<PersonEntry> {\n throwIfNotDefined(personId, 'personId');\n\n const pathParams = {\n personId\n };\n\n const queryParams = {\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.get({\n path: '/people/{personId}',\n pathParams,\n queryParams,\n returnType: PersonEntry\n });\n }\n\n /**\n * List people\n *\n * **Note:** this endpoint is available in Alfresco 5.2 and newer versions.\n *\n * List people.\n *\n * You can use the **include** parameter to return any additional information.\n *\n * The default sort order for the returned list is for people to be sorted by ascending id.\n * You can override the default by using the **orderBy** parameter.\n *\n * You can use any of the following fields to order the results:\n * - id\n * - firstName\n * - lastName\n * @param opts Optional parameters\n * @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to\n * sort the list by one or more fields.\n *\n * Each field has a default sort order, which is normally ascending order. Read the API method implementation notes\n * above to check if any fields used in this method have a descending default search order.\n *\n * To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.\n * @returns Promise<PersonPaging>\n */\n listPeople(\n opts?: {\n orderBy?: string[];\n } & ContentPagingQuery &\n ContentIncludeQuery &\n ContentFieldsQuery\n ): Promise<PersonPaging> {\n const queryParams = {\n skipCount: opts?.skipCount,\n maxItems: opts?.maxItems,\n orderBy: buildCollectionParam(opts?.orderBy, 'csv'),\n include: buildCollectionParam(opts?.include, 'csv'),\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.get({\n path: '/people',\n queryParams,\n returnType: PersonPaging\n });\n }\n\n /**\n * Request password reset\n *\n * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.\n * **Note:** No authentication is required to call this endpoint.\n * @param personId The identifier of a person.\n * @param clientBody The client name to send email with app-specific url.\n * @returns Promise<{}>\n */\n requestPasswordReset(personId: string, clientBody: ClientBody): Promise<any> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(clientBody, 'clientBody');\n\n const pathParams = {\n personId\n };\n\n return this.post({\n path: '/people/{personId}/request-password-reset',\n pathParams,\n bodyParam: clientBody\n });\n }\n\n /**\n * Reset password\n *\n * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.\n * **Note:** No authentication is required to call this endpoint.\n * @param personId The identifier of a person.\n * @param passwordResetBody The reset password details\n * @returns Promise<{}>\n */\n resetPassword(personId: string, passwordResetBody: PasswordResetBody): Promise<any> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(passwordResetBody, 'passwordResetBody');\n\n const pathParams = {\n personId\n };\n\n return this.post({\n path: '/people/{personId}/reset-password',\n pathParams,\n bodyParam: passwordResetBody\n });\n }\n\n /**\n * Update avatar image\n *\n * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.\n *\n * Updates the avatar image related to the person **personId**.\n *\n * The request body should be the binary stream for the avatar image. The content type of the file\n * should be an image file. This will be used to generate an \\\"avatar\\\" thumbnail rendition.\n *\n * You must be the person or have admin rights to update a person's avatar.\n *\n * You can use the -me- string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @param contentBodyUpdate The binary content\n * @returns Promise<{}>\n */\n updateAvatarImage(personId: string, contentBodyUpdate: string): Promise<any> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(contentBodyUpdate, 'contentBodyUpdate');\n\n const pathParams = {\n personId\n };\n\n const contentTypes = ['application/octet-stream'];\n\n return this.put({\n path: '/people/{personId}/avatar',\n pathParams,\n bodyParam: contentBodyUpdate,\n contentTypes\n });\n }\n\n /**\n * Update person\n *\n * **Note:** this endpoint is available in Alfresco 5.2 and newer versions.\n *\n * You can use the `-me-` string in place of <personId> to specify the currently authenticated user.\n * If applicable, the given person's login access can also be optionally disabled or re-enabled.\n * You must have admin rights to update a person — unless updating your own details.\n * If you are changing your password, as a non-admin user, then the existing password must also\n * be supplied (using the oldPassword field in addition to the new password value).\n *\n * Admin users cannot be disabled by setting enabled to false.\n * Non-admin users may not disable themselves.\n * **Note:** setting properties of type d:content and d:category are not supported.\n * @param personId The identifier of a person.\n * @param personBodyUpdate The person details.\n * @param opts Optional parameters\n * @returns Promise<PersonEntry>\n */\n updatePerson(personId: string, personBodyUpdate: PersonBodyUpdate, opts?: ContentFieldsQuery): Promise<PersonEntry> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(personBodyUpdate, 'personBodyUpdate');\n\n const pathParams = {\n personId\n };\n\n const queryParams = {\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.put({\n path: '/people/{personId}',\n pathParams,\n queryParams,\n bodyParam: personBodyUpdate,\n returnType: PersonEntry\n });\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"people.api.js","sourceRoot":"","sources":["people.api.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH,oCAAwH;AACxH,yCAAqC;AACrC,4CAAoD;AACpD,kEAAkE;AAMlE,MAAa,SAAU,SAAQ,kBAAO;IAUlC,YAAY,CAAC,gBAAkC,EAAE,IAAyB;QACtE,IAAA,0BAAiB,EAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;QAExD,MAAM,WAAW,GAAG;YAChB,MAAM,EAAE,IAAA,wCAAoB,EAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,EAAE,KAAK,CAAC;SACpD,CAAC;QAEF,OAAO,IAAI,CAAC,IAAI,CAAC;YACb,IAAI,EAAE,SAAS;YACf,WAAW;YACX,SAA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,UAAU;YACV,WAAW;YACX,SAAS,EAAE,gBAAgB;YAC3B,UAAU,EAAE,mBAAW;SAC1B,CAAC,CAAC;IACP,CAAC;CACJ;AAxTD,8BAwTC","sourcesContent":["/*!\n * @license\n * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ClientBody, PasswordResetBody, PersonBodyCreate, PersonBodyUpdate, PersonEntry, PersonPaging } from '../model';\nimport { BaseApi } from './base.api';\nimport { throwIfNotDefined } from '../../../assert';\nimport { buildCollectionParam } from '../../../alfrescoApiClient';\nimport { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types';\n\n/**\n * People service.\n */\nexport class PeopleApi extends BaseApi {\n /**\n * Create person\n *\n * **Note:** this endpoint is available in Alfresco 5.2 and newer versions.\n * **Note:** setting properties of type d:content and d:category are not supported.\n * @param personBodyCreate The person details.\n * @param opts Optional parameters\n * @returns Promise<PersonEntry>\n */\n createPerson(personBodyCreate: PersonBodyCreate, opts?: ContentFieldsQuery): Promise<PersonEntry> {\n throwIfNotDefined(personBodyCreate, 'personBodyCreate');\n\n const queryParams = {\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.post({\n path: '/people',\n queryParams,\n bodyParam: personBodyCreate,\n returnType: PersonEntry\n });\n }\n\n /**\n * Delete avatar image\n *\n * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.\n *\n * Deletes the avatar image related to person **personId**.\n * You must be the person or have admin rights to update a person's avatar.\n * You can use the -me- string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @returns Promise<{}>\n */\n deleteAvatarImage(personId: string): Promise<void> {\n throwIfNotDefined(personId, 'personId');\n\n const pathParams = {\n personId\n };\n\n return this.delete({\n path: '/people/{personId}/avatar',\n pathParams\n });\n }\n\n /**\n * Get avatar image\n *\n * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.\n *\n * Gets the avatar image related to the person **personId**. If the person has no related avatar then\n * the **placeholder** query parameter can be optionally used to request a placeholder image to be returned.\n *\n * You can use the -me- string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @param opts Optional parameters\n * @param opts.attachment **true** enables a web browser to download the file as an attachment.\n * **false** means a web browser may preview the file in a new tab or window, but not download the file.\n * You can only set this parameter to **false** if the content type of the file is in the supported list;\n * for example, certain image files and PDF files.\n * If the content type is not supported for preview, then a value of **false** is ignored, and\n * the attachment will be returned in the response. (default to true)\n * @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided.\n * Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT.\n * @param opts.placeholder If **true** and there is no avatar for this **personId**\n * then the placeholder image is returned, rather than a 404 response. (default to true)\n * @returns Promise<Blob>\n */\n getAvatarImage(personId: string, opts?: { attachment?: boolean; placeholder?: boolean; ifModifiedSince?: string }): Promise<Blob> {\n throwIfNotDefined(personId, 'personId');\n\n const pathParams = {\n personId\n };\n\n const queryParams = {\n attachment: opts?.attachment,\n placeholder: opts?.placeholder\n };\n\n const headerParams = {\n 'If-Modified-Since': opts?.ifModifiedSince\n };\n\n const accepts = ['application/octet-stream'];\n\n return this.get({\n path: '/people/{personId}/avatar',\n pathParams,\n queryParams,\n headerParams,\n accepts,\n returnType: 'blob'\n });\n }\n\n /**\n * Get a person\n *\n * You can use the `-me-` string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @param opts Optional parameters\n * @returns Promise<PersonEntry>\n */\n getPerson(personId: string, opts?: ContentFieldsQuery): Promise<PersonEntry> {\n throwIfNotDefined(personId, 'personId');\n\n const pathParams = {\n personId\n };\n\n const queryParams = {\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.get({\n path: '/people/{personId}',\n pathParams,\n queryParams,\n returnType: PersonEntry\n });\n }\n\n /**\n * List people\n *\n * **Note:** this endpoint is available in Alfresco 5.2 and newer versions.\n *\n * List people.\n *\n * You can use the **include** parameter to return any additional information.\n *\n * The default sort order for the returned list is for people to be sorted by ascending id.\n * You can override the default by using the **orderBy** parameter.\n *\n * You can use any of the following fields to order the results:\n * - id\n * - firstName\n * - lastName\n * @param opts Optional parameters\n * @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to\n * sort the list by one or more fields.\n *\n * Each field has a default sort order, which is normally ascending order. Read the API method implementation notes\n * above to check if any fields used in this method have a descending default search order.\n *\n * To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.\n * @returns Promise<PersonPaging>\n */\n listPeople(\n opts?: {\n orderBy?: string[];\n } & ContentPagingQuery &\n ContentIncludeQuery &\n ContentFieldsQuery\n ): Promise<PersonPaging> {\n const queryParams = {\n skipCount: opts?.skipCount,\n maxItems: opts?.maxItems,\n orderBy: buildCollectionParam(opts?.orderBy, 'csv'),\n include: buildCollectionParam(opts?.include, 'csv'),\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.get({\n path: '/people',\n queryParams,\n returnType: PersonPaging\n });\n }\n\n /**\n * Request password reset\n *\n * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.\n * **Note:** No authentication is required to call this endpoint.\n * @param personId The identifier of a person.\n * @param clientBody The client name to send email with app-specific url.\n * @returns Promise<{}>\n */\n requestPasswordReset(personId: string, clientBody: ClientBody): Promise<any> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(clientBody, 'clientBody');\n\n const pathParams = {\n personId\n };\n\n return this.post({\n path: '/people/{personId}/request-password-reset',\n pathParams,\n bodyParam: clientBody\n });\n }\n\n /**\n * Reset password\n *\n * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.\n * **Note:** No authentication is required to call this endpoint.\n * @param personId The identifier of a person.\n * @param passwordResetBody The reset password details\n * @returns Promise<{}>\n */\n resetPassword(personId: string, passwordResetBody: PasswordResetBody): Promise<any> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(passwordResetBody, 'passwordResetBody');\n\n const pathParams = {\n personId\n };\n\n return this.post({\n path: '/people/{personId}/reset-password',\n pathParams,\n bodyParam: passwordResetBody\n });\n }\n\n /**\n * Update avatar image\n *\n * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.\n *\n * Updates the avatar image related to the person **personId**.\n *\n * The request body should be the binary stream for the avatar image. The content type of the file\n * should be an image file. This will be used to generate an \\\"avatar\\\" thumbnail rendition.\n *\n * You must be the person or have admin rights to update a person's avatar.\n *\n * You can use the -me- string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @param contentBodyUpdate The binary content\n * @returns Promise<{}>\n */\n updateAvatarImage(personId: string, contentBodyUpdate: string): Promise<any> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(contentBodyUpdate, 'contentBodyUpdate');\n\n const pathParams = {\n personId\n };\n\n const contentTypes = ['application/octet-stream'];\n\n return this.put({\n path: '/people/{personId}/avatar',\n pathParams,\n bodyParam: contentBodyUpdate,\n contentTypes\n });\n }\n\n /**\n * Get avatar image URL\n *\n * Builds and returns the direct URL to fetch the avatar image for the person `personId`.\n * This includes the current authentication ticket in the URL to allow secure access.\n *\n * You can use the `-me-` string in place of <personId> to specify the currently authenticated user.\n * @param personId The identifier of a person.\n * @returns A string URL to the user's avatar image.\n */\n getAvatarImageUrl(personId: string): string {\n const ticket = this.alfrescoApi.contentClient.getAlfTicket(undefined);\n return `${this.apiClient.basePath}/people/${personId}/avatar?placeholder=true${ticket}`;\n }\n\n /**\n * Update person\n *\n * **Note:** this endpoint is available in Alfresco 5.2 and newer versions.\n *\n * You can use the `-me-` string in place of <personId> to specify the currently authenticated user.\n * If applicable, the given person's login access can also be optionally disabled or re-enabled.\n * You must have admin rights to update a person — unless updating your own details.\n * If you are changing your password, as a non-admin user, then the existing password must also\n * be supplied (using the oldPassword field in addition to the new password value).\n *\n * Admin users cannot be disabled by setting enabled to false.\n * Non-admin users may not disable themselves.\n * **Note:** setting properties of type d:content and d:category are not supported.\n * @param personId The identifier of a person.\n * @param personBodyUpdate The person details.\n * @param opts Optional parameters\n * @returns Promise<PersonEntry>\n */\n updatePerson(personId: string, personBodyUpdate: PersonBodyUpdate, opts?: ContentFieldsQuery): Promise<PersonEntry> {\n throwIfNotDefined(personId, 'personId');\n throwIfNotDefined(personBodyUpdate, 'personBodyUpdate');\n\n const pathParams = {\n personId\n };\n\n const queryParams = {\n fields: buildCollectionParam(opts?.fields, 'csv')\n };\n\n return this.put({\n path: '/people/{personId}',\n pathParams,\n queryParams,\n bodyParam: personBodyUpdate,\n returnType: PersonEntry\n });\n }\n}\n"]}
|
package/typings/package.json
CHANGED
@@ -147,6 +147,17 @@ export declare class PeopleApi extends BaseApi {
|
|
147
147
|
* @returns Promise<{}>
|
148
148
|
*/
|
149
149
|
updateAvatarImage(personId: string, contentBodyUpdate: string): Promise<any>;
|
150
|
+
/**
|
151
|
+
* Get avatar image URL
|
152
|
+
*
|
153
|
+
* Builds and returns the direct URL to fetch the avatar image for the person `personId`.
|
154
|
+
* This includes the current authentication ticket in the URL to allow secure access.
|
155
|
+
*
|
156
|
+
* You can use the `-me-` string in place of <personId> to specify the currently authenticated user.
|
157
|
+
* @param personId The identifier of a person.
|
158
|
+
* @returns A string URL to the user's avatar image.
|
159
|
+
*/
|
160
|
+
getAvatarImageUrl(personId: string): string;
|
150
161
|
/**
|
151
162
|
* Update person
|
152
163
|
*
|