@automate.ax/integration-contracts 0.115.6 → 0.116.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/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/triggers.d.ts +2 -1
- package/package.json +8 -2
- 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/triggers.ts +2 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
/** Structured failure returned by MillionVerifier. */
|
|
3
|
+
export declare class MillionVerifierApiError extends Error {
|
|
4
|
+
/** Provider error classification or message. */
|
|
5
|
+
readonly code: string;
|
|
6
|
+
/** API path that failed. */
|
|
7
|
+
readonly path: string;
|
|
8
|
+
/** HTTP status returned by MillionVerifier. */
|
|
9
|
+
readonly status: number;
|
|
10
|
+
/**
|
|
11
|
+
* Creates a MillionVerifier provider error.
|
|
12
|
+
*
|
|
13
|
+
* @param options - Provider failure details.
|
|
14
|
+
* @param options.code - Provider error classification or message.
|
|
15
|
+
* @param options.path - API path that failed.
|
|
16
|
+
* @param options.status - HTTP status.
|
|
17
|
+
*/
|
|
18
|
+
constructor(options: {
|
|
19
|
+
code: string;
|
|
20
|
+
path: string;
|
|
21
|
+
status: number;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/** Query values accepted by the MillionVerifier request helper. */
|
|
25
|
+
export type MillionVerifierQueryValue = boolean | number | readonly (number | string)[] | string | undefined;
|
|
26
|
+
/** Options accepted by the authenticated MillionVerifier request helper. */
|
|
27
|
+
export interface MillionVerifierRequestOptions extends RequestInit {
|
|
28
|
+
/** Selects the real-time or bulk API origin and credential parameter. */
|
|
29
|
+
api: "bulk" | "single";
|
|
30
|
+
/** Query parameters appended to the request URL. */
|
|
31
|
+
query?: Record<string, MillionVerifierQueryValue>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Creates an authenticated MillionVerifier HTTP client.
|
|
35
|
+
*
|
|
36
|
+
* @param secret - Resolved MillionVerifier integration secret.
|
|
37
|
+
*/
|
|
38
|
+
export declare function getMillionVerifierApi(secret: Record<string, unknown>): {
|
|
39
|
+
/**
|
|
40
|
+
* Sends an authenticated request to a MillionVerifier API.
|
|
41
|
+
*
|
|
42
|
+
* @param path - Absolute-path provider endpoint.
|
|
43
|
+
* @param options - API selection, native fetch options, and query values.
|
|
44
|
+
*/
|
|
45
|
+
request(path: string, options: MillionVerifierRequestOptions): Promise<Response>;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Parses a JSON response and rejects MillionVerifier logical errors.
|
|
49
|
+
*
|
|
50
|
+
* The provider returns HTTP 200 for authentication, credit, file, and filter
|
|
51
|
+
* failures, so callers must inspect every JSON body.
|
|
52
|
+
*
|
|
53
|
+
* @param response - Successful transport response.
|
|
54
|
+
* @param path - API path used in a structured failure.
|
|
55
|
+
* @param schema - Expected success payload.
|
|
56
|
+
* @param options - Parsing exceptions for complete resource payloads.
|
|
57
|
+
* @param options.acceptErrorFieldWhenValid - Accepts a schema-valid resource
|
|
58
|
+
* with provider error details.
|
|
59
|
+
*/
|
|
60
|
+
export declare function parseMillionVerifierJson<TSchema extends z.ZodType>(response: Response, path: string, schema: TSchema, options?: {
|
|
61
|
+
acceptErrorFieldWhenValid?: boolean;
|
|
62
|
+
}): Promise<z.output<TSchema>>;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
const MILLIONVERIFIER_SECRET_SCHEMA = z.object({ apiKey: z.string().min(1) });
|
|
3
|
+
const MILLIONVERIFIER_ERROR_SCHEMA = z.looseObject({
|
|
4
|
+
error: z.string().optional(),
|
|
5
|
+
result: z.string().optional(),
|
|
6
|
+
});
|
|
7
|
+
/** Structured failure returned by MillionVerifier. */
|
|
8
|
+
export class MillionVerifierApiError extends Error {
|
|
9
|
+
/** Provider error classification or message. */
|
|
10
|
+
code;
|
|
11
|
+
/** API path that failed. */
|
|
12
|
+
path;
|
|
13
|
+
/** HTTP status returned by MillionVerifier. */
|
|
14
|
+
status;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a MillionVerifier provider error.
|
|
17
|
+
*
|
|
18
|
+
* @param options - Provider failure details.
|
|
19
|
+
* @param options.code - Provider error classification or message.
|
|
20
|
+
* @param options.path - API path that failed.
|
|
21
|
+
* @param options.status - HTTP status.
|
|
22
|
+
*/
|
|
23
|
+
constructor(options) {
|
|
24
|
+
super(`MillionVerifier ${options.path} failed: ${options.code}`);
|
|
25
|
+
this.name = "MillionVerifierApiError";
|
|
26
|
+
this.code = options.code;
|
|
27
|
+
this.path = options.path;
|
|
28
|
+
this.status = options.status;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Creates an authenticated MillionVerifier HTTP client.
|
|
33
|
+
*
|
|
34
|
+
* @param secret - Resolved MillionVerifier integration secret.
|
|
35
|
+
*/
|
|
36
|
+
export function getMillionVerifierApi(secret) {
|
|
37
|
+
const { apiKey } = MILLIONVERIFIER_SECRET_SCHEMA.parse(secret);
|
|
38
|
+
return {
|
|
39
|
+
/**
|
|
40
|
+
* Sends an authenticated request to a MillionVerifier API.
|
|
41
|
+
*
|
|
42
|
+
* @param path - Absolute-path provider endpoint.
|
|
43
|
+
* @param options - API selection, native fetch options, and query values.
|
|
44
|
+
*/
|
|
45
|
+
async request(path, options) {
|
|
46
|
+
const { api, query, ...requestInit } = options;
|
|
47
|
+
const url = new URL(path, api === "single"
|
|
48
|
+
? "https://api.millionverifier.com"
|
|
49
|
+
: "https://bulkapi.millionverifier.com");
|
|
50
|
+
url.searchParams.set(api === "single" ? "api" : "key", apiKey);
|
|
51
|
+
for (const [key, value] of Object.entries(query ?? {})) {
|
|
52
|
+
if (value === undefined)
|
|
53
|
+
continue;
|
|
54
|
+
url.searchParams.set(key, Array.isArray(value) ? value.join(",") : String(value));
|
|
55
|
+
}
|
|
56
|
+
const response = await fetch(url, requestInit);
|
|
57
|
+
if (!response.ok) {
|
|
58
|
+
throw new MillionVerifierApiError({
|
|
59
|
+
code: await providerError(response),
|
|
60
|
+
path,
|
|
61
|
+
status: response.status,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return response;
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Parses a JSON response and rejects MillionVerifier logical errors.
|
|
70
|
+
*
|
|
71
|
+
* The provider returns HTTP 200 for authentication, credit, file, and filter
|
|
72
|
+
* failures, so callers must inspect every JSON body.
|
|
73
|
+
*
|
|
74
|
+
* @param response - Successful transport response.
|
|
75
|
+
* @param path - API path used in a structured failure.
|
|
76
|
+
* @param schema - Expected success payload.
|
|
77
|
+
* @param options - Parsing exceptions for complete resource payloads.
|
|
78
|
+
* @param options.acceptErrorFieldWhenValid - Accepts a schema-valid resource
|
|
79
|
+
* with provider error details.
|
|
80
|
+
*/
|
|
81
|
+
export async function parseMillionVerifierJson(response, path, schema, options) {
|
|
82
|
+
const value = await response.json();
|
|
83
|
+
if (options?.acceptErrorFieldWhenValid) {
|
|
84
|
+
const result = schema.safeParse(value);
|
|
85
|
+
if (result.success)
|
|
86
|
+
return result.data;
|
|
87
|
+
}
|
|
88
|
+
const failure = MILLIONVERIFIER_ERROR_SCHEMA.safeParse(value);
|
|
89
|
+
if (failure.success &&
|
|
90
|
+
failure.data.error &&
|
|
91
|
+
failure.data.error.trim().length > 0) {
|
|
92
|
+
throw new MillionVerifierApiError({
|
|
93
|
+
code: failure.data.error,
|
|
94
|
+
path,
|
|
95
|
+
status: response.status,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return schema.parse(value);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Extracts the most useful provider error from an unsuccessful response.
|
|
102
|
+
*
|
|
103
|
+
* @param response - Provider response to inspect.
|
|
104
|
+
*/
|
|
105
|
+
async function providerError(response) {
|
|
106
|
+
const text = await response.text();
|
|
107
|
+
try {
|
|
108
|
+
const failure = MILLIONVERIFIER_ERROR_SCHEMA.parse(JSON.parse(text));
|
|
109
|
+
return failure.error || failure.result || `HTTP ${response.status}`;
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
return text.trim() || `HTTP ${response.status}`;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const MILLIONVERIFIER_NO_CREDIT_EVENT_SCHEMA: z.ZodObject<{
|
|
3
|
+
reason: z.ZodLiteral<"noCredit">;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export declare const MILLIONVERIFIER_LOW_CREDIT_EVENT_SCHEMA: z.ZodObject<{
|
|
6
|
+
credits: z.ZodNumber;
|
|
7
|
+
reason: z.ZodLiteral<"lowCredit">;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export declare const MILLIONVERIFIER_FILE_READY_EVENT_SCHEMA: z.ZodObject<{
|
|
10
|
+
file: z.ZodObject<{
|
|
11
|
+
catchAll: z.ZodNumber;
|
|
12
|
+
disposable: z.ZodNumber;
|
|
13
|
+
fileId: z.ZodString;
|
|
14
|
+
fileName: z.ZodString;
|
|
15
|
+
invalid: z.ZodNumber;
|
|
16
|
+
ok: z.ZodNumber;
|
|
17
|
+
totalRows: z.ZodNumber;
|
|
18
|
+
uniqueEmails: z.ZodNumber;
|
|
19
|
+
unknown: z.ZodNumber;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
reason: z.ZodLiteral<"fileReady">;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export declare const MILLIONVERIFIER_FILE_DELETION_SCHEDULED_EVENT_SCHEMA: z.ZodObject<{
|
|
24
|
+
file: z.ZodObject<{
|
|
25
|
+
deletesIn: z.ZodString;
|
|
26
|
+
fileId: z.ZodString;
|
|
27
|
+
fileName: z.ZodString;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
reason: z.ZodLiteral<"fileDeletionScheduled">;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
export declare const MILLIONVERIFIER_EVENT_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
32
|
+
reason: z.ZodLiteral<"noCredit">;
|
|
33
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
34
|
+
credits: z.ZodNumber;
|
|
35
|
+
reason: z.ZodLiteral<"lowCredit">;
|
|
36
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
37
|
+
file: z.ZodObject<{
|
|
38
|
+
catchAll: z.ZodNumber;
|
|
39
|
+
disposable: z.ZodNumber;
|
|
40
|
+
fileId: z.ZodString;
|
|
41
|
+
fileName: z.ZodString;
|
|
42
|
+
invalid: z.ZodNumber;
|
|
43
|
+
ok: z.ZodNumber;
|
|
44
|
+
totalRows: z.ZodNumber;
|
|
45
|
+
uniqueEmails: z.ZodNumber;
|
|
46
|
+
unknown: z.ZodNumber;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
reason: z.ZodLiteral<"fileReady">;
|
|
49
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
+
file: z.ZodObject<{
|
|
51
|
+
deletesIn: z.ZodString;
|
|
52
|
+
fileId: z.ZodString;
|
|
53
|
+
fileName: z.ZodString;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
reason: z.ZodLiteral<"fileDeletionScheduled">;
|
|
56
|
+
}, z.core.$strip>], "reason">;
|
|
57
|
+
export declare const MILLIONVERIFIER_WEBHOOK_WIRE_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
58
|
+
reason: z.ZodLiteral<"no_credit">;
|
|
59
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
60
|
+
credits: z.ZodNumber;
|
|
61
|
+
reason: z.ZodLiteral<"low_credit">;
|
|
62
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
63
|
+
file: z.ZodObject<{
|
|
64
|
+
catch_all: z.ZodNumber;
|
|
65
|
+
disposable: z.ZodNumber;
|
|
66
|
+
file_id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
67
|
+
file_name: z.ZodString;
|
|
68
|
+
invalid: z.ZodNumber;
|
|
69
|
+
ok: z.ZodNumber;
|
|
70
|
+
total_rows: z.ZodNumber;
|
|
71
|
+
unique_emails: z.ZodNumber;
|
|
72
|
+
unknown: z.ZodNumber;
|
|
73
|
+
}, z.core.$loose>;
|
|
74
|
+
reason: z.ZodLiteral<"file_ready">;
|
|
75
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
76
|
+
file: z.ZodObject<{
|
|
77
|
+
file_delete: z.ZodString;
|
|
78
|
+
file_id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
79
|
+
file_name: z.ZodString;
|
|
80
|
+
}, z.core.$loose>;
|
|
81
|
+
reason: z.ZodLiteral<"file_delete">;
|
|
82
|
+
}, z.core.$loose>], "reason">;
|
|
83
|
+
/**
|
|
84
|
+
* Normalizes one documented MillionVerifier notification payload.
|
|
85
|
+
*
|
|
86
|
+
* @param value - Untrusted provider callback payload.
|
|
87
|
+
*/
|
|
88
|
+
export declare function normalizeMillionVerifierEvent(value: unknown): {
|
|
89
|
+
reason: "noCredit";
|
|
90
|
+
credits?: undefined;
|
|
91
|
+
file?: undefined;
|
|
92
|
+
} | {
|
|
93
|
+
credits: number;
|
|
94
|
+
reason: "lowCredit";
|
|
95
|
+
file?: undefined;
|
|
96
|
+
} | {
|
|
97
|
+
file: {
|
|
98
|
+
deletesIn: string;
|
|
99
|
+
fileId: string;
|
|
100
|
+
fileName: string;
|
|
101
|
+
catchAll?: undefined;
|
|
102
|
+
disposable?: undefined;
|
|
103
|
+
invalid?: undefined;
|
|
104
|
+
ok?: undefined;
|
|
105
|
+
totalRows?: undefined;
|
|
106
|
+
uniqueEmails?: undefined;
|
|
107
|
+
unknown?: undefined;
|
|
108
|
+
};
|
|
109
|
+
reason: "fileDeletionScheduled";
|
|
110
|
+
credits?: undefined;
|
|
111
|
+
} | {
|
|
112
|
+
file: {
|
|
113
|
+
catchAll: number;
|
|
114
|
+
disposable: number;
|
|
115
|
+
fileId: string;
|
|
116
|
+
fileName: string;
|
|
117
|
+
invalid: number;
|
|
118
|
+
ok: number;
|
|
119
|
+
totalRows: number;
|
|
120
|
+
uniqueEmails: number;
|
|
121
|
+
unknown: number;
|
|
122
|
+
deletesIn?: undefined;
|
|
123
|
+
};
|
|
124
|
+
reason: "fileReady";
|
|
125
|
+
credits?: undefined;
|
|
126
|
+
};
|
|
@@ -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
|
+
};
|