@ampsec/platform-client 61.2.1 → 61.3.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/build/src/dto/flows.dto.d.ts +65 -65
- package/build/src/dto/flows.dto.js +6 -4
- package/build/src/dto/flows.dto.js.map +1 -1
- package/build/src/dto/platform/platform.flows.dto.d.ts +50 -50
- package/build/src/services/AmpSdk.d.ts +4 -4
- package/build/src/services/AmpSdk.js +3 -3
- package/build/src/services/AmpSdk.js.map +1 -1
- package/build/src/services/entity.service.d.ts +7 -1
- package/build/src/services/entity.service.js +29 -1
- package/build/src/services/entity.service.js.map +1 -1
- package/package.json +1 -1
- package/src/dto/flows.dto.ts +11 -9
- package/src/services/AmpSdk.ts +19 -7
- package/src/services/entity.service.ts +33 -1
|
@@ -828,7 +828,7 @@ export declare const _FlowSpecDto: z.ZodObject<{
|
|
|
828
828
|
custom?: Record<string, unknown> | undefined;
|
|
829
829
|
}>;
|
|
830
830
|
filter: z.ZodObject<{
|
|
831
|
-
cohorts: z.ZodArray<z.ZodObject<{
|
|
831
|
+
cohorts: z.ZodArray<z.ZodOptional<z.ZodObject<{
|
|
832
832
|
id: z.ZodString;
|
|
833
833
|
kind: z.ZodEnum<["ORGANIZATION", "DEPARTMENT", "USER", "RISK_CONTRIBUTOR"]>;
|
|
834
834
|
displayValue: z.ZodString;
|
|
@@ -846,34 +846,34 @@ export declare const _FlowSpecDto: z.ZodObject<{
|
|
|
846
846
|
id: string;
|
|
847
847
|
displayValue: string;
|
|
848
848
|
kind: "USER" | "ORGANIZATION" | "DEPARTMENT" | "RISK_CONTRIBUTOR";
|
|
849
|
-
}
|
|
849
|
+
}>>, "many">;
|
|
850
850
|
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
851
851
|
}, "strip", z.ZodTypeAny, {
|
|
852
|
-
cohorts: {
|
|
852
|
+
cohorts: ({
|
|
853
853
|
inclusive: boolean;
|
|
854
854
|
value: string;
|
|
855
855
|
id: string;
|
|
856
856
|
displayValue: string;
|
|
857
857
|
kind: "USER" | "ORGANIZATION" | "DEPARTMENT" | "RISK_CONTRIBUTOR";
|
|
858
|
-
}[];
|
|
858
|
+
} | undefined)[];
|
|
859
859
|
custom?: Record<string, unknown> | undefined;
|
|
860
860
|
}, {
|
|
861
|
-
cohorts: {
|
|
861
|
+
cohorts: ({
|
|
862
862
|
inclusive: boolean;
|
|
863
863
|
value: string;
|
|
864
864
|
id: string;
|
|
865
865
|
displayValue: string;
|
|
866
866
|
kind: "USER" | "ORGANIZATION" | "DEPARTMENT" | "RISK_CONTRIBUTOR";
|
|
867
|
-
}[];
|
|
867
|
+
} | undefined)[];
|
|
868
868
|
custom?: Record<string, unknown> | undefined;
|
|
869
869
|
}>;
|
|
870
870
|
engagementChannelCids: z.ZodArray<z.ZodString, "many">;
|
|
871
871
|
tone: z.ZodOptional<z.ZodObject<{
|
|
872
|
-
kind: z.ZodString
|
|
872
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
873
873
|
}, "strip", z.ZodTypeAny, {
|
|
874
|
-
kind
|
|
874
|
+
kind?: string | undefined;
|
|
875
875
|
}, {
|
|
876
|
-
kind
|
|
876
|
+
kind?: string | undefined;
|
|
877
877
|
}>>;
|
|
878
878
|
targetResolution: z.ZodOptional<z.ZodObject<{
|
|
879
879
|
minutes: z.ZodNumber;
|
|
@@ -940,14 +940,14 @@ export declare const _FlowSpecDto: z.ZodObject<{
|
|
|
940
940
|
units?: string | undefined;
|
|
941
941
|
}>, "many">>;
|
|
942
942
|
customMessage: z.ZodOptional<z.ZodObject<{
|
|
943
|
-
template: z.ZodString
|
|
944
|
-
append: z.ZodBoolean
|
|
943
|
+
template: z.ZodOptional<z.ZodString>;
|
|
944
|
+
append: z.ZodOptional<z.ZodBoolean>;
|
|
945
945
|
}, "strip", z.ZodTypeAny, {
|
|
946
|
-
template
|
|
947
|
-
append
|
|
946
|
+
template?: string | undefined;
|
|
947
|
+
append?: boolean | undefined;
|
|
948
948
|
}, {
|
|
949
|
-
template
|
|
950
|
-
append
|
|
949
|
+
template?: string | undefined;
|
|
950
|
+
append?: boolean | undefined;
|
|
951
951
|
}>>;
|
|
952
952
|
scheduleConfig: z.ZodOptional<z.ZodObject<{
|
|
953
953
|
required: z.ZodBoolean;
|
|
@@ -971,13 +971,13 @@ export declare const _FlowSpecDto: z.ZodObject<{
|
|
|
971
971
|
}>>;
|
|
972
972
|
}, "strip", z.ZodTypeAny, {
|
|
973
973
|
filter: {
|
|
974
|
-
cohorts: {
|
|
974
|
+
cohorts: ({
|
|
975
975
|
inclusive: boolean;
|
|
976
976
|
value: string;
|
|
977
977
|
id: string;
|
|
978
978
|
displayValue: string;
|
|
979
979
|
kind: "USER" | "ORGANIZATION" | "DEPARTMENT" | "RISK_CONTRIBUTOR";
|
|
980
|
-
}[];
|
|
980
|
+
} | undefined)[];
|
|
981
981
|
custom?: Record<string, unknown> | undefined;
|
|
982
982
|
};
|
|
983
983
|
name: string;
|
|
@@ -1000,7 +1000,7 @@ export declare const _FlowSpecDto: z.ZodObject<{
|
|
|
1000
1000
|
};
|
|
1001
1001
|
engagementChannelCids: string[];
|
|
1002
1002
|
tone?: {
|
|
1003
|
-
kind
|
|
1003
|
+
kind?: string | undefined;
|
|
1004
1004
|
} | undefined;
|
|
1005
1005
|
targetResolution?: {
|
|
1006
1006
|
minutes: number;
|
|
@@ -1027,8 +1027,8 @@ export declare const _FlowSpecDto: z.ZodObject<{
|
|
|
1027
1027
|
units?: string | undefined;
|
|
1028
1028
|
}[] | undefined;
|
|
1029
1029
|
customMessage?: {
|
|
1030
|
-
template
|
|
1031
|
-
append
|
|
1030
|
+
template?: string | undefined;
|
|
1031
|
+
append?: boolean | undefined;
|
|
1032
1032
|
} | undefined;
|
|
1033
1033
|
scheduleConfig?: {
|
|
1034
1034
|
required: boolean;
|
|
@@ -1040,13 +1040,13 @@ export declare const _FlowSpecDto: z.ZodObject<{
|
|
|
1040
1040
|
} | undefined;
|
|
1041
1041
|
}, {
|
|
1042
1042
|
filter: {
|
|
1043
|
-
cohorts: {
|
|
1043
|
+
cohorts: ({
|
|
1044
1044
|
inclusive: boolean;
|
|
1045
1045
|
value: string;
|
|
1046
1046
|
id: string;
|
|
1047
1047
|
displayValue: string;
|
|
1048
1048
|
kind: "USER" | "ORGANIZATION" | "DEPARTMENT" | "RISK_CONTRIBUTOR";
|
|
1049
|
-
}[];
|
|
1049
|
+
} | undefined)[];
|
|
1050
1050
|
custom?: Record<string, unknown> | undefined;
|
|
1051
1051
|
};
|
|
1052
1052
|
name: string;
|
|
@@ -1069,7 +1069,7 @@ export declare const _FlowSpecDto: z.ZodObject<{
|
|
|
1069
1069
|
engagementChannelCids: string[];
|
|
1070
1070
|
fslStrategy?: "STANDARD" | undefined;
|
|
1071
1071
|
tone?: {
|
|
1072
|
-
kind
|
|
1072
|
+
kind?: string | undefined;
|
|
1073
1073
|
} | undefined;
|
|
1074
1074
|
targetResolution?: {
|
|
1075
1075
|
minutes: number;
|
|
@@ -1096,8 +1096,8 @@ export declare const _FlowSpecDto: z.ZodObject<{
|
|
|
1096
1096
|
units?: string | undefined;
|
|
1097
1097
|
}[] | undefined;
|
|
1098
1098
|
customMessage?: {
|
|
1099
|
-
template
|
|
1100
|
-
append
|
|
1099
|
+
template?: string | undefined;
|
|
1100
|
+
append?: boolean | undefined;
|
|
1101
1101
|
} | undefined;
|
|
1102
1102
|
scheduleConfig?: {
|
|
1103
1103
|
required: boolean;
|
|
@@ -1111,7 +1111,7 @@ export declare const _FlowSpecDto: z.ZodObject<{
|
|
|
1111
1111
|
export type FlowSpecDto = z.infer<typeof _FlowSpecDto>;
|
|
1112
1112
|
export declare const _FlowSpecUpsertDto: z.ZodObject<{
|
|
1113
1113
|
filter: z.ZodObject<{
|
|
1114
|
-
cohorts: z.ZodArray<z.ZodObject<{
|
|
1114
|
+
cohorts: z.ZodArray<z.ZodOptional<z.ZodObject<{
|
|
1115
1115
|
id: z.ZodString;
|
|
1116
1116
|
kind: z.ZodEnum<["ORGANIZATION", "DEPARTMENT", "USER", "RISK_CONTRIBUTOR"]>;
|
|
1117
1117
|
displayValue: z.ZodString;
|
|
@@ -1129,25 +1129,25 @@ export declare const _FlowSpecUpsertDto: z.ZodObject<{
|
|
|
1129
1129
|
id: string;
|
|
1130
1130
|
displayValue: string;
|
|
1131
1131
|
kind: "USER" | "ORGANIZATION" | "DEPARTMENT" | "RISK_CONTRIBUTOR";
|
|
1132
|
-
}
|
|
1132
|
+
}>>, "many">;
|
|
1133
1133
|
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1134
1134
|
}, "strip", z.ZodTypeAny, {
|
|
1135
|
-
cohorts: {
|
|
1135
|
+
cohorts: ({
|
|
1136
1136
|
inclusive: boolean;
|
|
1137
1137
|
value: string;
|
|
1138
1138
|
id: string;
|
|
1139
1139
|
displayValue: string;
|
|
1140
1140
|
kind: "USER" | "ORGANIZATION" | "DEPARTMENT" | "RISK_CONTRIBUTOR";
|
|
1141
|
-
}[];
|
|
1141
|
+
} | undefined)[];
|
|
1142
1142
|
custom?: Record<string, unknown> | undefined;
|
|
1143
1143
|
}, {
|
|
1144
|
-
cohorts: {
|
|
1144
|
+
cohorts: ({
|
|
1145
1145
|
inclusive: boolean;
|
|
1146
1146
|
value: string;
|
|
1147
1147
|
id: string;
|
|
1148
1148
|
displayValue: string;
|
|
1149
1149
|
kind: "USER" | "ORGANIZATION" | "DEPARTMENT" | "RISK_CONTRIBUTOR";
|
|
1150
|
-
}[];
|
|
1150
|
+
} | undefined)[];
|
|
1151
1151
|
custom?: Record<string, unknown> | undefined;
|
|
1152
1152
|
}>;
|
|
1153
1153
|
name: z.ZodString;
|
|
@@ -1192,11 +1192,11 @@ export declare const _FlowSpecUpsertDto: z.ZodObject<{
|
|
|
1192
1192
|
}>;
|
|
1193
1193
|
engagementChannelCids: z.ZodArray<z.ZodString, "many">;
|
|
1194
1194
|
tone: z.ZodOptional<z.ZodObject<{
|
|
1195
|
-
kind: z.ZodString
|
|
1195
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
1196
1196
|
}, "strip", z.ZodTypeAny, {
|
|
1197
|
-
kind
|
|
1197
|
+
kind?: string | undefined;
|
|
1198
1198
|
}, {
|
|
1199
|
-
kind
|
|
1199
|
+
kind?: string | undefined;
|
|
1200
1200
|
}>>;
|
|
1201
1201
|
targetResolution: z.ZodOptional<z.ZodObject<{
|
|
1202
1202
|
minutes: z.ZodNumber;
|
|
@@ -1263,14 +1263,14 @@ export declare const _FlowSpecUpsertDto: z.ZodObject<{
|
|
|
1263
1263
|
units?: string | undefined;
|
|
1264
1264
|
}>, "many">>;
|
|
1265
1265
|
customMessage: z.ZodOptional<z.ZodObject<{
|
|
1266
|
-
template: z.ZodString
|
|
1267
|
-
append: z.ZodBoolean
|
|
1266
|
+
template: z.ZodOptional<z.ZodString>;
|
|
1267
|
+
append: z.ZodOptional<z.ZodBoolean>;
|
|
1268
1268
|
}, "strip", z.ZodTypeAny, {
|
|
1269
|
-
template
|
|
1270
|
-
append
|
|
1269
|
+
template?: string | undefined;
|
|
1270
|
+
append?: boolean | undefined;
|
|
1271
1271
|
}, {
|
|
1272
|
-
template
|
|
1273
|
-
append
|
|
1272
|
+
template?: string | undefined;
|
|
1273
|
+
append?: boolean | undefined;
|
|
1274
1274
|
}>>;
|
|
1275
1275
|
scheduleConfig: z.ZodOptional<z.ZodObject<{
|
|
1276
1276
|
required: z.ZodBoolean;
|
|
@@ -1285,13 +1285,13 @@ export declare const _FlowSpecUpsertDto: z.ZodObject<{
|
|
|
1285
1285
|
deletedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1286
1286
|
}, "strip", z.ZodTypeAny, {
|
|
1287
1287
|
filter: {
|
|
1288
|
-
cohorts: {
|
|
1288
|
+
cohorts: ({
|
|
1289
1289
|
inclusive: boolean;
|
|
1290
1290
|
value: string;
|
|
1291
1291
|
id: string;
|
|
1292
1292
|
displayValue: string;
|
|
1293
1293
|
kind: "USER" | "ORGANIZATION" | "DEPARTMENT" | "RISK_CONTRIBUTOR";
|
|
1294
|
-
}[];
|
|
1294
|
+
} | undefined)[];
|
|
1295
1295
|
custom?: Record<string, unknown> | undefined;
|
|
1296
1296
|
};
|
|
1297
1297
|
name: string;
|
|
@@ -1310,7 +1310,7 @@ export declare const _FlowSpecUpsertDto: z.ZodObject<{
|
|
|
1310
1310
|
};
|
|
1311
1311
|
engagementChannelCids: string[];
|
|
1312
1312
|
tone?: {
|
|
1313
|
-
kind
|
|
1313
|
+
kind?: string | undefined;
|
|
1314
1314
|
} | undefined;
|
|
1315
1315
|
targetResolution?: {
|
|
1316
1316
|
minutes: number;
|
|
@@ -1337,8 +1337,8 @@ export declare const _FlowSpecUpsertDto: z.ZodObject<{
|
|
|
1337
1337
|
units?: string | undefined;
|
|
1338
1338
|
}[] | undefined;
|
|
1339
1339
|
customMessage?: {
|
|
1340
|
-
template
|
|
1341
|
-
append
|
|
1340
|
+
template?: string | undefined;
|
|
1341
|
+
append?: boolean | undefined;
|
|
1342
1342
|
} | undefined;
|
|
1343
1343
|
scheduleConfig?: {
|
|
1344
1344
|
required: boolean;
|
|
@@ -1349,13 +1349,13 @@ export declare const _FlowSpecUpsertDto: z.ZodObject<{
|
|
|
1349
1349
|
deletedAt?: string | null | undefined;
|
|
1350
1350
|
}, {
|
|
1351
1351
|
filter: {
|
|
1352
|
-
cohorts: {
|
|
1352
|
+
cohorts: ({
|
|
1353
1353
|
inclusive: boolean;
|
|
1354
1354
|
value: string;
|
|
1355
1355
|
id: string;
|
|
1356
1356
|
displayValue: string;
|
|
1357
1357
|
kind: "USER" | "ORGANIZATION" | "DEPARTMENT" | "RISK_CONTRIBUTOR";
|
|
1358
|
-
}[];
|
|
1358
|
+
} | undefined)[];
|
|
1359
1359
|
custom?: Record<string, unknown> | undefined;
|
|
1360
1360
|
};
|
|
1361
1361
|
name: string;
|
|
@@ -1374,7 +1374,7 @@ export declare const _FlowSpecUpsertDto: z.ZodObject<{
|
|
|
1374
1374
|
engagementChannelCids: string[];
|
|
1375
1375
|
fslStrategy?: "STANDARD" | undefined;
|
|
1376
1376
|
tone?: {
|
|
1377
|
-
kind
|
|
1377
|
+
kind?: string | undefined;
|
|
1378
1378
|
} | undefined;
|
|
1379
1379
|
targetResolution?: {
|
|
1380
1380
|
minutes: number;
|
|
@@ -1401,8 +1401,8 @@ export declare const _FlowSpecUpsertDto: z.ZodObject<{
|
|
|
1401
1401
|
units?: string | undefined;
|
|
1402
1402
|
}[] | undefined;
|
|
1403
1403
|
customMessage?: {
|
|
1404
|
-
template
|
|
1405
|
-
append
|
|
1404
|
+
template?: string | undefined;
|
|
1405
|
+
append?: boolean | undefined;
|
|
1406
1406
|
} | undefined;
|
|
1407
1407
|
scheduleConfig?: {
|
|
1408
1408
|
required: boolean;
|
|
@@ -1427,11 +1427,11 @@ export declare const _FlowSpecFilter: z.ZodObject<{
|
|
|
1427
1427
|
fslStrategy: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodEnum<["STANDARD"]>>>>;
|
|
1428
1428
|
engagementChannelCids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1429
1429
|
tone: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
1430
|
-
kind: z.ZodString
|
|
1430
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
1431
1431
|
}, "strip", z.ZodTypeAny, {
|
|
1432
|
-
kind
|
|
1432
|
+
kind?: string | undefined;
|
|
1433
1433
|
}, {
|
|
1434
|
-
kind
|
|
1434
|
+
kind?: string | undefined;
|
|
1435
1435
|
}>>>;
|
|
1436
1436
|
targetResolution: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
1437
1437
|
minutes: z.ZodNumber;
|
|
@@ -1498,14 +1498,14 @@ export declare const _FlowSpecFilter: z.ZodObject<{
|
|
|
1498
1498
|
units?: string | undefined;
|
|
1499
1499
|
}>, "many">>>;
|
|
1500
1500
|
customMessage: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
1501
|
-
template: z.ZodString
|
|
1502
|
-
append: z.ZodBoolean
|
|
1501
|
+
template: z.ZodOptional<z.ZodString>;
|
|
1502
|
+
append: z.ZodOptional<z.ZodBoolean>;
|
|
1503
1503
|
}, "strip", z.ZodTypeAny, {
|
|
1504
|
-
template
|
|
1505
|
-
append
|
|
1504
|
+
template?: string | undefined;
|
|
1505
|
+
append?: boolean | undefined;
|
|
1506
1506
|
}, {
|
|
1507
|
-
template
|
|
1508
|
-
append
|
|
1507
|
+
template?: string | undefined;
|
|
1508
|
+
append?: boolean | undefined;
|
|
1509
1509
|
}>>>;
|
|
1510
1510
|
scheduleConfig: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
1511
1511
|
required: z.ZodBoolean;
|
|
@@ -1542,7 +1542,7 @@ export declare const _FlowSpecFilter: z.ZodObject<{
|
|
|
1542
1542
|
fslStrategy?: "STANDARD" | undefined;
|
|
1543
1543
|
engagementChannelCids?: string[] | undefined;
|
|
1544
1544
|
tone?: {
|
|
1545
|
-
kind
|
|
1545
|
+
kind?: string | undefined;
|
|
1546
1546
|
} | undefined;
|
|
1547
1547
|
targetResolution?: {
|
|
1548
1548
|
minutes: number;
|
|
@@ -1569,8 +1569,8 @@ export declare const _FlowSpecFilter: z.ZodObject<{
|
|
|
1569
1569
|
units?: string | undefined;
|
|
1570
1570
|
}[] | undefined;
|
|
1571
1571
|
customMessage?: {
|
|
1572
|
-
template
|
|
1573
|
-
append
|
|
1572
|
+
template?: string | undefined;
|
|
1573
|
+
append?: boolean | undefined;
|
|
1574
1574
|
} | undefined;
|
|
1575
1575
|
scheduleConfig?: {
|
|
1576
1576
|
required: boolean;
|
|
@@ -1595,7 +1595,7 @@ export declare const _FlowSpecFilter: z.ZodObject<{
|
|
|
1595
1595
|
fslStrategy?: "STANDARD" | undefined;
|
|
1596
1596
|
engagementChannelCids?: string[] | undefined;
|
|
1597
1597
|
tone?: {
|
|
1598
|
-
kind
|
|
1598
|
+
kind?: string | undefined;
|
|
1599
1599
|
} | undefined;
|
|
1600
1600
|
targetResolution?: {
|
|
1601
1601
|
minutes: number;
|
|
@@ -1622,8 +1622,8 @@ export declare const _FlowSpecFilter: z.ZodObject<{
|
|
|
1622
1622
|
units?: string | undefined;
|
|
1623
1623
|
}[] | undefined;
|
|
1624
1624
|
customMessage?: {
|
|
1625
|
-
template
|
|
1626
|
-
append
|
|
1625
|
+
template?: string | undefined;
|
|
1626
|
+
append?: boolean | undefined;
|
|
1627
1627
|
} | undefined;
|
|
1628
1628
|
scheduleConfig?: {
|
|
1629
1629
|
required: boolean;
|
|
@@ -88,17 +88,19 @@ const _FlowTriggerFilter = zod_1.z.object({
|
|
|
88
88
|
custom: zod_1.z.record(zod_1.z.unknown()).optional(),
|
|
89
89
|
});
|
|
90
90
|
const _FlowFilter = zod_1.z.object({
|
|
91
|
-
cohorts: zod_1.z.array(zod_1.z
|
|
91
|
+
cohorts: zod_1.z.array(zod_1.z
|
|
92
|
+
.object({
|
|
92
93
|
id: zod_1.z.string(),
|
|
93
94
|
kind: zod_1.z.enum(['ORGANIZATION', 'DEPARTMENT', 'USER', 'RISK_CONTRIBUTOR']),
|
|
94
95
|
displayValue: zod_1.z.string(),
|
|
95
96
|
value: zod_1.z.string(),
|
|
96
97
|
inclusive: zod_1.z.boolean(),
|
|
97
|
-
})
|
|
98
|
+
})
|
|
99
|
+
.optional()),
|
|
98
100
|
custom: zod_1.z.record(zod_1.z.unknown()).optional(),
|
|
99
101
|
});
|
|
100
102
|
const _FlowTone = zod_1.z.object({
|
|
101
|
-
kind: zod_1.z.string(),
|
|
103
|
+
kind: zod_1.z.string().optional(),
|
|
102
104
|
});
|
|
103
105
|
exports._FlowInterval = zod_1.z.object({
|
|
104
106
|
minutes: zod_1.z.number(),
|
|
@@ -136,7 +138,7 @@ exports._FlowSpecDto = base_dto_1._BaseDto.merge(zod_1.z.object({
|
|
|
136
138
|
reminderInterval: exports._FlowInterval.optional(),
|
|
137
139
|
actions: exports._FlowActions.optional(),
|
|
138
140
|
rewards: zod_1.z.array(exports._FlowRewardsConfig).optional(),
|
|
139
|
-
customMessage: zod_1.z.object({ template: zod_1.z.string(), append: zod_1.z.boolean() }).optional(),
|
|
141
|
+
customMessage: zod_1.z.object({ template: zod_1.z.string().optional(), append: zod_1.z.boolean().optional() }).optional(),
|
|
140
142
|
scheduleConfig: zod_1.z.object({ required: zod_1.z.boolean() }).optional(),
|
|
141
143
|
activity: zod_1.z
|
|
142
144
|
.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flows.dto.js","sourceRoot":"","sources":["../../../src/dto/flows.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AACtB,yCAAoD;AACpD,sDAAiE;AAEjE;;;;GAIG;AACU,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,IAAI,EAAE,OAAC;SACJ,MAAM,CAAC;QACN,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC1B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC7B,CAAC;SACD,QAAQ,EAAE;IACb,MAAM,EAAE,OAAC;SACN,MAAM,CAAC;QACN,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC1B,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACzB,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC3B,CAAC;SACD,QAAQ,EAAE;IACb,OAAO,EAAE,OAAC,CAAC,OAAO,EAA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AU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;KAClC,CAAC;SACD,QAAQ,EAAE;CACd,CAAC,CACH,CAAC;AAGW,QAAA,kBAAkB,GAAG,oBAAY,CAAC,IAAI,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC,KAAK,CAAC,yBAAc,CAAC,CAAC;AAG/E,QAAA,eAAe,GAAG,oBAAY,CAAC,IAAI,CAAC,EAAC,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,kCAAiB,CAAC,CAAC,KAAK,CAAC,4BAAW,CAAC,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { FlowSpecStatusKind } from '../flows.dto';
|
|
3
3
|
export declare const _PlatformFlowSpecUpsertDto: z.ZodObject<{
|
|
4
4
|
filter: z.ZodObject<{
|
|
5
|
-
cohorts: z.ZodArray<z.ZodObject<{
|
|
5
|
+
cohorts: z.ZodArray<z.ZodOptional<z.ZodObject<{
|
|
6
6
|
id: z.ZodString;
|
|
7
7
|
kind: z.ZodEnum<["ORGANIZATION", "DEPARTMENT", "USER", "RISK_CONTRIBUTOR"]>;
|
|
8
8
|
displayValue: z.ZodString;
|
|
@@ -20,25 +20,25 @@ export declare const _PlatformFlowSpecUpsertDto: z.ZodObject<{
|
|
|
20
20
|
id: string;
|
|
21
21
|
displayValue: string;
|
|
22
22
|
kind: "USER" | "ORGANIZATION" | "DEPARTMENT" | "RISK_CONTRIBUTOR";
|
|
23
|
-
}
|
|
23
|
+
}>>, "many">;
|
|
24
24
|
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
25
25
|
}, "strip", z.ZodTypeAny, {
|
|
26
|
-
cohorts: {
|
|
26
|
+
cohorts: ({
|
|
27
27
|
inclusive: boolean;
|
|
28
28
|
value: string;
|
|
29
29
|
id: string;
|
|
30
30
|
displayValue: string;
|
|
31
31
|
kind: "USER" | "ORGANIZATION" | "DEPARTMENT" | "RISK_CONTRIBUTOR";
|
|
32
|
-
}[];
|
|
32
|
+
} | undefined)[];
|
|
33
33
|
custom?: Record<string, unknown> | undefined;
|
|
34
34
|
}, {
|
|
35
|
-
cohorts: {
|
|
35
|
+
cohorts: ({
|
|
36
36
|
inclusive: boolean;
|
|
37
37
|
value: string;
|
|
38
38
|
id: string;
|
|
39
39
|
displayValue: string;
|
|
40
40
|
kind: "USER" | "ORGANIZATION" | "DEPARTMENT" | "RISK_CONTRIBUTOR";
|
|
41
|
-
}[];
|
|
41
|
+
} | undefined)[];
|
|
42
42
|
custom?: Record<string, unknown> | undefined;
|
|
43
43
|
}>;
|
|
44
44
|
name: z.ZodString;
|
|
@@ -83,11 +83,11 @@ export declare const _PlatformFlowSpecUpsertDto: z.ZodObject<{
|
|
|
83
83
|
}>;
|
|
84
84
|
engagementChannelCids: z.ZodArray<z.ZodString, "many">;
|
|
85
85
|
tone: z.ZodOptional<z.ZodObject<{
|
|
86
|
-
kind: z.ZodString
|
|
86
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
87
87
|
}, "strip", z.ZodTypeAny, {
|
|
88
|
-
kind
|
|
88
|
+
kind?: string | undefined;
|
|
89
89
|
}, {
|
|
90
|
-
kind
|
|
90
|
+
kind?: string | undefined;
|
|
91
91
|
}>>;
|
|
92
92
|
targetResolution: z.ZodOptional<z.ZodObject<{
|
|
93
93
|
minutes: z.ZodNumber;
|
|
@@ -154,14 +154,14 @@ export declare const _PlatformFlowSpecUpsertDto: z.ZodObject<{
|
|
|
154
154
|
units?: string | undefined;
|
|
155
155
|
}>, "many">>;
|
|
156
156
|
customMessage: z.ZodOptional<z.ZodObject<{
|
|
157
|
-
template: z.ZodString
|
|
158
|
-
append: z.ZodBoolean
|
|
157
|
+
template: z.ZodOptional<z.ZodString>;
|
|
158
|
+
append: z.ZodOptional<z.ZodBoolean>;
|
|
159
159
|
}, "strip", z.ZodTypeAny, {
|
|
160
|
-
template
|
|
161
|
-
append
|
|
160
|
+
template?: string | undefined;
|
|
161
|
+
append?: boolean | undefined;
|
|
162
162
|
}, {
|
|
163
|
-
template
|
|
164
|
-
append
|
|
163
|
+
template?: string | undefined;
|
|
164
|
+
append?: boolean | undefined;
|
|
165
165
|
}>>;
|
|
166
166
|
scheduleConfig: z.ZodOptional<z.ZodObject<{
|
|
167
167
|
required: z.ZodBoolean;
|
|
@@ -176,13 +176,13 @@ export declare const _PlatformFlowSpecUpsertDto: z.ZodObject<{
|
|
|
176
176
|
deletedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
177
177
|
}, "strip", z.ZodTypeAny, {
|
|
178
178
|
filter: {
|
|
179
|
-
cohorts: {
|
|
179
|
+
cohorts: ({
|
|
180
180
|
inclusive: boolean;
|
|
181
181
|
value: string;
|
|
182
182
|
id: string;
|
|
183
183
|
displayValue: string;
|
|
184
184
|
kind: "USER" | "ORGANIZATION" | "DEPARTMENT" | "RISK_CONTRIBUTOR";
|
|
185
|
-
}[];
|
|
185
|
+
} | undefined)[];
|
|
186
186
|
custom?: Record<string, unknown> | undefined;
|
|
187
187
|
};
|
|
188
188
|
name: string;
|
|
@@ -201,7 +201,7 @@ export declare const _PlatformFlowSpecUpsertDto: z.ZodObject<{
|
|
|
201
201
|
};
|
|
202
202
|
engagementChannelCids: string[];
|
|
203
203
|
tone?: {
|
|
204
|
-
kind
|
|
204
|
+
kind?: string | undefined;
|
|
205
205
|
} | undefined;
|
|
206
206
|
targetResolution?: {
|
|
207
207
|
minutes: number;
|
|
@@ -228,8 +228,8 @@ export declare const _PlatformFlowSpecUpsertDto: z.ZodObject<{
|
|
|
228
228
|
units?: string | undefined;
|
|
229
229
|
}[] | undefined;
|
|
230
230
|
customMessage?: {
|
|
231
|
-
template
|
|
232
|
-
append
|
|
231
|
+
template?: string | undefined;
|
|
232
|
+
append?: boolean | undefined;
|
|
233
233
|
} | undefined;
|
|
234
234
|
scheduleConfig?: {
|
|
235
235
|
required: boolean;
|
|
@@ -240,13 +240,13 @@ export declare const _PlatformFlowSpecUpsertDto: z.ZodObject<{
|
|
|
240
240
|
deletedAt?: string | null | undefined;
|
|
241
241
|
}, {
|
|
242
242
|
filter: {
|
|
243
|
-
cohorts: {
|
|
243
|
+
cohorts: ({
|
|
244
244
|
inclusive: boolean;
|
|
245
245
|
value: string;
|
|
246
246
|
id: string;
|
|
247
247
|
displayValue: string;
|
|
248
248
|
kind: "USER" | "ORGANIZATION" | "DEPARTMENT" | "RISK_CONTRIBUTOR";
|
|
249
|
-
}[];
|
|
249
|
+
} | undefined)[];
|
|
250
250
|
custom?: Record<string, unknown> | undefined;
|
|
251
251
|
};
|
|
252
252
|
name: string;
|
|
@@ -265,7 +265,7 @@ export declare const _PlatformFlowSpecUpsertDto: z.ZodObject<{
|
|
|
265
265
|
engagementChannelCids: string[];
|
|
266
266
|
fslStrategy?: "STANDARD" | undefined;
|
|
267
267
|
tone?: {
|
|
268
|
-
kind
|
|
268
|
+
kind?: string | undefined;
|
|
269
269
|
} | undefined;
|
|
270
270
|
targetResolution?: {
|
|
271
271
|
minutes: number;
|
|
@@ -292,8 +292,8 @@ export declare const _PlatformFlowSpecUpsertDto: z.ZodObject<{
|
|
|
292
292
|
units?: string | undefined;
|
|
293
293
|
}[] | undefined;
|
|
294
294
|
customMessage?: {
|
|
295
|
-
template
|
|
296
|
-
append
|
|
295
|
+
template?: string | undefined;
|
|
296
|
+
append?: boolean | undefined;
|
|
297
297
|
} | undefined;
|
|
298
298
|
scheduleConfig?: {
|
|
299
299
|
required: boolean;
|
|
@@ -350,7 +350,7 @@ export declare const _PlatformFlowSpecDto: z.ZodObject<{
|
|
|
350
350
|
custom?: Record<string, unknown> | undefined;
|
|
351
351
|
}>;
|
|
352
352
|
filter: z.ZodObject<{
|
|
353
|
-
cohorts: z.ZodArray<z.ZodObject<{
|
|
353
|
+
cohorts: z.ZodArray<z.ZodOptional<z.ZodObject<{
|
|
354
354
|
id: z.ZodString;
|
|
355
355
|
kind: z.ZodEnum<["ORGANIZATION", "DEPARTMENT", "USER", "RISK_CONTRIBUTOR"]>;
|
|
356
356
|
displayValue: z.ZodString;
|
|
@@ -368,34 +368,34 @@ export declare const _PlatformFlowSpecDto: z.ZodObject<{
|
|
|
368
368
|
id: string;
|
|
369
369
|
displayValue: string;
|
|
370
370
|
kind: "USER" | "ORGANIZATION" | "DEPARTMENT" | "RISK_CONTRIBUTOR";
|
|
371
|
-
}
|
|
371
|
+
}>>, "many">;
|
|
372
372
|
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
373
373
|
}, "strip", z.ZodTypeAny, {
|
|
374
|
-
cohorts: {
|
|
374
|
+
cohorts: ({
|
|
375
375
|
inclusive: boolean;
|
|
376
376
|
value: string;
|
|
377
377
|
id: string;
|
|
378
378
|
displayValue: string;
|
|
379
379
|
kind: "USER" | "ORGANIZATION" | "DEPARTMENT" | "RISK_CONTRIBUTOR";
|
|
380
|
-
}[];
|
|
380
|
+
} | undefined)[];
|
|
381
381
|
custom?: Record<string, unknown> | undefined;
|
|
382
382
|
}, {
|
|
383
|
-
cohorts: {
|
|
383
|
+
cohorts: ({
|
|
384
384
|
inclusive: boolean;
|
|
385
385
|
value: string;
|
|
386
386
|
id: string;
|
|
387
387
|
displayValue: string;
|
|
388
388
|
kind: "USER" | "ORGANIZATION" | "DEPARTMENT" | "RISK_CONTRIBUTOR";
|
|
389
|
-
}[];
|
|
389
|
+
} | undefined)[];
|
|
390
390
|
custom?: Record<string, unknown> | undefined;
|
|
391
391
|
}>;
|
|
392
392
|
engagementChannelCids: z.ZodArray<z.ZodString, "many">;
|
|
393
393
|
tone: z.ZodOptional<z.ZodObject<{
|
|
394
|
-
kind: z.ZodString
|
|
394
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
395
395
|
}, "strip", z.ZodTypeAny, {
|
|
396
|
-
kind
|
|
396
|
+
kind?: string | undefined;
|
|
397
397
|
}, {
|
|
398
|
-
kind
|
|
398
|
+
kind?: string | undefined;
|
|
399
399
|
}>>;
|
|
400
400
|
targetResolution: z.ZodOptional<z.ZodObject<{
|
|
401
401
|
minutes: z.ZodNumber;
|
|
@@ -462,14 +462,14 @@ export declare const _PlatformFlowSpecDto: z.ZodObject<{
|
|
|
462
462
|
units?: string | undefined;
|
|
463
463
|
}>, "many">>;
|
|
464
464
|
customMessage: z.ZodOptional<z.ZodObject<{
|
|
465
|
-
template: z.ZodString
|
|
466
|
-
append: z.ZodBoolean
|
|
465
|
+
template: z.ZodOptional<z.ZodString>;
|
|
466
|
+
append: z.ZodOptional<z.ZodBoolean>;
|
|
467
467
|
}, "strip", z.ZodTypeAny, {
|
|
468
|
-
template
|
|
469
|
-
append
|
|
468
|
+
template?: string | undefined;
|
|
469
|
+
append?: boolean | undefined;
|
|
470
470
|
}, {
|
|
471
|
-
template
|
|
472
|
-
append
|
|
471
|
+
template?: string | undefined;
|
|
472
|
+
append?: boolean | undefined;
|
|
473
473
|
}>>;
|
|
474
474
|
scheduleConfig: z.ZodOptional<z.ZodObject<{
|
|
475
475
|
required: z.ZodBoolean;
|
|
@@ -493,13 +493,13 @@ export declare const _PlatformFlowSpecDto: z.ZodObject<{
|
|
|
493
493
|
}>>;
|
|
494
494
|
}, "strip", z.ZodTypeAny, {
|
|
495
495
|
filter: {
|
|
496
|
-
cohorts: {
|
|
496
|
+
cohorts: ({
|
|
497
497
|
inclusive: boolean;
|
|
498
498
|
value: string;
|
|
499
499
|
id: string;
|
|
500
500
|
displayValue: string;
|
|
501
501
|
kind: "USER" | "ORGANIZATION" | "DEPARTMENT" | "RISK_CONTRIBUTOR";
|
|
502
|
-
}[];
|
|
502
|
+
} | undefined)[];
|
|
503
503
|
custom?: Record<string, unknown> | undefined;
|
|
504
504
|
};
|
|
505
505
|
name: string;
|
|
@@ -522,7 +522,7 @@ export declare const _PlatformFlowSpecDto: z.ZodObject<{
|
|
|
522
522
|
};
|
|
523
523
|
engagementChannelCids: string[];
|
|
524
524
|
tone?: {
|
|
525
|
-
kind
|
|
525
|
+
kind?: string | undefined;
|
|
526
526
|
} | undefined;
|
|
527
527
|
targetResolution?: {
|
|
528
528
|
minutes: number;
|
|
@@ -549,8 +549,8 @@ export declare const _PlatformFlowSpecDto: z.ZodObject<{
|
|
|
549
549
|
units?: string | undefined;
|
|
550
550
|
}[] | undefined;
|
|
551
551
|
customMessage?: {
|
|
552
|
-
template
|
|
553
|
-
append
|
|
552
|
+
template?: string | undefined;
|
|
553
|
+
append?: boolean | undefined;
|
|
554
554
|
} | undefined;
|
|
555
555
|
scheduleConfig?: {
|
|
556
556
|
required: boolean;
|
|
@@ -562,13 +562,13 @@ export declare const _PlatformFlowSpecDto: z.ZodObject<{
|
|
|
562
562
|
} | undefined;
|
|
563
563
|
}, {
|
|
564
564
|
filter: {
|
|
565
|
-
cohorts: {
|
|
565
|
+
cohorts: ({
|
|
566
566
|
inclusive: boolean;
|
|
567
567
|
value: string;
|
|
568
568
|
id: string;
|
|
569
569
|
displayValue: string;
|
|
570
570
|
kind: "USER" | "ORGANIZATION" | "DEPARTMENT" | "RISK_CONTRIBUTOR";
|
|
571
|
-
}[];
|
|
571
|
+
} | undefined)[];
|
|
572
572
|
custom?: Record<string, unknown> | undefined;
|
|
573
573
|
};
|
|
574
574
|
name: string;
|
|
@@ -591,7 +591,7 @@ export declare const _PlatformFlowSpecDto: z.ZodObject<{
|
|
|
591
591
|
engagementChannelCids: string[];
|
|
592
592
|
fslStrategy?: "STANDARD" | undefined;
|
|
593
593
|
tone?: {
|
|
594
|
-
kind
|
|
594
|
+
kind?: string | undefined;
|
|
595
595
|
} | undefined;
|
|
596
596
|
targetResolution?: {
|
|
597
597
|
minutes: number;
|
|
@@ -618,8 +618,8 @@ export declare const _PlatformFlowSpecDto: z.ZodObject<{
|
|
|
618
618
|
units?: string | undefined;
|
|
619
619
|
}[] | undefined;
|
|
620
620
|
customMessage?: {
|
|
621
|
-
template
|
|
622
|
-
append
|
|
621
|
+
template?: string | undefined;
|
|
622
|
+
append?: boolean | undefined;
|
|
623
623
|
} | undefined;
|
|
624
624
|
scheduleConfig?: {
|
|
625
625
|
required: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PlatformAgentDto, PlatformAgentUpsertDto, PlatformConnectorDto, PlatformConnectorUpsertDto, PlatformFindingDto, PlatformFindingUpsertDto, PlatformNotificationDto, PlatformNotificationUpsertDto, PlatformProviderUpsertDto, PlatformReportResultDto, PlatformReportResultUpsertDto, PlatformRiskContributorDto, PlatformRiskContributorUpsertDto, PlatformSaasComponentDto, PlatformSaasComponentUpsertDto, PlatformStagedSaasAssetDto, PlatformStagedSaasAssetUpsertDto, PlatformStagedSaasUserDto, PlatformStagedSaasUserUpsertDto, ProviderDto, TenantDto, TenantUpsertDto } from '../dto';
|
|
2
|
-
import { AmpEntityService, AmpSdkAssetService, AmpSdkTenantService, AmpSdkUserService } from './entity.service';
|
|
2
|
+
import { AmpEntityService, AmpSdkAssetService, AmpSdkTenantService, AmpSdkUserService, TruncatableAmpEntityService } from './entity.service';
|
|
3
3
|
import { AmpRestClientOptions, RestClient } from './rest';
|
|
4
4
|
import { PlatformJobSpecDto, PlatformJobSpecUpsertDto } from '../dto/platform/platform.jobSpec.dto';
|
|
5
5
|
import { PlatformJobExecutionStateDto, PlatformJobExecutionStateUpsertDto } from '../dto/platform/platform.jobExecutionState.dto';
|
|
@@ -38,9 +38,9 @@ export declare class AmpSdkServices {
|
|
|
38
38
|
readonly saasAssets: AmpSdkSaasAssetService;
|
|
39
39
|
readonly saasComponents: AmpSdkSaasComponentService;
|
|
40
40
|
readonly saasUsers: AmpSdkSaasUserService;
|
|
41
|
-
readonly stagedSaasAssets:
|
|
42
|
-
readonly stagedSaaSComponents:
|
|
43
|
-
readonly stagedSaaSUsers:
|
|
41
|
+
readonly stagedSaasAssets: TruncatableAmpEntityService<PlatformStagedSaasAssetUpsertDto, PlatformStagedSaasAssetDto>;
|
|
42
|
+
readonly stagedSaaSComponents: TruncatableAmpEntityService<PlatformSaasComponentUpsertDto, PlatformSaasComponentDto>;
|
|
43
|
+
readonly stagedSaaSUsers: TruncatableAmpEntityService<PlatformStagedSaasUserUpsertDto, PlatformStagedSaasUserDto>;
|
|
44
44
|
readonly settings: AmpSdkSettingsService;
|
|
45
45
|
readonly tenants: AmpSdkTenantService<TenantUpsertDto, TenantDto>;
|
|
46
46
|
readonly users: AmpSdkUserService;
|
|
@@ -38,9 +38,9 @@ class AmpSdkServices {
|
|
|
38
38
|
this.saasAssets = new saasEntity_service_1.AmpSdkSaasAssetService(rest, constants_1.TARGET_API_PLATFORM);
|
|
39
39
|
this.saasComponents = new saasEntity_service_1.AmpSdkSaasComponentService(rest, constants_1.TARGET_API_PLATFORM);
|
|
40
40
|
this.saasUsers = new saasEntity_service_1.AmpSdkSaasUserService(rest, constants_1.TARGET_API_PLATFORM);
|
|
41
|
-
this.stagedSaasAssets = new entity_service_1.
|
|
42
|
-
this.stagedSaaSComponents = new entity_service_1.
|
|
43
|
-
this.stagedSaaSUsers = new entity_service_1.
|
|
41
|
+
this.stagedSaasAssets = new entity_service_1.TruncatableAmpEntityServiceImpl(rest, constants_1.KIND.STAGED_SAAS_ASSETS, constants_1.TARGET_API_PLATFORM);
|
|
42
|
+
this.stagedSaaSComponents = new entity_service_1.TruncatableAmpEntityServiceImpl(rest, constants_1.KIND.STAGED_SAAS_COMPONENTS, constants_1.TARGET_API_PLATFORM);
|
|
43
|
+
this.stagedSaaSUsers = new entity_service_1.TruncatableAmpEntityServiceImpl(rest, constants_1.KIND.STAGED_SAAS_USERS, constants_1.TARGET_API_PLATFORM);
|
|
44
44
|
this.settings = new settings_service_1.AmpSdkSettingsService(rest);
|
|
45
45
|
this.tenants = new entity_service_1.AmpEntityServiceImpl(rest, constants_1.KIND.TENANTS, constants_1.TARGET_API_PLATFORM);
|
|
46
46
|
this.users = new entity_service_1.AmpSdkUserService(rest, constants_1.TARGET_API_PLATFORM);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmpSdk.js","sourceRoot":"","sources":["../../../src/services/AmpSdk.ts"],"names":[],"mappings":";;;AA4BA,
|
|
1
|
+
{"version":3,"file":"AmpSdk.js","sourceRoot":"","sources":["../../../src/services/AmpSdk.ts"],"names":[],"mappings":";;;AA4BA,qDAQ0B;AAC1B,iCAA0E;AAC1E,2CAAsD;AAGtD,oDAAmE;AACnE,yDAAyD;AACzD,6DAA+J;AAC/J,6DAAuD;AACvD,yEAAmE;AAKnE;;;;;;;;GAQG;AACH,MAAa,cAAc;IA0BzB,YAAY,IAAgB;QAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,qCAAoB,CAA2C,IAAI,EAAE,gBAAI,CAAC,MAAM,EAAE,+BAAmB,CAAC,CAAC;QACzH,IAAI,CAAC,KAAK,GAAG,IAAI,mCAAkB,CAAC,IAAI,EAAE,+BAAmB,CAAC,CAAC;QAC/D,IAAI,CAAC,UAAU,GAAG,IAAI,qCAAoB,CAAmD,IAAI,EAAE,gBAAI,CAAC,UAAU,EAAE,+BAAmB,CAAC,CAAC;QACzI,IAAI,CAAC,UAAU,GAAG,IAAI,sCAAiB,EAAE,CAAC;QAC1C,IAAI,CAAC,KAAK,GAAG,IAAI,gCAAkB,CAAC,IAAI,EAAE,+BAAmB,CAAC,CAAC;QAC/D,IAAI,CAAC,QAAQ,GAAG,IAAI,6CAAwB,CAA+C,IAAI,EAAE,gBAAI,CAAC,QAAQ,EAAE,+BAAmB,CAAC,CAAC;QACrI,IAAI,CAAC,gBAAgB,GAAG,IAAI,kDAAuB,CAAC,IAAI,EAAE,gBAAI,CAAC,iBAAiB,EAAE,+BAAmB,CAAC,CAAC;QACvG,IAAI,CAAC,SAAS,GAAG,IAAI,6CAAwB,CAAiD,IAAI,EAAE,gBAAI,CAAC,UAAU,EAAE,+BAAmB,CAAC,CAAC;QAC1I,IAAI,CAAC,UAAU,GAAG,IAAI,6CAAwB,CAAmD,IAAI,EAAE,gBAAI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AAiD,IAAI,EAAE,gBAAI,CAAC,iBAAiB,EAAE,+BAAmB,CAAC,CAAC;QAE9J,IAAI,CAAC,QAAQ,GAAG,IAAI,wCAAqB,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,CAAC,OAAO,GAAG,IAAI,qCAAoB,CAA6B,IAAI,EAAE,gBAAI,CAAC,OAAO,EAAE,+BAAmB,CAAC,CAAC;QAC7G,IAAI,CAAC,KAAK,GAAG,IAAI,kCAAiB,CAAC,IAAI,EAAE,+BAAmB,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,OAAsB;QACpC,MAAM,IAAI,GAAG,IAAA,uBAAgB,EAAC,OAAO,CAAC,CAAC;QACvC,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACF;AA9DD,wCA8DC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseDto, BaseUpsertDto, ExtKeyMap, Page, PlatformAssetDto, PlatformAssetUpsertDto, PlatformUserDto, PlatformUserUpsertDto } from '../dto';
|
|
1
|
+
import { BaseDto, BaseUpsertDto, ExtKeyMap, Message, Page, PlatformAssetDto, PlatformAssetUpsertDto, PlatformUserDto, PlatformUserUpsertDto } from '../dto';
|
|
2
2
|
import { TargetApi } from './constants';
|
|
3
3
|
import { AmpDataService, AmpDataServiceImpl } from './data.service';
|
|
4
4
|
import { RestClient } from './rest';
|
|
@@ -11,6 +11,9 @@ export interface AmpEntityService<WriteT extends BaseUpsertDto, ReadT extends Ba
|
|
|
11
11
|
update(_model: WriteT | WriteT[], _options?: EntityCallOptions): Promise<Page<ReadT>>;
|
|
12
12
|
delete(_id: string, _options?: EntityCallOptions): Promise<Page<ReadT>>;
|
|
13
13
|
}
|
|
14
|
+
export interface TruncatableAmpEntityService<WriteT extends BaseUpsertDto, ReadT extends BaseDto> extends AmpEntityService<WriteT, ReadT> {
|
|
15
|
+
truncate(tid: string): Promise<Message>;
|
|
16
|
+
}
|
|
14
17
|
export interface AmpSdkTenantService<WriteT extends BaseUpsertDto, ReadT extends BaseDto> extends AmpDataService<ReadT> {
|
|
15
18
|
create(_model: WriteT | WriteT[], _options?: EntityCallOptions): Promise<Page<ReadT>>;
|
|
16
19
|
update(_model: WriteT | WriteT[], _options?: EntityCallOptions): Promise<Page<ReadT>>;
|
|
@@ -31,6 +34,9 @@ export declare class AmpEntityServiceImpl<WriteT extends BaseUpsertDto, ReadT ex
|
|
|
31
34
|
update: (model: WriteT | WriteT[], options?: EntityCallOptions) => Promise<Page<ReadT>>;
|
|
32
35
|
delete: (id: string, options?: EntityCallOptions) => Promise<Page<ReadT>>;
|
|
33
36
|
}
|
|
37
|
+
export declare class TruncatableAmpEntityServiceImpl<WriteT extends BaseUpsertDto, ReadT extends BaseDto> extends AmpEntityServiceImpl<WriteT, ReadT> implements TruncatableAmpEntityService<WriteT, ReadT> {
|
|
38
|
+
truncate: (tid: string) => Promise<Message>;
|
|
39
|
+
}
|
|
34
40
|
export declare class AmpGlobalEntityServiceImpl<WriteT extends BaseUpsertDto, ReadT extends BaseDto> extends AmpEntityServiceImpl<WriteT, ReadT> implements AmpGlobalEntityService<WriteT, ReadT> {
|
|
35
41
|
constructor(rest: RestClient, kind: string, targetApi?: TargetApi);
|
|
36
42
|
/** @deprecated */
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.AmpSdkAssetService = exports.AmpSdkUserService = exports.AmpPatchUserServiceImpl = exports.AmpGlobalEntityServiceImpl = exports.AmpEntityServiceImpl = void 0;
|
|
6
|
+
exports.AmpSdkAssetService = exports.AmpSdkUserService = exports.AmpPatchUserServiceImpl = exports.AmpGlobalEntityServiceImpl = exports.TruncatableAmpEntityServiceImpl = exports.AmpEntityServiceImpl = void 0;
|
|
7
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
8
|
const constants_1 = require("./constants");
|
|
9
9
|
const data_service_1 = require("./data.service");
|
|
@@ -52,6 +52,34 @@ class AmpEntityServiceImpl extends data_service_1.AmpDataServiceImpl {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
exports.AmpEntityServiceImpl = AmpEntityServiceImpl;
|
|
55
|
+
class TruncatableAmpEntityServiceImpl extends AmpEntityServiceImpl {
|
|
56
|
+
constructor() {
|
|
57
|
+
super(...arguments);
|
|
58
|
+
this.truncate = async (tid) => {
|
|
59
|
+
if (!tid) {
|
|
60
|
+
throw new Error('Tenant id is required');
|
|
61
|
+
}
|
|
62
|
+
const req = {
|
|
63
|
+
url: `/${this.targetApi}/v1/${this.kind}/truncate`,
|
|
64
|
+
method: 'DELETE',
|
|
65
|
+
params: { tid },
|
|
66
|
+
};
|
|
67
|
+
const { error } = await this.call(req, (error) => {
|
|
68
|
+
if (error instanceof Error) {
|
|
69
|
+
console.error(error.message);
|
|
70
|
+
}
|
|
71
|
+
return { success: false, error };
|
|
72
|
+
});
|
|
73
|
+
if (error) {
|
|
74
|
+
throw new Error(`Failed to truncate ${this.kind} for tenant id="${tid}"`);
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
message: `Truncated ${this.kind} for tenant id="${tid}"`,
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.TruncatableAmpEntityServiceImpl = TruncatableAmpEntityServiceImpl;
|
|
55
83
|
const extIdMapErrorHandler = (error) => {
|
|
56
84
|
if (error instanceof Error) {
|
|
57
85
|
console.error(error.message);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.service.js","sourceRoot":"","sources":["../../../src/services/entity.service.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AAEvB,2CAA4E;AAC5E,iDAAkE;AAGlE,qDAAuE;AAEvE,MAAM,mBAAmB,GAAG,EAAE,C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AA8C,CAAC,CAAC;gBAClF,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;gBAC1C,MAAM,GAAG,CAAC,MAAA,IAAI,CAAC,KAAK,CAAC,MAAM,mCAAI,MAAM,CAAC,GAAG,KAAK,CAAC;gBAC/C,OAAO,GAAG,MAAA,IAAI,CAAC,KAAK,CAAC,OAAO,mCAAI,KAAK,CAAC;YACxC,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;IAhCF,CAAC;CAiCF;AApCD,gDAoCC"}
|
package/package.json
CHANGED
package/src/dto/flows.dto.ts
CHANGED
|
@@ -110,18 +110,20 @@ const _FlowTriggerFilter = z.object({
|
|
|
110
110
|
export type FlowTriggerFilter = z.infer<typeof _FlowTriggerFilter>;
|
|
111
111
|
const _FlowFilter = z.object({
|
|
112
112
|
cohorts: z.array(
|
|
113
|
-
z
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
113
|
+
z
|
|
114
|
+
.object({
|
|
115
|
+
id: z.string(),
|
|
116
|
+
kind: z.enum(['ORGANIZATION', 'DEPARTMENT', 'USER', 'RISK_CONTRIBUTOR']),
|
|
117
|
+
displayValue: z.string(),
|
|
118
|
+
value: z.string(),
|
|
119
|
+
inclusive: z.boolean(),
|
|
120
|
+
})
|
|
121
|
+
.optional()
|
|
120
122
|
),
|
|
121
123
|
custom: z.record(z.unknown()).optional(),
|
|
122
124
|
});
|
|
123
125
|
const _FlowTone = z.object({
|
|
124
|
-
kind: z.string(),
|
|
126
|
+
kind: z.string().optional(),
|
|
125
127
|
});
|
|
126
128
|
export const _FlowInterval = z.object({
|
|
127
129
|
minutes: z.number(),
|
|
@@ -165,7 +167,7 @@ export const _FlowSpecDto = _BaseDto.merge(
|
|
|
165
167
|
reminderInterval: _FlowInterval.optional(),
|
|
166
168
|
actions: _FlowActions.optional(),
|
|
167
169
|
rewards: z.array(_FlowRewardsConfig).optional(),
|
|
168
|
-
customMessage: z.object({template: z.string(), append: z.boolean()}).optional(),
|
|
170
|
+
customMessage: z.object({template: z.string().optional(), append: z.boolean().optional()}).optional(),
|
|
169
171
|
scheduleConfig: z.object({required: z.boolean()}).optional(),
|
|
170
172
|
activity: z
|
|
171
173
|
.object({
|
package/src/services/AmpSdk.ts
CHANGED
|
@@ -26,7 +26,15 @@ import {
|
|
|
26
26
|
TenantDto,
|
|
27
27
|
TenantUpsertDto,
|
|
28
28
|
} from '../dto';
|
|
29
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
AmpEntityService,
|
|
31
|
+
AmpEntityServiceImpl,
|
|
32
|
+
AmpSdkAssetService,
|
|
33
|
+
AmpSdkTenantService,
|
|
34
|
+
AmpSdkUserService,
|
|
35
|
+
TruncatableAmpEntityService,
|
|
36
|
+
TruncatableAmpEntityServiceImpl,
|
|
37
|
+
} from './entity.service';
|
|
30
38
|
import {AmpRestClientOptions, RestClient, getAmpRestClient} from './rest';
|
|
31
39
|
import {KIND, TARGET_API_PLATFORM} from './constants';
|
|
32
40
|
import {PlatformJobSpecDto, PlatformJobSpecUpsertDto} from '../dto/platform/platform.jobSpec.dto';
|
|
@@ -68,9 +76,9 @@ export class AmpSdkServices {
|
|
|
68
76
|
readonly saasAssets: AmpSdkSaasAssetService;
|
|
69
77
|
readonly saasComponents: AmpSdkSaasComponentService;
|
|
70
78
|
readonly saasUsers: AmpSdkSaasUserService;
|
|
71
|
-
readonly stagedSaasAssets:
|
|
72
|
-
readonly stagedSaaSComponents:
|
|
73
|
-
readonly stagedSaaSUsers:
|
|
79
|
+
readonly stagedSaasAssets: TruncatableAmpEntityService<PlatformStagedSaasAssetUpsertDto, PlatformStagedSaasAssetDto>;
|
|
80
|
+
readonly stagedSaaSComponents: TruncatableAmpEntityService<PlatformSaasComponentUpsertDto, PlatformSaasComponentDto>;
|
|
81
|
+
readonly stagedSaaSUsers: TruncatableAmpEntityService<PlatformStagedSaasUserUpsertDto, PlatformStagedSaasUserDto>;
|
|
74
82
|
readonly settings: AmpSdkSettingsService;
|
|
75
83
|
readonly tenants: AmpSdkTenantService<TenantUpsertDto, TenantDto>;
|
|
76
84
|
readonly users: AmpSdkUserService;
|
|
@@ -94,9 +102,13 @@ export class AmpSdkServices {
|
|
|
94
102
|
this.saasAssets = new AmpSdkSaasAssetService(rest, TARGET_API_PLATFORM);
|
|
95
103
|
this.saasComponents = new AmpSdkSaasComponentService(rest, TARGET_API_PLATFORM);
|
|
96
104
|
this.saasUsers = new AmpSdkSaasUserService(rest, TARGET_API_PLATFORM);
|
|
97
|
-
this.stagedSaasAssets = new
|
|
98
|
-
this.stagedSaaSComponents = new
|
|
99
|
-
|
|
105
|
+
this.stagedSaasAssets = new TruncatableAmpEntityServiceImpl<PlatformSaasAssetUpsertDto, PlatformSaasAssetDto>(rest, KIND.STAGED_SAAS_ASSETS, TARGET_API_PLATFORM);
|
|
106
|
+
this.stagedSaaSComponents = new TruncatableAmpEntityServiceImpl<PlatformSaasComponentUpsertDto, PlatformSaasComponentDto>(
|
|
107
|
+
rest,
|
|
108
|
+
KIND.STAGED_SAAS_COMPONENTS,
|
|
109
|
+
TARGET_API_PLATFORM
|
|
110
|
+
);
|
|
111
|
+
this.stagedSaaSUsers = new TruncatableAmpEntityServiceImpl<PlatformSaasUserUpsertDto, PlatformSaasUserDto>(rest, KIND.STAGED_SAAS_USERS, TARGET_API_PLATFORM);
|
|
100
112
|
|
|
101
113
|
this.settings = new AmpSdkSettingsService(rest);
|
|
102
114
|
this.tenants = new AmpEntityServiceImpl<TenantUpsertDto, TenantDto>(rest, KIND.TENANTS, TARGET_API_PLATFORM);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
|
-
import {AssetIdDto, BaseDto, BaseUpsertDto, ExtKeyMap, Page, PlatformAssetDto, PlatformAssetUpsertDto, PlatformUserDto, PlatformUserUpsertDto, UserIdDto} from '../dto';
|
|
2
|
+
import {AssetIdDto, BaseDto, BaseUpsertDto, ExtKeyMap, Message, Page, PlatformAssetDto, PlatformAssetUpsertDto, PlatformUserDto, PlatformUserUpsertDto, UserIdDto} from '../dto';
|
|
3
3
|
import {TargetApi, TARGET_API_AGENT, ErrorHandler, KIND} from './constants';
|
|
4
4
|
import {AmpDataService, AmpDataServiceImpl} from './data.service';
|
|
5
5
|
import {RestClient, RestRequest} from './rest';
|
|
@@ -18,6 +18,10 @@ export interface AmpEntityService<WriteT extends BaseUpsertDto, ReadT extends Ba
|
|
|
18
18
|
delete(_id: string, _options?: EntityCallOptions): Promise<Page<ReadT>>;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
export interface TruncatableAmpEntityService<WriteT extends BaseUpsertDto, ReadT extends BaseDto> extends AmpEntityService<WriteT, ReadT> {
|
|
22
|
+
truncate(tid: string): Promise<Message>;
|
|
23
|
+
}
|
|
24
|
+
|
|
21
25
|
export interface AmpSdkTenantService<WriteT extends BaseUpsertDto, ReadT extends BaseDto> extends AmpDataService<ReadT> {
|
|
22
26
|
create(_model: WriteT | WriteT[], _options?: EntityCallOptions): Promise<Page<ReadT>>;
|
|
23
27
|
update(_model: WriteT | WriteT[], _options?: EntityCallOptions): Promise<Page<ReadT>>;
|
|
@@ -81,6 +85,34 @@ export class AmpEntityServiceImpl<WriteT extends BaseUpsertDto, ReadT extends Ba
|
|
|
81
85
|
};
|
|
82
86
|
}
|
|
83
87
|
|
|
88
|
+
export class TruncatableAmpEntityServiceImpl<WriteT extends BaseUpsertDto, ReadT extends BaseDto>
|
|
89
|
+
extends AmpEntityServiceImpl<WriteT, ReadT>
|
|
90
|
+
implements TruncatableAmpEntityService<WriteT, ReadT>
|
|
91
|
+
{
|
|
92
|
+
truncate = async (tid: string): Promise<Message> => {
|
|
93
|
+
if (!tid) {
|
|
94
|
+
throw new Error('Tenant id is required');
|
|
95
|
+
}
|
|
96
|
+
const req: RestRequest = {
|
|
97
|
+
url: `/${this.targetApi}/v1/${this.kind}/truncate`,
|
|
98
|
+
method: 'DELETE',
|
|
99
|
+
params: {tid},
|
|
100
|
+
};
|
|
101
|
+
const {error} = await this.call(req, (error: unknown) => {
|
|
102
|
+
if (error instanceof Error) {
|
|
103
|
+
console.error(error.message);
|
|
104
|
+
}
|
|
105
|
+
return {success: false, error};
|
|
106
|
+
});
|
|
107
|
+
if (error) {
|
|
108
|
+
throw new Error(`Failed to truncate ${this.kind} for tenant id="${tid}"`);
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
message: `Truncated ${this.kind} for tenant id="${tid}"`,
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
84
116
|
const extIdMapErrorHandler: ErrorHandler<ExtKeyMap> = (error: unknown) => {
|
|
85
117
|
if (error instanceof Error) {
|
|
86
118
|
console.error(error.message);
|