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

Commit

Permalink
[ACS-5839] improved typing support (#1638)
Browse files Browse the repository at this point in the history
* cleanup UserprofileApi

* cleanup activiti api

* cleanup activiti api

* cleanup activiti api

* cleanup activiti api

* cleanup activiti api typings

* cleanup activiti api typings

* cleanup activiti api typings

* cleanup api typings

* cleanup api typings

* cleanup api typings

* cleanup api typings

* remove eslint excludes

* remove eslint excludes

* remove eslint excludes

* remove eslint excludes

* remove eslint excludes

* remove unnecessary config imports

* more typings for query params

* more typings for query params

* more typings for query params

* more typings for query params

* more typings for query params

* reduce code

* fix delete queries, reduce code

* reduce code

* reduce code

* reduce code

* reduce code
  • Loading branch information
DenysVuika authored Aug 28, 2023
1 parent c212009 commit 12567fe
Show file tree
Hide file tree
Showing 129 changed files with 4,460 additions and 8,929 deletions.
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

0 comments on commit 12567fe

Please sign in to comment.