@alanszp/integrations-common 12.0.1 → 12.0.3

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 (130) hide show
  1. package/package.json +4 -8
  2. package/.gitignore +0 -3
  3. package/.npmignore +0 -3
  4. package/node_modules/@jest/schemas/LICENSE +0 -21
  5. package/node_modules/@jest/schemas/README.md +0 -3
  6. package/node_modules/@jest/schemas/build/index.d.ts +0 -72
  7. package/node_modules/@jest/schemas/build/index.js +0 -65
  8. package/node_modules/@jest/schemas/package.json +0 -29
  9. package/node_modules/@types/jest/LICENSE +0 -21
  10. package/node_modules/@types/jest/README.md +0 -17
  11. package/node_modules/@types/jest/index.d.ts +0 -1684
  12. package/node_modules/@types/jest/package.json +0 -159
  13. package/node_modules/@types/node/LICENSE +0 -21
  14. package/node_modules/@types/node/README.md +0 -15
  15. package/node_modules/@types/node/assert/strict.d.ts +0 -8
  16. package/node_modules/@types/node/assert.d.ts +0 -996
  17. package/node_modules/@types/node/async_hooks.d.ts +0 -539
  18. package/node_modules/@types/node/buffer.d.ts +0 -2362
  19. package/node_modules/@types/node/child_process.d.ts +0 -1540
  20. package/node_modules/@types/node/cluster.d.ts +0 -432
  21. package/node_modules/@types/node/console.d.ts +0 -415
  22. package/node_modules/@types/node/constants.d.ts +0 -19
  23. package/node_modules/@types/node/crypto.d.ts +0 -4487
  24. package/node_modules/@types/node/dgram.d.ts +0 -596
  25. package/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
  26. package/node_modules/@types/node/dns/promises.d.ts +0 -425
  27. package/node_modules/@types/node/dns.d.ts +0 -809
  28. package/node_modules/@types/node/dom-events.d.ts +0 -122
  29. package/node_modules/@types/node/domain.d.ts +0 -170
  30. package/node_modules/@types/node/events.d.ts +0 -879
  31. package/node_modules/@types/node/fs/promises.d.ts +0 -1239
  32. package/node_modules/@types/node/fs.d.ts +0 -4311
  33. package/node_modules/@types/node/globals.d.ts +0 -411
  34. package/node_modules/@types/node/globals.global.d.ts +0 -1
  35. package/node_modules/@types/node/http.d.ts +0 -1887
  36. package/node_modules/@types/node/http2.d.ts +0 -2382
  37. package/node_modules/@types/node/https.d.ts +0 -550
  38. package/node_modules/@types/node/index.d.ts +0 -88
  39. package/node_modules/@types/node/inspector.d.ts +0 -2747
  40. package/node_modules/@types/node/module.d.ts +0 -315
  41. package/node_modules/@types/node/net.d.ts +0 -949
  42. package/node_modules/@types/node/os.d.ts +0 -478
  43. package/node_modules/@types/node/package.json +0 -229
  44. package/node_modules/@types/node/path.d.ts +0 -191
  45. package/node_modules/@types/node/perf_hooks.d.ts +0 -645
  46. package/node_modules/@types/node/process.d.ts +0 -1561
  47. package/node_modules/@types/node/punycode.d.ts +0 -117
  48. package/node_modules/@types/node/querystring.d.ts +0 -141
  49. package/node_modules/@types/node/readline/promises.d.ts +0 -150
  50. package/node_modules/@types/node/readline.d.ts +0 -539
  51. package/node_modules/@types/node/repl.d.ts +0 -430
  52. package/node_modules/@types/node/stream/consumers.d.ts +0 -12
  53. package/node_modules/@types/node/stream/promises.d.ts +0 -83
  54. package/node_modules/@types/node/stream/web.d.ts +0 -366
  55. package/node_modules/@types/node/stream.d.ts +0 -1701
  56. package/node_modules/@types/node/string_decoder.d.ts +0 -67
  57. package/node_modules/@types/node/test.d.ts +0 -1465
  58. package/node_modules/@types/node/timers/promises.d.ts +0 -93
  59. package/node_modules/@types/node/timers.d.ts +0 -240
  60. package/node_modules/@types/node/tls.d.ts +0 -1210
  61. package/node_modules/@types/node/trace_events.d.ts +0 -182
  62. package/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
  63. package/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
  64. package/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
  65. package/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
  66. package/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
  67. package/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
  68. package/node_modules/@types/node/ts4.8/console.d.ts +0 -415
  69. package/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
  70. package/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
  71. package/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
  72. package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
  73. package/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
  74. package/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
  75. package/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
  76. package/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
  77. package/node_modules/@types/node/ts4.8/events.d.ts +0 -879
  78. package/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
  79. package/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
  80. package/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
  81. package/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
  82. package/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
  83. package/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
  84. package/node_modules/@types/node/ts4.8/https.d.ts +0 -550
  85. package/node_modules/@types/node/ts4.8/index.d.ts +0 -88
  86. package/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
  87. package/node_modules/@types/node/ts4.8/module.d.ts +0 -315
  88. package/node_modules/@types/node/ts4.8/net.d.ts +0 -949
  89. package/node_modules/@types/node/ts4.8/os.d.ts +0 -478
  90. package/node_modules/@types/node/ts4.8/path.d.ts +0 -191
  91. package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
  92. package/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
  93. package/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
  94. package/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
  95. package/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
  96. package/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
  97. package/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
  98. package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
  99. package/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
  100. package/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
  101. package/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
  102. package/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
  103. package/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
  104. package/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
  105. package/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
  106. package/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
  107. package/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
  108. package/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
  109. package/node_modules/@types/node/ts4.8/url.d.ts +0 -927
  110. package/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
  111. package/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
  112. package/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
  113. package/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
  114. package/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
  115. package/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
  116. package/node_modules/@types/node/tty.d.ts +0 -208
  117. package/node_modules/@types/node/url.d.ts +0 -927
  118. package/node_modules/@types/node/util.d.ts +0 -2183
  119. package/node_modules/@types/node/v8.d.ts +0 -764
  120. package/node_modules/@types/node/vm.d.ts +0 -903
  121. package/node_modules/@types/node/wasi.d.ts +0 -179
  122. package/node_modules/@types/node/worker_threads.d.ts +0 -691
  123. package/node_modules/@types/node/zlib.d.ts +0 -517
  124. package/src/IntegrationExecutionResult.ts +0 -106
  125. package/src/helpers/generateChecksum.test.ts +0 -41
  126. package/src/helpers/generateChecksum.ts +0 -32
  127. package/src/index.ts +0 -5
  128. package/src/models/BaseIntegrationHistory.ts +0 -30
  129. package/src/types.ts +0 -32
  130. package/src/views/integrationView.ts +0 -27
@@ -1,30 +0,0 @@
1
- import { BaseEntityUuid } from "@alanszp/typeorm";
2
- import { IntegrationResultStatus, IntegrationStatus } from "../types";
3
- import { IsDate, IsEnum, IsNotEmpty, IsString } from "class-validator";
4
- import { Column, CreateDateColumn } from "typeorm";
5
-
6
- export abstract class BaseIntegrationHistory extends BaseEntityUuid {
7
- @Column()
8
- @IsString()
9
- public integrationId: string;
10
-
11
- @Column()
12
- @IsString()
13
- public organizationReference: string;
14
-
15
- @Column({ type: "enum", enum: IntegrationStatus, nullable: false })
16
- @IsEnum(IntegrationStatus)
17
- public status: IntegrationStatus;
18
-
19
- @Column({ type: "jsonb" })
20
- @IsNotEmpty()
21
- public result: IntegrationResultStatus;
22
-
23
- @CreateDateColumn()
24
- @IsDate()
25
- public executedAt: Date;
26
-
27
- @Column()
28
- @IsString()
29
- public executedBy: string;
30
- }
package/src/types.ts DELETED
@@ -1,32 +0,0 @@
1
- export enum IntegrationStatus {
2
- SUCCESS = "success",
3
- ERROR = "error",
4
- }
5
-
6
- export enum SyncError {
7
- MISSING_FIELDS = "missing",
8
- VALIDATION = "validation",
9
- VALIDATION_SERVER = "validation_server",
10
- CREATION_DISABLED = "creation_disabled",
11
- }
12
-
13
- export type IntegrationResultError = {
14
- type: SyncError;
15
- userReference: string;
16
- metadata: string[];
17
- };
18
-
19
- export interface IntegrationResultStatus {
20
- totals: {
21
- added: number;
22
- updated: number;
23
- removed: number;
24
- error: number;
25
- };
26
- details: {
27
- added: string[];
28
- updated: string[];
29
- removed: string[];
30
- error: IntegrationResultError[];
31
- };
32
- }
@@ -1,27 +0,0 @@
1
- import { IntegrationExecutionResult } from "../IntegrationExecutionResult";
2
- import { BaseIntegrationHistory } from "../models/BaseIntegrationHistory";
3
-
4
- export function syncIntegrationHistoryView<IH extends BaseIntegrationHistory>(
5
- history: IH
6
- ): Record<string, unknown> {
7
- return {
8
- id: history.id,
9
- status: history.status,
10
- executedAt: history.executedAt,
11
- executedBy: history.executedBy,
12
- totals: history.result.totals,
13
- details: history.result.details,
14
- };
15
- }
16
-
17
- export function syncIntegrationResultsView(
18
- result: IntegrationExecutionResult
19
- ): Record<string, unknown> {
20
- const { totals, details } = result.getResults();
21
- return {
22
- totals,
23
- details,
24
- status: result.getStatus(),
25
- context: result.getContext(),
26
- };
27
- }