@qawolf/emailer-types 1.0.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/LICENSE +21 -0
- package/README.md +13 -0
- package/dist/getNamedAddress.d.ts +12 -0
- package/dist/getNamedAddress.d.ts.map +1 -0
- package/dist/getNamedAddress.js +18 -0
- package/dist/getNamedAddress.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/trpc/address.d.ts +50 -0
- package/dist/trpc/address.d.ts.map +1 -0
- package/dist/trpc/address.js +43 -0
- package/dist/trpc/address.js.map +1 -0
- package/dist/trpc/domains.d.ts +10 -0
- package/dist/trpc/domains.d.ts.map +1 -0
- package/dist/trpc/domains.js +9 -0
- package/dist/trpc/domains.js.map +1 -0
- package/dist/trpc/emails/base.d.ts +61 -0
- package/dist/trpc/emails/base.d.ts.map +1 -0
- package/dist/trpc/emails/base.js +79 -0
- package/dist/trpc/emails/base.js.map +1 -0
- package/dist/trpc/emails/delete.d.ts +17 -0
- package/dist/trpc/emails/delete.d.ts.map +1 -0
- package/dist/trpc/emails/delete.js +12 -0
- package/dist/trpc/emails/delete.js.map +1 -0
- package/dist/trpc/emails/index.d.ts +7 -0
- package/dist/trpc/emails/index.d.ts.map +1 -0
- package/dist/trpc/emails/index.js +7 -0
- package/dist/trpc/emails/index.js.map +1 -0
- package/dist/trpc/emails/query.d.ts +87 -0
- package/dist/trpc/emails/query.d.ts.map +1 -0
- package/dist/trpc/emails/query.js +29 -0
- package/dist/trpc/emails/query.js.map +1 -0
- package/dist/trpc/emails/receive.d.ts +82 -0
- package/dist/trpc/emails/receive.d.ts.map +1 -0
- package/dist/trpc/emails/receive.js +86 -0
- package/dist/trpc/emails/receive.js.map +1 -0
- package/dist/trpc/emails/schemaUtils.d.ts +4 -0
- package/dist/trpc/emails/schemaUtils.d.ts.map +1 -0
- package/dist/trpc/emails/schemaUtils.js +35 -0
- package/dist/trpc/emails/schemaUtils.js.map +1 -0
- package/dist/trpc/emails/search.d.ts +62 -0
- package/dist/trpc/emails/search.d.ts.map +1 -0
- package/dist/trpc/emails/search.js +19 -0
- package/dist/trpc/emails/search.js.map +1 -0
- package/dist/trpc/emails/send.d.ts +48 -0
- package/dist/trpc/emails/send.d.ts.map +1 -0
- package/dist/trpc/emails/send.js +9 -0
- package/dist/trpc/emails/send.js.map +1 -0
- package/dist/trpc/index.d.ts +6 -0
- package/dist/trpc/index.d.ts.map +1 -0
- package/dist/trpc/index.js +6 -0
- package/dist/trpc/index.js.map +1 -0
- package/dist/trpc/owners.d.ts +38 -0
- package/dist/trpc/owners.d.ts.map +1 -0
- package/dist/trpc/owners.js +15 -0
- package/dist/trpc/owners.js.map +1 -0
- package/dist/trpc/probes.d.ts +15 -0
- package/dist/trpc/probes.d.ts.map +1 -0
- package/dist/trpc/probes.js +9 -0
- package/dist/trpc/probes.js.map +1 -0
- package/package.json +48 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 QA Wolf Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# @qawolf/emailer-types
|
|
2
|
+
|
|
3
|
+
`@qawolf/emailer-types` is a companion package for `@qawolf/emails`. It provides
|
|
4
|
+
shared emailer types and helpers used by the QA Wolf email libraries.
|
|
5
|
+
|
|
6
|
+
Most users should start with the
|
|
7
|
+
[`@qawolf/emails` documentation](https://docs.qawolf.com/qawolf/libraries/emails).
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install @qawolf/emailer-types
|
|
13
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type NamedAddress } from "./trpc/emails/base.js";
|
|
2
|
+
/**
|
|
3
|
+
* Extract email address from a string in the following format: "Name Surname <email@hostname>".
|
|
4
|
+
* If the string is in the format "email@hostname", the name will be undefined.
|
|
5
|
+
*
|
|
6
|
+
* SORCE-1353 - consider making this compatible with RFC 5322
|
|
7
|
+
*
|
|
8
|
+
* @param input The string to extract email address from.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getNamedAddress: (input: string) => NamedAddress;
|
|
11
|
+
export declare const getNamedAddressAsString: (input: NamedAddress) => string;
|
|
12
|
+
//# sourceMappingURL=getNamedAddress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getNamedAddress.d.ts","sourceRoot":"","sources":["../src/getNamedAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAElB,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,KAAG,YAE/C,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,OAAO,YAAY,KAAG,MAI7D,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { StringToNamedAddressSchema, } from "./trpc/emails/base.js";
|
|
2
|
+
/**
|
|
3
|
+
* Extract email address from a string in the following format: "Name Surname <email@hostname>".
|
|
4
|
+
* If the string is in the format "email@hostname", the name will be undefined.
|
|
5
|
+
*
|
|
6
|
+
* SORCE-1353 - consider making this compatible with RFC 5322
|
|
7
|
+
*
|
|
8
|
+
* @param input The string to extract email address from.
|
|
9
|
+
*/
|
|
10
|
+
export const getNamedAddress = (input) => {
|
|
11
|
+
return StringToNamedAddressSchema.parse(input);
|
|
12
|
+
};
|
|
13
|
+
export const getNamedAddressAsString = (input) => {
|
|
14
|
+
if (input.name)
|
|
15
|
+
return `${input.name} <${input.address}>`;
|
|
16
|
+
return input.address;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=getNamedAddress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getNamedAddress.js","sourceRoot":"","sources":["../src/getNamedAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAa,EAAgB,EAAE;IAC7D,OAAO,0BAA0B,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACjD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,KAAmB,EAAU,EAAE;IACrE,IAAI,KAAK,CAAC,IAAI;QAAE,OAAO,GAAG,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,GAAG,CAAC;IAE1D,OAAO,KAAK,CAAC,OAAO,CAAC;AACvB,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const addressErrorMessages: {
|
|
3
|
+
defaultAddressDeletionAttempted: string;
|
|
4
|
+
usageOfAnotherTeamAddressAttempted: string;
|
|
5
|
+
usageOfUnknownDomain: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const upsertAddressInputSchema: z.ZodObject<{
|
|
8
|
+
emailAddress: z.ZodEmail;
|
|
9
|
+
isDefault: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
10
|
+
isTemporary: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
11
|
+
ownerId: z.ZodString;
|
|
12
|
+
upsertOwner: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type UpsertAddressInput = z.infer<typeof upsertAddressInputSchema>;
|
|
15
|
+
export declare const upsertAddressOutputSchema: z.ZodObject<{
|
|
16
|
+
emailAddress: z.ZodEmail;
|
|
17
|
+
isDefault: z.ZodBoolean;
|
|
18
|
+
isTemporary: z.ZodBoolean;
|
|
19
|
+
ownerId: z.ZodString;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export type UpsertAddressOutput = z.infer<typeof upsertAddressOutputSchema>;
|
|
22
|
+
export declare const queryAddressesInputSchema: z.ZodObject<{
|
|
23
|
+
constraints: z.ZodOptional<z.ZodObject<{
|
|
24
|
+
cursor: z.ZodOptional<z.ZodObject<{
|
|
25
|
+
emailAddress: z.ZodString;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
}, z.core.$strip>>;
|
|
29
|
+
emailAddress: z.ZodOptional<z.ZodEmail>;
|
|
30
|
+
isDefault: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
isTemporary: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
ownerId: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
export type QueryAddressesInput = z.infer<typeof queryAddressesInputSchema>;
|
|
35
|
+
export declare const queryAddressesOutputSchema: z.ZodArray<z.ZodObject<{
|
|
36
|
+
emailAddress: z.ZodEmail;
|
|
37
|
+
isDefault: z.ZodBoolean;
|
|
38
|
+
isTemporary: z.ZodBoolean;
|
|
39
|
+
ownerId: z.ZodString;
|
|
40
|
+
}, z.core.$strip>>;
|
|
41
|
+
export type QueryAddressesOutput = z.infer<typeof queryAddressesOutputSchema>;
|
|
42
|
+
export declare const deleteAddressInputSchema: z.ZodObject<{
|
|
43
|
+
emailAddress: z.ZodEmail;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export type DeleteAddressInput = z.infer<typeof deleteAddressInputSchema>;
|
|
46
|
+
export declare const deleteAddressOutputSchema: z.ZodObject<{
|
|
47
|
+
emailAddress: z.ZodEmail;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export type DeleteAddressOutput = z.infer<typeof deleteAddressOutputSchema>;
|
|
50
|
+
//# sourceMappingURL=address.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/trpc/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB;;;;CAKhC,CAAC;AAMF,eAAO,MAAM,wBAAwB;;;;;;iBAOpC,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAU1E,eAAO,MAAM,yBAAyB;;;;;iBAAsB,CAAC;AAC7D,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,yBAAyB;;;;;;;;;;;iBAoBnC,CAAC;AACJ,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,0BAA0B;;;;;kBAA+B,CAAC;AACvE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,wBAAwB;;iBAA0B,CAAC;AAChE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,yBAAyB;;iBAA0B,CAAC;AACjE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const addressErrorMessages = {
|
|
3
|
+
defaultAddressDeletionAttempted: "Please mark another address as default first.",
|
|
4
|
+
usageOfAnotherTeamAddressAttempted: "Address is used by another team.",
|
|
5
|
+
usageOfUnknownDomain: "Address domain name is not allowed.",
|
|
6
|
+
};
|
|
7
|
+
const addressIdentifierSchema = z.object({
|
|
8
|
+
emailAddress: z.email(),
|
|
9
|
+
});
|
|
10
|
+
export const upsertAddressInputSchema = addressIdentifierSchema.merge(z.object({
|
|
11
|
+
isDefault: z.boolean().default(false).optional(),
|
|
12
|
+
isTemporary: z.boolean().default(false).optional(),
|
|
13
|
+
ownerId: z.string(),
|
|
14
|
+
upsertOwner: z.boolean().default(false).optional(),
|
|
15
|
+
}));
|
|
16
|
+
const addressOutputSchema = addressIdentifierSchema.merge(z.object({
|
|
17
|
+
isDefault: z.boolean(),
|
|
18
|
+
isTemporary: z.boolean(),
|
|
19
|
+
ownerId: z.string(),
|
|
20
|
+
}));
|
|
21
|
+
export const upsertAddressOutputSchema = addressOutputSchema;
|
|
22
|
+
export const queryAddressesInputSchema = z
|
|
23
|
+
.object({
|
|
24
|
+
constraints: z
|
|
25
|
+
.object({
|
|
26
|
+
cursor: z
|
|
27
|
+
.object({
|
|
28
|
+
emailAddress: z.string(),
|
|
29
|
+
})
|
|
30
|
+
.optional(),
|
|
31
|
+
limit: z.number().optional(),
|
|
32
|
+
})
|
|
33
|
+
.optional(),
|
|
34
|
+
emailAddress: z.email().optional(),
|
|
35
|
+
isDefault: z.boolean().optional(),
|
|
36
|
+
isTemporary: z.boolean().optional(),
|
|
37
|
+
ownerId: z.string().optional(),
|
|
38
|
+
})
|
|
39
|
+
.refine((data) => data.emailAddress || data.ownerId, "either emailAddress or ownerId must be provided");
|
|
40
|
+
export const queryAddressesOutputSchema = z.array(addressOutputSchema);
|
|
41
|
+
export const deleteAddressInputSchema = addressIdentifierSchema;
|
|
42
|
+
export const deleteAddressOutputSchema = addressIdentifierSchema;
|
|
43
|
+
//# sourceMappingURL=address.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src/trpc/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,+BAA+B,EAC7B,+CAA+C;IACjD,kCAAkC,EAAE,kCAAkC;IACtE,oBAAoB,EAAE,qCAAqC;CAC5D,CAAC;AAEF,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,YAAY,EAAE,CAAC,CAAC,KAAK,EAAE;CACxB,CAAC,CA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,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC;KACD,MAAM,CACL,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,OAAO,EAC3C,iDAAiD,CAClD,CAAC;AAGJ,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;AAGvE,MAAM,CAAC,MAAM,wBAAwB,GAAG,uBAAuB,CAAC;AAGhE,MAAM,CAAC,MAAM,yBAAyB,GAAG,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const queryDomainsInputSchema: z.ZodObject<{
|
|
3
|
+
ownerId: z.ZodString;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export type QueryDomainsInput = z.infer<typeof queryDomainsInputSchema>;
|
|
6
|
+
export declare const queryDomainsOutputSchema: z.ZodArray<z.ZodObject<{
|
|
7
|
+
domain: z.ZodString;
|
|
8
|
+
}, z.core.$strip>>;
|
|
9
|
+
export type QueryDomainsOutput = z.infer<typeof queryDomainsOutputSchema>;
|
|
10
|
+
//# sourceMappingURL=domains.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domains.d.ts","sourceRoot":"","sources":["../../src/trpc/domains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,wBAAwB;;kBAAkC,CAAC;AACxE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const domainIdentifierSchema = z.object({
|
|
3
|
+
domain: z.string(),
|
|
4
|
+
});
|
|
5
|
+
export const queryDomainsInputSchema = z.object({
|
|
6
|
+
ownerId: z.string(),
|
|
7
|
+
});
|
|
8
|
+
export const queryDomainsOutputSchema = z.array(domainIdentifierSchema);
|
|
9
|
+
//# sourceMappingURL=domains.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domains.js","sourceRoot":"","sources":["../../src/trpc/domains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;CACnB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const NamedAddressSchema: z.ZodObject<{
|
|
3
|
+
address: z.ZodString;
|
|
4
|
+
name: z.ZodOptional<z.ZodString>;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export type NamedAddress = z.infer<typeof NamedAddressSchema>;
|
|
7
|
+
export declare const StringToNamedAddressSchema: z.ZodPipe<z.ZodString, z.ZodTransform<{
|
|
8
|
+
address: string;
|
|
9
|
+
name: string;
|
|
10
|
+
} | {
|
|
11
|
+
address: string;
|
|
12
|
+
name?: undefined;
|
|
13
|
+
}, string>>;
|
|
14
|
+
export declare const baseEmailSchema: z.ZodObject<{
|
|
15
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
16
|
+
contentBase64: z.ZodString;
|
|
17
|
+
contentId: z.ZodOptional<z.ZodString>;
|
|
18
|
+
disposition: z.ZodOptional<z.ZodEnum<{
|
|
19
|
+
attachment: "attachment";
|
|
20
|
+
inline: "inline";
|
|
21
|
+
}>>;
|
|
22
|
+
fileName: z.ZodString;
|
|
23
|
+
type: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, z.core.$strip>>>;
|
|
25
|
+
bcc: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
26
|
+
address: z.ZodString;
|
|
27
|
+
name: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, z.core.$strip>>>;
|
|
29
|
+
cc: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
30
|
+
address: z.ZodString;
|
|
31
|
+
name: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, z.core.$strip>>>;
|
|
33
|
+
from: z.ZodObject<{
|
|
34
|
+
address: z.ZodString;
|
|
35
|
+
name: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
html: z.ZodOptional<z.ZodString>;
|
|
38
|
+
ownerId: z.ZodString;
|
|
39
|
+
ownerType: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
40
|
+
TEAM: "TEAM";
|
|
41
|
+
}>>>;
|
|
42
|
+
replyTo: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
43
|
+
address: z.ZodString;
|
|
44
|
+
name: z.ZodOptional<z.ZodString>;
|
|
45
|
+
}, z.core.$strip>>>;
|
|
46
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
47
|
+
text: z.ZodOptional<z.ZodString>;
|
|
48
|
+
to: z.ZodArray<z.ZodObject<{
|
|
49
|
+
address: z.ZodString;
|
|
50
|
+
name: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, z.core.$strip>>;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
export declare const dateSchema: z.ZodString;
|
|
54
|
+
export declare const dateRangeSchema: z.ZodObject<{
|
|
55
|
+
after: z.ZodOptional<z.ZodString>;
|
|
56
|
+
at: z.ZodOptional<z.ZodString>;
|
|
57
|
+
atOrAfter: z.ZodOptional<z.ZodString>;
|
|
58
|
+
atOrBefore: z.ZodOptional<z.ZodString>;
|
|
59
|
+
before: z.ZodOptional<z.ZodString>;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/trpc/emails/base.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,eAAO,MAAM,kBAAkB;;;iBAK7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,0BAA0B;;;;;;WAgBrC,CAAC;AAaH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgCzB,CAAC;AAEJ,eAAO,MAAM,UAAU,aAAwC,CAAC;AAEhE,eAAO,MAAM,eAAe;;;;;;iBAYzB,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import emailAddresses from "email-addresses";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
/**
|
|
4
|
+
* This does not guarantee RFC 5322 compliance, but should at least cover most
|
|
5
|
+
* common cases and ensure one @ is included. Note that a valid email address
|
|
6
|
+
* can include a quoted @, but that is not common in practice.
|
|
7
|
+
*
|
|
8
|
+
* Not vulnerable to ReDoS. If you change this, please verify at https://devina.io/redos-checker
|
|
9
|
+
*
|
|
10
|
+
* Beware that this may not align with SendGrid's validation, which may or may
|
|
11
|
+
* not be more strict.
|
|
12
|
+
*/
|
|
13
|
+
const minimalEmailRegex = /^[^@]+@[^@]+$/;
|
|
14
|
+
export const NamedAddressSchema = z.object({
|
|
15
|
+
address: z.string().refine((value) => minimalEmailRegex.test(value), {
|
|
16
|
+
message: "Invalid email address",
|
|
17
|
+
}),
|
|
18
|
+
name: z.string().optional(),
|
|
19
|
+
});
|
|
20
|
+
export const StringToNamedAddressSchema = z.string().transform((value, ctx) => {
|
|
21
|
+
const parsedAddress = emailAddresses.parseOneAddress({
|
|
22
|
+
atInDisplayName: true,
|
|
23
|
+
input: value,
|
|
24
|
+
});
|
|
25
|
+
if (!parsedAddress || parsedAddress.type === "group") {
|
|
26
|
+
ctx.addIssue({
|
|
27
|
+
code: z.ZodIssueCode.custom,
|
|
28
|
+
message: `Invalid email address: ${value}`,
|
|
29
|
+
});
|
|
30
|
+
return z.NEVER;
|
|
31
|
+
}
|
|
32
|
+
const { address, name } = parsedAddress;
|
|
33
|
+
return name ? { address, name } : { address };
|
|
34
|
+
});
|
|
35
|
+
// Receive endpoint is used by Sendgrid, and it uses multipart/form-data which is not supported by tRPC.
|
|
36
|
+
// See https://github.com/trpc/trpc/discussions/658 for more details.
|
|
37
|
+
/**
|
|
38
|
+
* regex pulled from https://stackoverflow.com/questions/475074/regex-to-parse-or-validate-base64-data
|
|
39
|
+
* however it does not validate that the string is not empty, so we just do that in another refine option
|
|
40
|
+
* the previous regex /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$/ would runaway and
|
|
41
|
+
* catastrophically backtrace on large strings
|
|
42
|
+
*/
|
|
43
|
+
const base64RegExp = /^[-A-Za-z0-9+/]*={0,3}$/;
|
|
44
|
+
export const baseEmailSchema = z
|
|
45
|
+
.object({
|
|
46
|
+
attachments: z
|
|
47
|
+
.array(z.object({
|
|
48
|
+
contentBase64: z
|
|
49
|
+
.string()
|
|
50
|
+
.refine((s) => base64RegExp.test(s), "contentBase64 is required to be base64-encoded"),
|
|
51
|
+
contentId: z.string().optional(),
|
|
52
|
+
disposition: z.enum(["attachment", "inline"]).optional(),
|
|
53
|
+
fileName: z.string(),
|
|
54
|
+
type: z.string().optional(),
|
|
55
|
+
}))
|
|
56
|
+
.optional(),
|
|
57
|
+
bcc: z.array(NamedAddressSchema).optional(),
|
|
58
|
+
cc: z.array(NamedAddressSchema).optional(),
|
|
59
|
+
from: NamedAddressSchema,
|
|
60
|
+
html: z.string().optional(),
|
|
61
|
+
ownerId: z.string(),
|
|
62
|
+
ownerType: z.enum(["TEAM"]).optional().default("TEAM"),
|
|
63
|
+
replyTo: z.array(NamedAddressSchema).optional(),
|
|
64
|
+
subject: z.string().optional(),
|
|
65
|
+
text: z.string().optional(),
|
|
66
|
+
to: z.array(NamedAddressSchema),
|
|
67
|
+
})
|
|
68
|
+
.refine((data) => data.html || data.text, "You must provide text, html, or both");
|
|
69
|
+
export const dateSchema = z.string().datetime({ offset: true });
|
|
70
|
+
export const dateRangeSchema = z
|
|
71
|
+
.object({
|
|
72
|
+
after: dateSchema.optional(),
|
|
73
|
+
at: dateSchema.optional(),
|
|
74
|
+
atOrAfter: dateSchema.optional(),
|
|
75
|
+
atOrBefore: dateSchema.optional(),
|
|
76
|
+
before: dateSchema.optional(),
|
|
77
|
+
})
|
|
78
|
+
.refine((data) => data.after || data.at || data.before || data.atOrAfter || data.atOrBefore, "at least one of the fields must be set: after, at, before or atOrAfter, atOrBefore");
|
|
79
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/trpc/emails/base.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;GASG;AACH,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAE1C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;QACnE,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AE,EAAE,UAAU,CAAC,QAAQ,EAAE;IACzB,SAAS,EAAE,UAAU,CAAC,QAAQ,EAAE;IAChC,UAAU,EAAE,UAAU,CAAC,QAAQ,EAAE;IACjC,MAAM,EAAE,UAAU,CAAC,QAAQ,EAAE;CAC9B,CAAC;KACD,MAAM,CACL,CAAC,IAAI,EAAE,EAAE,CACP,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,UAAU,EAC3E,oFAAoF,CACrF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const deleteEmailsInputSchema: z.ZodObject<{
|
|
3
|
+
createdAt: z.ZodOptional<z.ZodObject<{
|
|
4
|
+
after: z.ZodOptional<z.ZodString>;
|
|
5
|
+
at: z.ZodOptional<z.ZodString>;
|
|
6
|
+
atOrAfter: z.ZodOptional<z.ZodString>;
|
|
7
|
+
atOrBefore: z.ZodOptional<z.ZodString>;
|
|
8
|
+
before: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, z.core.$strip>>;
|
|
10
|
+
id: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export type DeleteEmailsInput = z.infer<typeof deleteEmailsInputSchema>;
|
|
13
|
+
export declare const deleteEmailsOutputSchema: z.ZodObject<{
|
|
14
|
+
count: z.ZodNumber;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export type DeleteEmailsOutput = z.infer<typeof deleteEmailsOutputSchema>;
|
|
17
|
+
//# sourceMappingURL=delete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/trpc/emails/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,uBAAuB;;;;;;;;;iBAQjC,CAAC;AACJ,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,eAAO,MAAM,wBAAwB;;iBAEnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { dateRangeSchema } from "./base.js";
|
|
3
|
+
export const deleteEmailsInputSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
createdAt: dateRangeSchema.optional(),
|
|
6
|
+
id: z.string().optional(),
|
|
7
|
+
})
|
|
8
|
+
.refine((data) => data.id || data.createdAt, "either id or createdAt must be provided");
|
|
9
|
+
export const deleteEmailsOutputSchema = z.object({
|
|
10
|
+
count: z.number(),
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/trpc/emails/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC;KACrC,MAAM,CAAC;IACN,SAAS,EAAE,eAAe,CAAC,QAAQ,EAAE;IACrC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC1B,CAAC;KACD,MAAM,CACL,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,SAAS,EACnC,yCAAyC,CAC1C,CAAC;AAEJ,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/trpc/emails/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/trpc/emails/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const queryEmailsFilterSchema: z.ZodObject<{
|
|
3
|
+
constraints: z.ZodOptional<z.ZodObject<{
|
|
4
|
+
cursor: z.ZodOptional<z.ZodObject<{
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
}, z.core.$strip>>;
|
|
7
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
}, z.core.$strip>>;
|
|
9
|
+
createdAt: z.ZodOptional<z.ZodObject<{
|
|
10
|
+
after: z.ZodOptional<z.ZodString>;
|
|
11
|
+
at: z.ZodOptional<z.ZodString>;
|
|
12
|
+
atOrAfter: z.ZodOptional<z.ZodString>;
|
|
13
|
+
atOrBefore: z.ZodOptional<z.ZodString>;
|
|
14
|
+
before: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, z.core.$strip>>;
|
|
16
|
+
from: z.ZodOptional<z.ZodString>;
|
|
17
|
+
id: z.ZodOptional<z.ZodString>;
|
|
18
|
+
isInbound: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
ownerId: z.ZodOptional<z.ZodString>;
|
|
20
|
+
target: z.ZodOptional<z.ZodString>;
|
|
21
|
+
to: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export declare const queryEmailsInputSchema: z.ZodObject<{
|
|
24
|
+
constraints: z.ZodOptional<z.ZodObject<{
|
|
25
|
+
cursor: z.ZodOptional<z.ZodObject<{
|
|
26
|
+
id: z.ZodString;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
createdAt: z.ZodOptional<z.ZodObject<{
|
|
31
|
+
after: z.ZodOptional<z.ZodString>;
|
|
32
|
+
at: z.ZodOptional<z.ZodString>;
|
|
33
|
+
atOrAfter: z.ZodOptional<z.ZodString>;
|
|
34
|
+
atOrBefore: z.ZodOptional<z.ZodString>;
|
|
35
|
+
before: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
from: z.ZodOptional<z.ZodString>;
|
|
38
|
+
id: z.ZodOptional<z.ZodString>;
|
|
39
|
+
isInbound: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
+
ownerId: z.ZodOptional<z.ZodString>;
|
|
41
|
+
target: z.ZodOptional<z.ZodString>;
|
|
42
|
+
to: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
export type QueryEmailsInput = z.infer<typeof queryEmailsInputSchema>;
|
|
45
|
+
export declare const queryEmailsOutputSchema: z.ZodArray<z.ZodObject<{
|
|
46
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
47
|
+
contentBase64: z.ZodString;
|
|
48
|
+
contentId: z.ZodOptional<z.ZodString>;
|
|
49
|
+
disposition: z.ZodOptional<z.ZodEnum<{
|
|
50
|
+
attachment: "attachment";
|
|
51
|
+
inline: "inline";
|
|
52
|
+
}>>;
|
|
53
|
+
fileName: z.ZodString;
|
|
54
|
+
type: z.ZodOptional<z.ZodString>;
|
|
55
|
+
}, z.core.$strip>>>;
|
|
56
|
+
bcc: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
57
|
+
address: z.ZodString;
|
|
58
|
+
name: z.ZodOptional<z.ZodString>;
|
|
59
|
+
}, z.core.$strip>>>;
|
|
60
|
+
cc: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
61
|
+
address: z.ZodString;
|
|
62
|
+
name: z.ZodOptional<z.ZodString>;
|
|
63
|
+
}, z.core.$strip>>>;
|
|
64
|
+
from: z.ZodObject<{
|
|
65
|
+
address: z.ZodString;
|
|
66
|
+
name: z.ZodOptional<z.ZodString>;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
html: z.ZodOptional<z.ZodString>;
|
|
69
|
+
ownerId: z.ZodString;
|
|
70
|
+
ownerType: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
71
|
+
TEAM: "TEAM";
|
|
72
|
+
}>>>;
|
|
73
|
+
replyTo: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
74
|
+
address: z.ZodString;
|
|
75
|
+
name: z.ZodOptional<z.ZodString>;
|
|
76
|
+
}, z.core.$strip>>>;
|
|
77
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
78
|
+
text: z.ZodOptional<z.ZodString>;
|
|
79
|
+
to: z.ZodArray<z.ZodObject<{
|
|
80
|
+
address: z.ZodString;
|
|
81
|
+
name: z.ZodOptional<z.ZodString>;
|
|
82
|
+
}, z.core.$strip>>;
|
|
83
|
+
createdAt: z.ZodString;
|
|
84
|
+
id: z.ZodString;
|
|
85
|
+
}, z.core.$strip>>;
|
|
86
|
+
export type QueryEmailsOutput = z.infer<typeof queryEmailsOutputSchema>;
|
|
87
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/trpc/emails/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;iBAclC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;iBAUlC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAOnC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { baseEmailSchema, dateRangeSchema, dateSchema } from "./base.js";
|
|
3
|
+
export const queryEmailsFilterSchema = z.object({
|
|
4
|
+
constraints: z
|
|
5
|
+
.object({
|
|
6
|
+
cursor: z.object({ id: z.string() }).optional(),
|
|
7
|
+
limit: z.number().optional(),
|
|
8
|
+
})
|
|
9
|
+
.optional(),
|
|
10
|
+
createdAt: dateRangeSchema.optional(),
|
|
11
|
+
from: z.string().optional(),
|
|
12
|
+
id: z.string().optional(),
|
|
13
|
+
isInbound: z.boolean().optional(),
|
|
14
|
+
ownerId: z.string().optional(),
|
|
15
|
+
target: z.string().optional(),
|
|
16
|
+
to: z.array(z.string()).optional(),
|
|
17
|
+
});
|
|
18
|
+
export const queryEmailsInputSchema = queryEmailsFilterSchema.refine((data) => data.from !== undefined ||
|
|
19
|
+
data.id !== undefined ||
|
|
20
|
+
data.isInbound !== undefined ||
|
|
21
|
+
data.createdAt !== undefined ||
|
|
22
|
+
data.ownerId !== undefined ||
|
|
23
|
+
data.to !== undefined ||
|
|
24
|
+
data.target !== undefined, `at least one of the fields must be set: from, id, isInbound, ownerId, to, createdAt, target`);
|
|
25
|
+
export const queryEmailsOutputSchema = z.array(baseEmailSchema.merge(z.object({
|
|
26
|
+
createdAt: dateSchema,
|
|
27
|
+
id: z.string(),
|
|
28
|
+
})));
|
|
29
|
+
//# sourceMappingURL=query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/trpc/emails/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEzE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,WAAW,EAAE,CAAC;SACX,MAAM,CAAC;QACN,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE;QAC/C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC7B,CAAC;SACD,QAAQ,EAAE;IACb,SAAS,EAAE,eAAe,CAAC,QAAQ,EAAE;IACrC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACjC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,uBAAuB,CAAC,MAAM,CAClE,CAAC,IAAI,EAAE,EAAE,CACP,IAAI,CAAC,IAAI,KAAK,SAAS;IACvB,IAAI,CAAC,EAAE,KAAK,SAAS;IACrB,IAAI,CAAC,SAAS,KAAK,SAAS;IAC5B,IAAI,CAAC,SAAS,KAAK,SAAS;IAC5B,IAAI,CAAC,OAAO,KAAK,SAAS;IAC1B,IAAI,CAAC,EAAE,KAAK,SAAS;IACrB,IAAI,CAAC,MAAM,KAAK,SAAS,EAC3B,6FAA6F,CAC9F,CAAC;AAIF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC5C,eAAe,CAAC,KAAK,CACnB,CAAC,CAAC,MAAM,CAAC;IACP,SAAS,EAAE,UAAU;IACrB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;CACf,CAAC,CACH,CACF,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const receiveEmailFromSendgridInputSchema: z.ZodPipe<z.ZodPipe<z.ZodTransform<z.ZodObject<{
|
|
3
|
+
attachments: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>;
|
|
4
|
+
envelope: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>, z.ZodObject<{
|
|
5
|
+
from: z.ZodString;
|
|
6
|
+
to: z.ZodArray<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>>;
|
|
8
|
+
from: z.ZodString;
|
|
9
|
+
headers: z.ZodPipe<z.ZodString, z.ZodTransform<Record<string, string>, string>>;
|
|
10
|
+
html: z.ZodOptional<z.ZodString>;
|
|
11
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
12
|
+
text: z.ZodOptional<z.ZodString>;
|
|
13
|
+
to: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, z.core.$loose>, FormData | {
|
|
15
|
+
entries(): IterableIterator<[string, FormDataEntryValue]>;
|
|
16
|
+
[Symbol.iterator](): IterableIterator<[string, FormDataEntryValue]>;
|
|
17
|
+
} | {
|
|
18
|
+
[x: string]: unknown;
|
|
19
|
+
attachments: unknown;
|
|
20
|
+
envelope: string;
|
|
21
|
+
from: string;
|
|
22
|
+
headers: string;
|
|
23
|
+
html?: string | undefined;
|
|
24
|
+
subject?: string | undefined;
|
|
25
|
+
text?: string | undefined;
|
|
26
|
+
to?: string | undefined;
|
|
27
|
+
}>, z.ZodObject<{
|
|
28
|
+
attachments: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>;
|
|
29
|
+
envelope: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>, z.ZodObject<{
|
|
30
|
+
from: z.ZodString;
|
|
31
|
+
to: z.ZodArray<z.ZodString>;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
from: z.ZodString;
|
|
34
|
+
headers: z.ZodPipe<z.ZodString, z.ZodTransform<Record<string, string>, string>>;
|
|
35
|
+
html: z.ZodOptional<z.ZodString>;
|
|
36
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
37
|
+
text: z.ZodOptional<z.ZodString>;
|
|
38
|
+
to: z.ZodOptional<z.ZodString>;
|
|
39
|
+
}, z.core.$loose>>, z.ZodTransform<{
|
|
40
|
+
bcc: string | undefined;
|
|
41
|
+
cc: string | undefined;
|
|
42
|
+
files: File[];
|
|
43
|
+
replyTo: string | undefined;
|
|
44
|
+
targets: string[];
|
|
45
|
+
to: string;
|
|
46
|
+
attachments: number;
|
|
47
|
+
envelope: {
|
|
48
|
+
from: string;
|
|
49
|
+
to: string[];
|
|
50
|
+
};
|
|
51
|
+
from: string;
|
|
52
|
+
headers: Record<string, string>;
|
|
53
|
+
html?: string | undefined;
|
|
54
|
+
subject?: string | undefined;
|
|
55
|
+
text?: string | undefined;
|
|
56
|
+
}, {
|
|
57
|
+
[x: string]: unknown;
|
|
58
|
+
attachments: number;
|
|
59
|
+
envelope: {
|
|
60
|
+
from: string;
|
|
61
|
+
to: string[];
|
|
62
|
+
};
|
|
63
|
+
from: string;
|
|
64
|
+
headers: Record<string, string>;
|
|
65
|
+
html?: string | undefined;
|
|
66
|
+
subject?: string | undefined;
|
|
67
|
+
text?: string | undefined;
|
|
68
|
+
to?: string | undefined;
|
|
69
|
+
}>>;
|
|
70
|
+
export type ReceiveEmailFromSendgridInput = z.infer<typeof receiveEmailFromSendgridInputSchema>;
|
|
71
|
+
export declare const receiveEmailFromSendgridOutputSchema: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
72
|
+
id: z.ZodString;
|
|
73
|
+
type: z.ZodLiteral<"UNMATCHED">;
|
|
74
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
75
|
+
id: z.ZodString;
|
|
76
|
+
ownerId: z.ZodString;
|
|
77
|
+
type: z.ZodLiteral<"MATCHED">;
|
|
78
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
79
|
+
error: z.ZodString;
|
|
80
|
+
}, z.core.$strip>]>>;
|
|
81
|
+
export type ReceiveEmailFromSendgridOutput = z.infer<typeof receiveEmailFromSendgridOutputSchema>;
|
|
82
|
+
//# sourceMappingURL=receive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"receive.d.ts","sourceRoot":"","sources":["../../../src/trpc/emails/receive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsE5C,CAAC;AAEL,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CACjD,OAAO,mCAAmC,CAC3C,CAAC;AAEF,eAAO,MAAM,oCAAoC;;;;;;;;;oBAehD,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,oCAAoC,CAC5C,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { zfd } from "zod-form-data";
|
|
3
|
+
import { stringToHeaders, stringToJson } from "./schemaUtils.js";
|
|
4
|
+
// Attachments all have the key attachment1, attachment2, etc.
|
|
5
|
+
// But there are other keys starting with attachment, i.e. attachments,
|
|
6
|
+
// attachment-info, and possibly others
|
|
7
|
+
const attachmentFieldPattern = /^attachment\d+$/;
|
|
8
|
+
export const receiveEmailFromSendgridInputSchema = zfd
|
|
9
|
+
.formData(z
|
|
10
|
+
// need "loose" validation since sendgrid will send attachments with form-data
|
|
11
|
+
// names such as attachment1, attachment2, etc.
|
|
12
|
+
.looseObject({
|
|
13
|
+
attachments: zfd.numeric(),
|
|
14
|
+
// envelope is a JSON string with from/to fields
|
|
15
|
+
envelope: stringToJson.pipe(z.object({
|
|
16
|
+
from: z.string(),
|
|
17
|
+
to: z.array(z.string()),
|
|
18
|
+
})),
|
|
19
|
+
from: z.string().min(1),
|
|
20
|
+
// headers come in as a string, but we can apply basic parsing
|
|
21
|
+
// as they are formatted as HTTP headers.
|
|
22
|
+
// e.g. "Content-Type: multipart/form-data"
|
|
23
|
+
headers: stringToHeaders,
|
|
24
|
+
html: z.string().optional(),
|
|
25
|
+
subject: z.string().optional(),
|
|
26
|
+
text: z.string().optional(),
|
|
27
|
+
to: z.string().optional(),
|
|
28
|
+
}))
|
|
29
|
+
.transform((input, ctx) => {
|
|
30
|
+
// sendgrid includes the attachments as attachment1, attachment2, etc.
|
|
31
|
+
// we need to parse them out and add them to the files array
|
|
32
|
+
const files = Object.entries(input)
|
|
33
|
+
.filter(([key]) => attachmentFieldPattern.test(key))
|
|
34
|
+
.map(([key, value]) => {
|
|
35
|
+
if (!(value instanceof File)) {
|
|
36
|
+
// Add a Zod validation issue, this will result in a 400 error in tRPC procedures
|
|
37
|
+
ctx.addIssue({
|
|
38
|
+
code: z.ZodIssueCode.custom,
|
|
39
|
+
message: `Expected ${key} to be a File`,
|
|
40
|
+
path: [key],
|
|
41
|
+
});
|
|
42
|
+
return "not-a-file";
|
|
43
|
+
}
|
|
44
|
+
return value;
|
|
45
|
+
})
|
|
46
|
+
// This filter is just to ensure the resulting type is `File`
|
|
47
|
+
// The validation above this ensures that all values are files
|
|
48
|
+
.filter((file) => file !== "not-a-file");
|
|
49
|
+
// sendgrid includes the bcc and cc fields in the headers
|
|
50
|
+
const cc = input.headers["cc"];
|
|
51
|
+
const bcc = input.headers["bcc"];
|
|
52
|
+
const replyTo = input.headers["reply-to"];
|
|
53
|
+
const to = input.to ? input.to : input.envelope.to.join(",");
|
|
54
|
+
if (!to) {
|
|
55
|
+
ctx.addIssue({
|
|
56
|
+
code: z.ZodIssueCode.custom,
|
|
57
|
+
message: "to, or envelope.to is required",
|
|
58
|
+
path: ["to"],
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
...input,
|
|
63
|
+
bcc,
|
|
64
|
+
cc,
|
|
65
|
+
files,
|
|
66
|
+
replyTo,
|
|
67
|
+
// convenience to have the targets in the input
|
|
68
|
+
targets: input.envelope.to,
|
|
69
|
+
to,
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
export const receiveEmailFromSendgridOutputSchema = z.array(z.union([
|
|
73
|
+
z.object({
|
|
74
|
+
id: z.string(),
|
|
75
|
+
type: z.literal("UNMATCHED"),
|
|
76
|
+
}),
|
|
77
|
+
z.object({
|
|
78
|
+
id: z.string(),
|
|
79
|
+
ownerId: z.string(),
|
|
80
|
+
type: z.literal("MATCHED"),
|
|
81
|
+
}),
|
|
82
|
+
z.object({
|
|
83
|
+
error: z.string(),
|
|
84
|
+
}),
|
|
85
|
+
]));
|
|
86
|
+
//# sourceMappingURL=receive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"receive.js","sourceRoot":"","sources":["../../../src/trpc/emails/receive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEjE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,CAAC,CAAC,MAAM,CAAC;QACP,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;QACd,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;KAC7B,CAAC;IACF,CAAC,CAAC,MAAM,CAAC;QACP,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;QACd,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;KAC3B,CAAC;IACF,CAAC,CAAC,MAAM,CAAC;QACP,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;KAClB,CAAC;CACH,CAAC,CACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaUtils.d.ts","sourceRoot":"","sources":["../../../src/trpc/emails/schemaUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,YAAY,qDAUvB,CAAC;AAKH,eAAO,MAAM,eAAe,wEAgBxB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// zod helper to parse a JSON string
|
|
3
|
+
export const stringToJson = z.string().transform((value, context) => {
|
|
4
|
+
try {
|
|
5
|
+
return JSON.parse(value);
|
|
6
|
+
}
|
|
7
|
+
catch (error) {
|
|
8
|
+
context.addIssue({
|
|
9
|
+
code: "custom",
|
|
10
|
+
message: `Invalid JSON string: ${error}`,
|
|
11
|
+
});
|
|
12
|
+
return z.NEVER;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
// zod helper to convert http headers string to object
|
|
16
|
+
// it also normalizes the keys to lowercase
|
|
17
|
+
// e.g. "Content-Type: multipart/form-data" to { "content-type": "multipart/form-data" }
|
|
18
|
+
export const stringToHeaders = z
|
|
19
|
+
.string()
|
|
20
|
+
.transform((value) => {
|
|
21
|
+
return Object.fromEntries(value
|
|
22
|
+
.split("\n")
|
|
23
|
+
.map((header) => {
|
|
24
|
+
const firstColonIndex = header.indexOf(":");
|
|
25
|
+
if (firstColonIndex === -1)
|
|
26
|
+
return [];
|
|
27
|
+
const key = header.slice(0, firstColonIndex).trim().toLowerCase();
|
|
28
|
+
const value = header.slice(firstColonIndex + 1).trim();
|
|
29
|
+
if (!key || !value)
|
|
30
|
+
return [];
|
|
31
|
+
return [key, value];
|
|
32
|
+
})
|
|
33
|
+
.filter((pair) => pair.length > 0));
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=schemaUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaUtils.js","sourceRoot":"","sources":["../../../src/trpc/emails/schemaUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,oCAAoC;AACpC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IAClE,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,wBAAwB,KAAK,EAAE;SACzC,CAAC,CAAC;QACH,OAAO,CAAC,CAAC,KAAK,CAAC;IACjB,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,sDAAsD;AACtD,2CAA2C;AAC3C,wFAAwF;AACxF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC;KAC7B,MAAM,EAAE;KACR,SAAS,CAAyB,CAAC,KAAK,EAAE,EAAE;IAC3C,OAAO,MAAM,CAAC,WAAW,CACvB,KAAK;SACF,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QACd,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,eAAe,KAAK,CAAC,CAAC;YAAE,OAAO,EAAE,CAAC;QACtC,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAClE,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACvD,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK;YAAE,OAAO,EAAE,CAAC;QAC9B,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACtB,CAAC,CAAC;SACD,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CACrC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const searchEmailsInputSchema: z.ZodObject<{
|
|
3
|
+
constraints: z.ZodOptional<z.ZodObject<{
|
|
4
|
+
cursor: z.ZodOptional<z.ZodObject<{
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
}, z.core.$strip>>;
|
|
7
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
}, z.core.$strip>>;
|
|
9
|
+
isInbound: z.ZodBoolean;
|
|
10
|
+
ownerId: z.ZodString;
|
|
11
|
+
searchQuery: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export type SearchEmailsInput = z.infer<typeof searchEmailsInputSchema>;
|
|
14
|
+
export declare const searchEmailsOutputSchema: z.ZodObject<{
|
|
15
|
+
items: z.ZodArray<z.ZodObject<{
|
|
16
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
17
|
+
contentBase64: z.ZodString;
|
|
18
|
+
contentId: z.ZodOptional<z.ZodString>;
|
|
19
|
+
disposition: z.ZodOptional<z.ZodEnum<{
|
|
20
|
+
attachment: "attachment";
|
|
21
|
+
inline: "inline";
|
|
22
|
+
}>>;
|
|
23
|
+
fileName: z.ZodString;
|
|
24
|
+
type: z.ZodOptional<z.ZodString>;
|
|
25
|
+
}, z.core.$strip>>>;
|
|
26
|
+
bcc: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
27
|
+
address: z.ZodString;
|
|
28
|
+
name: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, z.core.$strip>>>;
|
|
30
|
+
cc: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
31
|
+
address: z.ZodString;
|
|
32
|
+
name: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, z.core.$strip>>>;
|
|
34
|
+
from: z.ZodObject<{
|
|
35
|
+
address: z.ZodString;
|
|
36
|
+
name: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
html: z.ZodOptional<z.ZodString>;
|
|
39
|
+
ownerId: z.ZodString;
|
|
40
|
+
ownerType: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
41
|
+
TEAM: "TEAM";
|
|
42
|
+
}>>>;
|
|
43
|
+
replyTo: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
44
|
+
address: z.ZodString;
|
|
45
|
+
name: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, z.core.$strip>>>;
|
|
47
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
48
|
+
text: z.ZodOptional<z.ZodString>;
|
|
49
|
+
to: z.ZodArray<z.ZodObject<{
|
|
50
|
+
address: z.ZodString;
|
|
51
|
+
name: z.ZodOptional<z.ZodString>;
|
|
52
|
+
}, z.core.$strip>>;
|
|
53
|
+
createdAt: z.ZodString;
|
|
54
|
+
id: z.ZodString;
|
|
55
|
+
}, z.core.$strip>>;
|
|
56
|
+
nextCursor: z.ZodOptional<z.ZodObject<{
|
|
57
|
+
id: z.ZodString;
|
|
58
|
+
}, z.core.$strip>>;
|
|
59
|
+
totalCount: z.ZodNumber;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
export type SearchEmailsOutput = z.infer<typeof searchEmailsOutputSchema>;
|
|
62
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/trpc/emails/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,uBAAuB;;;;;;;;;;iBAUlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAInC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { queryEmailsOutputSchema } from "./query.js";
|
|
3
|
+
export const searchEmailsInputSchema = z.object({
|
|
4
|
+
constraints: z
|
|
5
|
+
.object({
|
|
6
|
+
cursor: z.object({ id: z.string() }).optional(),
|
|
7
|
+
limit: z.number().optional(),
|
|
8
|
+
})
|
|
9
|
+
.optional(),
|
|
10
|
+
isInbound: z.boolean(),
|
|
11
|
+
ownerId: z.string(),
|
|
12
|
+
searchQuery: z.string().optional(),
|
|
13
|
+
});
|
|
14
|
+
export const searchEmailsOutputSchema = z.object({
|
|
15
|
+
items: queryEmailsOutputSchema,
|
|
16
|
+
nextCursor: z.object({ id: z.string() }).optional(),
|
|
17
|
+
totalCount: z.number(),
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/trpc/emails/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,WAAW,EAAE,CAAC;SACX,MAAM,CAAC;QACN,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE;QAC/C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC7B,CAAC;SACD,QAAQ,EAAE;IACb,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;IACtB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,KAAK,EAAE,uBAAuB;IAC9B,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE;IACnD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const sendEmailInputSchema: z.ZodIntersection<z.ZodObject<{
|
|
3
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
4
|
+
contentBase64: z.ZodString;
|
|
5
|
+
contentId: z.ZodOptional<z.ZodString>;
|
|
6
|
+
disposition: z.ZodOptional<z.ZodEnum<{
|
|
7
|
+
attachment: "attachment";
|
|
8
|
+
inline: "inline";
|
|
9
|
+
}>>;
|
|
10
|
+
fileName: z.ZodString;
|
|
11
|
+
type: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, z.core.$strip>>>;
|
|
13
|
+
bcc: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
14
|
+
address: z.ZodString;
|
|
15
|
+
name: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, z.core.$strip>>>;
|
|
17
|
+
cc: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
18
|
+
address: z.ZodString;
|
|
19
|
+
name: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, z.core.$strip>>>;
|
|
21
|
+
from: z.ZodObject<{
|
|
22
|
+
address: z.ZodString;
|
|
23
|
+
name: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
html: z.ZodOptional<z.ZodString>;
|
|
26
|
+
ownerId: z.ZodString;
|
|
27
|
+
ownerType: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
28
|
+
TEAM: "TEAM";
|
|
29
|
+
}>>>;
|
|
30
|
+
replyTo: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
31
|
+
address: z.ZodString;
|
|
32
|
+
name: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, z.core.$strip>>>;
|
|
34
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
35
|
+
text: z.ZodOptional<z.ZodString>;
|
|
36
|
+
to: z.ZodArray<z.ZodObject<{
|
|
37
|
+
address: z.ZodString;
|
|
38
|
+
name: z.ZodOptional<z.ZodString>;
|
|
39
|
+
}, z.core.$strip>>;
|
|
40
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
41
|
+
replyToMessageId: z.ZodOptional<z.ZodString>;
|
|
42
|
+
}, z.core.$strip>>;
|
|
43
|
+
export type SendEmailInput = z.infer<typeof sendEmailInputSchema>;
|
|
44
|
+
export declare const sendEmailOutputSchema: z.ZodObject<{
|
|
45
|
+
id: z.ZodString;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
export type SendEmailOutput = z.infer<typeof sendEmailOutputSchema>;
|
|
48
|
+
//# sourceMappingURL=send.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../../src/trpc/emails/send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAIhC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,qBAAqB;;iBAEhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { baseEmailSchema } from "./base.js";
|
|
3
|
+
export const sendEmailInputSchema = baseEmailSchema.and(z.object({
|
|
4
|
+
replyToMessageId: z.string().optional(),
|
|
5
|
+
}));
|
|
6
|
+
export const sendEmailOutputSchema = z.object({
|
|
7
|
+
id: z.string(),
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=send.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send.js","sourceRoot":"","sources":["../../../src/trpc/emails/send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC,GAAG,CACrD,CAAC,CAAC,MAAM,CAAC;IACP,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACxC,CAAC,CACH,CAAC;AAIF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;CACf,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/trpc/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/trpc/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const upsertOwnerInputSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
addresses: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
|
|
5
|
+
type: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
6
|
+
TEAM: "TEAM";
|
|
7
|
+
}>>>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export type UpsertOwnerInput = z.infer<typeof upsertOwnerInputSchema>;
|
|
10
|
+
export declare const upsertOwnerOutputSchema: z.ZodObject<{
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
addresses: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
|
|
13
|
+
type: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
14
|
+
TEAM: "TEAM";
|
|
15
|
+
}>>>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export type UpsertOwnerOutput = z.infer<typeof upsertOwnerOutputSchema>;
|
|
18
|
+
export declare const queryOwnerInputSchema: z.ZodObject<{
|
|
19
|
+
id: z.ZodString;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export type GetOwnerInput = z.infer<typeof queryOwnerInputSchema>;
|
|
22
|
+
export declare const queryOwnerOutputSchema: z.ZodObject<{
|
|
23
|
+
id: z.ZodString;
|
|
24
|
+
addresses: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
|
|
25
|
+
type: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
26
|
+
TEAM: "TEAM";
|
|
27
|
+
}>>>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export type GetOwnerOutput = z.infer<typeof queryOwnerOutputSchema>;
|
|
30
|
+
export declare const deleteOwnerInputSchema: z.ZodObject<{
|
|
31
|
+
id: z.ZodString;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
export type DeleteOwnerInput = z.infer<typeof deleteOwnerInputSchema>;
|
|
34
|
+
export declare const deleteOwnerOutputSchema: z.ZodObject<{
|
|
35
|
+
id: z.ZodString;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export type DeleteOwnerOutput = z.infer<typeof deleteOwnerOutputSchema>;
|
|
38
|
+
//# sourceMappingURL=owners.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"owners.d.ts","sourceRoot":"","sources":["../../src/trpc/owners.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,sBAAsB;;;;;;iBAAc,CAAC;AAClD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,uBAAuB;;;;;;iBAAc,CAAC;AACnD,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,qBAAqB;;iBAAwB,CAAC;AAC3D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAElE,eAAO,MAAM,sBAAsB;;;;;;iBAAc,CAAC;AAClD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEpE,eAAO,MAAM,sBAAsB;;iBAAwB,CAAC;AAC5D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,uBAAuB;;iBAAwB,CAAC;AAC7D,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const ownerIdentifierSchema = z.object({
|
|
3
|
+
id: z.string(),
|
|
4
|
+
});
|
|
5
|
+
const ownerSchema = ownerIdentifierSchema.merge(z.object({
|
|
6
|
+
addresses: z.array(z.email()).optional(),
|
|
7
|
+
type: z.enum(["TEAM"]).optional().default("TEAM"),
|
|
8
|
+
}));
|
|
9
|
+
export const upsertOwnerInputSchema = ownerSchema;
|
|
10
|
+
export const upsertOwnerOutputSchema = ownerSchema;
|
|
11
|
+
export const queryOwnerInputSchema = ownerIdentifierSchema;
|
|
12
|
+
export const queryOwnerOutputSchema = ownerSchema;
|
|
13
|
+
export const deleteOwnerInputSchema = ownerIdentifierSchema;
|
|
14
|
+
export const deleteOwnerOutputSchema = ownerIdentifierSchema;
|
|
15
|
+
//# sourceMappingURL=owners.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"owners.js","sourceRoot":"","sources":["../../src/trpc/owners.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;CACf,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,qBAAqB,CAAC,KAAK,CAC7C,CAAC,CAAC,MAAM,CAAC;IACP,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,QAAQ,EAAE;IACxC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;CAClD,CAAC,CACH,CAAC;AACF,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAC;AAGlD,MAAM,CAAC,MAAM,uBAAuB,GAAG,WAAW,CAAC;AAGnD,MAAM,CAAC,MAAM,qBAAqB,GAAG,qBAAqB,CAAC;AAG3D,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAC;AAGlD,MAAM,CAAC,MAAM,sBAAsB,GAAG,qBAAqB,CAAC;AAG5D,MAAM,CAAC,MAAM,uBAAuB,GAAG,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const healthzOutputSchema: z.ZodObject<{
|
|
3
|
+
status: z.ZodEnum<{
|
|
4
|
+
pass: "pass";
|
|
5
|
+
}>;
|
|
6
|
+
version: z.ZodString;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export type HealthzOutput = z.infer<typeof healthzOutputSchema>;
|
|
9
|
+
export declare const readyzOutputSchema: z.ZodObject<{
|
|
10
|
+
status: z.ZodEnum<{
|
|
11
|
+
OK: "OK";
|
|
12
|
+
}>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type ReadyzOutput = z.infer<typeof readyzOutputSchema>;
|
|
15
|
+
//# sourceMappingURL=probes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probes.d.ts","sourceRoot":"","sources":["../../src/trpc/probes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,eAAO,MAAM,mBAAmB;;;;;iBAG9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,kBAAkB;;;;iBAE7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probes.js","sourceRoot":"","sources":["../../src/trpc/probes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;IACxB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;CACvB,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@qawolf/emailer-types",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"type": "module",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"files": [
|
|
16
|
+
"/dist",
|
|
17
|
+
"/LICENSE",
|
|
18
|
+
"/README.md"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "rm -rf ./dist && tsc -p tsconfig.build.json",
|
|
22
|
+
"lint:ci": "npm run lint:non-fixable; NON_FIXABLE_EXIT=$?; npm run lint:fixable && exit $NON_FIXABLE_EXIT",
|
|
23
|
+
"lint:dev": "npm run lint:fixable",
|
|
24
|
+
"lint:fixable": "eslint . --ext cjs,cts,js,jsx,mjs,ts,tsx --fix --quiet && prettier --log-level=warn --write .",
|
|
25
|
+
"lint:non-fixable": "dpdm --exit-code circular:1 --no-tree --no-warning --transform --include='.*' --exclude='/(dist|node_modules)/' '**/*'",
|
|
26
|
+
"prepublishOnly": "nx run emailer-types:build",
|
|
27
|
+
"test": "NODE_OPTIONS=\"--experimental-vm-modules\" NODE_NO_WARNINGS=1 jest --passWithNoTests",
|
|
28
|
+
"test:watch": "npm run test -- --watch",
|
|
29
|
+
"tsc:check": "tsc"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"email-addresses": "^5.0.0",
|
|
33
|
+
"tslib": "^2.5.3",
|
|
34
|
+
"zod": "^4.1.11",
|
|
35
|
+
"zod-form-data": "^3.0.1"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"typescript": "^5.9.2"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=22.22.0 <25"
|
|
42
|
+
},
|
|
43
|
+
"nx": {
|
|
44
|
+
"targets": {
|
|
45
|
+
"npm:publish": {}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|