yaveon.ecm.d3dwebhooks 0.12.5 → 0.12.7
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/js/features/Bucket/Yaveon.ECM.d3d.Webhook.Bucket.Logic.js +1 -1
- package/js/features/Bucket/Yaveon.ECM.d3d.Webhook.Bucket.Logic.js.map +1 -1
- package/js/features/Contract/Yaveon.ECM.d3d.Webhook.af.Contract.Logic.js +1 -0
- package/js/features/Contract/Yaveon.ECM.d3d.Webhook.af.Contract.Logic.js.map +1 -1
- package/js/features/Contract/Yaveon.ECM.d3d.Webhook.af.Contract.Utility.js +1 -1
- package/js/features/Contract/Yaveon.ECM.d3d.Webhook.af.Contract.Utility.js.map +1 -1
- package/js/features/Enrich/Yaveon.ECM.d3d.Webhook.Enrich.Logic.js +8 -4
- package/js/features/Enrich/Yaveon.ECM.d3d.Webhook.Enrich.Logic.js.map +1 -1
- package/js/features/Enrich/Yaveon.ECM.d3d.Webhook.Enrich.Utility.js +11 -7
- package/js/features/Enrich/Yaveon.ECM.d3d.Webhook.Enrich.Utility.js.map +1 -1
- package/js/features/Move/Yaveon.ECM.d3d.Webhook.Move.Utility.js +7 -5
- package/js/features/Move/Yaveon.ECM.d3d.Webhook.Move.Utility.js.map +1 -1
- package/js/features/Sync/Yaveon.ECM.d3d.Webhook.Sync.Utility.js +12 -10
- package/js/features/Sync/Yaveon.ECM.d3d.Webhook.Sync.Utility.js.map +1 -1
- package/package.json +3 -3
- package/js/features/Bucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Handler.d.ts +0 -2
- package/js/features/Bucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Handler.js +0 -24
- package/js/features/Bucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Handler.js.map +0 -1
- package/js/features/Bucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Interfaces.d.ts +0 -24
- package/js/features/Bucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Interfaces.js +0 -3
- package/js/features/Bucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Interfaces.js.map +0 -1
- package/js/features/Bucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Logic.d.ts +0 -4
- package/js/features/Bucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Logic.js +0 -121
- package/js/features/Bucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Logic.js.map +0 -1
- package/js/features/Bucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Utility.d.ts +0 -7
- package/js/features/Bucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Utility.js +0 -39
- package/js/features/Bucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Utility.js.map +0 -1
- package/js/features/UpdateBucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Handler.d.ts +0 -2
- package/js/features/UpdateBucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Handler.js +0 -24
- package/js/features/UpdateBucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Handler.js.map +0 -1
- package/js/features/UpdateBucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Interfaces.d.ts +0 -24
- package/js/features/UpdateBucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Interfaces.js +0 -3
- package/js/features/UpdateBucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Interfaces.js.map +0 -1
- package/js/features/UpdateBucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Logic.d.ts +0 -4
- package/js/features/UpdateBucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Logic.js +0 -121
- package/js/features/UpdateBucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Logic.js.map +0 -1
- package/js/features/UpdateBucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Utility.d.ts +0 -7
- package/js/features/UpdateBucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Utility.js +0 -39
- package/js/features/UpdateBucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Utility.js.map +0 -1
- package/js/features/alphaflow/Contract/Yaveon.ECM.d3d.Webhook.af.Contract.Constants.d.ts +0 -65
- package/js/features/alphaflow/Contract/Yaveon.ECM.d3d.Webhook.af.Contract.Constants.js +0 -79
- package/js/features/alphaflow/Contract/Yaveon.ECM.d3d.Webhook.af.Contract.Constants.js.map +0 -1
- package/js/features/alphaflow/Contract/Yaveon.ECM.d3d.Webhook.af.Contract.Handler.d.ts +0 -2
- package/js/features/alphaflow/Contract/Yaveon.ECM.d3d.Webhook.af.Contract.Handler.js +0 -28
- package/js/features/alphaflow/Contract/Yaveon.ECM.d3d.Webhook.af.Contract.Handler.js.map +0 -1
- package/js/features/alphaflow/Contract/Yaveon.ECM.d3d.Webhook.af.Contract.Interfaces.d.ts +0 -115
- package/js/features/alphaflow/Contract/Yaveon.ECM.d3d.Webhook.af.Contract.Interfaces.js +0 -4
- package/js/features/alphaflow/Contract/Yaveon.ECM.d3d.Webhook.af.Contract.Interfaces.js.map +0 -1
- package/js/features/alphaflow/Contract/Yaveon.ECM.d3d.Webhook.af.Contract.Logic.d.ts +0 -3
- package/js/features/alphaflow/Contract/Yaveon.ECM.d3d.Webhook.af.Contract.Logic.js +0 -80
- package/js/features/alphaflow/Contract/Yaveon.ECM.d3d.Webhook.af.Contract.Logic.js.map +0 -1
- package/js/features/alphaflow/Contract/Yaveon.ECM.d3d.Webhook.af.Contract.Utility.d.ts +0 -14
- package/js/features/alphaflow/Contract/Yaveon.ECM.d3d.Webhook.af.Contract.Utility.js +0 -245
- package/js/features/alphaflow/Contract/Yaveon.ECM.d3d.Webhook.af.Contract.Utility.js.map +0 -1
- package/js/features/alphaflow/QM/ReadReceipt/Yaveon.ECM.d3d.Webhook.af.ReadReceipt.Constants.d.ts +0 -14
- package/js/features/alphaflow/QM/ReadReceipt/Yaveon.ECM.d3d.Webhook.af.ReadReceipt.Constants.js +0 -22
- package/js/features/alphaflow/QM/ReadReceipt/Yaveon.ECM.d3d.Webhook.af.ReadReceipt.Constants.js.map +0 -1
- package/js/features/alphaflow/QM/ReadReceipt/Yaveon.ECM.d3d.Webhook.af.ReadReceipt.Handler.d.ts +0 -2
- package/js/features/alphaflow/QM/ReadReceipt/Yaveon.ECM.d3d.Webhook.af.ReadReceipt.Handler.js +0 -28
- package/js/features/alphaflow/QM/ReadReceipt/Yaveon.ECM.d3d.Webhook.af.ReadReceipt.Handler.js.map +0 -1
- package/js/features/alphaflow/QM/ReadReceipt/Yaveon.ECM.d3d.Webhook.af.ReadReceipt.Interfaces.d.ts +0 -37
- package/js/features/alphaflow/QM/ReadReceipt/Yaveon.ECM.d3d.Webhook.af.ReadReceipt.Interfaces.js +0 -3
- package/js/features/alphaflow/QM/ReadReceipt/Yaveon.ECM.d3d.Webhook.af.ReadReceipt.Interfaces.js.map +0 -1
- package/js/features/alphaflow/QM/ReadReceipt/Yaveon.ECM.d3d.Webhook.af.ReadReceipt.Logic.d.ts +0 -3
- package/js/features/alphaflow/QM/ReadReceipt/Yaveon.ECM.d3d.Webhook.af.ReadReceipt.Logic.js +0 -106
- package/js/features/alphaflow/QM/ReadReceipt/Yaveon.ECM.d3d.Webhook.af.ReadReceipt.Logic.js.map +0 -1
- package/js/features/alphaflow/QM/ReadReceipt/Yaveon.ECM.d3d.Webhook.af.ReadReceipt.Utility.d.ts +0 -6
- package/js/features/alphaflow/QM/ReadReceipt/Yaveon.ECM.d3d.Webhook.af.ReadReceipt.Utility.js +0 -35
- package/js/features/alphaflow/QM/ReadReceipt/Yaveon.ECM.d3d.Webhook.af.ReadReceipt.Utility.js.map +0 -1
- package/js/features/alphaflow/QM/Yaveon.ECM.d3d.Webhook.af.QM.Constants.d.ts +0 -31
- package/js/features/alphaflow/QM/Yaveon.ECM.d3d.Webhook.af.QM.Constants.js +0 -40
- package/js/features/alphaflow/QM/Yaveon.ECM.d3d.Webhook.af.QM.Constants.js.map +0 -1
- package/js/features/alphaflow/QM/Yaveon.ECM.d3d.Webhook.af.QM.Interfaces.d.ts +0 -62
- package/js/features/alphaflow/QM/Yaveon.ECM.d3d.Webhook.af.QM.Interfaces.js +0 -3
- package/js/features/alphaflow/QM/Yaveon.ECM.d3d.Webhook.af.QM.Interfaces.js.map +0 -1
- package/js/features/alphaflow/QM/Yaveon.ECM.d3d.Webhook.af.QM.Utility.d.ts +0 -7
- package/js/features/alphaflow/QM/Yaveon.ECM.d3d.Webhook.af.QM.Utility.js +0 -31
- package/js/features/alphaflow/QM/Yaveon.ECM.d3d.Webhook.af.QM.Utility.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Yaveon.ECM.d3d.Webhook.UpdateBucket.Utility.js","sourceRoot":"","sources":["../../../source/features/Bucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Utility.ts"],"names":[],"mappings":";;;AAAA,mFAAoE;AAWpE,MAAa,mBAAoB,SAAQ,mCAAU;IAE/C,MAAM,CAAC,eAAe,CAAC,YAA8C,EAAE,aAA6D;QAChI,IAAI,iBAAiB,GAAc,EAAE,CAAC;QAEtC,KAAK,MAAM,WAAW,IAAI,YAAY,CAAC,YAAY,EAAE;YACjD,IAAI,WAAW,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,WAAW,CAAC,QAAQ,CAAC,CAAA;YAC9E,IAAI,WAAW,EAAC;gBACZ,IAAI,SAAS,GAAG,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;gBACvD,IAAG,SAAS,CAAC,MAAM,GAAG,CAAC,EAAC;oBACpB,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;iBACxC;;oBACI,OAAO,SAAS,CAAC;aACzB;;gBACI,OAAO,SAAS,CAAC;SACzB;QAED,OAAO,iBAAiB,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IAC3D,CAAC;IAGD,MAAM,CAAC,kBAAkB,CAAC,QAA6C,EAAE,aAA6D;QAClI,IAAI,eAAe,GAAG,IAAI,GAAG,EAAiB,CAAC;QAE/C,KAAI,MAAM,OAAO,IAAI,QAAQ,EAAC;YAC1B,IAAI,YAAY,GAAa,EAAE,CAAC;YAChC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;gBACvC,IAAI,WAAW,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,WAAW,CAAC,QAAQ,CAAC,CAAC;gBAC/E,IAAG,WAAW,EAAC;oBACX,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;iBACpE;YACL,CAAC,CAAC,CAAC;YAEH,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,EAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;SAClF;QAED,OAAO,eAAe,CAAC;IAC3B,CAAC;CACJ;AAtCD,kDAsCC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handleRequest = void 0;
|
|
4
|
-
const Yaveon_ECM_d3d_Webhook_Constants_1 = require("../../constants/Yaveon.ECM.d3d.Webhook.Constants");
|
|
5
|
-
const Yaveon_ECM_d3d_Webhook_UpdateBucket_Logic_1 = require("./Yaveon.ECM.d3d.Webhook.UpdateBucket.Logic");
|
|
6
|
-
let handleRequest = async (req) => {
|
|
7
|
-
let event = req.params[Yaveon_ECM_d3d_Webhook_Constants_1.Constants.UrlParameters.ParamNames.Event];
|
|
8
|
-
switch (event) {
|
|
9
|
-
case Yaveon_ECM_d3d_Webhook_Constants_1.Constants.UrlParameters.EventNames.Create:
|
|
10
|
-
return (0, Yaveon_ECM_d3d_Webhook_UpdateBucket_Logic_1.add)(req);
|
|
11
|
-
case Yaveon_ECM_d3d_Webhook_Constants_1.Constants.UrlParameters.EventNames.Update:
|
|
12
|
-
return (0, Yaveon_ECM_d3d_Webhook_UpdateBucket_Logic_1.update)(req);
|
|
13
|
-
case Yaveon_ECM_d3d_Webhook_Constants_1.Constants.UrlParameters.EventNames.Remove:
|
|
14
|
-
return (0, Yaveon_ECM_d3d_Webhook_UpdateBucket_Logic_1.remove)(req);
|
|
15
|
-
default:
|
|
16
|
-
return {
|
|
17
|
-
reqBody: req.json(),
|
|
18
|
-
resultMsg: 'Event "' + event + '" unknown or not supported. Valid events: ' + Object.values(Yaveon_ECM_d3d_Webhook_Constants_1.Constants.UrlParameters.EventNames).join(", ") + '"',
|
|
19
|
-
resultState: 400
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
exports.handleRequest = handleRequest;
|
|
24
|
-
//# sourceMappingURL=Yaveon.ECM.d3d.Webhook.UpdateBucket.Handler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Yaveon.ECM.d3d.Webhook.UpdateBucket.Handler.js","sourceRoot":"","sources":["../../../source/features/UpdateBucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Handler.ts"],"names":[],"mappings":";;;AACA,uGAA6E;AAC7E,2GAGoD;AAE7C,IAAI,aAAa,GAAG,KAAK,EAAE,GAAQ,EAA6B,EAAE;IAErE,IAAI,KAAK,GAAW,GAAG,CAAC,MAAM,CAAC,4CAAS,CAAC,aAAa,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;IAExE,QAAQ,KAAK,EAAC;QACV,KAAK,4CAAS,CAAC,aAAa,CAAC,UAAU,CAAC,MAAM;YAC1C,OAAO,IAAA,+CAAG,EAAC,GAAG,CAAC,CAAC;QACpB,KAAK,4CAAS,CAAC,aAAa,CAAC,UAAU,CAAC,MAAM;YAC1C,OAAO,IAAA,kDAAM,EAAC,GAAG,CAAC,CAAC;QACvB,KAAK,4CAAS,CAAC,aAAa,CAAC,UAAU,CAAC,MAAM;YAC1C,OAAO,IAAA,kDAAM,EAAC,GAAG,CAAC,CAAC;QACvB;YACI,OAAO;gBACH,OAAO,EAAE,GAAG,CAAC,IAAI,EAAE;gBACnB,SAAS,EAAE,SAAS,GAAE,KAAK,GAAE,4CAA4C,GAAE,MAAM,CAAC,MAAM,CAAC,4CAAS,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAE,GAAG;gBAC5I,WAAW,EAAE,GAAG;aACnB,CAAC;KACT;AACL,CAAC,CAAA;AAlBU,QAAA,aAAa,iBAkBvB"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { IWebhookConfigKeyProperty } from '../../interfaces/Yaveon.ECM.d3d.Webhook.Interfaces';
|
|
2
|
-
export { IWebhookResponse, IDocPropertyObject, IDocMultiPropertyObject } from '../../interfaces/Yaveon.ECM.d3d.Webhook.Interfaces';
|
|
3
|
-
export interface IWebhookConfigBucketMappingFieldObject {
|
|
4
|
-
id: string | null;
|
|
5
|
-
uniqueId: string;
|
|
6
|
-
displayName: string;
|
|
7
|
-
}
|
|
8
|
-
export interface IWebhookConfigBucketObject extends IWebhookConfigKeyProperty {
|
|
9
|
-
bucketUrl: string;
|
|
10
|
-
rowKey: IWebhookConfigBucketRowKeyObject;
|
|
11
|
-
mappings: IWebhookConfigBucketMappingObject[];
|
|
12
|
-
}
|
|
13
|
-
export interface IWebhookConfigBucketRowKeyObject {
|
|
14
|
-
joinString: string;
|
|
15
|
-
sourceFields: IWebhookConfigBucketMappingFieldObject[];
|
|
16
|
-
}
|
|
17
|
-
export interface IWebhookConfigBucketMappingObject {
|
|
18
|
-
joinString: string;
|
|
19
|
-
sourceFields: IWebhookConfigBucketMappingFieldObject[];
|
|
20
|
-
targetField: string;
|
|
21
|
-
}
|
|
22
|
-
export interface IWebhookConfigBucket {
|
|
23
|
-
buckets: IWebhookConfigBucketObject[];
|
|
24
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Yaveon.ECM.d3d.Webhook.UpdateBucket.Interfaces.js","sourceRoot":"","sources":["../../../source/features/UpdateBucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { IWebhookResponse } from './Yaveon.ECM.d3d.Webhook.UpdateBucket.Interfaces';
|
|
2
|
-
export declare let add: (req: any) => Promise<IWebhookResponse>;
|
|
3
|
-
export declare let update: (req: any) => Promise<IWebhookResponse>;
|
|
4
|
-
export declare let remove: (req: any) => Promise<IWebhookResponse>;
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.remove = exports.update = exports.add = void 0;
|
|
4
|
-
const Yaveon_ECM_d3d_Webhook_Client_1 = require("../../clients/Yaveon.ECM.d3d.Webhook.Client");
|
|
5
|
-
const Yaveon_ECM_d3d_Webhook_UpdateBucket_Utility_1 = require("./Yaveon.ECM.d3d.Webhook.UpdateBucket.Utility");
|
|
6
|
-
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '1';
|
|
7
|
-
let add = async (req) => { return addUpdate(req); };
|
|
8
|
-
exports.add = add;
|
|
9
|
-
let update = async (req) => { return addUpdate(req); };
|
|
10
|
-
exports.update = update;
|
|
11
|
-
let addUpdate = async (req) => {
|
|
12
|
-
let webHookResponse = {
|
|
13
|
-
reqBody: req.json(),
|
|
14
|
-
resultMsg: '',
|
|
15
|
-
resultState: 200
|
|
16
|
-
};
|
|
17
|
-
let doc = webHookResponse.reqBody.doc;
|
|
18
|
-
try {
|
|
19
|
-
webHookResponse.resultMsg += 'Creating D3dWebhookClient object... ';
|
|
20
|
-
let client = new Yaveon_ECM_d3d_Webhook_Client_1.D3dWebhookClient(req.get('x-dv-baseuri'), req.get('x-dv-repository-id'), 'Bearer ' + req.get('Authorization').replace('Bearer ', ''));
|
|
21
|
-
webHookResponse.resultMsg += 'done\n';
|
|
22
|
-
webHookResponse.resultMsg += 'Retrieving configuration... ';
|
|
23
|
-
let config = await client.getConfiguration();
|
|
24
|
-
webHookResponse.resultMsg += 'done\n';
|
|
25
|
-
let bussinessObjectDefinitions = config.buckets;
|
|
26
|
-
const boDefinition = bussinessObjectDefinitions.find(x => x.uniqueId === doc.categoryId);
|
|
27
|
-
if (boDefinition !== undefined) {
|
|
28
|
-
let bucketRowKey = Yaveon_ECM_d3d_Webhook_UpdateBucket_Utility_1.UpdateBucketUtility.getBucketRowKey(boDefinition.rowKey, doc.properties);
|
|
29
|
-
if (bucketRowKey) {
|
|
30
|
-
let bucketRowValues = Yaveon_ECM_d3d_Webhook_UpdateBucket_Utility_1.UpdateBucketUtility.getBucketRowValues(boDefinition.mappings, doc.properties);
|
|
31
|
-
try {
|
|
32
|
-
let response = await client.updateBucketEntry(boDefinition.bucketUrl, bucketRowKey, bucketRowValues);
|
|
33
|
-
webHookResponse.resultMsg += '\r\nSuccessfully updated business object entry.';
|
|
34
|
-
console.log('Successfully updated business object entry.\n' + JSON.stringify(Object.fromEntries(bucketRowValues)));
|
|
35
|
-
}
|
|
36
|
-
catch (ex) {
|
|
37
|
-
let response = await client.newBucketEntry(boDefinition.bucketUrl, bucketRowValues);
|
|
38
|
-
webHookResponse.resultMsg += '\r\nSuccessfully added business object entry.';
|
|
39
|
-
console.log('Successfully added business object entry.\n' + JSON.stringify(Object.fromEntries(bucketRowValues)));
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
catch (ex) {
|
|
45
|
-
webHookResponse.resultState = 400;
|
|
46
|
-
webHookResponse.resultMsg += 'error\n';
|
|
47
|
-
if (ex.response.data) {
|
|
48
|
-
webHookResponse.resultMsg += ex.response.data;
|
|
49
|
-
}
|
|
50
|
-
else if (ex.Message) {
|
|
51
|
-
webHookResponse.resultMsg += ex.Message;
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
webHookResponse.resultMsg += ex.toString();
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return webHookResponse;
|
|
58
|
-
};
|
|
59
|
-
let remove = async (req) => {
|
|
60
|
-
let webHookResponse = {
|
|
61
|
-
reqBody: req.json(),
|
|
62
|
-
resultMsg: '',
|
|
63
|
-
resultState: 200
|
|
64
|
-
};
|
|
65
|
-
let doc = webHookResponse.reqBody.doc;
|
|
66
|
-
try {
|
|
67
|
-
if (doc.status === 'F') {
|
|
68
|
-
webHookResponse.resultMsg += 'Creating D3dWebhookClient object... ';
|
|
69
|
-
let client = new Yaveon_ECM_d3d_Webhook_Client_1.D3dWebhookClient(req.get('x-dv-baseuri'), req.get('x-dv-repository-id'), 'Bearer ' + req.get('Authorization').replace('Bearer ', ''));
|
|
70
|
-
webHookResponse.resultMsg += 'done\n';
|
|
71
|
-
webHookResponse.resultMsg += 'Retrieving configuration... ';
|
|
72
|
-
let config = await client.getConfiguration();
|
|
73
|
-
webHookResponse.resultMsg += 'done\n';
|
|
74
|
-
let bussinessObjectDefinitions = config.buckets;
|
|
75
|
-
const boDefinition = bussinessObjectDefinitions.find(bod => bod.uniqueId === doc.categoryId);
|
|
76
|
-
if (boDefinition !== undefined) {
|
|
77
|
-
let bucketRowKey = Yaveon_ECM_d3d_Webhook_UpdateBucket_Utility_1.UpdateBucketUtility.getBucketRowKey(boDefinition.rowKey, doc.properties);
|
|
78
|
-
if (bucketRowKey) {
|
|
79
|
-
try {
|
|
80
|
-
client.removeBucketEntry(boDefinition.bucketUrl, bucketRowKey);
|
|
81
|
-
console.log('Successfully deleted business object entry in ' + boDefinition.bucketUrl + ' with key ' + bucketRowKey + '.');
|
|
82
|
-
}
|
|
83
|
-
catch (ex) {
|
|
84
|
-
console.log('Unable to delete business object entry in ' + boDefinition.bucketUrl + ' with key ' + bucketRowKey + '.\r\n' + ex.Message);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
webHookResponse.resultState = 400;
|
|
89
|
-
webHookResponse.resultMsg = 'Unable to obtain key properties for bucket "' + boDefinition.uniqueId + '" from document\r\n' + JSON.stringify(doc);
|
|
90
|
-
console.log(webHookResponse.resultMsg);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
webHookResponse.resultState = 400;
|
|
95
|
-
webHookResponse.resultMsg = 'Unable to obtain corresponding object with uniqueId === "' + doc.categoryId + '" from configuration.';
|
|
96
|
-
console.log(webHookResponse.resultMsg);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
webHookResponse.resultState = 200;
|
|
101
|
-
webHookResponse.resultMsg = 'Deleting draft -> bucket will not be updated.';
|
|
102
|
-
console.log('Deleting draft -> bucket will not be updated.');
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
catch (ex) {
|
|
106
|
-
webHookResponse.resultState = 400;
|
|
107
|
-
webHookResponse.resultMsg += 'error\n';
|
|
108
|
-
if (ex.response.data) {
|
|
109
|
-
webHookResponse.resultMsg += ex.response.data;
|
|
110
|
-
}
|
|
111
|
-
else if (ex.Message) {
|
|
112
|
-
webHookResponse.resultMsg += ex.Message;
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
webHookResponse.resultMsg += ex.toString();
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
return webHookResponse;
|
|
119
|
-
};
|
|
120
|
-
exports.remove = remove;
|
|
121
|
-
//# sourceMappingURL=Yaveon.ECM.d3d.Webhook.UpdateBucket.Logic.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Yaveon.ECM.d3d.Webhook.UpdateBucket.Logic.js","sourceRoot":"","sources":["../../../source/features/UpdateBucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Logic.ts"],"names":[],"mappings":";;;AACA,+FAA+E;AAK/E,+GAAmF;AAGnF,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,GAAG,GAAG,CAAC;AAE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IAAG,EAAE,CAAC,OAAO,EAAC;YACf,eAAe,CAAC,SAAS,IAAI,EAAE,CAAC,OAAO,CAAC;SAC3C;aACG;YACA,eAAe,CAAC,SAAS,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC;SAC9C;KACJ;IACD,OAAO,eAAe,CAAC;AAC3B,CAAC,CAAA;AA/EU,QAAA,MAAM,UA+EhB"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { d3dUtility } from "../../utilities/Yaveon.ECM.d3d.Utility";
|
|
2
|
-
import { IDocPropertyObject, IDocMultiPropertyObject } from './Yaveon.ECM.d3d.Webhook.UpdateBucket.Interfaces';
|
|
3
|
-
import { IWebhookConfigBucketRowKeyObject, IWebhookConfigBucketMappingObject } from "./Yaveon.ECM.d3d.Webhook.UpdateBucket.Interfaces";
|
|
4
|
-
export declare class UpdateBucketUtility extends d3dUtility {
|
|
5
|
-
static getBucketRowKey(rowKeyObject: IWebhookConfigBucketRowKeyObject, docProperties: (IDocPropertyObject | IDocMultiPropertyObject)[]): string | undefined;
|
|
6
|
-
static getBucketRowValues(mappings: IWebhookConfigBucketMappingObject[], docProperties: (IDocPropertyObject | IDocMultiPropertyObject)[]): Map<string, string>;
|
|
7
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UpdateBucketUtility = void 0;
|
|
4
|
-
const Yaveon_ECM_d3d_Utility_1 = require("../../utilities/Yaveon.ECM.d3d.Utility");
|
|
5
|
-
class UpdateBucketUtility extends Yaveon_ECM_d3d_Utility_1.d3dUtility {
|
|
6
|
-
static getBucketRowKey(rowKeyObject, docProperties) {
|
|
7
|
-
let keyPropertyValues = [];
|
|
8
|
-
for (const sourceField of rowKeyObject.sourceFields) {
|
|
9
|
-
let keyProperty = docProperties.find(prop => prop.id === sourceField.uniqueId);
|
|
10
|
-
if (keyProperty) {
|
|
11
|
-
let keyValues = this.getDocPropertyValues(keyProperty);
|
|
12
|
-
if (keyValues.length > 0) {
|
|
13
|
-
keyPropertyValues.push(keyValues[0]);
|
|
14
|
-
}
|
|
15
|
-
else
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
else
|
|
19
|
-
return undefined;
|
|
20
|
-
}
|
|
21
|
-
return keyPropertyValues.join(rowKeyObject.joinString);
|
|
22
|
-
}
|
|
23
|
-
static getBucketRowValues(mappings, docProperties) {
|
|
24
|
-
let bucketRowValues = new Map();
|
|
25
|
-
for (const mapping of mappings) {
|
|
26
|
-
let targetValues = [];
|
|
27
|
-
mapping.sourceFields.forEach(sourceField => {
|
|
28
|
-
let docProperty = docProperties.find(prop => prop.id === sourceField.uniqueId);
|
|
29
|
-
if (docProperty) {
|
|
30
|
-
targetValues.push(this.getDocPropertyValues(docProperty).join());
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
bucketRowValues.set(mapping.targetField, targetValues.join(mapping.joinString));
|
|
34
|
-
}
|
|
35
|
-
return bucketRowValues;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.UpdateBucketUtility = UpdateBucketUtility;
|
|
39
|
-
//# sourceMappingURL=Yaveon.ECM.d3d.Webhook.UpdateBucket.Utility.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Yaveon.ECM.d3d.Webhook.UpdateBucket.Utility.js","sourceRoot":"","sources":["../../../source/features/UpdateBucket/Yaveon.ECM.d3d.Webhook.UpdateBucket.Utility.ts"],"names":[],"mappings":";;;AAAA,mFAAoE;AAWpE,MAAa,mBAAoB,SAAQ,mCAAU;IAE/C,MAAM,CAAC,eAAe,CAAC,YAA8C,EAAE,aAA6D;QAChI,IAAI,iBAAiB,GAAc,EAAE,CAAC;QAEtC,KAAK,MAAM,WAAW,IAAI,YAAY,CAAC,YAAY,EAAE;YACjD,IAAI,WAAW,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC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
export declare class Constants extends _constants {
|
|
3
|
-
}
|
|
4
|
-
export declare namespace Constants {
|
|
5
|
-
namespace Contracts {
|
|
6
|
-
enum ContractStates {
|
|
7
|
-
Concept = "CONCEPT",
|
|
8
|
-
Negotiation = "NEGOTIATION",
|
|
9
|
-
Valid = "VALID",
|
|
10
|
-
Canceled = "CANCELED",
|
|
11
|
-
Suspended = "SUSPENDED",
|
|
12
|
-
Expired = "EXPIRED"
|
|
13
|
-
}
|
|
14
|
-
enum ServiceEndpoints {
|
|
15
|
-
Contracts = "/alphaflow-contract/contractservice/contracts"
|
|
16
|
-
}
|
|
17
|
-
enum OwnRole {
|
|
18
|
-
Active = "ACTIVE",
|
|
19
|
-
Passive = "PASSIVE",
|
|
20
|
-
Coop = "COOPERATION"
|
|
21
|
-
}
|
|
22
|
-
enum AutomaticRenewal {
|
|
23
|
-
Auto = "AUTOMATIC",
|
|
24
|
-
None = "NONE"
|
|
25
|
-
}
|
|
26
|
-
enum TerminationUnit {
|
|
27
|
-
Days = "DAYS",
|
|
28
|
-
Weeks = "WEEKS",
|
|
29
|
-
Months = "MONTHS",
|
|
30
|
-
Years = "YEARS"
|
|
31
|
-
}
|
|
32
|
-
enum TerminationCalendarEvent {
|
|
33
|
-
Any = "ANYTIME",
|
|
34
|
-
ExactDay = "EXACTDAY",
|
|
35
|
-
EndOfMonth = "ENDOFMONTH",
|
|
36
|
-
EndOfQuarter = "ENDOFQUARTER",
|
|
37
|
-
EndOfSemester = "ENDOFSEMESTER",
|
|
38
|
-
EndOfYear = "ENDOFYEAR",
|
|
39
|
-
Termination = "TERMINATION"
|
|
40
|
-
}
|
|
41
|
-
enum ToType {
|
|
42
|
-
boolean = "boolean",
|
|
43
|
-
Date = "date",
|
|
44
|
-
IAfAutomaticRenewalProperty = "IAfAutomaticRenewalProperty",
|
|
45
|
-
IAfContractStatusProperty = "IAfContractStatusProperty",
|
|
46
|
-
IAfCustomFieldProperty = "IAfCustomFieldProperty",
|
|
47
|
-
IAfGenericIdProperty = "IAfGenericIdProperty",
|
|
48
|
-
IAfOwnRoleProperty = "IAfOwnRoleProperty",
|
|
49
|
-
IAfTerminationCalendarEventProperty = "IAfTerminationCalendarEventProperty",
|
|
50
|
-
IAfTerminationUnitProperty = "IAfTerminationUnitProperty",
|
|
51
|
-
number = "number",
|
|
52
|
-
string = "string"
|
|
53
|
-
}
|
|
54
|
-
enum ConfigProperty {
|
|
55
|
-
Default = "default",
|
|
56
|
-
Id = "id",
|
|
57
|
-
Static = "static",
|
|
58
|
-
ToCustomPropertyId = "toCustomPropertyId",
|
|
59
|
-
ToPropertyName = "toPropertyName",
|
|
60
|
-
Translation = "translation",
|
|
61
|
-
Value = "value",
|
|
62
|
-
RegEx = "regex"
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Constants = void 0;
|
|
4
|
-
const Yaveon_ECM_d3d_Webhook_af_Constants_1 = require("../../../constants/Yaveon.ECM.d3d.Webhook.af.Constants");
|
|
5
|
-
class Constants extends Yaveon_ECM_d3d_Webhook_af_Constants_1.Constants {
|
|
6
|
-
}
|
|
7
|
-
exports.Constants = Constants;
|
|
8
|
-
(function (Constants) {
|
|
9
|
-
let Contracts;
|
|
10
|
-
(function (Contracts) {
|
|
11
|
-
let ContractStates;
|
|
12
|
-
(function (ContractStates) {
|
|
13
|
-
ContractStates["Concept"] = "CONCEPT";
|
|
14
|
-
ContractStates["Negotiation"] = "NEGOTIATION";
|
|
15
|
-
ContractStates["Valid"] = "VALID";
|
|
16
|
-
ContractStates["Canceled"] = "CANCELED";
|
|
17
|
-
ContractStates["Suspended"] = "SUSPENDED";
|
|
18
|
-
ContractStates["Expired"] = "EXPIRED";
|
|
19
|
-
})(ContractStates = Contracts.ContractStates || (Contracts.ContractStates = {}));
|
|
20
|
-
let ServiceEndpoints;
|
|
21
|
-
(function (ServiceEndpoints) {
|
|
22
|
-
ServiceEndpoints["Contracts"] = "/alphaflow-contract/contractservice/contracts";
|
|
23
|
-
})(ServiceEndpoints = Contracts.ServiceEndpoints || (Contracts.ServiceEndpoints = {}));
|
|
24
|
-
let OwnRole;
|
|
25
|
-
(function (OwnRole) {
|
|
26
|
-
OwnRole["Active"] = "ACTIVE";
|
|
27
|
-
OwnRole["Passive"] = "PASSIVE";
|
|
28
|
-
OwnRole["Coop"] = "COOPERATION";
|
|
29
|
-
})(OwnRole = Contracts.OwnRole || (Contracts.OwnRole = {}));
|
|
30
|
-
let AutomaticRenewal;
|
|
31
|
-
(function (AutomaticRenewal) {
|
|
32
|
-
AutomaticRenewal["Auto"] = "AUTOMATIC";
|
|
33
|
-
AutomaticRenewal["None"] = "NONE";
|
|
34
|
-
})(AutomaticRenewal = Contracts.AutomaticRenewal || (Contracts.AutomaticRenewal = {}));
|
|
35
|
-
let TerminationUnit;
|
|
36
|
-
(function (TerminationUnit) {
|
|
37
|
-
TerminationUnit["Days"] = "DAYS";
|
|
38
|
-
TerminationUnit["Weeks"] = "WEEKS";
|
|
39
|
-
TerminationUnit["Months"] = "MONTHS";
|
|
40
|
-
TerminationUnit["Years"] = "YEARS";
|
|
41
|
-
})(TerminationUnit = Contracts.TerminationUnit || (Contracts.TerminationUnit = {}));
|
|
42
|
-
let TerminationCalendarEvent;
|
|
43
|
-
(function (TerminationCalendarEvent) {
|
|
44
|
-
TerminationCalendarEvent["Any"] = "ANYTIME";
|
|
45
|
-
TerminationCalendarEvent["ExactDay"] = "EXACTDAY";
|
|
46
|
-
TerminationCalendarEvent["EndOfMonth"] = "ENDOFMONTH";
|
|
47
|
-
TerminationCalendarEvent["EndOfQuarter"] = "ENDOFQUARTER";
|
|
48
|
-
TerminationCalendarEvent["EndOfSemester"] = "ENDOFSEMESTER";
|
|
49
|
-
TerminationCalendarEvent["EndOfYear"] = "ENDOFYEAR";
|
|
50
|
-
TerminationCalendarEvent["Termination"] = "TERMINATION";
|
|
51
|
-
})(TerminationCalendarEvent = Contracts.TerminationCalendarEvent || (Contracts.TerminationCalendarEvent = {}));
|
|
52
|
-
let ToType;
|
|
53
|
-
(function (ToType) {
|
|
54
|
-
ToType["boolean"] = "boolean";
|
|
55
|
-
ToType["Date"] = "date";
|
|
56
|
-
ToType["IAfAutomaticRenewalProperty"] = "IAfAutomaticRenewalProperty";
|
|
57
|
-
ToType["IAfContractStatusProperty"] = "IAfContractStatusProperty";
|
|
58
|
-
ToType["IAfCustomFieldProperty"] = "IAfCustomFieldProperty";
|
|
59
|
-
ToType["IAfGenericIdProperty"] = "IAfGenericIdProperty";
|
|
60
|
-
ToType["IAfOwnRoleProperty"] = "IAfOwnRoleProperty";
|
|
61
|
-
ToType["IAfTerminationCalendarEventProperty"] = "IAfTerminationCalendarEventProperty";
|
|
62
|
-
ToType["IAfTerminationUnitProperty"] = "IAfTerminationUnitProperty";
|
|
63
|
-
ToType["number"] = "number";
|
|
64
|
-
ToType["string"] = "string";
|
|
65
|
-
})(ToType = Contracts.ToType || (Contracts.ToType = {}));
|
|
66
|
-
let ConfigProperty;
|
|
67
|
-
(function (ConfigProperty) {
|
|
68
|
-
ConfigProperty["Default"] = "default";
|
|
69
|
-
ConfigProperty["Id"] = "id";
|
|
70
|
-
ConfigProperty["Static"] = "static";
|
|
71
|
-
ConfigProperty["ToCustomPropertyId"] = "toCustomPropertyId";
|
|
72
|
-
ConfigProperty["ToPropertyName"] = "toPropertyName";
|
|
73
|
-
ConfigProperty["Translation"] = "translation";
|
|
74
|
-
ConfigProperty["Value"] = "value";
|
|
75
|
-
ConfigProperty["RegEx"] = "regex";
|
|
76
|
-
})(ConfigProperty = Contracts.ConfigProperty || (Contracts.ConfigProperty = {}));
|
|
77
|
-
})(Contracts = Constants.Contracts || (Constants.Contracts = {}));
|
|
78
|
-
})(Constants || (exports.Constants = Constants = {}));
|
|
79
|
-
//# sourceMappingURL=Yaveon.ECM.d3d.Webhook.af.Contract.Constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Yaveon.ECM.d3d.Webhook.af.Contract.Constants.js","sourceRoot":"","sources":["../../../../source/features/alphaflow/Contract/Yaveon.ECM.d3d.Webhook.af.Contract.Constants.ts"],"names":[],"mappings":";;;AAAA,gHAAgG;AAEhG,MAAa,SAAU,SAAQ,+CAAU;CACxC;AADD,8BACC;AAED,WAAiB,SAAS;IACtB,IAAiB,SAAS,CAkEzB;IAlED,WAAiB,SAAS;QACtB,IAAY,cAOX;QAPD,WAAY,cAAc;YACtB,qCAAmB,CAAA;YACnB,6CAA2B,CAAA;YAC3B,iCAAe,CAAA;YACf,uCAAqB,CAAA;YACrB,yCAAuB,CAAA;YACvB,qCAAmB,CAAA;QACvB,CAAC,EAPW,cAAc,GAAd,wBAAc,KAAd,wBAAc,QAOzB;QAED,IAAY,gBAEX;QAFD,WAAY,gBAAgB;YACxB,+EAA2D,CAAA;QAC/D,CAAC,EAFW,gBAAgB,GAAhB,0BAAgB,KAAhB,0BAAgB,QAE3B;QAED,IAAY,OAIX;QAJD,WAAY,OAAO;YACf,4BAAiB,CAAA;YACjB,8BAAmB,CAAA;YACnB,+BAAoB,CAAA;QACxB,CAAC,EAJW,OAAO,GAAP,iBAAO,KAAP,iBAAO,QAIlB;QAED,IAAY,gBAGX;QAHD,WAAY,gBAAgB;YACxB,sCAAkB,CAAA;YAClB,iCAAa,CAAA;QACjB,CAAC,EAHW,gBAAgB,GAAhB,0BAAgB,KAAhB,0BAAgB,QAG3B;QAED,IAAY,eAKX;QALD,WAAY,eAAe;YACvB,gCAAa,CAAA;YACb,kCAAe,CAAA;YACf,oCAAiB,CAAA;YACjB,kCAAe,CAAA;QACnB,CAAC,EALW,eAAe,GAAf,yBAAe,KAAf,yBAAe,QAK1B;QAED,IAAY,wBAQX;QARD,WAAY,wBAAwB;YAChC,2CAAe,CAAA;YACf,iDAAqB,CAAA;YACrB,qDAAyB,CAAA;YACzB,yDAA6B,CAAA;YAC7B,2DAA+B,CAAA;YAC/B,mDAAuB,CAAA;YACvB,uDAA2B,CAAA;QAC/B,CAAC,EARW,wBAAwB,GAAxB,kCAAwB,KAAxB,kCAAwB,QAQnC;QAED,IAAY,MAYX;QAZD,WAAY,MAAM;YACd,6BAAmB,CAAA;YACnB,uBAAa,CAAA;YACb,qEAA2D,CAAA;YAC3D,iEAAuD,CAAA;YACvD,2DAAiD,CAAA;YACjD,uDAA6C,CAAA;YAC7C,mDAAyC,CAAA;YACzC,qFAA2E,CAAA;YAC3E,mEAAyD,CAAA;YACzD,2BAAiB,CAAA;YACjB,2BAAiB,CAAA;QACrB,CAAC,EAZW,MAAM,GAAN,gBAAM,KAAN,gBAAM,QAYjB;QAED,IAAY,cASX;QATD,WAAY,cAAc;YACtB,qCAAmB,CAAA;YACnB,2BAAS,CAAA;YACT,mCAAiB,CAAA;YACjB,2DAAyC,CAAA;YACzC,mDAAiC,CAAA;YACjC,6CAA2B,CAAA;YAC3B,iCAAe,CAAA;YACf,iCAAe,CAAA;QACnB,CAAC,EATW,cAAc,GAAd,wBAAc,KAAd,wBAAc,QASzB;IACL,CAAC,EAlEgB,SAAS,GAAT,mBAAS,KAAT,mBAAS,QAkEzB;AACL,CAAC,EApEgB,SAAS,yBAAT,SAAS,QAoEzB"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handleRequest = void 0;
|
|
4
|
-
const Yaveon_ECM_d3d_Webhook_af_Contract_Constants_1 = require("./Yaveon.ECM.d3d.Webhook.af.Contract.Constants");
|
|
5
|
-
const Yaveon_ECM_d3d_Webhook_af_Contract_Logic_1 = require("./Yaveon.ECM.d3d.Webhook.af.Contract.Logic");
|
|
6
|
-
let handleRequest = async (req) => {
|
|
7
|
-
let event = req.params[Yaveon_ECM_d3d_Webhook_af_Contract_Constants_1.Constants.UrlParameters.ParamNames.Event];
|
|
8
|
-
switch (event) {
|
|
9
|
-
case Yaveon_ECM_d3d_Webhook_af_Contract_Constants_1.Constants.UrlParameters.EventNames.Create:
|
|
10
|
-
return (0, Yaveon_ECM_d3d_Webhook_af_Contract_Logic_1.add)(req);
|
|
11
|
-
case Yaveon_ECM_d3d_Webhook_af_Contract_Constants_1.Constants.UrlParameters.EventNames.Update:
|
|
12
|
-
return (0, Yaveon_ECM_d3d_Webhook_af_Contract_Logic_1.update)(req);
|
|
13
|
-
case Yaveon_ECM_d3d_Webhook_af_Contract_Constants_1.Constants.UrlParameters.EventNames.Remove:
|
|
14
|
-
return {
|
|
15
|
-
reqBody: req.json(),
|
|
16
|
-
resultMsg: 'Event "' + event + '" does not require any custom logic.',
|
|
17
|
-
resultState: 200
|
|
18
|
-
};
|
|
19
|
-
default:
|
|
20
|
-
return {
|
|
21
|
-
reqBody: req.json(),
|
|
22
|
-
resultMsg: 'Event "' + event + '" unknown or not supported. Valid events: ' + Object.values(Yaveon_ECM_d3d_Webhook_af_Contract_Constants_1.Constants.UrlParameters.EventNames).join(", ") + '"',
|
|
23
|
-
resultState: 400
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
exports.handleRequest = handleRequest;
|
|
28
|
-
//# sourceMappingURL=Yaveon.ECM.d3d.Webhook.af.Contract.Handler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Yaveon.ECM.d3d.Webhook.af.Contract.Handler.js","sourceRoot":"","sources":["../../../../source/features/alphaflow/Contract/Yaveon.ECM.d3d.Webhook.af.Contract.Handler.ts"],"names":[],"mappings":";;;AACA,iHAA2E;AAC3E,yGAGmD;AAE5C,IAAI,aAAa,GAAG,KAAK,EAAE,GAAQ,EAA6B,EAAE;IAErE,IAAI,KAAK,GAAW,GAAG,CAAC,MAAM,CAAC,wDAAS,CAAC,aAAa,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;IAExE,QAAQ,KAAK,EAAC;QACV,KAAK,wDAAS,CAAC,aAAa,CAAC,UAAU,CAAC,MAAM;YACtC,OAAO,IAAA,8CAAG,EAAC,GAAG,CAAC,CAAC;QACxB,KAAK,wDAAS,CAAC,aAAa,CAAC,UAAU,CAAC,MAAM;YACtC,OAAO,IAAA,iDAAM,EAAC,GAAG,CAAC,CAAC;QAC3B,KAAK,wDAAS,CAAC,aAAa,CAAC,UAAU,CAAC,MAAM;YAC1C,OAAO;gBACH,OAAO,EAAE,GAAG,CAAC,IAAI,EAAE;gBACnB,SAAS,EAAE,SAAS,GAAE,KAAK,GAAE,sCAAsC;gBACnE,WAAW,EAAE,GAAG;aACnB,CAAC;QACN;YACI,OAAO;gBACH,OAAO,EAAE,GAAG,CAAC,IAAI,EAAE;gBACnB,SAAS,EAAE,SAAS,GAAE,KAAK,GAAE,4CAA4C,GAAE,MAAM,CAAC,MAAM,CAAC,wDAAS,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAE,GAAG;gBAC5I,WAAW,EAAE,GAAG;aACnB,CAAC;KACT;AACL,CAAC,CAAA;AAtBU,QAAA,aAAa,iBAsBvB"}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { IAfGenericIdProperty } from '../../../interfaces/Yaveon.ECM.d3d.Webhook.af.Interfaces';
|
|
2
|
-
import { Constants } from './Yaveon.ECM.d3d.Webhook.af.Contract.Constants';
|
|
3
|
-
export { IAfGenericIdProperty } from '../../../interfaces/Yaveon.ECM.d3d.Webhook.af.Interfaces';
|
|
4
|
-
export { IWebhookResponse } from '../../../interfaces/Yaveon.ECM.d3d.Webhook.Interfaces';
|
|
5
|
-
export interface IAfNewContract {
|
|
6
|
-
[key: string]: any;
|
|
7
|
-
responsible: IAfGenericIdProperty | null;
|
|
8
|
-
contractType: IAfGenericIdProperty | null;
|
|
9
|
-
subject: string;
|
|
10
|
-
contractStatus: IAfContractStatusProperty | null;
|
|
11
|
-
externalNumber: string;
|
|
12
|
-
relatedFrameContract: IAfGenericIdProperty | null;
|
|
13
|
-
frameContract: boolean;
|
|
14
|
-
organization: IAfGenericIdProperty | null;
|
|
15
|
-
ownRole: IAfOwnRoleProperty | null;
|
|
16
|
-
tradingPartner: IAfGenericIdProperty | null;
|
|
17
|
-
contact: IAfGenericIdProperty | null;
|
|
18
|
-
ownSignature: Date | null;
|
|
19
|
-
partnerSignature: Date | null;
|
|
20
|
-
startDate: Date | null;
|
|
21
|
-
endDate: Date | null;
|
|
22
|
-
duration: number | null;
|
|
23
|
-
renewalDate: Date | null;
|
|
24
|
-
followingContractPeriod: string;
|
|
25
|
-
automaticRenewal: IAfAutomaticRenewalProperty | null;
|
|
26
|
-
terminationValue: number | null;
|
|
27
|
-
terminationUnit: IAfTerminationUnitProperty | null;
|
|
28
|
-
terminationCalendarEvent: IAfTerminationCalendarEventProperty | null;
|
|
29
|
-
firstTermination: Date | null;
|
|
30
|
-
nextTermination: Date | null;
|
|
31
|
-
terminationDate: Date | null;
|
|
32
|
-
terminationBy: IAfGenericIdProperty | null;
|
|
33
|
-
terminationRemark: string;
|
|
34
|
-
customFields: {
|
|
35
|
-
[key: string]: IAfCustomFieldProperty;
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
export interface IAfContract extends IAfNewContract {
|
|
39
|
-
id: string;
|
|
40
|
-
internalNumber: string;
|
|
41
|
-
}
|
|
42
|
-
export interface IAfContractStatusProperty {
|
|
43
|
-
value: Constants.Contracts.ContractStates;
|
|
44
|
-
}
|
|
45
|
-
export interface IAfOwnRoleProperty {
|
|
46
|
-
value: Constants.Contracts.OwnRole;
|
|
47
|
-
}
|
|
48
|
-
export interface IAfAutomaticRenewalProperty {
|
|
49
|
-
value: Constants.Contracts.AutomaticRenewal;
|
|
50
|
-
}
|
|
51
|
-
export interface IAfTerminationUnitProperty {
|
|
52
|
-
value: Constants.Contracts.TerminationUnit;
|
|
53
|
-
}
|
|
54
|
-
export interface IAfTerminationCalendarEventProperty {
|
|
55
|
-
value: Constants.Contracts.TerminationCalendarEvent;
|
|
56
|
-
}
|
|
57
|
-
export interface IAfCustomFieldProperty {
|
|
58
|
-
value: string;
|
|
59
|
-
configID: string;
|
|
60
|
-
}
|
|
61
|
-
export interface IWebhookConfigAfContract {
|
|
62
|
-
contract: IWebhhokConfigAfContractProperty;
|
|
63
|
-
}
|
|
64
|
-
export interface IWebhhokConfigAfContractProperty {
|
|
65
|
-
translations: IWebhookConfigAfContractTranslation[];
|
|
66
|
-
mappings: IWebhookConfigAfContractMapping[];
|
|
67
|
-
}
|
|
68
|
-
export interface IWebhookConfigAfContractMapping {
|
|
69
|
-
fromCategoryGuid: string;
|
|
70
|
-
fromCategoryId?: string;
|
|
71
|
-
fromCategoryName?: string;
|
|
72
|
-
propertyMapping: (IWebhookConfigAfContractPropertyMapping | IWebhookConfigAfContractCustomPropertyMapping)[];
|
|
73
|
-
toContractKeys: IWebhookConfigAfContractKey[];
|
|
74
|
-
returnMapping: IWebhookConfigAfContractReturnMapping[];
|
|
75
|
-
}
|
|
76
|
-
export interface IWebhookConfigAfContractKey {
|
|
77
|
-
toPropertyName: string;
|
|
78
|
-
subProperty?: string;
|
|
79
|
-
}
|
|
80
|
-
interface IWebhookConfigAfContractPropertyMappingBase {
|
|
81
|
-
fromPropertyGuid: string;
|
|
82
|
-
fromPropertyId?: string;
|
|
83
|
-
fromPropertyName: string;
|
|
84
|
-
toType: Constants.Contracts.ToType;
|
|
85
|
-
default?: any;
|
|
86
|
-
mandatory?: boolean;
|
|
87
|
-
static?: any;
|
|
88
|
-
translation?: string;
|
|
89
|
-
regex?: string;
|
|
90
|
-
}
|
|
91
|
-
export interface IWebhookConfigAfContractPropertyMapping extends IWebhookConfigAfContractPropertyMappingBase {
|
|
92
|
-
toPropertyName: string;
|
|
93
|
-
}
|
|
94
|
-
export interface IWebhookConfigAfContractCustomPropertyMapping extends IWebhookConfigAfContractPropertyMappingBase {
|
|
95
|
-
toCustomPropertyId: string;
|
|
96
|
-
}
|
|
97
|
-
export interface IWebhookConfigAfContractReturnMapping {
|
|
98
|
-
fromPropertyName: string;
|
|
99
|
-
toPropertyGuid: string;
|
|
100
|
-
toPropertyId?: string;
|
|
101
|
-
toPropertyName?: string;
|
|
102
|
-
}
|
|
103
|
-
export interface IWebhookConfigAfContractTranslation {
|
|
104
|
-
id: string;
|
|
105
|
-
keyValues: TGenericObject;
|
|
106
|
-
}
|
|
107
|
-
export type TSearchProperty = TGenericObject;
|
|
108
|
-
export type TTenantMapping = TGenericObject;
|
|
109
|
-
type TGenericObject = {
|
|
110
|
-
[key: string]: any;
|
|
111
|
-
};
|
|
112
|
-
export type TCheckMandatoryResult = {
|
|
113
|
-
outcome: boolean;
|
|
114
|
-
missing: string[];
|
|
115
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Yaveon.ECM.d3d.Webhook.af.Contract.Interfaces.js","sourceRoot":"","sources":["../../../../source/features/alphaflow/Contract/Yaveon.ECM.d3d.Webhook.af.Contract.Interfaces.ts"],"names":[],"mappings":";;AA8CC,CAAC"}
|