@alanszp/integrations-common 12.0.2 → 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.
- package/package.json +4 -7
- package/.gitignore +0 -3
- package/.npmignore +0 -3
- package/node_modules/@jest/schemas/LICENSE +0 -21
- package/node_modules/@jest/schemas/README.md +0 -3
- package/node_modules/@jest/schemas/build/index.d.ts +0 -72
- package/node_modules/@jest/schemas/build/index.js +0 -65
- package/node_modules/@jest/schemas/package.json +0 -29
- package/node_modules/@types/jest/LICENSE +0 -21
- package/node_modules/@types/jest/README.md +0 -17
- package/node_modules/@types/jest/index.d.ts +0 -1684
- package/node_modules/@types/jest/package.json +0 -159
- package/node_modules/@types/node/LICENSE +0 -21
- package/node_modules/@types/node/README.md +0 -15
- package/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/node_modules/@types/node/assert.d.ts +0 -996
- package/node_modules/@types/node/async_hooks.d.ts +0 -539
- package/node_modules/@types/node/buffer.d.ts +0 -2362
- package/node_modules/@types/node/child_process.d.ts +0 -1540
- package/node_modules/@types/node/cluster.d.ts +0 -432
- package/node_modules/@types/node/console.d.ts +0 -415
- package/node_modules/@types/node/constants.d.ts +0 -19
- package/node_modules/@types/node/crypto.d.ts +0 -4487
- package/node_modules/@types/node/dgram.d.ts +0 -596
- package/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
- package/node_modules/@types/node/dns/promises.d.ts +0 -425
- package/node_modules/@types/node/dns.d.ts +0 -809
- package/node_modules/@types/node/dom-events.d.ts +0 -122
- package/node_modules/@types/node/domain.d.ts +0 -170
- package/node_modules/@types/node/events.d.ts +0 -879
- package/node_modules/@types/node/fs/promises.d.ts +0 -1239
- package/node_modules/@types/node/fs.d.ts +0 -4311
- package/node_modules/@types/node/globals.d.ts +0 -411
- package/node_modules/@types/node/globals.global.d.ts +0 -1
- package/node_modules/@types/node/http.d.ts +0 -1887
- package/node_modules/@types/node/http2.d.ts +0 -2382
- package/node_modules/@types/node/https.d.ts +0 -550
- package/node_modules/@types/node/index.d.ts +0 -88
- package/node_modules/@types/node/inspector.d.ts +0 -2747
- package/node_modules/@types/node/module.d.ts +0 -315
- package/node_modules/@types/node/net.d.ts +0 -949
- package/node_modules/@types/node/os.d.ts +0 -478
- package/node_modules/@types/node/package.json +0 -229
- package/node_modules/@types/node/path.d.ts +0 -191
- package/node_modules/@types/node/perf_hooks.d.ts +0 -645
- package/node_modules/@types/node/process.d.ts +0 -1561
- package/node_modules/@types/node/punycode.d.ts +0 -117
- package/node_modules/@types/node/querystring.d.ts +0 -141
- package/node_modules/@types/node/readline/promises.d.ts +0 -150
- package/node_modules/@types/node/readline.d.ts +0 -539
- package/node_modules/@types/node/repl.d.ts +0 -430
- package/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/node_modules/@types/node/stream/promises.d.ts +0 -83
- package/node_modules/@types/node/stream/web.d.ts +0 -366
- package/node_modules/@types/node/stream.d.ts +0 -1701
- package/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/node_modules/@types/node/test.d.ts +0 -1465
- package/node_modules/@types/node/timers/promises.d.ts +0 -93
- package/node_modules/@types/node/timers.d.ts +0 -240
- package/node_modules/@types/node/tls.d.ts +0 -1210
- package/node_modules/@types/node/trace_events.d.ts +0 -182
- package/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
- package/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
- package/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
- package/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
- package/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
- package/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
- package/node_modules/@types/node/ts4.8/console.d.ts +0 -415
- package/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
- package/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
- package/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
- package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
- package/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
- package/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
- package/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
- package/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
- package/node_modules/@types/node/ts4.8/events.d.ts +0 -879
- package/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
- package/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
- package/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
- package/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
- package/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
- package/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
- package/node_modules/@types/node/ts4.8/https.d.ts +0 -550
- package/node_modules/@types/node/ts4.8/index.d.ts +0 -88
- package/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
- package/node_modules/@types/node/ts4.8/module.d.ts +0 -315
- package/node_modules/@types/node/ts4.8/net.d.ts +0 -949
- package/node_modules/@types/node/ts4.8/os.d.ts +0 -478
- package/node_modules/@types/node/ts4.8/path.d.ts +0 -191
- package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
- package/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
- package/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
- package/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
- package/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
- package/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
- package/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
- package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
- package/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
- package/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
- package/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
- package/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
- package/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
- package/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
- package/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
- package/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
- package/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
- package/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
- package/node_modules/@types/node/ts4.8/url.d.ts +0 -927
- package/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
- package/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
- package/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
- package/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
- package/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
- package/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
- package/node_modules/@types/node/tty.d.ts +0 -208
- package/node_modules/@types/node/url.d.ts +0 -927
- package/node_modules/@types/node/util.d.ts +0 -2183
- package/node_modules/@types/node/v8.d.ts +0 -764
- package/node_modules/@types/node/vm.d.ts +0 -903
- package/node_modules/@types/node/wasi.d.ts +0 -179
- package/node_modules/@types/node/worker_threads.d.ts +0 -691
- package/node_modules/@types/node/zlib.d.ts +0 -517
- package/src/IntegrationExecutionResult.ts +0 -106
- package/src/helpers/generateChecksum.test.ts +0 -41
- package/src/helpers/generateChecksum.ts +0 -32
- package/src/index.ts +0 -5
- package/src/models/BaseIntegrationHistory.ts +0 -30
- package/src/types.ts +0 -32
- 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
|
-
}
|