@automate.ax/integration-contracts 0.115.6 → 0.118.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/dist/gmail/index.d.ts +269 -0
- package/dist/gmail/index.js +13 -1
- package/dist/gmail/schemas.d.ts +204 -0
- package/dist/gmail/schemas.js +24 -0
- package/dist/google-calendar/event-schemas.d.ts +346 -0
- package/dist/google-calendar/event-schemas.js +14 -0
- package/dist/google-calendar/index.d.ts +350 -0
- package/dist/google-calendar/index.js +5 -1
- package/dist/millionverifier/api.d.ts +62 -0
- package/dist/millionverifier/api.js +114 -0
- package/dist/millionverifier/events.d.ts +126 -0
- package/dist/millionverifier/events.js +103 -0
- package/dist/millionverifier/index.d.ts +77 -0
- package/dist/millionverifier/index.js +17 -0
- package/dist/millionverifier/schemas.d.ts +226 -0
- package/dist/millionverifier/schemas.js +188 -0
- package/dist/tidycal/api.d.ts +62 -0
- package/dist/tidycal/api.js +192 -0
- package/dist/tidycal/index.d.ts +2 -0
- package/dist/tidycal/index.js +2 -0
- package/dist/tidycal/schemas.d.ts +121 -0
- package/dist/tidycal/schemas.js +95 -0
- package/dist/triggers.d.ts +2 -1
- package/package.json +14 -2
- package/src/gmail/index.ts +18 -1
- package/src/gmail/schemas.ts +26 -0
- package/src/google-calendar/event-schemas.ts +18 -0
- package/src/google-calendar/index.ts +8 -1
- package/src/millionverifier/api.ts +151 -0
- package/src/millionverifier/events.ts +110 -0
- package/src/millionverifier/index.ts +33 -0
- package/src/millionverifier/schemas.ts +207 -0
- package/src/tidycal/api.ts +239 -0
- package/src/tidycal/index.ts +2 -0
- package/src/tidycal/schemas.ts +105 -0
- package/src/triggers.ts +2 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
const FILE_ID_WIRE_SCHEMA = z.union([z.string(), z.number()]).transform(String);
|
|
3
|
+
export const MILLIONVERIFIER_NO_CREDIT_EVENT_SCHEMA = z.object({
|
|
4
|
+
reason: z.literal("noCredit"),
|
|
5
|
+
});
|
|
6
|
+
export const MILLIONVERIFIER_LOW_CREDIT_EVENT_SCHEMA = z.object({
|
|
7
|
+
credits: z.number().int().nonnegative(),
|
|
8
|
+
reason: z.literal("lowCredit"),
|
|
9
|
+
});
|
|
10
|
+
export const MILLIONVERIFIER_FILE_READY_EVENT_SCHEMA = z.object({
|
|
11
|
+
file: z.object({
|
|
12
|
+
catchAll: z.number().int().nonnegative(),
|
|
13
|
+
disposable: z.number().int().nonnegative(),
|
|
14
|
+
fileId: z.string(),
|
|
15
|
+
fileName: z.string(),
|
|
16
|
+
invalid: z.number().int().nonnegative(),
|
|
17
|
+
ok: z.number().int().nonnegative(),
|
|
18
|
+
totalRows: z.number().int().nonnegative(),
|
|
19
|
+
uniqueEmails: z.number().int().nonnegative(),
|
|
20
|
+
unknown: z.number().int().nonnegative(),
|
|
21
|
+
}),
|
|
22
|
+
reason: z.literal("fileReady"),
|
|
23
|
+
});
|
|
24
|
+
export const MILLIONVERIFIER_FILE_DELETION_SCHEDULED_EVENT_SCHEMA = z.object({
|
|
25
|
+
file: z.object({
|
|
26
|
+
deletesIn: z.string().min(1),
|
|
27
|
+
fileId: z.string(),
|
|
28
|
+
fileName: z.string(),
|
|
29
|
+
}),
|
|
30
|
+
reason: z.literal("fileDeletionScheduled"),
|
|
31
|
+
});
|
|
32
|
+
export const MILLIONVERIFIER_EVENT_SCHEMA = z.discriminatedUnion("reason", [
|
|
33
|
+
MILLIONVERIFIER_NO_CREDIT_EVENT_SCHEMA,
|
|
34
|
+
MILLIONVERIFIER_LOW_CREDIT_EVENT_SCHEMA,
|
|
35
|
+
MILLIONVERIFIER_FILE_READY_EVENT_SCHEMA,
|
|
36
|
+
MILLIONVERIFIER_FILE_DELETION_SCHEDULED_EVENT_SCHEMA,
|
|
37
|
+
]);
|
|
38
|
+
export const MILLIONVERIFIER_WEBHOOK_WIRE_SCHEMA = z.discriminatedUnion("reason", [
|
|
39
|
+
z.looseObject({ reason: z.literal("no_credit") }),
|
|
40
|
+
z.looseObject({
|
|
41
|
+
credits: z.number().int().nonnegative(),
|
|
42
|
+
reason: z.literal("low_credit"),
|
|
43
|
+
}),
|
|
44
|
+
z.looseObject({
|
|
45
|
+
file: z.looseObject({
|
|
46
|
+
catch_all: z.number().int().nonnegative(),
|
|
47
|
+
disposable: z.number().int().nonnegative(),
|
|
48
|
+
file_id: FILE_ID_WIRE_SCHEMA,
|
|
49
|
+
file_name: z.string(),
|
|
50
|
+
invalid: z.number().int().nonnegative(),
|
|
51
|
+
ok: z.number().int().nonnegative(),
|
|
52
|
+
total_rows: z.number().int().nonnegative(),
|
|
53
|
+
unique_emails: z.number().int().nonnegative(),
|
|
54
|
+
unknown: z.number().int().nonnegative(),
|
|
55
|
+
}),
|
|
56
|
+
reason: z.literal("file_ready"),
|
|
57
|
+
}),
|
|
58
|
+
z.looseObject({
|
|
59
|
+
file: z.looseObject({
|
|
60
|
+
file_delete: z.string().min(1),
|
|
61
|
+
file_id: FILE_ID_WIRE_SCHEMA,
|
|
62
|
+
file_name: z.string(),
|
|
63
|
+
}),
|
|
64
|
+
reason: z.literal("file_delete"),
|
|
65
|
+
}),
|
|
66
|
+
]);
|
|
67
|
+
/**
|
|
68
|
+
* Normalizes one documented MillionVerifier notification payload.
|
|
69
|
+
*
|
|
70
|
+
* @param value - Untrusted provider callback payload.
|
|
71
|
+
*/
|
|
72
|
+
export function normalizeMillionVerifierEvent(value) {
|
|
73
|
+
const event = MILLIONVERIFIER_WEBHOOK_WIRE_SCHEMA.parse(value);
|
|
74
|
+
if (event.reason === "no_credit")
|
|
75
|
+
return { reason: "noCredit" };
|
|
76
|
+
if (event.reason === "low_credit") {
|
|
77
|
+
return { credits: event.credits, reason: "lowCredit" };
|
|
78
|
+
}
|
|
79
|
+
if (event.reason === "file_delete") {
|
|
80
|
+
return {
|
|
81
|
+
file: {
|
|
82
|
+
deletesIn: event.file.file_delete,
|
|
83
|
+
fileId: event.file.file_id,
|
|
84
|
+
fileName: event.file.file_name,
|
|
85
|
+
},
|
|
86
|
+
reason: "fileDeletionScheduled",
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
file: {
|
|
91
|
+
catchAll: event.file.catch_all,
|
|
92
|
+
disposable: event.file.disposable,
|
|
93
|
+
fileId: event.file.file_id,
|
|
94
|
+
fileName: event.file.file_name,
|
|
95
|
+
invalid: event.file.invalid,
|
|
96
|
+
ok: event.file.ok,
|
|
97
|
+
totalRows: event.file.total_rows,
|
|
98
|
+
uniqueEmails: event.file.unique_emails,
|
|
99
|
+
unknown: event.file.unknown,
|
|
100
|
+
},
|
|
101
|
+
reason: "fileReady",
|
|
102
|
+
};
|
|
103
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export * from "./api.js";
|
|
2
|
+
export * from "./events.js";
|
|
3
|
+
export * from "./schemas.js";
|
|
4
|
+
import * as z from "zod";
|
|
5
|
+
export declare const MILLIONVERIFIER_TRIGGER_CONFIG_SCHEMA: z.ZodObject<{}, z.core.$strip>;
|
|
6
|
+
export declare const millionVerifierTriggerContracts: {
|
|
7
|
+
readonly "millionverifier.event": {
|
|
8
|
+
configSchema: z.ZodObject<{}, z.core.$strip>;
|
|
9
|
+
eventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
10
|
+
reason: z.ZodLiteral<"noCredit">;
|
|
11
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
12
|
+
credits: z.ZodNumber;
|
|
13
|
+
reason: z.ZodLiteral<"lowCredit">;
|
|
14
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
15
|
+
file: z.ZodObject<{
|
|
16
|
+
catchAll: z.ZodNumber;
|
|
17
|
+
disposable: z.ZodNumber;
|
|
18
|
+
fileId: z.ZodString;
|
|
19
|
+
fileName: z.ZodString;
|
|
20
|
+
invalid: z.ZodNumber;
|
|
21
|
+
ok: z.ZodNumber;
|
|
22
|
+
totalRows: z.ZodNumber;
|
|
23
|
+
uniqueEmails: z.ZodNumber;
|
|
24
|
+
unknown: z.ZodNumber;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
reason: z.ZodLiteral<"fileReady">;
|
|
27
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
28
|
+
file: z.ZodObject<{
|
|
29
|
+
deletesIn: z.ZodString;
|
|
30
|
+
fileId: z.ZodString;
|
|
31
|
+
fileName: z.ZodString;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
reason: z.ZodLiteral<"fileDeletionScheduled">;
|
|
34
|
+
}, z.core.$strip>], "reason">;
|
|
35
|
+
};
|
|
36
|
+
readonly "millionverifier.noCredit": {
|
|
37
|
+
configSchema: z.ZodObject<{}, z.core.$strip>;
|
|
38
|
+
eventSchema: z.ZodObject<{
|
|
39
|
+
reason: z.ZodLiteral<"noCredit">;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
};
|
|
42
|
+
readonly "millionverifier.lowCredit": {
|
|
43
|
+
configSchema: z.ZodObject<{}, z.core.$strip>;
|
|
44
|
+
eventSchema: z.ZodObject<{
|
|
45
|
+
credits: z.ZodNumber;
|
|
46
|
+
reason: z.ZodLiteral<"lowCredit">;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
};
|
|
49
|
+
readonly "millionverifier.fileReady": {
|
|
50
|
+
configSchema: z.ZodObject<{}, z.core.$strip>;
|
|
51
|
+
eventSchema: z.ZodObject<{
|
|
52
|
+
file: z.ZodObject<{
|
|
53
|
+
catchAll: z.ZodNumber;
|
|
54
|
+
disposable: z.ZodNumber;
|
|
55
|
+
fileId: z.ZodString;
|
|
56
|
+
fileName: z.ZodString;
|
|
57
|
+
invalid: z.ZodNumber;
|
|
58
|
+
ok: z.ZodNumber;
|
|
59
|
+
totalRows: z.ZodNumber;
|
|
60
|
+
uniqueEmails: z.ZodNumber;
|
|
61
|
+
unknown: z.ZodNumber;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
reason: z.ZodLiteral<"fileReady">;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
};
|
|
66
|
+
readonly "millionverifier.fileDeletionScheduled": {
|
|
67
|
+
configSchema: z.ZodObject<{}, z.core.$strip>;
|
|
68
|
+
eventSchema: z.ZodObject<{
|
|
69
|
+
file: z.ZodObject<{
|
|
70
|
+
deletesIn: z.ZodString;
|
|
71
|
+
fileId: z.ZodString;
|
|
72
|
+
fileName: z.ZodString;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
reason: z.ZodLiteral<"fileDeletionScheduled">;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from "./api.js";
|
|
2
|
+
export * from "./events.js";
|
|
3
|
+
export * from "./schemas.js";
|
|
4
|
+
import * as z from "zod";
|
|
5
|
+
import { MILLIONVERIFIER_EVENT_SCHEMA, MILLIONVERIFIER_FILE_DELETION_SCHEDULED_EVENT_SCHEMA, MILLIONVERIFIER_FILE_READY_EVENT_SCHEMA, MILLIONVERIFIER_LOW_CREDIT_EVENT_SCHEMA, MILLIONVERIFIER_NO_CREDIT_EVENT_SCHEMA, } from "./events.js";
|
|
6
|
+
export const MILLIONVERIFIER_TRIGGER_CONFIG_SCHEMA = z.object({});
|
|
7
|
+
const contract = (eventSchema) => ({
|
|
8
|
+
configSchema: MILLIONVERIFIER_TRIGGER_CONFIG_SCHEMA,
|
|
9
|
+
eventSchema,
|
|
10
|
+
});
|
|
11
|
+
export const millionVerifierTriggerContracts = {
|
|
12
|
+
"millionverifier.event": contract(MILLIONVERIFIER_EVENT_SCHEMA),
|
|
13
|
+
"millionverifier.noCredit": contract(MILLIONVERIFIER_NO_CREDIT_EVENT_SCHEMA),
|
|
14
|
+
"millionverifier.lowCredit": contract(MILLIONVERIFIER_LOW_CREDIT_EVENT_SCHEMA),
|
|
15
|
+
"millionverifier.fileReady": contract(MILLIONVERIFIER_FILE_READY_EVENT_SCHEMA),
|
|
16
|
+
"millionverifier.fileDeletionScheduled": contract(MILLIONVERIFIER_FILE_DELETION_SCHEDULED_EVENT_SCHEMA),
|
|
17
|
+
};
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const MILLIONVERIFIER_FILE_ID_SCHEMA: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
3
|
+
export declare const MILLIONVERIFIER_FILE_STATUS_SCHEMA: z.ZodEnum<{
|
|
4
|
+
error: "error";
|
|
5
|
+
paused: "paused";
|
|
6
|
+
canceled: "canceled";
|
|
7
|
+
finished: "finished";
|
|
8
|
+
inProgress: "inProgress";
|
|
9
|
+
inQueueToStart: "inQueueToStart";
|
|
10
|
+
}>;
|
|
11
|
+
export declare const MILLIONVERIFIER_FILE_SCHEMA: z.ZodObject<{
|
|
12
|
+
catchAll: z.ZodNumber;
|
|
13
|
+
createdAt: z.ZodString;
|
|
14
|
+
creditsRequired: z.ZodNumber;
|
|
15
|
+
disposable: z.ZodNumber;
|
|
16
|
+
error: z.ZodString;
|
|
17
|
+
estimatedTimeSeconds: z.ZodNumber;
|
|
18
|
+
fileId: z.ZodString;
|
|
19
|
+
fileName: z.ZodString;
|
|
20
|
+
invalid: z.ZodNumber;
|
|
21
|
+
ok: z.ZodNumber;
|
|
22
|
+
percent: z.ZodNumber;
|
|
23
|
+
reverify: z.ZodNumber;
|
|
24
|
+
status: z.ZodEnum<{
|
|
25
|
+
error: "error";
|
|
26
|
+
paused: "paused";
|
|
27
|
+
canceled: "canceled";
|
|
28
|
+
finished: "finished";
|
|
29
|
+
inProgress: "inProgress";
|
|
30
|
+
inQueueToStart: "inQueueToStart";
|
|
31
|
+
}>;
|
|
32
|
+
totalRows: z.ZodNumber;
|
|
33
|
+
uniqueEmails: z.ZodNumber;
|
|
34
|
+
unknown: z.ZodNumber;
|
|
35
|
+
unverified: z.ZodNumber;
|
|
36
|
+
updatedAt: z.ZodString;
|
|
37
|
+
verified: z.ZodNumber;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
export declare const MILLIONVERIFIER_EMAIL_RESULT_SCHEMA: z.ZodEnum<{
|
|
40
|
+
unknown: "unknown";
|
|
41
|
+
error: "error";
|
|
42
|
+
invalid: "invalid";
|
|
43
|
+
ok: "ok";
|
|
44
|
+
catchAll: "catchAll";
|
|
45
|
+
disposable: "disposable";
|
|
46
|
+
unverified: "unverified";
|
|
47
|
+
}>;
|
|
48
|
+
export declare const MILLIONVERIFIER_EMAIL_VERIFICATION_SCHEMA: z.ZodObject<{
|
|
49
|
+
credits: z.ZodNumber;
|
|
50
|
+
didYouMean: z.ZodString;
|
|
51
|
+
email: z.ZodString;
|
|
52
|
+
error: z.ZodString;
|
|
53
|
+
executionTimeMilliseconds: z.ZodNumber;
|
|
54
|
+
free: z.ZodBoolean;
|
|
55
|
+
liveMode: z.ZodBoolean;
|
|
56
|
+
quality: z.ZodOptional<z.ZodEnum<{
|
|
57
|
+
good: "good";
|
|
58
|
+
bad: "bad";
|
|
59
|
+
risky: "risky";
|
|
60
|
+
}>>;
|
|
61
|
+
result: z.ZodEnum<{
|
|
62
|
+
unknown: "unknown";
|
|
63
|
+
error: "error";
|
|
64
|
+
invalid: "invalid";
|
|
65
|
+
ok: "ok";
|
|
66
|
+
catchAll: "catchAll";
|
|
67
|
+
disposable: "disposable";
|
|
68
|
+
unverified: "unverified";
|
|
69
|
+
}>;
|
|
70
|
+
resultCode: z.ZodNumber;
|
|
71
|
+
role: z.ZodBoolean;
|
|
72
|
+
subresult: z.ZodString;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
export declare const MILLIONVERIFIER_CREDITS_SCHEMA: z.ZodObject<{
|
|
75
|
+
bulkCredits: z.ZodNumber;
|
|
76
|
+
credits: z.ZodNumber;
|
|
77
|
+
plan: z.ZodNumber;
|
|
78
|
+
renewingCredits: z.ZodNumber;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
export declare const MILLIONVERIFIER_FILE_WIRE_SCHEMA: z.ZodPipe<z.ZodObject<{
|
|
81
|
+
catch_all: z.ZodNumber;
|
|
82
|
+
createdate: z.ZodString;
|
|
83
|
+
credit: z.ZodNumber;
|
|
84
|
+
disposable: z.ZodNumber;
|
|
85
|
+
error: z.ZodString;
|
|
86
|
+
estimated_time_sec: z.ZodNumber;
|
|
87
|
+
file_id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
88
|
+
file_name: z.ZodString;
|
|
89
|
+
invalid: z.ZodNumber;
|
|
90
|
+
ok: z.ZodNumber;
|
|
91
|
+
percent: z.ZodNumber;
|
|
92
|
+
reverify: z.ZodNumber;
|
|
93
|
+
status: z.ZodEnum<{
|
|
94
|
+
error: "error";
|
|
95
|
+
in_progress: "in_progress";
|
|
96
|
+
paused: "paused";
|
|
97
|
+
canceled: "canceled";
|
|
98
|
+
finished: "finished";
|
|
99
|
+
in_queue_to_start: "in_queue_to_start";
|
|
100
|
+
}>;
|
|
101
|
+
total_rows: z.ZodNumber;
|
|
102
|
+
unique_emails: z.ZodNumber;
|
|
103
|
+
unknown: z.ZodNumber;
|
|
104
|
+
unverified: z.ZodNumber;
|
|
105
|
+
updated_at: z.ZodString;
|
|
106
|
+
verified: z.ZodNumber;
|
|
107
|
+
}, z.core.$loose>, z.ZodTransform<{
|
|
108
|
+
catchAll: number;
|
|
109
|
+
createdAt: string;
|
|
110
|
+
creditsRequired: number;
|
|
111
|
+
disposable: number;
|
|
112
|
+
error: string;
|
|
113
|
+
estimatedTimeSeconds: number;
|
|
114
|
+
fileId: string;
|
|
115
|
+
fileName: string;
|
|
116
|
+
invalid: number;
|
|
117
|
+
ok: number;
|
|
118
|
+
percent: number;
|
|
119
|
+
reverify: number;
|
|
120
|
+
status: "error" | "paused" | "canceled" | "finished" | "inProgress" | "inQueueToStart";
|
|
121
|
+
totalRows: number;
|
|
122
|
+
uniqueEmails: number;
|
|
123
|
+
unknown: number;
|
|
124
|
+
unverified: number;
|
|
125
|
+
updatedAt: string;
|
|
126
|
+
verified: number;
|
|
127
|
+
}, {
|
|
128
|
+
[x: string]: unknown;
|
|
129
|
+
catch_all: number;
|
|
130
|
+
createdate: string;
|
|
131
|
+
credit: number;
|
|
132
|
+
disposable: number;
|
|
133
|
+
error: string;
|
|
134
|
+
estimated_time_sec: number;
|
|
135
|
+
file_id: string;
|
|
136
|
+
file_name: string;
|
|
137
|
+
invalid: number;
|
|
138
|
+
ok: number;
|
|
139
|
+
percent: number;
|
|
140
|
+
reverify: number;
|
|
141
|
+
status: "error" | "in_progress" | "paused" | "canceled" | "finished" | "in_queue_to_start";
|
|
142
|
+
total_rows: number;
|
|
143
|
+
unique_emails: number;
|
|
144
|
+
unknown: number;
|
|
145
|
+
unverified: number;
|
|
146
|
+
updated_at: string;
|
|
147
|
+
verified: number;
|
|
148
|
+
}>>;
|
|
149
|
+
export declare const MILLIONVERIFIER_EMAIL_VERIFICATION_WIRE_SCHEMA: z.ZodPipe<z.ZodObject<{
|
|
150
|
+
credits: z.ZodNumber;
|
|
151
|
+
didyoumean: z.ZodString;
|
|
152
|
+
email: z.ZodString;
|
|
153
|
+
error: z.ZodString;
|
|
154
|
+
executiontime: z.ZodNumber;
|
|
155
|
+
free: z.ZodBoolean;
|
|
156
|
+
livemode: z.ZodBoolean;
|
|
157
|
+
quality: z.ZodOptional<z.ZodEnum<{
|
|
158
|
+
"": "";
|
|
159
|
+
good: "good";
|
|
160
|
+
bad: "bad";
|
|
161
|
+
risky: "risky";
|
|
162
|
+
}>>;
|
|
163
|
+
result: z.ZodEnum<{
|
|
164
|
+
"": "";
|
|
165
|
+
unknown: "unknown";
|
|
166
|
+
error: "error";
|
|
167
|
+
invalid: "invalid";
|
|
168
|
+
ok: "ok";
|
|
169
|
+
disposable: "disposable";
|
|
170
|
+
catch_all: "catch_all";
|
|
171
|
+
unverified: "unverified";
|
|
172
|
+
}>;
|
|
173
|
+
resultcode: z.ZodNumber;
|
|
174
|
+
role: z.ZodBoolean;
|
|
175
|
+
subresult: z.ZodString;
|
|
176
|
+
}, z.core.$loose>, z.ZodTransform<{
|
|
177
|
+
credits: number;
|
|
178
|
+
didYouMean: string;
|
|
179
|
+
email: string;
|
|
180
|
+
error: string;
|
|
181
|
+
executionTimeMilliseconds: number;
|
|
182
|
+
free: boolean;
|
|
183
|
+
liveMode: boolean;
|
|
184
|
+
result: "unknown" | "error" | "invalid" | "ok" | "catchAll" | "disposable" | "unverified";
|
|
185
|
+
resultCode: number;
|
|
186
|
+
role: boolean;
|
|
187
|
+
subresult: string;
|
|
188
|
+
quality?: "good" | "bad" | "risky" | undefined;
|
|
189
|
+
}, {
|
|
190
|
+
[x: string]: unknown;
|
|
191
|
+
credits: number;
|
|
192
|
+
didyoumean: string;
|
|
193
|
+
email: string;
|
|
194
|
+
error: string;
|
|
195
|
+
executiontime: number;
|
|
196
|
+
free: boolean;
|
|
197
|
+
livemode: boolean;
|
|
198
|
+
result: "" | "unknown" | "error" | "invalid" | "ok" | "disposable" | "catch_all" | "unverified";
|
|
199
|
+
resultcode: number;
|
|
200
|
+
role: boolean;
|
|
201
|
+
subresult: string;
|
|
202
|
+
quality?: "" | "good" | "bad" | "risky" | undefined;
|
|
203
|
+
}>>;
|
|
204
|
+
export declare const MILLIONVERIFIER_CREDITS_WIRE_SCHEMA: z.ZodPipe<z.ZodObject<{
|
|
205
|
+
bulk_credits: z.ZodNumber;
|
|
206
|
+
credits: z.ZodNumber;
|
|
207
|
+
plan: z.ZodNumber;
|
|
208
|
+
renewing_credits: z.ZodNumber;
|
|
209
|
+
}, z.core.$loose>, z.ZodTransform<{
|
|
210
|
+
bulkCredits: number;
|
|
211
|
+
credits: number;
|
|
212
|
+
plan: number;
|
|
213
|
+
renewingCredits: number;
|
|
214
|
+
}, {
|
|
215
|
+
[x: string]: unknown;
|
|
216
|
+
bulk_credits: number;
|
|
217
|
+
credits: number;
|
|
218
|
+
plan: number;
|
|
219
|
+
renewing_credits: number;
|
|
220
|
+
}>>;
|
|
221
|
+
/**
|
|
222
|
+
* Maps a public file status to MillionVerifier's query value.
|
|
223
|
+
*
|
|
224
|
+
* @param status - Public file status.
|
|
225
|
+
*/
|
|
226
|
+
export declare function toMillionVerifierFileStatus(status: z.output<typeof MILLIONVERIFIER_FILE_STATUS_SCHEMA>): "error" | "in_progress" | "paused" | "canceled" | "finished" | "in_queue_to_start";
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export const MILLIONVERIFIER_FILE_ID_SCHEMA = z
|
|
3
|
+
.union([z.string().regex(/^\d+$/), z.number().int().positive()])
|
|
4
|
+
.transform(String);
|
|
5
|
+
export const MILLIONVERIFIER_FILE_STATUS_SCHEMA = z.enum([
|
|
6
|
+
"inProgress",
|
|
7
|
+
"error",
|
|
8
|
+
"finished",
|
|
9
|
+
"canceled",
|
|
10
|
+
"paused",
|
|
11
|
+
"inQueueToStart",
|
|
12
|
+
]);
|
|
13
|
+
export const MILLIONVERIFIER_FILE_SCHEMA = z.object({
|
|
14
|
+
catchAll: z.number().int().nonnegative(),
|
|
15
|
+
createdAt: z.string(),
|
|
16
|
+
creditsRequired: z.number().int().nonnegative(),
|
|
17
|
+
disposable: z.number().int().nonnegative(),
|
|
18
|
+
error: z.string(),
|
|
19
|
+
estimatedTimeSeconds: z.number().int().nonnegative(),
|
|
20
|
+
fileId: z.string(),
|
|
21
|
+
fileName: z.string(),
|
|
22
|
+
invalid: z.number().int().nonnegative(),
|
|
23
|
+
ok: z.number().int().nonnegative(),
|
|
24
|
+
percent: z.number().int().min(0).max(100),
|
|
25
|
+
reverify: z.number().int().nonnegative(),
|
|
26
|
+
status: MILLIONVERIFIER_FILE_STATUS_SCHEMA,
|
|
27
|
+
totalRows: z.number().int().nonnegative(),
|
|
28
|
+
uniqueEmails: z.number().int().nonnegative(),
|
|
29
|
+
unknown: z.number().int().nonnegative(),
|
|
30
|
+
unverified: z.number().int().nonnegative(),
|
|
31
|
+
updatedAt: z.string(),
|
|
32
|
+
verified: z.number().int().nonnegative(),
|
|
33
|
+
});
|
|
34
|
+
export const MILLIONVERIFIER_EMAIL_RESULT_SCHEMA = z.enum([
|
|
35
|
+
"unverified",
|
|
36
|
+
"ok",
|
|
37
|
+
"catchAll",
|
|
38
|
+
"unknown",
|
|
39
|
+
"error",
|
|
40
|
+
"disposable",
|
|
41
|
+
"invalid",
|
|
42
|
+
]);
|
|
43
|
+
export const MILLIONVERIFIER_EMAIL_VERIFICATION_SCHEMA = z.object({
|
|
44
|
+
credits: z.number().int().nonnegative(),
|
|
45
|
+
didYouMean: z.string(),
|
|
46
|
+
email: z.string(),
|
|
47
|
+
error: z.string(),
|
|
48
|
+
executionTimeMilliseconds: z.number().int().nonnegative(),
|
|
49
|
+
free: z.boolean(),
|
|
50
|
+
liveMode: z.boolean(),
|
|
51
|
+
quality: z.enum(["good", "bad", "risky"]).optional(),
|
|
52
|
+
result: MILLIONVERIFIER_EMAIL_RESULT_SCHEMA,
|
|
53
|
+
resultCode: z.number().int().min(0).max(6),
|
|
54
|
+
role: z.boolean(),
|
|
55
|
+
subresult: z.string(),
|
|
56
|
+
});
|
|
57
|
+
export const MILLIONVERIFIER_CREDITS_SCHEMA = z.object({
|
|
58
|
+
bulkCredits: z.number().int().nonnegative(),
|
|
59
|
+
credits: z.number().int().nonnegative(),
|
|
60
|
+
plan: z.number().int(),
|
|
61
|
+
renewingCredits: z.number().int().nonnegative(),
|
|
62
|
+
});
|
|
63
|
+
const PROVIDER_FILE_STATUS_SCHEMA = z.enum([
|
|
64
|
+
"in_progress",
|
|
65
|
+
"error",
|
|
66
|
+
"finished",
|
|
67
|
+
"canceled",
|
|
68
|
+
"paused",
|
|
69
|
+
"in_queue_to_start",
|
|
70
|
+
]);
|
|
71
|
+
export const MILLIONVERIFIER_FILE_WIRE_SCHEMA = z
|
|
72
|
+
.looseObject({
|
|
73
|
+
catch_all: z.number().int().nonnegative(),
|
|
74
|
+
createdate: z.string(),
|
|
75
|
+
credit: z.number().int().nonnegative(),
|
|
76
|
+
disposable: z.number().int().nonnegative(),
|
|
77
|
+
error: z.string(),
|
|
78
|
+
estimated_time_sec: z.number().int().nonnegative(),
|
|
79
|
+
file_id: z.union([z.string(), z.number()]).transform(String),
|
|
80
|
+
file_name: z.string(),
|
|
81
|
+
invalid: z.number().int().nonnegative(),
|
|
82
|
+
ok: z.number().int().nonnegative(),
|
|
83
|
+
percent: z.number().int().min(0).max(100),
|
|
84
|
+
reverify: z.number().int().nonnegative(),
|
|
85
|
+
status: PROVIDER_FILE_STATUS_SCHEMA,
|
|
86
|
+
total_rows: z.number().int().nonnegative(),
|
|
87
|
+
unique_emails: z.number().int().nonnegative(),
|
|
88
|
+
unknown: z.number().int().nonnegative(),
|
|
89
|
+
unverified: z.number().int().nonnegative(),
|
|
90
|
+
updated_at: z.string(),
|
|
91
|
+
verified: z.number().int().nonnegative(),
|
|
92
|
+
})
|
|
93
|
+
.transform((file) => MILLIONVERIFIER_FILE_SCHEMA.parse({
|
|
94
|
+
catchAll: file.catch_all,
|
|
95
|
+
createdAt: file.createdate,
|
|
96
|
+
creditsRequired: file.credit,
|
|
97
|
+
disposable: file.disposable,
|
|
98
|
+
error: file.error,
|
|
99
|
+
estimatedTimeSeconds: file.estimated_time_sec,
|
|
100
|
+
fileId: file.file_id,
|
|
101
|
+
fileName: file.file_name,
|
|
102
|
+
invalid: file.invalid,
|
|
103
|
+
ok: file.ok,
|
|
104
|
+
percent: file.percent,
|
|
105
|
+
reverify: file.reverify,
|
|
106
|
+
status: fromProviderFileStatus(file.status),
|
|
107
|
+
totalRows: file.total_rows,
|
|
108
|
+
uniqueEmails: file.unique_emails,
|
|
109
|
+
unknown: file.unknown,
|
|
110
|
+
unverified: file.unverified,
|
|
111
|
+
updatedAt: file.updated_at,
|
|
112
|
+
verified: file.verified,
|
|
113
|
+
}));
|
|
114
|
+
export const MILLIONVERIFIER_EMAIL_VERIFICATION_WIRE_SCHEMA = z
|
|
115
|
+
.looseObject({
|
|
116
|
+
credits: z.number().int().nonnegative(),
|
|
117
|
+
didyoumean: z.string(),
|
|
118
|
+
email: z.string(),
|
|
119
|
+
error: z.string(),
|
|
120
|
+
executiontime: z.number().int().nonnegative(),
|
|
121
|
+
free: z.boolean(),
|
|
122
|
+
livemode: z.boolean(),
|
|
123
|
+
quality: z.enum(["", "good", "bad", "risky"]).optional(),
|
|
124
|
+
result: z.enum([
|
|
125
|
+
"",
|
|
126
|
+
"unverified",
|
|
127
|
+
"ok",
|
|
128
|
+
"catch_all",
|
|
129
|
+
"unknown",
|
|
130
|
+
"error",
|
|
131
|
+
"disposable",
|
|
132
|
+
"invalid",
|
|
133
|
+
]),
|
|
134
|
+
resultcode: z.number().int().min(0).max(6),
|
|
135
|
+
role: z.boolean(),
|
|
136
|
+
subresult: z.string(),
|
|
137
|
+
})
|
|
138
|
+
.transform((result) => MILLIONVERIFIER_EMAIL_VERIFICATION_SCHEMA.parse({
|
|
139
|
+
credits: result.credits,
|
|
140
|
+
didYouMean: result.didyoumean,
|
|
141
|
+
email: result.email,
|
|
142
|
+
error: result.error,
|
|
143
|
+
executionTimeMilliseconds: result.executiontime,
|
|
144
|
+
free: result.free,
|
|
145
|
+
liveMode: result.livemode,
|
|
146
|
+
quality: result.quality || undefined,
|
|
147
|
+
result: result.result === "catch_all" ? "catchAll" : result.result || "error",
|
|
148
|
+
resultCode: result.resultcode,
|
|
149
|
+
role: result.role,
|
|
150
|
+
subresult: result.subresult,
|
|
151
|
+
}));
|
|
152
|
+
export const MILLIONVERIFIER_CREDITS_WIRE_SCHEMA = z
|
|
153
|
+
.looseObject({
|
|
154
|
+
bulk_credits: z.number().int().nonnegative(),
|
|
155
|
+
credits: z.number().int().nonnegative(),
|
|
156
|
+
plan: z.number().int(),
|
|
157
|
+
renewing_credits: z.number().int().nonnegative(),
|
|
158
|
+
})
|
|
159
|
+
.transform((credits) => MILLIONVERIFIER_CREDITS_SCHEMA.parse({
|
|
160
|
+
bulkCredits: credits.bulk_credits,
|
|
161
|
+
credits: credits.credits,
|
|
162
|
+
plan: credits.plan,
|
|
163
|
+
renewingCredits: credits.renewing_credits,
|
|
164
|
+
}));
|
|
165
|
+
/**
|
|
166
|
+
* Maps a provider file status to the public camelCase discriminator.
|
|
167
|
+
*
|
|
168
|
+
* @param status - Provider file status.
|
|
169
|
+
*/
|
|
170
|
+
function fromProviderFileStatus(status) {
|
|
171
|
+
if (status === "in_progress")
|
|
172
|
+
return "inProgress";
|
|
173
|
+
if (status === "in_queue_to_start")
|
|
174
|
+
return "inQueueToStart";
|
|
175
|
+
return status;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Maps a public file status to MillionVerifier's query value.
|
|
179
|
+
*
|
|
180
|
+
* @param status - Public file status.
|
|
181
|
+
*/
|
|
182
|
+
export function toMillionVerifierFileStatus(status) {
|
|
183
|
+
if (status === "inProgress")
|
|
184
|
+
return "in_progress";
|
|
185
|
+
if (status === "inQueueToStart")
|
|
186
|
+
return "in_queue_to_start";
|
|
187
|
+
return status;
|
|
188
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { Encodable } from "@automate.ax/codec";
|
|
2
|
+
import * as z from "zod";
|
|
3
|
+
/** Resolved TidyCal account accepted by the shared API client. */
|
|
4
|
+
export interface TidyCalResolvedAccount {
|
|
5
|
+
connectionMethodId: string;
|
|
6
|
+
secret: Record<string, unknown>;
|
|
7
|
+
serviceId: "tidycal";
|
|
8
|
+
}
|
|
9
|
+
/** Options for one authenticated TidyCal REST request. */
|
|
10
|
+
export interface TidyCalRequestOptions<TSchema extends z.ZodType> {
|
|
11
|
+
/** Public camelCase JSON body. */
|
|
12
|
+
body?: Encodable;
|
|
13
|
+
/** HTTP verb. Defaults to `GET`. */
|
|
14
|
+
method?: "DELETE" | "GET" | "PATCH" | "POST";
|
|
15
|
+
/** Public camelCase query parameters. */
|
|
16
|
+
query?: Record<string, boolean | number | string | undefined>;
|
|
17
|
+
/** Schema for the normalized provider response. */
|
|
18
|
+
responseSchema: TSchema;
|
|
19
|
+
}
|
|
20
|
+
/** Structured TidyCal REST error. */
|
|
21
|
+
export declare class TidyCalApiError extends Error {
|
|
22
|
+
/** Normalized provider error payload, when it was valid JSON. */
|
|
23
|
+
readonly body?: Encodable;
|
|
24
|
+
/** Retry delay in seconds, when TidyCal returned one. */
|
|
25
|
+
readonly retryAfter?: number;
|
|
26
|
+
/** HTTP status returned by TidyCal. */
|
|
27
|
+
readonly status: number;
|
|
28
|
+
/**
|
|
29
|
+
* Creates a structured error from one TidyCal response.
|
|
30
|
+
*
|
|
31
|
+
* @param options - Response status, provider body, and retry metadata.
|
|
32
|
+
* @param options.body - Normalized provider error payload.
|
|
33
|
+
* @param options.retryAfter - Retry delay in seconds.
|
|
34
|
+
* @param options.status - HTTP response status.
|
|
35
|
+
*/
|
|
36
|
+
constructor(options: {
|
|
37
|
+
body?: Encodable;
|
|
38
|
+
retryAfter?: number;
|
|
39
|
+
status: number;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Creates an authenticated TidyCal REST client.
|
|
44
|
+
*
|
|
45
|
+
* @param account - Resolved OAuth or personal-access-token account.
|
|
46
|
+
* @throws When the connection method or secret shape is unsupported.
|
|
47
|
+
*/
|
|
48
|
+
export declare function getTidyCalApi(account: TidyCalResolvedAccount): {
|
|
49
|
+
request: <TSchema extends z.ZodType>(path: string, options: TidyCalRequestOptions<TSchema>) => Promise<z.output<TSchema>>;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Converts public camelCase JSON to TidyCal wire keys.
|
|
53
|
+
*
|
|
54
|
+
* @param value - Codec-safe public value.
|
|
55
|
+
*/
|
|
56
|
+
export declare function toTidyCal(value: Encodable): Encodable;
|
|
57
|
+
/**
|
|
58
|
+
* Converts TidyCal wire JSON to public camelCase keys.
|
|
59
|
+
*
|
|
60
|
+
* @param value - Untrusted provider JSON value.
|
|
61
|
+
*/
|
|
62
|
+
export declare function fromTidyCal(value: unknown): unknown;
|