@hitch42/applet 0.1.1-beta.14 → 0.1.1-beta.16
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/_internal/server.d.ts +10 -1
- package/dist/_internal/server.js +16 -2
- package/dist/applet.js +12 -12
- package/dist/auth-D3CrCtZq.js +21 -0
- package/dist/{build-CwOM9C0W.js → build-XHoa_sJL.js} +1 -1
- package/dist/build-ueR7XjZT.js +2 -0
- package/dist/{ci-BKw14X2h.js → ci-B5-mH-YW.js} +1 -1
- package/dist/client.d.ts +3 -3
- package/dist/contract-BbOj5EB7.js +23 -0
- package/dist/{contract-CZdT22tB.d.ts → contract-D9wEvxGI.d.ts} +1 -1
- package/dist/{deploy-CaGPhe2h.js → deploy-C5JDIn2Y.js} +4 -3
- package/dist/device-BgIfytaR.js +135 -0
- package/dist/email-protocol-B9u_dh2p.d.ts +202 -0
- package/dist/{generate-CORu1X2X.js → generate-BV_emZgy.js} +39 -13
- package/dist/generate-C9bWqdaB.js +2 -0
- package/dist/hitch-file-url-BPKj9zVG.js +25 -0
- package/dist/index.d.ts +15 -25
- package/dist/index.js +80 -192
- package/dist/{init-CD-xOYWV.js → init-BGQ_bP44.js} +5 -5
- package/dist/{manifest-CuY3ICpN.js → load-config-Dkr2VxZN.js} +37 -2
- package/dist/{login-CUx3TmFQ.js → login-CceGvlMi.js} +3 -1
- package/dist/{logs-BySh9fnH.js → logs-DOkT5ots.js} +3 -3
- package/dist/{manifest-ARAy2HP7.d.ts → manifest-BSUtHbu-.d.ts} +1 -4
- package/dist/markdown-CwlqzBtP.js +88 -0
- package/dist/markdown-DSHOQIOb.d.ts +14 -0
- package/dist/markdown-editor-BmEaBzd7.d.ts +27 -0
- package/dist/markdown-editor-C5mLHGqu.js +428 -0
- package/dist/{project-z7x0omdw.js → project-CCVqCCgU.js} +5 -4
- package/dist/react/markdown-editor.d.ts +2 -0
- package/dist/react/markdown-editor.js +2 -0
- package/dist/react/markdown.d.ts +2 -0
- package/dist/react/markdown.js +2 -0
- package/dist/react.d.ts +2 -37
- package/dist/react.js +2 -534
- package/dist/{schedules-B_p9U-vM.js → schedules-D6-3v-Az.js} +1 -1
- package/dist/server.d.ts +3 -3
- package/dist/store-B8N_8JIN.js +196 -0
- package/dist/{upload-DKZzz5kW.d.ts → upload-D_kkmne_.d.ts} +5 -9
- package/dist/{variables-D9nEFyOK.js → variables-BSFZnLxY.js} +2 -2
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +165 -35
- package/dist/workspace-8yqXsvce.js +31 -0
- package/fonts/inter/LICENSE.txt +92 -0
- package/fonts/inter/inter-cyrillic-ext.woff2 +0 -0
- package/fonts/inter/inter-cyrillic.woff2 +0 -0
- package/fonts/inter/inter-greek-ext.woff2 +0 -0
- package/fonts/inter/inter-greek.woff2 +0 -0
- package/fonts/inter/inter-latin-ext.woff2 +0 -0
- package/fonts/inter/inter-latin.woff2 +0 -0
- package/fonts/inter/inter-vietnamese.woff2 +0 -0
- package/fonts/inter.css +81 -0
- package/package.json +15 -1
- package/scaffold/.agents/skills/hitch-applets/references/markdown.md +20 -2
- package/scaffold/applet/src/client/styles/globals.css +6 -1
- package/dist/build-CeRZYhM9.js +0 -2
- package/dist/email-WA4jnzZ0.js +0 -211
- package/dist/email-protocol-DqJ6YCiC.d.ts +0 -230
- package/dist/generate-CtbF9Zxd.js +0 -2
- package/dist/load-config-BeQZ2yOa.js +0 -27
- package/dist/me-BW7Paary.js +0 -32
- package/dist/workspace-D0dnnlxL.js +0 -385
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
Copyright (c) 2016 The Inter Project Authors (https://github.com/rsms/inter)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
-----------------------------------------------------------
|
|
8
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
9
|
+
-----------------------------------------------------------
|
|
10
|
+
|
|
11
|
+
PREAMBLE
|
|
12
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
13
|
+
development of collaborative font projects, to support the font creation
|
|
14
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
15
|
+
open framework in which fonts may be shared and improved in partnership
|
|
16
|
+
with others.
|
|
17
|
+
|
|
18
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
19
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
20
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
21
|
+
redistributed and/or sold with any software provided that any reserved
|
|
22
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
23
|
+
however, cannot be released under any other type of license. The
|
|
24
|
+
requirement for fonts to remain under this license does not apply
|
|
25
|
+
to any document created using the fonts or their derivatives.
|
|
26
|
+
|
|
27
|
+
DEFINITIONS
|
|
28
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
29
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
30
|
+
include source files, build scripts and documentation.
|
|
31
|
+
|
|
32
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
33
|
+
copyright statement(s).
|
|
34
|
+
|
|
35
|
+
"Original Version" refers to the collection of Font Software components as
|
|
36
|
+
distributed by the Copyright Holder(s).
|
|
37
|
+
|
|
38
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
39
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
40
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
41
|
+
new environment.
|
|
42
|
+
|
|
43
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
44
|
+
writer or other person who contributed to the Font Software.
|
|
45
|
+
|
|
46
|
+
PERMISSION AND CONDITIONS
|
|
47
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
48
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
49
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
50
|
+
Software, subject to the following conditions:
|
|
51
|
+
|
|
52
|
+
1) Neither the Font Software nor any of its individual components,
|
|
53
|
+
in Original or Modified Versions, may be sold by itself.
|
|
54
|
+
|
|
55
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
56
|
+
redistributed and/or sold with any software, provided that each copy
|
|
57
|
+
contains the above copyright notice and this license. These can be
|
|
58
|
+
included either as stand-alone text files, human-readable headers or
|
|
59
|
+
in the appropriate machine-readable metadata fields within text or
|
|
60
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
61
|
+
|
|
62
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
63
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
64
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
65
|
+
presented to the users.
|
|
66
|
+
|
|
67
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
68
|
+
Software shall not be used to promote, endorse or advertise any
|
|
69
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
70
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
71
|
+
permission.
|
|
72
|
+
|
|
73
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
74
|
+
must be distributed entirely under this license, and must not be
|
|
75
|
+
distributed under any other license. The requirement for fonts to
|
|
76
|
+
remain under this license does not apply to any document created
|
|
77
|
+
using the Font Software.
|
|
78
|
+
|
|
79
|
+
TERMINATION
|
|
80
|
+
This license becomes null and void if any of the above conditions are
|
|
81
|
+
not met.
|
|
82
|
+
|
|
83
|
+
DISCLAIMER
|
|
84
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
85
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
86
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
87
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
88
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
89
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
90
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
91
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
92
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/fonts/inter.css
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/* Inter 4.1 (https://github.com/rsms/inter, SIL Open Font License, see
|
|
2
|
+
inter/LICENSE.txt) with its weight and optical-size axes, cut into the same
|
|
3
|
+
per-script files as Fontsource so a page downloads only the scripts it
|
|
4
|
+
shows. The Google Fonts build that Fontsource ships drops Inter's
|
|
5
|
+
alternates; these keep the ones Hitch turns on, cv11 (single-storey a) and
|
|
6
|
+
ss01 (open digits), plus tnum, pnum, case and zero. Made with fonttools
|
|
7
|
+
from web/InterVariable.woff2 in the release zip:
|
|
8
|
+
|
|
9
|
+
pyftsubset InterVariable.woff2 --unicodes=<range below>
|
|
10
|
+
--layout-features+=cv11,ss01,tnum,pnum,case,zero
|
|
11
|
+
--flavor=woff2 --no-hinting --desubroutinize */
|
|
12
|
+
|
|
13
|
+
@font-face {
|
|
14
|
+
font-family: "Inter Variable";
|
|
15
|
+
font-style: normal;
|
|
16
|
+
font-display: swap;
|
|
17
|
+
font-weight: 100 900;
|
|
18
|
+
src: url(./inter/inter-cyrillic-ext.woff2) format("woff2");
|
|
19
|
+
unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@font-face {
|
|
23
|
+
font-family: "Inter Variable";
|
|
24
|
+
font-style: normal;
|
|
25
|
+
font-display: swap;
|
|
26
|
+
font-weight: 100 900;
|
|
27
|
+
src: url(./inter/inter-cyrillic.woff2) format("woff2");
|
|
28
|
+
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@font-face {
|
|
32
|
+
font-family: "Inter Variable";
|
|
33
|
+
font-style: normal;
|
|
34
|
+
font-display: swap;
|
|
35
|
+
font-weight: 100 900;
|
|
36
|
+
src: url(./inter/inter-greek-ext.woff2) format("woff2");
|
|
37
|
+
unicode-range: U+1F00-1FFF;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@font-face {
|
|
41
|
+
font-family: "Inter Variable";
|
|
42
|
+
font-style: normal;
|
|
43
|
+
font-display: swap;
|
|
44
|
+
font-weight: 100 900;
|
|
45
|
+
src: url(./inter/inter-greek.woff2) format("woff2");
|
|
46
|
+
unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@font-face {
|
|
50
|
+
font-family: "Inter Variable";
|
|
51
|
+
font-style: normal;
|
|
52
|
+
font-display: swap;
|
|
53
|
+
font-weight: 100 900;
|
|
54
|
+
src: url(./inter/inter-vietnamese.woff2) format("woff2");
|
|
55
|
+
unicode-range:
|
|
56
|
+
U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
|
|
57
|
+
U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@font-face {
|
|
61
|
+
font-family: "Inter Variable";
|
|
62
|
+
font-style: normal;
|
|
63
|
+
font-display: swap;
|
|
64
|
+
font-weight: 100 900;
|
|
65
|
+
src: url(./inter/inter-latin-ext.woff2) format("woff2");
|
|
66
|
+
unicode-range:
|
|
67
|
+
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
|
|
68
|
+
U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
|
|
69
|
+
U+A720-A7FF;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@font-face {
|
|
73
|
+
font-family: "Inter Variable";
|
|
74
|
+
font-style: normal;
|
|
75
|
+
font-display: swap;
|
|
76
|
+
font-weight: 100 900;
|
|
77
|
+
src: url(./inter/inter-latin.woff2) format("woff2");
|
|
78
|
+
unicode-range:
|
|
79
|
+
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
|
|
80
|
+
U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
81
|
+
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hitch42/applet",
|
|
3
|
-
"version": "0.1.1-beta.
|
|
3
|
+
"version": "0.1.1-beta.16",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"bin": {
|
|
6
6
|
"applet": "./dist/applet.js"
|
|
7
7
|
},
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
10
|
+
"fonts",
|
|
10
11
|
"scaffold"
|
|
11
12
|
],
|
|
12
13
|
"type": "module",
|
|
14
|
+
"sideEffects": [
|
|
15
|
+
"*.css"
|
|
16
|
+
],
|
|
13
17
|
"exports": {
|
|
14
18
|
".": {
|
|
15
19
|
"source": "./src/index.ts",
|
|
@@ -27,6 +31,14 @@
|
|
|
27
31
|
"source": "./src/react/index.ts",
|
|
28
32
|
"default": "./dist/react.js"
|
|
29
33
|
},
|
|
34
|
+
"./react/markdown": {
|
|
35
|
+
"source": "./src/react/markdown.tsx",
|
|
36
|
+
"default": "./dist/react/markdown.js"
|
|
37
|
+
},
|
|
38
|
+
"./react/markdown-editor": {
|
|
39
|
+
"source": "./src/react/markdown-editor.tsx",
|
|
40
|
+
"default": "./dist/react/markdown-editor.js"
|
|
41
|
+
},
|
|
30
42
|
"./telephony": {
|
|
31
43
|
"source": "./src/telephony/index.ts",
|
|
32
44
|
"default": "./dist/telephony.js"
|
|
@@ -35,6 +47,7 @@
|
|
|
35
47
|
"source": "./src/vite.ts",
|
|
36
48
|
"default": "./dist/vite.js"
|
|
37
49
|
},
|
|
50
|
+
"./inter.css": "./fonts/inter.css",
|
|
38
51
|
"./_internal/client": {
|
|
39
52
|
"source": "./src/internal/client.ts",
|
|
40
53
|
"default": "./dist/_internal/client.js"
|
|
@@ -57,6 +70,7 @@
|
|
|
57
70
|
"@orpc/contract": "^1.15.0",
|
|
58
71
|
"@orpc/openapi-client": "^1.15.0",
|
|
59
72
|
"@orpc/tanstack-query": "^1.15.0",
|
|
73
|
+
"@react-aria/optimize-locales-plugin": "^2.1.0",
|
|
60
74
|
"@tailwindcss/vite": "^4.3.0",
|
|
61
75
|
"@tanstack/react-query-persist-client": "5.101.4",
|
|
62
76
|
"@tanstack/router-cli": "^1.167.24",
|
|
@@ -10,7 +10,7 @@ The editor supports GFM tables and task lists. A plain table serializes as GFM.
|
|
|
10
10
|
|
|
11
11
|
```tsx
|
|
12
12
|
import { hitch } from "@hitch42/applet/client";
|
|
13
|
-
import { MarkdownEditor } from "@hitch42/applet/react";
|
|
13
|
+
import { MarkdownEditor } from "@hitch42/applet/react/markdown-editor";
|
|
14
14
|
|
|
15
15
|
<MarkdownEditor value={value} onChange={setValue} files={hitch.files} />;
|
|
16
16
|
```
|
|
@@ -23,13 +23,31 @@ The `files` value must supply both `upload(file)` and `download(id)`. The editor
|
|
|
23
23
|
|
|
24
24
|
While an upload runs, the editor shows the image from a temporary local URL and blocks native form submission, so a form cannot save a half-done upload. A failed upload removes the image and calls `onUploadError` if you pass one; without it, the editor logs the error and continues with the next file.
|
|
25
25
|
|
|
26
|
+
## Load the editor lazily
|
|
27
|
+
|
|
28
|
+
The editor uses Tiptap and is large (about 166 KB gzip). Load it lazily when it is not on the first screen, such as in a dialog or an edit form.
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
import { lazy, Suspense } from "react";
|
|
32
|
+
|
|
33
|
+
const MarkdownEditor = lazy(() =>
|
|
34
|
+
import("@hitch42/applet/react/markdown-editor").then((m) => ({ default: m.MarkdownEditor })),
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
<Suspense fallback={<div className="min-h-32" />}>
|
|
38
|
+
<MarkdownEditor value={value} onChange={setValue} files={hitch.files} />
|
|
39
|
+
</Suspense>;
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Use the `/react/markdown-editor` path for the lazy import. A lazy import from `@hitch42/applet/react` does not split the editor out when the applet also imports `Markdown`.
|
|
43
|
+
|
|
26
44
|
## Render markdown
|
|
27
45
|
|
|
28
46
|
Pass the same files surface to `Markdown`:
|
|
29
47
|
|
|
30
48
|
```tsx
|
|
31
49
|
import { hitch } from "@hitch42/applet/client";
|
|
32
|
-
import { Markdown } from "@hitch42/applet/react";
|
|
50
|
+
import { Markdown } from "@hitch42/applet/react/markdown";
|
|
33
51
|
|
|
34
52
|
<Markdown files={hitch.files}>{value}</Markdown>;
|
|
35
53
|
```
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@import "tailwindcss";
|
|
2
2
|
@import "tw-animate-css";
|
|
3
3
|
@import "shadcn/tailwind.css";
|
|
4
|
-
@import "@
|
|
4
|
+
@import "@hitch42/applet/inter.css";
|
|
5
5
|
@import "@fontsource-variable/geist-mono";
|
|
6
6
|
|
|
7
7
|
@source "../../../node_modules/@hitch42/applet/dist/react.js";
|
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
--font-heading: var(--font-sans);
|
|
15
15
|
--font-sans: "Inter Variable", sans-serif;
|
|
16
16
|
--font-mono: "Geist Mono Variable", monospace;
|
|
17
|
+
/* Inter's single-storey a and open digits, as in the Hitch dashboard. Geist
|
|
18
|
+
Mono maps the same tags to its own alternates, so mono text resets them. */
|
|
19
|
+
--font-sans--font-feature-settings: "cv11", "ss01";
|
|
20
|
+
--font-heading--font-feature-settings: "cv11", "ss01";
|
|
21
|
+
--font-mono--font-feature-settings: normal;
|
|
17
22
|
--color-sidebar-ring: var(--sidebar-ring);
|
|
18
23
|
--color-sidebar-border: var(--sidebar-border);
|
|
19
24
|
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
package/dist/build-CeRZYhM9.js
DELETED
package/dist/email-WA4jnzZ0.js
DELETED
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
import { oc } from "@orpc/contract";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
//#region src/hitch/email.ts
|
|
4
|
-
const emailTagKeySchema = z.string().regex(/^[A-Za-z][A-Za-z0-9_]{0,63}$/);
|
|
5
|
-
const emailTagsSchema = z.record(emailTagKeySchema, z.string().min(1).max(200)).refine((tags) => Object.keys(tags).length <= 10);
|
|
6
|
-
const createEmailPixelInputSchema = z.object({ tags: emailTagsSchema.optional() }).strict();
|
|
7
|
-
const createEmailPixelOutputSchema = z.object({
|
|
8
|
-
id: z.uuid(),
|
|
9
|
-
url: z.url()
|
|
10
|
-
});
|
|
11
|
-
const getEmailTrackerInputSchema = z.object({ id: z.uuid() });
|
|
12
|
-
const markEmailTrackerSentInputSchema = z.object({
|
|
13
|
-
id: z.uuid(),
|
|
14
|
-
sentAt: z.iso.datetime({ offset: true }).optional()
|
|
15
|
-
}).strict();
|
|
16
|
-
const markEmailTrackerSentBodySchema = z.object({ sentAt: z.iso.datetime({ offset: true }).optional() }).strict();
|
|
17
|
-
const emailTrackerSchema = z.object({
|
|
18
|
-
id: z.uuid(),
|
|
19
|
-
url: z.url(),
|
|
20
|
-
tags: emailTagsSchema,
|
|
21
|
-
createdAt: z.iso.datetime(),
|
|
22
|
-
sentAt: z.iso.datetime().nullable(),
|
|
23
|
-
firstHitAt: z.iso.datetime().nullable(),
|
|
24
|
-
lastHitAt: z.iso.datetime().nullable()
|
|
25
|
-
});
|
|
26
|
-
const listEmailTrackersInputSchema = z.object({
|
|
27
|
-
filter: emailTagsSchema.optional(),
|
|
28
|
-
sentAt: z.object({
|
|
29
|
-
$gte: z.iso.datetime({ offset: true }).optional(),
|
|
30
|
-
$lt: z.iso.datetime({ offset: true }).optional()
|
|
31
|
-
}).strict().optional(),
|
|
32
|
-
cursor: z.uuid().optional(),
|
|
33
|
-
limit: z.number().int().min(1).max(200).optional()
|
|
34
|
-
}).strict();
|
|
35
|
-
const listEmailTrackersOutputSchema = z.object({
|
|
36
|
-
trackers: z.array(emailTrackerSchema),
|
|
37
|
-
nextCursor: z.uuid().nullable()
|
|
38
|
-
});
|
|
39
|
-
function emailContract(appletCode) {
|
|
40
|
-
const path = `/v1/applets/${encodeURIComponent(appletCode)}/email/tracking`;
|
|
41
|
-
return {
|
|
42
|
-
mailboxes: { list: oc.route({
|
|
43
|
-
method: "GET",
|
|
44
|
-
path: "/v1/email/mailboxes"
|
|
45
|
-
}).input(z.void()).output(listHitchEmailMailboxesOutputSchema) },
|
|
46
|
-
threads: {
|
|
47
|
-
list: oc.route({
|
|
48
|
-
method: "GET",
|
|
49
|
-
path: "/v1/email/threads"
|
|
50
|
-
}).input(listHitchEmailThreadsInputSchema).output(listHitchEmailThreadsOutputSchema),
|
|
51
|
-
get: oc.route({
|
|
52
|
-
method: "GET",
|
|
53
|
-
path: "/v1/email/threads/{id}"
|
|
54
|
-
}).input(hitchEmailIdInputSchema).output(hitchEmailThreadSchema)
|
|
55
|
-
},
|
|
56
|
-
messages: {
|
|
57
|
-
list: oc.route({
|
|
58
|
-
method: "GET",
|
|
59
|
-
path: "/v1/email/messages"
|
|
60
|
-
}).input(listHitchEmailMessagesInputSchema).output(listHitchEmailMessagesOutputSchema),
|
|
61
|
-
get: oc.route({
|
|
62
|
-
method: "GET",
|
|
63
|
-
path: "/v1/email/messages/{id}"
|
|
64
|
-
}).input(hitchEmailIdInputSchema).output(hitchEmailMessageSchema),
|
|
65
|
-
send: oc.route({
|
|
66
|
-
method: "POST",
|
|
67
|
-
path: "/v1/email/messages",
|
|
68
|
-
successStatus: 201
|
|
69
|
-
}).input(sendHitchEmailInputSchema).output(hitchEmailMessageSchema),
|
|
70
|
-
raw: oc.route({
|
|
71
|
-
method: "GET",
|
|
72
|
-
path: "/v1/email/messages/{id}/raw"
|
|
73
|
-
}).input(hitchEmailIdInputSchema).output(getHitchEmailRawOutputSchema)
|
|
74
|
-
},
|
|
75
|
-
attachments: { get: oc.route({
|
|
76
|
-
method: "GET",
|
|
77
|
-
path: "/v1/email/attachments/{id}"
|
|
78
|
-
}).input(hitchEmailIdInputSchema).output(getHitchEmailAttachmentOutputSchema) },
|
|
79
|
-
tracking: {
|
|
80
|
-
createPixel: oc.route({
|
|
81
|
-
method: "POST",
|
|
82
|
-
path: `${path}/pixels`,
|
|
83
|
-
successStatus: 201
|
|
84
|
-
}).input(createEmailPixelInputSchema.optional()).output(createEmailPixelOutputSchema),
|
|
85
|
-
markSent: oc.route({
|
|
86
|
-
method: "POST",
|
|
87
|
-
path: `${path}/{id}/sent`
|
|
88
|
-
}).input(markEmailTrackerSentInputSchema).output(emailTrackerSchema),
|
|
89
|
-
get: oc.route({
|
|
90
|
-
method: "GET",
|
|
91
|
-
path: `${path}/{id}`
|
|
92
|
-
}).input(getEmailTrackerInputSchema).output(emailTrackerSchema),
|
|
93
|
-
list: oc.route({
|
|
94
|
-
method: "POST",
|
|
95
|
-
path: `${path}/list`
|
|
96
|
-
}).input(listEmailTrackersInputSchema.optional()).output(listEmailTrackersOutputSchema)
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
const hitchEmailAddressSchema = z.object({
|
|
101
|
-
address: z.string(),
|
|
102
|
-
name: z.string().nullable()
|
|
103
|
-
});
|
|
104
|
-
const hitchMailboxSchema = z.object({
|
|
105
|
-
id: z.uuid(),
|
|
106
|
-
address: z.string(),
|
|
107
|
-
label: z.string(),
|
|
108
|
-
enabled: z.boolean(),
|
|
109
|
-
receive: z.boolean(),
|
|
110
|
-
canRead: z.boolean(),
|
|
111
|
-
canSend: z.boolean()
|
|
112
|
-
});
|
|
113
|
-
const hitchEmailAttachmentSchema = z.object({
|
|
114
|
-
id: z.uuid(),
|
|
115
|
-
filename: z.string(),
|
|
116
|
-
contentType: z.string(),
|
|
117
|
-
sizeBytes: z.number(),
|
|
118
|
-
contentId: z.string().nullable(),
|
|
119
|
-
inline: z.boolean()
|
|
120
|
-
});
|
|
121
|
-
const hitchEmailMessageSchema = z.object({
|
|
122
|
-
id: z.uuid(),
|
|
123
|
-
mailboxId: z.uuid(),
|
|
124
|
-
threadId: z.uuid(),
|
|
125
|
-
direction: z.enum(["inbound", "outbound"]),
|
|
126
|
-
status: z.enum([
|
|
127
|
-
"received",
|
|
128
|
-
"unknown",
|
|
129
|
-
"sent",
|
|
130
|
-
"failed"
|
|
131
|
-
]),
|
|
132
|
-
messageId: z.string().nullable(),
|
|
133
|
-
inReplyTo: z.string().nullable(),
|
|
134
|
-
references: z.array(z.string()),
|
|
135
|
-
from: hitchEmailAddressSchema,
|
|
136
|
-
to: z.array(hitchEmailAddressSchema),
|
|
137
|
-
cc: z.array(hitchEmailAddressSchema),
|
|
138
|
-
bcc: z.array(hitchEmailAddressSchema),
|
|
139
|
-
replyTo: z.array(hitchEmailAddressSchema),
|
|
140
|
-
subject: z.string(),
|
|
141
|
-
text: z.string().nullable(),
|
|
142
|
-
html: z.string().nullable(),
|
|
143
|
-
sentAt: z.string().nullable(),
|
|
144
|
-
automated: z.string().nullable(),
|
|
145
|
-
authentication: z.object({
|
|
146
|
-
spf: z.string().nullable(),
|
|
147
|
-
dkim: z.string().nullable(),
|
|
148
|
-
dmarc: z.string().nullable()
|
|
149
|
-
}).nullable(),
|
|
150
|
-
parseError: z.string().nullable(),
|
|
151
|
-
attachments: z.array(hitchEmailAttachmentSchema),
|
|
152
|
-
userId: z.uuid().nullable(),
|
|
153
|
-
appletId: z.uuid().nullable(),
|
|
154
|
-
requestId: z.string().nullable(),
|
|
155
|
-
errorDetail: z.string().nullable(),
|
|
156
|
-
createdAt: z.string()
|
|
157
|
-
});
|
|
158
|
-
const hitchEmailThreadSchema = z.object({
|
|
159
|
-
id: z.uuid(),
|
|
160
|
-
mailboxId: z.uuid(),
|
|
161
|
-
subject: z.string(),
|
|
162
|
-
messageCount: z.number(),
|
|
163
|
-
lastMessageAt: z.string(),
|
|
164
|
-
createdAt: z.string()
|
|
165
|
-
});
|
|
166
|
-
const listHitchEmailMailboxesOutputSchema = z.object({ data: z.array(hitchMailboxSchema) });
|
|
167
|
-
const listHitchEmailThreadsOutputSchema = z.object({
|
|
168
|
-
data: z.array(hitchEmailThreadSchema),
|
|
169
|
-
nextCursor: z.string().nullable()
|
|
170
|
-
});
|
|
171
|
-
const listHitchEmailMessagesOutputSchema = z.object({
|
|
172
|
-
data: z.array(hitchEmailMessageSchema),
|
|
173
|
-
nextCursor: z.string().nullable()
|
|
174
|
-
});
|
|
175
|
-
const getHitchEmailRawOutputSchema = z.object({ url: z.string() });
|
|
176
|
-
const getHitchEmailAttachmentOutputSchema = z.object({
|
|
177
|
-
url: z.string(),
|
|
178
|
-
filename: z.string(),
|
|
179
|
-
contentType: z.string(),
|
|
180
|
-
sizeBytes: z.number()
|
|
181
|
-
});
|
|
182
|
-
const hitchEmailIdInputSchema = z.object({ id: z.uuid() });
|
|
183
|
-
const listHitchEmailThreadsInputSchema = z.object({
|
|
184
|
-
mailboxId: z.uuid().optional(),
|
|
185
|
-
cursor: z.string().optional(),
|
|
186
|
-
limit: z.number().int().min(1).max(200).optional()
|
|
187
|
-
});
|
|
188
|
-
const listHitchEmailMessagesInputSchema = z.object({
|
|
189
|
-
mailboxId: z.uuid().optional(),
|
|
190
|
-
address: z.string().optional(),
|
|
191
|
-
threadId: z.uuid().optional(),
|
|
192
|
-
direction: z.enum(["inbound", "outbound"]).optional(),
|
|
193
|
-
since: z.iso.datetime().optional(),
|
|
194
|
-
until: z.iso.datetime().optional(),
|
|
195
|
-
cursor: z.string().optional(),
|
|
196
|
-
limit: z.number().int().min(1).max(50).optional()
|
|
197
|
-
});
|
|
198
|
-
const sendHitchEmailInputSchema = z.object({
|
|
199
|
-
mailboxId: z.uuid(),
|
|
200
|
-
to: z.array(z.string()).max(50).optional(),
|
|
201
|
-
cc: z.array(z.string()).max(50).optional(),
|
|
202
|
-
bcc: z.array(z.string()).max(50).optional(),
|
|
203
|
-
subject: z.string().max(998).optional(),
|
|
204
|
-
text: z.string().optional(),
|
|
205
|
-
html: z.string().optional(),
|
|
206
|
-
replyToMessageId: z.uuid().optional(),
|
|
207
|
-
attachmentFileIds: z.array(z.uuid()).max(32).optional(),
|
|
208
|
-
requestId: z.string().min(1).max(200).optional()
|
|
209
|
-
});
|
|
210
|
-
//#endregion
|
|
211
|
-
export { markEmailTrackerSentBodySchema as C, listHitchEmailThreadsOutputSchema as S, sendHitchEmailInputSchema as T, listEmailTrackersOutputSchema as _, emailTagsSchema as a, listHitchEmailMessagesOutputSchema as b, getHitchEmailAttachmentOutputSchema as c, hitchEmailAttachmentSchema as d, hitchEmailIdInputSchema as f, listEmailTrackersInputSchema as g, hitchMailboxSchema as h, emailTagKeySchema as i, getHitchEmailRawOutputSchema as l, hitchEmailThreadSchema as m, createEmailPixelOutputSchema as n, emailTrackerSchema as o, hitchEmailMessageSchema as p, emailContract as r, getEmailTrackerInputSchema as s, createEmailPixelInputSchema as t, hitchEmailAddressSchema as u, listHitchEmailMailboxesOutputSchema as v, markEmailTrackerSentInputSchema as w, listHitchEmailThreadsInputSchema as x, listHitchEmailMessagesInputSchema as y };
|