sms-verification-api 0.9.1 → 0.9.7
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/CHANGELOG.md +71 -0
- package/examples/{client.js → client.ts} +105 -119
- package/examples/{libphonenumber-example.js → libphonenumber-example.ts} +1 -1
- package/package.json +16 -14
- package/src/identity-verification-server.ts +385 -261
- package/src/{index.js → index.ts} +1 -1
- package/src/sns.ts +265 -0
- package/src/{verify-phone-server.js → verify-phone-server.ts} +206 -151
- package/src/verify-phone.ts +48 -22
- package/test/{api.test.js → api.test.ts} +20 -16
- package/test/{integration.test.js → integration.test.ts} +10 -10
- package/test/{server.test.js → server.test.ts} +3 -3
- package/test/{verify.test.js → verify.test.ts} +20 -23
- package/test/{voip.test.js → voip.test.ts} +13 -12
- package/tsconfig.json +24 -0
- package/{vitest.config.js → vitest.config.ts} +1 -1
- package/wrangler.toml +1 -4
- package/src/sns.js +0 -236
- /package/test/{metadata-test.js → metadata-test.ts} +0 -0
- /package/test/{setup.js → setup.ts} +0 -0
- /package/test/{utils.test.js → utils.test.ts} +0 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
|
+
|
|
5
|
+
### [0.9.5](https://github.com/OpenSourceAGI/appdemo-dev-tools/compare/v0.9.3...v0.9.5) (2026-05-23)
|
|
6
|
+
|
|
7
|
+
### [0.9.3](https://github.com/OpenSourceAGI/appdemo-dev-tools/compare/v1.1.5...v0.9.3) (2026-05-23)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* add initial setup for Svelte template with Cloudflare Workers ([791308a](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/791308aee06fc0a01fecde061a7f8a0372329464))
|
|
13
|
+
* add theme toggle component and integrate WebGL shader background ([56551a3](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/56551a35ee3246d9d7530f88bbf91546e3c4e1fa))
|
|
14
|
+
* implement risk-based tool classification, runtime security policies, and granular configuration for OpenAPI MCP generators ([91ad054](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/91ad054b893f3807a5100eba4bf1953ef467815d))
|
|
15
|
+
* implement Sparkles decorative component and enhance home page UI aesthetics while updating git ignore rules. ([4f91b06](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/4f91b06ad0be897edf24a0dd160d02a385a1f4d7))
|
|
16
|
+
* scaffold shadcn demo environment and expand theme collection in theme-dropdown ([b366c1d](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/b366c1d39ca46556c6f4e597265b3af6236657c7))
|
|
17
|
+
* update system info installation and enhance theme styles ([46ead08](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/46ead086bfceeb49862c8054f4641134285d1ace))
|
|
18
|
+
* **vscode-cloud:** add Cloudflare Workers observability config ([#30](https://github.com/OpenSourceAGI/appdemo-dev-tools/issues/30)) ([c3b17c8](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/c3b17c8265e63895d77ec8124c321e65cbaff75f))
|
|
19
|
+
* **vscode-cloud:** add Cloudflare Workers observability config ([#31](https://github.com/OpenSourceAGI/appdemo-dev-tools/issues/31)) ([aebc1f3](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/aebc1f35fc56c0b99c9ccacb39e707bd73e5e20d))
|
|
20
|
+
* **vscode-cloud:** enhance Dockerfile with multi-language runtimes and language servers ([#27](https://github.com/OpenSourceAGI/appdemo-dev-tools/issues/27)) ([a43daf8](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/a43daf8b0081139c6854355b3a6e6b5e1ec4202a))
|
|
21
|
+
* **vscode-cloud:** enhance Dockerfile with multi-language runtimes and language servers ([#28](https://github.com/OpenSourceAGI/appdemo-dev-tools/issues/28)) ([2792bc6](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/2792bc6a6e0719be3fd9d60867e5726fdc2f23ef))
|
|
22
|
+
* **vscode-cloud:** enhance Dockerfile with multi-language runtimes and language servers ([#29](https://github.com/OpenSourceAGI/appdemo-dev-tools/issues/29)) ([7b91874](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/7b91874b86b2026bcc61a25ed4ee78f5f52118da))
|
|
23
|
+
* **vscode-cloud:** fix internet access, type safety, and improve UX ([a5827d6](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/a5827d66023c8fa382a400416e04b7e634f0c1bb))
|
|
24
|
+
* **vscode-cloud:** passwordless login, landing page, and pre-installed AI/dev extensions ([5765f80](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/5765f806961e32fd11e9fcab9e58e78e57835c61))
|
|
25
|
+
* **vscode-cloud:** provision KV namespace and D1 database IDs for deploy ([ad463e9](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/ad463e905c3c3c80665d4ad158fb147cb44f3358))
|
|
26
|
+
* **vscode-cloud:** provision KV namespace and D1 database IDs for deploy ([#24](https://github.com/OpenSourceAGI/appdemo-dev-tools/issues/24)) ([3cc9246](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/3cc924655c708f881ad352df83ff9eeaf289796d))
|
|
27
|
+
* **vscode-cloud:** teams dashboard, WakaTime tracking, and updated landing page ([815ff09](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/815ff0930778ba2e4c42e7a5cac62eb3df6d0454))
|
|
28
|
+
|
|
29
|
+
### [0.9.2](https://github.com/OpenSourceAGI/appdemo-dev-tools/compare/v1.1.5...v0.9.2) (2026-05-23)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Features
|
|
33
|
+
|
|
34
|
+
* add initial setup for Svelte template with Cloudflare Workers ([791308a](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/791308aee06fc0a01fecde061a7f8a0372329464))
|
|
35
|
+
* add theme toggle component and integrate WebGL shader background ([56551a3](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/56551a35ee3246d9d7530f88bbf91546e3c4e1fa))
|
|
36
|
+
* implement risk-based tool classification, runtime security policies, and granular configuration for OpenAPI MCP generators ([91ad054](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/91ad054b893f3807a5100eba4bf1953ef467815d))
|
|
37
|
+
* implement Sparkles decorative component and enhance home page UI aesthetics while updating git ignore rules. ([4f91b06](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/4f91b06ad0be897edf24a0dd160d02a385a1f4d7))
|
|
38
|
+
* scaffold shadcn demo environment and expand theme collection in theme-dropdown ([b366c1d](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/b366c1d39ca46556c6f4e597265b3af6236657c7))
|
|
39
|
+
* update system info installation and enhance theme styles ([46ead08](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/46ead086bfceeb49862c8054f4641134285d1ace))
|
|
40
|
+
* **vscode-cloud:** add Cloudflare Workers observability config ([#30](https://github.com/OpenSourceAGI/appdemo-dev-tools/issues/30)) ([c3b17c8](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/c3b17c8265e63895d77ec8124c321e65cbaff75f))
|
|
41
|
+
* **vscode-cloud:** add Cloudflare Workers observability config ([#31](https://github.com/OpenSourceAGI/appdemo-dev-tools/issues/31)) ([aebc1f3](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/aebc1f35fc56c0b99c9ccacb39e707bd73e5e20d))
|
|
42
|
+
* **vscode-cloud:** enhance Dockerfile with multi-language runtimes and language servers ([#27](https://github.com/OpenSourceAGI/appdemo-dev-tools/issues/27)) ([a43daf8](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/a43daf8b0081139c6854355b3a6e6b5e1ec4202a))
|
|
43
|
+
* **vscode-cloud:** enhance Dockerfile with multi-language runtimes and language servers ([#28](https://github.com/OpenSourceAGI/appdemo-dev-tools/issues/28)) ([2792bc6](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/2792bc6a6e0719be3fd9d60867e5726fdc2f23ef))
|
|
44
|
+
* **vscode-cloud:** enhance Dockerfile with multi-language runtimes and language servers ([#29](https://github.com/OpenSourceAGI/appdemo-dev-tools/issues/29)) ([7b91874](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/7b91874b86b2026bcc61a25ed4ee78f5f52118da))
|
|
45
|
+
* **vscode-cloud:** fix internet access, type safety, and improve UX ([a5827d6](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/a5827d66023c8fa382a400416e04b7e634f0c1bb))
|
|
46
|
+
* **vscode-cloud:** passwordless login, landing page, and pre-installed AI/dev extensions ([5765f80](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/5765f806961e32fd11e9fcab9e58e78e57835c61))
|
|
47
|
+
* **vscode-cloud:** provision KV namespace and D1 database IDs for deploy ([ad463e9](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/ad463e905c3c3c80665d4ad158fb147cb44f3358))
|
|
48
|
+
* **vscode-cloud:** provision KV namespace and D1 database IDs for deploy ([#24](https://github.com/OpenSourceAGI/appdemo-dev-tools/issues/24)) ([3cc9246](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/3cc924655c708f881ad352df83ff9eeaf289796d))
|
|
49
|
+
* **vscode-cloud:** teams dashboard, WakaTime tracking, and updated landing page ([815ff09](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/815ff0930778ba2e4c42e7a5cac62eb3df6d0454))
|
|
50
|
+
|
|
51
|
+
### [0.9.1](https://github.com/OpenSourceAGI/appdemo-dev-tools/compare/v1.1.5...v0.9.1) (2026-05-23)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
### Features
|
|
55
|
+
|
|
56
|
+
* add initial setup for Svelte template with Cloudflare Workers ([791308a](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/791308aee06fc0a01fecde061a7f8a0372329464))
|
|
57
|
+
* add theme toggle component and integrate WebGL shader background ([56551a3](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/56551a35ee3246d9d7530f88bbf91546e3c4e1fa))
|
|
58
|
+
* implement risk-based tool classification, runtime security policies, and granular configuration for OpenAPI MCP generators ([91ad054](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/91ad054b893f3807a5100eba4bf1953ef467815d))
|
|
59
|
+
* implement Sparkles decorative component and enhance home page UI aesthetics while updating git ignore rules. ([4f91b06](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/4f91b06ad0be897edf24a0dd160d02a385a1f4d7))
|
|
60
|
+
* scaffold shadcn demo environment and expand theme collection in theme-dropdown ([b366c1d](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/b366c1d39ca46556c6f4e597265b3af6236657c7))
|
|
61
|
+
* update system info installation and enhance theme styles ([46ead08](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/46ead086bfceeb49862c8054f4641134285d1ace))
|
|
62
|
+
* **vscode-cloud:** add Cloudflare Workers observability config ([#30](https://github.com/OpenSourceAGI/appdemo-dev-tools/issues/30)) ([c3b17c8](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/c3b17c8265e63895d77ec8124c321e65cbaff75f))
|
|
63
|
+
* **vscode-cloud:** add Cloudflare Workers observability config ([#31](https://github.com/OpenSourceAGI/appdemo-dev-tools/issues/31)) ([aebc1f3](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/aebc1f35fc56c0b99c9ccacb39e707bd73e5e20d))
|
|
64
|
+
* **vscode-cloud:** enhance Dockerfile with multi-language runtimes and language servers ([#27](https://github.com/OpenSourceAGI/appdemo-dev-tools/issues/27)) ([a43daf8](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/a43daf8b0081139c6854355b3a6e6b5e1ec4202a))
|
|
65
|
+
* **vscode-cloud:** enhance Dockerfile with multi-language runtimes and language servers ([#28](https://github.com/OpenSourceAGI/appdemo-dev-tools/issues/28)) ([2792bc6](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/2792bc6a6e0719be3fd9d60867e5726fdc2f23ef))
|
|
66
|
+
* **vscode-cloud:** enhance Dockerfile with multi-language runtimes and language servers ([#29](https://github.com/OpenSourceAGI/appdemo-dev-tools/issues/29)) ([7b91874](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/7b91874b86b2026bcc61a25ed4ee78f5f52118da))
|
|
67
|
+
* **vscode-cloud:** fix internet access, type safety, and improve UX ([a5827d6](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/a5827d66023c8fa382a400416e04b7e634f0c1bb))
|
|
68
|
+
* **vscode-cloud:** passwordless login, landing page, and pre-installed AI/dev extensions ([5765f80](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/5765f806961e32fd11e9fcab9e58e78e57835c61))
|
|
69
|
+
* **vscode-cloud:** provision KV namespace and D1 database IDs for deploy ([ad463e9](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/ad463e905c3c3c80665d4ad158fb147cb44f3358))
|
|
70
|
+
* **vscode-cloud:** provision KV namespace and D1 database IDs for deploy ([#24](https://github.com/OpenSourceAGI/appdemo-dev-tools/issues/24)) ([3cc9246](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/3cc924655c708f881ad352df83ff9eeaf289796d))
|
|
71
|
+
* **vscode-cloud:** teams dashboard, WakaTime tracking, and updated landing page ([815ff09](https://github.com/OpenSourceAGI/appdemo-dev-tools/commit/815ff0930778ba2e4c42e7a5cac62eb3df6d0454))
|
|
@@ -1,119 +1,105 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
})
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
'
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
console.log('
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
'
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
} catch (error) {
|
|
100
|
-
console.error('Error:', error);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
module.exports = SMSVerificationClient;
|
|
107
|
-
|
|
108
|
-
// Run example if this file is executed directly
|
|
109
|
-
if (require.main === module) {
|
|
110
|
-
example();
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// Browser usage
|
|
115
|
-
if (typeof window !== 'undefined') {
|
|
116
|
-
window.SMSVerificationClient = SMSVerificationClient;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export default SMSVerificationClient;
|
|
1
|
+
/**
|
|
2
|
+
* Example client for the SMS Verification API
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const API_BASE_URL = 'http://localhost:8787';
|
|
6
|
+
const API_KEY = 'sms_1234567890abcdef1234567890abcdef';
|
|
7
|
+
|
|
8
|
+
interface SendOptions {
|
|
9
|
+
blockVoip?: boolean;
|
|
10
|
+
senderId?: string;
|
|
11
|
+
messageTemplate?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface SmsOptions {
|
|
15
|
+
senderId?: string;
|
|
16
|
+
smsType?: 'Transactional' | 'Promotional';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
class SMSVerificationClient {
|
|
20
|
+
baseUrl: string;
|
|
21
|
+
apiKey: string;
|
|
22
|
+
|
|
23
|
+
constructor(baseUrl: string = API_BASE_URL, apiKey: string = API_KEY) {
|
|
24
|
+
this.baseUrl = baseUrl;
|
|
25
|
+
this.apiKey = apiKey;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async sendVerificationCode(phoneNumber: string, options: SendOptions = {}): Promise<any> {
|
|
29
|
+
const response = await fetch(`${this.baseUrl}/api/send`, {
|
|
30
|
+
method: 'POST',
|
|
31
|
+
headers: {
|
|
32
|
+
'Content-Type': 'application/json',
|
|
33
|
+
'X-API-Key': this.apiKey,
|
|
34
|
+
},
|
|
35
|
+
body: JSON.stringify({ phoneNumber, ...options }),
|
|
36
|
+
});
|
|
37
|
+
return response.json();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async verifyCode(phoneNumber: string, code: string): Promise<any> {
|
|
41
|
+
const response = await fetch(`${this.baseUrl}/api/verify`, {
|
|
42
|
+
method: 'POST',
|
|
43
|
+
headers: {
|
|
44
|
+
'Content-Type': 'application/json',
|
|
45
|
+
'X-API-Key': this.apiKey,
|
|
46
|
+
},
|
|
47
|
+
body: JSON.stringify({ phoneNumber, code }),
|
|
48
|
+
});
|
|
49
|
+
return response.json();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async sendGeneralSMS(phoneNumber: string, message: string, options: SmsOptions = {}): Promise<any> {
|
|
53
|
+
const response = await fetch(`${this.baseUrl}/api/sms`, {
|
|
54
|
+
method: 'POST',
|
|
55
|
+
headers: {
|
|
56
|
+
'Content-Type': 'application/json',
|
|
57
|
+
'X-API-Key': this.apiKey,
|
|
58
|
+
},
|
|
59
|
+
body: JSON.stringify({ phoneNumber, message, ...options }),
|
|
60
|
+
});
|
|
61
|
+
return response.json();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async checkHealth(): Promise<any> {
|
|
65
|
+
const response = await fetch(`${this.baseUrl}/health`);
|
|
66
|
+
return response.json();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async function example() {
|
|
71
|
+
const client = new SMSVerificationClient();
|
|
72
|
+
|
|
73
|
+
try {
|
|
74
|
+
console.log('Checking server health...');
|
|
75
|
+
const health = await client.checkHealth();
|
|
76
|
+
console.log('Health:', health);
|
|
77
|
+
|
|
78
|
+
console.log('\nSending verification code...');
|
|
79
|
+
const sendResult = await client.sendVerificationCode('+1234567890', {
|
|
80
|
+
blockVoip: true,
|
|
81
|
+
senderId: 'MyApp',
|
|
82
|
+
messageTemplate: 'Your verification code is: {code}. Valid for 10 minutes.',
|
|
83
|
+
});
|
|
84
|
+
console.log('Send result:', sendResult);
|
|
85
|
+
|
|
86
|
+
if (sendResult?.success) {
|
|
87
|
+
console.log('\nVerifying code...');
|
|
88
|
+
const verifyResult = await client.verifyCode('+1234567890', sendResult.code);
|
|
89
|
+
console.log('Verify result:', verifyResult);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
console.log('\nSending general SMS...');
|
|
93
|
+
const smsResult = await client.sendGeneralSMS(
|
|
94
|
+
'+1234567890',
|
|
95
|
+
'Hello from your app! This is a test message.',
|
|
96
|
+
{ senderId: 'MyApp' },
|
|
97
|
+
);
|
|
98
|
+
console.log('SMS result:', smsResult);
|
|
99
|
+
} catch (error) {
|
|
100
|
+
console.error('Error:', error);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export default SMSVerificationClient;
|
|
105
|
+
export { example };
|
package/package.json
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sms-verification-api",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.7",
|
|
4
4
|
"description": "SMS Phone Verification API using AWS SNS HTTP API with Hono server on Cloudflare Workers",
|
|
5
|
-
"main": "src/verify-phone.
|
|
5
|
+
"main": "src/verify-phone.ts",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"types": "./src/verify-phone.
|
|
8
|
-
"module": "./src/verify-phone.
|
|
7
|
+
"types": "./src/verify-phone.ts",
|
|
8
|
+
"module": "./src/verify-phone.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"types": "./src/verify-phone.
|
|
12
|
-
"import": "./src/verify-phone.
|
|
13
|
-
"require": "./src/verify-phone.
|
|
11
|
+
"types": "./src/verify-phone.ts",
|
|
12
|
+
"import": "./src/verify-phone.ts",
|
|
13
|
+
"require": "./src/verify-phone.ts"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"dev": "wrangler dev",
|
|
18
|
+
"typecheck": "tsc --noEmit",
|
|
18
19
|
"ship": "bun run standard-version --release-as patch; bun publish",
|
|
19
20
|
"deploy": "wrangler deploy",
|
|
20
21
|
"deploy:staging": "wrangler deploy --env staging",
|
|
@@ -29,9 +30,7 @@
|
|
|
29
30
|
"build:docs": "cd docs && bun run build",
|
|
30
31
|
"test": "vitest",
|
|
31
32
|
"test:run": "vitest run",
|
|
32
|
-
"test:ui": "vitest --ui"
|
|
33
|
-
"lint": "eslint .",
|
|
34
|
-
"format": "prettier --write ."
|
|
33
|
+
"test:ui": "vitest --ui"
|
|
35
34
|
},
|
|
36
35
|
"keywords": [
|
|
37
36
|
"sms",
|
|
@@ -51,17 +50,20 @@
|
|
|
51
50
|
"@hono/swagger-ui": "^0.5.2",
|
|
52
51
|
"@hono/zod-openapi": "^0.19.9",
|
|
53
52
|
"grab-api.js": "^0.9.131",
|
|
54
|
-
"hono": "^
|
|
53
|
+
"hono": "^4.0.0",
|
|
55
54
|
"hono-rate-limiter": "^0.2.2",
|
|
56
55
|
"libphonenumber-js": "^1.12.13"
|
|
57
56
|
},
|
|
58
57
|
"devDependencies": {
|
|
59
|
-
"
|
|
58
|
+
"@cloudflare/workers-types": "^4.20260507.1",
|
|
59
|
+
"@types/node": "^25.6.0",
|
|
60
|
+
"@vitest/ui": "^1.0.0",
|
|
60
61
|
"eslint": "^8.55.0",
|
|
61
62
|
"prettier": "^3.1.0",
|
|
63
|
+
"supertest": "^6.3.3",
|
|
64
|
+
"typescript": "^6.0.3",
|
|
62
65
|
"vitest": "^1.0.0",
|
|
63
|
-
"
|
|
64
|
-
"supertest": "^6.3.3"
|
|
66
|
+
"wrangler": "^4.24.0"
|
|
65
67
|
},
|
|
66
68
|
"repository": {
|
|
67
69
|
"type": "git",
|