[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,14 @@
# AbstractClassAssociation
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **string** | | [default to null]
**title** | **string** | | [optional] [default to null]
**description** | **string** | | [optional] [default to null]
**isChild** | **boolean** | | [optional] [default to null]
**isProtected** | **boolean** | | [optional] [default to null]
**source** | [**AbstractClassAssociationSource**](AbstractClassAssociationSource.md) | | [optional] [default to null]
**target** | [**AbstractClassAssociationSource**](AbstractClassAssociationSource.md) | | [optional] [default to null]

View File

@@ -0,0 +1,12 @@
# AbstractClassAssociationSource
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**role** | **string** | | [optional] [default to null]
**cls** | **string** | | [optional] [default to null]
**isMandatory** | **boolean** | | [optional] [default to null]
**isMany** | **boolean** | | [optional] [default to null]
**isMandatoryEnforced** | **boolean** | | [optional] [default to null]

View File

@@ -0,0 +1,16 @@
# Aspect
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **string** | | [default to null]
**title** | **string** | | [default to null]
**description** | **string** | | [optional] [default to null]
**parentId** | **string** | | [optional] [default to null]
**properties** | [**Property[]**](../../content-rest-api/docs/Property.md) | | [optional] [default to null]
**isContainer** | **boolean** | | [optional] [default to null]
**isArchive** | **boolean** | | [optional] [default to null]
**includedInSupertypeQuery** | **boolean** | | [optional] [default to null]
**mandatoryAspects** | **string[]** | | [optional] [default to null]
**associations** | [**AbstractClassAssociation[]**](AbstractClassAssociation.md) | | [optional] [default to null]
**model** | [**Model**](Model.md) | | [optional] [default to null]

View File

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

View File

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

View File

@@ -0,0 +1,9 @@
# AspectPagingList
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**pagination** | [**Pagination**](../../content-rest-api/docs/Pagination.md) | | [optional] [default to null]
**entries** | [**AspectEntry[]**](AspectEntry.md) | | [optional] [default to null]

View File

@@ -0,0 +1,151 @@
# AspectsApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-----------------------------|-----------------------------|---------------|
| [getAspect](#getAspect) | **GET** /aspects/{aspectId} | Get an aspect |
| [listAspects](#listAspects) | **GET** /aspects | List aspects |
## getAspect
Get an aspect
> This is available in Alfresco 7.0.0 and newer versions.
**Parameters**
| Name | Type | Description |
|--------------|--------|----------------------------------------------------|
| **aspectId** | string | The Qname of an aspect(prefix:name) e.g 'cm:title' |
**Return type**: [AspectEntry](AspectEntry.md)
**Example**
```javascript
import { AlfrescoApi, AspectsApi} from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi({
hostEcm: 'http://127.0.0.1:8080'
});
const aspectsApi = new AspectsApi(alfrescoApi);
aspectsApi.getAspect(aspectId).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listAspects
List aspects
> This is available in Alfresco 7.0.0 and newer versions.
Gets a list of aspects from the data dictionary. The System aspects will be ignored by default.
```json
{
"list": {
"pagination": {
"count": 0,
"hasMoreItems": true,
"totalItems": 0,
"skipCount": 0,
"maxItems": 0
},
"entries": [
{
"entry": {
"associations": [],
"mandatoryAspects": [],
"includedInSupertypeQuery": true,
"description": "Titled",
"isContainer": false,
"model": {
"id": "cm:contentmodel",
"author": "Alfresco",
"description": "Alfresco Content Domain Model",
"namespaceUri": "http://www.alfresco.org/model/content/1.0",
"namespacePrefix": "cm"
},
"id": "cm:titled",
"title": "Titled",
"properties": [
{
"id": "cm:title",
"title": "Title",
"description": "Content Title",
"dataType": "d:mltext",
"isMultiValued": false,
"isMandatory": false,
"isMandatoryEnforced": false,
"isProtected": false
}
]
}
}
]
}
}
```
**Parameters**
| Name | Type | Description | Notes |
|-------|--------|-----------------------------|------------|
| where | string | Optionally filter the list. | [optional] |
Here are some examples:
An aspect should represented in the following format(prefix:name). e.g 'cm:title'.
The following where clause will only return aspects from the namespace1:model and namespace2:model.
```text
where=(modelId in ('namespace1:model','namespace2:model'))
where=(modelId in ('namespace1:model INCLUDESUBASPECTS','namespace2:model'))
```
The following where clause will only return sub aspects for the given parents.
```text
where=(parentId in ('namespace1:parent','namespace2:parent'))
```
The following where clause will only return aspects that match the pattern.
```text
where=(namespaceUri matches('http://www.alfresco.*'))
```
The following where clause will only return aspects that don't match the pattern.
```text
where=(not namespaceUri matches('http://www.alfresco.*'))
```
| Name | Type | Description | Notes |
|---------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| **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. | [optional] [default to 0] |
| **maxItems** | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | [optional] [default to 100] |
| **include** | string | Returns additional information about the aspect. The following optional fields can be requested: `properties`, `mandatoryAspects`, `associations` | [optional] |
**Return type**: [AspectPaging](AspectPaging.md)
**Example**
```javascript
import { AlfrescoApi, AspectsApi} from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi({
hostEcm: 'http://127.0.0.1:8080'
});
const aspectsApi = new AspectsApi(alfrescoApi);
aspectsApi.listAspects(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```

View File

@@ -0,0 +1,11 @@
# Model
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **string** | | [default to null]
**author** | **string** | | [optional] [default to null]
**description** | **string** | | [optional] [default to null]
**namespaceUri** | **string** | | [optional] [default to null]
**namespacePrefix** | **string** | | [optional] [default to null]

View File

@@ -0,0 +1,17 @@
# Type
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **string** | | [default to null]
**title** | **string** | | [default to null]
**description** | **string** | | [optional] [default to null]
**parentId** | **string** | | [optional] [default to null]
**properties** | [**Property[]**](../../content-rest-api/docs/Property.md) | | [optional] [default to null]
**isContainer** | **boolean** | | [optional] [default to null]
**isArchive** | **boolean** | | [optional] [default to null]
**includedInSupertypeQuery** | **boolean** | | [optional] [default to null]
**mandatoryAspects** | **string[]** | | [optional] [default to null]
**associations** | [**AbstractClassAssociation[]**](AbstractClassAssociation.md) | | [optional] [default to null]
**model** | [**Model**](Model.md) | | [optional] [default to null]

View File

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

View File

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

View File

@@ -0,0 +1,9 @@
# TypePagingList
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**pagination** | [**Pagination**](../../content-rest-api/docs/Pagination.md) | | [optional] [default to null]
**entries** | [**TypeEntry[]**](TypeEntry.md) | | [optional] [default to null]

View File

@@ -0,0 +1,170 @@
# TypesApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|----------------------------------------|-------------------------|-------------|
| [**getType**](TypesApi.md#getType) | **GET** /types/{typeId} | Get a type |
| [**listTypes**](TypesApi.md#listTypes) | **GET** /types | List types |
<a name="getType"></a>
## getType
> TypeEntry getType(typeId)
Get a type
**Note:** This is available in Alfresco 7.0.0 and newer versions.
Get information for type **typeId**.
### Example
```javascript
import { AlfrescoApi, TypesApi} from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi({
hostEcm: 'http://127.0.0.1:8080'
});
const typesApi = new TypesApi(alfrescoApi);
typesApi.getType(typeId).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
```
### Parameters
| Name | Type | Description | Notes |
|------------|------------|---------------------------------------------------|-------|
| **typeId** | **string** | The Qname of a type(prefix:name) e.g 'cm:content' |
**Return type**: [**TypeEntry**](TypeEntry.md)
<a name="listTypes"></a>
## listTypes
> TypePaging listTypes(opts)
List types
**Note:** This is available in Alfresco 7.0.0 and newer versions.
Gets a list of types from the data dictionary. The System types will be ignored by default.
```json
{
"list": {
"pagination": {
"count": 0,
"hasMoreItems": true,
"totalItems": 0,
"skipCount": 0,
"maxItems": 0
},
"entries": [
{
"entry": {
"associations": [],
"isArchive": true,
"mandatoryAspects": [
"cm:auditable",
"sys:referenceable",
"sys:localized"
],
"includedInSupertypeQuery": true,
"description": "Base Content Object",
"isContainer": false,
"model": {
"id": "cm:contentmodel",
"author": "Alfresco",
"description": "Alfresco Content Domain Model",
"namespaceUri": "http://www.alfresco.org/model/content/1.0",
"namespacePrefix": "cm"
},
"id": "cm:content",
"title": "Content",
"parentId": "cm:cmobject"
"properties": [
{
"id": "cm:name",
"title": "Name",
"description": "Name",
"dataType": "d:text",
"isMultiValued": false,
"isMandatory": true,
"isMandatoryEnforced": true
"isProtected": false
}
]
}
}
]
}
}
```
**Example**
```javascript
import { AlfrescoApi, TypesApi} from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi({
hostEcm: 'http://127.0.0.1:8080'
});
const typesApi = new TypesApi(alfrescoApi);
typesApi.listTypes(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
```
### Parameters
| Name | Type | Description | Notes |
|-----------|--------|-----------------------------|-------|
| **where** | string | Optionally filter the list. |
Here are some examples:
A type should be represented in the following format `(prefix:name)`. e.g 'cm:content'.
The following where clause will only return types from the namespace1:model and namespace2:model.
```text
where=(modelId in ('namespace1:model','namespace2:model'))
where=(modelId in ('namespace1:model INCLUDESUBTYPES','namespace2:model'))
```
The following where clause will only return sub types for the given parents.
```text
where=(parentId in ('namespace1:parent','namespace2:parent'))
```
The following where clause will only return types that match the pattern.
```text
where=(namespaceUri matches('http://www.alfresco.*'))
```
The following where clause will only return types that don't match the pattern.
```text
where=(not namespaceUri matches('http://www.alfresco.*'))
```
| 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 type. The following optional fields can be requested: `properties`, `mandatoryAspects`, `associations` | |
**Return type**: [TypePaging](TypePaging.md)