@venturialstd/workflow 0.1.51 → 0.1.52

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.
@@ -0,0 +1,2 @@
1
+ export * from './kira-auth.service';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/kira/auth/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,18 @@
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("./kira-auth.service"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/kira/auth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC"}
@@ -0,0 +1,8 @@
1
+ import { KiraApiService } from '@venturialstd/kira';
2
+ import { CredentialAuthResult, IWorkflowCredentialAuthService } from '../../types';
3
+ export declare class KiraAuthService implements IWorkflowCredentialAuthService {
4
+ private readonly kiraApiService;
5
+ constructor(kiraApiService: KiraApiService);
6
+ authenticate(credentials: Record<string, unknown>): Promise<CredentialAuthResult>;
7
+ }
8
+ //# sourceMappingURL=kira-auth.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kira-auth.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/kira/auth/kira-auth.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAc,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAEnF,qBACa,eAAgB,YAAW,8BAA8B;IACxD,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,cAAc;IAErD,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAyExF"}
@@ -0,0 +1,94 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.KiraAuthService = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const kira_1 = require("@venturialstd/kira");
15
+ let KiraAuthService = class KiraAuthService {
16
+ kiraApiService;
17
+ constructor(kiraApiService) {
18
+ this.kiraApiService = kiraApiService;
19
+ }
20
+ async authenticate(credentials) {
21
+ try {
22
+ const apiKey = credentials.apiKey;
23
+ const clientId = credentials.clientId;
24
+ const password = credentials.password;
25
+ const baseUrl = credentials.baseUrl;
26
+ if (!apiKey || apiKey.trim().length === 0) {
27
+ return {
28
+ success: false,
29
+ message: 'API Key is required',
30
+ error: 'MISSING_API_KEY',
31
+ };
32
+ }
33
+ if (!clientId || clientId.trim().length === 0) {
34
+ return {
35
+ success: false,
36
+ message: 'Client ID is required',
37
+ error: 'MISSING_CLIENT_ID',
38
+ };
39
+ }
40
+ if (!password || password.trim().length === 0) {
41
+ return {
42
+ success: false,
43
+ message: 'Password is required',
44
+ error: 'MISSING_PASSWORD',
45
+ };
46
+ }
47
+ const config = {
48
+ auth: {
49
+ apiKey,
50
+ clientId,
51
+ password,
52
+ },
53
+ baseUrl,
54
+ };
55
+ try {
56
+ const token = await this.kiraApiService.authenticate(config);
57
+ if (token && token.length > 0) {
58
+ return {
59
+ success: true,
60
+ message: 'Credentials validated successfully',
61
+ };
62
+ }
63
+ else {
64
+ return {
65
+ success: false,
66
+ message: 'Authentication failed: No token received',
67
+ error: 'AUTH_FAILED',
68
+ };
69
+ }
70
+ }
71
+ catch (error) {
72
+ const errorMessage = error instanceof Error ? error.message : 'Unknown error';
73
+ return {
74
+ success: false,
75
+ message: `Authentication failed: ${errorMessage}`,
76
+ error: 'AUTH_ERROR',
77
+ };
78
+ }
79
+ }
80
+ catch (error) {
81
+ return {
82
+ success: false,
83
+ message: error instanceof Error ? error.message : 'Unknown error occurred',
84
+ error: 'AUTH_ERROR',
85
+ };
86
+ }
87
+ }
88
+ };
89
+ exports.KiraAuthService = KiraAuthService;
90
+ exports.KiraAuthService = KiraAuthService = __decorate([
91
+ (0, common_1.Injectable)(),
92
+ __metadata("design:paramtypes", [kira_1.KiraApiService])
93
+ ], KiraAuthService);
94
+ //# sourceMappingURL=kira-auth.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kira-auth.service.js","sourceRoot":"","sources":["../../../../src/modules/kira/auth/kira-auth.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAgE;AAKzD,IAAM,eAAe,G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AAM,GAAG,CAAC,EAAE,CAAC;oBAC9B,OAAO;wBACL,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE,oCAAoC;qBAC9C,CAAC;gBACJ,CAAC;qBAAM,CAAC;oBACN,OAAO;wBACL,OAAO,EAAE,KAAK;wBACd,OAAO,EAAE,0CAA0C;wBACnD,KAAK,EAAE,aAAa;qBACrB,CAAC;gBACJ,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;gBAC9E,OAAO;oBACL,OAAO,EAAE,KAAK;oBACd,OAAO,EAAE,0BAA0B,YAAY,EAAE;oBACjD,KAAK,EAAE,YAAY;iBACpB,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAwB;gBAC1E,KAAK,EAAE,YAAY;aACpB,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AA5EY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;qCAEkC,qBAAc;GADhD,eAAe,CA4E3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"kira-nest.module.d.ts","sourceRoot":"","sources":["../../../src/modules/kira/kira-nest.module.ts"],"names":[],"mappings":"AAKA,qBAKa,cAAc;CAAG"}
1
+ {"version":3,"file":"kira-nest.module.d.ts","sourceRoot":"","sources":["../../../src/modules/kira/kira-nest.module.ts"],"names":[],"mappings":"AAMA,qBAKa,cAAc;CAAG"}
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.KiraNestModule = void 0;
10
10
  const common_1 = require("@nestjs/common");
11
11
  const kira_1 = require("@venturialstd/kira");
12
+ const auth_1 = require("./auth");
12
13
  const services_1 = require("./services");
13
14
  let KiraNestModule = class KiraNestModule {
14
15
  };
@@ -16,8 +17,8 @@ exports.KiraNestModule = KiraNestModule;
16
17
  exports.KiraNestModule = KiraNestModule = __decorate([
17
18
  (0, common_1.Module)({
18
19
  imports: [kira_1.KiraModule],
19
- providers: [services_1.CreatePaymentLinkService],
20
- exports: [services_1.CreatePaymentLinkService],
20
+ providers: [services_1.CreatePaymentLinkService, auth_1.KiraAuthService],
21
+ exports: [services_1.CreatePaymentLinkService, auth_1.KiraAuthService],
21
22
  })
22
23
  ], KiraNestModule);
23
24
  //# sourceMappingURL=kira-nest.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"kira-nest.module.js","sourceRoot":"","sources":["../../../src/modules/kira/kira-nest.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAEhD,yCAAsD;AAO/C,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAL1B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,iBAAU,CAAC;QACrB,SAAS,EAAE,CAAC,mCAAwB,CAAC;QACrC,OAAO,EAAE,CAAC,mCAAwB,CAAC;KACpC,CAAC;GACW,cAAc,CAAG"}
1
+ {"version":3,"file":"kira-nest.module.js","sourceRoot":"","sources":["../../../src/modules/kira/kira-nest.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAEhD,iCAAyC;AACzC,yCAAsD;AAO/C,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAL1B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,iBAAU,CAAC;QACrB,SAAS,EAAE,CAAC,mCAAwB,EAAE,sBAAe,CAAC;QACtD,OAAO,EAAE,CAAC,mCAAwB,EAAE,sBAAe,CAAC;KACrD,CAAC;GACW,cAAc,CAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"kira.module.d.ts","sourceRoot":"","sources":["../../../src/modules/kira/kira.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAIpD,eAAO,MAAM,UAAU,EAAE,wBASxB,CAAC"}
1
+ {"version":3,"file":"kira.module.d.ts","sourceRoot":"","sources":["../../../src/modules/kira/kira.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAKpF,eAAO,MAAM,UAAU,EAAE,wBAUxB,CAAC"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.kiraModule = void 0;
4
4
  const actions_1 = require("./actions");
5
+ const kira_auth_service_1 = require("./auth/kira-auth.service");
5
6
  const credentials_1 = require("./credentials");
6
7
  exports.kiraModule = {
7
8
  key: 'kira',
@@ -10,6 +11,7 @@ exports.kiraModule = {
10
11
  icon: '💳',
11
12
  version: '1.0.0',
12
13
  credentialFields: credentials_1.kiraCredentials,
14
+ authServiceClass: kira_auth_service_1.KiraAuthService,
13
15
  actions: [actions_1.createPaymentLinkAction],
14
16
  triggers: [],
15
17
  };
@@ -1 +1 @@
1
- {"version":3,"file":"kira.module.js","sourceRoot":"","sources":["../../../src/modules/kira/kira.module.ts"],"names":[],"mappings":";;;AACA,uCAAoD;AACpD,+CAAgD;AAEnC,QAAA,UAAU,GAA6B;IAClD,GAAG,EAAE,MAAM;IACX,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,uDAAuD;IACpE,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,OAAO;IAChB,gBAAgB,EAAE,6BAAe;IACjC,OAAO,EAAE,CAAC,iCAAuB,CAAC;IAClC,QAAQ,EAAE,EAAE;CACb,CAAC"}
1
+ {"version":3,"file":"kira.module.js","sourceRoot":"","sources":["../../../src/modules/kira/kira.module.ts"],"names":[],"mappings":";;;AACA,uCAAoD;AACpD,gEAA2D;AAC3D,+CAAgD;AAEnC,QAAA,UAAU,GAA6B;IAClD,GAAG,EAAE,MAAM;IACX,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,uDAAuD;IACpE,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,OAAO;IAChB,gBAAgB,EAAE,6BAAe;IACjC,gBAAgB,EAAE,mCAA6E;IAC/F,OAAO,EAAE,CAAC,iCAAuB,CAAC;IAClC,QAAQ,EAAE,EAAE;CACb,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venturialstd/workflow",
3
- "version": "0.1.51",
3
+ "version": "0.1.52",
4
4
  "description": "Workflow Module for Venturial",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",