@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.
Files changed (97) hide show
  1. package/lib/Network/axios-error-handling.d.ts +26 -0
  2. package/lib/Network/axios-error-handling.d.ts.map +1 -0
  3. package/lib/Network/axios-error-handling.js +52 -0
  4. package/lib/Network/axios-error-handling.js.map +1 -0
  5. package/lib/Network/index.d.ts +11 -0
  6. package/lib/Network/index.d.ts.map +1 -0
  7. package/lib/Network/index.js +19 -0
  8. package/lib/Network/index.js.map +1 -0
  9. package/lib/Parse/index.d.ts +4 -0
  10. package/lib/Parse/index.d.ts.map +1 -0
  11. package/lib/Parse/index.js +16 -0
  12. package/lib/Parse/index.js.map +1 -0
  13. package/lib/TestHarness/index.d.ts +11 -0
  14. package/lib/TestHarness/index.d.ts.map +1 -0
  15. package/lib/TestHarness/index.js +39 -0
  16. package/lib/TestHarness/index.js.map +1 -0
  17. package/lib/hooks/index.d.ts +3 -0
  18. package/lib/hooks/index.d.ts.map +1 -0
  19. package/lib/hooks/index.js +6 -0
  20. package/lib/hooks/index.js.map +1 -0
  21. package/lib/hooks/useWindowMessge/index.d.ts +7 -0
  22. package/lib/hooks/useWindowMessge/index.d.ts.map +1 -0
  23. package/lib/hooks/useWindowMessge/index.js +28 -0
  24. package/lib/hooks/useWindowMessge/index.js.map +1 -0
  25. package/lib/types/Enrichment.d.ts +89 -0
  26. package/lib/types/Enrichment.d.ts.map +1 -0
  27. package/lib/types/Enrichment.js +3 -0
  28. package/lib/types/Enrichment.js.map +1 -0
  29. package/lib/types/EnrichmentComponentArgs.d.ts +51 -0
  30. package/lib/types/EnrichmentComponentArgs.d.ts.map +1 -0
  31. package/lib/types/EnrichmentComponentArgs.js +3 -0
  32. package/lib/types/EnrichmentComponentArgs.js.map +1 -0
  33. package/lib/types/Events.d.ts +5 -0
  34. package/lib/types/Events.d.ts.map +1 -0
  35. package/lib/types/Events.js +9 -0
  36. package/lib/types/Events.js.map +1 -0
  37. package/lib/types/IPartnerDataSchema.d.ts +26 -0
  38. package/lib/types/IPartnerDataSchema.d.ts.map +1 -0
  39. package/lib/types/IPartnerDataSchema.js +3 -0
  40. package/lib/types/IPartnerDataSchema.js.map +1 -0
  41. package/lib/types/Integration.d.ts +26 -0
  42. package/lib/types/Integration.d.ts.map +1 -0
  43. package/lib/types/Integration.js +41 -0
  44. package/lib/types/Integration.js.map +1 -0
  45. package/lib/types/IntegrationManifest.d.ts +47 -0
  46. package/lib/types/IntegrationManifest.d.ts.map +1 -0
  47. package/lib/types/IntegrationManifest.js +3 -0
  48. package/lib/types/IntegrationManifest.js.map +1 -0
  49. package/lib/types/Storage.d.ts +13 -0
  50. package/lib/types/Storage.d.ts.map +1 -0
  51. package/lib/types/Storage.js +3 -0
  52. package/lib/types/Storage.js.map +1 -0
  53. package/lib/types/formatters/functions/arrayToString.d.ts +7 -0
  54. package/lib/types/formatters/functions/arrayToString.d.ts.map +1 -0
  55. package/lib/types/formatters/functions/arrayToString.js +7 -0
  56. package/lib/types/formatters/functions/arrayToString.js.map +1 -0
  57. package/lib/types/formatters/functions/capitalize.d.ts +6 -0
  58. package/lib/types/formatters/functions/capitalize.d.ts.map +1 -0
  59. package/lib/types/formatters/functions/capitalize.js +11 -0
  60. package/lib/types/formatters/functions/capitalize.js.map +1 -0
  61. package/lib/types/formatters/functions/date.d.ts +4 -0
  62. package/lib/types/formatters/functions/date.d.ts.map +1 -0
  63. package/lib/types/formatters/functions/date.js +15 -0
  64. package/lib/types/formatters/functions/date.js.map +1 -0
  65. package/lib/types/formatters/functions/decimalToPercentage.d.ts +4 -0
  66. package/lib/types/formatters/functions/decimalToPercentage.d.ts.map +1 -0
  67. package/lib/types/formatters/functions/decimalToPercentage.js +16 -0
  68. package/lib/types/formatters/functions/decimalToPercentage.js.map +1 -0
  69. package/lib/types/formatters/functions/index.d.ts +8 -0
  70. package/lib/types/formatters/functions/index.d.ts.map +1 -0
  71. package/lib/types/formatters/functions/index.js +19 -0
  72. package/lib/types/formatters/functions/index.js.map +1 -0
  73. package/lib/types/formatters/functions/numberToString.d.ts +4 -0
  74. package/lib/types/formatters/functions/numberToString.d.ts.map +1 -0
  75. package/lib/types/formatters/functions/numberToString.js +32 -0
  76. package/lib/types/formatters/functions/numberToString.js.map +1 -0
  77. package/lib/types/formatters/functions/scoreLetterToLowMedHigh.d.ts +4 -0
  78. package/lib/types/formatters/functions/scoreLetterToLowMedHigh.d.ts.map +1 -0
  79. package/lib/types/formatters/functions/scoreLetterToLowMedHigh.js +22 -0
  80. package/lib/types/formatters/functions/scoreLetterToLowMedHigh.js.map +1 -0
  81. package/lib/types/formatters/index.d.ts +3 -0
  82. package/lib/types/formatters/index.d.ts.map +1 -0
  83. package/lib/types/formatters/index.js +19 -0
  84. package/lib/types/formatters/index.js.map +1 -0
  85. package/lib/types/formatters/types/index.d.ts +38 -0
  86. package/lib/types/formatters/types/index.d.ts.map +1 -0
  87. package/lib/types/formatters/types/index.js +30 -0
  88. package/lib/types/formatters/types/index.js.map +1 -0
  89. package/lib/types/index.d.ts +9 -0
  90. package/lib/types/index.d.ts.map +1 -0
  91. package/lib/types/index.js +25 -0
  92. package/lib/types/index.js.map +1 -0
  93. package/lib/utils/index.d.ts +2 -0
  94. package/lib/utils/index.d.ts.map +1 -0
  95. package/lib/utils/index.js +12 -0
  96. package/lib/utils/index.js.map +1 -0
  97. package/package.json +2 -1
@@ -0,0 +1,47 @@
1
+ export declare type IntegrationManifest = {
2
+ version: number;
3
+ partner: string;
4
+ offering: string;
5
+ description: string;
6
+ abstract?: string;
7
+ contact_name?: string;
8
+ contact_email?: string;
9
+ website_url?: string;
10
+ capabilities: {
11
+ cadence?: Cadence | Cadence[];
12
+ webhook?: boolean;
13
+ enrichment?: {
14
+ requires?: string[];
15
+ provides?: string[];
16
+ /**
17
+ * Use `components` instead
18
+ *
19
+ * @deprecated
20
+ */
21
+ has_card?: boolean;
22
+ has_photos?: string[];
23
+ };
24
+ hasCommands?: boolean;
25
+ };
26
+ /**
27
+ * Optional list of custom components
28
+ */
29
+ components?: {
30
+ bundle: string;
31
+ type: string;
32
+ }[];
33
+ credentials_schema?: Record<string, {
34
+ display: string;
35
+ sensitive?: boolean;
36
+ }>;
37
+ options_schema?: Record<string, {
38
+ display: string;
39
+ required?: boolean;
40
+ }>;
41
+ };
42
+ declare type Cadence = {
43
+ schedule: 'daily' | 'weekly' | 'monthly';
44
+ label: string;
45
+ };
46
+ export {};
47
+ //# sourceMappingURL=IntegrationManifest.d.ts.map
@@ -0,0 +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,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;YACnB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;SACvB,CAAC;QACF,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,CAAC;IACF;;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;IAC9E,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CAC1E,CAAC;AAEF,aAAK,OAAO,GAAG;IACb,QAAQ,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;IAEzC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IntegrationManifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IntegrationManifest.js","sourceRoot":"","sources":["../../src/types/IntegrationManifest.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { Readable } from 'stream';
4
+ /**
5
+ * Provides data and file storage for integrations
6
+ */
7
+ export interface Storage {
8
+ getFile(key: string): Promise<Readable | null>;
9
+ putFile(key: string, buffer: Buffer): Promise<void>;
10
+ getData(key: string): Promise<string | null>;
11
+ saveData(key: string, value: string | null): Promise<void>;
12
+ }
13
+ //# sourceMappingURL=Storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Storage.d.ts","sourceRoot":"","sources":["../../src/types/Storage.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IAC/C,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC7C,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Storage.js","sourceRoot":"","sources":["../../src/types/Storage.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { IDataFormatterRequest } from '..';
2
+ export declare const arrayToString: ({ data, separator, emptyResponse }: IDataFormatterRequest & {
3
+ data: string[];
4
+ separator: string;
5
+ }) => string;
6
+ export default arrayToString;
7
+ //# sourceMappingURL=arrayToString.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrayToString.d.ts","sourceRoot":"","sources":["../../../../src/types/formatters/functions/arrayToString.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,IAAI,CAAC;AAE3C,eAAO,MAAM,aAAa;UAIS,MAAM,EAAE;eAAa,MAAM;YAAmD,CAAC;AAElH,eAAe,aAAa,CAAC"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.arrayToString = void 0;
4
+ const arrayToString = ({ data, separator = ',', emptyResponse = '-' }) => data?.join(`${separator} `) ?? emptyResponse;
5
+ exports.arrayToString = arrayToString;
6
+ exports.default = exports.arrayToString;
7
+ //# sourceMappingURL=arrayToString.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrayToString.js","sourceRoot":"","sources":["../../../../src/types/formatters/functions/arrayToString.ts"],"names":[],"mappings":";;;AAEO,MAAM,aAAa,GAAG,CAAC,EAC5B,IAAI,EACJ,SAAS,GAAG,GAAG,EACf,aAAa,GAAG,GAAG,EAC2C,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,SAAS,GAAG,CAAC,IAAI,aAAa,CAAC;AAJrG,QAAA,aAAa,iBAIwF;AAElH,kBAAe,qBAAa,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { IDataFormatterRequest } from '..';
2
+ export declare const capitalize: ({ data, emptyResponse }: IDataFormatterRequest & {
3
+ data: string;
4
+ }) => string;
5
+ export default capitalize;
6
+ //# sourceMappingURL=capitalize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capitalize.d.ts","sourceRoot":"","sources":["../../../../src/types/formatters/functions/capitalize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,IAAI,CAAC;AAE3C,eAAO,MAAM,UAAU;UAAmE,MAAM;MAAK,MAGpG,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.capitalize = void 0;
4
+ const capitalize = ({ data, emptyResponse = '-' }) => {
5
+ if (!data)
6
+ return emptyResponse;
7
+ return data.charAt(0).toUpperCase() + data.slice(1);
8
+ };
9
+ exports.capitalize = capitalize;
10
+ exports.default = exports.capitalize;
11
+ //# sourceMappingURL=capitalize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capitalize.js","sourceRoot":"","sources":["../../../../src/types/formatters/functions/capitalize.ts"],"names":[],"mappings":";;;AAEO,MAAM,UAAU,GAAG,CAAC,EAAE,IAAI,EAAE,aAAa,GAAG,GAAG,EAA4C,EAAU,EAAE;IAC5G,IAAI,CAAC,IAAI;QAAE,OAAO,aAAa,CAAC;IAChC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC,CAAC;AAHW,QAAA,UAAU,cAGrB;AAEF,kBAAe,kBAAU,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { IDataFormatterRequest } from '..';
2
+ export declare const date: ({ data, emptyResponse, options }: IDataFormatterRequest) => string;
3
+ export default date;
4
+ //# sourceMappingURL=date.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../../../src/types/formatters/functions/date.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,IAAI,CAAC;AAE3C,eAAO,MAAM,IAAI,qCAId,qBAAqB,KAAG,MAG1B,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,15 @@
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.date = void 0;
7
+ const moment_1 = __importDefault(require("moment"));
8
+ const date = ({ data, emptyResponse = '-', options = { dateFormat: 'MMM D, YYYY' } }) => {
9
+ if (!data || !(0, moment_1.default)(data).isValid())
10
+ return emptyResponse; // return the original string if it's empty
11
+ return (0, moment_1.default)(data).format(options.dateFormat);
12
+ };
13
+ exports.date = date;
14
+ exports.default = exports.date;
15
+ //# sourceMappingURL=date.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date.js","sourceRoot":"","sources":["../../../../src/types/formatters/functions/date.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAGrB,MAAM,IAAI,GAAG,CAAC,EACnB,IAAI,EACJ,aAAa,GAAG,GAAG,EACnB,OAAO,GAAG,EAAE,UAAU,EAAE,aAAa,EAAE,EACjB,EAAU,EAAE;IAClC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAA,gBAAM,EAAC,IAAc,CAAC,CAAC,OAAO,EAAE;QAAE,OAAO,aAAa,CAAC,CAAC,2CAA2C;IACjH,OAAO,IAAA,gBAAM,EAAC,IAAc,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAC3D,CAAC,CAAC;AAPW,QAAA,IAAI,QAOf;AAEF,kBAAe,YAAI,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { IDataFormatterRequest } from '..';
2
+ declare const decimalToPercentage: ({ data, emptyResponse }: IDataFormatterRequest) => string;
3
+ export default decimalToPercentage;
4
+ //# sourceMappingURL=decimalToPercentage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decimalToPercentage.d.ts","sourceRoot":"","sources":["../../../../src/types/formatters/functions/decimalToPercentage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,IAAI,CAAC;AAC3C,QAAA,MAAM,mBAAmB,4BAAmC,qBAAqB,KAAG,MAWnF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const decimalToPercentage = ({ data, emptyResponse = '-' }) => {
4
+ if (!data && data !== 0) {
5
+ return emptyResponse;
6
+ }
7
+ if (typeof data !== 'number' && typeof data !== 'string')
8
+ return `${data}`;
9
+ if (isNaN(data))
10
+ return `${data}`;
11
+ const num = Number(data);
12
+ const strNum = `${(num * 100).toFixed(2)}%`;
13
+ return strNum;
14
+ };
15
+ exports.default = decimalToPercentage;
16
+ //# sourceMappingURL=decimalToPercentage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decimalToPercentage.js","sourceRoot":"","sources":["../../../../src/types/formatters/functions/decimalToPercentage.ts"],"names":[],"mappings":";;AACA,MAAM,mBAAmB,GAAG,CAAC,EAAE,IAAI,EAAE,aAAa,GAAG,GAAG,EAAyB,EAAU,EAAE;IAC3F,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,CAAC,EAAE;QACvB,OAAO,aAAa,CAAC;KACtB;IACD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,GAAG,IAAI,EAAE,CAAC;IAC3E,IAAI,KAAK,CAAC,IAAc,CAAC;QAAE,OAAO,GAAG,IAAI,EAAE,CAAC;IAE5C,MAAM,GAAG,GAAG,MAAM,CAAC,IAAc,CAAC,CAAC;IACnC,MAAM,MAAM,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;IAE5C,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,kBAAe,mBAAmB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import arrayToStringFn from '../functions/arrayToString';
2
+ import capitalizeFn from '../functions/capitalize';
3
+ import dateFn from '../functions/date';
4
+ import decimalToPercentage from './decimalToPercentage';
5
+ import numberToString from './numberToString';
6
+ import scoreLetterToLowMedHigh from './scoreLetterToLowMedHigh';
7
+ export { arrayToStringFn, capitalizeFn, dateFn, decimalToPercentage, numberToString, scoreLetterToLowMedHigh };
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/formatters/functions/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,4BAA4B,CAAC;AACzD,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,CAAC"}
@@ -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.scoreLetterToLowMedHigh = exports.numberToString = exports.decimalToPercentage = exports.dateFn = exports.capitalizeFn = exports.arrayToStringFn = void 0;
7
+ const arrayToString_1 = __importDefault(require("../functions/arrayToString"));
8
+ exports.arrayToStringFn = arrayToString_1.default;
9
+ const capitalize_1 = __importDefault(require("../functions/capitalize"));
10
+ exports.capitalizeFn = capitalize_1.default;
11
+ const date_1 = __importDefault(require("../functions/date"));
12
+ exports.dateFn = date_1.default;
13
+ const decimalToPercentage_1 = __importDefault(require("./decimalToPercentage"));
14
+ exports.decimalToPercentage = decimalToPercentage_1.default;
15
+ const numberToString_1 = __importDefault(require("./numberToString"));
16
+ exports.numberToString = numberToString_1.default;
17
+ const scoreLetterToLowMedHigh_1 = __importDefault(require("./scoreLetterToLowMedHigh"));
18
+ exports.scoreLetterToLowMedHigh = scoreLetterToLowMedHigh_1.default;
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/formatters/functions/index.ts"],"names":[],"mappings":";;;;;;AAAA,+EAAyD;AAOhD,0BAPF,uBAAe,CAOE;AANxB,yEAAmD;AAMzB,uBANnB,oBAAY,CAMmB;AALtC,6DAAuC;AAKC,iBALjC,cAAM,CAKiC;AAJ9C,gFAAwD;AAIR,8BAJzC,6BAAmB,CAIyC;AAHnE,sEAA8C;AAGuB,yBAH9D,wBAAc,CAG8D;AAFnF,wFAAgE;AAEqB,kCAF9E,iCAAuB,CAE8E"}
@@ -0,0 +1,4 @@
1
+ import { IDataFormatterRequest } from '..';
2
+ export declare const numberToString: ({ data, emptyResponse, options }: IDataFormatterRequest) => string;
3
+ export default numberToString;
4
+ //# sourceMappingURL=numberToString.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numberToString.d.ts","sourceRoot":"","sources":["../../../../src/types/formatters/functions/numberToString.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,IAAI,CAAC;AAE3C,eAAO,MAAM,cAAc,qCAA4C,qBAAqB,KAAG,MA0B9F,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.numberToString = void 0;
4
+ const numberToString = ({ data, emptyResponse = '-', options }) => {
5
+ if (typeof data !== 'number' && typeof data !== 'string')
6
+ return emptyResponse;
7
+ let num = Number(data);
8
+ if (isNaN(num))
9
+ return `${data}`;
10
+ const { prefix, round, suffix } = options ?? {};
11
+ if (round) {
12
+ num = typeof round === 'number' ? parseFloat(num.toFixed(round)) : Math.round(num);
13
+ }
14
+ let str = `${num}`;
15
+ if (options?.round) {
16
+ str = `${Math.round(num * 100) / 100}`;
17
+ }
18
+ if (options?.includeCommas) {
19
+ num = parseFloat(str);
20
+ str = num.toLocaleString('en-US');
21
+ }
22
+ if (prefix) {
23
+ str = `${prefix}${str}`;
24
+ }
25
+ if (suffix) {
26
+ str = `${str}${num === 1 ? suffix.single : suffix.multiple}`;
27
+ }
28
+ return str;
29
+ };
30
+ exports.numberToString = numberToString;
31
+ exports.default = exports.numberToString;
32
+ //# sourceMappingURL=numberToString.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numberToString.js","sourceRoot":"","sources":["../../../../src/types/formatters/functions/numberToString.ts"],"names":[],"mappings":";;;AAEO,MAAM,cAAc,GAAG,CAAC,EAAE,IAAI,EAAE,aAAa,GAAG,GAAG,EAAE,OAAO,EAAyB,EAAU,EAAE;IACtG,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,aAAa,CAAC;IAC/E,IAAI,GAAG,GAAW,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAI,KAAK,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,IAAI,EAAE,CAAC;IAEjC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAChD,IAAI,KAAK,EAAE;QACT,GAAG,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KACpF;IAED,IAAI,GAAG,GAAG,GAAG,GAAG,EAAE,CAAC;IACnB,IAAI,OAAO,EAAE,KAAK,EAAE;QAClB,GAAG,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC;KACxC;IACD,IAAI,OAAO,EAAE,aAAa,EAAE;QAC1B,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;QACtB,GAAG,GAAG,GAAG,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;KACnC;IACD,IAAI,MAAM,EAAE;QACV,GAAG,GAAG,GAAG,MAAM,GAAG,GAAG,EAAE,CAAC;KACzB;IACD,IAAI,MAAM,EAAE;QACV,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;KAC9D;IAED,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AA1BW,QAAA,cAAc,kBA0BzB;AAEF,kBAAe,sBAAc,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { IDataFormatterRequest } from '..';
2
+ declare const scoreLetterToLowMedHigh: ({ data }: IDataFormatterRequest) => string;
3
+ export default scoreLetterToLowMedHigh;
4
+ //# sourceMappingURL=scoreLetterToLowMedHigh.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scoreLetterToLowMedHigh.d.ts","sourceRoot":"","sources":["../../../../src/types/formatters/functions/scoreLetterToLowMedHigh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,IAAI,CAAC;AAE3C,QAAA,MAAM,uBAAuB,aAAc,qBAAqB,KAAG,MAiBlE,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const scoreLetterToLowMedHigh = ({ data }) => {
4
+ let text = 'Low';
5
+ switch (data || 'A') {
6
+ case 'C':
7
+ text = 'Moderate';
8
+ break;
9
+ case 'D':
10
+ text = 'Moderate-High';
11
+ break;
12
+ case 'F':
13
+ text = 'High';
14
+ break;
15
+ default:
16
+ text = `Low`;
17
+ break;
18
+ }
19
+ return text;
20
+ };
21
+ exports.default = scoreLetterToLowMedHigh;
22
+ //# sourceMappingURL=scoreLetterToLowMedHigh.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scoreLetterToLowMedHigh.js","sourceRoot":"","sources":["../../../../src/types/formatters/functions/scoreLetterToLowMedHigh.ts"],"names":[],"mappings":";;AAEA,MAAM,uBAAuB,GAAG,CAAC,EAAE,IAAI,EAAyB,EAAU,EAAE;IAC1E,IAAI,IAAI,GAAG,KAAK,CAAC;IACjB,QAAQ,IAAI,IAAI,GAAG,EAAE;QACnB,KAAK,GAAG;YACN,IAAI,GAAG,UAAU,CAAC;YAClB,MAAM;QACR,KAAK,GAAG;YACN,IAAI,GAAG,eAAe,CAAC;YACvB,MAAM;QACR,KAAK,GAAG;YACN,IAAI,GAAG,MAAM,CAAC;YACd,MAAM;QACR;YACE,IAAI,GAAG,KAAK,CAAC;YACb,MAAM;KACT;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,kBAAe,uBAAuB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './functions';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/formatters/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./functions"), exports);
18
+ __exportStar(require("./types"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/formatters/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,0CAAwB"}
@@ -0,0 +1,38 @@
1
+ export declare enum Formatters {
2
+ scoreLetterToLowMedHigh = "scoreLetterToLowMedHigh",
3
+ decimalToPercentage = "decimalToPercentage",
4
+ numberToString = "numberToString",
5
+ capitalize = "capitalize",
6
+ arrayToString = "arrayToString",
7
+ date = "date"
8
+ }
9
+ export declare const FormatterFunctions: {
10
+ scoreLetterToLowMedHigh: ({ data }: IDataFormatterRequest) => string;
11
+ decimalToPercentage: ({ data, emptyResponse }: IDataFormatterRequest) => string;
12
+ numberToString: ({ data, emptyResponse, options }: IDataFormatterRequest) => string;
13
+ capitalize: ({ data, emptyResponse }: IDataFormatterRequest & {
14
+ data: string;
15
+ }) => string;
16
+ arrayToString: ({ data, separator, emptyResponse }: IDataFormatterRequest & {
17
+ data: string[];
18
+ separator: string;
19
+ }) => string;
20
+ date: ({ data, emptyResponse, options }: IDataFormatterRequest) => string;
21
+ };
22
+ export declare type FormatOptions = {
23
+ dateFormat?: string;
24
+ includeCommas?: boolean;
25
+ prefix?: string;
26
+ round?: true | number;
27
+ suffix?: {
28
+ single: string;
29
+ multiple: string;
30
+ };
31
+ };
32
+ export interface IDataFormatterRequest {
33
+ data: string | number | null | boolean | undefined;
34
+ emptyResponse?: string;
35
+ options?: FormatOptions;
36
+ }
37
+ export declare type Formatter = (request: IDataFormatterRequest) => string;
38
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/formatters/types/index.ts"],"names":[],"mappings":"AAOA,oBAAY,UAAU;IACpB,uBAAuB,4BAA4B;IACnD,mBAAmB,wBAAwB;IAC3C,cAAc,mBAAmB;IACjC,UAAU,eAAe;IACzB,aAAa,kBAAkB;IAC/B,IAAI,SAAS;CACd;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;;;;CAO9B,CAAC;AAEF,oBAAY,aAAa,GAAG;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,CAAC;IACnD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,oBAAY,SAAS,GAAG,CAAC,OAAO,EAAE,qBAAqB,KAAK,MAAM,CAAC"}
@@ -0,0 +1,30 @@
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.FormatterFunctions = exports.Formatters = void 0;
7
+ const arrayToString_1 = __importDefault(require("../functions/arrayToString"));
8
+ const capitalize_1 = __importDefault(require("../functions/capitalize"));
9
+ const date_1 = __importDefault(require("../functions/date"));
10
+ const decimalToPercentage_1 = __importDefault(require("../functions/decimalToPercentage"));
11
+ const numberToString_1 = __importDefault(require("../functions/numberToString"));
12
+ const scoreLetterToLowMedHigh_1 = __importDefault(require("../functions/scoreLetterToLowMedHigh"));
13
+ var Formatters;
14
+ (function (Formatters) {
15
+ Formatters["scoreLetterToLowMedHigh"] = "scoreLetterToLowMedHigh";
16
+ Formatters["decimalToPercentage"] = "decimalToPercentage";
17
+ Formatters["numberToString"] = "numberToString";
18
+ Formatters["capitalize"] = "capitalize";
19
+ Formatters["arrayToString"] = "arrayToString";
20
+ Formatters["date"] = "date";
21
+ })(Formatters = exports.Formatters || (exports.Formatters = {}));
22
+ exports.FormatterFunctions = {
23
+ [Formatters.scoreLetterToLowMedHigh]: scoreLetterToLowMedHigh_1.default,
24
+ [Formatters.decimalToPercentage]: decimalToPercentage_1.default,
25
+ [Formatters.numberToString]: numberToString_1.default,
26
+ [Formatters.capitalize]: capitalize_1.default,
27
+ [Formatters.arrayToString]: arrayToString_1.default,
28
+ [Formatters.date]: date_1.default
29
+ };
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/formatters/types/index.ts"],"names":[],"mappings":";;;;;;AAAA,+EAAyD;AACzD,yEAAmD;AACnD,6DAAuC;AACvC,2FAAqE;AACrE,iFAA2D;AAC3D,mGAA6E;AAE7E,IAAY,UAOX;AAPD,WAAY,UAAU;IACpB,iEAAmD,CAAA;IACnD,yDAA2C,CAAA;IAC3C,+CAAiC,CAAA;IACjC,uCAAyB,CAAA;IACzB,6CAA+B,CAAA;IAC/B,2BAAa,CAAA;AACf,CAAC,EAPW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAOrB;AAEY,QAAA,kBAAkB,GAAG;IAChC,CAAC,UAAU,CAAC,uBAAuB,CAAC,EAAE,iCAAyB;IAC/D,CAAC,UAAU,CAAC,mBAAmB,CAAC,EAAE,6BAAqB;IACvD,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,wBAAgB;IAC7C,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,oBAAY;IACrC,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,uBAAe;IAC3C,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,cAAM;CAC1B,CAAC"}
@@ -0,0 +1,9 @@
1
+ export * from './Enrichment';
2
+ export * from './EnrichmentComponentArgs';
3
+ export * from './Events';
4
+ export * from './Integration';
5
+ export * from './IntegrationManifest';
6
+ export * from './IPartnerDataSchema';
7
+ export * from './Storage';
8
+ export * from './formatters';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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;AACrC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Enrichment"), exports);
18
+ __exportStar(require("./EnrichmentComponentArgs"), exports);
19
+ __exportStar(require("./Events"), exports);
20
+ __exportStar(require("./Integration"), exports);
21
+ __exportStar(require("./IntegrationManifest"), exports);
22
+ __exportStar(require("./IPartnerDataSchema"), exports);
23
+ __exportStar(require("./Storage"), exports);
24
+ __exportStar(require("./formatters"), exports);
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
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;AACrC,4CAA0B;AAC1B,+CAA6B"}
@@ -0,0 +1,2 @@
1
+ export declare function jsonLog(obj: Record<string, any> | undefined): string;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAEA,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,UAE3D"}
@@ -0,0 +1,12 @@
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.jsonLog = void 0;
7
+ const json_colorizer_1 = __importDefault(require("json-colorizer"));
8
+ function jsonLog(obj) {
9
+ return (0, json_colorizer_1.default)(JSON.stringify(obj, null, 2));
10
+ }
11
+ exports.jsonLog = jsonLog;
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;AAAA,oEAAsC;AAEtC,SAAgB,OAAO,CAAC,GAAoC;IAC1D,OAAO,IAAA,wBAAQ,EAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC;AAFD,0BAEC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterview/integration-toolkit",
3
- "version": "7.5.4",
3
+ "version": "7.5.7",
4
4
  "description": "Supports integration packages. This should be the only import from our integrations",
5
5
  "scripts": {
6
6
  "prebuild": "rm -rf ./lib",
@@ -20,6 +20,7 @@
20
20
  "geojson": "0.5.0",
21
21
  "json-colorizer": "2.2.2",
22
22
  "lodash": "4.17.21",
23
+ "moment": "^2.30.1",
23
24
  "xml2js": "0.6.2"
24
25
  },
25
26
  "peerDependencies": {