@webamoki/web-svelte 0.7.4 → 0.8.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/README.md +1 -1
- package/dist/components/ui/choice/Choice.svelte +5 -2
- package/dist/components/ui/choice/ChoiceInternal.svelte +5 -2
- package/dist/components/ui/choice/ChoiceMulti.svelte +5 -2
- package/dist/utils/datetime/index.d.ts +2 -2
- package/dist/utils/email/ses.d.ts +3 -5
- package/dist/utils/email/ses.js +9 -17
- package/package.json +31 -31
package/README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
-
export interface ChoiceProps<
|
|
3
|
-
|
|
2
|
+
export interface ChoiceProps<
|
|
3
|
+
V,
|
|
4
|
+
I,
|
|
5
|
+
K extends string | number | symbol
|
|
6
|
+
> extends ChoiceInternalProps<V, I, K> {
|
|
4
7
|
value?: V;
|
|
5
8
|
onChange?: (value: V) => void;
|
|
6
9
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
-
export interface ChoiceInternalProps<
|
|
3
|
-
|
|
2
|
+
export interface ChoiceInternalProps<
|
|
3
|
+
V,
|
|
4
|
+
I,
|
|
5
|
+
K extends string | number | symbol
|
|
6
|
+
> extends Partial<FormAttrs> {
|
|
4
7
|
items: readonly I[];
|
|
5
8
|
getKey: (item: I) => K;
|
|
6
9
|
getLabel: (item: I) => string;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
-
export interface ChoiceMultiProps<
|
|
3
|
-
|
|
2
|
+
export interface ChoiceMultiProps<
|
|
3
|
+
V,
|
|
4
|
+
I,
|
|
5
|
+
K extends string | number | symbol
|
|
6
|
+
> extends ChoiceInternalProps<V, I, K> {
|
|
4
7
|
value: V[];
|
|
5
8
|
onAdd?: (value: V) => void;
|
|
6
9
|
onRemove?: (value: V) => void;
|
|
@@ -162,11 +162,11 @@ export declare function formatAbsolute(datetime: ZonedDateTime): string;
|
|
|
162
162
|
* @param raw - The snapshot of the CalendarDate object.
|
|
163
163
|
* @returns The unfrozen CalendarDate object.
|
|
164
164
|
*/
|
|
165
|
-
export declare function unfreezeDate(raw: $state.
|
|
165
|
+
export declare function unfreezeDate(raw: ReturnType<typeof $state.snapshot<CalendarDate>>): CalendarDate;
|
|
166
166
|
/**
|
|
167
167
|
* Unfreezes a Time object from a snapshot.
|
|
168
168
|
* @param raw - The snapshot of the Time object.
|
|
169
169
|
* @returns The unfrozen Time object.
|
|
170
170
|
*/
|
|
171
|
-
export declare function unfreezeTime(raw: $state.
|
|
171
|
+
export declare function unfreezeTime(raw: ReturnType<typeof $state.snapshot<Time>>): Time;
|
|
172
172
|
export declare const dateTransport: Transport;
|
|
@@ -8,16 +8,14 @@ export interface SendEmailOptions {
|
|
|
8
8
|
from: string;
|
|
9
9
|
fromName?: string;
|
|
10
10
|
replyTo?: string | string[];
|
|
11
|
+
awsRegion: string;
|
|
12
|
+
awsAccessKeyId: string;
|
|
13
|
+
awsSecretAccessKey: string;
|
|
11
14
|
}
|
|
12
15
|
/**
|
|
13
16
|
* Send an email using AWS SES API.
|
|
14
17
|
* Uses AWS Signature V4 signing and fetch API for Cloudflare Workers compatibility.
|
|
15
18
|
*
|
|
16
|
-
* Environment variables required:
|
|
17
|
-
* - AWS_REGION
|
|
18
|
-
* - AWS_ACCESS_KEY_ID
|
|
19
|
-
* - AWS_SECRET_ACCESS_KEY
|
|
20
|
-
*
|
|
21
19
|
* @returns messageId returned by SES
|
|
22
20
|
*/
|
|
23
21
|
export declare function sendEmail(options: SendEmailOptions): Promise<string>;
|
package/dist/utils/email/ses.js
CHANGED
|
@@ -3,17 +3,12 @@ import { signRequest } from './aws-signer.js';
|
|
|
3
3
|
* Send an email using AWS SES API.
|
|
4
4
|
* Uses AWS Signature V4 signing and fetch API for Cloudflare Workers compatibility.
|
|
5
5
|
*
|
|
6
|
-
* Environment variables required:
|
|
7
|
-
* - AWS_REGION
|
|
8
|
-
* - AWS_ACCESS_KEY_ID
|
|
9
|
-
* - AWS_SECRET_ACCESS_KEY
|
|
10
|
-
*
|
|
11
6
|
* @returns messageId returned by SES
|
|
12
7
|
*/
|
|
13
8
|
export async function sendEmail(options) {
|
|
14
9
|
if (!options)
|
|
15
10
|
throw new Error('sendEmail: options is required');
|
|
16
|
-
const { to, cc, bcc, subject, text, html, from, fromName, replyTo } = options;
|
|
11
|
+
const { to, cc, bcc, subject, text, html, from, fromName, replyTo, awsRegion, awsAccessKeyId, awsSecretAccessKey } = options;
|
|
17
12
|
if (!subject) {
|
|
18
13
|
throw new Error('sendEmail: subject is required');
|
|
19
14
|
}
|
|
@@ -38,12 +33,9 @@ export async function sendEmail(options) {
|
|
|
38
33
|
if (!toAddresses || toAddresses.length === 0) {
|
|
39
34
|
throw new Error('sendEmail: at least one valid recipient is required (to)');
|
|
40
35
|
}
|
|
41
|
-
//
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const secretAccessKey = process.env.AWS_SECRET_ACCESS_KEY;
|
|
45
|
-
if (!region || !accessKeyId || !secretAccessKey) {
|
|
46
|
-
throw new Error('sendEmail: missing required environment variables (AWS_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)');
|
|
36
|
+
// Validate AWS credentials
|
|
37
|
+
if (!awsRegion || !awsAccessKeyId || !awsSecretAccessKey) {
|
|
38
|
+
throw new Error('sendEmail: missing required AWS credentials (awsRegion, awsAccessKeyId, awsSecretAccessKey)');
|
|
47
39
|
}
|
|
48
40
|
// Format source with optional fromName
|
|
49
41
|
const source = fromName ? `${fromName} <${from}>` : from;
|
|
@@ -76,16 +68,16 @@ export async function sendEmail(options) {
|
|
|
76
68
|
params.append('Message.Body.Text.Charset', 'UTF-8');
|
|
77
69
|
}
|
|
78
70
|
const body = params.toString();
|
|
79
|
-
const host = `email.${
|
|
71
|
+
const host = `email.${awsRegion}.amazonaws.com`;
|
|
80
72
|
const path = '/';
|
|
81
73
|
try {
|
|
82
74
|
// Sign the request
|
|
83
75
|
const { headers } = await signRequest('POST', host, path, body, {
|
|
84
|
-
accessKeyId,
|
|
85
|
-
secretAccessKey,
|
|
86
|
-
region
|
|
76
|
+
accessKeyId: awsAccessKeyId,
|
|
77
|
+
secretAccessKey: awsSecretAccessKey,
|
|
78
|
+
region: awsRegion
|
|
87
79
|
});
|
|
88
|
-
// Make the
|
|
80
|
+
// Make the request
|
|
89
81
|
const response = await fetch(`https://${host}${path}`, {
|
|
90
82
|
method: 'POST',
|
|
91
83
|
headers: {
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.8.0",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -72,57 +72,57 @@
|
|
|
72
72
|
"sveltekit-superforms": "^2.28.1"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@changesets/cli": "^2.
|
|
75
|
+
"@changesets/cli": "^2.30.0",
|
|
76
76
|
"@eslint/compat": "^1.4.1",
|
|
77
|
-
"@eslint/js": "^9.39.
|
|
77
|
+
"@eslint/js": "^9.39.4",
|
|
78
78
|
"@sveltejs/adapter-cloudflare": "^7.2.8",
|
|
79
|
-
"@sveltejs/kit": "^2.
|
|
80
|
-
"@sveltejs/package": "^2.5.
|
|
81
|
-
"@sveltejs/vite-plugin-svelte": "^6.2.
|
|
82
|
-
"@tailwindcss/forms": "^0.5.
|
|
79
|
+
"@sveltejs/kit": "^2.53.4",
|
|
80
|
+
"@sveltejs/package": "^2.5.7",
|
|
81
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
82
|
+
"@tailwindcss/forms": "^0.5.11",
|
|
83
83
|
"@tailwindcss/typography": "^0.5.19",
|
|
84
|
-
"@tailwindcss/vite": "^4.1
|
|
85
|
-
"@types/node": "^22.19.
|
|
84
|
+
"@tailwindcss/vite": "^4.2.1",
|
|
85
|
+
"@types/node": "^22.19.15",
|
|
86
86
|
"@types/ramda": "^0.31.1",
|
|
87
87
|
"@types/sorted-array-functions": "^1.3.3",
|
|
88
88
|
"clsx": "^2.1.1",
|
|
89
|
-
"eslint": "^9.39.
|
|
89
|
+
"eslint": "^9.39.4",
|
|
90
90
|
"eslint-config-prettier": "^10.1.8",
|
|
91
|
-
"eslint-plugin-svelte": "^3.
|
|
91
|
+
"eslint-plugin-svelte": "^3.15.2",
|
|
92
92
|
"globals": "^16.5.0",
|
|
93
|
-
"prettier": "^3.
|
|
94
|
-
"prettier-plugin-svelte": "^3.
|
|
95
|
-
"prettier-plugin-tailwindcss": "^0.
|
|
96
|
-
"publint": "^0.3.
|
|
97
|
-
"shiki": "^3.
|
|
98
|
-
"svelte": "^5.
|
|
99
|
-
"svelte-check": "^4.
|
|
100
|
-
"tailwind-merge": "^3.
|
|
101
|
-
"tailwind-variants": "^3.
|
|
102
|
-
"tailwindcss": "^4.1
|
|
93
|
+
"prettier": "^3.8.1",
|
|
94
|
+
"prettier-plugin-svelte": "^3.5.1",
|
|
95
|
+
"prettier-plugin-tailwindcss": "^0.7.2",
|
|
96
|
+
"publint": "^0.3.18",
|
|
97
|
+
"shiki": "^3.23.0",
|
|
98
|
+
"svelte": "^5.53.9",
|
|
99
|
+
"svelte-check": "^4.4.5",
|
|
100
|
+
"tailwind-merge": "^3.5.0",
|
|
101
|
+
"tailwind-variants": "^3.2.2",
|
|
102
|
+
"tailwindcss": "^4.2.1",
|
|
103
103
|
"tw-animate-css": "^1.4.0",
|
|
104
104
|
"typescript": "^5.9.3",
|
|
105
|
-
"typescript-eslint": "^8.
|
|
106
|
-
"vite": "^7.
|
|
105
|
+
"typescript-eslint": "^8.57.0",
|
|
106
|
+
"vite": "^7.3.1",
|
|
107
107
|
"vitest": "^3.2.4"
|
|
108
108
|
},
|
|
109
109
|
"keywords": [
|
|
110
110
|
"svelte"
|
|
111
111
|
],
|
|
112
112
|
"dependencies": {
|
|
113
|
-
"@internationalized/date": "^3.
|
|
113
|
+
"@internationalized/date": "^3.12.0",
|
|
114
114
|
"@lucide/svelte": "^0.553.0",
|
|
115
|
-
"@sveltejs/adapter-auto": "^7.0.
|
|
116
|
-
"arktype": "^2.
|
|
117
|
-
"bits-ui": "^2.
|
|
118
|
-
"devalue": "^5.
|
|
115
|
+
"@sveltejs/adapter-auto": "^7.0.1",
|
|
116
|
+
"arktype": "^2.2.0",
|
|
117
|
+
"bits-ui": "^2.16.3",
|
|
118
|
+
"devalue": "^5.6.3",
|
|
119
119
|
"drizzle-orm": "^0.44.7",
|
|
120
120
|
"formsnap": "^2.0.1",
|
|
121
121
|
"ramda": "^0.31.3",
|
|
122
122
|
"sorted-array-functions": "^1.3.0",
|
|
123
|
-
"svelte-awesome-color-picker": "^4.1.
|
|
124
|
-
"svelte-sonner": "^1.0
|
|
125
|
-
"sveltekit-superforms": "^2.
|
|
123
|
+
"svelte-awesome-color-picker": "^4.1.1",
|
|
124
|
+
"svelte-sonner": "^1.1.0",
|
|
125
|
+
"sveltekit-superforms": "^2.30.0"
|
|
126
126
|
},
|
|
127
127
|
"scripts": {
|
|
128
128
|
"dev": "vite dev",
|