@fiado/api-invoker 1.3.99 → 1.4.1

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.
@@ -5,4 +5,5 @@ export declare class AuthenticationApi implements IAuthenticationApi {
5
5
  private httpRequest;
6
6
  constructor(httpRequest: IHttpRequest);
7
7
  signUpAdditionalCard(createAdditionalCard: SignUpAdditionalRequest): Promise<any>;
8
+ deleteAuthSessionByDirectoryId(directoryId: string): Promise<any>;
8
9
  }
@@ -23,6 +23,11 @@ let AuthenticationApi = class AuthenticationApi {
23
23
  const operation = "postSignUpAdditionalCard";
24
24
  return await this.httpRequest.post(url, createAdditionalCard, { 'operationName': operation });
25
25
  }
26
+ async deleteAuthSessionByDirectoryId(directoryId) {
27
+ const url = `${process.env.AUTH_LAMBDA_URL}`;
28
+ const operation = "deleteAuthSessionByDirectoryId";
29
+ return await this.httpRequest.delete(url, { directoryId }, { 'operationName': operation });
30
+ }
26
31
  };
27
32
  exports.AuthenticationApi = AuthenticationApi;
28
33
  exports.AuthenticationApi = AuthenticationApi = __decorate([
@@ -1,4 +1,5 @@
1
1
  import { SignUpAdditionalRequest } from "@fiado/type-kit/bin/authentication";
2
2
  export interface IAuthenticationApi {
3
3
  signUpAdditionalCard(createAdditionalCard: SignUpAdditionalRequest): Promise<any>;
4
+ deleteAuthSessionByDirectoryId(directoryId: string): Promise<any>;
4
5
  }
@@ -5,6 +5,7 @@ export default class CognitoConnectorApi implements ICognitoConnectorApi {
5
5
  private httpRequest;
6
6
  private readonly baseUrl;
7
7
  constructor(httpRequest: IHttpRequest);
8
+ deleteCognitoUserByDirectoryId(directoryId: string): Promise<void>;
8
9
  signUp(input: SignUpRequest): Promise<SignUpResponse>;
9
10
  signIn(input: SignInRequest): Promise<SignInResponse>;
10
11
  getUser(input: GetUserRequest): Promise<GetUserResponse>;
@@ -18,6 +18,10 @@ let CognitoConnectorApi = class CognitoConnectorApi {
18
18
  this.httpRequest = httpRequest;
19
19
  this.baseUrl = process.env.INDETITY_SERVER_BASE_URL || "";
20
20
  }
21
+ async deleteCognitoUserByDirectoryId(directoryId) {
22
+ const url = `${this.baseUrl}cognito/deleteUser/${directoryId}`;
23
+ return await this.httpRequest.delete(url);
24
+ }
21
25
  async signUp(input) {
22
26
  const url = `${this.baseUrl}cognito/signUp`;
23
27
  const response = await this.httpRequest.post(url, input, { operationName: "postConnectorCognitoSignUp" });
@@ -9,4 +9,5 @@ export interface ICognitoConnectorApi {
9
9
  changePassword(input: SetPasswordRequest): Promise<void>;
10
10
  respondToNewPasswordChallenge(input: RespondToAuthChallengeRequest): Promise<SignInResponse>;
11
11
  resetPassword(username: string, typeOfDirectoryId: TypeOfDirectoryId): Promise<void>;
12
+ deleteCognitoUserByDirectoryId(directoryId: string): Promise<void>;
12
13
  }
@@ -9,4 +9,5 @@ export default class NotificationMessagePublisher implements INotificationMessag
9
9
  private readonly NOTIFICATION_MESSAGES_URL;
10
10
  publish(message: NotificationQueueMessageRequest): Promise<void>;
11
11
  getTemplateById(templateId: string): Promise<FiadoApiResponse<NotificationTemplate>>;
12
+ deleteByDirectoryId(directoryId: string): Promise<void>;
12
13
  }
@@ -38,6 +38,10 @@ let NotificationMessagePublisher = class NotificationMessagePublisher {
38
38
  const url = `${this.NOTIFICATION_MESSAGES_URL}notification-messages/private/templates/${templateId}`;
39
39
  return await this.httpRequest.get(`${url}`);
40
40
  }
41
+ async deleteByDirectoryId(directoryId) {
42
+ const url = `${this.NOTIFICATION_MESSAGES_URL}notification-messages/private/directory/${directoryId}`;
43
+ return await this.httpRequest.delete(`${url}`);
44
+ }
41
45
  };
42
46
  NotificationMessagePublisher = __decorate([
43
47
  (0, inversify_1.injectable)(),
@@ -3,4 +3,5 @@ import { NotificationQueueMessageRequest, NotificationTemplate } from "@fiado/ty
3
3
  export interface INotificationMessagesPublisher {
4
4
  publish(message: NotificationQueueMessageRequest): Promise<void>;
5
5
  getTemplateById(templateId: string): Promise<FiadoApiResponse<NotificationTemplate>>;
6
+ deleteByDirectoryId(directoryId: string): Promise<void>;
6
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.3.99",
3
+ "version": "1.4.1",
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",
@@ -14,4 +14,11 @@ export class AuthenticationApi implements IAuthenticationApi {
14
14
 
15
15
  return await this.httpRequest.post(url, createAdditionalCard, { 'operationName': operation });
16
16
  }
17
+
18
+ async deleteAuthSessionByDirectoryId (directoryId: string): Promise<any> {
19
+ const url = `${process.env.AUTH_LAMBDA_URL}`;
20
+ const operation = "deleteAuthSessionByDirectoryId";
21
+
22
+ return await this.httpRequest.delete(url, {directoryId}, { 'operationName': operation });
23
+ }
17
24
  }
@@ -3,4 +3,5 @@ import { SignUpAdditionalRequest } from "@fiado/type-kit/bin/authentication";
3
3
  export interface IAuthenticationApi {
4
4
 
5
5
  signUpAdditionalCard(createAdditionalCard: SignUpAdditionalRequest): Promise<any>;
6
+ deleteAuthSessionByDirectoryId(directoryId: string): Promise<any>;
6
7
  }
@@ -9,6 +9,10 @@ export default class CognitoConnectorApi implements ICognitoConnectorApi {
9
9
  private readonly baseUrl = process.env.INDETITY_SERVER_BASE_URL || "";
10
10
 
11
11
  constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
12
+ async deleteCognitoUserByDirectoryId(directoryId: string): Promise<void> {
13
+ const url = `${this.baseUrl}cognito/deleteUser/${directoryId}`;
14
+ return await this.httpRequest.delete(url);
15
+ }
12
16
 
13
17
 
14
18
  async signUp(input: SignUpRequest): Promise<SignUpResponse> {
@@ -13,4 +13,5 @@ export interface ICognitoConnectorApi {
13
13
  changePassword(input: SetPasswordRequest): Promise<void>;
14
14
  respondToNewPasswordChallenge(input: RespondToAuthChallengeRequest): Promise<SignInResponse>;
15
15
  resetPassword(username: string, typeOfDirectoryId: TypeOfDirectoryId): Promise<void>;
16
+ deleteCognitoUserByDirectoryId(directoryId: string): Promise<void>;
16
17
  }
@@ -12,6 +12,7 @@ export default class NotificationMessagePublisher implements INotificationMessag
12
12
  @inject("IHttpRequest") private httpRequest: IHttpRequest
13
13
  ) {}
14
14
 
15
+
15
16
  private readonly NOTIFICATION_MESSAGES_QUEUE = process.env.NOTIFICATION_MESSAGES_QUEUE
16
17
  private readonly NOTIFICATION_MESSAGES_URL = process.env.NOTIFICATION_MESSAGES_URL;
17
18
 
@@ -33,4 +34,9 @@ export default class NotificationMessagePublisher implements INotificationMessag
33
34
  const url = `${this.NOTIFICATION_MESSAGES_URL}notification-messages/private/templates/${templateId}`;
34
35
  return await this.httpRequest.get(`${url}`);
35
36
  }
37
+
38
+ async deleteByDirectoryId(directoryId: string): Promise<void> {
39
+ const url = `${this.NOTIFICATION_MESSAGES_URL}notification-messages/private/directory/${directoryId}`;
40
+ return await this.httpRequest.delete(`${url}`);
41
+ }
36
42
  }
@@ -4,4 +4,5 @@ import {NotificationQueueMessageRequest, NotificationTemplate} from "@fiado/type
4
4
  export interface INotificationMessagesPublisher {
5
5
  publish(message: NotificationQueueMessageRequest): Promise<void>;
6
6
  getTemplateById(templateId: string): Promise<FiadoApiResponse<NotificationTemplate>>;
7
+ deleteByDirectoryId(directoryId: string): Promise<void>;
7
8
  }