@fiado/api-invoker 1.3.73 → 1.3.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/card/CardApi.d.ts +1 -0
- package/bin/card/CardApi.js +4 -0
- package/bin/card/interfaces/ICardApi.d.ts +1 -0
- package/bin/centralPayments/CentralPaymentsConnectorApi.d.ts +1 -0
- package/bin/centralPayments/CentralPaymentsConnectorApi.js +4 -0
- package/bin/centralPayments/interfaces/ICentralPaymentsConnectorApi.d.ts +1 -0
- package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.d.ts +46 -0
- package/bin/transaction/api/TransactionApi.js +4 -4
- package/package.json +1 -1
- package/src/card/CardApi.ts +6 -0
- package/src/card/interfaces/ICardApi.ts +2 -0
- package/src/centralPayments/CentralPaymentsConnectorApi.ts +5 -0
- package/src/centralPayments/interfaces/ICentralPaymentsConnectorApi.ts +2 -0
- package/src/transaction/api/TransactionApi.ts +4 -4
- package/bin/account-fiadoinc/queue/TransactionPublisher.d.ts +0 -9
- package/bin/account-fiadoinc/queue/TransactionPublisher.js +0 -36
- package/bin/account-fiadoinc/queue/interfaces/ITransactionPublisher.d.ts +0 -7
- package/bin/activity/ActivityApi.d.ts +0 -17
- package/bin/activity/ActivityApi.js +0 -72
- package/bin/activity/index.d.ts +0 -2
- package/bin/activity/index.js +0 -18
- package/bin/activity/interfaces/IActivityApi.d.ts +0 -39
- package/bin/activity/interfaces/IActivityApi.js +0 -2
- /package/bin/{account-fiadoinc/queue/interfaces/ITransactionPublisher.js → cognitoConnector/interfaces/ICognitoConnectorApiV2.js} +0 -0
package/bin/card/CardApi.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare class CardApi implements ICardApi {
|
|
|
11
11
|
getByDirectoryId(provider: Provider, directoryId: string, onlyDb?: boolean): Promise<ApiGatewayResponse<CardResponse>>;
|
|
12
12
|
getById(provider: Provider, id: string, onlyDb?: boolean): Promise<ApiGatewayResponse<CardResponse>>;
|
|
13
13
|
getByExternalId(provider: Provider, externalId: string): Promise<ApiGatewayResponse<CardResponse>>;
|
|
14
|
+
getCardByIdExternal(externalCardId: string): Promise<ApiGatewayResponse<any>>;
|
|
14
15
|
evaluateAccountLevelUpdate(directoryId: string): Promise<void>;
|
|
15
16
|
findCardIssuanceByIds(directoryIds: string[]): Promise<ApiGatewayResponse<any>>;
|
|
16
17
|
updateIssuance(provider: Provider, input: CardUpdateIssuanceRequest): Promise<ApiGatewayResponse<void>>;
|
package/bin/card/CardApi.js
CHANGED
|
@@ -31,6 +31,10 @@ let CardApi = class CardApi {
|
|
|
31
31
|
const url = `${this.baseUrl}/${provider}?externalCardId=${externalId}`;
|
|
32
32
|
return await this.httpRequest.get(url);
|
|
33
33
|
}
|
|
34
|
+
async getCardByIdExternal(externalCardId) {
|
|
35
|
+
const url = `${this.baseUrl}/cards/${externalCardId}?raw=true`;
|
|
36
|
+
return await this.httpRequest.get(url);
|
|
37
|
+
}
|
|
34
38
|
async evaluateAccountLevelUpdate(directoryId) {
|
|
35
39
|
const url = `${this.baseUrl}accounts/levels`;
|
|
36
40
|
await this.httpRequest.post(url, { directoryId });
|
|
@@ -6,6 +6,7 @@ export interface ICardApi {
|
|
|
6
6
|
getByDirectoryId(provider: Provider, directoryId: string, onlyDb?: boolean): Promise<ApiGatewayResponse<CardResponse>>;
|
|
7
7
|
getById(provider: Provider, id: string, onlyDb?: boolean): Promise<ApiGatewayResponse<CardResponse>>;
|
|
8
8
|
getByExternalId(provider: Provider, externalId: string): Promise<ApiGatewayResponse<CardResponse>>;
|
|
9
|
+
getCardByIdExternal(externalCardId: string): Promise<ApiGatewayResponse<any>>;
|
|
9
10
|
findCardIssuanceByIds(directoryIds: string[]): Promise<ApiGatewayResponse<any>>;
|
|
10
11
|
updateIssuance(provider: Provider, input: CardUpdateIssuanceRequest): Promise<ApiGatewayResponse<void>>;
|
|
11
12
|
updateIssuanceObservation(directoryId: string, input: CardIssuanceObservationUpdateRequest): Promise<ApiGatewayResponse<void>>;
|
|
@@ -26,6 +26,7 @@ export declare class CentralPaymentsConnectorApi implements ICentralPaymentsConn
|
|
|
26
26
|
uploadDocuments(externalUserId: string, request: ProviderDocumentUploadRequest): Promise<FiadoApiResponse<ProviderDocumentUploadResponse>>;
|
|
27
27
|
changePin(request: UpdateBankAccountCardRequest): Promise<FiadoApiResponse<UpdateBankAccountCardResponse>>;
|
|
28
28
|
getCardsById(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
29
|
+
getCardByIdExternal(externalCardId: string): Promise<FiadoApiResponse<any>>;
|
|
29
30
|
getCardSensitiveInformation(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountSensitiveInformationResponse>>;
|
|
30
31
|
activateCard(request: ActivateBankAccountCardRequest): Promise<FiadoApiResponse<ActivateBankAccountCardResponse>>;
|
|
31
32
|
getCardBalance(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardBalanceResponse>>;
|
|
@@ -65,6 +65,10 @@ let CentralPaymentsConnectorApi = class CentralPaymentsConnectorApi {
|
|
|
65
65
|
const url = `${this.baseUrl}/cards/${externalCardId}`;
|
|
66
66
|
return await this.httpRequest.get(url);
|
|
67
67
|
}
|
|
68
|
+
async getCardByIdExternal(externalCardId) {
|
|
69
|
+
const url = `${this.baseUrl}/cards/${externalCardId}?raw=true`;
|
|
70
|
+
return await this.httpRequest.get(url);
|
|
71
|
+
}
|
|
68
72
|
async getCardSensitiveInformation(externalCardId) {
|
|
69
73
|
const url = `${this.baseUrl}/cards/${externalCardId}/sensitive`;
|
|
70
74
|
return await this.httpRequest.get(url);
|
|
@@ -19,6 +19,7 @@ export interface ICentralPaymentsConnectorApi {
|
|
|
19
19
|
uploadDocuments(externalUserId: string, request: ProviderDocumentUploadRequest): Promise<FiadoApiResponse<ProviderDocumentUploadResponse>>;
|
|
20
20
|
changePin(request: UpdateBankAccountCardRequest): Promise<FiadoApiResponse<UpdateBankAccountCardResponse>>;
|
|
21
21
|
getCardsById(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
22
|
+
getCardByIdExternal(externalCardId: string): Promise<FiadoApiResponse<any>>;
|
|
22
23
|
getCardSensitiveInformation(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountSensitiveInformationResponse>>;
|
|
23
24
|
activateCard(request: ActivateBankAccountCardRequest): Promise<FiadoApiResponse<ActivateBankAccountCardResponse>>;
|
|
24
25
|
getCardBalance(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardBalanceResponse>>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ChangePasswordRequest, GetUserRequest, GetUserResponse, RefreshTokenRequest, RefreshTokenResponse, RespondToAuthChallengeRequest, SetPasswordRequest, SignInRequest, SignInResponse, SignUpConfirmRequest, SignUpRequest, SignUpResponse } from "@fiado/type-kit/bin/cognitoConnector";
|
|
2
|
+
export interface ICognitoApi {
|
|
3
|
+
/**
|
|
4
|
+
* Healthcheck for the cognito-connector
|
|
5
|
+
*/
|
|
6
|
+
healthcheck(): Promise<HealthcheckResponse>;
|
|
7
|
+
/**
|
|
8
|
+
* Create a new user in Cognito
|
|
9
|
+
*/
|
|
10
|
+
signUp(request: SignUpRequest): Promise<SignUpResponse>;
|
|
11
|
+
/**
|
|
12
|
+
* Confirm sign-up for a user in Cognito
|
|
13
|
+
*/
|
|
14
|
+
signUpConfirm(request: SignUpConfirmRequest): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Sign in a user
|
|
17
|
+
*/
|
|
18
|
+
signIn(request: SignInRequest): Promise<SignInResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Sign out a user
|
|
21
|
+
*/
|
|
22
|
+
signOut(): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Change a user's password
|
|
25
|
+
*/
|
|
26
|
+
changePassword(request: ChangePasswordRequest): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Retrieve user details
|
|
29
|
+
*/
|
|
30
|
+
getUser(request: GetUserRequest): Promise<GetUserResponse>;
|
|
31
|
+
/**
|
|
32
|
+
* Refresh a user's tokens
|
|
33
|
+
*/
|
|
34
|
+
refreshToken(request: RefreshTokenRequest): Promise<RefreshTokenResponse>;
|
|
35
|
+
/**
|
|
36
|
+
* Respond to an auth challenge
|
|
37
|
+
*/
|
|
38
|
+
respondToAuthChallenge(request: RespondToAuthChallengeRequest): Promise<any>;
|
|
39
|
+
/**
|
|
40
|
+
* Reset a user's password
|
|
41
|
+
*/
|
|
42
|
+
resetPassword(request: SetPasswordRequest): Promise<void>;
|
|
43
|
+
}
|
|
44
|
+
export interface HealthcheckResponse {
|
|
45
|
+
status: string;
|
|
46
|
+
}
|
|
@@ -60,19 +60,19 @@ let TransactionApi = class TransactionApi {
|
|
|
60
60
|
return await this.httpRequest.get(url);
|
|
61
61
|
}
|
|
62
62
|
async getTransactionDetailByTransactionNumber(params) {
|
|
63
|
-
const url = `${this.baseUrl}
|
|
63
|
+
const url = `${this.baseUrl}private/${params.transactionNumber}/${params.directoryId}/${params.source}`;
|
|
64
64
|
return await this.httpRequest.get(url);
|
|
65
65
|
}
|
|
66
66
|
async getTransactionDetailById(params) {
|
|
67
|
-
const url = `${this.baseUrl}
|
|
67
|
+
const url = `${this.baseUrl}private/transaction/${params.source}/${params.id}`;
|
|
68
68
|
return await this.httpRequest.get(url);
|
|
69
69
|
}
|
|
70
70
|
async updateTransaction(params) {
|
|
71
|
-
const url = `${this.baseUrl}
|
|
71
|
+
const url = `${this.baseUrl}private/transaction/${params.source}/${params.id}`;
|
|
72
72
|
return await this.httpRequest.put(url, params.params);
|
|
73
73
|
}
|
|
74
74
|
async getTransactionsByDisputeOrFraudLogId(id) {
|
|
75
|
-
const url = `${this.baseUrl}
|
|
75
|
+
const url = `${this.baseUrl}transactions/disputes/${id}`;
|
|
76
76
|
return await this.httpRequest.get(url);
|
|
77
77
|
}
|
|
78
78
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.75",
|
|
4
4
|
"description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a través de invocaciones http",
|
|
5
5
|
"main": "bin/index.js",
|
|
6
6
|
"types": "bin/index.d.ts",
|
package/src/card/CardApi.ts
CHANGED
|
@@ -33,6 +33,12 @@ export class CardApi implements ICardApi {
|
|
|
33
33
|
return await this.httpRequest.get(url);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
async getCardByIdExternal(externalCardId: string): Promise<ApiGatewayResponse<any>> {
|
|
37
|
+
|
|
38
|
+
const url = `${this.baseUrl}/cards/${externalCardId}?raw=true`;
|
|
39
|
+
return await this.httpRequest.get(url);
|
|
40
|
+
}
|
|
41
|
+
|
|
36
42
|
async evaluateAccountLevelUpdate(directoryId: string): Promise<void> {
|
|
37
43
|
|
|
38
44
|
const url = `${this.baseUrl}accounts/levels`
|
|
@@ -11,6 +11,8 @@ export interface ICardApi {
|
|
|
11
11
|
|
|
12
12
|
getByExternalId(provider: Provider, externalId: string): Promise<ApiGatewayResponse<CardResponse>>;
|
|
13
13
|
|
|
14
|
+
getCardByIdExternal(externalCardId: string): Promise<ApiGatewayResponse<any>>;
|
|
15
|
+
|
|
14
16
|
findCardIssuanceByIds(directoryIds: string[]): Promise<ApiGatewayResponse<any>>;
|
|
15
17
|
|
|
16
18
|
updateIssuance(provider: Provider, input: CardUpdateIssuanceRequest): Promise<ApiGatewayResponse<void>>
|
|
@@ -124,6 +124,11 @@ export class CentralPaymentsConnectorApi implements ICentralPaymentsConnectorApi
|
|
|
124
124
|
return await this.httpRequest.get(url);
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
async getCardByIdExternal(externalCardId: string): Promise<FiadoApiResponse<any>> {
|
|
128
|
+
const url = `${this.baseUrl}/cards/${externalCardId}?raw=true`;
|
|
129
|
+
return await this.httpRequest.get(url);
|
|
130
|
+
}
|
|
131
|
+
|
|
127
132
|
async getCardSensitiveInformation(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountSensitiveInformationResponse>> {
|
|
128
133
|
const url = `${this.baseUrl}/cards/${externalCardId}/sensitive`;
|
|
129
134
|
return await this.httpRequest.get(url);
|
|
@@ -78,6 +78,8 @@ export interface ICentralPaymentsConnectorApi {
|
|
|
78
78
|
|
|
79
79
|
getCardsById(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
80
80
|
|
|
81
|
+
getCardByIdExternal(externalCardId: string): Promise<FiadoApiResponse<any>>;
|
|
82
|
+
|
|
81
83
|
getCardSensitiveInformation(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountSensitiveInformationResponse>>;
|
|
82
84
|
|
|
83
85
|
activateCard(request: ActivateBankAccountCardRequest): Promise<FiadoApiResponse<ActivateBankAccountCardResponse>>;
|
|
@@ -68,25 +68,25 @@ export default class TransactionApi implements ITransactionApi {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
async getTransactionDetailByTransactionNumber(params:{transactionNumber:string,directoryId:string,source:TransactionSourceEnum}): Promise<any> {
|
|
71
|
-
const url: string = `${this.baseUrl}
|
|
71
|
+
const url: string = `${this.baseUrl}private/${params.transactionNumber}/${params.directoryId}/${params.source}`;
|
|
72
72
|
return await this.httpRequest.get(url);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
async getTransactionDetailById(params: { id: string; source: TransactionSourceEnum; }): Promise<any> {
|
|
77
|
-
const url: string = `${this.baseUrl}
|
|
77
|
+
const url: string = `${this.baseUrl}private/transaction/${params.source}/${params.id}`;
|
|
78
78
|
return await this.httpRequest.get(url);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
async updateTransaction(params:{id:string,
|
|
82
82
|
source:TransactionSourceEnum,
|
|
83
83
|
params:any}): Promise<any> {
|
|
84
|
-
const url: string = `${this.baseUrl}
|
|
84
|
+
const url: string = `${this.baseUrl}private/transaction/${params.source}/${params.id}`;
|
|
85
85
|
return await this.httpRequest.put(url,params.params);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
async getTransactionsByDisputeOrFraudLogId(id:string): Promise<any> {
|
|
89
|
-
const url: string = `${this.baseUrl}
|
|
89
|
+
const url: string = `${this.baseUrl}transactions/disputes/${id}`;
|
|
90
90
|
return await this.httpRequest.get(url);
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ITransactionPublisher } from "./interfaces/ITransactionPublisher";
|
|
2
|
-
import { ProviderDocumentUploadRequest } from "@fiado/type-kit/bin/provider";
|
|
3
|
-
export declare class TransactionPublisher implements ITransactionPublisher {
|
|
4
|
-
private readonly FIADO_INC_KYC_MESSAGE_QUEUE;
|
|
5
|
-
publish(message: {
|
|
6
|
-
externalUserId: string;
|
|
7
|
-
input: ProviderDocumentUploadRequest;
|
|
8
|
-
}): Promise<void>;
|
|
9
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.TransactionPublisher = void 0;
|
|
10
|
-
const client_sqs_1 = require("@aws-sdk/client-sqs");
|
|
11
|
-
const inversify_1 = require("inversify");
|
|
12
|
-
let TransactionPublisher = class TransactionPublisher {
|
|
13
|
-
constructor() {
|
|
14
|
-
this.FIADO_INC_KYC_MESSAGE_QUEUE = process.env.FIADO_INC_KYC_MESSAGE_QUEUE;
|
|
15
|
-
}
|
|
16
|
-
async publish(message) {
|
|
17
|
-
try {
|
|
18
|
-
const client = new client_sqs_1.SQSClient();
|
|
19
|
-
const sendMessageRequest = {
|
|
20
|
-
QueueUrl: this.FIADO_INC_KYC_MESSAGE_QUEUE,
|
|
21
|
-
MessageBody: JSON.stringify(message),
|
|
22
|
-
MessageGroupId: message.externalUserId,
|
|
23
|
-
MessageDeduplicationId: message.externalUserId
|
|
24
|
-
};
|
|
25
|
-
const command = new client_sqs_1.SendMessageCommand(sendMessageRequest);
|
|
26
|
-
await client.send(command);
|
|
27
|
-
}
|
|
28
|
-
catch (error) {
|
|
29
|
-
throw new Error(`Error publishing message to queue ${': ' + error.message}`);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
exports.TransactionPublisher = TransactionPublisher;
|
|
34
|
-
exports.TransactionPublisher = TransactionPublisher = __decorate([
|
|
35
|
-
(0, inversify_1.injectable)()
|
|
36
|
-
], TransactionPublisher);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
-
import { IActivityApi } from './interfaces/IActivityApi';
|
|
3
|
-
import { TypeOfDirectoryId } from '@fiado/type-kit/bin/directory';
|
|
4
|
-
export declare class ActivityApi implements IActivityApi {
|
|
5
|
-
private httpRequest;
|
|
6
|
-
private readonly baseUrl;
|
|
7
|
-
constructor(httpRequest: IHttpRequest);
|
|
8
|
-
getActivities(typeOfActivities: string[]): Promise<any>;
|
|
9
|
-
getActivitiesByDirectoryIdAndTypeOfActivity(directoryId: string, typeOfActivities: string[]): Promise<any>;
|
|
10
|
-
postActivity(params: {
|
|
11
|
-
directoryId: string;
|
|
12
|
-
typeOfDirectoryId: TypeOfDirectoryId;
|
|
13
|
-
typeOfActivity: string;
|
|
14
|
-
amount: string;
|
|
15
|
-
date: string;
|
|
16
|
-
}): Promise<any>;
|
|
17
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
-
};
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.ActivityApi = void 0;
|
|
19
|
-
const dotenv_1 = __importDefault(require("dotenv"));
|
|
20
|
-
const inversify_1 = require("inversify");
|
|
21
|
-
dotenv_1.default.config();
|
|
22
|
-
let ActivityApi = class ActivityApi {
|
|
23
|
-
constructor(httpRequest) {
|
|
24
|
-
this.httpRequest = httpRequest;
|
|
25
|
-
this.baseUrl = process.env.ACTIVITY_LAMBDA_URL || "";
|
|
26
|
-
}
|
|
27
|
-
async getActivities(typeOfActivities) {
|
|
28
|
-
let url = `${this.baseUrl}activities`;
|
|
29
|
-
if (typeOfActivities.length > 0) {
|
|
30
|
-
url = `${this.baseUrl}activities?${typeOfActivities.map(id => `typeOfActivities=${encodeURIComponent(id)}`).join('&')}`;
|
|
31
|
-
}
|
|
32
|
-
const operationName = "getActivities";
|
|
33
|
-
return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
|
|
34
|
-
}
|
|
35
|
-
async getActivitiesByDirectoryIdAndTypeOfActivity(directoryId, typeOfActivities) {
|
|
36
|
-
if (directoryId == null || directoryId == undefined || directoryId == "") {
|
|
37
|
-
throw new Error("At least directory ID is required.");
|
|
38
|
-
}
|
|
39
|
-
let url = `${this.baseUrl}activities/directory/${directoryId}`;
|
|
40
|
-
if (typeOfActivities.length > 0) {
|
|
41
|
-
url = `${this.baseUrl}activities/directory/${directoryId}?${typeOfActivities.map(id => `typeOfActivities=${encodeURIComponent(id)}`).join('&')}`;
|
|
42
|
-
}
|
|
43
|
-
const operationName = "getActivitiesByDirectoryIdAndTypeOfActivity";
|
|
44
|
-
return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
|
|
45
|
-
}
|
|
46
|
-
async postActivity(params) {
|
|
47
|
-
if (params.directoryId == null || params.directoryId == undefined || params.directoryId == "") {
|
|
48
|
-
throw new Error("At least directory ID is required.");
|
|
49
|
-
}
|
|
50
|
-
if (params.typeOfDirectoryId == null || params.typeOfDirectoryId == undefined) {
|
|
51
|
-
throw new Error("At least typeOfDirectoryId is required.");
|
|
52
|
-
}
|
|
53
|
-
if (params.typeOfActivity == null || params.typeOfActivity == undefined || params.typeOfActivity == "") {
|
|
54
|
-
throw new Error("At least typeOfActivity is required.");
|
|
55
|
-
}
|
|
56
|
-
if (params.amount == null || params.amount == undefined || params.amount == "") {
|
|
57
|
-
throw new Error("At least amount is required.");
|
|
58
|
-
}
|
|
59
|
-
if (params.date == null || params.date == undefined || params.date == "") {
|
|
60
|
-
throw new Error("At least date is required.");
|
|
61
|
-
}
|
|
62
|
-
const url = `${this.baseUrl}/activities/create`;
|
|
63
|
-
const operationName = "postActivity";
|
|
64
|
-
return await this.httpRequest.post(`${url}`, params, { 'operationName': operationName });
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
exports.ActivityApi = ActivityApi;
|
|
68
|
-
exports.ActivityApi = ActivityApi = __decorate([
|
|
69
|
-
(0, inversify_1.injectable)(),
|
|
70
|
-
__param(0, (0, inversify_1.inject)("IHttpRequest")),
|
|
71
|
-
__metadata("design:paramtypes", [Object])
|
|
72
|
-
], ActivityApi);
|
package/bin/activity/index.d.ts
DELETED
package/bin/activity/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./interfaces/IActivityApi"), exports);
|
|
18
|
-
__exportStar(require("./ActivityApi"), exports);
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { TypeOfDirectoryId } from "@fiado/type-kit/bin/directory";
|
|
2
|
-
/**
|
|
3
|
-
* Interfaz para el servicio Directory que permite operaciones sobre directorios.
|
|
4
|
-
*/
|
|
5
|
-
export interface IActivityApi {
|
|
6
|
-
/**
|
|
7
|
-
* Obtiene una lista de entidades de la tabla ActivityDirectory.
|
|
8
|
-
* @param directoryId Directorio que se va a consultar.
|
|
9
|
-
* @param typeOfActivities Array de tipos de actividades (Opcional).
|
|
10
|
-
* @returns Retorna un arreglo de objetos de ActivityDirectory.
|
|
11
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
12
|
-
*/
|
|
13
|
-
getActivitiesByDirectoryIdAndTypeOfActivity(directoryId: string, typeOfActivities: string[]): Promise<any>;
|
|
14
|
-
/**
|
|
15
|
-
* Obtener actividades globales.
|
|
16
|
-
* @param typeOfActivity Tipo de actividad
|
|
17
|
-
* Puede devolver un arreglo vacío si no se encuentran coincidencias.
|
|
18
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
19
|
-
*/
|
|
20
|
-
getActivities(typeOfActivities: string[]): Promise<any>;
|
|
21
|
-
/**
|
|
22
|
-
* Proceso para agregar a las actividades.
|
|
23
|
-
* @param directoryId Directorio
|
|
24
|
-
* @param typeOfDirectoryId Tipo de directorio
|
|
25
|
-
* @param typeOfActivity Tipo de actividad
|
|
26
|
-
* @param amount Monto de la actividad
|
|
27
|
-
* @param date Fecha de la actividad
|
|
28
|
-
* @returns Retorna un objeto de ActivityDirectory.
|
|
29
|
-
* Puede devolver un arreglo vacío si no se encuentran coincidencias.
|
|
30
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
31
|
-
*/
|
|
32
|
-
postActivity(params: {
|
|
33
|
-
directoryId: string;
|
|
34
|
-
typeOfDirectoryId: TypeOfDirectoryId;
|
|
35
|
-
typeOfActivity: string;
|
|
36
|
-
amount: string;
|
|
37
|
-
date: string;
|
|
38
|
-
}): Promise<any>;
|
|
39
|
-
}
|