@betterview/integration-toolkit 3.2.0 → 4.0.0
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/lib/Deployment/index.js +4 -4
- package/lib/Deployment/index.js.map +1 -1
- package/lib/TestHarness/index.d.ts +3 -3
- package/lib/TestHarness/index.d.ts.map +1 -1
- package/lib/TestHarness/index.js +1 -1
- package/lib/TestHarness/index.js.map +1 -1
- package/lib/types/{IEnrichmentIntegration.d.ts → Enrichment.d.ts} +10 -3
- package/lib/types/Enrichment.d.ts.map +1 -0
- package/lib/types/Enrichment.js +16 -0
- package/lib/types/Enrichment.js.map +1 -0
- package/lib/types/EnrichmentComponentArgs.d.ts +1 -0
- package/lib/types/EnrichmentComponentArgs.d.ts.map +1 -1
- package/lib/types/Events.d.ts +6 -0
- package/lib/types/Events.d.ts.map +1 -0
- package/lib/types/Events.js +10 -0
- package/lib/types/Events.js.map +1 -0
- package/lib/types/Integration.d.ts +21 -0
- package/lib/types/Integration.d.ts.map +1 -0
- package/lib/types/Integration.js +29 -0
- package/lib/types/Integration.js.map +1 -0
- package/lib/types/IntegrationManifest.d.ts +29 -0
- package/lib/types/IntegrationManifest.d.ts.map +1 -1
- package/lib/types/index.d.ts +3 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +3 -1
- package/lib/types/index.js.map +1 -1
- package/package.json +6 -6
- package/lib/types/IEnrichmentIntegration.d.ts.map +0 -1
- package/lib/types/IEnrichmentIntegration.js +0 -3
- package/lib/types/IEnrichmentIntegration.js.map +0 -1
package/lib/Deployment/index.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.generateDatabaseScripts = void 0;
|
|
|
4
4
|
function generateDatabaseScripts(integration) {
|
|
5
5
|
const { partner, offering, description, abstract, contact_email, contact_name, website_url } = integration;
|
|
6
6
|
const intName = `${partner.toLowerCase()}_${offering.toLowerCase()}`;
|
|
7
|
-
const ph_create = `
|
|
7
|
+
const ph_create = /* sql */ `
|
|
8
8
|
do $$
|
|
9
9
|
declare offering_id bigint;
|
|
10
10
|
begin
|
|
@@ -24,13 +24,13 @@ function generateDatabaseScripts(integration) {
|
|
|
24
24
|
create index if not exists idx_ph_${intName}_property_id on ph.${intName}(property_id);
|
|
25
25
|
end$$
|
|
26
26
|
`;
|
|
27
|
-
const ph_rollback = `
|
|
27
|
+
const ph_rollback = /* sql */ `
|
|
28
28
|
drop index if exists idx_ph_${intName}_property_id;
|
|
29
29
|
drop table ph.${intName};
|
|
30
30
|
delete from ph.offering_detail where partner_offering_id = <partner_offering_id>
|
|
31
31
|
delete from ph.offering_card where partner_offering_id = <partner_offering_id>
|
|
32
32
|
`;
|
|
33
|
-
const flag_create = `
|
|
33
|
+
const flag_create = /* sql */ `
|
|
34
34
|
do $$
|
|
35
35
|
declare
|
|
36
36
|
sectionid bigint;
|
|
@@ -46,7 +46,7 @@ function generateDatabaseScripts(integration) {
|
|
|
46
46
|
values (subsectionid, 'Match Value(s)', 'value', '${intName}', 'custom', 'Case-insesitive, comma separated');
|
|
47
47
|
end $$;
|
|
48
48
|
`;
|
|
49
|
-
const flag_rollback = `
|
|
49
|
+
const flag_rollback = /* sql */ `
|
|
50
50
|
delete from flags.option where source = '${intName}' and key = 'custom';
|
|
51
51
|
delete from flags.options_subsection where display = '${partner} ${offering}';
|
|
52
52
|
delete from flags.options_section where display = '${partner}' and position = 999;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Deployment/index.ts"],"names":[],"mappings":";;;AAYA,SAAgB,uBAAuB,CAAC,WAAgC;IACtE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,WAAW,CAAC;IAC3G,MAAM,OAAO,GAAG,GAAG,OAAO,CAAC,WAAW,EAAE,IAAI,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC;IAErE,MAAM,SAAS,GAAG;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Deployment/index.ts"],"names":[],"mappings":";;;AAYA,SAAgB,uBAAuB,CAAC,WAAgC;IACtE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,WAAW,CAAC;IAC3G,MAAM,OAAO,GAAG,GAAG,OAAO,CAAC,WAAW,EAAE,IAAI,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC;IAErE,MAAM,SAAS,GAAG,SAAS,CAAC;;;;oCAIM,OAAO;;;;;;;;kHAQuE,OAAO,OAAO,QAAQ,OAAO,OAAO,eAAe,OAAO;mKACT,OAAO,OAAO,QAAQ,OAAO,WAAW,OAAO,YAAY,OAAO,aAAa,OAAO,WAAW,OAAO,QAAQ;iGAClL,OAAO,MAAM,QAAQ,+BAA+B,OAAO;;;wCAGpH,OAAO,sBAAsB,OAAO;;GAEzE,CAAC;IAEF,MAAM,WAAW,GAAG,SAAS,CAAC;kCACE,OAAO;oBACrB,OAAO;;;GAGxB,CAAC;IAEF,MAAM,WAAW,GAAG,SAAS,CAAC;;;;;;gFAMgD,OAAO;;;8BAGzD,OAAO,IAAI,QAAQ;;;;4DAIW,OAAO;;KAE9D,CAAC;IAEJ,MAAM,aAAa,GAAG,SAAS,CAAC;+CACa,OAAO;4DACM,OAAO,IAAI,QAAQ;yDACtB,OAAO;GAC7D,CAAC;IAEF,OAAO;QACL,eAAe,EAAE;YACf,GAAG,EAAE,SAAS;YACd,QAAQ,EAAE,WAAW;SACtB;QACD,aAAa,EAAE;YACb,GAAG,EAAE,WAAW;YAChB,QAAQ,EAAE,aAAa;SACxB;KACF,CAAC;AACJ,CAAC;AAjED,0DAiEC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Enrichment, IEnrichmentIntegrationRequestData } from '../types';
|
|
2
2
|
export default class TestHarness {
|
|
3
|
-
integration:
|
|
3
|
+
integration: Enrichment;
|
|
4
4
|
requestData: IEnrichmentIntegrationRequestData | undefined;
|
|
5
|
-
constructor(integration:
|
|
5
|
+
constructor(integration: Enrichment, requestData?: IEnrichmentIntegrationRequestData);
|
|
6
6
|
runGetData(): Promise<Record<string, any> | undefined>;
|
|
7
7
|
setMockRequestData(): void;
|
|
8
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TestHarness/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TestHarness/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAC;AAGzE,MAAM,CAAC,OAAO,OAAO,WAAW;IACvB,WAAW,EAAE,UAAU,CAAC;IACxB,WAAW,EAAE,iCAAiC,GAAG,SAAS,CAAC;gBAEtD,WAAW,EAAE,UAAU,EAAE,WAAW,CAAC,EAAE,iCAAiC;IAKvE,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC;IAU5D,kBAAkB;CAe1B"}
|
package/lib/TestHarness/index.js
CHANGED
|
@@ -11,7 +11,7 @@ class TestHarness {
|
|
|
11
11
|
this.setMockRequestData();
|
|
12
12
|
}
|
|
13
13
|
console.log('Request data set to: ', utils_1.jsonLog(this.requestData));
|
|
14
|
-
const result = await this.integration.
|
|
14
|
+
const result = await this.integration.getEnrichmentData?.(this.requestData);
|
|
15
15
|
console.log(`Result:`, utils_1.jsonLog(result));
|
|
16
16
|
return result;
|
|
17
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/TestHarness/index.ts"],"names":[],"mappings":";;AACA,oCAAmC;AAEnC,MAAqB,WAAW;IAI9B,YAAY,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/TestHarness/index.ts"],"names":[],"mappings":";;AACA,oCAAmC;AAEnC,MAAqB,WAAW;IAI9B,YAAY,WAAuB,EAAE,WAA+C;QAClF,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAEM,KAAK,CAAC,UAAU;QACrB,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YACrB,IAAI,CAAC,kBAAkB,EAAE,CAAC;SAC3B;QACD,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,eAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;QAChE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,iBAAiB,EAAE,CAAC,IAAI,CAAC,WAAY,CAAC,CAAC;QAC7E,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,eAAO,CAAC,MAAM,CAAC,CAAC,CAAC;QACxC,OAAO,MAAM,CAAC;IAChB,CAAC;IAEM,kBAAkB;QACvB,IAAI,CAAC,WAAW,GAAG;YACjB,YAAY,EAAE,yCAAyC;YACvD,MAAM,EAAE,kBAAkB;YAC1B,IAAI,EAAE,cAAc;YACpB,GAAG,EAAE,OAAO;YACZ,KAAK,EAAE,IAAI;YACX,qDAAqD;YACrD,WAAW,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE;YACnD,UAAU,EAAE,WAAW;YACvB,WAAW,EAAE,UAAU;YACvB,QAAQ,EAAE,iBAAiB;YAC3B,SAAS,EAAE,CAAC,gBAAgB;SAC7B,CAAC;IACJ,CAAC;CACF;AAlCD,8BAkCC"}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare abstract class Enrichment {
|
|
2
2
|
/**
|
|
3
3
|
* Pulls data from the vendor and returns the data graph in JSON format.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
abstract getEnrichmentData(requestData: IEnrichmentIntegrationRequestData): Promise<EnrichmentIntegrationResult>;
|
|
6
|
+
/**
|
|
7
|
+
* Pulls data from the vendor and returns the data graph in JSON format.
|
|
8
|
+
* Deprecated as of manifest version 2. Please use `getEnrichmentData`.
|
|
9
|
+
*
|
|
10
|
+
* @deprecated
|
|
11
|
+
*/
|
|
12
|
+
getData?(requestData: IEnrichmentIntegrationRequestData): Promise<EnrichmentIntegrationResult>;
|
|
6
13
|
}
|
|
7
14
|
export interface IEnrichmentIntegrationRequestData {
|
|
8
15
|
credentials: Record<any, string>;
|
|
@@ -24,4 +31,4 @@ export declare type EnrichmentIntegrationResult = {
|
|
|
24
31
|
err?: Record<string, any>;
|
|
25
32
|
};
|
|
26
33
|
};
|
|
27
|
-
//# sourceMappingURL=
|
|
34
|
+
//# sourceMappingURL=Enrichment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Enrichment.d.ts","sourceRoot":"","sources":["../../src/types/Enrichment.ts"],"names":[],"mappings":"AAAA,8BAAsB,UAAU;IAC9B;;OAEG;aACa,iBAAiB,CAC/B,WAAW,EAAE,iCAAiC,GAC7C,OAAO,CAAC,2BAA2B,CAAC;IAEvC;;;;;OAKG;IACI,OAAO,CAAC,CAAC,WAAW,EAAE,iCAAiC,GAAG,OAAO,CAAC,2BAA2B,CAAC;CAGtG;AAED,MAAM,WAAW,iCAAiC;IAChD,WAAW,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,oBAAY,2BAA2B,GAAG;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE;QACN,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC3B,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC3B,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Enrichment = void 0;
|
|
4
|
+
class Enrichment {
|
|
5
|
+
/**
|
|
6
|
+
* Pulls data from the vendor and returns the data graph in JSON format.
|
|
7
|
+
* Deprecated as of manifest version 2. Please use `getEnrichmentData`.
|
|
8
|
+
*
|
|
9
|
+
* @deprecated
|
|
10
|
+
*/
|
|
11
|
+
getData(requestData) {
|
|
12
|
+
throw new Error('Not implemented');
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.Enrichment = Enrichment;
|
|
16
|
+
//# sourceMappingURL=Enrichment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Enrichment.js","sourceRoot":"","sources":["../../src/types/Enrichment.ts"],"names":[],"mappings":";;;AAAA,MAAsB,UAAU;IAQ9B;;;;;OAKG;IACI,OAAO,CAAE,WAA8C;QAC5D,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACrC,CAAC;CACF;AAjBD,gCAiBC"}
|
|
@@ -31,6 +31,7 @@ export declare type EnrichmentComponentArgs = {
|
|
|
31
31
|
addGeometries?: (data: IAddGeometries) => void;
|
|
32
32
|
hideGeometries?: (id: string) => void;
|
|
33
33
|
panTo?: (coordinate: ICoordinate) => void;
|
|
34
|
+
trigger: (label: string, data: any) => void;
|
|
34
35
|
};
|
|
35
36
|
export {};
|
|
36
37
|
//# sourceMappingURL=EnrichmentComponentArgs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnrichmentComponentArgs.d.ts","sourceRoot":"","sources":["../../src/types/EnrichmentComponentArgs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC7B;AACD,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AACD,UAAU,iBAAiB;IACzB,UAAU,EAAE,WAAW,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,OAAO,EAAE,QAAQ,CAAC;CACnB;AAED,UAAU,cAAc;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE;QACV,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,aAAa,CAAC;QACxB,OAAO,CAAC,EAAE,QAAQ,CAAC;QACnB,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;KAChC,EAAE,CAAC;CACL;AAED,oBAAY,uBAAuB,GAAG;IACpC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACrC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gBAAgB,CAAC,EAAE,CAAC,EAAE,UAAU,EAAE,mBAAmB,EAAE,OAAO,EAAE,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC7F,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAC/C,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,KAAK,CAAC,EAAE,CAAC,UAAU,EAAE,WAAW,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"EnrichmentComponentArgs.d.ts","sourceRoot":"","sources":["../../src/types/EnrichmentComponentArgs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC7B;AACD,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AACD,UAAU,iBAAiB;IACzB,UAAU,EAAE,WAAW,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,OAAO,EAAE,QAAQ,CAAC;CACnB;AAED,UAAU,cAAc;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE;QACV,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,aAAa,CAAC;QACxB,OAAO,CAAC,EAAE,QAAQ,CAAC;QACnB,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;KAChC,EAAE,CAAC;CACL;AAED,oBAAY,uBAAuB,GAAG;IACpC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACrC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gBAAgB,CAAC,EAAE,CAAC,EAAE,UAAU,EAAE,mBAAmB,EAAE,OAAO,EAAE,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC7F,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAC/C,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,KAAK,CAAC,EAAE,CAAC,UAAU,EAAE,WAAW,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;CAC7C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Events.d.ts","sourceRoot":"","sources":["../../src/types/Events.ts"],"names":[],"mappings":"AAAA,oBAAY,oBAAoB;IAC9B,gBAAgB,mBAAmB;IACnC,SAAS,YAAY;IACrB,gBAAgB,mBAAmB;CACpC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IntegrationEventName = void 0;
|
|
4
|
+
var IntegrationEventName;
|
|
5
|
+
(function (IntegrationEventName) {
|
|
6
|
+
IntegrationEventName["triggered_task"] = "triggered_task";
|
|
7
|
+
IntegrationEventName["cadence"] = "cadence";
|
|
8
|
+
IntegrationEventName["webhook_called"] = "webhook_called";
|
|
9
|
+
})(IntegrationEventName = exports.IntegrationEventName || (exports.IntegrationEventName = {}));
|
|
10
|
+
//# sourceMappingURL=Events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Events.js","sourceRoot":"","sources":["../../src/types/Events.ts"],"names":[],"mappings":";;;AAAA,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,yDAAmC,CAAA;IACnC,2CAAqB,CAAA;IACrB,yDAAmC,CAAA;AACrC,CAAC,EAJW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAI/B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IntegrationEventName } from './Events';
|
|
2
|
+
/**
|
|
3
|
+
* Base class for integrations. All integrations should default export a class that extends this class.
|
|
4
|
+
*/
|
|
5
|
+
export declare abstract class Integration {
|
|
6
|
+
private events;
|
|
7
|
+
constructor();
|
|
8
|
+
/**
|
|
9
|
+
* Initializer for the class. This will be called once per instance of the integration. Multiple instances
|
|
10
|
+
* of an integration may be loaded throughout the system. Integrations should override this method if they
|
|
11
|
+
* need to register event handlers.
|
|
12
|
+
*/
|
|
13
|
+
init(): Promise<void>;
|
|
14
|
+
on(eventName: IntegrationEventName.triggered_task, handler: (label: string, data: any) => void): this;
|
|
15
|
+
on(eventName: IntegrationEventName.webhook_called, handler: (data: any) => void): this;
|
|
16
|
+
on(eventName: IntegrationEventName.cadence, handler: (label: string) => void): this;
|
|
17
|
+
emit(eventName: IntegrationEventName.triggered_task, label: string, data: any): boolean;
|
|
18
|
+
emit(eventName: IntegrationEventName.webhook_called, data: any): boolean;
|
|
19
|
+
emit(eventName: IntegrationEventName.cadence, label: string): boolean;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=Integration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Integration.d.ts","sourceRoot":"","sources":["../../src/types/Integration.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD;;GAEG;AACH,8BAAsB,WAAW;IAC/B,OAAO,CAAC,MAAM,CAAe;;IAK7B;;;;OAIG;IACU,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,EAAE,CAAC,SAAS,EAAE,oBAAoB,CAAC,cAAc,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;IACrG,EAAE,CAAC,SAAS,EAAE,oBAAoB,CAAC,cAAc,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;IACtF,EAAE,CAAC,SAAS,EAAE,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI;IAMnF,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO;IACvF,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,cAAc,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO;IACxE,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;CAI7E"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Integration = void 0;
|
|
4
|
+
const events_1 = require("events");
|
|
5
|
+
/**
|
|
6
|
+
* Base class for integrations. All integrations should default export a class that extends this class.
|
|
7
|
+
*/
|
|
8
|
+
class Integration {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.events = new events_1.EventEmitter();
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Initializer for the class. This will be called once per instance of the integration. Multiple instances
|
|
14
|
+
* of an integration may be loaded throughout the system. Integrations should override this method if they
|
|
15
|
+
* need to register event handlers.
|
|
16
|
+
*/
|
|
17
|
+
async init() {
|
|
18
|
+
// noop
|
|
19
|
+
}
|
|
20
|
+
on(eventName, handler) {
|
|
21
|
+
this.events.on(eventName, handler);
|
|
22
|
+
return this;
|
|
23
|
+
}
|
|
24
|
+
emit(eventName, ...args) {
|
|
25
|
+
return this.events.emit(eventName, ...args);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.Integration = Integration;
|
|
29
|
+
//# sourceMappingURL=Integration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Integration.js","sourceRoot":"","sources":["../../src/types/Integration.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AAGtC;;GAEG;AACH,MAAsB,WAAW;IAG/B;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,qBAAY,EAAE,CAAC;IACnC,CAAC;IACD;;;;OAIG;IACI,KAAK,CAAC,IAAI;QACf,OAAO;IACT,CAAC;IAKM,EAAE,CAAC,SAA+B,EAAE,OAAiC;QAC1E,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAKM,IAAI,CAAC,SAA+B,EAAE,GAAG,IAAW;QACzD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,CAAC;IAC9C,CAAC;CACF;AA7BD,kCA6BC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare type IntegrationManifest = {
|
|
2
|
+
version: number;
|
|
2
3
|
partner: string;
|
|
3
4
|
offering: string;
|
|
4
5
|
description: string;
|
|
@@ -7,14 +8,42 @@ export declare type IntegrationManifest = {
|
|
|
7
8
|
contact_email?: string;
|
|
8
9
|
website_url?: string;
|
|
9
10
|
capabilities: {
|
|
11
|
+
cadence?: Cadence | Cadence[];
|
|
12
|
+
webhook?: boolean;
|
|
10
13
|
enrichment?: {
|
|
11
14
|
requires?: string[];
|
|
15
|
+
provides?: string[];
|
|
16
|
+
/**
|
|
17
|
+
* Use `components` instead
|
|
18
|
+
*
|
|
19
|
+
* @deprecated
|
|
20
|
+
*/
|
|
12
21
|
has_card?: boolean;
|
|
13
22
|
};
|
|
14
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* Optional list of available triggers. These triggers may be used in reaction to a click event
|
|
26
|
+
* or some other event that happens in the system. Custom components are sent a `trigger` function
|
|
27
|
+
* in props. OnClick handlers can call `trigger(label, data)` to execute a trigger.
|
|
28
|
+
*/
|
|
29
|
+
triggers?: {
|
|
30
|
+
label: string;
|
|
31
|
+
}[];
|
|
32
|
+
/**
|
|
33
|
+
* Optional list of custom components
|
|
34
|
+
*/
|
|
35
|
+
components?: {
|
|
36
|
+
bundle: string;
|
|
37
|
+
type: string;
|
|
38
|
+
}[];
|
|
15
39
|
credentials_schema?: Record<string, {
|
|
16
40
|
display: string;
|
|
17
41
|
sensitive?: boolean;
|
|
18
42
|
}>;
|
|
19
43
|
};
|
|
44
|
+
declare type Cadence = {
|
|
45
|
+
schedule: string;
|
|
46
|
+
label: string;
|
|
47
|
+
};
|
|
48
|
+
export {};
|
|
20
49
|
//# sourceMappingURL=IntegrationManifest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegrationManifest.d.ts","sourceRoot":"","sources":["../../src/types/IntegrationManifest.ts"],"names":[],"mappings":"AAAA,oBAAY,mBAAmB,GAAG;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE;QACZ,UAAU,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"IntegrationManifest.d.ts","sourceRoot":"","sources":["../../src/types/IntegrationManifest.ts"],"names":[],"mappings":"AAAA,oBAAY,mBAAmB,GAAG;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE;QACZ,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,EAAE,CAAC;QAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;QAElB,UAAU,CAAC,EAAE;YAKX,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;YAEpB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;YACpB;;;;eAIG;YACH,QAAQ,CAAC,EAAE,OAAO,CAAC;SACpB,CAAC;KACH,CAAC;IACF;;;;OAIG;IACH,QAAQ,CAAC,EAAE;QAET,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ;;OAEG;IACH,UAAU,CAAC,EAAE;QACX,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;KACd,EAAE,CAAC;IACJ,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CAC/E,CAAC;AAEF,aAAK,OAAO,GAAG;IAEb,QAAQ,EAAE,MAAM,CAAC;IAEjB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
export * from './Enrichment';
|
|
1
2
|
export * from './EnrichmentComponentArgs';
|
|
2
|
-
export * from './
|
|
3
|
+
export * from './Events';
|
|
4
|
+
export * from './Integration';
|
|
3
5
|
export * from './IntegrationManifest';
|
|
4
6
|
export * from './IPartnerDataSchema';
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
|
package/lib/types/index.js
CHANGED
|
@@ -10,8 +10,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./Enrichment"), exports);
|
|
13
14
|
__exportStar(require("./EnrichmentComponentArgs"), exports);
|
|
14
|
-
__exportStar(require("./
|
|
15
|
+
__exportStar(require("./Events"), exports);
|
|
16
|
+
__exportStar(require("./Integration"), exports);
|
|
15
17
|
__exportStar(require("./IntegrationManifest"), exports);
|
|
16
18
|
__exportStar(require("./IPartnerDataSchema"), exports);
|
|
17
19
|
//# sourceMappingURL=index.js.map
|
package/lib/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4DAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA6B;AAC7B,4DAA0C;AAC1C,2CAAyB;AACzB,gDAA8B;AAC9B,wDAAsC;AACtC,uDAAqC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@betterview/integration-toolkit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Supports integration packages. This should be the only import from our integrations",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"prebuild": "rm -rf ./lib",
|
|
@@ -17,19 +17,19 @@
|
|
|
17
17
|
"license": "UNLICENSED",
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"async": "^3.2.4",
|
|
20
|
-
"axios": "
|
|
20
|
+
"axios": "0.24.0",
|
|
21
21
|
"fs-extra": "^10.1.0",
|
|
22
|
-
"geojson": "
|
|
22
|
+
"geojson": "0.5.0",
|
|
23
23
|
"json-colorizer": "2.2.2",
|
|
24
24
|
"lodash": "4.17.21",
|
|
25
25
|
"xml2js": "0.4.23"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
+
"@babel/eslint-parser": "7.18.9",
|
|
28
29
|
"@types/xml2js": "0.4.5",
|
|
29
30
|
"@typescript-eslint/eslint-plugin": "4.26.1",
|
|
30
31
|
"@typescript-eslint/eslint-plugin-tslint": "4.26.1",
|
|
31
32
|
"@typescript-eslint/parser": "4.26.1",
|
|
32
|
-
"babel-eslint": "10.1.0",
|
|
33
33
|
"eslint": "7.22.0",
|
|
34
34
|
"eslint-config-prettier": "6.10.1",
|
|
35
35
|
"eslint-plugin-import": "2.22.1",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"eslint-plugin-prettier": "3.3.1",
|
|
39
39
|
"eslint-plugin-react": "7.22.0",
|
|
40
40
|
"eslint-plugin-sonarjs": "0.6.0",
|
|
41
|
-
"jest": "
|
|
42
|
-
"ts-jest": "
|
|
41
|
+
"jest": "28.1.3",
|
|
42
|
+
"ts-jest": "28.0.7",
|
|
43
43
|
"ts-node": "8.8.2",
|
|
44
44
|
"typescript": "4.3.2"
|
|
45
45
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IEnrichmentIntegration.d.ts","sourceRoot":"","sources":["../../src/types/IEnrichmentIntegration.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,OAAO,CAAC,WAAW,EAAE,iCAAiC,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;CAC/F;AAED,MAAM,WAAW,iCAAiC;IAChD,WAAW,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,oBAAY,2BAA2B,GAAG;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE;QACN,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC3B,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC3B,CAAC;CACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IEnrichmentIntegration.js","sourceRoot":"","sources":["../../src/types/IEnrichmentIntegration.ts"],"names":[],"mappings":""}
|