@flowcore/sdk 1.34.0 → 1.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/README.md +36 -3
- package/esm/commands/event-type/event-type.create.d.ts +5 -10
- package/esm/commands/event-type/event-type.create.d.ts.map +1 -1
- package/esm/commands/event-type/event-type.update.d.ts +5 -10
- package/esm/commands/event-type/event-type.update.d.ts.map +1 -1
- package/esm/contracts/event-type.d.ts +33 -21
- package/esm/contracts/event-type.d.ts.map +1 -1
- package/esm/contracts/event-type.js +59 -5
- package/package.json +1 -1
- package/script/commands/event-type/event-type.create.d.ts +5 -10
- package/script/commands/event-type/event-type.create.d.ts.map +1 -1
- package/script/commands/event-type/event-type.update.d.ts +5 -10
- package/script/commands/event-type/event-type.update.d.ts.map +1 -1
- package/script/contracts/event-type.d.ts +33 -21
- package/script/contracts/event-type.d.ts.map +1 -1
- package/script/contracts/event-type.js +59 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.35.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.34.0...v1.35.0) (2025-04-24)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **event-type:** :sparkles: enhance PII masking schema with detailed field definitions ([955ec28](https://github.com/flowcore-io/flowcore-sdk/commit/955ec281f5d026cb4cf564a25d0cc0d977df70b6))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **event-type:** :art: simplify import statements and improve PII definition formatting ([8f8af77](https://github.com/flowcore-io/flowcore-sdk/commit/8f8af77d114e912b4b76e7f92559b50a6e56b0af))
|
|
14
|
+
* **event-type:** :art: update PII types for improved clarity and consistency ([b8f632a](https://github.com/flowcore-io/flowcore-sdk/commit/b8f632aeff64b5b438f45cc171eb56d2bb09745b))
|
|
15
|
+
|
|
3
16
|
## [1.34.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.33.2...v1.34.0) (2025-04-23)
|
|
4
17
|
|
|
5
18
|
|
package/README.md
CHANGED
|
@@ -512,9 +512,42 @@ const command = new EventTypeCreateCommand({
|
|
|
512
512
|
description: "My awesome event type",
|
|
513
513
|
piiMask: {
|
|
514
514
|
key: "entityId",
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
515
|
+
schema: {
|
|
516
|
+
// Simple fields
|
|
517
|
+
name: true, // Will be masked completely
|
|
518
|
+
email: "string", // Will be masked as a string
|
|
519
|
+
age: "number", // Will be masked as a number
|
|
520
|
+
isActive: "boolean", // Will be masked as a boolean
|
|
521
|
+
|
|
522
|
+
// Complex nested objects
|
|
523
|
+
address: {
|
|
524
|
+
street: {
|
|
525
|
+
type: "string",
|
|
526
|
+
faker: "address.streetAddress" // Uses faker.js for realistic values
|
|
527
|
+
},
|
|
528
|
+
city: "string",
|
|
529
|
+
zipCode: {
|
|
530
|
+
type: "string",
|
|
531
|
+
pattern: "\\d{5}" // Will generate a 5-digit zip code
|
|
532
|
+
}
|
|
533
|
+
},
|
|
534
|
+
|
|
535
|
+
// Arrays
|
|
536
|
+
phoneNumbers: {
|
|
537
|
+
type: "array",
|
|
538
|
+
count: 2, // Will generate 2 items
|
|
539
|
+
items: "string" // Each item will be a masked string
|
|
540
|
+
},
|
|
541
|
+
|
|
542
|
+
// Objects with properties
|
|
543
|
+
preferences: {
|
|
544
|
+
type: "object",
|
|
545
|
+
properties: {
|
|
546
|
+
theme: "string",
|
|
547
|
+
notifications: "boolean"
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
}
|
|
518
551
|
},
|
|
519
552
|
piiEnabled: true
|
|
520
553
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command } from "../../common/command.js";
|
|
2
|
-
import { type EventType } from "../../contracts/event-type.js";
|
|
2
|
+
import { type EventType, type PiiDefinition } from "../../contracts/event-type.js";
|
|
3
3
|
/**
|
|
4
4
|
* The input for the event type create command
|
|
5
5
|
*/
|
|
@@ -12,17 +12,12 @@ export interface EventTypeCreateInput {
|
|
|
12
12
|
description: string;
|
|
13
13
|
/** The pii mask of the event type */
|
|
14
14
|
piiMask?: {
|
|
15
|
-
/** The json path to the key where the
|
|
15
|
+
/** The json path to the key where the entity id for the PII mask is located */
|
|
16
16
|
key: string;
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
/** The json path to the field that should be masked */
|
|
20
|
-
path: string;
|
|
21
|
-
/** The type of the field that should be masked */
|
|
22
|
-
type: "string" | "number" | "boolean";
|
|
23
|
-
}[];
|
|
17
|
+
/** Schema defining the fields that should be masked and how they should be masked */
|
|
18
|
+
schema: Record<string, PiiDefinition>;
|
|
24
19
|
};
|
|
25
|
-
/** Whether
|
|
20
|
+
/** Whether PII masking is enabled for this event type */
|
|
26
21
|
piiEnabled?: boolean;
|
|
27
22
|
}
|
|
28
23
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-type.create.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,+BAA+B,CAAA;
|
|
1
|
+
{"version":3,"file":"event-type.create.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,SAAS,EAAmB,KAAK,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAGnG;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAA;IACnB,qCAAqC;IACrC,OAAO,CAAC,EAAE;QACR,+EAA+E;QAC/E,GAAG,EAAE,MAAM,CAAA;QACX,qFAAqF;QACrF,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;KACtC,CAAA;IACD,yDAAyD;IACzD,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,OAAO,CAAC,oBAAoB,EAAE,SAAS,CAAC;IAClF;;OAEG;IACH,UAAmB,cAAc,EAAE,OAAO,CAAQ;IAElD;;OAEG;cACgB,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,SAAS;CAGlE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command } from "../../common/command.js";
|
|
2
|
-
import { type EventType } from "../../contracts/event-type.js";
|
|
2
|
+
import { type EventType, type PiiDefinition } from "../../contracts/event-type.js";
|
|
3
3
|
/**
|
|
4
4
|
* The input for the event type update command
|
|
5
5
|
*/
|
|
@@ -10,17 +10,12 @@ export type EventTypeUpdateInput = {
|
|
|
10
10
|
description?: string;
|
|
11
11
|
/** The pii mask of the event type */
|
|
12
12
|
piiMask?: {
|
|
13
|
-
/** The json path to the key where the
|
|
13
|
+
/** The json path to the key where the entity id for the PII mask is located */
|
|
14
14
|
key: string;
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
/** The json path to the field that should be masked */
|
|
18
|
-
path: string;
|
|
19
|
-
/** The type of the field that should be masked */
|
|
20
|
-
type: "string" | "number" | "boolean";
|
|
21
|
-
}[];
|
|
15
|
+
/** Schema defining the fields that should be masked and how they should be masked */
|
|
16
|
+
schema: Record<string, PiiDefinition>;
|
|
22
17
|
};
|
|
23
|
-
/** Whether
|
|
18
|
+
/** Whether PII masking is enabled for this event type */
|
|
24
19
|
piiEnabled?: boolean;
|
|
25
20
|
};
|
|
26
21
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-type.update.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,+BAA+B,CAAA;
|
|
1
|
+
{"version":3,"file":"event-type.update.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,SAAS,EAAmB,KAAK,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAGnG;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IACnB,wCAAwC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qCAAqC;IACrC,OAAO,CAAC,EAAE;QACR,+EAA+E;QAC/E,GAAG,EAAE,MAAM,CAAA;QACX,qFAAqF;QACrF,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;KACtC,CAAA;IACD,yDAAyD;IACzD,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,OAAO,CAAC,oBAAoB,EAAE,SAAS,CAAC;IAClF;;OAEG;cACgB,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAKrD;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,SAAS;CAGlE"}
|
|
@@ -1,29 +1,41 @@
|
|
|
1
|
-
import { type Static, type TArray, type
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
type:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { type Static, type TArray, type TObject, type TUnion } from "@sinclair/typebox";
|
|
2
|
+
export type SimplePiiType = boolean | "string" | "number" | "boolean";
|
|
3
|
+
export type DetailedPiiField = {
|
|
4
|
+
type: "string" | "number" | "boolean" | "object" | "array";
|
|
5
|
+
faker?: string;
|
|
6
|
+
args?: unknown[];
|
|
7
|
+
length?: number;
|
|
8
|
+
pattern?: string;
|
|
9
|
+
redact?: {
|
|
10
|
+
char: string;
|
|
11
|
+
length: number;
|
|
12
|
+
};
|
|
13
|
+
min?: number;
|
|
14
|
+
max?: number;
|
|
15
|
+
precision?: number;
|
|
16
|
+
count?: number;
|
|
17
|
+
items?: SimplePiiType | DetailedPiiField | Record<string, unknown>;
|
|
18
|
+
properties?: Record<string, SimplePiiType | DetailedPiiField | Record<string, unknown>>;
|
|
19
|
+
};
|
|
20
|
+
export type PiiDefinition = SimplePiiType | DetailedPiiField | Record<string, SimplePiiType | DetailedPiiField | Record<string, unknown>>;
|
|
21
|
+
export declare const DetailedPiiFieldSchema: TObject;
|
|
22
|
+
export declare const PiiDefinitionSchema: TUnion;
|
|
23
|
+
export declare const EventTypePiiMaskSchema: TObject;
|
|
24
|
+
export declare const EventTypePiiMaskParsedSchema: TArray<TObject>;
|
|
10
25
|
/**
|
|
11
26
|
* The schema for an event type
|
|
12
27
|
*/
|
|
13
|
-
export declare const EventTypeSchema: TObject
|
|
14
|
-
id: TString;
|
|
15
|
-
tenantId: TString;
|
|
16
|
-
dataCoreId: TString;
|
|
17
|
-
flowTypeId: TString;
|
|
18
|
-
name: TString;
|
|
19
|
-
description: TString;
|
|
20
|
-
isTruncating: TBoolean;
|
|
21
|
-
isDeleting: TBoolean;
|
|
22
|
-
piiMask: TUnion<[typeof EventTypePiiMaskSchema, TNull]>;
|
|
23
|
-
piiEnabled: TBoolean;
|
|
24
|
-
}>;
|
|
28
|
+
export declare const EventTypeSchema: TObject;
|
|
25
29
|
/**
|
|
26
30
|
* The type for an event type
|
|
27
31
|
*/
|
|
28
32
|
export type EventType = Static<typeof EventTypeSchema>;
|
|
33
|
+
/**
|
|
34
|
+
* Type for PII mask
|
|
35
|
+
*/
|
|
36
|
+
export type EventTypePiiMask = Static<typeof EventTypePiiMaskSchema>;
|
|
37
|
+
/**
|
|
38
|
+
* Type for parsed PII mask
|
|
39
|
+
*/
|
|
40
|
+
export type EventTypePiiMaskParsed = Static<typeof EventTypePiiMaskParsedSchema>;
|
|
29
41
|
//# sourceMappingURL=event-type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-type.d.ts","sourceRoot":"","sources":["../../src/contracts/event-type.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"event-type.d.ts","sourceRoot":"","sources":["../../src/contracts/event-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAA;AAG7F,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;AAErE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAA;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,OAAO,EAAE,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE;QACP,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,EAAE,MAAM,CAAA;KACf,CAAA;IACD,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,aAAa,GAAG,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CACxF,CAAA;AAGD,MAAM,MAAM,aAAa,GACrB,aAAa,GACb,gBAAgB,GAChB,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;AAE9E,eAAO,MAAM,sBAAsB,EAAE,OA6BnC,CAAA;AAEF,eAAO,MAAM,mBAAmB,EAAE,MAKhC,CAAA;AAEF,eAAO,MAAM,sBAAsB,EAAE,OAGnC,CAAA;AAEF,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,OAAO,CA6BxD,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,OAc5B,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,eAAe,CAAC,CAAA;AAEtD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAEpE;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,4BAA4B,CAAC,CAAA"}
|
|
@@ -1,12 +1,63 @@
|
|
|
1
|
-
import { Type
|
|
2
|
-
export const
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
export const DetailedPiiFieldSchema = Type.Object({
|
|
3
|
+
type: Type.Union([
|
|
4
|
+
Type.Literal("string"),
|
|
5
|
+
Type.Literal("number"),
|
|
6
|
+
Type.Literal("boolean"),
|
|
7
|
+
Type.Literal("object"),
|
|
8
|
+
Type.Literal("array"),
|
|
9
|
+
]),
|
|
10
|
+
faker: Type.Optional(Type.String()),
|
|
11
|
+
args: Type.Optional(Type.Array(Type.Unknown())),
|
|
12
|
+
length: Type.Optional(Type.Number()),
|
|
13
|
+
pattern: Type.Optional(Type.String()),
|
|
14
|
+
redact: Type.Optional(Type.Object({
|
|
15
|
+
char: Type.String({ minLength: 1, maxLength: 1 }),
|
|
16
|
+
length: Type.Number({ minimum: 1 }),
|
|
17
|
+
})),
|
|
18
|
+
min: Type.Optional(Type.Number()),
|
|
19
|
+
max: Type.Optional(Type.Number()),
|
|
20
|
+
precision: Type.Optional(Type.Number()),
|
|
21
|
+
count: Type.Optional(Type.Number()),
|
|
22
|
+
items: Type.Optional(Type.Unknown()),
|
|
23
|
+
properties: Type.Optional(Type.Record(Type.String(), Type.Unknown())),
|
|
5
24
|
});
|
|
25
|
+
export const PiiDefinitionSchema = Type.Union([
|
|
26
|
+
Type.Literal(true),
|
|
27
|
+
Type.Union([Type.Literal("string"), Type.Literal("number"), Type.Literal("boolean")]),
|
|
28
|
+
DetailedPiiFieldSchema,
|
|
29
|
+
Type.Record(Type.String(), Type.Unknown()),
|
|
30
|
+
]);
|
|
6
31
|
export const EventTypePiiMaskSchema = Type.Object({
|
|
7
32
|
key: Type.String(),
|
|
8
|
-
|
|
33
|
+
schema: Type.Record(Type.String(), PiiDefinitionSchema),
|
|
9
34
|
});
|
|
35
|
+
export const EventTypePiiMaskParsedSchema = Type.Array(Type.Object({
|
|
36
|
+
path: Type.String(),
|
|
37
|
+
definition: Type.Object({
|
|
38
|
+
type: Type.Union([
|
|
39
|
+
Type.Literal("string"),
|
|
40
|
+
Type.Literal("number"),
|
|
41
|
+
Type.Literal("boolean"),
|
|
42
|
+
Type.Literal("object"),
|
|
43
|
+
Type.Literal("array"),
|
|
44
|
+
]),
|
|
45
|
+
faker: Type.Optional(Type.String()),
|
|
46
|
+
args: Type.Array(Type.Unknown()),
|
|
47
|
+
length: Type.Optional(Type.Number()),
|
|
48
|
+
pattern: Type.Optional(Type.String()),
|
|
49
|
+
min: Type.Optional(Type.Number()),
|
|
50
|
+
max: Type.Optional(Type.Number()),
|
|
51
|
+
precision: Type.Optional(Type.Number()),
|
|
52
|
+
count: Type.Optional(Type.Number()),
|
|
53
|
+
items: Type.Optional(Type.Unknown()),
|
|
54
|
+
properties: Type.Optional(Type.Record(Type.String(), Type.Unknown())),
|
|
55
|
+
redact: Type.Optional(Type.Object({
|
|
56
|
+
char: Type.String(),
|
|
57
|
+
length: Type.Number(),
|
|
58
|
+
})),
|
|
59
|
+
}),
|
|
60
|
+
}));
|
|
10
61
|
/**
|
|
11
62
|
* The schema for an event type
|
|
12
63
|
*/
|
|
@@ -19,6 +70,9 @@ export const EventTypeSchema = Type.Object({
|
|
|
19
70
|
description: Type.String(),
|
|
20
71
|
isTruncating: Type.Boolean(),
|
|
21
72
|
isDeleting: Type.Boolean(),
|
|
73
|
+
createdAt: Type.String(),
|
|
74
|
+
updatedAt: Type.Union([Type.String(), Type.Null()]),
|
|
22
75
|
piiMask: Type.Union([EventTypePiiMaskSchema, Type.Null()]),
|
|
76
|
+
piiMaskParsed: Type.Union([EventTypePiiMaskParsedSchema, Type.Null()]),
|
|
23
77
|
piiEnabled: Type.Boolean(),
|
|
24
78
|
});
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command } from "../../common/command.js";
|
|
2
|
-
import { type EventType } from "../../contracts/event-type.js";
|
|
2
|
+
import { type EventType, type PiiDefinition } from "../../contracts/event-type.js";
|
|
3
3
|
/**
|
|
4
4
|
* The input for the event type create command
|
|
5
5
|
*/
|
|
@@ -12,17 +12,12 @@ export interface EventTypeCreateInput {
|
|
|
12
12
|
description: string;
|
|
13
13
|
/** The pii mask of the event type */
|
|
14
14
|
piiMask?: {
|
|
15
|
-
/** The json path to the key where the
|
|
15
|
+
/** The json path to the key where the entity id for the PII mask is located */
|
|
16
16
|
key: string;
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
/** The json path to the field that should be masked */
|
|
20
|
-
path: string;
|
|
21
|
-
/** The type of the field that should be masked */
|
|
22
|
-
type: "string" | "number" | "boolean";
|
|
23
|
-
}[];
|
|
17
|
+
/** Schema defining the fields that should be masked and how they should be masked */
|
|
18
|
+
schema: Record<string, PiiDefinition>;
|
|
24
19
|
};
|
|
25
|
-
/** Whether
|
|
20
|
+
/** Whether PII masking is enabled for this event type */
|
|
26
21
|
piiEnabled?: boolean;
|
|
27
22
|
}
|
|
28
23
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-type.create.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,+BAA+B,CAAA;
|
|
1
|
+
{"version":3,"file":"event-type.create.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,SAAS,EAAmB,KAAK,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAGnG;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAA;IACnB,qCAAqC;IACrC,OAAO,CAAC,EAAE;QACR,+EAA+E;QAC/E,GAAG,EAAE,MAAM,CAAA;QACX,qFAAqF;QACrF,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;KACtC,CAAA;IACD,yDAAyD;IACzD,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,OAAO,CAAC,oBAAoB,EAAE,SAAS,CAAC;IAClF;;OAEG;IACH,UAAmB,cAAc,EAAE,OAAO,CAAQ;IAElD;;OAEG;cACgB,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,SAAS;CAGlE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command } from "../../common/command.js";
|
|
2
|
-
import { type EventType } from "../../contracts/event-type.js";
|
|
2
|
+
import { type EventType, type PiiDefinition } from "../../contracts/event-type.js";
|
|
3
3
|
/**
|
|
4
4
|
* The input for the event type update command
|
|
5
5
|
*/
|
|
@@ -10,17 +10,12 @@ export type EventTypeUpdateInput = {
|
|
|
10
10
|
description?: string;
|
|
11
11
|
/** The pii mask of the event type */
|
|
12
12
|
piiMask?: {
|
|
13
|
-
/** The json path to the key where the
|
|
13
|
+
/** The json path to the key where the entity id for the PII mask is located */
|
|
14
14
|
key: string;
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
/** The json path to the field that should be masked */
|
|
18
|
-
path: string;
|
|
19
|
-
/** The type of the field that should be masked */
|
|
20
|
-
type: "string" | "number" | "boolean";
|
|
21
|
-
}[];
|
|
15
|
+
/** Schema defining the fields that should be masked and how they should be masked */
|
|
16
|
+
schema: Record<string, PiiDefinition>;
|
|
22
17
|
};
|
|
23
|
-
/** Whether
|
|
18
|
+
/** Whether PII masking is enabled for this event type */
|
|
24
19
|
piiEnabled?: boolean;
|
|
25
20
|
};
|
|
26
21
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-type.update.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,+BAA+B,CAAA;
|
|
1
|
+
{"version":3,"file":"event-type.update.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,SAAS,EAAmB,KAAK,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAGnG;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IACnB,wCAAwC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qCAAqC;IACrC,OAAO,CAAC,EAAE;QACR,+EAA+E;QAC/E,GAAG,EAAE,MAAM,CAAA;QACX,qFAAqF;QACrF,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;KACtC,CAAA;IACD,yDAAyD;IACzD,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,OAAO,CAAC,oBAAoB,EAAE,SAAS,CAAC;IAClF;;OAEG;cACgB,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAKrD;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,SAAS;CAGlE"}
|
|
@@ -1,29 +1,41 @@
|
|
|
1
|
-
import { type Static, type TArray, type
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
type:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { type Static, type TArray, type TObject, type TUnion } from "@sinclair/typebox";
|
|
2
|
+
export type SimplePiiType = boolean | "string" | "number" | "boolean";
|
|
3
|
+
export type DetailedPiiField = {
|
|
4
|
+
type: "string" | "number" | "boolean" | "object" | "array";
|
|
5
|
+
faker?: string;
|
|
6
|
+
args?: unknown[];
|
|
7
|
+
length?: number;
|
|
8
|
+
pattern?: string;
|
|
9
|
+
redact?: {
|
|
10
|
+
char: string;
|
|
11
|
+
length: number;
|
|
12
|
+
};
|
|
13
|
+
min?: number;
|
|
14
|
+
max?: number;
|
|
15
|
+
precision?: number;
|
|
16
|
+
count?: number;
|
|
17
|
+
items?: SimplePiiType | DetailedPiiField | Record<string, unknown>;
|
|
18
|
+
properties?: Record<string, SimplePiiType | DetailedPiiField | Record<string, unknown>>;
|
|
19
|
+
};
|
|
20
|
+
export type PiiDefinition = SimplePiiType | DetailedPiiField | Record<string, SimplePiiType | DetailedPiiField | Record<string, unknown>>;
|
|
21
|
+
export declare const DetailedPiiFieldSchema: TObject;
|
|
22
|
+
export declare const PiiDefinitionSchema: TUnion;
|
|
23
|
+
export declare const EventTypePiiMaskSchema: TObject;
|
|
24
|
+
export declare const EventTypePiiMaskParsedSchema: TArray<TObject>;
|
|
10
25
|
/**
|
|
11
26
|
* The schema for an event type
|
|
12
27
|
*/
|
|
13
|
-
export declare const EventTypeSchema: TObject
|
|
14
|
-
id: TString;
|
|
15
|
-
tenantId: TString;
|
|
16
|
-
dataCoreId: TString;
|
|
17
|
-
flowTypeId: TString;
|
|
18
|
-
name: TString;
|
|
19
|
-
description: TString;
|
|
20
|
-
isTruncating: TBoolean;
|
|
21
|
-
isDeleting: TBoolean;
|
|
22
|
-
piiMask: TUnion<[typeof EventTypePiiMaskSchema, TNull]>;
|
|
23
|
-
piiEnabled: TBoolean;
|
|
24
|
-
}>;
|
|
28
|
+
export declare const EventTypeSchema: TObject;
|
|
25
29
|
/**
|
|
26
30
|
* The type for an event type
|
|
27
31
|
*/
|
|
28
32
|
export type EventType = Static<typeof EventTypeSchema>;
|
|
33
|
+
/**
|
|
34
|
+
* Type for PII mask
|
|
35
|
+
*/
|
|
36
|
+
export type EventTypePiiMask = Static<typeof EventTypePiiMaskSchema>;
|
|
37
|
+
/**
|
|
38
|
+
* Type for parsed PII mask
|
|
39
|
+
*/
|
|
40
|
+
export type EventTypePiiMaskParsed = Static<typeof EventTypePiiMaskParsedSchema>;
|
|
29
41
|
//# sourceMappingURL=event-type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-type.d.ts","sourceRoot":"","sources":["../../src/contracts/event-type.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"event-type.d.ts","sourceRoot":"","sources":["../../src/contracts/event-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAA;AAG7F,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;AAErE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAA;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,OAAO,EAAE,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE;QACP,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,EAAE,MAAM,CAAA;KACf,CAAA;IACD,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,aAAa,GAAG,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CACxF,CAAA;AAGD,MAAM,MAAM,aAAa,GACrB,aAAa,GACb,gBAAgB,GAChB,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;AAE9E,eAAO,MAAM,sBAAsB,EAAE,OA6BnC,CAAA;AAEF,eAAO,MAAM,mBAAmB,EAAE,MAKhC,CAAA;AAEF,eAAO,MAAM,sBAAsB,EAAE,OAGnC,CAAA;AAEF,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,OAAO,CA6BxD,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,OAc5B,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,eAAe,CAAC,CAAA;AAEtD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAEpE;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,4BAA4B,CAAC,CAAA"}
|
|
@@ -1,15 +1,66 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EventTypeSchema = exports.EventTypePiiMaskSchema = exports.
|
|
3
|
+
exports.EventTypeSchema = exports.EventTypePiiMaskParsedSchema = exports.EventTypePiiMaskSchema = exports.PiiDefinitionSchema = exports.DetailedPiiFieldSchema = void 0;
|
|
4
4
|
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
-
exports.
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
exports.DetailedPiiFieldSchema = typebox_1.Type.Object({
|
|
6
|
+
type: typebox_1.Type.Union([
|
|
7
|
+
typebox_1.Type.Literal("string"),
|
|
8
|
+
typebox_1.Type.Literal("number"),
|
|
9
|
+
typebox_1.Type.Literal("boolean"),
|
|
10
|
+
typebox_1.Type.Literal("object"),
|
|
11
|
+
typebox_1.Type.Literal("array"),
|
|
12
|
+
]),
|
|
13
|
+
faker: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
14
|
+
args: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Unknown())),
|
|
15
|
+
length: typebox_1.Type.Optional(typebox_1.Type.Number()),
|
|
16
|
+
pattern: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
17
|
+
redact: typebox_1.Type.Optional(typebox_1.Type.Object({
|
|
18
|
+
char: typebox_1.Type.String({ minLength: 1, maxLength: 1 }),
|
|
19
|
+
length: typebox_1.Type.Number({ minimum: 1 }),
|
|
20
|
+
})),
|
|
21
|
+
min: typebox_1.Type.Optional(typebox_1.Type.Number()),
|
|
22
|
+
max: typebox_1.Type.Optional(typebox_1.Type.Number()),
|
|
23
|
+
precision: typebox_1.Type.Optional(typebox_1.Type.Number()),
|
|
24
|
+
count: typebox_1.Type.Optional(typebox_1.Type.Number()),
|
|
25
|
+
items: typebox_1.Type.Optional(typebox_1.Type.Unknown()),
|
|
26
|
+
properties: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown())),
|
|
8
27
|
});
|
|
28
|
+
exports.PiiDefinitionSchema = typebox_1.Type.Union([
|
|
29
|
+
typebox_1.Type.Literal(true),
|
|
30
|
+
typebox_1.Type.Union([typebox_1.Type.Literal("string"), typebox_1.Type.Literal("number"), typebox_1.Type.Literal("boolean")]),
|
|
31
|
+
exports.DetailedPiiFieldSchema,
|
|
32
|
+
typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown()),
|
|
33
|
+
]);
|
|
9
34
|
exports.EventTypePiiMaskSchema = typebox_1.Type.Object({
|
|
10
35
|
key: typebox_1.Type.String(),
|
|
11
|
-
|
|
36
|
+
schema: typebox_1.Type.Record(typebox_1.Type.String(), exports.PiiDefinitionSchema),
|
|
12
37
|
});
|
|
38
|
+
exports.EventTypePiiMaskParsedSchema = typebox_1.Type.Array(typebox_1.Type.Object({
|
|
39
|
+
path: typebox_1.Type.String(),
|
|
40
|
+
definition: typebox_1.Type.Object({
|
|
41
|
+
type: typebox_1.Type.Union([
|
|
42
|
+
typebox_1.Type.Literal("string"),
|
|
43
|
+
typebox_1.Type.Literal("number"),
|
|
44
|
+
typebox_1.Type.Literal("boolean"),
|
|
45
|
+
typebox_1.Type.Literal("object"),
|
|
46
|
+
typebox_1.Type.Literal("array"),
|
|
47
|
+
]),
|
|
48
|
+
faker: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
49
|
+
args: typebox_1.Type.Array(typebox_1.Type.Unknown()),
|
|
50
|
+
length: typebox_1.Type.Optional(typebox_1.Type.Number()),
|
|
51
|
+
pattern: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
52
|
+
min: typebox_1.Type.Optional(typebox_1.Type.Number()),
|
|
53
|
+
max: typebox_1.Type.Optional(typebox_1.Type.Number()),
|
|
54
|
+
precision: typebox_1.Type.Optional(typebox_1.Type.Number()),
|
|
55
|
+
count: typebox_1.Type.Optional(typebox_1.Type.Number()),
|
|
56
|
+
items: typebox_1.Type.Optional(typebox_1.Type.Unknown()),
|
|
57
|
+
properties: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown())),
|
|
58
|
+
redact: typebox_1.Type.Optional(typebox_1.Type.Object({
|
|
59
|
+
char: typebox_1.Type.String(),
|
|
60
|
+
length: typebox_1.Type.Number(),
|
|
61
|
+
})),
|
|
62
|
+
}),
|
|
63
|
+
}));
|
|
13
64
|
/**
|
|
14
65
|
* The schema for an event type
|
|
15
66
|
*/
|
|
@@ -22,6 +73,9 @@ exports.EventTypeSchema = typebox_1.Type.Object({
|
|
|
22
73
|
description: typebox_1.Type.String(),
|
|
23
74
|
isTruncating: typebox_1.Type.Boolean(),
|
|
24
75
|
isDeleting: typebox_1.Type.Boolean(),
|
|
76
|
+
createdAt: typebox_1.Type.String(),
|
|
77
|
+
updatedAt: typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()]),
|
|
25
78
|
piiMask: typebox_1.Type.Union([exports.EventTypePiiMaskSchema, typebox_1.Type.Null()]),
|
|
79
|
+
piiMaskParsed: typebox_1.Type.Union([exports.EventTypePiiMaskParsedSchema, typebox_1.Type.Null()]),
|
|
26
80
|
piiEnabled: typebox_1.Type.Boolean(),
|
|
27
81
|
});
|