verify-phone-sms 0.9.4

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.
Files changed (56) hide show
  1. package/.env.example +20 -0
  2. package/CHANGELOG.md +71 -0
  3. package/DEPLOYMENT.md +151 -0
  4. package/README.md +475 -0
  5. package/bun.lock +1110 -0
  6. package/docs/.source/index.ts +11 -0
  7. package/docs/.source/source.config.mjs +9 -0
  8. package/docs/app/(home)/layout.tsx +7 -0
  9. package/docs/app/(home)/page.tsx +38 -0
  10. package/docs/app/docs/[[...slug]]/page.tsx +59 -0
  11. package/docs/app/docs/layout.tsx +12 -0
  12. package/docs/app/docs-og/[...slug]/route.ts +24 -0
  13. package/docs/app/globals.css +587 -0
  14. package/docs/app/layout.config.tsx +13 -0
  15. package/docs/app/layout.tsx +27 -0
  16. package/docs/app/logo.tsx +35 -0
  17. package/docs/bun.lock +923 -0
  18. package/docs/content/docs/API_AUTHENTICATION.md +91 -0
  19. package/docs/content/docs/DEPLOYMENT.md +181 -0
  20. package/docs/content/docs/api/post.mdx +35 -0
  21. package/docs/content/docs/api/verify.mdx +34 -0
  22. package/docs/content/docs/meta.json +8 -0
  23. package/docs/content/docs/verify-legal-name.md +339 -0
  24. package/docs/lib/source.ts +14 -0
  25. package/docs/mdx-components.tsx +12 -0
  26. package/docs/next.config.mjs +51 -0
  27. package/docs/openapi.json +329 -0
  28. package/docs/package.json +37 -0
  29. package/docs/postcss.config.mjs +5 -0
  30. package/docs/scripts/generate-docs.mjs +23 -0
  31. package/docs/source.config.ts +5 -0
  32. package/docs/tsconfig.json +29 -0
  33. package/docs/worker.js +35 -0
  34. package/docs/wrangler.toml +26 -0
  35. package/examples/client.ts +105 -0
  36. package/examples/demo.html +325 -0
  37. package/examples/libphonenumber-example.ts +120 -0
  38. package/openapi.json +329 -0
  39. package/package.json +75 -0
  40. package/scripts/deploy.sh +63 -0
  41. package/src/identity-verification-server.ts +677 -0
  42. package/src/index.ts +8 -0
  43. package/src/sns.ts +265 -0
  44. package/src/verify-phone-server.ts +503 -0
  45. package/src/verify-phone.ts +577 -0
  46. package/test/api.test.ts +205 -0
  47. package/test/integration.test.ts +152 -0
  48. package/test/metadata-test.ts +73 -0
  49. package/test/server.test.ts +143 -0
  50. package/test/setup.ts +32 -0
  51. package/test/utils.test.ts +186 -0
  52. package/test/verify.test.ts +20 -0
  53. package/test/voip.test.ts +113 -0
  54. package/tsconfig.json +24 -0
  55. package/vitest.config.ts +10 -0
  56. package/wrangler.toml +24 -0
@@ -0,0 +1,11 @@
1
+ // @ts-nocheck -- skip type checking
2
+ import * as meta_0 from "../content/docs/meta.json?collection=meta&hash=1751452919000"
3
+ import * as docs_4 from "../content/docs/api/verify.mdx?collection=docs&hash=1751452919000"
4
+ import * as docs_3 from "../content/docs/api/post.mdx?collection=docs&hash=1751452919000"
5
+ import * as docs_2 from "../content/docs/verify-legal-name.md?collection=docs&hash=1751452919000"
6
+ import * as docs_1 from "../content/docs/DEPLOYMENT.md?collection=docs&hash=1751452919000"
7
+ import * as docs_0 from "../content/docs/API_AUTHENTICATION.md?collection=docs&hash=1751452919000"
8
+ import { _runtime } from "fumadocs-mdx"
9
+ import * as _source from "../source.config"
10
+ export const docs = _runtime.doc<typeof _source.docs>([{ info: {"path":"API_AUTHENTICATION.md","absolutePath":"/mnt/data/Projects/my-legal-name/docs/content/docs/API_AUTHENTICATION.md"}, data: docs_0 }, { info: {"path":"DEPLOYMENT.md","absolutePath":"/mnt/data/Projects/my-legal-name/docs/content/docs/DEPLOYMENT.md"}, data: docs_1 }, { info: {"path":"verify-legal-name.md","absolutePath":"/mnt/data/Projects/my-legal-name/docs/content/docs/verify-legal-name.md"}, data: docs_2 }, { info: {"path":"api/post.mdx","absolutePath":"/mnt/data/Projects/my-legal-name/docs/content/docs/api/post.mdx"}, data: docs_3 }, { info: {"path":"api/verify.mdx","absolutePath":"/mnt/data/Projects/my-legal-name/docs/content/docs/api/verify.mdx"}, data: docs_4 }]);
11
+ export const meta = _runtime.meta<typeof _source.meta>([{ info: {"path":"meta.json","absolutePath":"/mnt/data/Projects/my-legal-name/docs/content/docs/meta.json"}, data: meta_0 }]);
@@ -0,0 +1,9 @@
1
+ // source.config.ts
2
+ import { defineDocs } from "fumadocs-mdx/config";
3
+ var { docs, meta } = defineDocs({
4
+ dir: "content/docs"
5
+ });
6
+ export {
7
+ docs,
8
+ meta
9
+ };
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from 'react';
2
+ import { HomeLayout } from 'fumadocs-ui/layouts/home';
3
+ import { baseOptions } from '@/app/layout.config';
4
+
5
+ export default function Layout({ children }: { children: ReactNode }) {
6
+ return <HomeLayout {...baseOptions}>{children}</HomeLayout>;
7
+ }
@@ -0,0 +1,38 @@
1
+ import Link from 'next/link';
2
+
3
+ export default function HomePage() {
4
+ return (
5
+ <main
6
+ style={{
7
+ flex: 1,
8
+ display: 'flex',
9
+ flexDirection: 'column',
10
+ textAlign: 'center',
11
+ justifyContent: 'center',
12
+ }}
13
+ >
14
+ <h1
15
+ style={{
16
+ fontSize: '2rem',
17
+ fontWeight: 'bold',
18
+ marginBottom: '1rem',
19
+ }}
20
+ >
21
+ Hello World
22
+ </h1>
23
+ <p>
24
+ You can open{' '}
25
+ <Link
26
+ href="/docs"
27
+ style={{
28
+ fontWeight: '600',
29
+ textDecoration: 'underline',
30
+ }}
31
+ >
32
+ /docs
33
+ </Link>{' '}
34
+ and see the documentation.
35
+ </p>
36
+ </main>
37
+ );
38
+ }
@@ -0,0 +1,59 @@
1
+ import { source } from '@/lib/source';
2
+ import {
3
+ DocsBody,
4
+ DocsDescription,
5
+ DocsPage,
6
+ DocsTitle,
7
+ } from 'fumadocs-ui/page';
8
+ import { notFound } from 'next/navigation';
9
+ import { getMDXComponents } from '@/mdx-components';
10
+ import type { Metadata } from 'next';
11
+ import React from 'react';
12
+
13
+ export default async function Page(props: {
14
+ params: Promise<{ slug?: string[] }>;
15
+ }) {
16
+ const params = await props.params;
17
+ const page = source.getPage(params.slug);
18
+
19
+ if (!page) {
20
+ notFound();
21
+ }
22
+
23
+ const MDX = page.data.body;
24
+
25
+ return (
26
+ <DocsPage toc={page.data.toc} full={page.data.full}>
27
+ <DocsTitle>{page.data.title}</DocsTitle>
28
+ <DocsDescription>{page.data.description}</DocsDescription>
29
+ <DocsBody>
30
+ {MDX && React.createElement(MDX, { components: getMDXComponents() })}
31
+ </DocsBody>
32
+ </DocsPage>
33
+ );
34
+ }
35
+
36
+ export async function generateStaticParams() {
37
+ return source.generateParams();
38
+ }
39
+
40
+ export async function generateMetadata(props: {
41
+ params: Promise<{ slug?: string[] }>;
42
+ }) {
43
+ const params = await props.params;
44
+ const page = source.getPage(params.slug);
45
+ if (!page) notFound();
46
+ const image = ['/docs-og', ...(params.slug ?? []), 'image.png'].join('/');
47
+
48
+ return {
49
+ title: page.data.title,
50
+ description: page.data.description,
51
+ openGraph: {
52
+ images: image,
53
+ },
54
+ twitter: {
55
+ card: 'summary_large_image',
56
+ images: image,
57
+ },
58
+ } satisfies Metadata;
59
+ }
@@ -0,0 +1,12 @@
1
+ import { source } from '@/lib/source';
2
+ import { DocsLayout } from 'fumadocs-ui/layouts/notebook';
3
+ import type { ReactNode } from 'react';
4
+ import { baseOptions } from '@/app/layout.config';
5
+
6
+ export default function RootDocsLayout({ children }: { children: ReactNode }) {
7
+ return (
8
+ <DocsLayout tree={source.pageTree} {...baseOptions}>
9
+ {children}
10
+ </DocsLayout>
11
+ );
12
+ }
@@ -0,0 +1,24 @@
1
+ import { generateOGImage } from 'fumadocs-ui/og';
2
+ import { source } from '@/lib/source';
3
+ import { notFound } from 'next/navigation';
4
+
5
+ export async function GET(
6
+ _req: Request,
7
+ { params }: { params: Promise<{ slug: string[] }> },
8
+ ) {
9
+ const { slug } = await params;
10
+ const page = source.getPage(slug.slice(0, -1));
11
+ if (!page) notFound();
12
+
13
+ return generateOGImage({
14
+ title: page.data.title,
15
+ description: page.data.description,
16
+ });
17
+ }
18
+
19
+ export function generateStaticParams() {
20
+ return source.generateParams().map((page) => ({
21
+ ...page,
22
+ slug: [...page.slug, 'image.png'],
23
+ }));
24
+ }