Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

[ACS-5839] improved typing support #1638

Merged
merged 29 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
40af628
cleanup UserprofileApi
DenysVuika Aug 23, 2023
64fb986
cleanup activiti api
DenysVuika Aug 24, 2023
b1ba103
cleanup activiti api
DenysVuika Aug 24, 2023
521334b
cleanup activiti api
DenysVuika Aug 24, 2023
44da38d
cleanup activiti api
DenysVuika Aug 24, 2023
08d7465
cleanup activiti api typings
DenysVuika Aug 25, 2023
15b7eb2
cleanup activiti api typings
DenysVuika Aug 25, 2023
9c16078
cleanup activiti api typings
DenysVuika Aug 25, 2023
671a238
cleanup api typings
DenysVuika Aug 25, 2023
774a763
cleanup api typings
DenysVuika Aug 25, 2023
6da76b4
cleanup api typings
DenysVuika Aug 25, 2023
e49aeef
cleanup api typings
DenysVuika Aug 26, 2023
055d72e
remove eslint excludes
DenysVuika Aug 26, 2023
7aea238
remove eslint excludes
DenysVuika Aug 26, 2023
c629b42
remove eslint excludes
DenysVuika Aug 26, 2023
6284261
remove eslint excludes
DenysVuika Aug 26, 2023
f8280ba
remove eslint excludes
DenysVuika Aug 26, 2023
bb6d7de
remove unnecessary config imports
DenysVuika Aug 26, 2023
b0fd0e4
more typings for query params
DenysVuika Aug 26, 2023
fdfd70d
more typings for query params
DenysVuika Aug 26, 2023
4dc177c
more typings for query params
DenysVuika Aug 26, 2023
6660dff
more typings for query params
DenysVuika Aug 26, 2023
ad54688
more typings for query params
DenysVuika Aug 26, 2023
dd5ab9d
reduce code
DenysVuika Aug 26, 2023
3e8f1f7
fix delete queries, reduce code
DenysVuika Aug 26, 2023
d38fa1c
reduce code
DenysVuika Aug 26, 2023
3be5971
reduce code
DenysVuika Aug 26, 2023
4c0b67e
reduce code
DenysVuika Aug 26, 2023
b949f17
reduce code
DenysVuika Aug 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,13 @@
],
// TODO: consider removing these rules and improving the source code
"rules": {
"prefer-const": "off",
"no-useless-escape": "off",
"prefer-rest-params": "off",
"prefer-spread": "off",
"no-prototype-builtins": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/ban-ts-comment": 1,
"@typescript-eslint/ban-types": 1,
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-unused-vars": 1,
"license-header/header": [
"error",
[
Expand Down
99 changes: 10 additions & 89 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
},
"devDependencies": {
"@types/chai": "^4.2.3",
"@types/chai-spies": "^1.0.3",
"@types/event-emitter": "^0.3.3",
"@types/mocha": "^10.0.1",
"@types/node": "^20.4.9",
Expand Down
2 changes: 1 addition & 1 deletion src/alfrescoApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class AlfrescoApi implements Emitter, AlfrescoApiType {

setConfig(config: AlfrescoApiConfig) {
if (!config) {
config = {} as AlfrescoApiConfig;
config = {};
}

this.storage = Storage.getInstance();
Expand Down
9 changes: 6 additions & 3 deletions src/alfrescoApiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ export class AlfrescoApiClient implements ee.Emitter, LegacyHttpClient {
}

delete<T = void>(options: RequestOptions): AlfrescoApiClientPromise<T> {
return this.buildRequestCall<T>(this.basePath, options, this.httpClient.delete.bind(this.httpClient));
const url = this.getCallApiUrl(options);
return this.buildRequestCall<T>(url, options, this.httpClient.delete.bind(this.httpClient));
}

callApi(
Expand Down Expand Up @@ -264,13 +265,15 @@ export class AlfrescoApiClient implements ee.Emitter, LegacyHttpClient {
}

private static addParamsToUrl(path: string, pathParams: any) {
return path.replace(/\{([\w-]+)\}/g, function (fullMatch, key) {
return path.replace(/\{([\w-]+)}/g, function (fullMatch, key) {
let value;
if (pathParams.hasOwnProperty(key)) {

if (Object.prototype.hasOwnProperty.call(pathParams, key)) {
value = paramToString(pathParams[key]);
} else {
value = fullMatch;
}

return encodeURIComponent(value);
});
}
Expand Down
28 changes: 3 additions & 25 deletions src/api/activiti-rest-api/api/about.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,13 @@ import { BaseApi } from './base.api';
export class AboutApi extends BaseApi {
/**
* Get server type and version
*
* Provides information about the running Alfresco Process Services Suite. The response payload object has the properties type, majorVersion, minorVersion, revisionVersion and edition.
*
* @return Promise<{ [key: string]: string; }>
*/
getAppVersion(): Promise<{ [key: string]: string; }> {

let postBody = null;

let pathParams = {

};

let queryParams = {
};

let headerParams = {

};
let formParams = {
};

let contentTypes = ['application/json'];
let accepts = ['application/json'];

return this.apiClient.callApi(
'/api/enterprise/app-version', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
contentTypes, accepts);
return this.get({
path: '/api/enterprise/app-version'
});
}

}
33 changes: 6 additions & 27 deletions src/api/activiti-rest-api/api/accountIntegration.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,41 +19,20 @@ import { ResultListDataRepresentationAccountRepresentation } from '../model/resu
import { BaseApi } from './base.api';

/**
* Accountintegration service.
* @module AccountintegrationApi
* AccountIntegrationApi service.
* @module AccountIntegrationApi
*/
export class AccountIntegrationApi extends BaseApi {
/**
* Retrieve external account information
*
* Accounts are used to integrate with third party apps and clients
*
* @return Promise<ResultListDataRepresentationAccountRepresentation>
*/
getAccounts(): Promise<ResultListDataRepresentationAccountRepresentation> {

let postBody = null;

let pathParams = {

};

let queryParams = {
};

let headerParams = {

};
let formParams = {
};

let contentTypes = ['application/json'];
let accepts = ['application/json'];

return this.apiClient.callApi(
'/api/enterprise/account/integration', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
contentTypes, accepts, ResultListDataRepresentationAccountRepresentation);
return this.get({
path: '/api/enterprise/account/integration',
returnType: ResultListDataRepresentationAccountRepresentation
});
}

}
Loading