[PRODENG-211] integrate JS-API with monorepo (part 1) (#9081)

* integrate JS-API with monorepo

* [ci:force] fix token issue

[ci:force] migrate docs folder

[ci:force] clean personal tokens

* [ci:force] gha workflow support

* [ci:force] npm publish target

* fix js-api test linting

* [ci:force] fix test linting, mocks, https scheme

* [ci:force] fix https scheme

* [ci:force] typescript mappings

* [ci:force] update scripts

* lint fixes

* linting fixes

* fix linting

* [ci:force] linting fixes

* linting fixes

* [ci:force] remove js-api upstream and corresponding scripts

* [ci:force] jsdoc fixes

* fix jsdoc linting

* [ci:force] jsdoc fixes

* [ci:force] jsdoc fixes

* jsdoc fixes

* jsdoc fixes

* jsdoc fixes

* [ci:force] fix jsdoc

* [ci:force] reduce code duplication

* replace 'chai' expect with node.js assert

* replace 'chai' expect with node.js assert

* [ci:force] remove chai and chai-spies for js-api testing

* [ci:force] cleanup and fix imports

* [ci:force] fix linting

* [ci:force] fix unit test

* [ci:force] fix sonar linting findings

* [ci:force] switch activiti api models to interfaces (-2.5% reduction of bundle)

* [ci:force] switch activiti api models to interfaces

* [ci:force] switch AGS api models to interfaces

* [ci:force] switch AGS api models to interfaces

* [ci:force] switch search api models to interfaces

* [ci:force] switch content api models to interfaces where applicable
This commit is contained in:
Denys Vuika
2023-11-21 10:27:51 +00:00
committed by GitHub
parent 804fa2ffd4
commit ea2c0ce229
1334 changed files with 82605 additions and 1068 deletions

View File

@@ -0,0 +1,32 @@
# **Core API**
Provides access to the core features of Alfresco Content Services.
## Endpoint Clients
All URIs are relative to:
```text
https://localhost/alfresco/api/-default-/public/alfresco/versions/1
```
- [ActionsApi](docs/ActionsApi.md)
- [ActivitiesApi](docs/ActivitiesApi.md)
- [AuditApi](docs/AuditApi.md)
- [CommentsApi](docs/CommentsApi.md)
- [DownloadsApi](docs/DownloadsApi.md)
- [FavoritesApi](docs/FavoritesApi.md)
- [GroupsApi](docs/GroupsApi.md)
- [NetworksApi](docs/NetworksApi.md)
- [NodesApi](docs/NodesApi.md)
- [PeopleApi](docs/PeopleApi.md)
- [PreferencesApi](docs/PreferencesApi.md)
- [ProbesApi](docs/ProbesApi.md)
- [QueriesApi](docs/QueriesApi.md)
- [RatingsApi](docs/RatingsApi.md)
- [RenditionsApi](docs/RenditionsApi.md)
- [SharedlinksApi](docs/SharedlinksApi.md)
- [SitesApi](docs/SitesApi.md)
- [TagsApi](docs/TagsApi.md)
- [TrashcanApi](docs/TrashcanApi.md)
- [VersionsApi](docs/VersionsApi.md)

View File

@@ -0,0 +1,149 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ActionBodyExec, ActionDefinitionEntry, ActionDefinitionList, ActionExecResultEntry } from '../model';
import { BaseApi } from './base.api';
import { throwIfNotDefined } from '../../../assert';
import { buildCollectionParam } from '../../../alfrescoApiClient';
import { ContentFieldsQuery, ContentPagingQuery } from './types';
/**
* Actions service.
*/
export class ActionsApi extends BaseApi {
/**
* Retrieve the details of an action definition
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* @param actionDefinitionId The identifier of an action definition.
* @returns Promise<ActionDefinitionEntry>
*/
actionDetails(actionDefinitionId: string): Promise<ActionDefinitionEntry> {
throwIfNotDefined(actionDefinitionId, 'actionDefinitionId');
const pathParams = {
actionDefinitionId
};
return this.get({
path: '/action-definitions/{actionDefinitionId}',
pathParams
});
}
/**
* Execute an action
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* @param actionBodyExec Action execution details
* @returns Promise<ActionExecResultEntry>
*/
actionExec(actionBodyExec: ActionBodyExec): Promise<ActionExecResultEntry> {
throwIfNotDefined(actionBodyExec, 'actionBodyExec');
return this.post({
path: '/action-executions',
bodyParam: actionBodyExec
});
}
/**
* Retrieve list of available actions
*
* **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.
*
* Gets a list of all available actions
*
* The default sort order for the returned list is for actions to be sorted by ascending name.
* You can override the default by using the **orderBy** parameter.
*
* You can use any of the following fields to order the results:
* - name
* - title
*
*
* @param opts Optional parameters
* @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to
* sort the list by one or more fields.
* Each field has a default sort order, which is normally ascending order. Read the API method implementation notes
* above to check if any fields used in this method have a descending default search order.
* To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.
* @returns Promise<ActionDefinitionList>
*/
listActions(opts?: { orderBy?: string[] } & ContentPagingQuery & ContentFieldsQuery): Promise<ActionDefinitionList> {
opts = opts || {};
const queryParams = {
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
orderBy: buildCollectionParam(opts?.orderBy, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/action-definitions',
queryParams,
returnType: ActionDefinitionList
});
}
/**
* Retrieve actions for a node
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* Retrieve the list of actions that may be executed against the given **nodeId**.
* The default sort order for the returned list is for actions to be sorted by ascending name.
* You can override the default by using the **orderBy** parameter.
* You can use any of the following fields to order the results:
* - name
* - title
*
* @param nodeId The identifier of a node.
* @param opts Optional parameters
* @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to
* sort the list by one or more fields.
* Each field has a default sort order, which is normally ascending order. Read the API method implementation notes
* above to check if any fields used in this method have a descending default search order.
* To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.
* @returns Promise<ActionDefinitionList>
*/
nodeActions(nodeId: string, opts?: { orderBy?: string[] } & ContentPagingQuery & ContentFieldsQuery): Promise<ActionDefinitionList> {
throwIfNotDefined(nodeId, 'nodeId');
opts = opts || {};
const pathParams = {
nodeId
};
const queryParams = {
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
orderBy: buildCollectionParam(opts?.orderBy, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/nodes/{nodeId}/action-definitions',
pathParams,
queryParams,
returnType: ActionDefinitionList
});
}
}

View File

@@ -0,0 +1,67 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ActivityPaging } from '../model/activityPaging';
import { BaseApi } from './base.api';
import { throwIfNotDefined } from '../../../assert';
import { buildCollectionParam } from '../../../alfrescoApiClient';
import { ContentFieldsQuery, ContentPagingQuery } from './types';
/**
* Activities service.
*/
export class ActivitiesApi extends BaseApi {
/**
* List activities
*
* Gets a list of activities for person **personId**.
* You can use the -me- string in place of <personId> to specify the currently authenticated user.
*
* @param personId The identifier of a person.
* @param opts Optional parameters
* @param opts.who A filter to include the user's activities only me, other user's activities only others'
* @param opts.siteId Include only activity feed entries relating to this site.
* @returns Promise<ActivityPaging>
*/
listActivitiesForPerson(
personId: string,
opts?: {
who?: string;
siteId?: string;
} & ContentPagingQuery &
ContentFieldsQuery
): Promise<ActivityPaging> {
throwIfNotDefined(personId, 'personId');
opts = opts || {};
const pathParams = {
personId
};
const queryParams = {
...opts,
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/people/{personId}/activities',
pathParams,
queryParams,
returnType: ActivityPaging
});
}
}

View File

@@ -0,0 +1,347 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { AuditApp, AuditAppPaging, AuditBodyUpdate, AuditEntryEntry, AuditEntryPaging } from '../model';
import { BaseApi } from './base.api';
import { throwIfNotDefined } from '../../../assert';
import { buildCollectionParam } from '../../../alfrescoApiClient';
import { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types';
/**
* Audit service.
*/
export class AuditApi extends BaseApi {
/**
* Permanently delete audit entries for an audit application
*
* **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.
*
* Permanently delete audit entries for an audit application **auditApplicationId**.
* The **where** clause must be specified, either with an inclusive time period or for
* an inclusive range of ids. The delete is within the context of the given audit application.
* For example:
* - where=(createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00')
* - where=(id BETWEEN ('1234', '4321')
* You must have admin rights to delete audit information.
*
* @param auditApplicationId The identifier of an audit application.
* @param where Audit entries to permanently delete for an audit application, given an inclusive time period or range of ids. For example:
* - where=(createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00')
* - where=(id BETWEEN ('1234', '4321')
* @return Promise<{}>
*/
deleteAuditEntriesForAuditApp(auditApplicationId: string, where: string): Promise<void> {
throwIfNotDefined(auditApplicationId, 'auditApplicationId');
throwIfNotDefined(where, 'where');
const pathParams = {
auditApplicationId
};
const queryParams = {
where
};
return this.delete({
path: '/audit-applications/{auditApplicationId}/audit-entries',
pathParams,
queryParams
});
}
/**
* Permanently delete an audit entry
*
* **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.
* You must have admin rights to delete audit information.
*
* @param auditApplicationId The identifier of an audit application.
* @param auditEntryId The identifier of an audit entry.
* @return Promise<{}>
*/
deleteAuditEntry(auditApplicationId: string, auditEntryId: string): Promise<void> {
throwIfNotDefined(auditApplicationId, 'auditApplicationId');
throwIfNotDefined(auditEntryId, 'auditEntryId');
const pathParams = {
auditApplicationId,
auditEntryId
};
return this.delete({
path: '/audit-applications/{auditApplicationId}/audit-entries/{auditEntryId}',
pathParams
});
}
/**
* Get audit application info
*
* **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.
* You must have admin rights to retrieve audit information.
*
* You can use the **include** parameter to return the minimum and/or maximum audit record id for the application.
*
* @param auditApplicationId The identifier of an audit application.
* @param opts Optional parameters
* @return Promise<AuditApp>
*/
getAuditApp(auditApplicationId: string, opts?: ContentFieldsQuery & ContentIncludeQuery): Promise<AuditApp> {
throwIfNotDefined(auditApplicationId, 'auditApplicationId');
const pathParams = {
auditApplicationId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv'),
include: buildCollectionParam(opts?.include, 'csv')
};
return this.get({
path: '/audit-applications/{auditApplicationId}',
pathParams,
queryParams
});
}
/**
* Get audit entry
*
* **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.
* You must have admin rights to access audit information.
*
* @param auditApplicationId The identifier of an audit application.
* @param auditEntryId The identifier of an audit entry.
* @param opts Optional parameters
* @return Promise<AuditEntryEntry>
*/
getAuditEntry(auditApplicationId: string, auditEntryId: string, opts?: ContentFieldsQuery): Promise<AuditEntryEntry> {
throwIfNotDefined(auditApplicationId, 'auditApplicationId');
throwIfNotDefined(auditEntryId, 'auditEntryId');
const pathParams = {
auditApplicationId,
auditEntryId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/audit-applications/{auditApplicationId}/audit-entries/{auditEntryId}',
pathParams,
queryParams,
returnType: AuditEntryEntry
});
}
/**
* Gets a list of audit applications in this repository.
*
* **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.
*
* This list may include pre-configured audit applications, if enabled, such as:
*
* - alfresco-access
* - CMISChangeLog
* - Alfresco Tagging Service
* - Alfresco Sync Service (used by Enterprise Cloud Sync)
*
* You must have admin rights to retrieve audit information.
*
* @param opts Optional parameters
* @return Promise<AuditAppPaging>
*/
listAuditApps(opts?: ContentPagingQuery & ContentFieldsQuery): Promise<AuditAppPaging> {
const queryParams = {
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/audit-applications',
queryParams,
returnType: AuditAppPaging
});
}
/**
* List audit entries for an audit application
*
* **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.
*
* Gets a list of audit entries for audit application **auditApplicationId**.
* You can use the **include** parameter to return additional **values** information.
* The list can be filtered by one or more of:
* - **createdByUser** person id
* - **createdAt** inclusive time period
* - **id** inclusive range of ids
* - **valuesKey** audit entry values contains the exact matching key
* - **valuesValue** audit entry values contains the exact matching value
*
* The default sort order is **createdAt** ascending, but you can use an optional **ASC** or **DESC**
* modifier to specify an ascending or descending sort order.
*
* For example, specifying orderBy=createdAt DESC returns audit entries in descending **createdAt** order.
* You must have admin rights to retrieve audit information.
*
* @param auditApplicationId The identifier of an audit application.
* @param opts Optional parameters
* @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to
* sort the list by one or more fields.
* Each field has a default sort order, which is normally ascending order. Read the API method implementation notes
* above to check if any fields used in this method have a descending default search order.
* To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.
* @param opts.where Optionally filter the list. Here are some examples:
* - where=(createdByUser='jbloggs')
* - where=(id BETWEEN ('1234', '4321')
* - where=(createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00')
* - where=(createdByUser='jbloggs' and createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00')
* - where=(valuesKey='/alfresco-access/login/user')
* - where=(valuesKey='/alfresco-access/transaction/action' and valuesValue='DELETE')
* @returns Promise<AuditEntryPaging>
*/
listAuditEntriesForAuditApp(
auditApplicationId: string,
opts?: {
where?: string;
orderBy?: string[];
} & ContentPagingQuery &
ContentFieldsQuery &
ContentIncludeQuery
): Promise<AuditEntryPaging> {
throwIfNotDefined(auditApplicationId, 'auditApplicationId');
opts = opts || {};
const pathParams = {
auditApplicationId
};
const queryParams = {
skipCount: opts?.skipCount,
orderBy: buildCollectionParam(opts?.orderBy, 'csv'),
maxItems: opts?.maxItems,
where: opts?.where,
include: buildCollectionParam(opts?.include, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/audit-applications/{auditApplicationId}/audit-entries',
pathParams,
queryParams,
returnType: AuditEntryPaging
});
}
/**
* List audit entries for a node
*
* **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.
*
* The list can be filtered by **createdByUser** and for a given inclusive time period.
* The default sort order is **createdAt** ascending, but you can use an optional **ASC** or **DESC**
* modifier to specify an ascending or descending sort order.
*
* For example, specifying orderBy=createdAt DESC returns audit entries in descending **createdAt** order.
* This relies on the pre-configured 'alfresco-access' audit application.
*
* @param nodeId The identifier of a node.
* @param opts Optional parameters
* @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to
* sort the list by one or more fields.
* Each field has a default sort order, which is normally ascending order. Read the API method implementation notes
* above to check if any fields used in this method have a descending default search order.
* To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.
* @param opts.where Optionally filter the list. Here are some examples:
* - where=(createdByUser='-me-')
* - where=(createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00')
* - where=(createdByUser='jbloggs' and createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00')
* @returns Promise<AuditEntryPaging>
*/
listAuditEntriesForNode(
nodeId: string,
opts?: {
orderBy?: string[];
where?: string;
} & ContentPagingQuery &
ContentIncludeQuery &
ContentFieldsQuery
): Promise<AuditEntryPaging> {
throwIfNotDefined(nodeId, 'nodeId');
opts = opts || {};
const pathParams = {
nodeId
};
const queryParams = {
skipCount: opts?.skipCount,
orderBy: buildCollectionParam(opts?.orderBy, 'csv'),
maxItems: opts?.maxItems,
where: opts?.where,
include: buildCollectionParam(opts?.include, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/nodes/{nodeId}/audit-entries',
pathParams,
queryParams,
returnType: AuditEntryPaging
});
}
/**
* Update audit application info
*
* **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.
*
* New audit entries will not be created for a disabled audit application until
* it is re-enabled (and system-wide auditing is also enabled).
* Note, it is still possible to query &/or delete any existing audit entries even
* if auditing is disabled for the audit application.
* You must have admin rights to update audit application.
*
* @param auditApplicationId The identifier of an audit application.
* @param auditAppBodyUpdate The audit application to update.
* @param opts Optional parameters
* @returns Promise<AuditApp>
*/
updateAuditApp(auditApplicationId: string, auditAppBodyUpdate: AuditBodyUpdate, opts?: ContentFieldsQuery): Promise<AuditApp> {
throwIfNotDefined(auditApplicationId, 'auditApplicationId');
throwIfNotDefined(auditAppBodyUpdate, 'auditAppBodyUpdate');
const pathParams = {
auditApplicationId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.put({
path: '/audit-applications/{auditApplicationId}',
pathParams,
queryParams,
bodyParam: auditAppBodyUpdate
});
}
}

View File

@@ -0,0 +1,25 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ApiClient } from '../../../api-clients/api-client';
import { LegacyHttpClient } from '../../../api-clients/http-client.interface';
export abstract class BaseApi extends ApiClient {
override get apiClient(): LegacyHttpClient {
return this.httpClient ?? this.alfrescoApi.contentClient;
}
}

View File

@@ -0,0 +1,263 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { BaseApi } from './base.api';
import { throwIfNotDefined } from '../../../assert';
import { buildCollectionParam } from '../../../alfrescoApiClient';
import { CategoryBody, CategoryEntry, CategoryLinkBody, CategoryPaging } from '../model';
import { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types';
export type CategoryQuery = ContentFieldsQuery & ContentIncludeQuery;
/**
* Categories service.
*/
export class CategoriesApi extends BaseApi {
/**
* List of subcategories within category
*
* Gets a list of subcategories with category **categoryId**.
* The parameter categoryId can be set to the alias -root- to obtain a list of top level categories.
*
* You can use the **include** parameter to return additional **values** information.
*
* @param categoryId The identifier of a category.
* @param opts Optional parameters
* @returns Promise<CategoryPaging>
*/
getSubcategories(categoryId: string, opts?: ContentPagingQuery & CategoryQuery): Promise<CategoryPaging> {
throwIfNotDefined(categoryId, 'categoryId');
const pathParams = {
categoryId
};
const queryParams = {
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
fields: buildCollectionParam(opts?.fields, 'csv'),
include: buildCollectionParam(opts?.include, 'csv')
};
return this.get({
path: '/categories/{categoryId}/subcategories',
pathParams,
queryParams,
returnType: CategoryPaging
});
}
/**
* Get a category
*
* Get a specific category with categoryId.
* You can use the **include** parameter to return additional **values** information.
*
* @param categoryId The identifier of a category.
* @param opts Optional parameters
* @returns Promise<CategoryEntry>
*/
getCategory(categoryId: string, opts?: CategoryQuery): Promise<CategoryEntry> {
throwIfNotDefined(categoryId, 'categoryId');
const pathParams = {
categoryId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv'),
include: buildCollectionParam(opts?.include, 'csv')
};
return this.get({
path: '/categories/{categoryId}',
pathParams,
queryParams,
returnType: CategoryEntry
});
}
/**
* List of categories that node is assigned to
*
* @param nodeId The identifier of a node.
* @param opts Optional parameters
* @returns Promise<CategoryPaging>
*/
getCategoryLinksForNode(nodeId: string, opts?: ContentPagingQuery & CategoryQuery): Promise<CategoryPaging> {
throwIfNotDefined(nodeId, 'nodeId');
const pathParams = {
nodeId
};
const queryParams = {
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
fields: buildCollectionParam(opts?.fields, 'csv'),
include: buildCollectionParam(opts?.include, 'csv')
};
return this.get({
path: '/nodes/{nodeId}/category-links',
pathParams,
queryParams,
returnType: CategoryPaging
});
}
/**
* Deletes the category **categoryId**.
*
* This will cause everything to be removed from the category.
* You must have admin rights to delete a category.
*
* @param categoryId The identifier of a category.
* @returns Promise<{}>
*/
deleteCategory(categoryId: string): Promise<void> {
throwIfNotDefined(categoryId, 'categoryId');
const pathParams = {
categoryId
};
return this.delete({
path: '/categories/{categoryId}',
pathParams
});
}
/**
* Unassign a node from category
*
* @param nodeId The identifier of a node.
* @param categoryId The identifier of a category.
* @returns Promise<{}>
*/
unlinkNodeFromCategory(nodeId: string, categoryId: string): Promise<void> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(categoryId, 'categoryId');
const pathParams = {
nodeId,
categoryId
};
return this.delete({
path: '/nodes/{nodeId}/category-links/{categoryId}',
pathParams
});
}
/**
* Update a category
*
* Updates the category **categoryId**.
* You must have admin rights to update a category.
*
* @param categoryId The identifier of a category.
* @param categoryBodyUpdate The updated category
* @param opts Optional parameters
* @returns Promise<CategoryEntry>
*/
updateCategory(categoryId: string, categoryBodyUpdate: CategoryBody, opts?: CategoryQuery): Promise<CategoryEntry> {
throwIfNotDefined(categoryId, 'categoryId');
throwIfNotDefined(categoryBodyUpdate, 'categoryBodyUpdate');
const pathParams = {
categoryId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv'),
include: buildCollectionParam(opts?.include, 'csv')
};
return this.put({
path: '/categories/{categoryId}',
pathParams,
queryParams,
bodyParam: categoryBodyUpdate,
returnType: CategoryEntry
});
}
/**
* Create new categories
*
* Creates new categories within the category **categoryId**.
* The parameter categoryId can be set to the alias -root- to create a new top level category.
* You must have admin rights to create a category.
*
* @param categoryId The identifier of a category.
* @param categoryBodyCreate List of categories to create.
* @param opts Optional parameters.
* @returns Promise<CategoryPaging | CategoryEntry>
*/
createSubcategories(categoryId: string, categoryBodyCreate: CategoryBody[], opts?: CategoryQuery): Promise<CategoryPaging | CategoryEntry> {
throwIfNotDefined(categoryId, 'categoryId');
throwIfNotDefined(categoryBodyCreate, 'categoryBodyCreate');
const pathParams = {
categoryId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv'),
include: buildCollectionParam(opts?.include, 'csv')
};
return this.post({
path: '/categories/{categoryId}/subcategories',
pathParams,
queryParams,
bodyParam: categoryBodyCreate,
returnType: CategoryEntry
});
}
/**
* Assign a node to a category
*
* @param nodeId The identifier of a node.
* @param categoryLinkBodyCreate The new category link
* @param opts Optional parameters
* @returns Promise<CategoryPaging | CategoryEntry>
*/
linkNodeToCategory(nodeId: string, categoryLinkBodyCreate: CategoryLinkBody[], opts?: CategoryQuery): Promise<CategoryPaging | CategoryEntry> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(categoryLinkBodyCreate, 'categoryLinkBodyCreate');
const pathParams = {
nodeId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv'),
include: buildCollectionParam(opts?.include, 'csv')
};
return this.post({
path: '/nodes/{nodeId}/category-links',
pathParams,
queryParams,
bodyParam: categoryLinkBodyCreate,
returnType: CategoryEntry
});
}
}

View File

@@ -0,0 +1,142 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { CommentBody } from '../model/commentBody';
import { CommentEntry } from '../model/commentEntry';
import { CommentPaging } from '../model/commentPaging';
import { BaseApi } from './base.api';
import { throwIfNotDefined } from '../../../assert';
import { buildCollectionParam } from '../../../alfrescoApiClient';
import { ContentFieldsQuery, ContentPagingQuery } from './types';
/**
* Comments service.
*/
export class CommentsApi extends BaseApi {
/**
* Create a comment
*
* @param nodeId The identifier of a node.
* @param commentBodyCreate The comment text. Note that you can also provide a list of comments.
* @param opts Optional parameters
* @returns Promise<CommentEntry>
*/
createComment(nodeId: string, commentBodyCreate: CommentBody, opts?: ContentFieldsQuery): Promise<CommentEntry> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(commentBodyCreate, 'commentBodyCreate');
const pathParams = {
nodeId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.post({
path: '/nodes/{nodeId}/comments',
pathParams,
queryParams,
bodyParam: commentBodyCreate,
returnType: CommentEntry
});
}
/**
* Delete a comment
*
* @param nodeId The identifier of a node.
* @param commentId The identifier of a comment.
* @returns Promise<{}>
*/
deleteComment(nodeId: string, commentId: string): Promise<void> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(commentId, 'commentId');
const pathParams = {
nodeId,
commentId
};
return this.delete({
path: '/nodes/{nodeId}/comments/{commentId}',
pathParams
});
}
/**
* List comments
*
* Gets a list of comments for the node **nodeId**, sorted chronologically with the newest comment first.
*
* @param nodeId The identifier of a node.
* @param opts Optional parameters
* @returns Promise<CommentPaging>
*/
listComments(nodeId: string, opts?: ContentPagingQuery & ContentFieldsQuery): Promise<CommentPaging> {
throwIfNotDefined(nodeId, 'nodeId');
const pathParams = {
nodeId
};
const queryParams = {
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/nodes/{nodeId}/comments',
pathParams,
queryParams,
returnType: CommentPaging
});
}
/**
* Update a comment
*
* @param nodeId The identifier of a node.
* @param commentId The identifier of a comment.
* @param commentBodyUpdate The JSON representing the comment to be updated.
* @param opts Optional parameters
* @returns Promise<CommentEntry>
*/
updateComment(nodeId: string, commentId: string, commentBodyUpdate: CommentBody, opts?: ContentFieldsQuery): Promise<CommentEntry> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(commentId, 'commentId');
throwIfNotDefined(commentBodyUpdate, 'commentBodyUpdate');
const pathParams = {
nodeId,
commentId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.put({
path: '/nodes/{nodeId}/comments/{commentId}',
pathParams,
queryParams,
bodyParam: commentBodyUpdate,
returnType: CommentEntry
});
}
}

View File

@@ -0,0 +1,116 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { DownloadBodyCreate, DownloadEntry } from '../model';
import { BaseApi } from './base.api';
import { throwIfNotDefined } from '../../../assert';
import { buildCollectionParam } from '../../../alfrescoApiClient';
/**
* Downloads service.
*/
export class DownloadsApi extends BaseApi {
/**
* Cancel a download
*
* **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.
*
* Cancels the creation of a download request.
*
* **Note:** The download node can be deleted using the **DELETE /nodes/{downloadId}** endpoint
*
* By default, if the download node is not deleted it will be picked up by a cleaner job which removes download nodes older than a configurable amount of time (default is 1 hour)
* Information about the existing progress at the time of cancelling can be retrieved by calling the **GET /downloads/{downloadId}** endpoint
* The cancel operation is done asynchronously.
*
* @param downloadId The identifier of a download node.
* @returns Promise<{}>
*/
cancelDownload(downloadId: string): Promise<any> {
throwIfNotDefined(downloadId, 'downloadId');
const pathParams = {
downloadId
};
return this.delete({
path: '/downloads/{downloadId}',
pathParams
});
}
/**
* Create a new download
*
* **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.
* **Note:** The content of the download node can be obtained using the **GET /nodes/{downloadId}/content** endpoint
*
* @param downloadBodyCreate The nodeIds the content of which will be zipped, which zip will be set as the content of our download node.
* @param opts Optional parameters
* @param opts.fields A list of field names. You can use this parameter to restrict the fields
* returned within a response if, for example, you want to save on overall bandwidth.
* The list applies to a returned individual entity or entries within a collection.
* If the API method also supports the **include** parameter, then the fields specified in the **include**
* parameter are returned in addition to those specified in the **fields** parameter.
* @returns Promise<DownloadEntry>
*/
createDownload(downloadBodyCreate: DownloadBodyCreate, opts?: { fields?: string[] }): Promise<DownloadEntry> {
throwIfNotDefined(downloadBodyCreate, 'downloadBodyCreate');
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.post({
path: '/downloads',
queryParams,
bodyParam: downloadBodyCreate
});
}
/**
* Get a download
*
* **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.
*
* @param downloadId The identifier of a download node.
* @param opts Optional parameters
* @param opts.fields A list of field names. You can use this parameter to restrict the fields
* returned within a response if, for example, you want to save on overall bandwidth.
* The list applies to a returned individual entity or entries within a collection.
* If the API method also supports the **include** parameter, then the fields specified in the **include**
* parameter are returned in addition to those specified in the **fields** parameter.
* @returns Promise<DownloadEntry>
*/
getDownload(downloadId: string, opts?: { fields?: string[] }): Promise<DownloadEntry> {
throwIfNotDefined(downloadId, 'downloadId');
const pathParams = {
downloadId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/downloads/{downloadId}',
pathParams,
queryParams
});
}
}

View File

@@ -0,0 +1,311 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { FavoriteBodyCreate, FavoriteEntry, FavoritePaging, FavoriteSiteBodyCreate, FavoriteSiteEntry, SiteEntry, SitePaging } from '../model';
import { BaseApi } from './base.api';
import { throwIfNotDefined } from '../../../assert';
import { buildCollectionParam } from '../../../alfrescoApiClient';
import { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types';
/**
* Favorites service.
*/
export class FavoritesApi extends BaseApi {
/**
* Create a favorite
*
* Favorite a **site**, **file**, or **folder** in the repository.
* You can use the -me- string in place of <personId> to specify the currently authenticated user.
*
* @param personId The identifier of a person.
* @param favoriteBodyCreate An object identifying the entity to be favorited.
* The object consists of a single property which is an object with the name site, file, or folder.
* The content of that object is the guid of the target entity.
* @param opts Optional parameters
* @param opts.include Returns additional information about favorites, the following optional fields can be requested:
* - path (note, this only applies to files and folders)
* - properties
* @param opts.fields A list of field names. You can use this parameter to restrict the fields
* returned within a response if, for example, you want to save on overall bandwidth.
* The list applies to a returned individual entity or entries within a collection.
* If the API method also supports the **include** parameter, then the fields specified in the **include**
* parameter are returned in addition to those specified in the **fields** parameter.
* @returns Promise<FavoriteEntry>
*/
createFavorite(
personId: string,
favoriteBodyCreate: FavoriteBodyCreate,
opts?: { include?: string[]; fields?: string[] }
): Promise<FavoriteEntry> {
throwIfNotDefined(personId, 'personId');
throwIfNotDefined(favoriteBodyCreate, 'favoriteBodyCreate');
const pathParams = {
personId
};
const queryParams = {
include: buildCollectionParam(opts?.include, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.post({
path: '/people/{personId}/favorites',
pathParams,
queryParams,
bodyParam: favoriteBodyCreate,
returnType: FavoriteEntry
});
}
/**
* Create a site favorite
*
* **Note:** this endpoint is deprecated as of Alfresco 4.2, and will be removed in the future. Use /people/{personId}/favorites instead.
*
* @param personId The identifier of a person.
* @param favoriteSiteBodyCreate The id of the site to favorite.
* @param opts Optional parameters
* @returns Promise<FavoriteSiteEntry>
*/
createSiteFavorite(personId: string, favoriteSiteBodyCreate: FavoriteSiteBodyCreate, opts?: ContentFieldsQuery): Promise<FavoriteSiteEntry> {
throwIfNotDefined(personId, 'personId');
throwIfNotDefined(favoriteSiteBodyCreate, 'favoriteSiteBodyCreate');
const pathParams = {
personId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.post({
path: '/people/{personId}/favorite-sites',
pathParams,
queryParams,
bodyParam: favoriteSiteBodyCreate
});
}
/**
* Delete a favorite
*
* You can use the -me- string in place of <personId> to specify the currently authenticated user.
*
* @param personId The identifier of a person.
* @param favoriteId The identifier of a favorite.
* @returns Promise<{}>
*/
deleteFavorite(personId: string, favoriteId: string): Promise<void> {
throwIfNotDefined(personId, 'personId');
throwIfNotDefined(favoriteId, 'favoriteId');
const pathParams = {
personId,
favoriteId
};
return this.delete({
path: '/people/{personId}/favorites/{favoriteId}',
pathParams
});
}
/**
* Delete a site favorite
*
* **Note:** this endpoint is deprecated as of Alfresco 4.2, and will be removed in the future.
* Use /people/{personId}/favorites/{favoriteId} instead.
*
* You can use the -me- string in place of <personId> to specify the currently authenticated user.
*
* @param personId The identifier of a person.
* @param siteId The identifier of a site.
* @returns Promise<{}>
*/
deleteSiteFavorite(personId: string, siteId: string): Promise<void> {
throwIfNotDefined(personId, 'personId');
throwIfNotDefined(siteId, 'siteId');
const pathParams = {
personId,
siteId
};
return this.delete({
path: '/people/{personId}/favorite-sites/{siteId}',
pathParams
});
}
/**
* Get a favorite
*
* Gets favorite **favoriteId** for person **personId**.
* You can use the -me- string in place of <personId> to specify the currently authenticated user.
*
* @param personId The identifier of a person.
* @param favoriteId The identifier of a favorite.
* @param opts Optional parameters
* @param opts.include Returns additional information about favorites, the following optional fields can be requested:
* - path (note, this only applies to files and folders)
* - properties
* @param opts.fields A list of field names. You can use this parameter to restrict the fields
* returned within a response if, for example, you want to save on overall bandwidth.
* The list applies to a returned individual entity or entries within a collection.
* If the API method also supports the **include** parameter, then the fields specified in the **include**
* parameter are returned in addition to those specified in the **fields** parameter.
* @returns Promise<FavoriteEntry>
*/
getFavorite(personId: string, favoriteId: string, opts?: { include?: string[]; fields?: string[] }): Promise<FavoriteEntry> {
throwIfNotDefined(personId, 'personId');
throwIfNotDefined(favoriteId, 'favoriteId');
const pathParams = {
personId,
favoriteId
};
const queryParams = {
include: buildCollectionParam(opts?.include, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/people/{personId}/favorites/{favoriteId}',
pathParams,
queryParams,
returnType: FavoriteEntry
});
}
/**
* Get a favorite site
*
* **Note:** this endpoint is deprecated as of Alfresco 4.2, and will be removed in the future.
* Use /people/{personId}/favorites/{favoriteId} instead.
*
* You can use the -me- string in place of <personId> to specify the currently authenticated user.
*
* @param personId The identifier of a person.
* @param siteId The identifier of a site.
* @param opts Optional parameters
* @param opts.fields A list of field names. You can use this parameter to restrict the fields
* returned within a response if, for example, you want to save on overall bandwidth.
* The list applies to a returned individual entity or entries within a collection.
* If the API method also supports the **include** parameter, then the fields specified in the **include**
* parameter are returned in addition to those specified in the **fields** parameter.
* @returns Promise<SiteEntry>
*/
getFavoriteSite(personId: string, siteId: string, opts?: { fields?: string[] }): Promise<SiteEntry> {
throwIfNotDefined(personId, 'personId');
throwIfNotDefined(siteId, 'siteId');
const pathParams = {
personId,
siteId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/people/{personId}/favorite-sites/{siteId}',
pathParams,
queryParams,
returnType: SiteEntry
});
}
/**
* List favorite sites
*
* **Note:** this endpoint is deprecated as of Alfresco 4.2, and will be removed in the future.
* Use /people/{personId}/favorites instead.
*
* You can use the -me- string in place of <personId> to specify the currently authenticated user.
*
* @param personId The identifier of a person.
* @param opts Optional parameters
* @returns Promise<SitePaging>
*/
listFavoriteSitesForPerson(personId: string, opts?: ContentPagingQuery & ContentFieldsQuery): Promise<SitePaging> {
throwIfNotDefined(personId, 'personId');
const pathParams = {
personId
};
const queryParams = {
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/people/{personId}/favorite-sites',
pathParams,
queryParams,
returnType: SitePaging
});
}
/**
* List favorites
*
* Gets a list of favorites for person **personId**.
* You can use the -me- string in place of <personId> to specify the currently authenticated user.
*
* @param personId The identifier of a person.
* @param opts optional parameters
* @returns Promise<FavoritePaging>
*/
listFavorites(
personId: string,
opts?: {
orderBy?: string[];
where?: string;
} & ContentPagingQuery &
ContentIncludeQuery &
ContentFieldsQuery
): Promise<FavoritePaging> {
throwIfNotDefined(personId, 'personId');
opts = opts || {};
const pathParams = {
personId
};
const queryParams = {
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
orderBy: buildCollectionParam(opts?.orderBy, 'csv'),
where: opts?.where,
include: buildCollectionParam(opts?.include, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/people/{personId}/favorites',
pathParams,
queryParams,
returnType: FavoritePaging
});
}
}

View File

@@ -0,0 +1,382 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { GroupBodyCreate, GroupBodyUpdate, GroupEntry, GroupMemberEntry, GroupMemberPaging, GroupMembershipBodyCreate, GroupPaging } from '../model';
import { BaseApi } from './base.api';
import { throwIfNotDefined } from '../../../assert';
import { buildCollectionParam } from '../../../alfrescoApiClient';
import { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types';
export interface ListGroupMembershipsOpts {
/**
* A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to
* sort the list by one or more fields.
*
* Each field has a default sort order, which is normally ascending order. Read the API method implementation notes
* above to check if any fields used in this method have a descending default search order.
*
* To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field
*/
orderBy?: string[];
// A string to restrict the returned objects by using a predicate.
where?: string;
}
export interface GroupPagingOpts {
/**
* A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to
* sort the list by one or more fields.
*
* Each field has a default sort order, which is normally ascending order. Read the API method implementation notes
* above to check if any fields used in this method have a descending default search order.
*
* To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.
*/
orderBy?: string[];
/**
* A string to restrict the returned objects by using a predicate.
*/
where?: string;
}
export type DeleteGroupOpts = { cascade?: boolean };
/**
* Groups service.
*/
export class GroupsApi extends BaseApi {
/**
* Create a group
*
* **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.
*
* Create a group.
*
* The group id must start with \"GROUP\\_\". If this is omitted it will be added automatically.
* This format is also returned when listing groups or group memberships. It should be noted
* that the other group-related operations also expect the id to start with \"GROUP\\_\".
*
* If one or more parentIds are specified then the group will be created and become a member of each of the specified parent groups.
* If no parentIds are specified then the group will be created as a root group.
* The group will be created in the **APP.DEFAULT** and **AUTH.ALF** zones.
*
* You must have admin rights to create a group.
*
* @param groupBodyCreate The group to create.
* @param opts Optional parameters
* @returns Promise<GroupEntry>
*/
createGroup(groupBodyCreate: GroupBodyCreate, opts?: ContentIncludeQuery & ContentFieldsQuery): Promise<GroupEntry> {
throwIfNotDefined(groupBodyCreate, 'groupBodyCreate');
const queryParams = {
include: buildCollectionParam(opts?.include, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.post({
path: '/groups',
queryParams,
bodyParam: groupBodyCreate
});
}
/**
* Create a group membership
*
* **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.
*
* Create a group membership (for an existing person or group) within a group **groupId**.
* If the added group was previously a root group then it becomes a non-root group since it now has a parent.
* It is an error to specify an **id** that does not exist.
* You must have admin rights to create a group membership.
*
* @param groupId The identifier of a group.
* @param groupMembershipBodyCreate The group membership to add (person or sub-group).
* @param opts Optional parameters
* @returns Promise<GroupMemberEntry>
*/
createGroupMembership(
groupId: string,
groupMembershipBodyCreate: GroupMembershipBodyCreate,
opts?: ContentFieldsQuery
): Promise<GroupMemberEntry> {
throwIfNotDefined(groupId, 'groupId');
throwIfNotDefined(groupMembershipBodyCreate, 'groupMembershipBodyCreate');
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.post({
path: '/groups/{groupId}/members',
pathParams: { groupId },
queryParams,
bodyParam: groupMembershipBodyCreate
});
}
/**
* Delete a group
*
* **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.
*
* Delete group **groupId**.
* The option to cascade delete applies this recursively to any hierarchy of group members.
* In this case, removing a group member does not delete the person or sub-group itself.
* If a removed sub-group no longer has any parent groups then it becomes a root group.
* You must have admin rights to delete a group.
*
* @param groupId The identifier of a group.
* @param opts Optional parameters
* @returns Promise
*/
deleteGroup(groupId: string, opts?: DeleteGroupOpts): Promise<void> {
throwIfNotDefined(groupId, 'groupId');
opts = opts || {};
const cascadeDelete = opts['cascade'] ? opts['cascade'] : false;
const pathParams = {
groupId
};
const queryParams = {
cascade: cascadeDelete
};
return this.delete({
path: '/groups/{groupId}',
pathParams,
queryParams
});
}
/**
* Delete a group membership
*
* **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.
*
* Delete group member **groupMemberId** (person or sub-group) from group **groupId**.
* Removing a group member does not delete the person or sub-group itself.\
* If a removed sub-group no longer has any parent groups then it becomes a root group.
*
* @param groupId The identifier of a group.
* @param groupMemberId The identifier of a person or group.
* @returns Promise<{}>
*/
deleteGroupMembership(groupId: string, groupMemberId: string): Promise<void> {
throwIfNotDefined(groupId, 'groupId');
throwIfNotDefined(groupMemberId, 'groupMemberId');
const pathParams = {
groupId,
groupMemberId
};
return this.delete({
path: '/groups/{groupId}/members/{groupMemberId}',
pathParams
});
}
/**
* Get group details
*
* **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.
*
* Get details for group **groupId**.
* You can use the **include** parameter to return additional information.
*
* @param groupId The identifier of a group.
* @param opts Optional parameters
* @returns Promise<GroupEntry>
*/
getGroup(groupId: string, opts?: ContentIncludeQuery & ContentFieldsQuery): Promise<GroupEntry> {
throwIfNotDefined(groupId, 'groupId');
const pathParams = {
groupId
};
const queryParams = {
include: buildCollectionParam(opts?.include, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/groups/{groupId}',
pathParams,
queryParams
});
}
/**
* List memberships of a group
*
* **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.
*
* Gets a list of the group memberships for the group **groupId**.
*
* You can use the **where** parameter to filter the returned groups by **memberType**.
* Example to filter by **memberType**, use any one of:
* - (memberType='GROUP')
* - (memberType='PERSON')
*
* The default sort order for the returned list is for group members to be sorted by ascending displayName.
* You can override the default by using the **orderBy** parameter. You can specify one of the following fields in the **orderBy** parameter:
* - id
* - displayName
*
* @param groupId The identifier of a group.
* @param opts Optional parameters
* @returns Promise<GroupMemberPaging>
*/
listGroupMemberships(groupId: string, opts?: ListGroupMembershipsOpts & ContentPagingQuery & ContentFieldsQuery): Promise<GroupMemberPaging> {
throwIfNotDefined(groupId, 'groupId');
const pathParams = {
groupId
};
const queryParams = {
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
orderBy: buildCollectionParam(opts?.orderBy, 'csv'),
where: opts?.where,
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/groups/{groupId}/members',
pathParams,
queryParams,
returnType: GroupMemberPaging
});
}
/**
* List group memberships
*
* **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.
*
* @param personId The identifier of a person.
* @param opts Optional parameters
* @param opts.skipCount The number of entities that exist in the collection before those included in this list.
* If not supplied then the default value is 0. (default to 0)
* @param opts.maxItems The maximum number of items to return in the list. If not supplied then the default value is 100. (default to 100)
* @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to
* sort the list by one or more fields.
* Each field has a default sort order, which is normally ascending order. Read the API method implementation notes
* above to check if any fields used in this method have a descending default search order.
* To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.
* @param opts.include Returns additional information about the group. The following optional fields can be requested:
* - parentIds
* - zones
* @param opts.where A string to restrict the returned objects by using a predicate.
* @param opts.fields A list of field names.
* You can use this parameter to restrict the fields
* returned within a response if, for example, you want to save on overall bandwidth.
* The list applies to a returned individual entity or entries within a collection.
* If the API method also supports the **include** parameter, then the fields specified in the **include**
* parameter are returned in addition to those specified in the **fields** parameter.
* @returns Promise<GroupPaging>
*/
listGroupMembershipsForPerson(
personId: string,
opts?: GroupPagingOpts & ContentPagingQuery & ContentIncludeQuery & ContentFieldsQuery
): Promise<GroupPaging> {
throwIfNotDefined(personId, 'personId');
const pathParams = {
personId
};
const queryParams = {
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
orderBy: buildCollectionParam(opts?.orderBy, 'csv'),
include: buildCollectionParam(opts?.include, 'csv'),
where: opts?.where,
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/people/{personId}/groups',
pathParams,
queryParams,
returnType: GroupPaging
});
}
/**
* List groups
*
* **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.
*
* @param opts Optional parameters
* @returns Promise<GroupPaging>
*/
listGroups(opts?: GroupPagingOpts & ContentPagingQuery & ContentIncludeQuery & ContentFieldsQuery): Promise<GroupPaging> {
const queryParams = {
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
orderBy: buildCollectionParam(opts?.orderBy, 'csv'),
include: buildCollectionParam(opts?.include, 'csv'),
where: opts?.where,
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/groups',
queryParams,
returnType: GroupPaging
});
}
/**
* Update group details
*
* **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.
* You must have admin rights to update a group.
*
* @param groupId The identifier of a group.
* @param groupBodyUpdate The group information to update.
* @param opts Optional parameters
* @returns Promise<GroupEntry>
*/
updateGroup(groupId: string, groupBodyUpdate: GroupBodyUpdate, opts?: ContentIncludeQuery & ContentFieldsQuery): Promise<GroupEntry> {
throwIfNotDefined(groupId, 'groupId');
throwIfNotDefined(groupBodyUpdate, 'groupBodyUpdate');
const pathParams = {
groupId
};
const queryParams = {
include: buildCollectionParam(opts?.include, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.put({
path: '/groups/{groupId}',
pathParams,
queryParams,
bodyParam: groupBodyUpdate
});
}
}

View File

@@ -0,0 +1,39 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './types';
export * from './actions.api';
export * from './activities.api';
export * from './audit.api';
export * from './categories.api';
export * from './comments.api';
export * from './downloads.api';
export * from './favorites.api';
export * from './groups.api';
export * from './networks.api';
export * from './nodes.api';
export * from './people.api';
export * from './preferences.api';
export * from './probes.api';
export * from './queries.api';
export * from './ratings.api';
export * from './renditions.api';
export * from './sharedlinks.api';
export * from './sites.api';
export * from './tags.api';
export * from './trashcan.api';
export * from './versions.api';

View File

@@ -0,0 +1,116 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { PersonNetworkEntry } from '../model/personNetworkEntry';
import { PersonNetworkPaging } from '../model/personNetworkPaging';
import { BaseApi } from './base.api';
import { throwIfNotDefined } from '../../../assert';
import { buildCollectionParam } from '../../../alfrescoApiClient';
import { ContentFieldsQuery, ContentPagingQuery } from './types';
/**
* Networks service.
*/
export class NetworksApi extends BaseApi {
/**
* Get a network
*
* @param networkId The identifier of a network.
* @param opts Optional parameters
* @returns Promise<PersonNetworkEntry>
*/
getNetwork(networkId: string, opts?: ContentFieldsQuery): Promise<PersonNetworkEntry> {
throwIfNotDefined(networkId, 'networkId');
const pathParams = {
networkId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/networks/{networkId}',
pathParams,
queryParams,
returnType: PersonNetworkEntry
});
}
/**
* Get network information
*
* You can use the -me- string in place of <personId> to specify the currently authenticated user.
*
* @param personId The identifier of a person.
* @param networkId The identifier of a network.
* @param opts Optional parameters
* @returns Promise<PersonNetworkEntry>
*/
getNetworkForPerson(personId: string, networkId: string, opts?: ContentFieldsQuery): Promise<PersonNetworkEntry> {
throwIfNotDefined(personId, 'personId');
throwIfNotDefined(networkId, 'networkId');
const pathParams = {
personId,
networkId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/people/{personId}/networks/{networkId}',
pathParams,
queryParams,
returnType: PersonNetworkEntry
});
}
/**
* List network membership
*
* Gets a list of network memberships for person **personId**.
* You can use the -me- string in place of <personId> to specify the currently authenticated user.
*
* @param personId The identifier of a person.
* @param opts Optional parameters
* @returns Promise<PersonNetworkPaging>
*/
listNetworksForPerson(personId: string, opts?: ContentPagingQuery & ContentFieldsQuery): Promise<PersonNetworkPaging> {
throwIfNotDefined(personId, 'personId');
const pathParams = {
personId
};
const queryParams = {
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/people/{personId}/networks',
pathParams,
queryParams,
returnType: PersonNetworkPaging
});
}
}

View File

@@ -0,0 +1,974 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
AssociationBody,
AssociationEntry,
ChildAssociationBody,
ChildAssociationEntry,
DirectAccessUrlEntry,
NodeAssociationPaging,
NodeBodyCopy,
NodeBodyCreate,
NodeBodyLock,
NodeBodyMove,
NodeBodyUpdate,
NodeChildAssociationPaging,
NodeEntry
} from '../model';
import { BaseApi } from './base.api';
import { throwIfNotDefined } from '../../../assert';
import { buildCollectionParam } from '../../../alfrescoApiClient';
import { ContentPagingQuery } from './types';
export type NodesIncludeQuery = {
/**
* Returns additional information about the node. The following optional fields can be requested:
* - allowableOperations
* - association
* - isLink
* - isFavorite
* - isLocked
* - path
* - permissions
* - definition
*/
include?: string[];
/**
* A list of field names.
*
* You can use this parameter to restrict the fields
* returned within a response if, for example, you want to save on overall bandwidth.
*
* The list applies to a returned individual
* entity or entries within a collection.
*
* If the API method also supports the **include**
* parameter, then the fields specified in the **include**
* parameter are returned in addition to those specified in the **fields** parameter.
*/
fields?: string[];
};
export interface CreateNodeOpts extends NodesIncludeQuery {
[key: string]: any;
// If true, then a name clash will cause an attempt to auto rename by finding a unique name using an integer suffix.
autoRename?: boolean;
// If true, then created node will be version 1.0 MAJOR. If false, then created node will be version 0.1 MINOR.
majorVersion?: boolean;
// If true, then created node will be versioned. If false, then created node will be unversioned and auto-versioning disabled.
versioningEnabled?: boolean;
}
/**
* Nodes service.
*/
export class NodesApi extends BaseApi {
/**
* Copy a node
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* Copies the node **nodeId** to the parent folder node **targetParentId**. You specify the **targetParentId** in the request body.
*
* The new node has the same name as the source node unless you specify a new **name** in the request body.
*
* If the source **nodeId** is a folder, then all of its children are also copied.
*
* If the source **nodeId** is a file, it's properties, aspects and tags are copied, it's ratings, comments and locks are not.
*
* @param nodeId The identifier of a node.
* @param nodeBodyCopy The targetParentId and, optionally, a new name which should include the file extension.
* @param opts Optional parameters
* @returns Promise<NodeEntry>
*/
copyNode(nodeId: string, nodeBodyCopy: NodeBodyCopy, opts?: NodesIncludeQuery): Promise<NodeEntry> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(nodeBodyCopy, 'nodeBodyCopy');
const pathParams = {
nodeId
};
const queryParams = {
include: buildCollectionParam(opts?.include, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.post({
path: '/nodes/{nodeId}/copy',
pathParams,
queryParams,
bodyParam: nodeBodyCopy,
returnType: NodeEntry
});
}
/**
* Create node association
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* @param nodeId The identifier of a source node.
* @param associationBodyCreate The target node id and assoc type.
* @param opts Optional parameters
* @param opts.fields A list of field names.
* You can use this parameter to restrict the fields
* returned within a response if, for example, you want to save on overall bandwidth.
* The list applies to a returned individual entity or entries within a collection.
* If the API method also supports the **include** parameter, then the fields specified in the **include**
* parameter are returned in addition to those specified in the **fields** parameter.
* @returns Promise<AssociationEntry>
*/
createAssociation(nodeId: string, associationBodyCreate: AssociationBody, opts?: { fields?: string[] }): Promise<AssociationEntry> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(associationBodyCreate, 'associationBodyCreate');
const pathParams = {
nodeId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.post({
path: '/nodes/{nodeId}/targets',
pathParams,
queryParams,
bodyParam: associationBodyCreate
});
}
/**
* Create a node
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* @param nodeId The identifier of a node. You can also use one of these well-known aliases:
* -my-
* -shared-
* -root-
* @param nodeBodyCreate The node information to create.
* @param opts Optional parameters
* @param opts.autoRename If true, then a name clash will cause an attempt to auto rename by finding a unique name using an integer suffix.
* @param opts.include Returns additional information about the node. The following optional fields can be requested:
* - allowableOperations
* - association
* - isLink
* - isFavorite
* - isLocked
* - path
* - permissions
* - definition
* @param opts.fields A list of field names. You can use this parameter to restrict the fields
* returned within a response if, for example, you want to save on overall bandwidth.
* The list applies to a returned individual entity or entries within a collection.
* If the API method also supports the **include** parameter, then the fields specified in the **include**
* parameter are returned in addition to those specified in the **fields** parameter.
* @param formParams parameters
* @returns Promise<NodeEntry>
*/
createNode(nodeId: string, nodeBodyCreate: NodeBodyCreate, opts?: CreateNodeOpts, formParams?: any): Promise<NodeEntry | any> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(nodeBodyCreate, 'nodeBodyCreate');
const pathParams = {
nodeId
};
const queryParams = {
autoRename: opts?.autoRename,
include: buildCollectionParam(opts?.include, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
formParams = formParams || {};
let contentTypes;
let returnType;
if (formParams.filedata) {
contentTypes = ['multipart/form-data'];
} else {
contentTypes = ['application/json'];
returnType = NodeEntry;
}
return this.post({
path: '/nodes/{nodeId}/children',
pathParams,
queryParams,
formParams,
bodyParam: nodeBodyCreate,
contentTypes,
returnType
});
}
/**
* Create a folder
*
* @param name - folder name
* @param relativePath - The relativePath specifies the folder structure to create relative to the node identified by nodeId.
* @param nodeId default value root.The identifier of a node where add the folder. You can also use one of these well-known aliases: -my- | -shared- | -root-
* @param opts Optional parameters
* @returns A promise that is resolved if the folder is created and {error} if rejected.
*/
createFolder(name: string, relativePath: string, nodeId: string, opts?: CreateNodeOpts): Promise<NodeEntry> {
nodeId = nodeId || '-root-';
const nodeBody = new NodeBodyCreate({
name,
relativePath,
nodeType: 'cm:folder'
});
return this.createNode(nodeId, nodeBody, opts);
}
/**
* Create secondary child
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* @param nodeId The identifier of a parent node.
* @param secondaryChildAssociationBodyCreate The child node id and assoc type.
* @param opts Optional parameters
* @param opts.fields A list of field names.
* You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth.
* The list applies to a returned individual entity or entries within a collection.
* If the API method also supports the **include** parameter, then the fields specified in the **include**
* parameter are returned in addition to those specified in the **fields** parameter.
* @returns Promise<ChildAssociationEntry>
*/
createSecondaryChildAssociation(
nodeId: string,
secondaryChildAssociationBodyCreate: ChildAssociationBody,
opts?: {
fields?: string[];
}
): Promise<ChildAssociationEntry> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(secondaryChildAssociationBodyCreate, 'secondaryChildAssociationBodyCreate');
const pathParams = {
nodeId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.post({
path: '/nodes/{nodeId}/secondary-children',
pathParams,
queryParams,
bodyParam: secondaryChildAssociationBodyCreate,
returnType: ChildAssociationEntry
});
}
/**
* Delete node association(s)
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* Delete an association, or associations, from the source **nodeId* to a target node for the given association type.
* If the association type is **not** specified, then all peer associations, of any type, in the direction
* from source to target, are deleted.
* **Note:** After removal of the peer association, or associations, from source to target, the two nodes may still have peer associations in the other direction.
*
* @param nodeId The identifier of a source node.
* @param targetId The identifier of a target node.
* @param opts Optional parameters
* @param opts.assocType Only delete associations of this type.
* @returns Promise<{}>
*/
deleteAssociation(nodeId: string, targetId: string, opts?: { assocType?: string }): Promise<void> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(targetId, 'targetId');
const pathParams = {
nodeId,
targetId
};
const queryParams = {
assocType: opts?.assocType
};
return this.delete({
path: '/nodes/{nodeId}/targets/{targetId}',
pathParams,
queryParams
});
}
/**
* Delete a node
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* If **nodeId** is a folder, then its children are also deleted.
* Deleted nodes move to the trashcan unless the **permanent** query parameter is **true** and the current user is the owner of the node or an admin.
*
* Deleting a node deletes it from its primary parent and also from any secondary parents. Peer associations are also deleted, where the deleted
* node is either a source or target of an association. This applies recursively to any hierarchy of primary children of the deleted node.
*
* **Note:** If the node is not permanently deleted, and is later successfully restored to its former primary parent, then the primary
* child association is restored. This applies recursively for any primary children. No other secondary child associations or
* peer associations are restored for any of the nodes in the primary parent-child hierarchy of restored nodes, regardless of whether the original
* associations were to nodes inside or outside the restored hierarchy.
*
* @param nodeId The identifier of a node.
* @param opts Optional parameters
* @param opts.permanent If **true** then the node is deleted permanently, without moving to the trashcan.
* Only the owner of the node or an admin can permanently delete the node. (default to false)
* @returns Promise<{}>
*/
deleteNode(nodeId: string, opts?: { permanent?: boolean }): Promise<void> {
throwIfNotDefined(nodeId, 'nodeId');
const pathParams = {
nodeId
};
const queryParams = {
permanent: opts?.permanent
};
return this.delete({
path: '/nodes/{nodeId}',
pathParams,
queryParams
});
}
/**
* Delete multiple nodes
*
* @param nodeIds The list of node IDs to delete.
* @param opts Optional parameters
* @param opts.permanent If **true** then nodes are deleted permanently, without moving to the trashcan.
* Only the owner of the node or an admin can permanently delete the node. (default to false)
* @returns Promise<[]>
*/
deleteNodes(nodeIds: string[], opts?: { permanent?: boolean }): Promise<void[]> {
throwIfNotDefined(nodeIds, 'nodeIds');
return Promise.all(nodeIds.map((id) => this.deleteNode(id, opts)));
}
/**
* Delete secondary child or children
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* Delete secondary child associations between the parent **nodeId** and child nodes for the given association type.
*
* If the association type is **not** specified, then all secondary child associations, of any type in the direction
* from parent to secondary child, will be deleted. The child will still have a primary parent and may still be
* associated as a secondary child with other secondary parents.
*
* @param nodeId The identifier of a parent node.
* @param childId The identifier of a child node.
* @param opts Optional parameters
* @param opts.assocType Only delete associations of this type.
* @returns Promise<{}>
*/
deleteSecondaryChildAssociation(nodeId: string, childId: string, opts?: { assocType?: string }): Promise<void> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(childId, 'childId');
const pathParams = {
nodeId,
childId
};
return this.delete({
path: '/nodes/{nodeId}/secondary-children/{childId}',
pathParams,
queryParams: opts
});
}
/**
* Get a node
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* You can use the **include** parameter to return additional information.
*
* @param nodeId The identifier of a node. You can also use one of these well-known aliases:
* - -my-
* - -shared-
* - -root-
* @param opts Optional parameters
* @param opts.relativePath A path relative to the **nodeId**. If you set this, information is returned on the node resolved by this path.
* @returns Promise<NodeEntry>
*/
getNode(nodeId: string, opts?: { relativePath?: string } & NodesIncludeQuery): Promise<NodeEntry> {
throwIfNotDefined(nodeId, 'nodeId');
const pathParams = {
nodeId
};
const queryParams = {
include: buildCollectionParam(opts?.include, 'csv'),
relativePath: opts?.relativePath,
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/nodes/{nodeId}',
pathParams,
queryParams,
returnType: NodeEntry
});
}
/**
* Get node content
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* @param nodeId The identifier of a node.
* @param opts Optional parameters
* @param opts.attachment **true** enables a web browser to download the file as an attachment.
* **false** means a web browser may preview the file in a new tab or window, but not download the file.
* You can only set this parameter to **false** if the content type of the file is in the supported list;
* for example, certain image files and PDF files.
* If the content type is not supported for preview, then a value of **false** is ignored, and
* the attachment will be returned in the response. (default to true)
* @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided.
* Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT.
* @param opts.range The Range header indicates the part of a document that the server should return.
* Single part request supported, for example: bytes=1-10.
* @returns Promise<Blob>
*/
getNodeContent(
nodeId: string,
opts?: {
attachment?: boolean;
ifModifiedSince?: string;
range?: string;
}
): Promise<Blob> {
throwIfNotDefined(nodeId, 'nodeId');
opts = opts || {};
const pathParams = {
nodeId
};
const queryParams = {
attachment: opts?.attachment
};
const headerParams = {
'If-Modified-Since': opts?.ifModifiedSince,
Range: opts?.range
};
const accepts = ['application/octet-stream'];
return this.get({
path: '/nodes/{nodeId}/content',
pathParams,
queryParams,
headerParams,
accepts,
returnType: 'blob'
});
}
/**
* List node children
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* Gets a list of children of the parent node **nodeId**.
* Minimal information for each child is returned by default.
* You can use the **include** parameter to return additional information.
* The list of child nodes includes primary children and secondary children, if there are any.
* You can use the **include** parameter (include=association) to return child association details
* for each child, including the **assocTyp**e and the **isPrimary** flag.
*
* The default sort order for the returned list is for folders to be sorted before files, and by ascending name.
*
* You can override the default using **orderBy** to specify one or more fields to sort by. The default order is always ascending, but
* you can use an optional **ASC** or **DESC** modifier to specify an ascending or descending sort order.
*
* For example, specifying orderBy=name DESC returns a mixed folder/file list in descending **name** order.
* You can use any of the following fields to order the results:
* - isFolder
* - name
* - mimeType
* - nodeType
* - sizeInBytes
* - modifiedAt
* - createdAt
* - modifiedByUser
* - createdByUser
*
* @param nodeId The identifier of a node. You can also use one of these well-known aliases:
* - -my-
* - -shared-
* - -root-
* @param opts Optional parameters
* @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields.
* Each field has a default sort order, which is normally ascending order. Read the API method implementation notes
* above to check if any fields used in this method have a descending default search order.
* To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.
* @param opts.where Optionally filter the list. Here are some examples:
* - where=(isFolder=true)
* - where=(isFile=true)
* - where=(nodeType='my:specialNodeType')
* - where=(nodeType='my:specialNodeType INCLUDESUBTYPES')
* - where=(isPrimary=true)
* - where=(assocType='my:specialAssocType')
* - where=(isPrimary=false and assocType='my:specialAssocType')
* @param opts.relativePath Return information on children in the folder resolved by this path. The path is relative to **nodeId**.
* @param opts.includeSource Also include **source** in addition to **entries** with folder information on the parent node either the specified parent **nodeId**, or as resolved by **relativePath**.
* @returns Promise<NodeChildAssociationPaging>
*/
listNodeChildren(
nodeId: string,
opts?: {
orderBy?: string[];
where?: string;
relativePath?: string;
includeSource?: boolean;
} & NodesIncludeQuery &
ContentPagingQuery
): Promise<NodeChildAssociationPaging> {
throwIfNotDefined(nodeId, 'nodeId');
const pathParams = {
nodeId
};
const queryParams = {
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
orderBy: buildCollectionParam(opts?.orderBy, 'csv'),
where: opts?.where,
include: buildCollectionParam(opts?.include, 'csv'),
relativePath: opts?.relativePath,
includeSource: opts?.includeSource,
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/nodes/{nodeId}/children',
pathParams,
queryParams,
returnType: NodeChildAssociationPaging
});
}
/**
* List parents
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* Gets a list of parent nodes that are associated with the current child **nodeId**.
* The list includes both the primary parent and any secondary parents.
*
* @param nodeId The identifier of a child node. You can also use one of these well-known aliases:
* - -my-
* - -shared-
* - -root-
* @param opts Optional parameters
* @param opts.where Optionally filter the list by **assocType** and/or **isPrimary**. Here are some example filters:
* - where=(assocType='my:specialAssocType')
* - where=(isPrimary=true)
* - where=(isPrimary=false and assocType='my:specialAssocType')
* @param opts.includeSource Also include **source** (in addition to **entries**) with folder information on **nodeId**
* @returns Promise<NodeAssociationPaging>
*/
listParents(
nodeId: string,
opts?: {
where?: string;
includeSource?: boolean;
} & NodesIncludeQuery &
ContentPagingQuery
): Promise<NodeAssociationPaging> {
throwIfNotDefined(nodeId, 'nodeId');
opts = opts || {};
const pathParams = {
nodeId
};
const queryParams = {
where: opts?.where,
include: buildCollectionParam(opts?.include, 'csv'),
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
includeSource: opts?.includeSource,
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/nodes/{nodeId}/parents',
pathParams,
queryParams,
returnType: NodeAssociationPaging
});
}
/**
* List secondary children
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* Gets a list of secondary child nodes that are associated with the current parent **nodeId**, via a secondary child association.
*
* @param nodeId The identifier of a parent node. You can also use one of these well-known aliases:
* -my-
* -shared-
* -root-
* @param opts Optional parameters
* @param opts.where Optionally filter the list by assocType. Here's an example:
* - where=(assocType='my:specialAssocType')
* @param opts.includeSource Also include **source** (in addition to **entries**) with folder information on **nodeId**
* @returns Promise<NodeChildAssociationPaging>
*/
listSecondaryChildren(
nodeId: string,
opts?: {
where?: string;
includeSource?: boolean;
} & NodesIncludeQuery &
ContentPagingQuery
): Promise<NodeChildAssociationPaging> {
throwIfNotDefined(nodeId, 'nodeId');
opts = opts || {};
const pathParams = {
nodeId
};
const queryParams = {
where: opts?.where,
include: buildCollectionParam(opts?.include, 'csv'),
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
includeSource: opts?.includeSource,
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/nodes/{nodeId}/secondary-children',
pathParams,
queryParams,
returnType: NodeChildAssociationPaging
});
}
/**
* List source associations
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* @param nodeId The identifier of a target node.
* @param opts Optional parameters
* @param opts.where Optionally filter the list by **assocType**. Here's an example:
* - where=(assocType='my:specialAssocType')
* @returns Promise<NodeAssociationPaging>
*/
listSourceAssociations(
nodeId: string,
opts?: {
where?: string;
} & NodesIncludeQuery
): Promise<NodeAssociationPaging> {
throwIfNotDefined(nodeId, 'nodeId');
opts = opts || {};
const pathParams = {
nodeId
};
const queryParams = {
where: opts?.where,
include: buildCollectionParam(opts?.include, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/nodes/{nodeId}/sources',
pathParams,
queryParams,
returnType: NodeAssociationPaging
});
}
/**
* List target associations
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* Gets a list of target nodes that are associated with the current source **nodeId**.
*
* @param nodeId The identifier of a source node.
* @param opts Optional parameters
* @param opts.where Optionally filter the list by **assocType**. Here's an example:
* - where=(assocType='my:specialAssocType')
* @returns Promise<NodeAssociationPaging>
*/
listTargetAssociations(
nodeId: string,
opts?: {
where?: string;
} & NodesIncludeQuery &
ContentPagingQuery
): Promise<NodeAssociationPaging> {
throwIfNotDefined(nodeId, 'nodeId');
opts = opts || {};
const pathParams = {
nodeId
};
const queryParams = {
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
where: opts?.where,
include: buildCollectionParam(opts?.include, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/nodes/{nodeId}/targets',
pathParams,
queryParams,
returnType: NodeAssociationPaging
});
}
/**
* Lock a node
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* If a lock on the node cannot be taken, then an error is returned.
*
* @param nodeId The identifier of a node.
* @param nodeBodyLock Lock details.
* @param opts Optional parameters
* @returns Promise<NodeEntry>
*/
lockNode(nodeId: string, nodeBodyLock: NodeBodyLock, opts?: NodesIncludeQuery): Promise<NodeEntry> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(nodeBodyLock, 'nodeBodyLock');
const pathParams = {
nodeId
};
const queryParams = {
include: buildCollectionParam(opts?.include, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.post({
path: '/nodes/{nodeId}/lock',
pathParams,
queryParams,
bodyParam: nodeBodyLock,
returnType: NodeEntry
});
}
/**
* Move a node
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* The **targetParentId** is specified in the in request body.
* The moved node retains its name unless you specify a new **name** in the request body.
* If the source **nodeId** is a folder, then its children are also moved.
* The move will effectively change the primary parent.
*
* @param nodeId The identifier of a node.
* @param nodeBodyMove The targetParentId and, optionally, a new name which should include the file extension.
* @param opts Optional parameters
* @returns Promise<NodeEntry>
*/
moveNode(nodeId: string, nodeBodyMove: NodeBodyMove, opts?: NodesIncludeQuery): Promise<NodeEntry> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(nodeBodyMove, 'nodeBodyMove');
const pathParams = {
nodeId
};
const queryParams = {
include: buildCollectionParam(opts?.include, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.post({
path: '/nodes/{nodeId}/move',
pathParams,
queryParams,
bodyParam: nodeBodyMove,
returnType: NodeEntry
});
}
/**
* Unlock a node
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* The current user must be the owner of the locks or have admin rights, otherwise an error is returned.
* If a lock on the node cannot be released, then an error is returned.
*
* @param nodeId The identifier of a node.
* @param opts Optional parameters
* @returns Promise<NodeEntry>
*/
unlockNode(nodeId: string, opts?: NodesIncludeQuery): Promise<NodeEntry> {
throwIfNotDefined(nodeId, 'nodeId');
const pathParams = {
nodeId
};
const queryParams = {
include: buildCollectionParam(opts?.include, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.post({
path: '/nodes/{nodeId}/unlock',
pathParams,
queryParams,
returnType: NodeEntry
});
}
/**
* Update a node
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* @param nodeId The identifier of a node.
* @param nodeBodyUpdate The node information to update.
* @param opts Optional parameters
* @returns Promise<NodeEntry>
*/
updateNode(nodeId: string, nodeBodyUpdate: NodeBodyUpdate, opts?: NodesIncludeQuery): Promise<NodeEntry> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(nodeBodyUpdate, 'nodeBodyUpdate');
const pathParams = {
nodeId
};
const queryParams = {
include: buildCollectionParam(opts?.include, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.put({
path: '/nodes/{nodeId}',
pathParams,
queryParams,
bodyParam: nodeBodyUpdate,
returnType: NodeEntry
});
}
/**
* Update node content
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* @param nodeId The identifier of a node.
* @param contentBodyUpdate The binary content
* @param opts Optional parameters
* @param opts.majorVersion If **true**, create a major version.
* Setting this parameter also enables versioning of this node, if it is not already versioned. (default to false)
* @param opts.comment Add a version comment which will appear in version history.
* Setting this parameter also enables versioning of this node, if it is not already versioned.
* @param opts.name Optional new name. This should include the file extension.
* The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |.
* The character . must not be used at the end of the name.
* @returns Promise<NodeEntry>
*/
updateNodeContent(
nodeId: string,
contentBodyUpdate: string,
opts?: {
majorVersion?: boolean;
comment?: string;
name?: string;
} & NodesIncludeQuery
): Promise<NodeEntry> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(contentBodyUpdate, 'contentBodyUpdate');
opts = opts || {};
const pathParams = {
nodeId
};
const queryParams = {
majorVersion: opts?.majorVersion,
comment: opts?.comment,
name: opts?.name,
include: buildCollectionParam(opts?.include, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.put({
path: '/nodes/{nodeId}/content',
pathParams,
queryParams,
contentTypes: ['application/octet-stream'],
bodyParam: contentBodyUpdate,
returnType: NodeEntry
});
}
/**
* Generate a direct access content url for a given node
*
* **Note:** this endpoint is available in Alfresco 7.1 and newer versions.
*
* @param nodeId The identifier of a node.
* @returns Promise<DirectAccessUrlEntry>
*/
requestDirectAccessUrl(nodeId: string): Promise<DirectAccessUrlEntry> {
throwIfNotDefined(nodeId, 'nodeId');
const pathParams = {
nodeId
};
return this.post({
path: '/nodes/{nodeId}/request-direct-access-url',
pathParams,
returnType: DirectAccessUrlEntry
});
}
}

View File

@@ -0,0 +1,333 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ClientBody, PasswordResetBody, PersonBodyCreate, PersonBodyUpdate, PersonEntry, PersonPaging } from '../model';
import { BaseApi } from './base.api';
import { throwIfNotDefined } from '../../../assert';
import { buildCollectionParam } from '../../../alfrescoApiClient';
import { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types';
/**
* People service.
*/
export class PeopleApi extends BaseApi {
/**
* Create person
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
* **Note:** setting properties of type d:content and d:category are not supported.
*
* @param personBodyCreate The person details.
* @param opts Optional parameters
* @returns Promise<PersonEntry>
*/
createPerson(personBodyCreate: PersonBodyCreate, opts?: ContentFieldsQuery): Promise<PersonEntry> {
throwIfNotDefined(personBodyCreate, 'personBodyCreate');
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.post({
path: '/people',
queryParams,
bodyParam: personBodyCreate,
returnType: PersonEntry
});
}
/**
* Delete avatar image
*
* **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.
*
* Deletes the avatar image related to person **personId**.
* You must be the person or have admin rights to update a person's avatar.
* You can use the -me- string in place of <personId> to specify the currently authenticated user.
*
* @param personId The identifier of a person.
* @returns Promise<{}>
*/
deleteAvatarImage(personId: string): Promise<void> {
throwIfNotDefined(personId, 'personId');
const pathParams = {
personId
};
return this.delete({
path: '/people/{personId}/avatar',
pathParams
});
}
/**
* Get avatar image
*
* **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.
*
* Gets the avatar image related to the person **personId**. If the person has no related avatar then
* the **placeholder** query parameter can be optionally used to request a placeholder image to be returned.
*
* You can use the -me- string in place of <personId> to specify the currently authenticated user.
*
* @param personId The identifier of a person.
* @param opts Optional parameters
* @param opts.attachment **true** enables a web browser to download the file as an attachment.
* **false** means a web browser may preview the file in a new tab or window, but not download the file.
* You can only set this parameter to **false** if the content type of the file is in the supported list;
* for example, certain image files and PDF files.
* If the content type is not supported for preview, then a value of **false** is ignored, and
* the attachment will be returned in the response. (default to true)
* @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided.
* Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT.
* @param opts.placeholder If **true** and there is no avatar for this **personId**
* then the placeholder image is returned, rather than a 404 response. (default to true)
* @returns Promise<Blob>
*/
getAvatarImage(personId: string, opts?: { attachment?: boolean; placeholder?: boolean; ifModifiedSince?: string }): Promise<Blob> {
throwIfNotDefined(personId, 'personId');
const pathParams = {
personId
};
const queryParams = {
attachment: opts?.attachment,
placeholder: opts?.placeholder
};
const headerParams = {
'If-Modified-Since': opts?.ifModifiedSince
};
const accepts = ['application/octet-stream'];
return this.get({
path: '/people/{personId}/avatar',
pathParams,
queryParams,
headerParams,
accepts,
returnType: 'blob'
});
}
/**
* Get a person
*
* You can use the `-me-` string in place of <personId> to specify the currently authenticated user.
*
* @param personId The identifier of a person.
* @param opts Optional parameters
* @returns Promise<PersonEntry>
*/
getPerson(personId: string, opts?: ContentFieldsQuery): Promise<PersonEntry> {
throwIfNotDefined(personId, 'personId');
const pathParams = {
personId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/people/{personId}',
pathParams,
queryParams,
returnType: PersonEntry
});
}
/**
* List people
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* List people.
*
* You can use the **include** parameter to return any additional information.
*
* The default sort order for the returned list is for people to be sorted by ascending id.
* You can override the default by using the **orderBy** parameter.
*
* You can use any of the following fields to order the results:
* - id
* - firstName
* - lastName
*
* @param opts Optional parameters
* @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to
* sort the list by one or more fields.
*
* Each field has a default sort order, which is normally ascending order. Read the API method implementation notes
* above to check if any fields used in this method have a descending default search order.
*
* To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.
* @returns Promise<PersonPaging>
*/
listPeople(
opts?: {
orderBy?: string[];
} & ContentPagingQuery &
ContentIncludeQuery &
ContentFieldsQuery
): Promise<PersonPaging> {
const queryParams = {
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
orderBy: buildCollectionParam(opts?.orderBy, 'csv'),
include: buildCollectionParam(opts?.include, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/people',
queryParams,
returnType: PersonPaging
});
}
/**
* Request password reset
*
* **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.
* **Note:** No authentication is required to call this endpoint.
*
* @param personId The identifier of a person.
* @param clientBody The client name to send email with app-specific url.
* @returns Promise<{}>
*/
requestPasswordReset(personId: string, clientBody: ClientBody): Promise<any> {
throwIfNotDefined(personId, 'personId');
throwIfNotDefined(clientBody, 'clientBody');
const pathParams = {
personId
};
return this.post({
path: '/people/{personId}/request-password-reset',
pathParams,
bodyParam: clientBody
});
}
/**
* Reset password
*
* **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions.
* **Note:** No authentication is required to call this endpoint.
*
* @param personId The identifier of a person.
* @param passwordResetBody The reset password details
* @returns Promise<{}>
*/
resetPassword(personId: string, passwordResetBody: PasswordResetBody): Promise<any> {
throwIfNotDefined(personId, 'personId');
throwIfNotDefined(passwordResetBody, 'passwordResetBody');
const pathParams = {
personId
};
return this.post({
path: '/people/{personId}/reset-password',
pathParams,
bodyParam: passwordResetBody
});
}
/**
* Update avatar image
*
* **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.
*
* Updates the avatar image related to the person **personId**.
*
* The request body should be the binary stream for the avatar image. The content type of the file
* should be an image file. This will be used to generate an \"avatar\" thumbnail rendition.
*
* You must be the person or have admin rights to update a person's avatar.
*
* You can use the -me- string in place of <personId> to specify the currently authenticated user.
*
* @param personId The identifier of a person.
* @param contentBodyUpdate The binary content
* @returns Promise<{}>
*/
updateAvatarImage(personId: string, contentBodyUpdate: string): Promise<any> {
throwIfNotDefined(personId, 'personId');
throwIfNotDefined(contentBodyUpdate, 'contentBodyUpdate');
const pathParams = {
personId
};
const contentTypes = ['application/octet-stream'];
return this.put({
path: '/people/{personId}/avatar',
pathParams,
bodyParam: contentBodyUpdate,
contentTypes
});
}
/**
* Update person
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* You can use the `-me-` string in place of <personId> to specify the currently authenticated user.
* If applicable, the given person's login access can also be optionally disabled or re-enabled.
* You must have admin rights to update a person — unless updating your own details.
* If you are changing your password, as a non-admin user, then the existing password must also
* be supplied (using the oldPassword field in addition to the new password value).
*
* Admin users cannot be disabled by setting enabled to false.
* Non-admin users may not disable themselves.
* **Note:** setting properties of type d:content and d:category are not supported.
*
* @param personId The identifier of a person.
* @param personBodyUpdate The person details.
* @param opts Optional parameters
* @returns Promise<PersonEntry>
*/
updatePerson(personId: string, personBodyUpdate: PersonBodyUpdate, opts?: ContentFieldsQuery): Promise<PersonEntry> {
throwIfNotDefined(personId, 'personId');
throwIfNotDefined(personBodyUpdate, 'personBodyUpdate');
const pathParams = {
personId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.put({
path: '/people/{personId}',
pathParams,
queryParams,
bodyParam: personBodyUpdate,
returnType: PersonEntry
});
}
}

View File

@@ -0,0 +1,89 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { PreferenceEntry, PreferencePaging } from '../model';
import { BaseApi } from './base.api';
import { throwIfNotDefined } from '../../../assert';
import { buildCollectionParam } from '../../../alfrescoApiClient';
import { ContentFieldsQuery, ContentPagingQuery } from './types';
/**
* Preferences service.
*/
export class PreferencesApi extends BaseApi {
/**
* Get a preference
*
* Gets a specific preference for person **personId**.
* You can use the -me- string in place of <personId> to specify the currently authenticated user.
*
* @param personId The identifier of a person.
* @param preferenceName The name of the preference.
* @param opts Optional parameters
* @returns Promise<PreferenceEntry>
*/
getPreference(personId: string, preferenceName: string, opts?: ContentFieldsQuery): Promise<PreferenceEntry> {
throwIfNotDefined(personId, 'personId');
throwIfNotDefined(preferenceName, 'preferenceName');
const pathParams = {
personId,
preferenceName
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/people/{personId}/preferences/{preferenceName}',
pathParams,
queryParams
});
}
/**
* List preferences
*
* You can use the -me- string in place of <personId> to specify the currently authenticated user.
* Note that each preference consists of an **id** and a **value**.
*
* The **value** can be of any JSON type.
*
* @param personId The identifier of a person.
* @param opts Optional parameters
* @returns Promise<PreferencePaging>
*/
listPreferences(personId: string, opts?: ContentPagingQuery & ContentFieldsQuery): Promise<PreferencePaging> {
throwIfNotDefined(personId, 'personId');
const pathParams = {
personId
};
const queryParams = {
...(opts || {}),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/people/{personId}/preferences',
pathParams,
queryParams
});
}
}

View File

@@ -0,0 +1,53 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ProbeEntry } from '../model';
import { BaseApi } from './base.api';
import { throwIfNotDefined } from '../../../assert';
/**
* Probes service.
*/
export class ProbesApi extends BaseApi {
/**
* Check readiness and liveness of the repository
*
* **Note:** this endpoint is available in Alfresco 6.0 and newer versions.
*
* Returns a status of 200 to indicate success and 503 for failure.
* The readiness probe is normally only used to check repository startup.
* The liveness probe should then be used to check the repository is still responding to requests.
* **Note:** No authentication is required to call this endpoint.
*
* @param probeId The name of the probe:
* - -ready-
* - -live-
* @returns Promise<ProbeEntry>
*/
getProbe(probeId: string): Promise<ProbeEntry> {
throwIfNotDefined(probeId, 'probeId');
const pathParams = {
probeId
};
return this.get({
path: '/probes/{probeId}',
pathParams
});
}
}

View File

@@ -0,0 +1,189 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { NodePaging } from '../model/nodePaging';
import { PersonPaging } from '../model/personPaging';
import { SitePaging } from '../model/sitePaging';
import { BaseApi } from './base.api';
import { throwIfNotDefined } from '../../../assert';
import { buildCollectionParam } from '../../../alfrescoApiClient';
import { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types';
export type FindQuery = {
/**
* The term to search for.
*/
term?: string;
/**
* A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to
* sort the list by one or more fields.
*
* Each field has a default sort order, which is normally ascending order. Read the API method implementation notes
* above to check if any fields used in this method have a descending default search order.
*
* To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.
*/
orderBy?: string[];
} & ContentPagingQuery &
ContentFieldsQuery;
export type FindNodesQuery = {
/**
* The id of the node to start the search from.
* Supports the aliases **-my-**, **-root-** and **-shared-**.
*/
rootNodeId?: string;
/**
* Restrict the returned results to only those of the given node type and its sub-types
*/
nodeType?: string;
} & FindQuery;
/**
* Queries service.
*/
export class QueriesApi extends BaseApi {
/**
* Find nodes
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* Gets a list of nodes that match the given search criteria.
*
* The search term is used to look for nodes that match against name, title, description, full text content or tags.
*
* The search term:
* - must contain a minimum of 3 alphanumeric characters
* - allows \"quoted term\"
* - can optionally use '*' for wildcard matching
*
* By default, file and folder types will be searched unless a specific type is provided as a query parameter.
*
* By default, the search will be across the repository unless a specific root node id is provided to start the search from.
*
* You can sort the result list using the **orderBy** parameter. You can specify one or more of the following fields in the **orderBy** parameter:
* - name
* - modifiedAt
* - createdAt
*
* @param term The term to search for.
* @param opts Optional parameters
* @returns Promise<NodePaging>
*/
findNodes(term: string, opts?: FindNodesQuery & ContentPagingQuery & ContentIncludeQuery & ContentFieldsQuery): Promise<NodePaging> {
throwIfNotDefined(term, 'term');
const queryParams = {
term,
rootNodeId: opts?.rootNodeId,
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
nodeType: opts?.nodeType,
include: buildCollectionParam(opts?.include, 'csv'),
orderBy: buildCollectionParam(opts?.orderBy, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/queries/nodes',
queryParams,
returnType: NodePaging
});
}
/**
* Find people
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* Gets a list of people that match the given search criteria.
*
* The search term is used to look for matches against person id, firstname and lastname.
*
* The search term:
* - must contain a minimum of 2 alphanumeric characters
* - can optionally use '*' for wildcard matching within the term
*
* You can sort the result list using the **orderBy** parameter. You can specify one or more of the following fields in the **orderBy** parameter:
* - id
* - firstName
* - lastName
*
* @param term The term to search for.
* @param opts Optional parameters
* @returns Promise<PersonPaging>
*/
findPeople(term: string, opts?: FindQuery): Promise<PersonPaging> {
throwIfNotDefined(term, 'term');
opts = opts || {};
const queryParams = {
term,
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
fields: buildCollectionParam(opts?.fields, 'csv'),
orderBy: buildCollectionParam(opts?.orderBy, 'csv')
};
return this.get({
path: '/queries/people',
queryParams,
returnType: PersonPaging
});
}
/**
* Find sites
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* Gets a list of sites that match the given search criteria.
*
* The search term is used to look for sites that match against site id, title or description.
*
* The search term:
* - must contain a minimum of 2 alphanumeric characters
* - can optionally use '*' for wildcard matching within the term
*
* The default sort order for the returned list is for sites to be sorted by ascending id.
* You can override the default by using the **orderBy** parameter. You can specify one or more of the following fields in the **orderBy** parameter:
* - id
* - title
* - description
*
* @param term The term to search for.
* @param opts Optional parameters
* @returns Promise<SitePaging>
*/
findSites(term: string, opts?: FindQuery): Promise<SitePaging> {
throwIfNotDefined(term, 'term');
const queryParams = {
term,
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
orderBy: buildCollectionParam(opts?.orderBy, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/queries/sites',
queryParams,
returnType: SitePaging
});
}
}

View File

@@ -0,0 +1,150 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { RatingBody } from '../model/ratingBody';
import { RatingEntry } from '../model/ratingEntry';
import { RatingPaging } from '../model/ratingPaging';
import { BaseApi } from './base.api';
import { throwIfNotDefined } from '../../../assert';
import { buildCollectionParam } from '../../../alfrescoApiClient';
import { ContentFieldsQuery, ContentPagingQuery } from './types';
/**
* Ratings service.
*/
export class RatingsApi extends BaseApi {
/**
* Create a rating
*
* @param nodeId The identifier of a node.
* @param ratingBodyCreate For \"myRating\" the type is specific to the rating scheme, boolean for the likes and an integer for the fiveStar.
* For example, to \"like\" a file the following body would be used:
*
*JSON
*{
* \"id\": \"likes\",
* \"myRating\": true
* }
* @param opts Optional parameters
* @returns Promise<RatingEntry>
*/
createRating(nodeId: string, ratingBodyCreate: RatingBody, opts?: ContentFieldsQuery): Promise<RatingEntry> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(ratingBodyCreate, 'ratingBodyCreate');
const pathParams = {
nodeId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.post({
path: '/nodes/{nodeId}/ratings',
pathParams,
queryParams,
bodyParam: ratingBodyCreate,
returnType: RatingEntry
});
}
/**
* Delete a rating
*
* Deletes rating **ratingId** from node **nodeId**.
*
* @param nodeId The identifier of a node.
* @param ratingId The identifier of a rating.
* @returns Promise<{}>
*/
deleteRating(nodeId: string, ratingId: string): Promise<void> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(ratingId, 'ratingId');
const pathParams = {
nodeId,
ratingId
};
return this.delete({
path: '/nodes/{nodeId}/ratings/{ratingId}',
pathParams
});
}
/**
* Get a rating
*
* Get the specific rating **ratingId** on node **nodeId**.
*
* @param nodeId The identifier of a node.
* @param ratingId The identifier of a rating.
* @param opts Optional parameters
* @returns Promise<RatingEntry>
*/
getRating(nodeId: string, ratingId: string, opts?: ContentFieldsQuery): Promise<RatingEntry> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(ratingId, 'ratingId');
const pathParams = {
nodeId,
ratingId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/nodes/{nodeId}/ratings/{ratingId}',
pathParams,
queryParams,
returnType: RatingEntry
});
}
/**
* List ratings
*
* Gets a list of ratings for node **nodeId**.
*
* @param nodeId The identifier of a node.
* @param opts Optional parameters
* @returns Promise<RatingPaging>
*/
listRatings(nodeId: string, opts?: ContentPagingQuery & ContentFieldsQuery): Promise<RatingPaging> {
throwIfNotDefined(nodeId, 'nodeId');
const pathParams = {
nodeId
};
const queryParams = {
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/nodes/{nodeId}/ratings',
pathParams,
queryParams,
returnType: RatingPaging
});
}
}

View File

@@ -0,0 +1,191 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { DirectAccessUrlEntry, RenditionBodyCreate, RenditionEntry, RenditionPaging } from '../model';
import { BaseApi } from './base.api';
import { throwIfNotDefined } from '../../../assert';
/**
* Renditions service.
*/
export class RenditionsApi extends BaseApi {
/**
* Create rendition
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* @param nodeId The identifier of a node.
* @param renditionBodyCreate The rendition \"id\".
* @returns Promise<{}>
*/
createRendition(nodeId: string, renditionBodyCreate: RenditionBodyCreate): Promise<any> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(renditionBodyCreate, 'renditionBodyCreate');
const pathParams = {
nodeId
};
return this.post({
path: '/nodes/{nodeId}/renditions',
pathParams,
bodyParam: renditionBodyCreate
});
}
/**
* Get rendition information
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* @param nodeId The identifier of a node.
* @param renditionId The name of a thumbnail rendition, for example *doclib*, or *pdf*.
* @returns Promise<RenditionEntry>
*/
getRendition(nodeId: string, renditionId: string): Promise<RenditionEntry> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(renditionId, 'renditionId');
const pathParams = {
nodeId,
renditionId
};
return this.get({
path: '/nodes/{nodeId}/renditions/{renditionId}',
pathParams,
returnType: RenditionEntry
});
}
/**
* Get rendition content
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* @param nodeId The identifier of a node.
* @param renditionId The name of a thumbnail rendition, for example *doclib*, or *pdf*.
* @param opts Optional parameters
* @param opts.attachment **true** enables a web browser to download the file as an attachment.
* **false** means a web browser may preview the file in a new tab or window, but not download the file.
* You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files.
* If the content type is not supported for preview, then a value of **false** is ignored, and
* the attachment will be returned in the response. (default to true)
* @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided.
* Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT.
* @param opts.range The Range header indicates the part of a document that the server should return.
* Single part request supported, for example: bytes=1-10.
* @param opts.placeholder If **true** and there is no rendition for this **nodeId** and **renditionId**,
* then the placeholder image for the mime type of this rendition is returned, rather than a 404 response. (default to false)
* @returns Promise<Blob>
*/
getRenditionContent(
nodeId: string,
renditionId: string,
opts?: {
attachment?: boolean;
placeholder?: boolean;
ifModifiedSince?: string;
range?: string;
}
): Promise<Blob> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(renditionId, 'renditionId');
const pathParams = {
nodeId,
renditionId
};
const queryParams = {
attachment: opts?.attachment,
placeholder: opts?.placeholder
};
const headerParams = {
'If-Modified-Since': opts?.ifModifiedSince,
Range: opts?.range
};
const accepts = ['application/octet-stream'];
return this.get({
path: '/nodes/{nodeId}/renditions/{renditionId}/content',
pathParams,
queryParams,
headerParams,
accepts,
returnType: 'blob'
});
}
/**
* List renditions
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* Gets a list of the rendition information for each rendition of the the file **nodeId**, including the rendition id.
* Each rendition returned has a **status**: CREATED means it is available to view or download, NOT_CREATED means the rendition can be requested.
* You can use the **where** parameter to filter the returned renditions by **status**. For example, the following **where**
* clause will return just the CREATED renditions:
* - (status='CREATED')
*
* @param nodeId The identifier of a node.
* @param opts Optional parameters
* @param opts.where A string to restrict the returned objects by using a predicate.
* @returns Promise<RenditionPaging>
*/
listRenditions(nodeId: string, opts?: { where?: string }): Promise<RenditionPaging> {
throwIfNotDefined(nodeId, 'nodeId');
const pathParams = {
nodeId
};
return this.get({
path: '/nodes/{nodeId}/renditions',
pathParams,
queryParams: opts,
returnType: RenditionPaging
});
}
/**
* Generate a direct access content url for a given rendition of a node
*
* **Note:** this endpoint is available in Alfresco 7.1 and newer versions.
*
* @param nodeId The identifier of a node.
* @param renditionId The identifier of a version
* @returns Promise<DirectAccessUrlEntry>
*/
requestDirectAccessUrl(nodeId: string, renditionId: string): Promise<DirectAccessUrlEntry> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(renditionId, 'renditionId');
const pathParams = {
nodeId,
renditionId
};
return this.post({
path: '/nodes/{nodeId}/renditions/{renditionId}/request-direct-access-url',
pathParams,
returnType: DirectAccessUrlEntry
});
}
}

View File

@@ -0,0 +1,336 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { RenditionEntry } from '../model/renditionEntry';
import { RenditionPaging } from '../model/renditionPaging';
import { SharedLinkBodyCreate } from '../model/sharedLinkBodyCreate';
import { SharedLinkBodyEmail } from '../model/sharedLinkBodyEmail';
import { SharedLinkEntry } from '../model/sharedLinkEntry';
import { SharedLinkPaging } from '../model/sharedLinkPaging';
import { BaseApi } from './base.api';
import { throwIfNotDefined } from '../../../assert';
import { buildCollectionParam } from '../../../alfrescoApiClient';
import { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types';
/**
* Sharedlinks service.
*/
export class SharedlinksApi extends BaseApi {
/**
* Create a shared link to a file
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* @param sharedLinkBodyCreate The nodeId to create a shared link for.
* @param opts Optional parameters
* @returns Promise<SharedLinkEntry>
*/
createSharedLink(sharedLinkBodyCreate: SharedLinkBodyCreate, opts?: ContentIncludeQuery & ContentFieldsQuery): Promise<SharedLinkEntry> {
throwIfNotDefined(sharedLinkBodyCreate, 'sharedLinkBodyCreate');
const queryParams = {
include: buildCollectionParam(opts?.include, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.post({
path: '/shared-links',
queryParams,
bodyParam: sharedLinkBodyCreate,
returnType: SharedLinkEntry
});
}
/**
* Deletes a shared link
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* @param sharedId The identifier of a shared link to a file.
* @returns Promise<{}>
*/
deleteSharedLink(sharedId: string): Promise<void> {
throwIfNotDefined(sharedId, 'sharedId');
const pathParams = {
sharedId
};
return this.delete({
path: '/shared-links/{sharedId}',
pathParams
});
}
/**
* Email shared link
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* @param sharedId The identifier of a shared link to a file.
* @param sharedLinkBodyEmail The shared link email to send.
* @returns Promise<{}>
*/
emailSharedLink(sharedId: string, sharedLinkBodyEmail: SharedLinkBodyEmail): Promise<any> {
throwIfNotDefined(sharedId, 'sharedId');
throwIfNotDefined(sharedLinkBodyEmail, 'sharedLinkBodyEmail');
const pathParams = {
sharedId
};
return this.post({
path: '/shared-links/{sharedId}/email',
pathParams,
bodyParam: sharedLinkBodyEmail
});
}
/**
* Get a shared link
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
* **Note:** No authentication is required to call this endpoint.
*
* @param sharedId The identifier of a shared link to a file.
* @param opts Optional parameters
* @returns Promise<SharedLinkEntry>
*/
getSharedLink(sharedId: string, opts?: ContentFieldsQuery): Promise<SharedLinkEntry> {
throwIfNotDefined(sharedId, 'sharedId');
const pathParams = {
sharedId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/shared-links/{sharedId}',
pathParams,
queryParams,
returnType: SharedLinkEntry
});
}
/**
* Get shared link content
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
* **Note:** No authentication is required to call this endpoint.
*
* @param sharedId The identifier of a shared link to a file.
* @param opts Optional parameters
* @param opts.attachment **true** enables a web browser to download the file as an attachment.
* **false** means a web browser may preview the file in a new tab or window, but not download the file.
* You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files.
* If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response.
* (default to true)
* @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided.
* Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT.
* @param opts.range The Range header indicates the part of a document that the server should return.
* Single part request supported, for example: bytes=1-10.
* @returns Promise<Blob>
*/
getSharedLinkContent(
sharedId: string,
opts?: {
attachment?: boolean;
ifModifiedSince?: string;
range?: string;
}
): Promise<Blob> {
throwIfNotDefined(sharedId, 'sharedId');
const pathParams = {
sharedId
};
const queryParams = {
attachment: opts?.attachment
};
const headerParams = {
'If-Modified-Since': opts?.ifModifiedSince,
Range: opts?.range
};
return this.get({
path: '/shared-links/{sharedId}/content',
pathParams,
queryParams,
headerParams,
accepts: ['application/octet-stream'],
returnType: 'blob'
});
}
/**
* Get shared link rendition information
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* This API method returns rendition information where the rendition status is CREATED,
* which means the rendition is available to view/download.
*
* **Note:** No authentication is required to call this endpoint.
*
* @param sharedId The identifier of a shared link to a file.
* @param renditionId The name of a thumbnail rendition, for example *doclib*, or *pdf*.
* @returns Promise<RenditionEntry>
*/
getSharedLinkRendition(sharedId: string, renditionId: string): Promise<RenditionEntry> {
throwIfNotDefined(sharedId, 'sharedId');
throwIfNotDefined(renditionId, 'renditionId');
const pathParams = {
sharedId,
renditionId
};
return this.get({
path: '/shared-links/{sharedId}/renditions/{renditionId}',
pathParams,
returnType: RenditionEntry
});
}
/**
* Get shared link rendition content
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
* **Note:** No authentication is required to call this endpoint.
*
* @param sharedId The identifier of a shared link to a file.
* @param renditionId The name of a thumbnail rendition, for example *doclib*, or *pdf*.
* @param opts Optional parameters
* @param opts.attachment **true** enables a web browser to download the file as an attachment.
* **false** means a web browser may preview the file in a new tab or window, but not download the file.
* You can only set this parameter to **false** if the content type of the file is in the supported list;
* for example, certain image files and PDF files.
* If the content type is not supported for preview, then a value of **false** is ignored, and
* the attachment will be returned in the response. (default to true)
* @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided.
* Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT.
* @param opts.range The Range header indicates the part of a document that the server should return.
* Single part request supported, for example: bytes=1-10.
* @returns Promise<Blob>
*/
getSharedLinkRenditionContent(
sharedId: string,
renditionId: string,
opts?: {
attachment?: boolean;
ifModifiedSince?: string;
range?: string;
}
): Promise<Blob> {
throwIfNotDefined(sharedId, 'sharedId');
throwIfNotDefined(renditionId, 'renditionId');
const pathParams = {
sharedId,
renditionId
};
const queryParams = {
attachment: opts?.attachment
};
const headerParams = {
'If-Modified-Since': opts?.ifModifiedSince,
Range: opts?.range
};
return this.get({
path: '/shared-links/{sharedId}/renditions/{renditionId}/content',
pathParams,
queryParams,
headerParams,
accepts: ['application/octet-stream'],
returnType: 'blob'
});
}
/**
* List renditions for a shared link
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* Gets a list of the rendition information for the file with shared link identifier **sharedId**.
* This API method returns rendition information, including the rendition id, for each rendition
* where the rendition status is CREATED, which means the rendition is available to view/download.
*
* **Note:** No authentication is required to call this endpoint.
*
* @param sharedId The identifier of a shared link to a file.
* @returns Promise<RenditionPaging>
*/
listSharedLinkRenditions(sharedId: string): Promise<RenditionPaging> {
throwIfNotDefined(sharedId, 'sharedId');
const pathParams = {
sharedId
};
return this.get({
path: '/shared-links/{sharedId}/renditions',
pathParams,
returnType: RenditionPaging
});
}
/**
* List shared links
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* Get a list of links that the current user has read permission on source node.
* The list is ordered in descending modified order.
*
* **Note:** The list of links is eventually consistent so newly created shared links may not appear immediately.
*
* @param opts Optional parameters
* @param opts.where Optionally filter the list by \"sharedByUser\" `userId` of person who shared the link (can also use -me-)
* where=(sharedByUser='jbloggs')
* where=(sharedByUser='-me-')
* @returns Promise<SharedLinkPaging>
*/
listSharedLinks(
opts?: {
where?: string;
} & ContentPagingQuery &
ContentIncludeQuery &
ContentFieldsQuery
): Promise<SharedLinkPaging> {
const queryParams = {
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
where: opts?.where,
include: buildCollectionParam(opts?.include, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/shared-links',
queryParams,
returnType: SharedLinkPaging
});
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,262 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { TagBody } from '../model/tagBody';
import { TagEntry } from '../model/tagEntry';
import { TagPaging } from '../model/tagPaging';
import { BaseApi } from './base.api';
import { throwIfNotDefined } from '../../../assert';
import { buildCollectionParam } from '../../../alfrescoApiClient';
import { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types';
/**
* Tags service.
*/
export class TagsApi extends BaseApi {
/**
* Create a tag for a node
*
* @param nodeId The identifier of a node.
* @param tagBodyCreate The new tag
* @param opts Optional parameters
* @returns Promise<TagEntry>
*/
createTagForNode(nodeId: string, tagBodyCreate: TagBody[], opts?: ContentFieldsQuery): Promise<TagEntry> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(tagBodyCreate, 'tagBodyCreate');
const pathParams = {
nodeId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.post({
path: '/nodes/{nodeId}/tags',
pathParams,
queryParams,
bodyParam: tagBodyCreate,
returnType: TagEntry
});
}
/**
* Delete a tag from a node
*
* @param nodeId The identifier of a node.
* @param tagId The identifier of a tag.
* @returns Promise<{}>
*/
deleteTagFromNode(nodeId: string, tagId: string): Promise<void> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(tagId, 'tagId');
const pathParams = {
nodeId,
tagId
};
return this.delete({
path: '/nodes/{nodeId}/tags/{tagId}',
pathParams
});
}
/**
* Get a tag
*
* @param tagId The identifier of a tag.
* @param opts Optional parameters
* @returns Promise<TagEntry>
*/
getTag(tagId: string, opts?: ContentFieldsQuery): Promise<TagEntry> {
throwIfNotDefined(tagId, 'tagId');
const pathParams = {
tagId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/tags/{tagId}',
pathParams,
queryParams,
returnType: TagEntry
});
}
/**
* List tags
*
* @param opts Optional parameters
* @param opts.tag Name or pattern for which tag is returned. Example of pattern: *test* which returns tags like 'my test 1'
* @param opts.matching Switches filtering to pattern mode instead of exact mode.
* @returns Promise<TagPaging>
*/
listTags(opts?: { tag?: string; matching?: boolean } & ContentPagingQuery & ContentIncludeQuery & ContentFieldsQuery): Promise<TagPaging> {
opts = opts || {};
const pathParams = {};
let where: string;
if (opts?.tag) {
where = opts.matching ? `(tag matches ('${opts.tag}'))` : `(tag='${opts.tag}')`;
}
const queryParams = {
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
fields: buildCollectionParam(opts?.fields, 'csv'),
include: buildCollectionParam(opts?.include, 'csv'),
where
};
return this.get({
path: '/tags',
pathParams,
queryParams,
returnType: TagPaging
});
}
/**
* List tags for a node
*
* @param nodeId The identifier of a node.
* @param opts Optional parameters
* @returns Promise<TagPaging>
*/
listTagsForNode(nodeId: string, opts?: ContentPagingQuery & ContentFieldsQuery): Promise<TagPaging> {
throwIfNotDefined(nodeId, 'nodeId');
const pathParams = {
nodeId
};
const queryParams = {
skipCount: opts?.skipCount,
maxItems: opts?.maxItems,
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.get({
path: '/nodes/{nodeId}/tags',
pathParams,
queryParams,
returnType: TagPaging
});
}
/**
* Update a tag
*
* @param tagId The identifier of a tag.
* @param tagBodyUpdate The updated tag
* @param opts Optional parameters
* @returns Promise<TagEntry>
*/
updateTag(tagId: string, tagBodyUpdate: TagBody, opts?: ContentFieldsQuery): Promise<TagEntry> {
throwIfNotDefined(tagId, 'tagId');
throwIfNotDefined(tagBodyUpdate, 'tagBodyUpdate');
const pathParams = {
tagId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.put({
path: '/tags/{tagId}',
pathParams,
queryParams,
bodyParam: tagBodyUpdate,
returnType: TagEntry
});
}
/**
* Deletes a tag by **tagId**. This will cause the tag to be removed from all nodes.
*
* @param tagId The identifier of a tag.
* @returns Promise<{}>
*/
deleteTag(tagId: string): Promise<void> {
throwIfNotDefined(tagId, 'tagId');
const pathParams = {
tagId
};
return this.delete({
path: '/tags/{tagId}',
pathParams
});
}
/**
* Create specified by **tags** list of tags.
*
* @param tags List of tags to create.
* @returns Promise<TagEntry[]>
*/
createTags(tags: TagBody[]): Promise<TagEntry[]> {
throwIfNotDefined(tags, 'tags');
return this.post({
path: '/tags',
bodyParam: tags
});
}
/**
* Assign tags to node. If tag is new then tag is also created additionally, if tag already exists then it is just assigned.
*
* @param nodeId Id of node to which tags should be assigned.
* @param tags List of tags to create and assign or just assign if they already exist.
* @returns Promise<TagPaging>
*/
assignTagsToNode(nodeId: string, tags: TagBody[]): Promise<TagPaging> {
return this.post({
path: '/nodes/{nodeId}/tags',
pathParams: { nodeId },
bodyParam: tags,
returnType: TagPaging
});
}
/**
* Assign tags to node. If tag is new then tag is also created additionally, if tag already exists then it is just assigned.
*
* @param nodeId Id of node to which tags should be assigned.
* @param tag List of tags to create and assign or just assign if they already exist.
* @returns Promise<TagEntry>
*/
assignTagToNode(nodeId: string, tag: TagBody): Promise<TagEntry> {
return this.post({
path: '/nodes/{nodeId}/tags',
pathParams: { nodeId },
bodyParam: tag,
returnType: TagEntry
});
}
}

View File

@@ -0,0 +1,381 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { DeletedNodeEntry } from '../model/deletedNodeEntry';
import { DeletedNodesPaging } from '../model/deletedNodesPaging';
import { DirectAccessUrlEntry } from '../model/directAccessUrlEntry';
import { NodeEntry } from '../model/nodeEntry';
import { RenditionEntry } from '../model/renditionEntry';
import { RenditionPaging } from '../model/renditionPaging';
import { BaseApi } from './base.api';
import { throwIfNotDefined } from '../../../assert';
import { buildCollectionParam } from '../../../alfrescoApiClient';
import { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types';
/**
* Trashcan service.
*
* @module TrashcanApi
*/
export class TrashcanApi extends BaseApi {
/**
* Permanently delete a deleted node
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* @param nodeId The identifier of a node.
* @returns Promise<{}>
*/
deleteDeletedNode(nodeId: string): Promise<void> {
throwIfNotDefined(nodeId, 'nodeId');
const pathParams = {
nodeId
};
return this.delete({
path: '/deleted-nodes/{nodeId}',
pathParams
});
}
/**
* Get rendition information for a deleted node
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* @param nodeId The identifier of a node.
* @param renditionId The name of a thumbnail rendition, for example *doclib*, or *pdf*.
* @returns Promise<RenditionEntry>
*/
getArchivedNodeRendition(nodeId: string, renditionId: string): Promise<RenditionEntry> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(renditionId, 'renditionId');
const pathParams = {
nodeId,
renditionId
};
return this.get({
path: '/deleted-nodes/{nodeId}/renditions/{renditionId}',
pathParams,
returnType: RenditionEntry
});
}
/**
* Get rendition content of a deleted node
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* @param nodeId The identifier of a node.
* @param renditionId The name of a thumbnail rendition, for example *doclib*, or *pdf*.
* @param opts Optional parameters
* @param opts.attachment **true** enables a web browser to download the file as an attachment.
* **false** means a web browser may preview the file in a new tab or window, but not download the file.
* You can only set this parameter to **false** if the content type of the file is in the supported list;
* for example, certain image files and PDF files.
* If the content type is not supported for preview, then a value of **false** is ignored, and
* the attachment will be returned in the response. (default to true)
* @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided.
* Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT.
* @param opts.range The Range header indicates the part of a document that the server should return.
* Single part request supported, for example: bytes=1-10.
* @param opts.placeholder If **true** and there is no rendition for this **nodeId** and **renditionId**,
* then the placeholder image for the mime type of this rendition is returned, rather than a 404 response. (default to false)
* @returns Promise<Blob>
*/
getArchivedNodeRenditionContent(
nodeId: string,
renditionId: string,
opts?: {
attachment?: boolean;
placeholder?: boolean;
ifModifiedSince?: string;
range?: string;
}
): Promise<Blob> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(renditionId, 'renditionId');
opts = opts || {};
const pathParams = {
nodeId,
renditionId
};
const queryParams = {
attachment: opts?.attachment,
placeholder: opts?.placeholder
};
const headerParams = {
'If-Modified-Since': opts?.ifModifiedSince,
Range: opts?.range
};
return this.get({
path: '/deleted-nodes/{nodeId}/renditions/{renditionId}/content',
pathParams,
queryParams,
headerParams,
accepts: ['application/octet-stream']
});
}
/**
* Get a deleted node
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* @param nodeId The identifier of a node.
* @param opts Optional parameters
* @returns Promise<DeletedNodeEntry>
*/
getDeletedNode(nodeId: string, opts?: ContentIncludeQuery): Promise<DeletedNodeEntry> {
throwIfNotDefined(nodeId, 'nodeId');
const pathParams = {
nodeId
};
const queryParams = {
include: buildCollectionParam(opts?.include, 'csv')
};
return this.get({
path: '/deleted-nodes/{nodeId}',
pathParams,
queryParams,
returnType: DeletedNodeEntry
});
}
/**
* Get deleted node content
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* @param nodeId The identifier of a node.
* @param opts Optional parameters
* @param opts.attachment **true** enables a web browser to download the file as an attachment.
* **false** means a web browser may preview the file in a new tab or window, but not download the file.
* You can only set this parameter to **false** if the content type of the file is in the supported list;
* for example, certain image files and PDF files.
* If the content type is not supported for preview, then a value of **false** is ignored, and
* the attachment will be returned in the response. (default to true)
* @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided.
* Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT.
* @param opts.range The Range header indicates the part of a document that the server should return.
* Single part request supported, for example: bytes=1-10.
* @returns Promise<Blob>
*/
getDeletedNodeContent(
nodeId: string,
opts?: {
attachment?: boolean;
ifModifiedSince?: string;
range?: string;
}
): Promise<Blob> {
throwIfNotDefined(nodeId, 'nodeId');
const pathParams = {
nodeId
};
const queryParams = {
attachment: opts?.attachment
};
const headerParams = {
'If-Modified-Since': opts?.ifModifiedSince,
Range: opts?.range
};
const accepts = ['application/octet-stream'];
return this.get({
path: '/deleted-nodes/{nodeId}/content',
pathParams,
queryParams,
headerParams,
accepts,
returnType: 'blob'
});
}
/**
* List renditions for a deleted node
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* Each rendition returned has a **status**: `CREATED` means it is available to view or download,
* `NOT_CREATED` means the rendition can be requested.
*
* You can use the **where** parameter to filter the returned renditions by **status**. For example, the following **where**
* clause will return just the CREATED renditions:
*
* - (status='CREATED')
*
* @param nodeId The identifier of a node.
* @param opts Optional parameters
* @param opts.where A string to restrict the returned objects by using a predicate.
* @returns Promise<RenditionPaging>
*/
listDeletedNodeRenditions(nodeId: string, opts?: { where?: string }): Promise<RenditionPaging> {
throwIfNotDefined(nodeId, 'nodeId');
const pathParams = {
nodeId
};
const queryParams = {
where: opts?.where
};
return this.get({
path: '/deleted-nodes/{nodeId}/renditions',
pathParams,
queryParams,
returnType: RenditionPaging
});
}
/**
* List deleted nodes
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* Gets a list of deleted nodes for the current user.
* If the current user is an administrator deleted nodes for all users will be returned.
* The list of deleted nodes will be ordered with the most recently deleted node at the top of the list.
*
* @param opts Optional parameters
* @returns Promise<DeletedNodesPaging>
*/
listDeletedNodes(opts?: ContentPagingQuery & ContentIncludeQuery): Promise<DeletedNodesPaging> {
const queryParams = {
...(opts || {}),
include: buildCollectionParam(opts?.include, 'csv')
};
return this.get({
path: '/deleted-nodes',
queryParams,
returnType: DeletedNodesPaging
});
}
/**
* Restore a deleted node
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* Attempts to restore the deleted node **nodeId** to its original location or to a new location.
*
* If the node is successfully restored to its former primary parent, then only the
* primary child association will be restored, including recursively for any primary
* children. It should be noted that no other secondary child associations or peer
* associations will be restored, for any of the nodes within the primary parent-child
* hierarchy of restored nodes, irrespective of whether these associations were to
* nodes within or outside the restored hierarchy.
*
* Also, any previously shared link will not be restored since it is deleted at the time
* of delete of each node.
*
* @param nodeId The identifier of a node.
* @param opts Optional parameters
* @param opts.deletedNodeBodyRestore The targetParentId if the node is restored to a new location.
* @returns Promise<NodeEntry>
*/
restoreDeletedNode(
nodeId: string,
opts?: {
deletedNodeBodyRestore?: {
targetParentId?: string;
assocType?: string;
};
} & ContentFieldsQuery
): Promise<NodeEntry> {
throwIfNotDefined(nodeId, 'nodeId');
const pathParams = {
nodeId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.post({
path: '/deleted-nodes/{nodeId}/restore',
pathParams,
queryParams,
bodyParam: opts?.deletedNodeBodyRestore,
returnType: NodeEntry
});
}
/**
* Generate a direct access content url for a given deleted node
*
* **Note:** this endpoint is available in Alfresco 7.1 and newer versions.
*
* @param nodeId The identifier of a node.
* @returns Promise<DirectAccessUrlEntry>
*/
requestDirectAccessUrl(nodeId: string): Promise<DirectAccessUrlEntry> {
throwIfNotDefined(nodeId, 'nodeId');
const pathParams = {
nodeId
};
return this.post({
path: '/deleted-nodes/{nodeId}/request-direct-access-url',
pathParams,
returnType: DirectAccessUrlEntry
});
}
/**
* Generate a direct access content url for a given rendition of a deleted node
*
* **Note:** this endpoint is available in Alfresco 7.1 and newer versions.
*
* @param nodeId The identifier of a node.
* @param renditionId The identifier of a version
* @returns Promise<DirectAccessUrlEntry>
*/
requestRenditionDirectAccessUrl(nodeId: string, renditionId: string): Promise<DirectAccessUrlEntry> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(renditionId, 'renditionId');
const pathParams = {
nodeId,
renditionId
};
return this.post({
path: '/deleted-nodes/{nodeId}/renditions/{renditionId}/request-direct-access-url',
pathParams,
returnType: DirectAccessUrlEntry
});
}
}

View File

@@ -0,0 +1,52 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export type ContentPagingQuery = {
/**
* The number of entities that exist in the collection before those included in this list.
*/
skipCount?: number;
/**
* The maximum number of items to return in the list.
*/
maxItems?: number;
};
export type ContentIncludeQuery = {
/**
* Returns additional information about the record. Any optional field from the response model can be requested.
*/
include?: string[];
};
export type ContentFieldsQuery = {
/**
* A list of field names.
*
* You can use this parameter to restrict the fields
* returned within a response if, for example, you want to save on overall bandwidth.
*
* The list applies to a returned individual
* entity or entries within a collection.
*
* If the API method also supports the **include**
* parameter, then the fields specified in the **include**
* parameter are returned in addition to those specified in the **fields** parameter.
*/
fields?: string[];
};

View File

@@ -0,0 +1,406 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { DirectAccessUrlEntry, RenditionBodyCreate, RenditionEntry, RenditionPaging, RevertBody, VersionEntry, VersionPaging } from '../model';
import { BaseApi } from './base.api';
import { throwIfNotDefined } from '../../../assert';
import { buildCollectionParam } from '../../../alfrescoApiClient';
import { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types';
/**
* Versions service.
*
* @module VersionsApi
*/
export class VersionsApi extends BaseApi {
/**
* Create rendition for a file version
*
* **Note:** this endpoint is available in Alfresco 7.0.0 and newer versions.
*
* @param nodeId The identifier of a node.
* @param versionId The identifier of a version, ie. version label, within the version history of a node.
* @param renditionBodyCreate The rendition \"id\".
* @returns Promise<{}>
*/
createVersionRendition(nodeId: string, versionId: string, renditionBodyCreate: RenditionBodyCreate): Promise<any> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(versionId, 'versionId');
throwIfNotDefined(renditionBodyCreate, 'renditionBodyCreate');
const pathParams = {
nodeId,
versionId
};
return this.post({
path: '/nodes/{nodeId}/versions/{versionId}/renditions',
pathParams,
bodyParam: renditionBodyCreate
});
}
/**
* Delete a version
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* Delete the version identified by **versionId** and **nodeId*.
*
* If the version is successfully deleted then the content and metadata for that versioned node
* will be deleted and will no longer appear in the version history. This operation cannot be undone.
*
* If the most recent version is deleted the live node will revert to the next most recent version.
*
* We currently do not allow the last version to be deleted. If you wish to clear the history then you
* can remove the \"cm:versionable\" aspect (via update node) which will also disable versioning. In this
* case, you can re-enable versioning by adding back the \"cm:versionable\" aspect or using the version
* params (majorVersion and comment) on a subsequent file content update.
*
* @param nodeId The identifier of a node.
* @param versionId The identifier of a version, ie. version label, within the version history of a node.
* @returns Promise<{}>
*/
deleteVersion(nodeId: string, versionId: string): Promise<void> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(versionId, 'versionId');
const pathParams = {
nodeId,
versionId
};
return this.delete({
path: '/nodes/{nodeId}/versions/{versionId}',
pathParams
});
}
/**
* Get version information
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* @param nodeId The identifier of a node.
* @param versionId The identifier of a version, ie. version label, within the version history of a node.
* @returns Promise<VersionEntry>
*/
getVersion(nodeId: string, versionId: string): Promise<VersionEntry> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(versionId, 'versionId');
const pathParams = {
nodeId,
versionId
};
return this.get({
path: '/nodes/{nodeId}/versions/{versionId}',
pathParams,
returnType: VersionEntry
});
}
/**
* Get version content
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* @param nodeId The identifier of a node.
* @param versionId The identifier of a version, ie. version label, within the version history of a node.
* @param opts Optional parameters
* @param opts.attachment **true** enables a web browser to download the file as an attachment.
* **false** means a web browser may preview the file in a new tab or window, but not download the file.
* You can only set this parameter to **false** if the content type of the file is in the supported list;
* for example, certain image files and PDF files.
* If the content type is not supported for preview, then a value of **false** is ignored, and
* the attachment will be returned in the response.
* (default to true)
* @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided.
* Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT.
* @param opts.range The Range header indicates the part of a document that the server should return.
* Single part request supported, for example: bytes=1-10.
* @returns Promise<Blob>
*/
getVersionContent(
nodeId: string,
versionId: string,
opts?: {
attachment?: boolean;
ifModifiedSince?: string;
range?: string;
}
): Promise<Blob> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(versionId, 'versionId');
const pathParams = {
nodeId,
versionId
};
const queryParams = {
attachment: opts?.attachment
};
const headerParams = {
'If-Modified-Since': opts?.ifModifiedSince,
Range: opts?.range
};
const accepts = ['application/octet-stream'];
return this.get({
path: '/nodes/{nodeId}/versions/{versionId}/content',
pathParams,
queryParams,
headerParams,
accepts,
returnType: 'blob'
});
}
/**
* Get rendition information for a file version
*
* **Note:** this endpoint is available in Alfresco 7.0.0 and newer versions.
*
* @param nodeId The identifier of a node.
* @param versionId The identifier of a version, ie. version label, within the version history of a node.
* @param renditionId The name of a thumbnail rendition, for example *doclib*, or *pdf*.
* @returns Promise<RenditionEntry>
*/
getVersionRendition(nodeId: string, versionId: string, renditionId: string): Promise<RenditionEntry> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(versionId, 'versionId');
throwIfNotDefined(renditionId, 'renditionId');
const pathParams = {
nodeId,
versionId,
renditionId
};
return this.get({
path: '/nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}',
pathParams,
returnType: RenditionEntry
});
}
/**
* Get rendition content for a file version
*
* **Note:** this endpoint is available in Alfresco 7.0.0 and newer versions.
*
* @param nodeId The identifier of a node.
* @param versionId The identifier of a version, ie. version label, within the version history of a node.
* @param renditionId The name of a thumbnail rendition, for example *doclib*, or *pdf*.
* @param opts Optional parameters
* @param opts.attachment **true** enables a web browser to download the file as an attachment.
* **false** means a web browser may preview the file in a new tab or window, but not
* download the file.
* You can only set this parameter to **false** if the content type of the file is in the supported list;
* for example, certain image files and PDF files.
* If the content type is not supported for preview, then a value of **false** is ignored, and
* the attachment will be returned in the response.
* (default to true)
* @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided.
* Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT.
* @param opts.range The Range header indicates the part of a document that the server should return.
* Single part request supported, for example: bytes=1-10.
* @param opts.placeholder If **true** and there is no rendition for this **nodeId** and **renditionId**,
* then the placeholder image for the mime type of this rendition is returned, rather than a 404 response.
* (default to false)
* @returns Promise<Blob>
*/
getVersionRenditionContent(
nodeId: string,
versionId: string,
renditionId: string,
opts?: {
attachment?: boolean;
placeholder?: boolean;
ifModifiedSince?: string;
range?: string;
}
): Promise<Blob> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(versionId, 'versionId');
throwIfNotDefined(renditionId, 'renditionId');
opts = opts || {};
const pathParams = {
nodeId,
versionId,
renditionId
};
const queryParams = {
attachment: opts?.attachment,
placeholder: opts?.placeholder
};
const headerParams = {
'If-Modified-Since': opts?.ifModifiedSince,
Range: opts?.range
};
const accepts = ['application/octet-stream'];
return this.get({
path: '/nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}/content',
pathParams,
queryParams,
headerParams,
accepts,
returnType: 'blob'
});
}
/**
* List version history
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* Gets the version history as an ordered list of versions for the specified **nodeId**.
*
* The list is ordered in descending modified order. So the most recent version is first and
* the original version is last in the list.
*
* @param nodeId The identifier of a node.
* @param opts Optional parameters
* @returns Promise<VersionPaging>
*/
listVersionHistory(nodeId: string, opts?: ContentPagingQuery & ContentIncludeQuery & ContentFieldsQuery): Promise<VersionPaging> {
throwIfNotDefined(nodeId, 'nodeId');
const pathParams = {
nodeId
};
const queryParams = {
include: buildCollectionParam(opts?.include, 'csv'),
fields: buildCollectionParam(opts?.fields, 'csv'),
skipCount: opts?.skipCount,
maxItems: opts?.maxItems
};
return this.get({
path: '/nodes/{nodeId}/versions',
pathParams,
queryParams,
returnType: VersionPaging
});
}
/**
* List renditions for a file version
*
* **Note:** this endpoint is available in Alfresco 7.0.0 and newer versions.
*
* Gets a list of the rendition information for each rendition of the version of file **nodeId** and **versionId**, including the rendition id.
* Each rendition returned has a **status**: CREATED means it is available to view or download, NOT_CREATED means the rendition can be requested.
* You can use the **where** parameter to filter the returned renditions by **status**. For example, the following **where**
* clause will return just the CREATED renditions: (status='CREATED')
*
* @param nodeId The identifier of a node.
* @param versionId The identifier of a version, ie. version label, within the version history of a node.
* @param opts Optional parameters
* @param opts.where A string to restrict the returned objects by using a predicate.
* @returns Promise<RenditionPaging>
*/
listVersionRenditions(nodeId: string, versionId: string, opts?: { where?: string }): Promise<RenditionPaging> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(versionId, 'versionId');
const pathParams = {
nodeId,
versionId
};
return this.get({
path: '/nodes/{nodeId}/versions/{versionId}/renditions',
pathParams,
queryParams: opts,
returnType: RenditionPaging
});
}
/**
* Revert a version
*
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
*
* Attempts to revert the version identified by **versionId** and **nodeId** to the live node.
* If the node is successfully reverted then the content and metadata for that versioned node
* will be promoted to the live node and a new version will appear in the version history.
*
* @param nodeId The identifier of a node.
* @param versionId The identifier of a version, ie. version label, within the version history of a node.
* @param revertBody Optionally, specify a version comment and whether this should be a major version, or not.
* @param opts Optional parameters
* @returns Promise<VersionEntry>
*/
revertVersion(nodeId: string, versionId: string, revertBody: RevertBody, opts?: ContentFieldsQuery): Promise<VersionEntry> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(versionId, 'versionId');
throwIfNotDefined(revertBody, 'revertBody');
const pathParams = {
nodeId,
versionId
};
const queryParams = {
fields: buildCollectionParam(opts?.fields, 'csv')
};
return this.post({
path: '/nodes/{nodeId}/versions/{versionId}/revert',
pathParams,
queryParams,
bodyParam: revertBody,
returnType: VersionEntry
});
}
/**
* Generate a direct access content url for a given version of a node
*
* **Note:** this endpoint is available in Alfresco 7.1 and newer versions.
*
* @param nodeId The identifier of a node.
* @param versionId The identifier of a version
* @returns Promise<DirectAccessUrlEntry>
*/
requestDirectAccessUrl(nodeId: string, versionId: string): Promise<DirectAccessUrlEntry> {
throwIfNotDefined(nodeId, 'nodeId');
throwIfNotDefined(versionId, 'versionId');
const pathParams = {
nodeId,
versionId
};
return this.post({
path: '/nodes/{nodeId}/versions/{versionId}/request-direct-access-url',
pathParams,
returnType: DirectAccessUrlEntry
});
}
}

View File

@@ -0,0 +1,272 @@
# ActionsApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|---------------------------------|--------------------------------------------------|----------------------------------------------|
| [actionDetails](#actionDetails) | **GET** /action-definitions/{actionDefinitionId} | Retrieve the details of an action definition |
| [actionExec](#actionExec) | **POST** /action-executions | Execute an action |
| [listActions](#listActions) | **GET** /action-definitions | Retrieve list of available actions |
| [nodeActions](#nodeActions) | **GET** /nodes/{nodeId}/action-definitions | Retrieve actions for a node |
## actionDetails
Retrieve the details of an action definition
> this endpoint is available in **Alfresco 5.2** and newer versions.
**Parameters**
| Name | Type | Description |
|------------------------|--------|-----------------------------------------|
| **actionDefinitionId** | string | The identifier of an action definition. |
**Return type**: [ActionDefinitionEntry](#ActionDefinitionEntry)
**Example**
```javascript
import { AlfrescoApi, ActionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const actionsApi = new ActionsApi(alfrescoApi);
actionsApi.actionDetails(`<actionDefinitionId>`).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## actionExec
Execute an action
> this endpoint is available in **Alfresco 5.2** and newer versions.
Executes an action
An action may be executed against a node specified by **targetId**. For example:
```json
{
"actionDefinitionId": "copy",
"targetId": "4c4b3c43-f18b-43ff-af84-751f16f1ddfd",
"params": {
"destination-folder": "34219f79-66fa-4ebf-b371-118598af898c"
}
}
```
Performing a POST with the request body shown above will result in the node identified by targetId
being copied to the destination folder specified in the params object by the key destination-folder.
**targetId** is optional, however, currently **targetId** must be a valid node ID.
In the future, actions may be executed against different entity types or
executed without the need for the context of an entity.
Parameters supplied to the action within the params object will be converted to the expected type,
where possible using the DefaultTypeConverter class. In addition:
* Node IDs may be supplied in their short form (implicit `workspace://SpacesStore` prefix)
* Aspect names may be supplied using their short form, e.g. `cm:versionable` or `cm:auditable`
In this example, we add the aspect `cm:versionable` to a node using the QName resolution mentioned above:
```json
{
"actionDefinitionId": "add-features",
"targetId": "16349e3f-2977-44d1-93f2-73c12b8083b5",
"params": {
"aspect-name": "cm:versionable"
}
}
```
The actionDefinitionId is the id of an action definition as returned by
the _list actions_ operations (e.g. `GET /action-definitions`).
The action will be executed **asynchronously** with a 202 HTTP response signifying that
the request has been accepted successfully. The response body contains the unique ID of the action
pending execution. The ID may be used, for example to correlate an execution with output in the server logs.
**Parameters**
| Name | Type | Description |
|----------------|-----------------------------------|--------------------------|
| actionBodyExec | [ActionBodyExec](#ActionBodyExec) | Action execution details |
**Return type**: [ActionExecResultEntry](#ActionExecResultEntry)
**Example**
```javascript
import { AlfrescoApi, ActionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const actionsApi = new ActionsApi(alfrescoApi);
const actionBodyExec = {};
actionsApi.actionExec(actionBodyExec).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listActions
Retrieve list of available actions
> this endpoint is available in **Alfresco 5.2.2** and newer versions.
The default sort order for the returned list is for actions to be sorted by ascending name.
You can override the default by using the **orderBy** parameter.
You can use any of the following fields to order the results:
* name
* title
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [ActionDefinitionList](#ActionDefinitionList)
**Example**
```javascript
import { AlfrescoApi, ActionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const actionsApi = new ActionsApi(alfrescoApi);
const opts = {};
actionsApi.listActions(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## nodeActions
Retrieve actions for a node
> this endpoint is available in Alfresco 5.2 and newer versions.
The default sort order for the returned list is for actions to be sorted by ascending name.
You can override the default by using the **orderBy** parameter.
You can use any of the following fields to order the results:
* name
* title
**Parameters**
| Name | Type | Description | Notes |
|----------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| **nodeId** | string | The identifier of a node. |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | |
| opts.fields | string [] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [ActionDefinitionList](#ActionDefinitionList)
**Example**
```javascript
import { AlfrescoApi, ActionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const actionsApi = new ActionsApi(alfrescoApi);
const opts = {};
actionsApi.nodeActions(`<nodeId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## ActionBodyExec
**Properties**
| Name | Type | Description |
|------------------------|--------|------------------------------------------------------------------------------|
| **actionDefinitionId** | string | |
| targetId | string | The entity upon which to execute the action, typically a node ID or similar. |
| params | any | |
## ActionDefinitionEntry
**Properties**
| Name | Type |
|-----------|---------------------------------------|
| **entry** | [ActionDefinition](#ActionDefinition) |
## ActionDefinition
**Properties**
| Name | Type | Description |
|----------------------|-----------------------------------------------------------|-------------------------------------------------------------------------------------------|
| **id** | string | Identifier of the action definition — used for example when executing an action |
| name | string | name of the action definition, e.g. "move" |
| title | string | title of the action definition, e.g. "Move" |
| description | string | describes the action definition, e.g. "This will move the matched item to another space." |
| **applicableTypes** | string[] | QNames of the types this action applies to |
| **trackStatus** | boolean | whether the basic action definition supports action tracking or not |
| parameterDefinitions | [ActionParameterDefinition[]](#ActionParameterDefinition) | |
## ActionParameterDefinition
**Properties**
| Name | Type |
|--------------|---------|
| name | string |
| type | string |
| multiValued | boolean |
| mandatory | boolean |
| displayLabel | string |
## ActionExecResultEntry
**Properties**
| Name | Type |
|-----------|---------------------------------------|
| **entry** | [ActionExecResult](#ActionExecResult) |
## ActionExecResult
**Properties**
| Name | Type | Description |
|--------|--------|-------------------------------------------------------|
| **id** | string | The unique identifier of the action pending execution |
## ActionDefinitionList
**Properties**
| Name | Type |
|------|-------------------------------------------------------|
| list | [ActionDefinitionListList](#ActionDefinitionListList) |
## ActionDefinitionListList
**Properties**
| Name | Type |
|------------|-----------------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [ActionDefinition[]](#ActionDefinition) |

View File

@@ -0,0 +1,86 @@
# Activities Api
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-----------------------------------------------------|---------------------------------------|-----------------|
| [listActivitiesForPerson](#listActivitiesForPerson) | **GET** /people/{personId}/activities | List activities |
## listActivitiesForPerson
List activities
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------|
| **personId** | string | The identifier of a person. | |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | [default to 0] |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | [default to 100] |
| opts.who | string | A filter to include the user's activities only me, other user's activities only others' | |
| opts.siteId | string | Include only activity feed entries relating to this site. | |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [ActivityPaging](#ActivityPaging)
**Example**x
```javascript
import { AlfrescoApi, ActivitiesApi} from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*...*/);
const activitiesApi = new ActivitiesApi(alfrescoApi);
const personId = '<personId>';
const opts = {};
activitiesApi.listActivitiesForPerson(personId, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## ActivityPaging
**Properties**
| Name | Type |
|------|-------------------------------------------|
| list | [ActivityPagingList](#ActivityPagingList) |
## ActivityPagingList
**Properties**
| Name | Type |
|------------|-----------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [ActivityEntry[]](#ActivityEntry) |
## ActivityEntry
**Properties**
| Name | Type |
|-------|-----------------------|
| entry | [Activity](#Activity) |
## Activity
**Properties**
| Name | Type | Description |
|------------------|---------------------|---------------------------------------------------------------|
| **postPersonId** | string | The id of the person who performed the activity |
| **id** | number | The unique id of the activity |
| siteId | string | The unique id of the site on which the activity was performed |
| postedAt | Date | The date time at which the activity was performed |
| **feedPersonId** | string | The feed on which this activity was posted |
| activitySummary | Map<string, string> | An object summarizing the activity |
| **activityType** | string | The type of the activity posted |

View File

@@ -0,0 +1,9 @@
# Association
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**targetId** | **string** | | [default to null]
**assocType** | **string** | | [default to null]

View File

@@ -0,0 +1,8 @@
# AssociationEntry
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**entry** | [**Association**](Association.md) | | [default to null]

View File

@@ -0,0 +1,8 @@
# AssociationInfo
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**assocType** | **string** | | [default to null]

View File

@@ -0,0 +1,427 @@
**# AuditApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-----------------------------------------------------------------|----------------------------------------------------------------------------------|-----------------------------------------------------------|
| [deleteAuditEntriesForAuditApp](#deleteAuditEntriesForAuditApp) | **DELETE** /audit-applications/{auditApplicationId}/audit-entries | Permanently delete audit entries for an audit application |
| [deleteAuditEntry](#deleteAuditEntry) | **DELETE** /audit-applications/{auditApplicationId}/audit-entries/{auditEntryId} | Permanently delete an audit entry |
| [getAuditApp](#getAuditApp) | **GET** /audit-applications/{auditApplicationId} | Get audit application info |
| [getAuditEntry](#getAuditEntry) | **GET** /audit-applications/{auditApplicationId}/audit-entries/{auditEntryId} | Get audit entry |
| [listAuditApps](#listAuditApps) | **GET** /audit-applications | List audit applications |
| [listAuditEntriesForAuditApp](#listAuditEntriesForAuditApp) | **GET** /audit-applications/{auditApplicationId}/audit-entries | List audit entries for an audit application |
| [listAuditEntriesForNode](#listAuditEntriesForNode) | **GET** /nodes/{nodeId}/audit-entries | List audit entries for a node |
| [updateAuditApp](#updateAuditApp) | **PUT** /audit-applications/{auditApplicationId} | Update audit application info |
## deleteAuditEntriesForAuditApp
Permanently delete audit entries for an audit application
> this endpoint is available in **Alfresco 5.2.2** and newer versions.
The **where** clause must be specified, either with an inclusive time period or for
an inclusive range of ids. The deletion is within the context of the given audit application.
For example:
- `where=(createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00', '2017-06-04T10:05:16.536+01:00')`
- `where=(id BETWEEN ('1234', '4321')`
You must have admin rights to delete audit information.
**Parameters**
| Name | Type | Description |
|------------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **auditApplicationId** | string | The identifier of an audit application. |
| **where** | string | Audit entries to permanently delete for an audit application, given an inclusive time period or range of ids. For example: `where=(createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00')`, `where=(id BETWEEN ('1234', '4321')` |
**Example**
```javascript
import { AlfrescoApi, AuditApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*...*/);
const auditApi = new AuditApi(alfrescoApi);
auditApi.deleteAuditEntriesForAuditApp('<auditApplicationId>', '<where>').then(() => {
console.log('API called successfully.');
});
```
## deleteAuditEntry
Permanently delete an audit entry
> this endpoint is available in **Alfresco 5.2.2** and newer versions.
> You must have admin rights to delete audit information.
**Parameters**
| Name | Type | Description |
|------------------------|--------|-----------------------------------------|
| **auditApplicationId** | string | The identifier of an audit application. |
| **auditEntryId** | string | The identifier of an audit entry. |
**Example**
```javascript
import { AlfrescoApi, AuditApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*...*/);
const auditApi = new AuditApi(alfrescoApi);
auditApi.deleteAuditEntry('<auditApplicationId>', '<auditEntryId>').then(() => {
console.log('API called successfully.');
});
```
## getAuditApp
Get audit application info
> **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.
> You must have admin rights to retrieve audit information.
You can use the **include** parameter to return the minimum and/or maximum audit record id for the application.
**Parameters**
| Name | Type | Description |
|------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **auditApplicationId** | string | The identifier of an audit application. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
| opts.include | string[] | Also include the current minimum and/or maximum audit entry ids for the application. The following optional fields can be requested: `max`, `min` |
**Return type**: [AuditApp](#AuditApp)
**Example**
```javascript
import { AlfrescoApi, AuditApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*...*/);
const auditApi = new AuditApi(alfrescoApi);
const opts = {};
auditApi.getAuditApp(`<auditApplicationId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getAuditEntry
Get audit entry
> this endpoint is available in **Alfresco 5.2.2** and newer versions.
> You must have admin rights to access audit information.
**Parameters**
| Name | Type | Description |
|------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **auditApplicationId** | string | The identifier of an audit application. |
| **auditEntryId** | string | The identifier of an audit entry. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [AuditEntryEntry](#AuditEntryEntry)
**Example**
```javascript
import { AlfrescoApi, AuditApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*...*/);
const auditApi = new AuditApi(alfrescoApi);
const opts = {};
auditApi.getAuditEntry('<auditApplicationId>', '<auditEntryId>', opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listAuditApps
List audit applications
> this endpoint is available in **Alfresco 5.2.2** and newer versions.
> You must have admin rights to retrieve audit information.
Gets a list of audit applications in this repository.
This list may include pre-configured audit applications, if enabled, such as:
* alfresco-access
* CMISChangeLog
* Alfresco Tagging Service
* Alfresco Sync Service (used by Enterprise Cloud Sync)
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------|
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. | If not supplied then the default value is 0. default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [AuditAppPaging](#AuditAppPaging)
**Example**
```javascript
import { AlfrescoApi, AuditApi} from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*...*/);
const auditApi = new AuditApi(alfrescoApi);
const opts = {};
auditApi.listAuditApps(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listAuditEntriesForAuditApp
List audit entries for an audit application
> this endpoint is available in **Alfresco 5.2.2** and newer versions.
> You must have admin rights to retrieve audit information.
You can use the **include** parameter to return additional **values** information.
The list can be filtered by one or more of:
* **createdByUser** person id
* **createdAt** inclusive time period
* **id** inclusive range of ids
* **valuesKey** audit entry values contains the exact matching key
* **valuesValue** audit entry values contains the exact matching value
The default sort order is **createdAt** ascending, but you can use an optional **ASC** or **DESC**
modifier to specify an ascending or descending sort order.
For example, specifying `orderBy=createdAt DESC` returns audit entries in descending **createdAt** order.
**Example**
```javascript
import { AlfrescoApi, AuditApi} from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*...*/);
const auditApi = new AuditApi(alfrescoApi);
const opts = {};
auditApi.listAuditEntriesForAuditApp(`<auditApplicationId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
**Parameters**
| Name | Type | Description | Notes |
|------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| **auditApplicationId** | string | The identifier of an audit application. |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.orderBy | string | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.where | string | Optionally filter the list. | |
| opts.include | string | Returns additional information about the audit entry. The following optional fields can be requested: `values` | |
| opts.fields | string | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**where** examples:
* `where=(createdByUser='jbloggs')`
* `where=(id BETWEEN ('1234', '4321')`
* `where=(createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00', '2017-06-04T10:05:16.536+01:00')`
* `where=(createdByUser='jbloggs' and createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00', '2017-06-04T10:05:16.536+01:00')`
* `where=(valuesKey='/alfresco-access/login/user')`
* `where=(valuesKey='/alfresco-access/transaction/action' and valuesValue='DELETE')`
**Return type**: [AuditEntryPaging](#AuditEntryPaging)
## listAuditEntriesForNode
List audit entries for a node
> this endpoint is available in Alfresco 5.2.2 and newer versions.
Gets a list of audit entries for node **nodeId**.
The list can be filtered by **createdByUser** and for a given inclusive time period.
The default sort order is **createdAt** ascending, but you can use an optional **ASC** or **DESC**
modifier to specify an ascending or descending sort order.
For example, specifying `orderBy=createdAt DESC` returns audit entries in descending **createdAt** order.
This relies on the pre-configured 'alfresco-access' audit application.
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| **nodeId** | string | The identifier of a node. | |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.where | string | Optionally filter the list. | |
| opts.include | string[] | Returns additional information about the audit entry. The following optional fields can be requested: `values` | |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**where* examples:
- `where=(createdByUser='-me-')`
- `where=(createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00')`
- `where=(createdByUser='jbloggs' and createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00')`
**Return type**: [AuditEntryPaging](#AuditEntryPaging)
**Example**
```javascript
import { AlfrescoApi, AuditApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*...*/);
const auditApi = new AuditApi(alfrescoApi);
const opts = {};
auditApi.listAuditEntriesForNode(`<nodeId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## updateAuditApp
Update audit application info
> this endpoint is available in **Alfresco 5.2.2** and newer versions.
> You must have admin rights to update audit application.
Disable or re-enable the audit application **auditApplicationId**.
New audit entries will not be created for a disabled audit application until
it is re-enabled (and system-wide auditing is also enabled).
> it is still possible to query &/or delete any existing audit entries even
if auditing is disabled for the audit application.
**Parameters**
| Name | Type | Description |
|------------------------|-------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **auditApplicationId** | string | The identifier of an audit application. |
| **auditAppBodyUpdate** | [AuditBodyUpdate](#AuditBodyUpdate) | The audit application to update. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [AuditApp](#AuditApp)
**Example**
```javascript
import { AlfrescoApi, AuditApi} from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*...*/);
const auditApi = new AuditApi(alfrescoApi);
const auditAppBodyUpdate = {};
const opts = {};
auditApi.updateAuditApp(`<auditApplicationId>`, auditAppBodyUpdate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## AuditApp
**Properties**
| Name | Type |
|------------|---------|
| **id** | string |
| name | string |
| isEnabled | boolean |
| maxEntryId | number |
| minEntryId | number |
## AuditAppPaging
**Properties**
| Name | Type |
|------|-------------------------------------------|
| list | [AuditAppPagingList](#AuditAppPagingList) |
## AuditAppPagingList
**Properties**
| Name | Type |
|------------|-----------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [AuditAppEntry[]](#AuditAppEntry) |
## AuditAppEntry
**Properties**
| Name | Type |
|-------|-----------------------|
| entry | [AuditApp](#AuditApp) |
## AuditApp
**Properties**
| Name | Type |
|------------|---------|
| **id** | string |
| name | string |
| isEnabled | boolean |
| maxEntryId | number |
| minEntryId | number |
## AuditBodyUpdate
| Name | Type |
|-----------|---------|
| isEnabled | boolean |
## AuditEntryPaging
**Properties**
| Name | Type |
|------|-----------------------------------------------|
| list | [AuditEntryPagingList](#AuditEntryPagingList) |
## AuditEntryPagingList
**Properties**
| Name | Type |
|------------|---------------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [AuditEntryEntry[]](#AuditEntryEntry) |
## AuditEntryEntry
**Properties**
| Name | Type |
|-------|---------------------------|
| entry | [AuditEntry](#AuditEntry) |
## AuditEntry
**Properties**
| Name | Type |
|------------------------|-------------------------|
| **id** | string |
| **auditApplicationId** | string |
| **createdByUser** | [UserInfo](UserInfo.md) |
| **createdAt** | Date |
| values | any |

View File

@@ -0,0 +1,73 @@
# CategoriesApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-----------------------------------------------------|--------------------------------------------------------|---------------------------------------------|
| [getSubcategories](#getSubcategories) | **GET** /categories/{categoryId}/subcategories | List of subcategories within category |
| [getCategory](#getCategory) | **GET** /categories/{categoryId} | Get a category |
| [getCategoryLinksForNode](#getCategoryLinksForNode) | **GET** /nodes/{nodeId}/category-links | List of categories that node is assigned to |
| [deleteCategory](#deleteCategory) | **DELETE** /categories/{categoryId} | Deletes the category |
| [unlinkNodeFromCategory](#unlinkNodeFromCategory) | **DELETE** /nodes/{nodeId}/category-links/{categoryId} | Unassign a node from category |
| [updateCategory](#updateCategory) | **PUT** /categories/{categoryId} | Update a category |
| [createSubcategories](#createSubcategories) | **POST** /categories/{categoryId}/subcategories | Create new categories |
| [linkNodeToCategory](#linkNodeToCategory) | **POST** /nodes/{nodeId}/category-links | Assign a node to a category |
# Models
## CategoryPaging
**Properties**
| Name | Type |
|------|-------------------------------------------|
| list | [CategoryPagingList](#CategoryPagingList) |
## CategoryPagingList
**Properties**
| Name | Type |
|------------|-----------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [CategoryEntry[]](#CategoryEntry) |
## CategoryEntry
**Properties**
| Name | Type |
|-----------|-----------------------|
| **entry** | [Category](#Category) |
## Category
**Properties**
| Name | Type |
|-------------|---------|
| **id** | string |
| **name** | string |
| parentId | string |
| hasChildren | boolean |
| count | number |
| path | string |
## CategoryBody
**Properties**
| Name | Type |
|----------|--------|
| **name** | string |
## CategoryLinkBody
**Properties**
| Name | Type |
|----------------|--------|
| **categoryId** | string |

View File

@@ -0,0 +1,10 @@
# ChildAssociation
**Properties**
| Name | Type |
|---------------|--------|
| **childId** | string |
| **assocType** | string |

View File

@@ -0,0 +1,9 @@
# ChildAssociationEntry
**Properties**
| Name | Type |
|-----------|-----------------------------------------|
| **entry** | [ChildAssociation](ChildAssociation.md) |

View File

@@ -0,0 +1,10 @@
# ChildAssociationInfo
**Properties**
| Name | Type |
|---------------|---------|
| **assocType** | string |
| **isPrimary** | boolean |

View File

@@ -0,0 +1,220 @@
# CommentsApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|---------------------------------|-------------------------------------------------|------------------|
| [createComment](#createComment) | **POST** /nodes/{nodeId}/comments | Create a comment |
| [deleteComment](#deleteComment) | **DELETE** /nodes/{nodeId}/comments/{commentId} | Delete a comment |
| [listComments](#listComments) | **GET** /nodes/{nodeId}/comments | List comments |
| [updateComment](#updateComment) | **PUT** /nodes/{nodeId}/comments/{commentId} | Update a comment |
## createComment
Create a comment
You specify the comment in a JSON body like this:
```json
{
"content": "This is a comment"
}
```
**Note:** You can create more than one comment by specifying a list of comments in the JSON body like this:
```json
[
{
"content": "This is a comment"
},
{
"content": "This is another comment"
}
]
```
If you specify a list as input, then a paginated list rather than an entry is returned in the response body.
For example:
```json
{
"list": {
"pagination": {
"count": 2,
"hasMoreItems": false,
"totalItems": 2,
"skipCount": 0,
"maxItems": 100
},
"entries": [
{
"entry": {}
},
{
"entry": {}
}
]
}
}
```
**Parameters**
| Name | Type | Description |
|-----------------------|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **commentBodyCreate** | [CommentBody](#CommentBody) | The comment text. Note that you can also provide a list of comments. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [CommentEntry](#CommentEntry)
**Example**
```javascript
import { AlfrescoApi, CommentsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const commentsApi = new CommentsApi(alfrescoApi);
const opts = {};
const commentBodyCreate = {};
commentsApi.createComment(`<nodeId>`, commentBodyCreate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## deleteComment
Delete a comment
**Parameters**
| Name | Type | Description |
|---------------|--------|------------------------------|
| **nodeId** | string | The identifier of a node. |
| **commentId** | string | The identifier of a comment. |
**Example**
```javascript
import { AlfrescoApi, CommentsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const commentsApi = new CommentsApi(alfrescoApi);
commentsApi.deleteComment(`<nodeId>`, `<commentId>`).then(() => {
console.log('API called successfully.');
});
```
## listComments
Gets a list of comments for the node **nodeId**, sorted chronologically with the newest comment first.
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| **nodeId** | string | The identifier of a node. | |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [CommentPaging](#CommentPaging)
**Example**
```javascript
import { AlfrescoApi, CommentsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const commentsApi = new CommentsApi(alfrescoApi);
const opts = {};
commentsApi.listComments(`<nodeId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## updateComment
Update a comment
**Parameters**
| Name | Type | Description |
|-----------------------|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **commentId** | string | The identifier of a comment. |
| **commentBodyUpdate** | [CommentBody](#CommentBody) | The JSON representing the comment to be updated. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [CommentEntry](#CommentEntry)
**Example**
```javascript
import { AlfrescoApi, CommentsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const commentsApi = new CommentsApi(alfrescoApi);
const commentBodyUpdate = {};
const opts = {};
commentsApi.updateComment(`<nodeId>`, `<commentId>`, commentBodyUpdate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## CommentBody
**Properties**
| Name | Type |
|-------------|--------|
| **content** | string |
## CommentPaging
**Properties**
| Name | Type |
|------|-----------------------------------------|
| list | [CommentPagingList](#CommentPagingList) |
## CommentPagingList
**Properties**
| Name | Type |
|------------|---------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [CommentEntry[]](#CommentEntry) |
## CommentEntry
**Properties**
| Name | Type |
|-----------|---------------------|
| **entry** | [Comment](#Comment) |
## Comment
**Properties**
| Name | Type |
|----------------|---------------------|
| **id** | string |
| **title** | string |
| **content** | string |
| **createdBy** | [Person](Person.md) |
| **createdAt** | Date |
| **edited** | boolean |
| **modifiedBy** | [Person](Person.md) |
| **modifiedAt** | Date |
| **canEdit** | boolean |
| **canDelete** | boolean |

View File

@@ -0,0 +1,16 @@
# Company
**Properties**
| Name | Type |
|--------------|--------|
| organization | string |
| address1 | string |
| address2 | string |
| address3 | string |
| postcode | string |
| telephone | string |
| fax | string |
| email | string |

View File

@@ -0,0 +1,12 @@
# ContentInfo
**Properties**
| Name | Type |
|------------------|--------|
| **mimeType** | string |
| **mimeTypeName** | string |
| **sizeInBytes** | number |
| encoding | string |

View File

@@ -0,0 +1,8 @@
# Definition
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**properties** | [**Property[]**](Property.md) | List of property definitions effective for this node as the result of combining the type with all aspects. | [optional] [default to null]

View File

@@ -0,0 +1,9 @@
# DirectAccessUrl
**Properties**
| Name | Type | Description |
|----------------|---------|----------------------------------------------------------------------------|
| **contentUrl** | string | The direct access URL of a binary content |
| attachment | boolean | Whether or not the content downloads as an attachment |
| expiryTime | Date | The direct access URL would become invalid when the expiry date is reached |

View File

@@ -0,0 +1,9 @@
# DirectAccessUrlEntry
**Properties**
| Name | Type |
|-----------|---------------------------------------|
| **entry** | [DirectAccessUrl](DirectAccessUrl.md) |

View File

@@ -0,0 +1,156 @@
# DownloadsApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-----------------------------------|------------------------------------|-----------------------|
| [cancelDownload](#cancelDownload) | **DELETE** /downloads/{downloadId} | Cancel a download |
| [createDownload](#createDownload) | **POST** /downloads | Create a new download |
| [getDownload](#getDownload) | **GET** /downloads/{downloadId} | Get a download |
## cancelDownload
Cancel a download
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
Cancels the creation of a download request.
> The download node can be deleted using the **DELETE /nodes/{downloadId}** endpoint
By default, if the download node is not deleted it will be picked up by a cleaner job which removes download nodes older than a configurable amount of time (default is 1 hour)
Information about the existing progress at the time of cancelling can be retrieved by calling the **GET /downloads/{downloadId}** endpoint
The cancel operation is done asynchronously.
**Parameters**
| Name | Type | Description |
|----------------|--------|------------------------------------|
| **downloadId** | string | The identifier of a download node. |
**Example**
```javascript
import { AlfrescoApi, DownloadsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const downloadsApi = new DownloadsApi(alfrescoApi);
downloadsApi.cancelDownload(`<downloadId>`).then(() => {
console.log('API called successfully.');
});
```
## createDownload
Create a new download
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
Creates a new download node asynchronously, the content of which will be the zipped content of the **nodeIds** specified in the JSON body like this:
```json
{
"nodeIds":
[
"c8bb482a-ff3c-4704-a3a3-de1c83ccd84c",
"cffa62db-aa01-493d-9594-058bc058eeb1"
]
}
```
> The content of the download node can be obtained using the **GET /nodes/{downloadId}/content** endpoint
**Parameters**
| Name | Type | Description |
|------------------------|-------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **downloadBodyCreate** | [DownloadBodyCreate](#DownloadBodyCreate) | The nodeIds the content of which will be zipped, which zip will be set as the content of our download node. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [DownloadEntry](#DownloadEntry)
**Example**
```javascript
import { AlfrescoApi, DownloadsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const downloadsApi = new DownloadsApi(alfrescoApi);
const downloadBodyCreate = {};
const opts = {};
downloadsApi.createDownload(downloadBodyCreate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getDownload
Retrieve status information for download node
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
**Parameters**
| Name | Type | Description |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **downloadId** | string | The identifier of a download node. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [DownloadEntry](#DownloadEntry)
**Example**
```javascript
import { AlfrescoApi, DownloadsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const downloadsApi = new DownloadsApi(alfrescoApi);
const opts = {};
downloadsApi.getDownload(`<downloadId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## DownloadBodyCreate
**Properties**
| Name | Type |
|-------------|----------|
| **nodeIds** | string[] |
## DownloadEntry
**Properties**
| Name | Type |
|-----------|-----------------------|
| **entry** | [Download](#Download) |
## Download
**Properties**
| Name | Type | Description |
|------------|--------|--------------------------------------------------|
| filesAdded | number | number of files added so far in the zip |
| bytesAdded | number | number of bytes added so far in the zip |
| id | string | the id of the download node |
| totalFiles | number | the total number of files to be added in the zip |
| totalBytes | number | the total number of bytes to be added in the zip |
| status | string | the current status of the download node creation |
### Download.StatusEnum
* `PENDING` (value: `'PENDING'`)
* `CANCELLED` (value: `'CANCELLED'`)
* `INPROGRESS` (value: `'IN_PROGRESS'`)
* `DONE` (value: `'DONE'`)
* `MAXCONTENTSIZEEXCEEDED` (value: `'MAX_CONTENT_SIZE_EXCEEDED'`)

View File

@@ -0,0 +1,8 @@
# ModelError
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**error** | [**ErrorError**](ErrorError.md) | | [optional] [default to null]

View File

@@ -0,0 +1,13 @@
# ErrorError
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**errorKey** | **string** | | [optional] [default to null]
**statusCode** | **number** | | [default to null]
**briefSummary** | **string** | | [default to null]
**stackTrace** | **string** | | [default to null]
**descriptionURL** | **string** | | [default to null]
**logId** | **string** | | [optional] [default to null]

View File

@@ -0,0 +1,465 @@
# FavoritesApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-----------------------------------------------------------|-------------------------------------------------------|------------------------|
| [createFavorite](#createFavorite) | **POST** /people/{personId}/favorites | Create a favorite |
| [createSiteFavorite](#createSiteFavorite) | **POST** /people/{personId}/favorite-sites | Create a site favorite |
| [deleteFavorite](#deleteFavorite) | **DELETE** /people/{personId}/favorites/{favoriteId} | Delete a favorite |
| [deleteSiteFavorite](#deleteSiteFavorite) | **DELETE** /people/{personId}/favorite-sites/{siteId} | Delete a site favorite |
| [getFavorite](#getFavorite) | **GET** /people/{personId}/favorites/{favoriteId} | Get a favorite |
| [getFavoriteSite](#getFavoriteSite) | **GET** /people/{personId}/favorite-sites/{siteId} | Get a favorite site |
| [listFavoriteSitesForPerson](#listFavoriteSitesForPerson) | **GET** /people/{personId}/favorite-sites | List favorite sites |
| [listFavorites](#listFavorites) | **GET** /people/{personId}/favorites | List favorites |
## createFavorite
Favorite a **site**, **file**, or **folder** in the repository.
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Note:** You can favorite more than one entity by specifying a list of objects in the JSON body like this:
```json
[
{
"target": {
"file": {
"guid": "abcde-01234-...."
}
}
},
{
"target": {
"file": {
"guid": "abcde-09863-...."
}
}
}
]
```
If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example:
```json
{
"list": {
"pagination": {
"count": 2,
"hasMoreItems": false,
"totalItems": 2,
"skipCount": 0,
"maxItems": 100
},
"entries": [
{
"entry": {}
},
{
"entry": {}
}
]
}
}
```
**Parameters**
| Name | Type | Description |
|------------------------|-------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **personId** | string | The identifier of a person. |
| **favoriteBodyCreate** | [FavoriteBodyCreate](#FavoriteBodyCreate) | An object identifying the entity to be favorited. The object consists of a single property which is an object with the name site, file, or folder. The content of that object is the guid of the target entity. For example, to favorite a file the following body would be used. |
| opts.include | string[] | Returns additional information about favorites, the following optional fields can be requested: `path` (note, this only applies to files and folders), `properties` |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [FavoriteEntry](#FavoriteEntry)
**Example**
```javascript
import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const favoritesApi = new FavoritesApi(alfrescoApi);
const favoriteBodyCreate = {};
const opts = {};
favoritesApi.createFavorite(`<personId>`, favoriteBodyCreate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## createSiteFavorite
Create a site favorite
> this endpoint is deprecated as of **Alfresco 4.2**, and will be removed in the future.
> Use **/people/{personId}/favorites** instead.
Create a site favorite for person **personId**.
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Note:** You can favorite more than one site by specifying a list of sites in the JSON body like this:
```json
[
{
"id": "test-site-1"
},
{
"id": "test-site-2"
}
]
```
If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example:
```json
{
"list": {
"pagination": {
"count": 2,
"hasMoreItems": false,
"totalItems": 2,
"skipCount": 0,
"maxItems": 100
},
"entries": [
{
"entry": {}
},
{
"entry": {}
}
]
}
}
```
**Parameters**
| Name | Type | Description |
|----------------------------|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **personId** | string | The identifier of a person. |
| **favoriteSiteBodyCreate** | [FavoriteSiteBodyCreate](#FavoriteSiteBodyCreate) | The id of the site to favorite. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [FavoriteSiteEntry](#FavoriteSiteEntry)
**Example**
```javascript
import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const favoritesApi = new FavoritesApi(alfrescoApi);
const favoriteSiteBodyCreate = {};
const opts = {};
favoritesApi.createSiteFavorite(`<personId>`, favoriteSiteBodyCreate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## deleteFavorite
Delete a favorite
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Parameters**
| Name | Type | Description |
|----------------|--------|-------------------------------|
| **personId** | string | The identifier of a person. |
| **favoriteId** | string | The identifier of a favorite. |
**Example**
```javascript
import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const favoritesApi = new FavoritesApi(alfrescoApi);
favoritesApi.deleteFavorite(`<personId>`, `<favoriteId>`).then(() => {
console.log('API called successfully.');
});
```
## deleteSiteFavorite
Delete a site favorite
> this endpoint is deprecated as of **Alfresco 4.2**, and will be removed in the future.
> Use **/people/{personId}/favorites/{favoriteId}** instead.
Deletes site **siteId** from the favorite site list of person **personId**.
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Example**
```javascript
import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const favoritesApi = new FavoritesApi(alfrescoApi);
favoritesApi.deleteSiteFavorite(`<personId>`, `<siteId>`).then(() => {
console.log('API called successfully.');
});
```
**Parameters**
| Name | Type | Description |
|--------------|--------|-----------------------------|
| **personId** | string | The identifier of a person. |
| **siteId** | string | The identifier of a site. |
## getFavorite
Get a favorite
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Parameters**
| Name | Type | Description |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **personId** | string | The identifier of a person. |
| **favoriteId** | string | The identifier of a favorite. |
| opts.include | string[] | Returns additional information about favorites, the following optional fields can be requested: `path` (note, this only applies to files and folders), `properties` |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [FavoriteEntry](#FavoriteEntry)
**Example**
```javascript
import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const favoritesApi = new FavoritesApi(alfrescoApi);
const opts = {};
favoritesApi.getFavorite(`<personId>`, `<favoriteId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getFavoriteSite
Get a favorite site
> This endpoint is **deprecated** as of **Alfresco 4.2**, and will be removed in the future.
> Use `/people/{personId}/favorites/{favoriteId}` instead.
Gets information on favorite site **siteId** of person **personId**.
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Parameters**
| Name | Type | Description |
|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **personId** | string | The identifier of a person. |
| **siteId** | string | The identifier of a site. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [SiteEntry](SiteEntry.md)
**Example**
```javascript
import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const favoritesApi = new FavoritesApi(alfrescoApi);
const opts = {};
favoritesApi.getFavoriteSite(`<personId>`, `<siteId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listFavoriteSitesForPerson
List favorite sites
> This endpoint is **deprecated** as of Alfresco 4.2, and will be removed in the future.
> Use **/people/{personId}/favorites** instead.
Gets a list of a person's favorite sites.
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Example**
```javascript
import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const favoritesApi = new FavoritesApi(alfrescoApi);
const opts = {};
favoritesApi.listFavoriteSitesForPerson(`<personId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
**Parameters**
| Name | Type | Description |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **personId** | string | The identifier of a person. |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [SitePaging](SitePaging.md)
## listFavorites
List favorites
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
The default sort order for the returned list of favorites is type ascending, createdAt descending.
You can override the default by using the **orderBy** parameter.
You can use any of the following fields to order the results:
* type
* createdAt
* title
You can use the **where** parameter to restrict the list in the response
to entries of a specific kind. The **where** parameter takes a value.
The value is a single predicate that can include one or more **EXISTS**
conditions. The **EXISTS** condition uses a single operand to limit the
list to include entries that include that one property. The property values are:
* target/file
* target/folder
* target/site
For example, the following **where** parameter restricts the returned list to the file favorites for a person:
```sql
(EXISTS(target/file))
```
You can specify more than one condition using **OR**.
The predicate must be enclosed in parentheses.
For example, the following **where** parameter restricts the returned list to the file and folder favorites for a person:
```sql
(EXISTS(target/file) OR EXISTS(target/folder))
```
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| **personId** | string | The identifier of a person. |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | |
| opts.where | string | A string to restrict the returned objects by using a predicate. | |
| opts.include | string[] | Returns additional information about favorites, the following optional fields can be requested: `path` (note, this only applies to files and folders), `properties` | |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [FavoritePaging](#FavoritePaging)
**Example**
```javascript
import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const favoritesApi = new FavoritesApi(alfrescoApi);
const opts = {};
favoritesApi.listFavorites(`<personId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## FavoritePaging
**Properties**
| Name | Type |
|------|-------------------------------------------|
| list | [FavoritePagingList](#FavoritePagingList) |
## FavoritePagingList
**Properties**
| Name | Type |
|------------|-----------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [FavoriteEntry[]](#FavoriteEntry) |
## FavoriteEntry
**Properties**
| Name | Type |
|-----------|-----------------------|
| **entry** | [Favorite](#Favorite) |
## Favorite
**Properties**
| Name | Type | Description |
|----------------|--------|----------------------------------------------------------------------------------------------------------------------------|
| **targetGuid** | string | The guid of the object that is a favorite. |
| **target** | any | |
| createdAt | Date | The time the object was made a favorite. |
| properties | any | A subset of the target favorite properties, system properties and properties already available in the target are excluded. |
## FavoriteBodyCreate
**Properties**
| Name | Type |
|------------|---------|
| **target** | **any** |
## FavoriteSiteBodyCreate
**Properties**
| Name | Type |
|------|--------|
| id | string |
## FavoriteSiteEntry
**Properties**
| Name | Type |
|-------|-------------------------------|
| entry | [FavoriteSite](#FavoriteSite) |
## FavoriteSite
**Properties**
| Name | Type |
|------|--------|
| id | string |

View File

@@ -0,0 +1,12 @@
# Group
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **string** | | [default to null]
**displayName** | **string** | | [default to null]
**isRoot** | **boolean** | | [default to null]
**parentIds** | **string[]** | | [optional] [default to null]
**zones** | **string[]** | | [optional] [default to null]

View File

@@ -0,0 +1,18 @@
# GroupMember
**Properties**
| Name | Type |
|-----------------|--------|
| **id** | string |
| **displayName** | string |
| **memberType** | string |
## GroupMember.MemberTypeEnum
* `GROUP` (value: `'GROUP'`)
* `PERSON` (value: `'PERSON'`)

View File

@@ -0,0 +1,512 @@
# GroupsApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-----------------------------------------------------------------|------------------------------------------------------|-----------------------------|
| [createGroup](#createGroup) | **POST** /groups | Create a group |
| [createGroupMembership](#createGroupMembership) | **POST** /groups/{groupId}/members | Create a group membership |
| [deleteGroup](#deleteGroup) | **DELETE** /groups/{groupId} | Delete a group |
| [deleteGroupMembership](#deleteGroupMembership) | **DELETE** /groups/{groupId}/members/{groupMemberId} | Delete a group membership |
| [getGroup](#getGroup) | **GET** /groups/{groupId} | Get group details |
| [listGroupMemberships](#listGroupMemberships) | **GET** /groups/{groupId}/members | List memberships of a group |
| [listGroupMembershipsForPerson](#listGroupMembershipsForPerson) | **GET** /people/{personId}/groups | List group memberships |
| [listGroups](#listGroups) | **GET** /groups | List groups |
| [updateGroup](#updateGroup) | **PUT** /groups/{groupId} | Update group details |
## createGroup
Create a group
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
> You must have admin rights to create a group.
Create a group.
The group id must start with \"GROUP\\_\". If this is omitted it will be added automatically.
This format is also returned when listing groups or group memberships. It should be noted
that the other group-related operations also expect the id to start with \"GROUP\\_\".
If one or more parentIds are specified then the group will be created and become a member
of each of the specified parent groups.
If no parentIds are specified then the group will be created as a root group.
The group will be created in the **APP.DEFAULT** and **AUTH.ALF** zones.
**Parameters**
| Name | Type | Description |
|---------------------|-------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **groupBodyCreate** | [GroupBodyCreate](#GroupBodyCreate) | The group to create. |
| opts.include | string[] | Returns additional information about the group. The following optional fields can be requested: `parentIds`, `zones` |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [GroupEntry](#GroupEntry)
**Example**
```javascript
import { AlfrescoApi, GroupsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const groupsApi = new GroupsApi(alfrescoApi);
const payload = {};
const opts = {};
groupsApi.createGroup(payload, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## createGroupMembership
Create a group membership
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
> You must have admin rights to create a group membership.
Create a group membership (for an existing person or group) within a group **groupId**.
If the added group was previously a root group then it becomes a non-root group since it now has a parent.
It is an error to specify an **id** that does not exist.
**Parameters**
| Name | Type | Description |
|-------------------------------|---------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **groupId** | string | The identifier of a group. |
| **groupMembershipBodyCreate** | [GroupMembershipBodyCreate](#GroupMembershipBodyCreate) | The group membership to add (person or sub-group). |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [GroupMemberEntry](#GroupMemberEntry)
**Example**
```javascript
import { AlfrescoApi, GroupsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const groupsApi = new GroupsApi(alfrescoApi);
const groupMembershipBodyCreate = {};
const opts = {};
groupsApi.createGroupMembership(`<groupId>`, groupMembershipBodyCreate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## deleteGroup
Delete a group
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
> You must have admin rights to delete a group.
The option to cascade delete applies this recursively to any hierarchy of group members.
In this case, removing a group member does not delete the person or subgroup itself.
If a removed subgroup no longer has any parent groups then it becomes a root group.
**Parameters**
| Name | Type | Description | Notes |
|--------------|---------|-----------------------------------------------------------------------|------------------|
| **groupId** | string | The identifier of a group. | |
| opts.cascade | boolean | If **true** then the delete will be applied in cascade to sub-groups. | default to false |
**Example**
```javascript
import { AlfrescoApi, GroupsApi} from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const groupsApi = new GroupsApi(alfrescoApi);
const opts = {
cascade: true
};
groupsApi.deleteGroup(`<groupId>`, opts).then(() => {
console.log('API called successfully.');
});
```
## deleteGroupMembership
Delete a group membership
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
> You must have admin rights to delete a group membership.
Delete group member **groupMemberId** (person or subgroup) from group **groupId**.
Removing a group member does not delete the person or subgroup itself.
If a removed subgroup no longer has any parent groups then it becomes a root group.
**Parameters**
| Name | Type | Description |
|---------------|--------|--------------------------------------|
| groupId | string | The identifier of a group. |
| groupMemberId | string | The identifier of a person or group. |
**Example**
```javascript
import { AlfrescoApi, GroupsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const groupsApi = new GroupsApi(alfrescoApi);
groupsApi.deleteGroupMembership(`<groupId>`, `<groupMemberId>`).then(() => {
console.log('API called successfully.');
});
```
## getGroup
Get group details
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
You can use the **include** parameter to return additional information.
**Parameters**
| Name | Type | Description |
|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **groupId** | string | The identifier of a group. |
| opts.include | string[] | Returns additional information about the group. The following optional fields can be requested: `parentIds`, `zones` |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [GroupEntry](#GroupEntry)
**Example**
```javascript
import { AlfrescoApi, GroupsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const groupsApi = new GroupsApi(alfrescoApi);
const opts = {};
groupsApi.getGroup(`<groupId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listGroupMemberships
List memberships of a group
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
Gets a list of the group memberships for the group **groupId**.
You can use the **where** parameter to filter the returned groups by **memberType**.
Example to filter by **memberType**, use any one of:
```text
(memberType='GROUP')
(memberType='PERSON')
```
The default sort order for the returned list is for group members to be sorted by ascending displayName.
You can override the default by using the **orderBy** parameter. You can specify one of the following fields in the **orderBy** parameter:
* id
* displayName
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| **groupId** | string | The identifier of a group. |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | |
| opts.where | string | A string to restrict the returned objects by using a predicate. | |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [GroupMemberPaging](#GroupMemberPaging)
**Example**
```javascript
import { AlfrescoApi, GroupsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const groupsApi = new GroupsApi(alfrescoApi);
const opts = { };
groupsApi.listGroupMemberships(`<groupId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listGroupMembershipsForPerson
List group memberships
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
Gets a list of group membership information for person **personId**.
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
You can use the **include** parameter to return additional information.
You can use the **where** parameter to filter the returned groups by **isRoot**. For example, the following **where**
clause will return just the root groups:
```text
(isRoot=true)
```
The **where** parameter can also be used to filter by ***zone***. This may be combined with isRoot to narrow
a result set even further. For example, the following where clause will only return groups belonging to the
`MY.ZONE` zone.
```text
where=(zones in ('MY.ZONE'))
```
This may be combined with the isRoot filter, as shown below:
```text
where=(isRoot=false AND zones in ('MY.ZONE'))
```
***Note:*** restrictions include
* AND is the only supported operator when combining isRoot and zones filters
* Only one zone is supported by the filter
* The quoted zone name must be placed in parentheses — a 400 error will result if these are omitted.
The default sort order for the returned list is for groups to be sorted by ascending displayName.
You can override the default by using the **orderBy** parameter. You can specify one or more of the following fields in the **orderBy** parameter:
* id
* displayName
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| **personId** | string | The identifier of a person. | |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | |
| opts.include | string[] | Returns additional information about the group. The following optional fields can be requested: `parentIds`, `zones` | |
| opts.where | string | A string to restrict the returned objects by using a predicate. | |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [GroupPaging](#GroupPaging)
**Example**
```javascript
import { AlfrescoApi, GroupsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const groupsApi = new GroupsApi(alfrescoApi);
const opts = {};
groupsApi.listGroupMembershipsForPerson(`<personId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listGroups
List groups
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
Gets a list of groups.
You can use the **include** parameter to return additional information.
You can use the **where** parameter to filter the returned groups by **isRoot**. For example, the following **where**
clause will return just the root groups:
```text
(isRoot=true)
```
The **where** parameter can also be used to filter by ***zone***. This may be combined with isRoot to narrow
a result set even further. For example, the following where clause will only return groups belonging to the
`MY.ZONE` zone.
```text
where=(zones in ('MY.ZONE'))
```
This may be combined with the isRoot filter, as shown below:
```text
where=(isRoot=false AND zones in ('MY.ZONE'))
```
***Note:*** restrictions include
* AND is the only supported operator when combining isRoot and zones filters
* Only one zone is supported by the filter
* The quoted zone name must be placed in parentheses — a 400 error will result if these are omitted.
The default sort order for the returned list is for groups to be sorted by ascending displayName.
You can override the default by using the **orderBy** parameter. You can specify one of the following fields in the **orderBy** parameter:
* id
* displayName
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | |
| opts.include | string[] | Returns additional information about the group. The following optional fields can be requested: `parentIds`, `zones` | |
| opts.where | string | A string to restrict the returned objects by using a predicate. | |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [GroupPaging](#GroupPaging)
**Example**
```javascript
import { AlfrescoApi, GroupsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const groupsApi = new GroupsApi(alfrescoApi);
const opts = {};
groupsApi.listGroups(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## updateGroup
Update group details
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
> You must have admin rights to update a group.
**Parameters**
| Name | Type | Description |
|---------------------|-------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **groupId** | string | The identifier of a group. |
| **groupBodyUpdate** | [GroupBodyUpdate](#GroupBodyUpdate) | The group information to update. |
| opts.include | string[] | Returns additional information about the group. The following optional fields can be requested: `parentIds`, `zones` |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [GroupEntry](#GroupEntry)
**Example**
```javascript
import { AlfrescoApi, GroupsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const groupsApi = new GroupsApi(alfrescoApi);
const groupBodyUpdate = {};
const opts = {};
groupsApi.updateGroup(`<groupId>`, groupBodyUpdate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## GroupMemberPaging
**Properties**
| Name | Type |
|------|-------------------------------------------------|
| list | [GroupMemberPagingList](#GroupMemberPagingList) |
## GroupMemberPagingList
**Properties**
| Name | Type |
|------------|-----------------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [GroupMemberEntry[]](#GroupMemberEntry) |
## GroupMemberEntry
**Properties**
| Name | Type |
|-------|-------------------------------|
| entry | [GroupMember](GroupMember.md) |
## GroupBodyCreate
**Properties**
| Name | Type |
|-------------|----------|
| id | string |
| displayName | string |
| parentIds | string[] |
## GroupMembershipBodyCreate
**Properties**
| Name | Type |
|------------|--------|
| id | string |
| memberType | string |
### GroupMembershipBodyCreate.MemberTypeEnum
* `GROUP` (value: `'GROUP'`)
* `PERSON` (value: `'PERSON'`)
## GroupBodyUpdate
**Properties**
| Name | Type |
|-------------|--------|
| displayName | string |
## GroupPaging
**Properties**
| Name | Type |
|------|-------------------------------------|
| list | [GroupPagingList](#GroupPagingList) |
## GroupPagingList
**Properties**
| Name | Type |
|------------|-----------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [GroupEntry[]](#GroupEntry) |
## GroupEntry
**Properties**
| Name | Type |
|-----------|-------------------|
| **entry** | [Group](Group.md) |

View File

@@ -0,0 +1,158 @@
# NetworksApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-------------------------------------------------|-------------------------------------------------|-------------------------|
| [getNetwork](#getNetwork) | **GET** /networks/{networkId} | Get a network |
| [getNetworkForPerson](#getNetworkForPerson) | **GET** /people/{personId}/networks/{networkId} | Get network information |
| [listNetworksForPerson](#listNetworksForPerson) | **GET** /people/{personId}/networks | List network membership |
## getNetwork
Get a network
**Parameters**
| Name | Type | Description |
|---------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **networkId** | string | The identifier of a network. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [PersonNetworkEntry](#PersonNetworkEntry)
**Example**
```javascript
import { AlfrescoApi, NetworksApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const networksApi = new NetworksApi(alfrescoApi);
const opts = {};
networksApi.getNetwork(`<networkId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getNetworkForPerson
Get network information
You can use the `-me-` string in place of <personId> to specify the currently authenticated user.
**Parameters**
| Name | Type | Description |
|---------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **personId** | string | The identifier of a person. |
| **networkId** | string | The identifier of a network. |
| fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [PersonNetworkEntry](#PersonNetworkEntry)
**Example**
```javascript
import { AlfrescoApi, NetworksApi} from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const networksApi = new NetworksApi(alfrescoApi);
const opts = {};
networksApi.getNetworkForPerson(`<personId>`, `<networkId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listNetworksForPerson
List network membership
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| **personId** | string | The identifier of a person. |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [PersonNetworkPaging](#PersonNetworkPaging)
**Example**
```javascript
import { AlfrescoApi, NetworksApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const networksApi = new NetworksApi(alfrescoApi);
const opts = {};
networksApi.listNetworksForPerson(`<personId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## PersonNetworkEntry
**Properties**
| Name | Type |
|-------|---------------------------------|
| entry | [PersonNetwork](#PersonNetwork) |
## PersonNetworkPaging
**Properties**
| Name | Type |
|------|-----------------------------------------------------|
| list | [PersonNetworkPagingList](#PersonNetworkPagingList) |
## PersonNetworkPagingList
**Properties**
| Name | Type |
|------------|---------------------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [PersonNetworkEntry[]](#PersonNetworkEntry) |
## PersonNetwork
**Properties**
| Name | Type | Description |
|-------------------|---------------------------------|---------------------------|
| **id** | string | This network's unique id |
| homeNetwork | boolean | Is this the home network? |
| **isEnabled** | boolean | |
| createdAt | Date | |
| paidNetwork | boolean | |
| subscriptionLevel | string | |
| quotas | [NetworkQuota[]](#NetworkQuota) | |
### PersonNetwork.SubscriptionLevelEnum
* `Free` (value: `'Free'`)
* `Standard` (value: `'Standard'`)
* `Enterprise` (value: `'Enterprise'`)
## NetworkQuota
**Properties**
| Name | Type |
|-----------|--------|
| **id** | string |
| **limit** | number |
| **usage** | number |

View File

@@ -0,0 +1,29 @@
# Node
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **string** | | [default to null]
**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |.
The character . must not be used at the end of the name.
| [default to null]
**nodeType** | **string** | | [default to null]
**isFolder** | **boolean** | | [default to null]
**isFile** | **boolean** | | [default to null]
**isLocked** | **boolean** | | [optional] [default to null]
**modifiedAt** | [**Date**](Date.md) | | [default to null]
**modifiedByUser** | [**UserInfo**](UserInfo.md) | | [default to null]
**createdAt** | [**Date**](Date.md) | | [default to null]
**createdByUser** | [**UserInfo**](UserInfo.md) | | [default to null]
**parentId** | **string** | | [optional] [default to null]
**isLink** | **boolean** | | [optional] [default to null]
**isFavorite** | **boolean** | | [optional] [default to null]
**content** | [**ContentInfo**](ContentInfo.md) | | [optional] [default to null]
**aspectNames** | **string[]** | | [optional] [default to null]
**properties** | **any** | | [optional] [default to null]
**allowableOperations** | **string[]** | | [optional] [default to null]
**path** | [**PathInfo**](PathInfo.md) | | [optional] [default to null]
**permissions** | [**PermissionsInfo**](PermissionsInfo.md) | | [optional] [default to null]
**definition** | [**Definition**](Definition.md) | | [optional] [default to null]

View File

@@ -0,0 +1,8 @@
# NodeEntry
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**entry** | [**Node**](Node.md) | | [default to null]

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
# Pagination
**Properties**
| Name | Type | Description |
|--------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| count | number | The number of objects in the entries array. |
| hasMoreItems | boolean | A boolean value which is **true** if there are more entities in the collection beyond those in this response. A true value means a request with a larger value for the **skipCount** or the **maxItems** parameter will return more entities. |
| totalItems | number | An integer describing the total number of entities in the collection. The API might not be able to determine this value, in which case this property will not be present. |
| skipCount | number | An integer describing how many entities exist in the collection before those included in this list. If there was no **skipCount** parameter then the default value is 0. |
| maxItems | number | The value of the **maxItems** parameter used to generate this list. If there was no **maxItems** parameter then the default value is 100. |

View File

@@ -0,0 +1,12 @@
# PathElement
**Properties**
| Name | Type |
|-------------|----------|
| id | string |
| name | string |
| nodeType | string |
| aspectNames | string[] |

View File

@@ -0,0 +1,11 @@
# PathInfo
**Properties**
| Name | Type |
|------------|---------------------------------|
| elements | [PathElement[]](PathElement.md) |
| name | string |
| isComplete | boolean |

View File

@@ -0,0 +1,457 @@
# PeopleApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-----------------------------------------------|----------------------------------------------------|------------------------|
| [createPerson](#createPerson) | **POST** /people | Create person |
| [deleteAvatarImage](#deleteAvatarImage) | **DELETE** /people/{personId}/avatar | Delete avatar image |
| [getAvatarImage](#getAvatarImage) | **GET** /people/{personId}/avatar | Get avatar image |
| [getPerson](#getPerson) | **GET** /people/{personId} | Get a person |
| [listPeople](#listPeople) | **GET** /people | List people |
| [requestPasswordReset](#requestPasswordReset) | **POST** /people/{personId}/request-password-reset | Request password reset |
| [resetPassword](#resetPassword) | **POST** /people/{personId}/reset-password | Reset password |
| [updateAvatarImage](#updateAvatarImage) | **PUT** /people/{personId}/avatar | Update avatar image |
| [updatePerson](#updatePerson) | **PUT** /people/{personId} | Update person |
## createPerson
Create person
> this endpoint is available in **Alfresco 5.2** and newer versions.
> You must have admin rights to create a person.
Create a person.
If applicable, the given person's login access can also be optionally disabled.
You can set custom properties when you create a person:
```json
{
"id": "abeecher",
"firstName": "Alice",
"lastName": "Beecher",
"displayName": "Alice Beecher",
"email": "abeecher@example.com",
"password": "secret",
"properties":
{
"my:property": "The value"
}
}
```
> setting properties of type d:content and d:category are not supported.
**Parameters**
| Name | Type | Description |
|----------------------|---------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **personBodyCreate** | [PersonBodyCreate](#PersonBodyCreate) | The person details. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [PersonEntry](PersonEntry.md)
**Example**
```javascript
import { AlfrescoApi, PeopleApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const peopleApi = new PeopleApi(alfrescoApi);
const personBodyCreate = {};
const opts = {};
peopleApi.createPerson(personBodyCreate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## deleteAvatarImage
Deletes the avatar image related to person.
> this endpoint is available in **Alfresco 5.2.2** and newer versions.
> You must be the person or have admin rights to update a person's avatar.
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Parameters**
| Name | Type | Description |
|--------------|--------|-----------------------------|
| **personId** | string | The identifier of a person. |
**Example**
```javascript
import { AlfrescoApi, PeopleApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const peopleApi = new PeopleApi(alfrescoApi);
peopleApi.deleteAvatarImage(`<personId>`).then(() => {
console.log('API called successfully.');
});
```
## getAvatarImage
Get avatar image
> this endpoint is available in **Alfresco 5.2.2** and newer versions.
Gets the avatar image related to the person **personId**. If the person has no related avatar then
the **placeholder** query parameter can be optionally used to request a placeholder image to be returned.
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Parameters**
| Name | Type | Description |
|----------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **personId** | string | The identifier of a person. |
| opts.attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. |
| opts.ifModifiedSince | Date | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, `Wed, 09 Mar 2016 16:56:34 GMT`. |
| opts.placeholder | boolean | If **true** (default) and there is no avatar for this **personId** then the placeholder image is returned, rather than a 404 response. |
**Return type**: Blob
**Example**
```javascript
import { AlfrescoApi, PeopleApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const peopleApi = new PeopleApi(alfrescoApi);
const opts = {};
peopleApi.getAvatarImage(`<personId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getPerson
Gets information for the person
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Parameters**
| Name | Type | Description |
|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **personId** | string | The identifier of a person. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [PersonEntry](PersonEntry.md)
**Example**
```javascript
import { AlfrescoApi, PeopleApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const peopleApi = new PeopleApi(alfrescoApi);
const opts = {};
peopleApi.getPerson(`<personId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listPeople
List people
> this endpoint is available in **Alfresco 5.2** and newer versions.
You can use the **include** parameter to return any additional information.
The default sort order for the returned list is for people to be sorted by ascending id.
You can override the default by using the **orderBy** parameter.
You can use any of the following fields to order the results:
* id
* firstName
* lastName
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | |
| opts.include | string[] | Returns additional information about the person. The following optional fields can be requested: `properties`, `aspectNames`, `capabilities` | |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [PersonPaging](PersonPaging.md)
**Example**
```javascript
import { AlfrescoApi, PeopleApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const peopleApi = new PeopleApi(alfrescoApi);
const opts = {};
peopleApi.listPeople(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## requestPasswordReset
Request password reset
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
> No authentication is required to call this endpoint.
Initiates the reset password workflow to send an email with reset password instruction to the user's registered email.
The client is mandatory in the request body. For example:
```json
{
"client": "myClient"
}
```
**Note:** The client must be registered before this API can send an email. See [server documentation]. However, out-of-the-box
share is registered as a default client, so you could pass **share** as the client name:
```json
{
"client": "share"
}
```
**Parameters**
| Name | Type | Description |
|----------------|---------------------------|------------------------------------------------------|
| **personId** | **string** | The identifier of a person. |
| **clientBody** | [ClientBody](#ClientBody) | The client name to send email with app-specific url. |
**Example**
```javascript
import { AlfrescoApi, PeopleApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const peopleApi = new PeopleApi(alfrescoApi);
const clientBody = {};
peopleApi.requestPasswordReset(`<personId>`, clientBody).then(() => {
console.log('API called successfully.');
});
```
## resetPassword
Resets user's password
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
> No authentication is required to call this endpoint.
The password, id and key properties are mandatory in the request body. For example:
```json
{
"password":"newPassword",
"id":"activiti$10",
"key":"4dad6d00-0daf-413a-b200-f64af4e12345"
}
```
**Parameters**
| Name | Type | Description |
|-----------------------|-----------------------------------------|-----------------------------|
| **personId** | string | The identifier of a person. |
| **passwordResetBody** | [PasswordResetBody](#PasswordResetBody) | The reset password details |
**Example**
```javascript
import { AlfrescoApi, PeopleApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const peopleApi = new PeopleApi(alfrescoApi);
const passwordResetBody = {};
peopleApi.resetPassword(`<personId>`, passwordResetBody).then(() => {
console.log('API called successfully.');
});
```
## updateAvatarImage
Updates the avatar image related to the person
> this endpoint is available in **Alfresco 5.2.2** and newer versions.
> You must be the person or have admin rights to update a person's avatar.
The request body should be the binary stream for the avatar image. The content type of the file
should be an image file. This will be used to generate an "avatar" thumbnail rendition.
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Parameters**
| Name | Type | Description |
|-----------------------|--------|-----------------------------|
| **personId** | string | The identifier of a person. |
| **contentBodyUpdate** | string | The binary content |
**Example**
```javascript
import { AlfrescoApi, PeopleApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const peopleApi = new PeopleApi(alfrescoApi);
const contentBodyUpdate = {};
peopleApi.updateAvatarImage(`<personId>`, contentBodyUpdate).then(() => {
console.log('API called successfully.');
});
```
## updatePerson
Update the given person's details.
> this endpoint is available in **Alfresco 5.2** and newer versions.
> You must have admin rights to update a person — unless updating your own details.
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
If applicable, the given person's login access can also be optionally disabled or re-enabled.
If you are changing your password, as a non-admin user, then the existing password must also
be supplied (using the oldPassword field in addition to the new password value).
Admin users cannot be disabled by setting enabled to false.
Non-admin users may not disable themselves.
You can set custom properties when you update a person:
```json
{
"firstName": "Alice",
"properties":
{
"my:property": "The value"
}
}
```
> setting properties of type d:content and d:category are not supported.
**Parameters**
| Name | Type | Description |
|----------------------|---------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **personId** | string | The identifier of a person. |
| **personBodyUpdate** | [PersonBodyUpdate](#PersonBodyUpdate) | The person details. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [PersonEntry](PersonEntry.md)
**Example**
```javascript
import { AlfrescoApi, PeopleApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const peopleApi = new PeopleApi(alfrescoApi);
const personBodyUpdate = {};
const opts = {};
peopleApi.updatePerson(`<personId>`, personBodyUpdate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## PersonBodyCreate
**Properties**
| Name | Type | Description |
|---------------------------|-----------------------|-------------|
| **id** | string | |
| **firstName** | string | |
| lastName | string | |
| description | string | |
| **email** | string | |
| skypeId | string | |
| googleId | string | |
| instantMessageId | string | |
| jobTitle | string | |
| location | string | |
| company | [Company](Company.md) | |
| mobile | string | |
| telephone | string | |
| userStatus | string | |
| enabled | boolean | |
| emailNotificationsEnabled | boolean | |
| **password** | string | |
| aspectNames | string[] | |
| properties | any | |
## PersonBodyUpdate
**Properties**
| Name | Type |
|---------------------------|-----------------------|
| firstName | string |
| lastName | string |
| description | string |
| email | string |
| skypeId | string |
| googleId | string |
| instantMessageId | string |
| jobTitle | string |
| location | string |
| company | [Company](Company.md) |
| mobile | string |
| telephone | string |
| userStatus | string |
| enabled | boolean |
| emailNotificationsEnabled | boolean |
| password | string |
| oldPassword | string |
| aspectNames | string[] |
| properties | any |
## ClientBody
**Properties**
| Name | Type | Description |
|--------|--------|-----------------|
| client | string | the client name |
## PasswordResetBody
**Properties**
| Name | Type | Description |
|--------------|--------|-------------------------------------------------------|
| **password** | string | the new password |
| **id** | string | the workflow id provided in the reset password email |
| **key** | string | the workflow key provided in the reset password email |

View File

@@ -0,0 +1,14 @@
# PermissionElement
**Properties**
| Name | Type |
|--------------|--------|
| authorityId | string |
| name | string |
| accessStatus | string |
## PermissionElement.AccessStatusEnum
* `ALLOWED` (value: `'ALLOWED'`)
* `DENIED` (value: `'DENIED'`)

View File

@@ -0,0 +1,12 @@
# PermissionsInfo
**Properties**
| Name | Type |
|----------------------|---------------------------------------------|
| isInheritanceEnabled | boolean |
| inherited | [PermissionElement[]](PermissionElement.md) |
| locallySet | [PermissionElement[]](PermissionElement.md) |
| settable | string[] |

View File

@@ -0,0 +1,39 @@
# Person
**Properties**
| Name | Type |
|---------------------------|-------------------------------|
| **id** | string |
| **firstName** | string |
| lastName | string |
| displayName | string |
| description | string |
| avatarId | string |
| **email** | string |
| skypeId | string |
| googleId | string |
| instantMessageId | string |
| jobTitle | string |
| location | string |
| company | [Company](Company.md) |
| mobile | string |
| telephone | string |
| statusUpdatedAt | Date |
| userStatus | string |
| **enabled** | boolean |
| emailNotificationsEnabled | boolean |
| aspectNames | string[] |
| properties | Map<string, string> |
| capabilities | [Capabilities](#Capabilities) |
## Capabilities
**Properties**
| Name | Type |
|-----------|---------|
| isAdmin | boolean |
| isGuest | boolean |
| isMutable | boolean |

View File

@@ -0,0 +1,9 @@
# PersonEntry
**Properties**
| Name | Type |
|-----------|---------------------|
| **entry** | [Person](Person.md) |

View File

@@ -0,0 +1,18 @@
# PersonPaging
**Properties**
| Name | Type |
|------|---------------------------------------|
| list | [PersonPagingList](#PersonPagingList) |
# PersonPagingList
**Properties**
| Name | Type |
|------------|---------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [PersonEntry[]](PersonEntry.md) |

View File

@@ -0,0 +1,108 @@
# PreferencesApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-------------------------------------|---------------------------------------------------------|------------------|
| [getPreference](#getPreference) | **GET** /people/{personId}/preferences/{preferenceName} | Get a preference |
| [listPreferences](#listPreferences) | **GET** /people/{personId}/preferences | List preferences |
## getPreference
Get a preference
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
### Parameters
| Name | Type | Description |
|--------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **personId** | string | The identifier of a person. |
| **preferenceName** | string | The name of the preference. |
| opts.fields | string | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [PreferenceEntry](#PreferenceEntry)
**Example**
```javascript
import { AlfrescoApi, PreferencesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const preferencesApi = new PreferencesApi(alfrescoApi);
const opts = {};
preferencesApi.getPreference(`<personId>`, `<preferenceName>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listPreferences
Gets a list of preferences for person.
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
Note that each preference consists of an **id** and a **value**.
The **value** can be of any JSON type.
### Parameters
| Name | Type | Description | Notes |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| **personId** | string | The identifier of a person. | |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [PreferencePaging](#PreferencePaging)
**Example**
```javascript
import { AlfrescoApi, PreferencesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const preferencesApi = new PreferencesApi(alfrescoApi);
const opts = {};
preferencesApi.listPreferences(`<personId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## PreferencePaging
**Properties**
| Name | Type |
|------|-----------------------------------------------|
| list | [PreferencePagingList](#PreferencePagingList) |
## PreferencePagingList
**Properties**
| Name | Type |
|----------------|---------------------------------------|
| **pagination** | [Pagination](Pagination.md) |
| **entries** | [PreferenceEntry[]](#PreferenceEntry) |
## PreferenceEntry
**Properties**
| Name | Type |
|-----------|---------------------------|
| **entry** | [Preference](#Preference) |
# Preference
**Properties**
| Name | Type | Description |
|--------|--------|----------------------------------------------------------------------|
| **id** | string | The unique id of the preference |
| value | string | The value of the preference. Note that this can be of any JSON type. |

View File

@@ -0,0 +1,61 @@
# ProbesApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-----------------------|---------------------------|------------------------------------------------|
| [getProbe](#getProbe) | **GET** /probes/{probeId} | Check readiness and liveness of the repository |
## getProbe
Check readiness and liveness of the repository
> No authentication is required to call this endpoint.
> This endpoint is available in **Alfresco 6.0** and newer versions.
Returns a status of `200` to indicate success and `503` for failure.
The readiness probe is normally only used to check repository startup.
The liveness probe should then be used to check the repository is still responding to requests.
**Parameters**
| Name | Type | Description |
|-------------|--------|--------------------------------------------|
| **probeId** | string | The name of the probe: `-ready-`, `-live-` |
**Return type**: [ProbeEntry](#ProbeEntry)
**Example**
```javascript
import { AlfrescoApi, ProbesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const probesApi = new ProbesApi(alfrescoApi);
probesApi.getProbe(`<probeId>`).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## ProbeEntry
**Properties**
| Name | Type |
|-------|-------------------------------------|
| entry | [ProbeEntryEntry](#ProbeEntryEntry) |
## ProbeEntryEntry
**Properties**
| Name | Type |
|-------------|--------|
| **message** | string |

View File

@@ -0,0 +1,31 @@
# Property
**Properties**
| Name | Type | Description |
|---------------------|-----------------------------|------------------------------------------------------------|
| **id** | string | |
| title | string | the human-readable title |
| description | string | the human-readable description |
| defaultValue | string | the default value |
| dataType | string | the name of the property type (i.g. d:text) |
| isMultiValued | boolean | define if the property is multi-valued |
| isMandatory | boolean | define if the property is mandatory |
| isMandatoryEnforced | boolean | define if the presence of mandatory properties is enforced |
| isProtected | boolean | define if the property is system maintained |
| constraints | [Constraint[]](#Constraint) | list of constraints defined for the property |
## Constraint
**Properties**
| Name | Type | Description |
|-------------|------------------|-------------------------------------------|
| **id** | string | |
| type | string | the type of the constraint |
| title | string | the human-readable constraint title |
| description | string | the human-readable constraint description |
| parameters | Map<string, any> | |

View File

@@ -0,0 +1,182 @@
# QueriesApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|---------------------------|-------------------------|-------------|
| [findNodes](#findNodes) | **GET** /queries/nodes | Find nodes |
| [findPeople](#findPeople) | **GET** /queries/people | Find people |
| [findSites](#findSites) | **GET** /queries/sites | Find sites |
## findNodes
Find nodes
> this endpoint is available in **Alfresco 5.2** and newer versions.
Gets a list of nodes that match the given search criteria.
The search term is used to look for nodes that match against name, title, description, full text content or tags.
The search term:
- must contain a minimum of 3 alphanumeric characters
- allows "quoted term"
- can optionally use `*` for wildcard matching
By default, file and folder types will be searched unless a specific type is provided as a query parameter.
By default, the search will be across the repository unless a specific root node id is provided to start the search from.
You can sort the result list using the **orderBy** parameter. You can specify one or more of the following fields in the **orderBy** parameter:
* name
* modifiedAt
* createdAt
**Parameters**
| Name | Type | Description |
|-----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **term** | string | The term to search for. |
| opts.rootNodeId | string | The id of the node to start the search from. Supports the aliases `-my-`, `-root-` and `-shared-`. |
| opts.skipCount | number | Default: 0. The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. |
| opts.maxItems | number | Default: 100. The maximum number of items to return in the list. If not supplied then the default value is 100. |
| opts.nodeType | string | Restrict the returned results to only those of the given node type and its sub-types |
| opts.include | string[] | Returns additional information about the node. The following optional fields can be requested: `allowableOperations`, `aspectNames`, `isLink`, `isFavorite`, `isLocked`, `path`, `properties` |
| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [NodePaging](#NodePaging)
**Example**
```javascript
import { AlfrescoApi, QueriesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const queriesApi = new QueriesApi(alfrescoApi);
const opts = {};
queriesApi.findNodes(`<term>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## findPeople
Find people
> this endpoint is available in **Alfresco 5.2** and newer versions.
Gets a list of people that match the given search criteria.
The search term is used to look for matches against person id, firstname and lastname.
The search term:
- must contain a minimum of 2 alphanumeric characters
- can optionally use '*' for wildcard matching within the term
You can sort the result list using the **orderBy** parameter. You can specify one or more of the following fields in the **orderBy** parameter:
* id
* firstName
* lastName
**Parameters**
| Name | Type | Description |
|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **term** | string | The term to search for. |
| opts.skipCount | number | Default 0. The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. |
| opts.maxItems | number | Default 100. The maximum number of items to return in the list. If not supplied then the default value is 100. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. |
**Return type**: [PersonPaging](PersonPaging.md)
**Example**
```javascript
import { AlfrescoApi, QueriesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const queriesApi = new QueriesApi(alfrescoApi);
const opts = {};
queriesApi.findPeople(`<term>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## findSites
Find sites
> this endpoint is available in **Alfresco 5.2** and newer versions.
Gets a list of sites that match the given search criteria.
The search term is used to look for sites that match against site id, title or description.
The search term:
- must contain a minimum of 2 alphanumeric characters
- can optionally use '*' for wildcard matching within the term
The default sort order for the returned list is for sites to be sorted by ascending id.
You can override the default by using the **orderBy** parameter. You can specify one or more of the following fields in the **orderBy** parameter:
* id
* title
* description
**Parameters**
| Name | Type | Description |
|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **term** | string | The term to search for. |
| opts.skipCount | number | Default 0. The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. |
| opts.maxItems | number | Default 100. The maximum number of items to return in the list. If not supplied then the default value is 100. |
| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [SitePaging](SitePaging.md)
**Example**
```javascript
import { AlfrescoApi, QueriesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const queriesApi = new QueriesApi(alfrescoApi);
const opts = {};
queriesApi.findSites(`<term>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## NodePaging
**Properties**
| Name | Type |
|------|-----------------------------------|
| list | [NodePagingList](#NodePagingList) |
## NodePagingList
**Properties**
| Name | Type |
|------------|-----------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [NodeEntry[]](NodeEntry.md) |
| source | [Node](Node.md) |

View File

@@ -0,0 +1,181 @@
# RatingsApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-------------------------------|-----------------------------------------------|-----------------|
| [createRating](#createRating) | **POST** /nodes/{nodeId}/ratings | Create a rating |
| [deleteRating](#deleteRating) | **DELETE** /nodes/{nodeId}/ratings/{ratingId} | Delete a rating |
| [getRating](#getRating) | **GET** /nodes/{nodeId}/ratings/{ratingId} | Get a rating |
| [listRatings](#listRatings) | **GET** /nodes/{nodeId}/ratings | List ratings |
## createRating
Create a rating
**Parameters**
| Name | Type | Description |
|----------------------|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **ratingBodyCreate** | [RatingBody](#RatingBody) | For "myRating" the type is specific to the rating scheme, boolean for the likes and an integer for the fiveStar. For example, to "like" a file the following body would be used: `{ "id": "likes", "myRating": true }` |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [RatingEntry](#RatingEntry)
**Example**
```javascript
import { AlfrescoApi, RatingsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const ratingsApi = new RatingsApi(alfrescoApi);
const ratingBodyCreate = {};
const opts = {};
ratingsApi.createRating(`<nodeId>`, ratingBodyCreate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## deleteRating
Delete a rating
**Parameters**
| Name | Type | Description | Notes |
|--------------|--------|-----------------------------|-------|
| **nodeId** | string | The identifier of a node. | |
| **ratingId** | string | The identifier of a rating. | |
**Example**
```javascript
import { AlfrescoApi, RatingsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const ratingsApi = new RatingsApi(alfrescoApi);
ratingsApi.deleteRating(`<nodeId>`, `<ratingId>`).then(() => {
console.log('API called successfully.');
});
```
## getRating
Get a rating
**Parameters**
| Name | Type | Description |
|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **ratingId** | string | The identifier of a rating. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [RatingEntry](#RatingEntry)
**Example**
```javascript
import { AlfrescoApi, RatingsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const ratingsApi = new RatingsApi(alfrescoApi);
const opts = {};
ratingsApi.getRating(`<nodeId>`, `<ratingId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listRatings
List ratings
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| **nodeId** | string | The identifier of a node. | |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [RatingPaging](#RatingPaging)
**Example**
```javascript
import { AlfrescoApi, RatingsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const ratingsApi = new RatingsApi(alfrescoApi);
const opts = {};
ratingsApi.listRatings(`<nodeId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## RatingPaging
**Properties**
| Name | Type |
|------|---------------------------------------|
| list | [RatingPagingList](#RatingPagingList) |
## RatingPagingList
**Properties**
| Name | Type |
|----------------|-------------------------------|
| **pagination** | [Pagination](Pagination.md) |
| **entries** | [RatingEntry[]](#RatingEntry) |
## RatingEntry
**Properties**
| Name | Type |
|-----------|-------------------|
| **entry** | [Rating](#Rating) |
## Rating
**Properties**
| Name | Type | Description |
|-----------|-------------------------------------|---------------------------------------------------------------------------------------------------------------|
| **id** | string | |
| aggregate | [RatingAggregate](#RatingAggregate) | |
| ratedAt | Date | |
| myRating | string | The rating. The type is specific to the rating scheme, boolean for the likes and an integer for the fiveStar. |
## RatingAggregate
**Properties**
| Name | Type |
|---------------------|--------|
| **numberOfRatings** | number |
| average | number |
## RatingBody
**Properties**
| Name | Type | Description |
|--------------|--------|--------------------------------------------------------------------------------------------------------------|
| **id** | string | The rating scheme type. Possible values are likes and fiveStar. |
| **myRating** | string | The rating. The type is specific to the rating scheme, boolean for the likes and an integer for the fiveStar |
### RatingBody.IdEnum
* `Likes` (value: `'likes'`)
* `FiveStar` (value: `'fiveStar'`)

View File

@@ -0,0 +1,21 @@
# Rendition
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **string** | | [optional] [default to null]
**content** | [**ContentInfo**](ContentInfo.md) | | [optional] [default to null]
**status** | **string** | | [optional] [default to null]
<a name="Rendition.StatusEnum"></a>
## Enum: Rendition.StatusEnum
* `CREATED` (value: `'CREATED'`)
* `NOTCREATED` (value: `'NOT_CREATED'`)

View File

@@ -0,0 +1,9 @@
# RenditionBodyCreate
**Properties**
| Name | Type |
|--------|--------|
| **id** | string |

View File

@@ -0,0 +1,9 @@
# RenditionEntry
**Properties**
| Name | Type |
|-----------|---------------------------|
| **entry** | [Rendition](Rendition.md) |

View File

@@ -0,0 +1,18 @@
# RenditionPaging
**Properties**
| Name | Type |
|------|---------------------------------------------|
| list | [RenditionPagingList](#RenditionPagingList) |
# RenditionPagingList
**Properties**
| Name | Type |
|------------|---------------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [RenditionEntry[]](RenditionEntry.md) |

View File

@@ -0,0 +1,192 @@
# RenditionsApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|---------------------------------------------------|-----------------------------------------------------------------------------|----------------------------------------------------------------------|
| [createRendition](#createRendition) | **POST** /nodes/{nodeId}/renditions | Create rendition |
| [getRendition](#getRendition) | **GET** /nodes/{nodeId}/renditions/{renditionId} | Get rendition information |
| [getRenditionContent](#getRenditionContent) | **GET** /nodes/{nodeId}/renditions/{renditionId}/content | Get rendition content |
| [listRenditions](#listRenditions) | **GET** /nodes/{nodeId}/renditions | List renditions |
| [requestDirectAccessUrl](#requestDirectAccessUrl) | **POST** /nodes/{nodeId}/renditions/{renditionId}/request-direct-access-url | Generate a direct access content url for a given rendition of a node |
## createRendition
Create rendition
> this endpoint is available in **Alfresco 5.2** and newer versions.
An asynchronous request to create a rendition for file **nodeId**.
The rendition is specified by name **id** in the request body:
```json
{
"id": "doclib"
}
```
Multiple names may be specified as a comma separated list or using a list format:
```json
[
{
"id": "doclib"
},
{
"id": "avatar"
}
]
```
**Parameters**
| Name | Type | Description |
|-------------------------|-----------------------------------------------|---------------------------|
| **nodeId** | string | The identifier of a node. |
| **renditionBodyCreate** | [RenditionBodyCreate](RenditionBodyCreate.md) | The rendition "id". |
**Example**
```javascript
import { AlfrescoApi, RenditionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const renditionsApi = new RenditionsApi(alfrescoApi);
const renditionBodyCreate = {};
renditionsApi.createRendition(`<nodeId>`, renditionBodyCreate).then(() => {
console.log('API called successfully.');
});
```
## getRendition
Get rendition information
> **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
**Parameters**
| Name | Type | Description |
|-----------------|--------|--------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **renditionId** | string | The name of a thumbnail rendition, for example *doclib*, or *pdf*. |
**Return type**: [RenditionEntry](RenditionEntry.md)
**Example**
```javascript
import { AlfrescoApi, RenditionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const renditionsApi = new RenditionsApi(alfrescoApi);
renditionsApi.getRendition(`<nodeId>`, `<renditionId>`).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getRenditionContent
Get rendition content
> this endpoint is available in **Alfresco 5.2** and newer versions.
**Parameters**
| Name | Type | Description |
|----------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **renditionId** | string | The name of a thumbnail rendition, for example *doclib*, or *pdf*. |
| opts.attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. |
| opts.ifModifiedSince | Date | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, `Wed, 09 Mar 2016 16:56:34 GMT`. |
| opts.range | string | Default: true. The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. |
| opts.placeholder | boolean | Default: false. If **true** and there is no rendition for this **nodeId** and **renditionId**, then the placeholder image for the mime type of this rendition is returned, rather than a 404 response. |
**Return type**: Blob
**Example**
```javascript
import { AlfrescoApi, RenditionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const renditionsApi = new RenditionsApi(alfrescoApi);
const opts = {};
renditionsApi.getRenditionContent(`<nodeId>`, `<renditionId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listRenditions
List renditions
**Note:** this endpoint is available in Alfresco 5.2 and newer versions.
Gets a list of the rendition information for each rendition of the file **nodeId**, including the rendition id.
Each rendition returned has a **status**: `CREATED` means it is available to view or download, `NOT_CREATED` means the rendition can be requested.
You can use the **where** parameter to filter the returned renditions by **status**. For example, the following **where**
clause will return just the `CREATED` renditions:
```text
(status='CREATED')
```
**Parameters**
| Name | Type | Description |
|------------|--------|-----------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| where | string | A string to restrict the returned objects by using a predicate. |
**Return type**: [RenditionPaging](RenditionPaging.md)
**Example**
```javascript
import { AlfrescoApi, RenditionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const renditionsApi = new RenditionsApi(alfrescoApi);
renditionsApi.listRenditions(`<nodeId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## requestDirectAccessUrl
Generate a direct access content url for a given rendition of a node
> this endpoint is available in **Alfresco 7.1** and newer versions.
**Parameters**
| Name | Type | Description |
|-----------------|--------|--------------------------------|
| **nodeId** | string | The identifier of a node. |
| **renditionId** | string | The identifier of a rendition. |
**Return type**: [DirectAccessUrlEntry](DirectAccessUrlEntry.md)
**Example**
```javascript
import { AlfrescoApi, RenditionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const renditionsApi = new RenditionsApi(alfrescoApi);
const nodeId = 'da2e6953-3850-408b-8284-3534dd777417';
const renditionId = 'avatar';
renditionsApi.requestDirectAccessUrl(nodeId, renditionId).then((data) => {
console.log('URL generated successfully: ', data.contentUrl);
});
```

View File

@@ -0,0 +1,457 @@
# SharedlinksApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-----------------------------------------------------------------|-------------------------------------------------------------------|---------------------------------------|
| [createSharedLink](#createSharedLink) | **POST** /shared-links | Create a shared link to a file |
| [deleteSharedLink](#deleteSharedLink) | **DELETE** /shared-links/{sharedId} | Deletes a shared link |
| [emailSharedLink](#emailSharedLink) | **POST** /shared-links/{sharedId}/email | Email shared link |
| [getSharedLink](#getSharedLink) | **GET** /shared-links/{sharedId} | Get a shared link |
| [getSharedLinkContent](#getSharedLinkContent) | **GET** /shared-links/{sharedId}/content | Get shared link content |
| [getSharedLinkRendition](#getSharedLinkRendition) | **GET** /shared-links/{sharedId}/renditions/{renditionId} | Get shared link rendition information |
| [getSharedLinkRenditionContent](#getSharedLinkRenditionContent) | **GET** /shared-links/{sharedId}/renditions/{renditionId}/content | Get shared link rendition content |
| [listSharedLinkRenditions](#listSharedLinkRenditions) | **GET** /shared-links/{sharedId}/renditions | List renditions for a shared link |
| [listSharedLinks](#listSharedLinks) | **GET** /shared-links | List shared links |
## createSharedLink
Create a shared link to a file
> this endpoint is available in **Alfresco 5.2** and newer versions.
Create a shared link to the file **nodeId** in the request body. Also, an optional expiry date could be set,
so the shared link would become invalid when the expiry date is reached. For example:
```json
{
"nodeId": "1ff9da1a-ee2f-4b9c-8c34-3333333333",
"expiresAt": "2017-03-23T23:00:00.000+0000"
}
```
**Note:** You can create shared links to more than one file
specifying a list of **nodeId**s in the JSON body like this:
```json
[
{
"nodeId": "1ff9da1a-ee2f-4b9c-8c34-4444444444"
},
{
"nodeId": "1ff9da1a-ee2f-4b9c-8c34-5555555555"
}
]
```
If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example:
```json
{
"list": {
"pagination": {
"count": 2,
"hasMoreItems": false,
"totalItems": 2,
"skipCount": 0,
"maxItems": 100
},
"entries": [
{
"entry": {
}
},
{
"entry": {
}
}
]
}
}
```
**Parameters**
| Name | Type | Description |
|--------------------------|-----------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **sharedLinkBodyCreate** | [SharedLinkBodyCreate](#SharedLinkBodyCreate) | The nodeId to create a shared link for. |
| opts.include | string[] | Returns additional information about the shared link, the following optional fields can be requested: `allowableOperations`, `path`, `properties`, `isFavorite`, `aspectNames` |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [SharedLinkEntry](#SharedLinkEntry)
**Example**
```javascript
import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const sharedlinksApi = new SharedlinksApi(alfrescoApi);
const sharedLinkBodyCreate = {};
const opts = {};
sharedlinksApi.createSharedLink(sharedLinkBodyCreate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## deleteSharedLink
Deletes a shared link
> this endpoint is available in Alfresco 5.2 and newer versions.
**Parameters**
| Name | Type | Description |
|--------------|--------|--------------------------------------------|
| **sharedId** | string | The identifier of a shared link to a file. |
**Example**
```javascript
import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const sharedlinksApi = new SharedlinksApi(alfrescoApi);
sharedlinksApi.deleteSharedLink(`<sharedId>`).then(() => {
console.log('API called successfully.');
});
```
## emailSharedLink
Email shared link
> this endpoint is available in **Alfresco 5.2** and newer versions.
Sends email with app-specific url including identifier **sharedId**.
The client and recipientEmails properties are mandatory in the request body. For example, to email a shared link with minimum info:
```json
{
"client": "myClient",
"recipientEmails": ["john.doe@acme.com", "joe.bloggs@acme.com"]
}
```
A plain text message property can be optionally provided in the request body to customise the email being sent.
Also, a locale property can be optionally provided in the request body to send the emails in a particular language (if the locale is supported by Alfresco).
For example, to email a shared link with a messages and a locale:
```json
{
"client": "myClient",
"recipientEmails": ["john.doe@acme.com", "joe.bloggs@acme.com"],
"message": "myMessage",
"locale":"en-GB"
}
```
>The client must be registered before you can send a shared link email. See [server documentation]. However, out-of-the-box
share is registered as a default client, so you could pass **share** as the client name:
```json
{
"client": "share",
"recipientEmails": ["john.doe@acme.com"]
}
```
**Parameters**
| Name | Type | Description |
|-------------------------|---------------------------------------------|--------------------------------------------|
| **sharedId** | string | The identifier of a shared link to a file. |
| **sharedLinkBodyEmail** | [SharedLinkBodyEmail](#SharedLinkBodyEmail) | The shared link email to send. |
**Example**
```javascript
import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const sharedlinksApi = new SharedlinksApi(alfrescoApi);
const sharedLinkBodyEmail = {};
sharedlinksApi.emailSharedLink(`<sharedId>`, sharedLinkBodyEmail).then(() => {
console.log('API called successfully.');
});
```
## getSharedLink
Get a shared link
> this endpoint is available in **Alfresco 5.2** and newer versions.
> No authentication is required to call this endpoint.
Gets minimal information for the file with shared link identifier **sharedId**.
**Parameters**
| Name | Type | Description |
|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **sharedId** | string | The identifier of a shared link to a file. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [SharedLinkEntry](#SharedLinkEntry)
**Example**
```javascript
import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const sharedlinksApi = new SharedlinksApi(alfrescoApi);
const opts = {};
sharedlinksApi.getSharedLink(`<sharedId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getSharedLinkContent
Get shared link content
> this endpoint is available in **Alfresco 5.2** and newer versions.
> No authentication is required to call this endpoint.
Gets the content of the file with shared link identifier **sharedId**.
**Parameters**
| Name | Type | Description |
|----------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **sharedId** | string | The identifier of a shared link to a file. |
| opts.attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. |
| opts.ifModifiedSince | Date | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. |
| opts.range | string | The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. |
**Return type**: Blob
**Example**
```javascript
import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const sharedlinksApi = new SharedlinksApi(alfrescoApi);
const opts = {};
sharedlinksApi.getSharedLinkContent(`<sharedId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getSharedLinkRendition
Get shared link rendition information
> this endpoint is available in **Alfresco 5.2** and newer versions.
> No authentication is required to call this endpoint.
Gets rendition information for the file with shared link identifier **sharedId**.
This API method returns rendition information where the rendition status is CREATED,
which means the rendition is available to view/download.
**Parameters**
| Name | Type | Description |
|-----------------|--------|--------------------------------------------------------------------|
| **sharedId** | string | The identifier of a shared link to a file. |
| **renditionId** | string | The name of a thumbnail rendition, for example `doclib`, or `pdf`. |
**Return type**: [RenditionEntry](RenditionEntry.md)
**Example**
```javascript
import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const sharedlinksApi = new SharedlinksApi(alfrescoApi);
sharedlinksApi.getSharedLinkRendition(`<sharedId>`, `<renditionId>`).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getSharedLinkRenditionContent
Get shared link rendition content
> this endpoint is available in **Alfresco 5.2** and newer versions.
> No authentication is required to call this endpoint.
Gets the rendition content for file with shared link identifier **sharedId**.
**Parameters**
| Name | Type | Description |
|----------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **sharedId** | string | The identifier of a shared link to a file. |
| **renditionId** | string | The name of a thumbnail rendition, for example *doclib*, or *pdf*. |
| opts.attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. |
| opts.ifModifiedSince | Date | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. |
| opts.range | string | The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. |
**Return type**: Blob
**Example**
```javascript
import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const sharedlinksApi = new SharedlinksApi(alfrescoApi);
const opts = {};
sharedlinksApi.getSharedLinkRenditionContent(`<sharedId>`, `<renditionId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listSharedLinkRenditions
List renditions for a shared link
> this endpoint is available in **Alfresco 5.2** and newer versions.
> No authentication is required to call this endpoint.
Gets a list of the rendition information for the file with shared link identifier **sharedId**.
This API method returns rendition information, including the rendition id, for each rendition
where the rendition status is `CREATED`, which means the rendition is available to view/download.
**Parameters**
| Name | Type | Description |
|--------------|--------|--------------------------------------------|
| **sharedId** | string | The identifier of a shared link to a file. |
**Return type**: [RenditionPaging](RenditionPaging.md)
**Example**
```javascript
import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const sharedlinksApi = new SharedlinksApi(alfrescoApi);
sharedlinksApi.listSharedLinkRenditions(`<sharedId>`).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listSharedLinks
List shared links
> this endpoint is available in Alfresco 5.2 and newer versions.
Get a list of links that the current user has read permission on source node.
The list is ordered in descending modified order.
> The list of links is eventually consistent so newly created shared links may not appear immediately.
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.where | string | Optionally filter the list by "sharedByUser" userid of person who shared the link (can also use -me-)`where=(sharedByUser='jbloggs')`, `where=(sharedByUser='-me-')` | |
| opts.include | string[] | Returns additional information about the shared link, the following optional fields can be requested: `allowableOperations`, `path`, `properties`, `isFavorite`, `aspectNames` | |
| opts.fields | string[] | A list of field names.You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [SharedLinkPaging](#SharedLinkPaging)
**Example**
```javascript
import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const sharedlinksApi = new SharedlinksApi(alfrescoApi);
const opts = {};
sharedlinksApi.listSharedLinks(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## SharedLinkPaging
**Properties**
| Name | Type |
|------|-----------------------------------------------|
| list | [SharedLinkPagingList](#SharedLinkPagingList) |
## SharedLinkPagingList
**Properties**
| Name | Type |
|----------------|---------------------------------------|
| **pagination** | [Pagination](Pagination.md) |
| **entries** | [SharedLinkEntry[]](#SharedLinkEntry) |
## SharedLinkEntry
**Properties**
| Name | Type |
|-----------|---------------------------|
| **entry** | [SharedLink](#SharedLink) |
## SharedLinkBodyEmail
**Properties**
| Name | Type |
|-----------------|----------|
| client | string |
| message | string |
| locale | string |
| recipientEmails | string[] |
## SharedLinkBodyCreate
**Properties**
| Name | Type |
|------------|--------|
| **nodeId** | string |
| expiresAt | Date |
## SharedLink
**Properties**
| Name | Type | Description |
|-----------------------------|-------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
| id | string | |
| expiresAt | Date | |
| nodeId | string | |
| name | string | The name must not contain spaces or the following special characters: `* " < > \\ / ? :` and `\|`. The character . must not be used at the end of the name. |
| title | string | |
| description | string | |
| modifiedAt | Date | |
| modifiedByUser | [UserInfo](UserInfo.md) | |
| sharedByUser | [UserInfo](UserInfo.md) | |
| content | [ContentInfo](ContentInfo.md) | |
| allowableOperations | string[] | The allowable operations for the Quickshare link itself. See allowableOperationsOnTarget for the allowable operations pertaining to the linked content node. |
| allowableOperationsOnTarget | string[] | The allowable operations for the content node being shared. |
| isFavorite | boolean | |
| properties | any | A subset of the target node's properties, system properties and properties already available in the SharedLink are excluded. |
| aspectNames | string[] | |

View File

@@ -0,0 +1,42 @@
# Site
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **string** | | [default to null]
**guid** | **string** | | [default to null]
**title** | **string** | | [default to null]
**description** | **string** | | [optional] [default to null]
**visibility** | **string** | | [default to null]
**preset** | **string** | | [optional] [default to null]
**role** | **string** | | [optional] [default to null]
<a name="Site.VisibilityEnum"></a>
## Enum: Site.VisibilityEnum
* `PRIVATE` (value: `'PRIVATE'`)
* `MODERATED` (value: `'MODERATED'`)
* `PUBLIC` (value: `'PUBLIC'`)
<a name="Site.RoleEnum"></a>
## Enum: Site.RoleEnum
* `SiteConsumer` (value: `'SiteConsumer'`)
* `SiteCollaborator` (value: `'SiteCollaborator'`)
* `SiteContributor` (value: `'SiteContributor'`)
* `SiteManager` (value: `'SiteManager'`)

View File

@@ -0,0 +1,7 @@
# SiteEntry
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **entry** | [**Site**](Site.md) | | [default to null] |
| **relations** | [**SiteEntryRelations**]() | | [default to undefined] |

View File

@@ -0,0 +1,7 @@
# SiteEntryRelations
**Properties**
| Name | Type |
|----------------|-----------------------------|
| **members** | [SiteMemberPaging](SiteMemberPaging.md) |

View File

@@ -0,0 +1,18 @@
# SitePaging
**Properties**
| Name | Type |
|------|-----------------------------------|
| list | [SitePagingList](#SitePagingList) |
# SitePagingList
**Properties**
| Name | Type |
|----------------|-----------------------------|
| **pagination** | [Pagination](Pagination.md) |
| **entries** | [SiteEntry[]](SiteEntry.md) |

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,361 @@
# TagsApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-----------------------------------------|-----------------------------------------|---------------------------------------------------------------------------------------------------------------------------|
| [createTagForNode](#createTagForNode) | **POST** /nodes/{nodeId}/tags | Create a tag for a node |
| [deleteTagFromNode](#deleteTagFromNode) | **DELETE** /nodes/{nodeId}/tags/{tagId} | Delete a tag from a node |
| [getTag](#getTag) | **GET** /tags/{tagId} | Get a tag |
| [listTags](#listTags) | **GET** /tags | List tags |
| [listTagsForNode](#listTagsForNode) | **GET** /nodes/{nodeId}/tags | List tags for a node |
| [updateTag](#updateTag) | **PUT** /tags/{tagId} | Update a tag |
| [deleteTag](#deleteTag) | **DELETE** /tags/{tagId} | Completely deletes a tag |
| [createTags](#createTags) | **POST** /tags | Create list of tags |
| [assignTagsToNode](#assignTagsToNode) | **POST** /nodes/{nodeId}/tags | Assign tags to node. If tag is new then tag is also created additionally, if tag already exists then it is just assigned. |
## createTagForNode
Creates a tag on the node **nodeId**. You specify the tag in a JSON body like this:
```json
{
"tag":"test-tag-1"
}
```
**Note:** You can create more than one tag by
specifying a list of tags in the JSON body like this:
```json
[
{
"tag": "test-tag-1"
},
{
"tag": "test-tag-2"
}
]
```
If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example:
```json
{
"list": {
"pagination": {
"count": 2,
"hasMoreItems": false,
"totalItems": 2,
"skipCount": 0,
"maxItems": 100
},
"entries": [
{
"entry": {
}
},
{
"entry": {
}
}
]
}
}
```
**Example**
```javascript
import { AlfrescoApi, TagsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const tagsApi = new TagsApi(alfrescoApi);
const tagBodyCreate = {};
const opts = {};
tagsApi.createTagForNode(nodeId, tagBodyCreate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
**Parameters**
| Name | Type | Description |
|-------------------|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **tagBodyCreate** | [TagBody](#TagBody) | The new tag |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [TagEntry](#TagEntry)
## deleteTagFromNode
Delete a tag from a node
**Parameters**
| Name | Type | Description |
|------------|--------|---------------------------|
| **nodeId** | string | The identifier of a node. |
| **tagId** | string | The identifier of a tag. |
**Example**
```javascript
import { AlfrescoApi, TagsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const tagsApi = new TagsApi(alfrescoApi);
tagsApi.deleteTagFromNode(`<nodeId>`, `<tagId>`).then(() => {
console.log('API called successfully.');
});
```
## getTag
Get a tag
**Parameters**
| Name | Type | Description |
|-------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **tagId** | string | The identifier of a tag. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [TagEntry](#TagEntry)
**Example**
```javascript
import { AlfrescoApi, TagsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const tagsApi = new TagsApi(alfrescoApi);
const opts = {};
tagsApi.getTag(`<tagId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listTags
Gets a list of tags in this repository.
You can use the **include** parameter to return additional **values** information.
You can also use **name** parameter to return tags only for specified name.
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
| opts.include | string[] | Returns additional information about the tag. The following optional fields can be requested: `count` | |
**Return type**: [TagPaging](#TagPaging)
**Example**
```javascript
import { AlfrescoApi, TagsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const tagsApi = new TagsApi(alfrescoApi);
const opts = {};
tagsApi.listTags(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listTagsForNode
List tags for a node
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| **nodeId** | string | The identifier of a node. | |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [TagPaging](#TagPaging)
**Example**
```javascript
import { AlfrescoApi, TagsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const tagsApi = new TagsApi(alfrescoApi);
const opts = {};
tagsApi.listTagsForNode(`<nodeId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## updateTag
Update a tag
**Parameters**
| Name | Type | Description |
|-------------------|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **tagId** | string | The identifier of a tag. |
| **tagBodyUpdate** | [TagBody](#TagBody) | The updated tag |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [TagEntry](#TagEntry)
**Example**
```javascript
import { AlfrescoApi, TagsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const tagsApi = new TagsApi(alfrescoApi);
const tagBodyUpdate = {};
const opts = {};
tagsApi.updateTag(`<tagId>`, tagBodyUpdate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## createTags
Create specified by **tags** list of tags.
**Parameters**
| Name | Type | Description |
|----------|-----------------------|-------------------------|
| **tags** | [TagBody[]](#TagBody) | List of tags to create. |
**Return type**: [TagEntry[]](#TagEntry)
**Example**
```javascript
import { AlfrescoApi, TagsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const tagsApi = new TagsApi(alfrescoApi);
const tags = [];
tagsApi.createTags(tags).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## deleteTag
Deletes the tag with **tagId**. This will cause the tag to be removed from all nodes.
> You must have admin rights to delete a tag.
**Parameters**
| Name | Type | Description |
|-----------|--------|--------------------------|
| **tagId** | string | The identifier of a tag. |
**Example**
```javascript
import { AlfrescoApi, TagsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const tagsApi = new TagsApi(alfrescoApi);
tagsApi.deleteTag(`<tagId>`).then(() => {
console.log('API called successfully.');
});
```
## assignTagsToNode
Assign tags to node. If tag is new then tag is also created additionally, if tag already exists then it is just assigned.
**Parameters**
| Name | Type | Description | Notes |
|------------|-----------------------|-------------------------------------------------------------------------|-------|
| **nodeId** | string | Id of node to which tags should be assigned. |
| **tags** | [TagBody[]](#TagBody) | List of tags to create and assign or just assign if they already exist. |
**Return type**: [TagPaging](#TagPaging) | [TagEntry](#TagEntry)
**Example**
```javascript
import { AlfrescoApi, TagsApi, TagBody } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const tagsApi = new TagsApi(alfrescoApi);
const tag1 = new TagBody({ tag: 'tag-test-1' });
const tag2 = new TagBody({ tag: 'tag-test-2' });
tagsApi.assignTagsToNode('someNodeId', [tag1, tag2]).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## TagPaging
**Properties**
| Name | Type |
|------|---------------------------------|
| list | [TagPagingList](#TagPagingList) |
## TagPagingList
**Properties**
| Name | Type |
|----------------|-----------------------------|
| **pagination** | [Pagination](Pagination.md) |
| **entries** | [TagEntry[]](#TagEntry) |
## TagEntry
**Properties**
| Name | Type |
|-----------|-------------|
| **entry** | [Tag](#Tag) |
## TagBody
**Properties**
| Name | Type |
|---------|--------|
| **tag** | string |
## Tag
**Properties**
| Name | Type |
|---------|--------|
| **id** | string |
| **tag** | string |
| count | number |

View File

@@ -0,0 +1,403 @@
# TrashcanApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|---------------------------------------------------------------------|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| [deleteDeletedNode](#deleteDeletedNode) | **DELETE** /deleted-nodes/{nodeId} | Permanently delete a deleted node |
| [getArchivedNodeRendition](#getArchivedNodeRendition) | **GET** /deleted-nodes/{nodeId}/renditions/{renditionId} | Get rendition information for a deleted node |
| [getArchivedNodeRenditionContent](#getArchivedNodeRenditionContent) | **GET** /deleted-nodes/{nodeId}/renditions/{renditionId}/content | Get rendition content of a deleted node |
| [getDeletedNode](#getDeletedNode) | **GET** /deleted-nodes/{nodeId} | Get a deleted node |
| [getDeletedNodeContent](#getDeletedNodeContent) | **GET** /deleted-nodes/{nodeId}/content | Get deleted node content |
| [listDeletedNodeRenditions](#listDeletedNodeRenditions) | **GET** /deleted-nodes/{nodeId}/renditions | List renditions for a deleted node |
| [listDeletedNodes](#listDeletedNodes) | **GET** /deleted-nodes | List deleted nodes |
| [requestDirectAccessUrl](#requestDirectAccessUrl) | **POST** /deleted-nodes/{nodeId}/request-direct-access-url | Generate a direct access content url for a given deleted node |
| [requestRenditionDirectAccessUrl](#requestRenditionDirectAccessUrl) | **POST** /deleted-nodes/{nodeId}/renditions/{renditionId}/request-direct-access-url | Generate a direct access content url for a given rendition of a deleted node |
| [restoreDeletedNode](#restoreDeletedNode) | **POST** /deleted-nodes/{nodeId}/restore | Restore a deleted node |
## deleteDeletedNode
Permanently delete a deleted node
> this endpoint is available in **Alfresco 5.2** and newer versions.
**Parameters**
| Name | Type | Description |
|-------------|--------|--------------------------------------------------------------------|
| nodeId | string | The identifier of a node. |
**Example**
```javascript
import { AlfrescoApi, TrashcanApi} from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
trashcanApi.deleteDeletedNode(`<nodeId>`).then(() => {
console.log('API called successfully.');
});
```
## getArchivedNodeRendition
Get rendition information for a deleted node
> this endpoint is available in **Alfresco 5.2** and newer versions.
**Parameters**
| Name | Type | Description |
|-------------|--------|--------------------------------------------------------------------|
| nodeId | string | The identifier of a node. |
| renditionId | string | The name of a thumbnail rendition, for example *doclib*, or *pdf*. |
**Example**
```javascript
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
trashcanApi.getArchivedNodeRendition('node-id', 'rendition-id').then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
**Return type**: [RenditionEntry](RenditionEntry.md)
## getArchivedNodeRenditionContent
Get rendition content of a deleted node
> this endpoint is available in **Alfresco 5.2** and newer versions.
**Parameters**
| Name | Type | Description |
|-----------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| nodeId | string | The identifier of a node. |
| renditionId | string | The name of a thumbnail rendition, for example *doclib*, or *pdf*. |
| attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. |
| ifModifiedSince | boolean | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. |
| range | string | The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. |
| placeholder | boolean | If **true** and there is no rendition for this **nodeId** and **renditionId**, then the placeholder image for the mime type of this rendition is returned, rather than a 404 response. |
**Return type**: **Blob**
**Example**
```javascript
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
trashcanApi.getArchivedNodeRenditionContent('node-id', 'rendition-id').then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getDeletedNode
Get a deleted node
> this endpoint is available in **Alfresco 5.2** and newer versions.
**Parameters**
| Name | Type | Description |
|------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| include | string | Returns additional information about the node. The following optional fields can be requested: `allowableOperations`, `association`, `isLink`, `isFavorite`,`isLocked`, `path`, `permissions`, `definition` |
**Return type**: [DeletedNodeEntry](#DeletedNodeEntry)
**Example**
```javascript
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
trashcanApi.getDeletedNode('nodeId').then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getDeletedNodeContent
Get deleted node content
> this endpoint is available in **Alfresco 5.2** and newer versions.
**Parameters**
| Name | Type | Description |
|-----------------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. |
| ifModifiedSince | Date | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, `Wed, 09 Mar 2016 16:56:34 GMT`. |
| range | string | The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. |
**Return type**: Blob
**Example**
```javascript
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
trashcanApi.getDeletedNodeContent('nodeId').then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listDeletedNodeRenditions
List renditions for a deleted node
> this endpoint is available in **Alfresco 5.2** and newer versions.
Gets a list of the rendition information for each rendition of the file **nodeId**, including the rendition id.
Each rendition returned has a **status**: `CREATED` means it is available to view or download, `NOT_CREATED` means the rendition can be requested.
You can use the **where** parameter to filter the returned renditions by **status**. For example, the following **where**
clause will return just the `CREATED` renditions:
```text
(status='CREATED')
```
**Parameters**
| Name | Type | Description |
|------------|--------|-----------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| opts.where | string | A string to restrict the returned objects by using a predicate. |
**Return type**: [RenditionPaging](RenditionPaging.md)
**Example**
```javascript
import { AlfrescoApi, TrashcanApi} from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
trashcanApi.listDeletedNodeRenditions(`<nodeId>`).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listDeletedNodes
List deleted nodes
> this endpoint is available in **Alfresco 5.2** and newer versions.
Gets a list of deleted nodes for the current user.
If the current user is an administrator deleted nodes for all users will be returned.
The list of deleted nodes will be ordered with the most recently deleted node at the top of the list.
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.include | string[] | Returns additional information about the node. The following optional fields can be requested: `allowableOperations`, `aspectNames`, `association`, `isLink`, `isFavorite`, `isLocked`, `path`, `properties`, `permissions` | |
**Return type**: [DeletedNodesPaging](#DeletedNodesPaging)
**Example**
```javascript
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
const opts = {};
trashcanApi.listDeletedNodes(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## requestDirectAccessUrl
Generate a direct access content url for a given deleted node
> this endpoint is available in **Alfresco 7.1** and newer versions.
**Parameters**
| Name | Type | Description |
|------------|--------|---------------------------|
| **nodeId** | string | The identifier of a node. |
**Return type**: [DirectAccessUrlEntry](DirectAccessUrlEntry.md)
**Example**
```javascript
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
const nodeId = 'da2e6953-3850-408b-8284-3534dd777417';
trashcanApi.requestDirectAccessUrl(nodeId).then((data) => {
console.log('URL generated successfully: ', data.contentUrl);
});
```
## requestRenditionDirectAccessUrl
Generate a direct access content url for a given rendition of a deleted node
> this endpoint is available in **Alfresco 7.1** and newer versions.
**Parameters**
| Name | Type | Description |
|-----------------|--------|--------------------------------|
| **nodeId** | string | The identifier of a node. |
| **renditionId** | string | The identifier of a rendition. |
**Return type**: [**DirectAccessUrlEntry**](DirectAccessUrlEntry.md)
**Example**
```javascript
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
const nodeId = 'da2e6953-3850-408b-8284-3534dd777417';
const renditionId = 'avatar';
trashcanApi.requestRenditionDirectAccessUrl(nodeId, renditionId).then((data) => {
console.log('URL generated successfully: ', data.contentUrl);
});
```
## restoreDeletedNode
Restore a deleted node
> this endpoint is available in **Alfresco 5.2** and newer versions.
Attempts to restore the deleted node **nodeId** to its original location or to a new location.
If the node is successfully restored to its former primary parent, then only the
primary child association will be restored, including recursively for any primary
children. It should be noted that no other secondary child associations or peer
associations will be restored, for any of the nodes within the primary parent-child
hierarchy of restored nodes, irrespective of whether these associations were to
nodes within or outside the restored hierarchy.
Also, any previously shared link will not be restored since it is deleted at the time
of delete of each node.
**Parameters**
| Name | Type | Description |
|-----------------------------|---------------------------------------------------|---------------------------------------------------------------|
| nodeId | string | The identifier of a node. |
| opts.fields | string | A list of field names. |
| opts.deletedNodeBodyRestore | [DeletedNodeBodyRestore](#DeletedNodeBodyRestore) | The targetParentId if the node is restored to a new location. |
**Return type**: [NodeEntry](NodeEntry.md)
**Example**
```javascript
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
const nodeId = '<guid>';
trashcanApi.restoreDeletedNode(nodeId).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## DeletedNodesPaging
**Properties**
| Name | Type |
|------|-----------------------------------------------------|
| list | [DeletedNodesPagingList](DeletedNodesPagingList.md) |
## DeletedNodesPagingList
**Properties**
| Name | Type |
|------------|-----------------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [DeletedNodeEntry[]](#DeletedNodeEntry) |
## DeletedNodeEntry
**Properties**
| Name | Type |
|-----------|-----------------------------|
| **entry** | [DeletedNode](#DeletedNode) |
## DeletedNode
**Properties**
| Name | Type | Description |
|---------------------|---------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **id** | string | |
| **name** | string | The name must not contain spaces or the following special characters: `* \" < > \\ / ?` : and ` \| `. The character `.` must not be used at the end of the name. |
| **nodeType** | string | |
| **isFolder** | boolean | |
| **isFile** | boolean | |
| isLocked | boolean | |
| **modifiedAt** | Date | |
| **modifiedByUser** | [UserInfo](UserInfo.md) | |
| **createdAt** | Date | |
| **createdByUser** | [UserInfo](UserInfo.md) | |
| parentId | string | |
| isLink | boolean | |
| isFavorite | boolean | |
| content | [ContentInfo](ContentInfo.md) | |
| aspectNames | string[] | |
| properties | any | |
| allowableOperations | string[] | |
| path | [PathInfo](PathInfo.md) | |
| permissions | [PermissionsInfo](PermissionsInfo.md) | |
| definition | [Definition](Definition.md) | |
| **archivedByUser** | [UserInfo](UserInfo.md) | |
| **archivedAt** | Date | |
## DeletedNodeBodyRestore
**Properties**
| Name | Type |
|----------------|--------|
| targetParentId | string |
| assocType | string |

View File

@@ -0,0 +1,10 @@
# UserInfo
**Properties**
| Name | Type |
|-----------------|--------|
| **displayName** | string |
| **id** | string |

View File

@@ -0,0 +1,434 @@
# VersionsApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-----------------------------------------------------------|-------------------------------------------------------------------------------|--------------------------------------------------------------------|
| [createVersionRendition](#createVersionRendition) | **POST** /nodes/{nodeId}/versions/{versionId}/renditions | Create rendition for a file version |
| [deleteVersion](#deleteVersion) | **DELETE** /nodes/{nodeId}/versions/{versionId} | Delete a version |
| [getVersion](#getVersion) | **GET** /nodes/{nodeId}/versions/{versionId} | Get version information |
| [getVersionContent](#getVersionContent) | **GET** /nodes/{nodeId}/versions/{versionId}/content | Get version content |
| [getVersionRendition](#getVersionRendition) | **GET** /nodes/{nodeId}/versions/{versionId}/renditions/{renditionId} | Get rendition information for a file version |
| [getVersionRenditionContent](#getVersionRenditionContent) | **GET** /nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}/content | Get rendition content for a file version |
| [listVersionHistory](#listVersionHistory) | **GET** /nodes/{nodeId}/versions | List version history |
| [listVersionRenditions](#listVersionRenditions) | **GET** /nodes/{nodeId}/versions/{versionId}/renditions | List renditions for a file version |
| [requestDirectAccessUrl](#requestDirectAccessUrl) | **POST** /nodes/{nodeId}/versions/{versionId}/request-direct-access-url | Generate a direct access content url for a given version of a node |
| [revertVersion](#revertVersion) | **POST** /nodes/{nodeId}/versions/{versionId}/revert | Revert a version |
## createVersionRendition
Create rendition for a file version
> this endpoint is available in **Alfresco 7.0.0** and newer versions.
An asynchronous request to create a rendition for version of file **nodeId** and **versionId**.
The version rendition is specified by name **id** in the request body:
```json
{
"id": "doclib"
}
```
Multiple names may be specified as a comma separated list or using a list format:
```json
[
{
"id": "doclib"
},
{
"id": "avatar"
}
]
```
**Parameters**
| Name | Type | Description |
|-------------------------|-----------------------------------------------|---------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **versionId** | string | The identifier of a version, ie. version label, within the version history of a node. |
| **renditionBodyCreate** | [RenditionBodyCreate](RenditionBodyCreate.md) | The rendition "id". |
**Example**
```javascript
import { AlfrescoApi, VersionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const versionsApi = new VersionsApi(alfrescoApi);
const renditionBodyCreate = {};
versionsApi.createVersionRendition(`<nodeId>`, `<versionId>`, renditionBodyCreate).then(() => {
console.log('API called successfully.');
});
```
## deleteVersion
Delete a version
> this endpoint is available in **Alfresco 5.2** and newer versions.
Delete the version identified by **versionId** and **nodeId*.
**Parameters**
| Name | Type | Description | Notes |
|---------------|--------|---------------------------------------------------------------------------------------|-------|
| **nodeId** | string | The identifier of a node. |
| **versionId** | string | The identifier of a version, ie. version label, within the version history of a node. |
If the version is successfully deleted then the content and metadata for that versioned node
will be deleted and will no longer appear in the version history. This operation cannot be undone.
If the most recent version is deleted the live node will revert to the next most recent version.
We currently do not allow the last version to be deleted. If you wish to clear the history then you
can remove the `cm:versionable` aspect (via update node) which will also disable versioning. In this
case, you can re-enable versioning by adding back the `cm:versionable` aspect or using the version
params (majorVersion and comment) on a subsequent file content update.
**Example**
```javascript
import { AlfrescoApi, VersionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const versionsApi = new VersionsApi(alfrescoApi);
versionsApi.deleteVersion(nodeId, versionId).then(() => {
console.log('API called successfully.');
});
```
## getVersion
Get version information
> this endpoint is available in **Alfresco 5.2** and newer versions.
**Parameters**
| Name | Type | Description |
|---------------|------------|---------------------------------------------------------------------------------------|
| **nodeId** | **string** | The identifier of a node. |
| **versionId** | **string** | The identifier of a version, ie. version label, within the version history of a node. |
**Return type**: [VersionEntry](#VersionEntry)
**Example**
```javascript
import { AlfrescoApi, VersionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const versionsApi = new VersionsApi(alfrescoApi);
versionsApi.getVersion(`<nodeId>`, `<versionId>`).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getVersionContent
Get version content
> this endpoint is available in **Alfresco 5.2** and newer versions.
Gets the version content for **versionId** of file node **nodeId**.
**Parameters**
| Name | Type | Description |
|-----------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **versionId** | string | The identifier of a version, ie. version label, within the version history of a node. |
| attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. |
| ifModifiedSince | Date | Only returns the content if it has been modified since the date provided.Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. |
| range | string | The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. |
**Return type**: Blob
**Example**
```javascript
import { AlfrescoApi, VersionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const versionsApi = new VersionsApi(alfrescoApi);
const opts = {};
versionsApi.getVersionContent(`<nodeId>`, `<versionId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getVersionRendition
Get rendition information for a file version
> this endpoint is available in **Alfresco 7.0.0** and newer versions.
Gets the rendition information for **renditionId** of version of file **nodeId** and **versionId**.
**Parameters**
| Name | Type | Description |
|-----------------|--------|---------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **versionId** | string | The identifier of a version, ie. version label, within the version history of a node. |
| **renditionId** | string | The name of a thumbnail rendition, for example *doclib*, or *pdf*. |
**Return type**: [RenditionEntry](RenditionEntry.md)
**Example**
```javascript
import { AlfrescoApi, VersionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const versionsApi = new VersionsApi(alfrescoApi);
versionsApi.getVersionRendition(`<nodeId>`, `<versionId>`, `<renditionId>`).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getVersionRenditionContent
Get rendition content for a file version
> this endpoint is available in **Alfresco 7.0.0** and newer versions.
Gets the rendition content for **renditionId** of version of file **nodeId** and **versionId**.
**Parameters**
| Name | Type | Description |
|-----------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **versionId** | string | The identifier of a version, ie. version label, within the version history of a node. |
| **renditionId** | string | The name of a thumbnail rendition, for example *doclib*, or *pdf*. |
| attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. |
| ifModifiedSince | Date | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. |
| range | string | The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. |
| placeholder | boolean | If **true** (default: false) and there is no rendition for this **nodeId** and **renditionId**, then the placeholder image for the mime type of this rendition is returned, rather than a 404 response. |
**Return type**: Blob
**Example**
```javascript
import { AlfrescoApi, VersionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const versionsApi = new VersionsApi(alfrescoApi);
const opts = {};
versionsApi.getVersionRenditionContent(`<nodeId>`, `<versionId>`, `<renditionId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listVersionHistory
List version history
> this endpoint is available in **Alfresco 5.2** and newer versions.
Gets the version history as an ordered list of versions for the specified **nodeId**.
The list is ordered in descending modified order. So the most recent version is first and
the original version is last in the list.
**Parameters**
| Name | Type | Description |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| opts.include | string[] | Returns additional information about the version node. The following optional fields can be requested: `properties`, `aspectNames` |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. |
**Return type**: [VersionPaging](#VersionPaging)
**Example**
```javascript
import { AlfrescoApi, VersionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const versionsApi = new VersionsApi(alfrescoApi);
const opts = {};
versionsApi.listVersionHistory(`<nodeId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listVersionRenditions
List renditions for a file version
> this endpoint is available in **Alfresco 7.0.0** and newer versions.
Gets a list of the rendition information for each rendition of the version of file **nodeId** and **versionId**, including the rendition id.
Each rendition returned has a **status**: `CREATED` means it is available to view or download, `NOT_CREATED` means the rendition can be requested.
You can use the **where** parameter to filter the returned renditions by **status**. For example, the following **where**
clause will return just the `CREATED` renditions:
```text
(status='CREATED')
```
**Parameters**
| Name | Type | Description | Notes |
|---------------|--------|---------------------------------------------------------------------------------------|------------|
| **nodeId** | string | The identifier of a node. | |
| **versionId** | string | The identifier of a version, ie. version label, within the version history of a node. | |
| opts.where | string | A string to restrict the returned objects by using a predicate. | [optional] |
**Return type**: [RenditionPaging](RenditionPaging.md)
**Example**
```javascript
import { AlfrescoApi, VersionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const versionsApi = new VersionsApi(alfrescoApi);
const opts = {};
versionsApi.listVersionRenditions(`<nodeId>`, `<versionId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## requestDirectAccessUrl
Generate a direct access content url for a given version of a node
> this endpoint is available in **Alfresco 7.1** and newer versions.
**Parameters**
| Name | Type | Description |
|---------------|------------|------------------------------|
| **nodeId** | **string** | The identifier of a node. |
| **versionId** | **string** | The identifier of a version. |
**Return type**: [DirectAccessUrlEntry](DirectAccessUrlEntry.md)
### Example
```javascript
import { AlfrescoApi, VersionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const versionsApi = new VersionsApi(alfrescoApi);
const nodeId = 'da2e6953-3850-408b-8284-3534dd777417';
const versionId = '1.0';
versionsApi.requestDirectAccessUrl(nodeId, versionId).then((data) => {
console.log('URL generated successfully: ', data.contentUrl);
});
```
## revertVersion
Revert a version
> this endpoint is available in **Alfresco 5.2** and newer versions.
Attempts to revert the version identified by **versionId** and **nodeId** to the live node.
If the node is successfully reverted then the content and metadata for that versioned node
will be promoted to the live node and a new version will appear in the version history.
**Parameters**
| Name | Type | Description |
|----------------|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **versionId** | string | The identifier of a version, ie. version label, within the version history of a node. |
| **revertBody** | [RevertBody](#RevertBody) | Optionally, specify a version comment and whether this should be a major version, or not. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [VersionEntry](#VersionEntry)
**Example**
```javascript
import { AlfrescoApi, VersionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const versionsApi = new VersionsApi(alfrescoApi);
const revertBody = {};
const opts = {};
versionsApi.revertVersion(`<nodeId>`, `<versionId>`, revertBody, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## RevertBody
**Properties**
| Name | Type |
|--------------|---------|
| majorVersion | boolean |
| comment | string |
## VersionPaging
**Properties**
| Name | Type |
|------|-----------------------------------------|
| list | [VersionPagingList](#VersionPagingList) |
## VersionPagingList
**Properties**
| Name | Type |
|------------|---------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [VersionEntry[]](#VersionEntry) |
## VersionEntry
**Properties**
| Name | Type |
|-------|---------------------|
| entry | [Version](#Version) |
## Version
**Properties**
| Name | Type | Description |
|--------------------|-------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **id** | string | |
| versionComment | string | |
| **name** | string | The name must not contain spaces or the following special characters: `* \" < > \\ / ? :` and `\|` . The character . must not be used at the end of the name. |
| **nodeType** | string | |
| **isFolder** | boolean | |
| **isFile** | boolean | |
| **modifiedAt** | Date | |
| **modifiedByUser** | [UserInfo](UserInfo.md) | |
| content | [ContentInfo](ContentInfo.md) | |
| aspectNames | string[] | |
| properties | any | |

View File

@@ -0,0 +1,19 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './api';
export * from './model';

View File

@@ -0,0 +1,26 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export class CategoryLinkBody {
categoryId: string;
constructor(input?: Partial<CategoryLinkBody>) {
if (input) {
Object.assign(this, input);
}
}
}

View File

@@ -0,0 +1,25 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export interface ActionBodyExec {
actionDefinitionId: string;
/**
* The entity upon which to execute the action, typically a node ID or similar.
*/
targetId?: string;
params?: any;
}

View File

@@ -0,0 +1,46 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ActionParameterDefinition } from './actionParameterDefinition';
export interface ActionDefinition {
/**
* Identifier of the action definition — used for example when executing an action
*/
id: string;
/**
* name of the action definition, e.g. \"move\"
*/
name?: string;
/**
* title of the action definition, e.g. \"Move\"
*/
title?: string;
/**
* describes the action definition, e.g. \"This will move the matched item to another space.\"
*/
description?: string;
/**
* QNames of the types this action applies to
*/
applicableTypes: string[];
/**
* whether the basic action definition supports action tracking or not
*/
trackStatus: boolean;
parameterDefinitions?: ActionParameterDefinition[];
}

View File

@@ -0,0 +1,22 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ActionDefinition } from './actionDefinition';
export interface ActionDefinitionEntry {
entry: ActionDefinition;
}

View File

@@ -0,0 +1,30 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ActionDefinitionListList } from './actionDefinitionListList';
export class ActionDefinitionList {
list?: ActionDefinitionListList;
constructor(input?: ActionDefinitionList) {
if (input) {
Object.assign(this, input);
this.list = input.list ? new ActionDefinitionListList(input.list) : undefined;
}
}
}

View File

@@ -0,0 +1,31 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ActionDefinition } from './actionDefinition';
import { Pagination } from './pagination';
export class ActionDefinitionListList {
pagination?: Pagination;
entries?: ActionDefinition[];
constructor(input?: Partial<ActionDefinitionListList>) {
if (input) {
Object.assign(this, input);
this.pagination = input.pagination ? new Pagination(input.pagination) : undefined;
}
}
}

View File

@@ -0,0 +1,23 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export interface ActionExecResult {
/**
* The unique identifier of the action pending execution
*/
id: string;
}

View File

@@ -0,0 +1,22 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ActionExecResult } from './actionExecResult';
export interface ActionExecResultEntry {
entry: ActionExecResult;
}

View File

@@ -0,0 +1,24 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export interface ActionParameterDefinition {
name?: string;
type?: string;
multiValued?: boolean;
mandatory?: boolean;
displayLabel?: string;
}

View File

@@ -0,0 +1,61 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { DateAlfresco } from '../../content-custom-api';
/**
* Activities describe any past activity in a site,
* for example creating an item of content, commenting on a node,
* liking an item of content.
*/
export class Activity {
/**
* The id of the person who performed the activity
*/
postPersonId: string;
/**
* The unique id of the activity
*/
id: number;
/**
* The unique id of the site on which the activity was performed
*/
siteId?: string;
/**
* The date time at which the activity was performed
*/
postedAt?: Date;
/**
* The feed on which this activity was posted
*/
feedPersonId: string;
/**
* An object summarizing the activity
*/
activitySummary?: { [key: string]: string };
/**
* The type of the activity posted
*/
activityType: string;
constructor(input?: Partial<Activity>) {
if (input) {
Object.assign(this, input);
this.postedAt = input.postedAt ? DateAlfresco.parseDate(input.postedAt) : undefined;
}
}
}

View File

@@ -0,0 +1,30 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Activity } from './activity';
export class ActivityEntry {
entry: Activity;
constructor(input?: Partial<ActivityEntry>) {
if (input) {
Object.assign(this, input);
this.entry = input.entry ? new Activity(input.entry) : undefined;
}
}
}

View File

@@ -0,0 +1,30 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ActivityPagingList } from './activityPagingList';
export class ActivityPaging {
list?: ActivityPagingList;
constructor(input?: Partial<ActivityPaging>) {
if (input) {
Object.assign(this, input);
this.list = input.list ? new ActivityPagingList(input.list) : undefined;
}
}
}

View File

@@ -0,0 +1,35 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ActivityEntry } from './activityEntry';
import { Pagination } from './pagination';
export class ActivityPagingList {
pagination: Pagination;
entries: ActivityEntry[];
constructor(input?: Partial<ActivityPagingList>) {
if (input) {
Object.assign(this, input);
this.pagination = input.pagination ? new Pagination(input.pagination) : undefined;
if (input.entries) {
this.entries = input.entries.map((item) => new ActivityEntry(item));
}
}
}
}

View File

@@ -0,0 +1,21 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export interface Association {
targetId: string;
assocType: string;
}

View File

@@ -0,0 +1,27 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export class AssociationBody {
targetId: string;
assocType: string;
constructor(input?: Partial<AssociationBody>) {
if (input) {
Object.assign(this, input);
}
}
}

View File

@@ -0,0 +1,22 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Association } from './association';
export interface AssociationEntry {
entry: Association;
}

View File

@@ -0,0 +1,20 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export interface AssociationInfo {
assocType: string;
}

View File

@@ -0,0 +1,24 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export interface AuditApp {
id: string;
name?: string;
isEnabled?: boolean;
maxEntryId?: number;
minEntryId?: number;
}

Some files were not shown because too many files have changed in this diff Show More