@trigger.dev/sdk 2.0.0-next.1 → 2.0.0-next.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/LICENSE +201 -25
- package/dist/index.d.ts +309 -133
- package/dist/index.js +229 -85
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { z } from 'zod';
|
|
|
4
4
|
type LogLevel = "log" | "error" | "warn" | "info" | "debug";
|
|
5
5
|
declare class Logger {
|
|
6
6
|
#private;
|
|
7
|
-
constructor(name: string, level?: LogLevel, filteredKeys?: string[]);
|
|
7
|
+
constructor(name: string, level?: LogLevel, filteredKeys?: string[], jsonReplacer?: (key: string, value: unknown) => unknown);
|
|
8
8
|
filter(...keys: string[]): Logger;
|
|
9
9
|
log(...args: any[]): void;
|
|
10
10
|
error(...args: any[]): void;
|
|
@@ -67,6 +67,7 @@ declare const ServerTaskSchema: z.ZodObject<z.extendShape<{
|
|
|
67
67
|
variant?: string | undefined;
|
|
68
68
|
style: "normal" | "minimal";
|
|
69
69
|
}>>>;
|
|
70
|
+
operation: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
70
71
|
}, {
|
|
71
72
|
idempotencyKey: z.ZodString;
|
|
72
73
|
attempts: z.ZodNumber;
|
|
@@ -89,6 +90,7 @@ declare const ServerTaskSchema: z.ZodObject<z.extendShape<{
|
|
|
89
90
|
variant?: string | undefined;
|
|
90
91
|
style: "normal" | "minimal";
|
|
91
92
|
} | null | undefined;
|
|
93
|
+
operation?: string | null | undefined;
|
|
92
94
|
id: string;
|
|
93
95
|
name: string;
|
|
94
96
|
noop: boolean;
|
|
@@ -114,6 +116,7 @@ declare const ServerTaskSchema: z.ZodObject<z.extendShape<{
|
|
|
114
116
|
variant?: string | undefined;
|
|
115
117
|
style: "normal" | "minimal";
|
|
116
118
|
} | null | undefined;
|
|
119
|
+
operation?: string | null | undefined;
|
|
117
120
|
id: string;
|
|
118
121
|
name: string;
|
|
119
122
|
noop: boolean;
|
|
@@ -537,32 +540,35 @@ declare const JobMetadataSchema: z.ZodObject<{
|
|
|
537
540
|
integrations: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
538
541
|
id: z.ZodString;
|
|
539
542
|
metadata: z.ZodObject<{
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
+
id: z.ZodString;
|
|
544
|
+
name: z.ZodString;
|
|
545
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
543
546
|
}, "strip", z.ZodTypeAny, {
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
+
instructions?: string | undefined;
|
|
548
|
+
id: string;
|
|
549
|
+
name: string;
|
|
547
550
|
}, {
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
+
instructions?: string | undefined;
|
|
552
|
+
id: string;
|
|
553
|
+
name: string;
|
|
551
554
|
}>;
|
|
555
|
+
authSource: z.ZodEnum<["HOSTED", "LOCAL"]>;
|
|
552
556
|
}, "strip", z.ZodTypeAny, {
|
|
553
557
|
id: string;
|
|
554
558
|
metadata: {
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
559
|
+
instructions?: string | undefined;
|
|
560
|
+
id: string;
|
|
561
|
+
name: string;
|
|
558
562
|
};
|
|
563
|
+
authSource: "HOSTED" | "LOCAL";
|
|
559
564
|
}, {
|
|
560
565
|
id: string;
|
|
561
566
|
metadata: {
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
567
|
+
instructions?: string | undefined;
|
|
568
|
+
id: string;
|
|
569
|
+
name: string;
|
|
565
570
|
};
|
|
571
|
+
authSource: "HOSTED" | "LOCAL";
|
|
566
572
|
}>>;
|
|
567
573
|
internal: z.ZodDefault<z.ZodBoolean>;
|
|
568
574
|
queue: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
@@ -641,10 +647,11 @@ declare const JobMetadataSchema: z.ZodObject<{
|
|
|
641
647
|
integrations: Record<string, {
|
|
642
648
|
id: string;
|
|
643
649
|
metadata: {
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
650
|
+
instructions?: string | undefined;
|
|
651
|
+
id: string;
|
|
652
|
+
name: string;
|
|
647
653
|
};
|
|
654
|
+
authSource: "HOSTED" | "LOCAL";
|
|
648
655
|
}>;
|
|
649
656
|
internal: boolean;
|
|
650
657
|
startPosition: "initial" | "latest";
|
|
@@ -714,10 +721,11 @@ declare const JobMetadataSchema: z.ZodObject<{
|
|
|
714
721
|
integrations: Record<string, {
|
|
715
722
|
id: string;
|
|
716
723
|
metadata: {
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
724
|
+
instructions?: string | undefined;
|
|
725
|
+
id: string;
|
|
726
|
+
name: string;
|
|
720
727
|
};
|
|
728
|
+
authSource: "HOSTED" | "LOCAL";
|
|
721
729
|
}>;
|
|
722
730
|
startPosition: "initial" | "latest";
|
|
723
731
|
enabled: boolean;
|
|
@@ -992,32 +1000,35 @@ declare const CreateRunBodySchema: z.ZodObject<{
|
|
|
992
1000
|
integrations: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
993
1001
|
id: z.ZodString;
|
|
994
1002
|
metadata: z.ZodObject<{
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
1003
|
+
id: z.ZodString;
|
|
1004
|
+
name: z.ZodString;
|
|
1005
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
998
1006
|
}, "strip", z.ZodTypeAny, {
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1007
|
+
instructions?: string | undefined;
|
|
1008
|
+
id: string;
|
|
1009
|
+
name: string;
|
|
1002
1010
|
}, {
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1011
|
+
instructions?: string | undefined;
|
|
1012
|
+
id: string;
|
|
1013
|
+
name: string;
|
|
1006
1014
|
}>;
|
|
1015
|
+
authSource: z.ZodEnum<["HOSTED", "LOCAL"]>;
|
|
1007
1016
|
}, "strip", z.ZodTypeAny, {
|
|
1008
1017
|
id: string;
|
|
1009
1018
|
metadata: {
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1019
|
+
instructions?: string | undefined;
|
|
1020
|
+
id: string;
|
|
1021
|
+
name: string;
|
|
1013
1022
|
};
|
|
1023
|
+
authSource: "HOSTED" | "LOCAL";
|
|
1014
1024
|
}, {
|
|
1015
1025
|
id: string;
|
|
1016
1026
|
metadata: {
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1027
|
+
instructions?: string | undefined;
|
|
1028
|
+
id: string;
|
|
1029
|
+
name: string;
|
|
1020
1030
|
};
|
|
1031
|
+
authSource: "HOSTED" | "LOCAL";
|
|
1021
1032
|
}>>;
|
|
1022
1033
|
internal: z.ZodDefault<z.ZodBoolean>;
|
|
1023
1034
|
queue: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
@@ -1096,10 +1107,11 @@ declare const CreateRunBodySchema: z.ZodObject<{
|
|
|
1096
1107
|
integrations: Record<string, {
|
|
1097
1108
|
id: string;
|
|
1098
1109
|
metadata: {
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1110
|
+
instructions?: string | undefined;
|
|
1111
|
+
id: string;
|
|
1112
|
+
name: string;
|
|
1102
1113
|
};
|
|
1114
|
+
authSource: "HOSTED" | "LOCAL";
|
|
1103
1115
|
}>;
|
|
1104
1116
|
internal: boolean;
|
|
1105
1117
|
startPosition: "initial" | "latest";
|
|
@@ -1169,10 +1181,11 @@ declare const CreateRunBodySchema: z.ZodObject<{
|
|
|
1169
1181
|
integrations: Record<string, {
|
|
1170
1182
|
id: string;
|
|
1171
1183
|
metadata: {
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1184
|
+
instructions?: string | undefined;
|
|
1185
|
+
id: string;
|
|
1186
|
+
name: string;
|
|
1175
1187
|
};
|
|
1188
|
+
authSource: "HOSTED" | "LOCAL";
|
|
1176
1189
|
}>;
|
|
1177
1190
|
startPosition: "initial" | "latest";
|
|
1178
1191
|
enabled: boolean;
|
|
@@ -1294,10 +1307,11 @@ declare const CreateRunBodySchema: z.ZodObject<{
|
|
|
1294
1307
|
integrations: Record<string, {
|
|
1295
1308
|
id: string;
|
|
1296
1309
|
metadata: {
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1310
|
+
instructions?: string | undefined;
|
|
1311
|
+
id: string;
|
|
1312
|
+
name: string;
|
|
1300
1313
|
};
|
|
1314
|
+
authSource: "HOSTED" | "LOCAL";
|
|
1301
1315
|
}>;
|
|
1302
1316
|
internal: boolean;
|
|
1303
1317
|
startPosition: "initial" | "latest";
|
|
@@ -1384,10 +1398,11 @@ declare const CreateRunBodySchema: z.ZodObject<{
|
|
|
1384
1398
|
integrations: Record<string, {
|
|
1385
1399
|
id: string;
|
|
1386
1400
|
metadata: {
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1401
|
+
instructions?: string | undefined;
|
|
1402
|
+
id: string;
|
|
1403
|
+
name: string;
|
|
1390
1404
|
};
|
|
1405
|
+
authSource: "HOSTED" | "LOCAL";
|
|
1391
1406
|
}>;
|
|
1392
1407
|
startPosition: "initial" | "latest";
|
|
1393
1408
|
enabled: boolean;
|
|
@@ -1396,26 +1411,27 @@ declare const CreateRunBodySchema: z.ZodObject<{
|
|
|
1396
1411
|
client: string;
|
|
1397
1412
|
}>;
|
|
1398
1413
|
type CreateRunBody = z.infer<typeof CreateRunBodySchema>;
|
|
1399
|
-
declare const
|
|
1400
|
-
|
|
1414
|
+
declare const RedactStringSchema: z.ZodObject<{
|
|
1415
|
+
__redactedString: z.ZodLiteral<true>;
|
|
1401
1416
|
strings: z.ZodArray<z.ZodString, "many">;
|
|
1402
1417
|
interpolations: z.ZodArray<z.ZodString, "many">;
|
|
1403
1418
|
}, "strip", z.ZodTypeAny, {
|
|
1404
|
-
|
|
1419
|
+
__redactedString: true;
|
|
1405
1420
|
strings: string[];
|
|
1406
1421
|
interpolations: string[];
|
|
1407
1422
|
}, {
|
|
1408
|
-
|
|
1423
|
+
__redactedString: true;
|
|
1409
1424
|
strings: string[];
|
|
1410
1425
|
interpolations: string[];
|
|
1411
1426
|
}>;
|
|
1412
|
-
type
|
|
1427
|
+
type RedactString = z.infer<typeof RedactStringSchema>;
|
|
1413
1428
|
type CachedTask = z.infer<typeof CachedTaskSchema>;
|
|
1414
1429
|
declare const RunTaskOptionsSchema: z.ZodObject<{
|
|
1415
1430
|
name: z.ZodString;
|
|
1416
1431
|
icon: z.ZodOptional<z.ZodString>;
|
|
1417
1432
|
displayKey: z.ZodOptional<z.ZodString>;
|
|
1418
1433
|
noop: z.ZodDefault<z.ZodBoolean>;
|
|
1434
|
+
operation: z.ZodOptional<z.ZodEnum<["fetch"]>>;
|
|
1419
1435
|
delayUntil: z.ZodOptional<z.ZodDate>;
|
|
1420
1436
|
description: z.ZodOptional<z.ZodString>;
|
|
1421
1437
|
properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -1431,7 +1447,7 @@ declare const RunTaskOptionsSchema: z.ZodObject<{
|
|
|
1431
1447
|
label: string;
|
|
1432
1448
|
text: string;
|
|
1433
1449
|
}>, "many">>;
|
|
1434
|
-
params: z.
|
|
1450
|
+
params: z.ZodAny;
|
|
1435
1451
|
trigger: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
1436
1452
|
type: z.ZodLiteral<"dynamic">;
|
|
1437
1453
|
id: z.ZodString;
|
|
@@ -1620,7 +1636,7 @@ declare const RunTaskOptionsSchema: z.ZodObject<{
|
|
|
1620
1636
|
icon?: string | undefined;
|
|
1621
1637
|
delayUntil?: Date | undefined;
|
|
1622
1638
|
description?: string | undefined;
|
|
1623
|
-
params?:
|
|
1639
|
+
params?: any;
|
|
1624
1640
|
properties?: {
|
|
1625
1641
|
url?: string | undefined;
|
|
1626
1642
|
label: string;
|
|
@@ -1630,6 +1646,7 @@ declare const RunTaskOptionsSchema: z.ZodObject<{
|
|
|
1630
1646
|
variant?: string | undefined;
|
|
1631
1647
|
style: "normal" | "minimal";
|
|
1632
1648
|
} | undefined;
|
|
1649
|
+
operation?: "fetch" | undefined;
|
|
1633
1650
|
trigger?: {
|
|
1634
1651
|
id: string;
|
|
1635
1652
|
type: "dynamic";
|
|
@@ -1682,7 +1699,7 @@ declare const RunTaskOptionsSchema: z.ZodObject<{
|
|
|
1682
1699
|
noop?: boolean | undefined;
|
|
1683
1700
|
delayUntil?: Date | undefined;
|
|
1684
1701
|
description?: string | undefined;
|
|
1685
|
-
params?:
|
|
1702
|
+
params?: any;
|
|
1686
1703
|
properties?: {
|
|
1687
1704
|
url?: string | undefined;
|
|
1688
1705
|
label: string;
|
|
@@ -1692,6 +1709,7 @@ declare const RunTaskOptionsSchema: z.ZodObject<{
|
|
|
1692
1709
|
variant?: string | undefined;
|
|
1693
1710
|
style: "normal" | "minimal";
|
|
1694
1711
|
} | undefined;
|
|
1712
|
+
operation?: "fetch" | undefined;
|
|
1695
1713
|
trigger?: {
|
|
1696
1714
|
id: string;
|
|
1697
1715
|
type: "dynamic";
|
|
@@ -1745,6 +1763,7 @@ declare const RunTaskBodyInputSchema: z.ZodObject<z.extendShape<{
|
|
|
1745
1763
|
icon: z.ZodOptional<z.ZodString>;
|
|
1746
1764
|
displayKey: z.ZodOptional<z.ZodString>;
|
|
1747
1765
|
noop: z.ZodDefault<z.ZodBoolean>;
|
|
1766
|
+
operation: z.ZodOptional<z.ZodEnum<["fetch"]>>;
|
|
1748
1767
|
delayUntil: z.ZodOptional<z.ZodDate>;
|
|
1749
1768
|
description: z.ZodOptional<z.ZodString>;
|
|
1750
1769
|
properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -1760,7 +1779,7 @@ declare const RunTaskBodyInputSchema: z.ZodObject<z.extendShape<{
|
|
|
1760
1779
|
label: string;
|
|
1761
1780
|
text: string;
|
|
1762
1781
|
}>, "many">>;
|
|
1763
|
-
params: z.
|
|
1782
|
+
params: z.ZodAny;
|
|
1764
1783
|
trigger: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
1765
1784
|
type: z.ZodLiteral<"dynamic">;
|
|
1766
1785
|
id: z.ZodString;
|
|
@@ -1952,7 +1971,7 @@ declare const RunTaskBodyInputSchema: z.ZodObject<z.extendShape<{
|
|
|
1952
1971
|
icon?: string | undefined;
|
|
1953
1972
|
delayUntil?: Date | undefined;
|
|
1954
1973
|
description?: string | undefined;
|
|
1955
|
-
params?:
|
|
1974
|
+
params?: any;
|
|
1956
1975
|
properties?: {
|
|
1957
1976
|
url?: string | undefined;
|
|
1958
1977
|
label: string;
|
|
@@ -1963,6 +1982,7 @@ declare const RunTaskBodyInputSchema: z.ZodObject<z.extendShape<{
|
|
|
1963
1982
|
variant?: string | undefined;
|
|
1964
1983
|
style: "normal" | "minimal";
|
|
1965
1984
|
} | undefined;
|
|
1985
|
+
operation?: "fetch" | undefined;
|
|
1966
1986
|
trigger?: {
|
|
1967
1987
|
id: string;
|
|
1968
1988
|
type: "dynamic";
|
|
@@ -2016,7 +2036,7 @@ declare const RunTaskBodyInputSchema: z.ZodObject<z.extendShape<{
|
|
|
2016
2036
|
noop?: boolean | undefined;
|
|
2017
2037
|
delayUntil?: Date | undefined;
|
|
2018
2038
|
description?: string | undefined;
|
|
2019
|
-
params?:
|
|
2039
|
+
params?: any;
|
|
2020
2040
|
properties?: {
|
|
2021
2041
|
url?: string | undefined;
|
|
2022
2042
|
label: string;
|
|
@@ -2027,6 +2047,7 @@ declare const RunTaskBodyInputSchema: z.ZodObject<z.extendShape<{
|
|
|
2027
2047
|
variant?: string | undefined;
|
|
2028
2048
|
style: "normal" | "minimal";
|
|
2029
2049
|
} | undefined;
|
|
2050
|
+
operation?: "fetch" | undefined;
|
|
2030
2051
|
trigger?: {
|
|
2031
2052
|
id: string;
|
|
2032
2053
|
type: "dynamic";
|
|
@@ -2081,6 +2102,7 @@ declare const CompleteTaskBodyInputSchema: z.ZodObject<z.extendShape<Pick<z.exte
|
|
|
2081
2102
|
icon: z.ZodOptional<z.ZodString>;
|
|
2082
2103
|
displayKey: z.ZodOptional<z.ZodString>;
|
|
2083
2104
|
noop: z.ZodDefault<z.ZodBoolean>;
|
|
2105
|
+
operation: z.ZodOptional<z.ZodEnum<["fetch"]>>;
|
|
2084
2106
|
delayUntil: z.ZodOptional<z.ZodDate>;
|
|
2085
2107
|
description: z.ZodOptional<z.ZodString>;
|
|
2086
2108
|
properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -2096,7 +2118,7 @@ declare const CompleteTaskBodyInputSchema: z.ZodObject<z.extendShape<Pick<z.exte
|
|
|
2096
2118
|
label: string;
|
|
2097
2119
|
text: string;
|
|
2098
2120
|
}>, "many">>;
|
|
2099
|
-
params: z.
|
|
2121
|
+
params: z.ZodAny;
|
|
2100
2122
|
trigger: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
2101
2123
|
type: z.ZodLiteral<"dynamic">;
|
|
2102
2124
|
id: z.ZodString;
|
|
@@ -2290,7 +2312,7 @@ declare const CompleteTaskBodyInputSchema: z.ZodObject<z.extendShape<Pick<z.exte
|
|
|
2290
2312
|
} | DeserializedJson[] | null, SerializableJson>;
|
|
2291
2313
|
}>, "strip", z.ZodTypeAny, {
|
|
2292
2314
|
description?: string | undefined;
|
|
2293
|
-
params?:
|
|
2315
|
+
params?: any;
|
|
2294
2316
|
properties?: {
|
|
2295
2317
|
url?: string | undefined;
|
|
2296
2318
|
label: string;
|
|
@@ -2301,7 +2323,7 @@ declare const CompleteTaskBodyInputSchema: z.ZodObject<z.extendShape<Pick<z.exte
|
|
|
2301
2323
|
} | DeserializedJson[] | null;
|
|
2302
2324
|
}, {
|
|
2303
2325
|
description?: string | undefined;
|
|
2304
|
-
params?:
|
|
2326
|
+
params?: any;
|
|
2305
2327
|
properties?: {
|
|
2306
2328
|
url?: string | undefined;
|
|
2307
2329
|
label: string;
|
|
@@ -2391,30 +2413,86 @@ declare const RegisterTriggerBodySchema: z.ZodObject<{
|
|
|
2391
2413
|
}>;
|
|
2392
2414
|
source: z.ZodObject<{
|
|
2393
2415
|
channel: z.ZodEnum<["HTTP", "SQS", "SMTP"]>;
|
|
2416
|
+
integration: z.ZodObject<{
|
|
2417
|
+
id: z.ZodString;
|
|
2418
|
+
metadata: z.ZodObject<{
|
|
2419
|
+
id: z.ZodString;
|
|
2420
|
+
name: z.ZodString;
|
|
2421
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
2422
|
+
}, "strip", z.ZodTypeAny, {
|
|
2423
|
+
instructions?: string | undefined;
|
|
2424
|
+
id: string;
|
|
2425
|
+
name: string;
|
|
2426
|
+
}, {
|
|
2427
|
+
instructions?: string | undefined;
|
|
2428
|
+
id: string;
|
|
2429
|
+
name: string;
|
|
2430
|
+
}>;
|
|
2431
|
+
authSource: z.ZodEnum<["HOSTED", "LOCAL"]>;
|
|
2432
|
+
}, "strip", z.ZodTypeAny, {
|
|
2433
|
+
id: string;
|
|
2434
|
+
metadata: {
|
|
2435
|
+
instructions?: string | undefined;
|
|
2436
|
+
id: string;
|
|
2437
|
+
name: string;
|
|
2438
|
+
};
|
|
2439
|
+
authSource: "HOSTED" | "LOCAL";
|
|
2440
|
+
}, {
|
|
2441
|
+
id: string;
|
|
2442
|
+
metadata: {
|
|
2443
|
+
instructions?: string | undefined;
|
|
2444
|
+
id: string;
|
|
2445
|
+
name: string;
|
|
2446
|
+
};
|
|
2447
|
+
authSource: "HOSTED" | "LOCAL";
|
|
2448
|
+
}>;
|
|
2394
2449
|
key: z.ZodString;
|
|
2395
2450
|
params: z.ZodAny;
|
|
2396
2451
|
events: z.ZodArray<z.ZodString, "many">;
|
|
2397
|
-
clientId: z.ZodOptional<z.ZodString>;
|
|
2398
2452
|
}, "strip", z.ZodTypeAny, {
|
|
2399
2453
|
params?: any;
|
|
2400
|
-
clientId?: string | undefined;
|
|
2401
2454
|
key: string;
|
|
2402
2455
|
channel: "HTTP" | "SMTP" | "SQS";
|
|
2403
2456
|
events: string[];
|
|
2457
|
+
integration: {
|
|
2458
|
+
id: string;
|
|
2459
|
+
metadata: {
|
|
2460
|
+
instructions?: string | undefined;
|
|
2461
|
+
id: string;
|
|
2462
|
+
name: string;
|
|
2463
|
+
};
|
|
2464
|
+
authSource: "HOSTED" | "LOCAL";
|
|
2465
|
+
};
|
|
2404
2466
|
}, {
|
|
2405
2467
|
params?: any;
|
|
2406
|
-
clientId?: string | undefined;
|
|
2407
2468
|
key: string;
|
|
2408
2469
|
channel: "HTTP" | "SMTP" | "SQS";
|
|
2409
2470
|
events: string[];
|
|
2471
|
+
integration: {
|
|
2472
|
+
id: string;
|
|
2473
|
+
metadata: {
|
|
2474
|
+
instructions?: string | undefined;
|
|
2475
|
+
id: string;
|
|
2476
|
+
name: string;
|
|
2477
|
+
};
|
|
2478
|
+
authSource: "HOSTED" | "LOCAL";
|
|
2479
|
+
};
|
|
2410
2480
|
}>;
|
|
2411
2481
|
}, "strip", z.ZodTypeAny, {
|
|
2412
2482
|
source: {
|
|
2413
2483
|
params?: any;
|
|
2414
|
-
clientId?: string | undefined;
|
|
2415
2484
|
key: string;
|
|
2416
2485
|
channel: "HTTP" | "SMTP" | "SQS";
|
|
2417
2486
|
events: string[];
|
|
2487
|
+
integration: {
|
|
2488
|
+
id: string;
|
|
2489
|
+
metadata: {
|
|
2490
|
+
instructions?: string | undefined;
|
|
2491
|
+
id: string;
|
|
2492
|
+
name: string;
|
|
2493
|
+
};
|
|
2494
|
+
authSource: "HOSTED" | "LOCAL";
|
|
2495
|
+
};
|
|
2418
2496
|
};
|
|
2419
2497
|
rule: {
|
|
2420
2498
|
payload?: EventFilter | undefined;
|
|
@@ -2425,10 +2503,18 @@ declare const RegisterTriggerBodySchema: z.ZodObject<{
|
|
|
2425
2503
|
}, {
|
|
2426
2504
|
source: {
|
|
2427
2505
|
params?: any;
|
|
2428
|
-
clientId?: string | undefined;
|
|
2429
2506
|
key: string;
|
|
2430
2507
|
channel: "HTTP" | "SMTP" | "SQS";
|
|
2431
2508
|
events: string[];
|
|
2509
|
+
integration: {
|
|
2510
|
+
id: string;
|
|
2511
|
+
metadata: {
|
|
2512
|
+
instructions?: string | undefined;
|
|
2513
|
+
id: string;
|
|
2514
|
+
name: string;
|
|
2515
|
+
};
|
|
2516
|
+
authSource: "HOSTED" | "LOCAL";
|
|
2517
|
+
};
|
|
2432
2518
|
};
|
|
2433
2519
|
rule: {
|
|
2434
2520
|
payload?: EventFilter | undefined;
|
|
@@ -2636,48 +2722,51 @@ declare const ConnectionAuthSchema: z.ZodObject<{
|
|
|
2636
2722
|
}>;
|
|
2637
2723
|
type ConnectionAuth = z.infer<typeof ConnectionAuthSchema>;
|
|
2638
2724
|
declare const IntegrationMetadataSchema: z.ZodObject<{
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2725
|
+
id: z.ZodString;
|
|
2726
|
+
name: z.ZodString;
|
|
2727
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
2642
2728
|
}, "strip", z.ZodTypeAny, {
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2729
|
+
instructions?: string | undefined;
|
|
2730
|
+
id: string;
|
|
2731
|
+
name: string;
|
|
2646
2732
|
}, {
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2733
|
+
instructions?: string | undefined;
|
|
2734
|
+
id: string;
|
|
2735
|
+
name: string;
|
|
2650
2736
|
}>;
|
|
2651
2737
|
type IntegrationMetadata = z.infer<typeof IntegrationMetadataSchema>;
|
|
2652
2738
|
declare const IntegrationConfigSchema: z.ZodObject<{
|
|
2653
2739
|
id: z.ZodString;
|
|
2654
2740
|
metadata: z.ZodObject<{
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2741
|
+
id: z.ZodString;
|
|
2742
|
+
name: z.ZodString;
|
|
2743
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
2658
2744
|
}, "strip", z.ZodTypeAny, {
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2745
|
+
instructions?: string | undefined;
|
|
2746
|
+
id: string;
|
|
2747
|
+
name: string;
|
|
2662
2748
|
}, {
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2749
|
+
instructions?: string | undefined;
|
|
2750
|
+
id: string;
|
|
2751
|
+
name: string;
|
|
2666
2752
|
}>;
|
|
2753
|
+
authSource: z.ZodEnum<["HOSTED", "LOCAL"]>;
|
|
2667
2754
|
}, "strip", z.ZodTypeAny, {
|
|
2668
2755
|
id: string;
|
|
2669
2756
|
metadata: {
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2757
|
+
instructions?: string | undefined;
|
|
2758
|
+
id: string;
|
|
2759
|
+
name: string;
|
|
2673
2760
|
};
|
|
2761
|
+
authSource: "HOSTED" | "LOCAL";
|
|
2674
2762
|
}, {
|
|
2675
2763
|
id: string;
|
|
2676
2764
|
metadata: {
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2765
|
+
instructions?: string | undefined;
|
|
2766
|
+
id: string;
|
|
2767
|
+
name: string;
|
|
2680
2768
|
};
|
|
2769
|
+
authSource: "HOSTED" | "LOCAL";
|
|
2681
2770
|
}>;
|
|
2682
2771
|
type IntegrationConfig = z.infer<typeof IntegrationConfigSchema>;
|
|
2683
2772
|
|
|
@@ -2763,24 +2852,18 @@ declare const MissingConnectionNotificationPayloadSchema: z.ZodDiscriminatedUnio
|
|
|
2763
2852
|
scopes: z.ZodArray<z.ZodString, "many">;
|
|
2764
2853
|
createdAt: z.ZodDate;
|
|
2765
2854
|
updatedAt: z.ZodDate;
|
|
2766
|
-
integrationIdentifier: z.ZodString;
|
|
2767
|
-
integrationAuthMethod: z.ZodString;
|
|
2768
2855
|
}, "strip", z.ZodTypeAny, {
|
|
2769
2856
|
id: string;
|
|
2770
2857
|
scopes: string[];
|
|
2771
2858
|
title: string;
|
|
2772
2859
|
createdAt: Date;
|
|
2773
2860
|
updatedAt: Date;
|
|
2774
|
-
integrationIdentifier: string;
|
|
2775
|
-
integrationAuthMethod: string;
|
|
2776
2861
|
}, {
|
|
2777
2862
|
id: string;
|
|
2778
2863
|
scopes: string[];
|
|
2779
2864
|
title: string;
|
|
2780
2865
|
createdAt: Date;
|
|
2781
2866
|
updatedAt: Date;
|
|
2782
|
-
integrationIdentifier: string;
|
|
2783
|
-
integrationAuthMethod: string;
|
|
2784
2867
|
}>;
|
|
2785
2868
|
authorizationUrl: z.ZodString;
|
|
2786
2869
|
}, {
|
|
@@ -2794,8 +2877,6 @@ declare const MissingConnectionNotificationPayloadSchema: z.ZodDiscriminatedUnio
|
|
|
2794
2877
|
title: string;
|
|
2795
2878
|
createdAt: Date;
|
|
2796
2879
|
updatedAt: Date;
|
|
2797
|
-
integrationIdentifier: string;
|
|
2798
|
-
integrationAuthMethod: string;
|
|
2799
2880
|
};
|
|
2800
2881
|
authorizationUrl: string;
|
|
2801
2882
|
}, {
|
|
@@ -2807,8 +2888,6 @@ declare const MissingConnectionNotificationPayloadSchema: z.ZodDiscriminatedUnio
|
|
|
2807
2888
|
title: string;
|
|
2808
2889
|
createdAt: Date;
|
|
2809
2890
|
updatedAt: Date;
|
|
2810
|
-
integrationIdentifier: string;
|
|
2811
|
-
integrationAuthMethod: string;
|
|
2812
2891
|
};
|
|
2813
2892
|
authorizationUrl: string;
|
|
2814
2893
|
}>, z.ZodObject<z.extendShape<{
|
|
@@ -2819,24 +2898,18 @@ declare const MissingConnectionNotificationPayloadSchema: z.ZodDiscriminatedUnio
|
|
|
2819
2898
|
scopes: z.ZodArray<z.ZodString, "many">;
|
|
2820
2899
|
createdAt: z.ZodDate;
|
|
2821
2900
|
updatedAt: z.ZodDate;
|
|
2822
|
-
integrationIdentifier: z.ZodString;
|
|
2823
|
-
integrationAuthMethod: z.ZodString;
|
|
2824
2901
|
}, "strip", z.ZodTypeAny, {
|
|
2825
2902
|
id: string;
|
|
2826
2903
|
scopes: string[];
|
|
2827
2904
|
title: string;
|
|
2828
2905
|
createdAt: Date;
|
|
2829
2906
|
updatedAt: Date;
|
|
2830
|
-
integrationIdentifier: string;
|
|
2831
|
-
integrationAuthMethod: string;
|
|
2832
2907
|
}, {
|
|
2833
2908
|
id: string;
|
|
2834
2909
|
scopes: string[];
|
|
2835
2910
|
title: string;
|
|
2836
2911
|
createdAt: Date;
|
|
2837
2912
|
updatedAt: Date;
|
|
2838
|
-
integrationIdentifier: string;
|
|
2839
|
-
integrationAuthMethod: string;
|
|
2840
2913
|
}>;
|
|
2841
2914
|
authorizationUrl: z.ZodString;
|
|
2842
2915
|
}, {
|
|
@@ -2864,8 +2937,6 @@ declare const MissingConnectionNotificationPayloadSchema: z.ZodDiscriminatedUnio
|
|
|
2864
2937
|
title: string;
|
|
2865
2938
|
createdAt: Date;
|
|
2866
2939
|
updatedAt: Date;
|
|
2867
|
-
integrationIdentifier: string;
|
|
2868
|
-
integrationAuthMethod: string;
|
|
2869
2940
|
};
|
|
2870
2941
|
authorizationUrl: string;
|
|
2871
2942
|
}, {
|
|
@@ -2881,8 +2952,6 @@ declare const MissingConnectionNotificationPayloadSchema: z.ZodDiscriminatedUnio
|
|
|
2881
2952
|
title: string;
|
|
2882
2953
|
createdAt: Date;
|
|
2883
2954
|
updatedAt: Date;
|
|
2884
|
-
integrationIdentifier: string;
|
|
2885
|
-
integrationAuthMethod: string;
|
|
2886
2955
|
};
|
|
2887
2956
|
authorizationUrl: string;
|
|
2888
2957
|
}>]>;
|
|
@@ -3020,6 +3089,80 @@ declare const MissingConnectionResolvedNotificationPayloadSchema: z.ZodDiscrimin
|
|
|
3020
3089
|
}>]>;
|
|
3021
3090
|
type MissingConnectionResolvedNotificationPayload = z.infer<typeof MissingConnectionResolvedNotificationPayloadSchema>;
|
|
3022
3091
|
|
|
3092
|
+
declare const FetchRequestInitSchema: z.ZodObject<{
|
|
3093
|
+
method: z.ZodOptional<z.ZodString>;
|
|
3094
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
3095
|
+
__redactedString: z.ZodLiteral<true>;
|
|
3096
|
+
strings: z.ZodArray<z.ZodString, "many">;
|
|
3097
|
+
interpolations: z.ZodArray<z.ZodString, "many">;
|
|
3098
|
+
}, "strip", z.ZodTypeAny, {
|
|
3099
|
+
__redactedString: true;
|
|
3100
|
+
strings: string[];
|
|
3101
|
+
interpolations: string[];
|
|
3102
|
+
}, {
|
|
3103
|
+
__redactedString: true;
|
|
3104
|
+
strings: string[];
|
|
3105
|
+
interpolations: string[];
|
|
3106
|
+
}>]>>>;
|
|
3107
|
+
body: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>]>>;
|
|
3108
|
+
}, "strip", z.ZodTypeAny, {
|
|
3109
|
+
method?: string | undefined;
|
|
3110
|
+
headers?: Record<string, string | {
|
|
3111
|
+
__redactedString: true;
|
|
3112
|
+
strings: string[];
|
|
3113
|
+
interpolations: string[];
|
|
3114
|
+
}> | undefined;
|
|
3115
|
+
body?: string | ArrayBuffer | undefined;
|
|
3116
|
+
}, {
|
|
3117
|
+
method?: string | undefined;
|
|
3118
|
+
headers?: Record<string, string | {
|
|
3119
|
+
__redactedString: true;
|
|
3120
|
+
strings: string[];
|
|
3121
|
+
interpolations: string[];
|
|
3122
|
+
}> | undefined;
|
|
3123
|
+
body?: string | ArrayBuffer | undefined;
|
|
3124
|
+
}>;
|
|
3125
|
+
type FetchRequestInit = z.infer<typeof FetchRequestInitSchema>;
|
|
3126
|
+
declare const FetchRetryOptionsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"strategy", [z.ZodObject<{
|
|
3127
|
+
strategy: z.ZodLiteral<"headers">;
|
|
3128
|
+
limitHeader: z.ZodString;
|
|
3129
|
+
remainingHeader: z.ZodString;
|
|
3130
|
+
resetHeader: z.ZodString;
|
|
3131
|
+
}, "strip", z.ZodTypeAny, {
|
|
3132
|
+
strategy: "headers";
|
|
3133
|
+
limitHeader: string;
|
|
3134
|
+
remainingHeader: string;
|
|
3135
|
+
resetHeader: string;
|
|
3136
|
+
}, {
|
|
3137
|
+
strategy: "headers";
|
|
3138
|
+
limitHeader: string;
|
|
3139
|
+
remainingHeader: string;
|
|
3140
|
+
resetHeader: string;
|
|
3141
|
+
}>, z.ZodObject<z.extendShape<{
|
|
3142
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
3143
|
+
factor: z.ZodOptional<z.ZodNumber>;
|
|
3144
|
+
minTimeoutInMs: z.ZodOptional<z.ZodNumber>;
|
|
3145
|
+
maxTimeoutInMs: z.ZodOptional<z.ZodNumber>;
|
|
3146
|
+
randomize: z.ZodOptional<z.ZodBoolean>;
|
|
3147
|
+
}, {
|
|
3148
|
+
strategy: z.ZodLiteral<"backoff">;
|
|
3149
|
+
}>, "strip", z.ZodTypeAny, {
|
|
3150
|
+
limit?: number | undefined;
|
|
3151
|
+
factor?: number | undefined;
|
|
3152
|
+
minTimeoutInMs?: number | undefined;
|
|
3153
|
+
maxTimeoutInMs?: number | undefined;
|
|
3154
|
+
randomize?: boolean | undefined;
|
|
3155
|
+
strategy: "backoff";
|
|
3156
|
+
}, {
|
|
3157
|
+
limit?: number | undefined;
|
|
3158
|
+
factor?: number | undefined;
|
|
3159
|
+
minTimeoutInMs?: number | undefined;
|
|
3160
|
+
maxTimeoutInMs?: number | undefined;
|
|
3161
|
+
randomize?: boolean | undefined;
|
|
3162
|
+
strategy: "backoff";
|
|
3163
|
+
}>]>>;
|
|
3164
|
+
type FetchRetryOptions = z.infer<typeof FetchRetryOptionsSchema>;
|
|
3165
|
+
|
|
3023
3166
|
type ApiClientOptions = {
|
|
3024
3167
|
apiKey?: string;
|
|
3025
3168
|
apiUrl?: string;
|
|
@@ -3065,6 +3208,7 @@ declare class ApiClient {
|
|
|
3065
3208
|
variant?: string | undefined;
|
|
3066
3209
|
style: "normal" | "minimal";
|
|
3067
3210
|
} | null | undefined;
|
|
3211
|
+
operation?: string | null | undefined;
|
|
3068
3212
|
id: string;
|
|
3069
3213
|
name: string;
|
|
3070
3214
|
noop: boolean;
|
|
@@ -3091,6 +3235,7 @@ declare class ApiClient {
|
|
|
3091
3235
|
variant?: string | undefined;
|
|
3092
3236
|
style: "normal" | "minimal";
|
|
3093
3237
|
} | null | undefined;
|
|
3238
|
+
operation?: string | null | undefined;
|
|
3094
3239
|
id: string;
|
|
3095
3240
|
name: string;
|
|
3096
3241
|
noop: boolean;
|
|
@@ -3117,6 +3262,7 @@ declare class ApiClient {
|
|
|
3117
3262
|
variant?: string | undefined;
|
|
3118
3263
|
style: "normal" | "minimal";
|
|
3119
3264
|
} | null | undefined;
|
|
3265
|
+
operation?: string | null | undefined;
|
|
3120
3266
|
id: string;
|
|
3121
3267
|
name: string;
|
|
3122
3268
|
noop: boolean;
|
|
@@ -3194,6 +3340,10 @@ interface TriggerContext {
|
|
|
3194
3340
|
id: string;
|
|
3195
3341
|
metadata?: any;
|
|
3196
3342
|
};
|
|
3343
|
+
source?: {
|
|
3344
|
+
id: string;
|
|
3345
|
+
metadata?: any;
|
|
3346
|
+
};
|
|
3197
3347
|
}
|
|
3198
3348
|
interface TriggerPreprocessContext {
|
|
3199
3349
|
job: {
|
|
@@ -3242,6 +3392,12 @@ interface Trigger<TEventSpec extends EventSpecification<any>> {
|
|
|
3242
3392
|
attachToJob(triggerClient: TriggerClient, job: Job<Trigger<TEventSpec>, any>): void;
|
|
3243
3393
|
preprocessRuns: boolean;
|
|
3244
3394
|
}
|
|
3395
|
+
type EventSpecificationExample = {
|
|
3396
|
+
id: string;
|
|
3397
|
+
name: string;
|
|
3398
|
+
icon?: string;
|
|
3399
|
+
payload: any;
|
|
3400
|
+
};
|
|
3245
3401
|
interface EventSpecification<TEvent extends any> {
|
|
3246
3402
|
name: string;
|
|
3247
3403
|
title: string;
|
|
@@ -3249,12 +3405,7 @@ interface EventSpecification<TEvent extends any> {
|
|
|
3249
3405
|
icon: string;
|
|
3250
3406
|
properties?: DisplayProperty[];
|
|
3251
3407
|
schema?: any;
|
|
3252
|
-
examples?: Array<
|
|
3253
|
-
id: string;
|
|
3254
|
-
name: string;
|
|
3255
|
-
icon?: string;
|
|
3256
|
-
payload: TEvent;
|
|
3257
|
-
}>;
|
|
3408
|
+
examples?: Array<EventSpecificationExample>;
|
|
3258
3409
|
filter?: EventFilter;
|
|
3259
3410
|
parsePayload: (payload: unknown) => TEvent;
|
|
3260
3411
|
runProperties?: (payload: TEvent) => DisplayProperty[];
|
|
@@ -3361,9 +3512,9 @@ declare class ExternalSource<TIntegration extends TriggerIntegration<Integration
|
|
|
3361
3512
|
get integrationConfig(): {
|
|
3362
3513
|
id: string;
|
|
3363
3514
|
metadata: {
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3515
|
+
instructions?: string | undefined;
|
|
3516
|
+
id: string;
|
|
3517
|
+
name: string;
|
|
3367
3518
|
};
|
|
3368
3519
|
};
|
|
3369
3520
|
get id(): string;
|
|
@@ -3495,7 +3646,6 @@ declare class TriggerClient {
|
|
|
3495
3646
|
}>;
|
|
3496
3647
|
authorized(apiKey?: string | null): boolean;
|
|
3497
3648
|
apiKey(): string | undefined;
|
|
3498
|
-
listen(): Promise<void>;
|
|
3499
3649
|
}
|
|
3500
3650
|
|
|
3501
3651
|
type ScheduledEventSpecification = EventSpecification<ScheduledPayload>;
|
|
@@ -3507,6 +3657,15 @@ declare class IntervalTrigger implements Trigger<ScheduledEventSpecification> {
|
|
|
3507
3657
|
title: string;
|
|
3508
3658
|
source: string;
|
|
3509
3659
|
icon: string;
|
|
3660
|
+
examples: {
|
|
3661
|
+
id: string;
|
|
3662
|
+
name: string;
|
|
3663
|
+
icon: string;
|
|
3664
|
+
payload: {
|
|
3665
|
+
ts: string;
|
|
3666
|
+
lastTimestamp: string;
|
|
3667
|
+
};
|
|
3668
|
+
}[];
|
|
3510
3669
|
parsePayload: (data: unknown, params?: Partial<zod.ParseParams> | undefined) => {
|
|
3511
3670
|
lastTimestamp?: Date | undefined;
|
|
3512
3671
|
ts: Date;
|
|
@@ -3529,6 +3688,15 @@ declare class CronTrigger implements Trigger<ScheduledEventSpecification> {
|
|
|
3529
3688
|
title: string;
|
|
3530
3689
|
source: string;
|
|
3531
3690
|
icon: string;
|
|
3691
|
+
examples: {
|
|
3692
|
+
id: string;
|
|
3693
|
+
name: string;
|
|
3694
|
+
icon: string;
|
|
3695
|
+
payload: {
|
|
3696
|
+
ts: string;
|
|
3697
|
+
lastTimestamp: string;
|
|
3698
|
+
};
|
|
3699
|
+
}[];
|
|
3532
3700
|
parsePayload: (data: unknown, params?: Partial<zod.ParseParams> | undefined) => {
|
|
3533
3701
|
lastTimestamp?: Date | undefined;
|
|
3534
3702
|
ts: Date;
|
|
@@ -3556,6 +3724,15 @@ declare class DynamicSchedule implements Trigger<ScheduledEventSpecification> {
|
|
|
3556
3724
|
title: string;
|
|
3557
3725
|
source: string;
|
|
3558
3726
|
icon: string;
|
|
3727
|
+
examples: {
|
|
3728
|
+
id: string;
|
|
3729
|
+
name: string;
|
|
3730
|
+
icon: string;
|
|
3731
|
+
payload: {
|
|
3732
|
+
ts: string;
|
|
3733
|
+
lastTimestamp: string;
|
|
3734
|
+
};
|
|
3735
|
+
}[];
|
|
3559
3736
|
parsePayload: (data: unknown, params?: Partial<zod.ParseParams> | undefined) => {
|
|
3560
3737
|
lastTimestamp?: Date | undefined;
|
|
3561
3738
|
ts: Date;
|
|
@@ -3609,6 +3786,7 @@ declare class IO {
|
|
|
3609
3786
|
constructor(options: IOOptions);
|
|
3610
3787
|
get logger(): IOLogger;
|
|
3611
3788
|
wait(key: string | any[], seconds: number): Promise<void>;
|
|
3789
|
+
backgroundFetch<TResponseData>(key: string | any[], url: string, requestInit?: FetchRequestInit, retry?: FetchRetryOptions): Promise<TResponseData>;
|
|
3612
3790
|
sendEvent(key: string | any[], event: SendEvent, options?: SendEventOptions): Promise<{
|
|
3613
3791
|
context?: DeserializedJson | undefined;
|
|
3614
3792
|
deliverAt?: Date | null | undefined;
|
|
@@ -3674,6 +3852,7 @@ declare class IO {
|
|
|
3674
3852
|
runTask<TResult extends SerializableJson | void = void>(key: string | any[], options: RunTaskOptions, callback: (task: IOTask, io: IO) => Promise<TResult>, onError?: (error: unknown, task: IOTask, io: IO) => {
|
|
3675
3853
|
retryAt: Date;
|
|
3676
3854
|
error?: Error;
|
|
3855
|
+
jitter?: number;
|
|
3677
3856
|
} | undefined | void): Promise<TResult>;
|
|
3678
3857
|
try<TResult, TCatchResult>(tryCallback: () => Promise<TResult>, catchCallback: (error: unknown) => Promise<TCatchResult>): Promise<TResult | TCatchResult>;
|
|
3679
3858
|
}
|
|
@@ -3693,17 +3872,18 @@ interface TriggerIntegration<TIntegrationClient extends IntegrationClient<any, a
|
|
|
3693
3872
|
id: string;
|
|
3694
3873
|
metadata: IntegrationMetadata;
|
|
3695
3874
|
}
|
|
3696
|
-
type IntegrationClient<TClient, TTasks extends Record<string, AuthenticatedTask<TClient, any, any>>> = {
|
|
3875
|
+
type IntegrationClient<TClient, TTasks extends Record<string, AuthenticatedTask<TClient, any, any, any>>> = {
|
|
3697
3876
|
usesLocalAuth: true;
|
|
3698
3877
|
client: TClient;
|
|
3699
3878
|
tasks?: TTasks;
|
|
3879
|
+
auth: any;
|
|
3700
3880
|
} | {
|
|
3701
3881
|
usesLocalAuth: false;
|
|
3702
3882
|
clientFactory: ClientFactory<TClient>;
|
|
3703
3883
|
tasks?: TTasks;
|
|
3704
3884
|
};
|
|
3705
|
-
type AuthenticatedTask<TClient, TParams, TResult> = {
|
|
3706
|
-
run: (params: TParams, client: TClient, task: ServerTask, io: IO) => Promise<TResult>;
|
|
3885
|
+
type AuthenticatedTask<TClient, TParams, TResult, TAuth = ConnectionAuth> = {
|
|
3886
|
+
run: (params: TParams, client: TClient, task: ServerTask, io: IO, auth: TAuth) => Promise<TResult>;
|
|
3707
3887
|
init: (params: TParams) => RunTaskOptions;
|
|
3708
3888
|
onError?: (error: unknown, task: ServerTask) => {
|
|
3709
3889
|
retryAt: Date;
|
|
@@ -3714,8 +3894,8 @@ declare function authenticatedTask<TClient, TParams, TResult>(options: {
|
|
|
3714
3894
|
run: (params: TParams, client: TClient, task: ServerTask, io: IO) => Promise<TResult>;
|
|
3715
3895
|
init: (params: TParams) => RunTaskOptions;
|
|
3716
3896
|
}): AuthenticatedTask<TClient, TParams, TResult>;
|
|
3717
|
-
type ExtractRunFunction<T> = T extends AuthenticatedTask<any, infer TParams, infer TResult> ? (key: string, params: TParams) => Promise<TResult> : never;
|
|
3718
|
-
type ExtractTasks<TTasks extends Record<string, AuthenticatedTask<any, any, any>>> = {
|
|
3897
|
+
type ExtractRunFunction<T> = T extends AuthenticatedTask<any, infer TParams, infer TResult, infer TAuth> ? (key: string, params: TParams) => Promise<TResult> : never;
|
|
3898
|
+
type ExtractTasks<TTasks extends Record<string, AuthenticatedTask<any, any, any, any>>> = {
|
|
3719
3899
|
[key in keyof TTasks]: ExtractRunFunction<TTasks[key]>;
|
|
3720
3900
|
};
|
|
3721
3901
|
type ExtractIntegrationClientClient<TIntegrationClient extends IntegrationClient<any, any>> = TIntegrationClient extends {
|
|
@@ -3806,8 +3986,6 @@ declare class MissingConnectionNotification implements Trigger<MissingConnection
|
|
|
3806
3986
|
title: string;
|
|
3807
3987
|
createdAt: Date;
|
|
3808
3988
|
updatedAt: Date;
|
|
3809
|
-
integrationIdentifier: string;
|
|
3810
|
-
integrationAuthMethod: string;
|
|
3811
3989
|
};
|
|
3812
3990
|
authorizationUrl: string;
|
|
3813
3991
|
} | {
|
|
@@ -3823,8 +4001,6 @@ declare class MissingConnectionNotification implements Trigger<MissingConnection
|
|
|
3823
4001
|
title: string;
|
|
3824
4002
|
createdAt: Date;
|
|
3825
4003
|
updatedAt: Date;
|
|
3826
|
-
integrationIdentifier: string;
|
|
3827
|
-
integrationAuthMethod: string;
|
|
3828
4004
|
};
|
|
3829
4005
|
authorizationUrl: string;
|
|
3830
4006
|
};
|
|
@@ -3900,6 +4076,6 @@ declare class RetryWithTaskError {
|
|
|
3900
4076
|
declare function isTriggerError(err: unknown): err is ResumeWithTaskError | RetryWithTaskError;
|
|
3901
4077
|
|
|
3902
4078
|
type Task = ServerTask;
|
|
3903
|
-
declare function
|
|
4079
|
+
declare function redactString(strings: TemplateStringsArray, ...interpolations: string[]): RedactString;
|
|
3904
4080
|
|
|
3905
|
-
export { AuthenticatedTask, ClientFactory, CronTrigger, DynamicIntervalOptions, DynamicSchedule, DynamicTrigger, DynamicTriggerOptions, EventFilter, EventSpecification, EventTrigger, EventTypeFromSpecification, ExternalSource, ExternalSourceParams, ExternalSourceTrigger, ExternalSourceTriggerOptions, HandlerEvent, HttpSourceEvent, IO, IOLogger, IOOptions, IOTask, IOWithIntegrations, IntegrationClient, IntervalTrigger, Job, JobOptions, ListenOptions, Logger, MissingConnectionNotification, MissingConnectionResolvedNotification, NormalizedRequest, PreprocessResults,
|
|
4081
|
+
export { AuthenticatedTask, ClientFactory, CronTrigger, DynamicIntervalOptions, DynamicSchedule, DynamicTrigger, DynamicTriggerOptions, EventFilter, EventSpecification, EventSpecificationExample, EventTrigger, EventTypeFromSpecification, ExternalSource, ExternalSourceParams, ExternalSourceTrigger, ExternalSourceTriggerOptions, HandlerEvent, HttpSourceEvent, IO, IOLogger, IOOptions, IOTask, IOWithIntegrations, IntegrationClient, IntervalTrigger, Job, JobOptions, ListenOptions, Logger, MissingConnectionNotification, MissingConnectionResolvedNotification, NormalizedRequest, PreprocessResults, RedactString, Task, TaskLogger, Trigger, TriggerClient, TriggerClientOptions, TriggerContext, TriggerEventType, TriggerIntegration, TriggerPreprocessContext, authenticatedTask, cronTrigger, eventTrigger, intervalTrigger, isTriggerError, missingConnectionNotification, missingConnectionResolvedNotification, omit, redactString };
|