@betterview/integration-toolkit 7.5.4 → 7.5.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/lib/Network/axios-error-handling.d.ts +26 -0
- package/lib/Network/axios-error-handling.d.ts.map +1 -0
- package/lib/Network/axios-error-handling.js +52 -0
- package/lib/Network/axios-error-handling.js.map +1 -0
- package/lib/Network/index.d.ts +11 -0
- package/lib/Network/index.d.ts.map +1 -0
- package/lib/Network/index.js +19 -0
- package/lib/Network/index.js.map +1 -0
- package/lib/Parse/index.d.ts +4 -0
- package/lib/Parse/index.d.ts.map +1 -0
- package/lib/Parse/index.js +16 -0
- package/lib/Parse/index.js.map +1 -0
- package/lib/TestHarness/index.d.ts +11 -0
- package/lib/TestHarness/index.d.ts.map +1 -0
- package/lib/TestHarness/index.js +39 -0
- package/lib/TestHarness/index.js.map +1 -0
- package/lib/hooks/index.d.ts +3 -0
- package/lib/hooks/index.d.ts.map +1 -0
- package/lib/hooks/index.js +6 -0
- package/lib/hooks/index.js.map +1 -0
- package/lib/hooks/useWindowMessge/index.d.ts +7 -0
- package/lib/hooks/useWindowMessge/index.d.ts.map +1 -0
- package/lib/hooks/useWindowMessge/index.js +28 -0
- package/lib/hooks/useWindowMessge/index.js.map +1 -0
- package/lib/types/Enrichment.d.ts +89 -0
- package/lib/types/Enrichment.d.ts.map +1 -0
- package/lib/types/Enrichment.js +3 -0
- package/lib/types/Enrichment.js.map +1 -0
- package/lib/types/EnrichmentComponentArgs.d.ts +51 -0
- package/lib/types/EnrichmentComponentArgs.d.ts.map +1 -0
- package/lib/types/EnrichmentComponentArgs.js +3 -0
- package/lib/types/EnrichmentComponentArgs.js.map +1 -0
- package/lib/types/Events.d.ts +5 -0
- package/lib/types/Events.d.ts.map +1 -0
- package/lib/types/Events.js +9 -0
- package/lib/types/Events.js.map +1 -0
- package/lib/types/IPartnerDataSchema.d.ts +26 -0
- package/lib/types/IPartnerDataSchema.d.ts.map +1 -0
- package/lib/types/IPartnerDataSchema.js +3 -0
- package/lib/types/IPartnerDataSchema.js.map +1 -0
- package/lib/types/Integration.d.ts +26 -0
- package/lib/types/Integration.d.ts.map +1 -0
- package/lib/types/Integration.js +41 -0
- package/lib/types/Integration.js.map +1 -0
- package/lib/types/IntegrationManifest.d.ts +47 -0
- package/lib/types/IntegrationManifest.d.ts.map +1 -0
- package/lib/types/IntegrationManifest.js +3 -0
- package/lib/types/IntegrationManifest.js.map +1 -0
- package/lib/types/Storage.d.ts +13 -0
- package/lib/types/Storage.d.ts.map +1 -0
- package/lib/types/Storage.js +3 -0
- package/lib/types/Storage.js.map +1 -0
- package/lib/types/formatters/functions/arrayToString.d.ts +7 -0
- package/lib/types/formatters/functions/arrayToString.d.ts.map +1 -0
- package/lib/types/formatters/functions/arrayToString.js +7 -0
- package/lib/types/formatters/functions/arrayToString.js.map +1 -0
- package/lib/types/formatters/functions/capitalize.d.ts +6 -0
- package/lib/types/formatters/functions/capitalize.d.ts.map +1 -0
- package/lib/types/formatters/functions/capitalize.js +11 -0
- package/lib/types/formatters/functions/capitalize.js.map +1 -0
- package/lib/types/formatters/functions/date.d.ts +4 -0
- package/lib/types/formatters/functions/date.d.ts.map +1 -0
- package/lib/types/formatters/functions/date.js +15 -0
- package/lib/types/formatters/functions/date.js.map +1 -0
- package/lib/types/formatters/functions/decimalToPercentage.d.ts +4 -0
- package/lib/types/formatters/functions/decimalToPercentage.d.ts.map +1 -0
- package/lib/types/formatters/functions/decimalToPercentage.js +16 -0
- package/lib/types/formatters/functions/decimalToPercentage.js.map +1 -0
- package/lib/types/formatters/functions/index.d.ts +8 -0
- package/lib/types/formatters/functions/index.d.ts.map +1 -0
- package/lib/types/formatters/functions/index.js +19 -0
- package/lib/types/formatters/functions/index.js.map +1 -0
- package/lib/types/formatters/functions/numberToString.d.ts +4 -0
- package/lib/types/formatters/functions/numberToString.d.ts.map +1 -0
- package/lib/types/formatters/functions/numberToString.js +32 -0
- package/lib/types/formatters/functions/numberToString.js.map +1 -0
- package/lib/types/formatters/functions/scoreLetterToLowMedHigh.d.ts +4 -0
- package/lib/types/formatters/functions/scoreLetterToLowMedHigh.d.ts.map +1 -0
- package/lib/types/formatters/functions/scoreLetterToLowMedHigh.js +22 -0
- package/lib/types/formatters/functions/scoreLetterToLowMedHigh.js.map +1 -0
- package/lib/types/formatters/index.d.ts +3 -0
- package/lib/types/formatters/index.d.ts.map +1 -0
- package/lib/types/formatters/index.js +19 -0
- package/lib/types/formatters/index.js.map +1 -0
- package/lib/types/formatters/types/index.d.ts +38 -0
- package/lib/types/formatters/types/index.d.ts.map +1 -0
- package/lib/types/formatters/types/index.js +30 -0
- package/lib/types/formatters/types/index.js.map +1 -0
- package/lib/types/index.d.ts +9 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +25 -0
- package/lib/types/index.js.map +1 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/index.js +12 -0
- package/lib/utils/index.js.map +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AxiosError, AxiosResponse } from 'axios';
|
|
2
|
+
export declare type FriendlyName = 'server error' | 'no response' | 'request init failure' | 'auth error' | 'endpoint not found';
|
|
3
|
+
export interface SimplifiedError {
|
|
4
|
+
/** the status code number (e.g. 500) */
|
|
5
|
+
statusCode?: number;
|
|
6
|
+
data?: any;
|
|
7
|
+
/** the status code name (e.g. ETIMEDOUT) */
|
|
8
|
+
code?: string;
|
|
9
|
+
responseHeaders?: Record<string, string>;
|
|
10
|
+
/**
|
|
11
|
+
* server error: the server responded with an error
|
|
12
|
+
* no repsonse: no response was received from the server
|
|
13
|
+
* request init failure: axios failed to create the request to send
|
|
14
|
+
*/
|
|
15
|
+
friendly: FriendlyName;
|
|
16
|
+
}
|
|
17
|
+
/** simplifies an axios error, exposing the properties that are commonly used and friendly name to help decision trees */
|
|
18
|
+
export declare function simplifyError(err: AxiosError): SimplifiedError;
|
|
19
|
+
export interface IWrapResult<T> {
|
|
20
|
+
data?: T;
|
|
21
|
+
headers?: Record<string, string>;
|
|
22
|
+
err?: SimplifiedError;
|
|
23
|
+
}
|
|
24
|
+
/** wraps an axios api call, resulting in a successful promise containing either the requested data or a simplfied error */
|
|
25
|
+
export declare function wrap<T>(axiosApiCall: Promise<AxiosResponse<T> | AxiosError<T>>): Promise<IWrapResult<T>>;
|
|
26
|
+
//# sourceMappingURL=axios-error-handling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"axios-error-handling.d.ts","sourceRoot":"","sources":["../../src/Network/axios-error-handling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAElD,oBAAY,YAAY,GACpB,cAAc,GACd,aAAa,GACb,sBAAsB,GACtB,YAAY,GACZ,oBAAoB,CAAC;AAEzB,MAAM,WAAW,eAAe;IAC9B,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC;;;;OAIG;IACH,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED,yHAAyH;AACzH,wBAAgB,aAAa,CAAC,GAAG,EAAE,UAAU,GAAG,eAAe,CAa9D;AAED,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,GAAG,CAAC,EAAE,eAAe,CAAC;CACvB;AAeD,2HAA2H;AAC3H,wBAAsB,IAAI,CAAC,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAe9G"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.wrap = exports.simplifyError = void 0;
|
|
4
|
+
/** simplifies an axios error, exposing the properties that are commonly used and friendly name to help decision trees */
|
|
5
|
+
function simplifyError(err) {
|
|
6
|
+
let friendly = 'request init failure';
|
|
7
|
+
const statusCode = `${err.code ?? err.response?.status}`;
|
|
8
|
+
if (err.response)
|
|
9
|
+
friendly = convertStatusCode(statusCode);
|
|
10
|
+
else if (err.request)
|
|
11
|
+
friendly = 'no response';
|
|
12
|
+
return {
|
|
13
|
+
statusCode: err.response?.status,
|
|
14
|
+
data: err.response?.data,
|
|
15
|
+
code: statusCode,
|
|
16
|
+
responseHeaders: err.response?.headers,
|
|
17
|
+
friendly
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
exports.simplifyError = simplifyError;
|
|
21
|
+
function convertStatusCode(code) {
|
|
22
|
+
switch (code) {
|
|
23
|
+
case '401':
|
|
24
|
+
return 'auth error';
|
|
25
|
+
case '500':
|
|
26
|
+
return 'server error';
|
|
27
|
+
case '404':
|
|
28
|
+
return 'endpoint not found';
|
|
29
|
+
default:
|
|
30
|
+
return 'no response';
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/** wraps an axios api call, resulting in a successful promise containing either the requested data or a simplfied error */
|
|
34
|
+
async function wrap(axiosApiCall) {
|
|
35
|
+
const result = {};
|
|
36
|
+
try {
|
|
37
|
+
let r = await axiosApiCall;
|
|
38
|
+
if (r.isAxiosError !== undefined) {
|
|
39
|
+
throw r;
|
|
40
|
+
}
|
|
41
|
+
r = r;
|
|
42
|
+
result.headers = r.headers;
|
|
43
|
+
result.data = r.data;
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
const simple = simplifyError(err);
|
|
47
|
+
result.err = simple;
|
|
48
|
+
}
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
exports.wrap = wrap;
|
|
52
|
+
//# sourceMappingURL=axios-error-handling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"axios-error-handling.js","sourceRoot":"","sources":["../../src/Network/axios-error-handling.ts"],"names":[],"mappings":";;;AAwBA,yHAAyH;AACzH,SAAgB,aAAa,CAAC,GAAe;IAC3C,IAAI,QAAQ,GAAiB,sBAAsB,CAAC;IACpD,MAAM,UAAU,GAAG,GAAG,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACzD,IAAI,GAAG,CAAC,QAAQ;QAAE,QAAQ,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;SACtD,IAAI,GAAG,CAAC,OAAO;QAAE,QAAQ,GAAG,aAAa,CAAC;IAE/C,OAAO;QACL,UAAU,EAAE,GAAG,CAAC,QAAQ,EAAE,MAAM;QAChC,IAAI,EAAE,GAAG,CAAC,QAAQ,EAAE,IAAI;QACxB,IAAI,EAAE,UAAU;QAChB,eAAe,EAAE,GAAG,CAAC,QAAQ,EAAE,OAAO;QACtC,QAAQ;KACT,CAAC;AACJ,CAAC;AAbD,sCAaC;AAQD,SAAS,iBAAiB,CAAC,IAAY;IACrC,QAAQ,IAAI,EAAE;QACZ,KAAK,KAAK;YACR,OAAO,YAAY,CAAC;QACtB,KAAK,KAAK;YACR,OAAO,cAAc,CAAC;QACxB,KAAK,KAAK;YACR,OAAO,oBAAoB,CAAC;QAC9B;YACE,OAAO,aAAa,CAAC;KACxB;AACH,CAAC;AAED,2HAA2H;AACpH,KAAK,UAAU,IAAI,CAAI,YAAuD;IACnF,MAAM,MAAM,GAAmB,EAAE,CAAC;IAClC,IAAI;QACF,IAAI,CAAC,GAAG,MAAM,YAAY,CAAC;QAC3B,IAAK,CAAgB,CAAC,YAAY,KAAK,SAAS,EAAE;YAChD,MAAM,CAAC,CAAC;SACT;QACD,CAAC,GAAG,CAAqB,CAAC;QAC1B,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC;QAC3B,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC;KACtB;IAAC,OAAO,GAAG,EAAE;QACZ,MAAM,MAAM,GAAG,aAAa,CAAC,GAAsB,CAAC,CAAC;QACrD,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC;KACrB;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAfD,oBAeC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import { IWrapResult } from './axios-error-handling';
|
|
3
|
+
export declare function get<T = Record<string, any>>(url: string, config?: AxiosRequestConfig): Promise<{
|
|
4
|
+
request_url: string;
|
|
5
|
+
result: IWrapResult<T>;
|
|
6
|
+
}>;
|
|
7
|
+
export declare function post<T = any, U = Record<string, any>>(url: string, data: T, config?: AxiosRequestConfig): Promise<{
|
|
8
|
+
request_url: string;
|
|
9
|
+
result: IWrapResult<U>;
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Network/index.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,WAAW,EAAQ,MAAM,wBAAwB,CAAC;AAE3D,wBAAsB,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC/C,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC,CAG1D;AAED,wBAAsB,IAAI,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACzD,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,CAAC,EACP,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC,CAG1D"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.post = exports.get = void 0;
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
const axios_error_handling_1 = require("./axios-error-handling");
|
|
9
|
+
async function get(url, config) {
|
|
10
|
+
const result = await (0, axios_error_handling_1.wrap)(axios_1.default.get(url, config));
|
|
11
|
+
return { request_url: url, result };
|
|
12
|
+
}
|
|
13
|
+
exports.get = get;
|
|
14
|
+
async function post(url, data, config) {
|
|
15
|
+
const result = await (0, axios_error_handling_1.wrap)(axios_1.default.post(url, data, config));
|
|
16
|
+
return { request_url: url, result };
|
|
17
|
+
}
|
|
18
|
+
exports.post = post;
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Network/index.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAkD;AAClD,iEAA2D;AAEpD,KAAK,UAAU,GAAG,CACvB,GAAW,EACX,MAA2B;IAE3B,MAAM,MAAM,GAAG,MAAM,IAAA,2BAAI,EAAC,eAAK,CAAC,GAAG,CAAI,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;AACtC,CAAC;AAND,kBAMC;AAEM,KAAK,UAAU,IAAI,CACxB,GAAW,EACX,IAAO,EACP,MAA2B;IAE3B,MAAM,MAAM,GAAG,MAAM,IAAA,2BAAI,EAAC,eAAK,CAAC,IAAI,CAAI,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAC5D,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;AACtC,CAAC;AAPD,oBAOC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Parse/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEhD,oBAAY,oBAAoB,GAAG,SAAS,CAAC;AAE7C,wBAAsB,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CASlG"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.xml2js = void 0;
|
|
4
|
+
const xml2js_1 = require("xml2js");
|
|
5
|
+
async function xml2js(xmlToConvert, options) {
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
(0, xml2js_1.parseString)(xmlToConvert, options || {}, (err, result) => {
|
|
8
|
+
if (err) {
|
|
9
|
+
return reject(err);
|
|
10
|
+
}
|
|
11
|
+
return resolve(result);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
exports.xml2js = xml2js;
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Parse/index.ts"],"names":[],"mappings":";;;AAAA,mCAAgD;AAIzC,KAAK,UAAU,MAAM,CAAC,YAAoB,EAAE,OAA8B;IAC/E,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAA,oBAAW,EAAC,YAAY,EAAE,OAAO,IAAI,EAAE,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;YACvD,IAAI,GAAG,EAAE;gBACP,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;aACpB;YACD,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AATD,wBASC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Enrichment, IEnrichmentGetTimelineMarkerDetailsRequest, IEnrichmentGetTimelineMarkerDetailsResponse, IEnrichmentIntegrationRequestData } from '../types';
|
|
2
|
+
export default class TestHarness {
|
|
3
|
+
integration: Enrichment;
|
|
4
|
+
requestData: IEnrichmentIntegrationRequestData | undefined;
|
|
5
|
+
timelineMarkerData: IEnrichmentGetTimelineMarkerDetailsRequest;
|
|
6
|
+
constructor(integration: Enrichment, requestData?: IEnrichmentIntegrationRequestData);
|
|
7
|
+
runGetData(): Promise<Record<string, any> | undefined>;
|
|
8
|
+
runGetTimelineMarkerDetails(): IEnrichmentGetTimelineMarkerDetailsResponse | undefined;
|
|
9
|
+
setMockRequestData(): void;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TestHarness/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,0CAA0C,EAC1C,2CAA2C,EAC3C,iCAAiC,EAClC,MAAM,UAAU,CAAC;AAGlB,MAAM,CAAC,OAAO,OAAO,WAAW;IACvB,WAAW,EAAE,UAAU,CAAC;IACxB,WAAW,EAAE,iCAAiC,GAAG,SAAS,CAAC;IAC3D,kBAAkB,EAAE,0CAA0C,CAAC;gBAE1D,WAAW,EAAE,UAAU,EAAE,WAAW,CAAC,EAAE,iCAAiC;IAKvE,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC;IAU5D,2BAA2B,IAAI,2CAA2C,GAAG,SAAS;IAOtF,kBAAkB;CAa1B"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../utils");
|
|
4
|
+
class TestHarness {
|
|
5
|
+
constructor(integration, requestData) {
|
|
6
|
+
this.integration = integration;
|
|
7
|
+
this.requestData = requestData;
|
|
8
|
+
}
|
|
9
|
+
async runGetData() {
|
|
10
|
+
if (!this.requestData) {
|
|
11
|
+
this.setMockRequestData();
|
|
12
|
+
}
|
|
13
|
+
console.log('Request data set to: ', (0, utils_1.jsonLog)(this.requestData));
|
|
14
|
+
const result = await this.integration.getEnrichmentData?.(this.requestData);
|
|
15
|
+
console.log(`Result:`, (0, utils_1.jsonLog)(result));
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
runGetTimelineMarkerDetails() {
|
|
19
|
+
console.log('Timeline marker data set to: ', (0, utils_1.jsonLog)(this.timelineMarkerData));
|
|
20
|
+
const result = this.integration.getTimelineMarkerDetails?.(this.timelineMarkerData);
|
|
21
|
+
console.log(`Timeline marker Result:`, (0, utils_1.jsonLog)(result));
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
setMockRequestData() {
|
|
25
|
+
this.requestData = {
|
|
26
|
+
full_address: '100 Pringle Ave. Walnut Creek, CA 94596',
|
|
27
|
+
street: '100 Pringle Ave.',
|
|
28
|
+
city: 'Walnut Creek',
|
|
29
|
+
zip: '94596',
|
|
30
|
+
state: 'CA',
|
|
31
|
+
externalId: 'external1',
|
|
32
|
+
insuredName: 'Jane Doe',
|
|
33
|
+
latitude: 37.90820797421544,
|
|
34
|
+
longitude: -122.067761097756
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.default = TestHarness;
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/TestHarness/index.ts"],"names":[],"mappings":";;AAMA,oCAAmC;AAEnC,MAAqB,WAAW;IAK9B,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,IAAA,eAAO,EAAC,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,IAAA,eAAO,EAAC,MAAM,CAAC,CAAC,CAAC;QACxC,OAAO,MAAM,CAAC;IAChB,CAAC;IAEM,2BAA2B;QAChC,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,IAAA,eAAO,EAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC;QAC/E,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,wBAAwB,EAAE,CAAC,IAAI,CAAC,kBAAmB,CAAC,CAAC;QACrF,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,IAAA,eAAO,EAAC,MAAM,CAAC,CAAC,CAAC;QACxD,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,UAAU,EAAE,WAAW;YACvB,WAAW,EAAE,UAAU;YACvB,QAAQ,EAAE,iBAAiB;YAC3B,SAAS,EAAE,CAAC,gBAAgB;SAC7B,CAAC;IACJ,CAAC;CACF;AAxCD,8BAwCC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useWindowMessage = void 0;
|
|
4
|
+
const useWindowMessge_1 = require("./useWindowMessge");
|
|
5
|
+
Object.defineProperty(exports, "useWindowMessage", { enumerable: true, get: function () { return useWindowMessge_1.useWindowMessage; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":";;;AAAA,uDAAqD;AAE5C,iGAFA,kCAAgB,OAEA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useWindowMessge/index.ts"],"names":[],"mappings":"AAEA,oBAAY,aAAa,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAAE,CAAC;AAE5F,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC,aAAa,GAAG,IAAI,EAAE,GAAG,CAAC,CAwB/E"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useWindowMessage = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
function useWindowMessage(namespace) {
|
|
6
|
+
const [message, setMessage] = (0, react_1.useState)(null);
|
|
7
|
+
const handleMessageEvent = (0, react_1.useCallback)(event => {
|
|
8
|
+
if (event.data.namespace !== namespace)
|
|
9
|
+
return;
|
|
10
|
+
setMessage(event.data);
|
|
11
|
+
}, []);
|
|
12
|
+
(0, react_1.useEffect)(() => {
|
|
13
|
+
window.addEventListener('message', handleMessageEvent);
|
|
14
|
+
return () => {
|
|
15
|
+
window.removeEventListener('message', handleMessageEvent);
|
|
16
|
+
};
|
|
17
|
+
}, [handleMessageEvent]);
|
|
18
|
+
const postMessage = (0, react_1.useCallback)((msg, targetOrigin = '*', transfer = undefined) => {
|
|
19
|
+
// eslint-disable-next-line no-console
|
|
20
|
+
if (!msg.type)
|
|
21
|
+
console.error('message object must contain properties "type" and "data"');
|
|
22
|
+
msg.namespace = namespace;
|
|
23
|
+
window.postMessage(msg, targetOrigin, transfer);
|
|
24
|
+
}, []);
|
|
25
|
+
return [message, postMessage];
|
|
26
|
+
}
|
|
27
|
+
exports.useWindowMessage = useWindowMessage;
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/useWindowMessge/index.ts"],"names":[],"mappings":";;;AAAA,iCAAyD;AAIzD,SAAgB,gBAAgB,CAAC,SAAiB;IAChD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAuB,IAAI,CAAC,CAAC;IAEnE,MAAM,kBAAkB,GAAG,IAAA,mBAAW,EAAC,KAAK,CAAC,EAAE;QAC7C,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS;YAAE,OAAO;QAC/C,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;QACvD,OAAO,GAAG,EAAE;YACV,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;QAC5D,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAEzB,MAAM,WAAW,GAAG,IAAA,mBAAW,EAAC,CAAC,GAAkB,EAAE,YAAY,GAAG,GAAG,EAAE,QAAQ,GAAG,SAAS,EAAE,EAAE;QAC/F,sCAAsC;QACtC,IAAI,CAAC,GAAG,CAAC,IAAI;YAAE,OAAO,CAAC,KAAK,CAAC,0DAA0D,CAAC,CAAC;QAEzF,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC;QAC1B,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;IAClD,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AAChC,CAAC;AAxBD,4CAwBC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { IDataSchemaField, IPartnerDataSchema } from './IPartnerDataSchema';
|
|
2
|
+
export interface Enrichment {
|
|
3
|
+
/**
|
|
4
|
+
* Pulls data from the vendor and returns the data graph in JSON format.
|
|
5
|
+
*/
|
|
6
|
+
getEnrichmentData(requestData: IEnrichmentIntegrationRequestData): Promise<EnrichmentIntegrationResult>;
|
|
7
|
+
/**
|
|
8
|
+
* Constructs the URL to a photo for a given data field within the integration
|
|
9
|
+
*/
|
|
10
|
+
getEnrichmentPhotoDetails?(requestData: IEnrichmentGetPhotoDetailsRequest): Promise<{
|
|
11
|
+
url: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
}[]>;
|
|
15
|
+
getTimelineMarkerDetails?(requestData: IEnrichmentGetTimelineMarkerDetailsRequest): IEnrichmentGetTimelineMarkerDetailsResponse;
|
|
16
|
+
/**
|
|
17
|
+
* Pulls data from the vendor and returns the data graph in JSON format.
|
|
18
|
+
* Deprecated as of manifest version 2. Please use `getEnrichmentData`.
|
|
19
|
+
*
|
|
20
|
+
* @deprecated
|
|
21
|
+
*/
|
|
22
|
+
getData?(requestData: IEnrichmentIntegrationRequestData): Promise<EnrichmentIntegrationResult>;
|
|
23
|
+
}
|
|
24
|
+
export interface IEnrichmentGetPhotoDetailsRequest {
|
|
25
|
+
credentials?: Record<any, string>;
|
|
26
|
+
key: string;
|
|
27
|
+
data: Record<string, any>;
|
|
28
|
+
width?: string;
|
|
29
|
+
height?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface IEnrichmentGetTimelineMarkerDetailsRequest {
|
|
32
|
+
credentials?: Record<any, string>;
|
|
33
|
+
markerType?: string;
|
|
34
|
+
data: Record<string, any>;
|
|
35
|
+
schema: IPartnerDataSchema;
|
|
36
|
+
offeringId: string;
|
|
37
|
+
}
|
|
38
|
+
export declare type EnrichmentTimelineMarkerValue<T = string | number | null | undefined | string[]> = {
|
|
39
|
+
jsonPath: string;
|
|
40
|
+
title: string;
|
|
41
|
+
description: string;
|
|
42
|
+
dataType: IDataSchemaField['data_type'];
|
|
43
|
+
value: T;
|
|
44
|
+
};
|
|
45
|
+
export declare type EnrichmentTimelineMarkerIcon = {
|
|
46
|
+
prefix: string;
|
|
47
|
+
iconName: string;
|
|
48
|
+
color: string;
|
|
49
|
+
};
|
|
50
|
+
export declare type EnrichmentTimelineMarker = {
|
|
51
|
+
title: string;
|
|
52
|
+
description: string;
|
|
53
|
+
icon: EnrichmentTimelineMarkerIcon;
|
|
54
|
+
date: string;
|
|
55
|
+
popoverData: Record<string, EnrichmentTimelineMarkerValue>;
|
|
56
|
+
tooltipData: Record<string, string | number | string[] | number[]>;
|
|
57
|
+
};
|
|
58
|
+
export interface IEnrichmentGetTimelineMarkerDetailsResponse {
|
|
59
|
+
name: string;
|
|
60
|
+
partner: string;
|
|
61
|
+
offering: string;
|
|
62
|
+
timelineMarkers: EnrichmentTimelineMarker[];
|
|
63
|
+
offeringId: string;
|
|
64
|
+
}
|
|
65
|
+
export interface IEnrichmentIntegrationRequestData {
|
|
66
|
+
credentials?: Record<any, string>;
|
|
67
|
+
options?: Record<string, any> | null;
|
|
68
|
+
full_address?: string;
|
|
69
|
+
street?: string;
|
|
70
|
+
city?: string;
|
|
71
|
+
state?: string;
|
|
72
|
+
zip?: string;
|
|
73
|
+
county?: string;
|
|
74
|
+
externalId?: string | null;
|
|
75
|
+
latitude?: number;
|
|
76
|
+
longitude?: number;
|
|
77
|
+
insuredName?: string | null;
|
|
78
|
+
clientOrgId?: number;
|
|
79
|
+
boundaryWkt?: string;
|
|
80
|
+
buildingsWkt?: string;
|
|
81
|
+
}
|
|
82
|
+
export declare type EnrichmentIntegrationResult = {
|
|
83
|
+
request_url: string;
|
|
84
|
+
result: {
|
|
85
|
+
data?: Record<string, any>;
|
|
86
|
+
err?: Record<string, any>;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=Enrichment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Enrichment.d.ts","sourceRoot":"","sources":["../../src/types/Enrichment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE5E,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,iBAAiB,CAAC,WAAW,EAAE,iCAAiC,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAExG;;OAEG;IACH,yBAAyB,CAAC,CACxB,WAAW,EAAE,iCAAiC,GAC7C,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,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AAE,GAAG,CAAC,CAAC;QAC3B,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC3B,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Enrichment.js","sourceRoot":"","sources":["../../src/types/Enrichment.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { GeoJsonObject } from 'geojson';
|
|
2
|
+
export interface ICoordinate {
|
|
3
|
+
lat?: string | number;
|
|
4
|
+
latitude?: string | number;
|
|
5
|
+
lng?: string | number;
|
|
6
|
+
lon?: string | number;
|
|
7
|
+
longitude?: string | number;
|
|
8
|
+
}
|
|
9
|
+
export interface ITooltip {
|
|
10
|
+
title: string;
|
|
11
|
+
content?: string[];
|
|
12
|
+
}
|
|
13
|
+
interface IAddMapCoordinate {
|
|
14
|
+
coordinate: ICoordinate;
|
|
15
|
+
onCoordinateClicked?: () => void;
|
|
16
|
+
tooltip: ITooltip;
|
|
17
|
+
}
|
|
18
|
+
interface IAddGeometries {
|
|
19
|
+
id: string;
|
|
20
|
+
geometries: {
|
|
21
|
+
wkt?: string;
|
|
22
|
+
geojson?: GeoJsonObject;
|
|
23
|
+
tooltip?: ITooltip;
|
|
24
|
+
onGeometryClicked?: () => void;
|
|
25
|
+
}[];
|
|
26
|
+
}
|
|
27
|
+
export declare type EnrichmentComponentArgs = {
|
|
28
|
+
betterviewData?: {
|
|
29
|
+
property_id?: number;
|
|
30
|
+
policy_number?: string;
|
|
31
|
+
insured_name?: string;
|
|
32
|
+
address?: string;
|
|
33
|
+
city?: string;
|
|
34
|
+
state?: string;
|
|
35
|
+
zip?: string;
|
|
36
|
+
webhookUrl: string;
|
|
37
|
+
};
|
|
38
|
+
partnerHubData?: Record<string, any>;
|
|
39
|
+
previewMode?: boolean;
|
|
40
|
+
addMapCoordinate?: ({ coordinate, onCoordinateClicked, tooltip }: IAddMapCoordinate) => void;
|
|
41
|
+
addGeometries?: (data: IAddGeometries) => void;
|
|
42
|
+
hideGeometries?: (id: string) => void;
|
|
43
|
+
panTo?: (coordinate: ICoordinate) => void;
|
|
44
|
+
command: <T = any, U = any>(label: string, data?: T, options?: Record<string, string>) => Promise<U>;
|
|
45
|
+
getData: (key: string) => Promise<string | null>;
|
|
46
|
+
onClose?: (args: any) => void;
|
|
47
|
+
timelineDate?: string;
|
|
48
|
+
options?: Record<string, string>;
|
|
49
|
+
};
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=EnrichmentComponentArgs.d.ts.map
|
|
@@ -0,0 +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,EA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MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnrichmentComponentArgs.js","sourceRoot":"","sources":["../../src/types/EnrichmentComponentArgs.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Events.d.ts","sourceRoot":"","sources":["../../src/types/Events.ts"],"names":[],"mappings":"AAAA,oBAAY,oBAAoB;IAC9B,SAAS,YAAY;IACrB,gBAAgB,mBAAmB;CACpC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IntegrationEventName = void 0;
|
|
4
|
+
var IntegrationEventName;
|
|
5
|
+
(function (IntegrationEventName) {
|
|
6
|
+
IntegrationEventName["cadence"] = "cadence";
|
|
7
|
+
IntegrationEventName["webhook_called"] = "webhook_called";
|
|
8
|
+
})(IntegrationEventName = exports.IntegrationEventName || (exports.IntegrationEventName = {}));
|
|
9
|
+
//# sourceMappingURL=Events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Events.js","sourceRoot":"","sources":["../../src/types/Events.ts"],"names":[],"mappings":";;;AAAA,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,2CAAqB,CAAA;IACrB,yDAAmC,CAAA;AACrC,CAAC,EAHW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAG/B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FormatOptions, Formatters } from './formatters';
|
|
2
|
+
export interface IDataSchemaField {
|
|
3
|
+
description: string;
|
|
4
|
+
formatter?: Formatters;
|
|
5
|
+
formatOptions?: FormatOptions;
|
|
6
|
+
jsonPath: string;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
sample?: string | number | boolean | string[];
|
|
9
|
+
title: string;
|
|
10
|
+
data_type: 'string' | 'number' | 'date' | 'stringArray' | 'objectArray' | 'boolean' | 'wkt' | 'geojson' | 'imgSrc' | 'downloadSrc' | 'coordinates' | 'coordinatesLatLngCSV' | 'coordinatesLngLatCSV' | 'imageUrlList' | 'temporalObjectArray' | 'imageObjectArray';
|
|
11
|
+
fields?: IDataSchemaField[];
|
|
12
|
+
imageObjectKey?: string;
|
|
13
|
+
temporalObjectKey?: string;
|
|
14
|
+
docRef?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface IPartnerDataSchema {
|
|
17
|
+
name: string;
|
|
18
|
+
partner: string;
|
|
19
|
+
offering: string;
|
|
20
|
+
docRef?: string;
|
|
21
|
+
fields: IDataSchemaField[];
|
|
22
|
+
}
|
|
23
|
+
export interface IPartnerDataSchemas {
|
|
24
|
+
[name: string]: IPartnerDataSchema;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=IPartnerDataSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IPartnerDataSchema.d.ts","sourceRoot":"","sources":["../../src/types/IPartnerDataSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEzD,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,CAAC;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EACL,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,aAAa,GACb,aAAa,GACb,SAAS,GACT,KAAK,GACL,SAAS,GACT,QAAQ,GACR,aAAa,GACb,aAAa,GACb,sBAAsB,GACtB,sBAAsB,GACtB,cAAc,GACd,qBAAqB,GACrB,kBAAkB,CAAC;IACvB,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,gBAAgB,EAAE,CAAC;CAC5B;AACD,MAAM,WAAW,mBAAmB;IAClC,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAAC;CACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IPartnerDataSchema.js","sourceRoot":"","sources":["../../src/types/IPartnerDataSchema.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IntegrationEventName, Storage } from '.';
|
|
2
|
+
export declare type Command<T, U> = (data?: T, options?: Record<string, string>) => Promise<U>;
|
|
3
|
+
/**
|
|
4
|
+
* Base class for integrations. All integrations should default export a class that extends this class.
|
|
5
|
+
*/
|
|
6
|
+
export declare class Integration {
|
|
7
|
+
protected credentials?: Record<string, string> | undefined;
|
|
8
|
+
protected options?: Record<string, string> | undefined;
|
|
9
|
+
protected storage?: Storage | undefined;
|
|
10
|
+
private events;
|
|
11
|
+
private commands;
|
|
12
|
+
constructor(credentials?: Record<string, string> | undefined, options?: Record<string, string> | undefined, storage?: Storage | undefined);
|
|
13
|
+
/**
|
|
14
|
+
* Initializer for the class. This will be called once per instance of the integration. Multiple instances
|
|
15
|
+
* of an integration may be loaded throughout the system. Integrations should override this method if they
|
|
16
|
+
* need to register event handlers.
|
|
17
|
+
*/
|
|
18
|
+
init(): Promise<void>;
|
|
19
|
+
command<T = any, U = any>(label: string, data?: T, options?: Record<string, string>): Promise<U>;
|
|
20
|
+
protected registerCommand<T = any, U = any>(label: string, command: Command<T, U>): void;
|
|
21
|
+
protected on(eventName: IntegrationEventName.webhook_called, handler: (data: any, propertyId?: number) => void): this;
|
|
22
|
+
protected on(eventName: IntegrationEventName.cadence, handler: (label: string) => void): this;
|
|
23
|
+
emit(eventName: IntegrationEventName.webhook_called, data: any, propertyId?: number): boolean;
|
|
24
|
+
emit(eventName: IntegrationEventName.cadence, label: string): boolean;
|
|
25
|
+
}
|
|
26
|
+
//# 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,OAAO,EAAE,MAAM,GAAG,CAAC;AAElD,oBAAY,OAAO,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AAEvF;;GAEG;AACH,qBAAa,WAAW;IAKpB,SAAS,CAAC,WAAW,CAAC;IACtB,SAAS,CAAC,OAAO,CAAC;IAClB,SAAS,CAAC,OAAO,CAAC;IANpB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,QAAQ,CAAyC;gBAG7C,WAAW,CAAC,oCAAwB,EACpC,OAAO,CAAC,oCAAwB,EAChC,OAAO,CAAC,qBAAS;IAI7B;;;;OAIG;IACU,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,OAAO,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAK7G,SAAS,CAAC,eAAe,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IAIjF,SAAS,CAAC,EAAE,CAAC,SAAS,EAAE,oBAAoB,CAAC,cAAc,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI;IACrH,SAAS,CAAC,EAAE,CAAC,SAAS,EAAE,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI;IAMtF,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,cAAc,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO;IAC7F,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;CAI7E"}
|
|
@@ -0,0 +1,41 @@
|
|
|
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(credentials, options, storage) {
|
|
10
|
+
this.credentials = credentials;
|
|
11
|
+
this.options = options;
|
|
12
|
+
this.storage = storage;
|
|
13
|
+
this.commands = {};
|
|
14
|
+
this.events = new events_1.EventEmitter();
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Initializer for the class. This will be called once per instance of the integration. Multiple instances
|
|
18
|
+
* of an integration may be loaded throughout the system. Integrations should override this method if they
|
|
19
|
+
* need to register event handlers.
|
|
20
|
+
*/
|
|
21
|
+
async init() {
|
|
22
|
+
// noop
|
|
23
|
+
}
|
|
24
|
+
async command(label, data, options) {
|
|
25
|
+
if (this.commands[label])
|
|
26
|
+
return this.commands[label](data, options);
|
|
27
|
+
throw new Error('Not implemented');
|
|
28
|
+
}
|
|
29
|
+
registerCommand(label, command) {
|
|
30
|
+
this.commands[label] = command;
|
|
31
|
+
}
|
|
32
|
+
on(eventName, handler) {
|
|
33
|
+
this.events.on(eventName, handler);
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
emit(eventName, ...args) {
|
|
37
|
+
return this.events.emit(eventName, ...args);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.Integration = Integration;
|
|
41
|
+
//# sourceMappingURL=Integration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Integration.js","sourceRoot":"","sources":["../../src/types/Integration.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AAKtC;;GAEG;AACH,MAAa,WAAW;IAItB,YACY,WAAoC,EACpC,OAAgC,EAChC,OAAiB;QAFjB,gBAAW,GAAX,WAAW,CAAyB;QACpC,YAAO,GAAP,OAAO,CAAyB;QAChC,YAAO,GAAP,OAAO,CAAU;QALrB,aAAQ,GAAsC,EAAE,CAAC;QAOvD,IAAI,CAAC,MAAM,GAAG,IAAI,qBAAY,EAAE,CAAC;IACnC,CAAC;IACD;;;;OAIG;IACI,KAAK,CAAC,IAAI;QACf,OAAO;IACT,CAAC;IAEM,KAAK,CAAC,OAAO,CAAmB,KAAa,EAAE,IAAQ,EAAE,OAAgC;QAC9F,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACrE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACrC,CAAC;IAES,eAAe,CAAmB,KAAa,EAAE,OAAsB;QAC/E,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC;IACjC,CAAC;IAIS,EAAE,CAAC,SAA+B,EAAE,OAAiC;QAC7E,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAIM,IAAI,CAAC,SAA+B,EAAE,GAAG,IAAW;QACzD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,CAAC;IAC9C,CAAC;CACF;AAzCD,kCAyCC"}
|