@prefabs.tech/fastify-phone-auth 0.0.0-bootstrap.0 → 0.0.0-stage

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.
@@ -1,8 +0,0 @@
1
- declare const DEFAULT_CONTACT_METHOD = "PHONE";
2
- declare const DEFAULT_FLOW_TYPE = "USER_INPUT_CODE";
3
- declare const ERROR_CODES: {
4
- SIGNUP_FAILED_ERROR: string;
5
- };
6
- declare const TWILIO_VERIFY_PLACEHOLDER_CODE = "000000";
7
- export { DEFAULT_CONTACT_METHOD, DEFAULT_FLOW_TYPE, ERROR_CODES, TWILIO_VERIFY_PLACEHOLDER_CODE, };
8
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,sBAAsB,UAAU,CAAC;AACvC,QAAA,MAAM,iBAAiB,oBAAoB,CAAC;AAE5C,QAAA,MAAM,WAAW;;CAEhB,CAAC;AAKF,QAAA,MAAM,8BAA8B,WAAW,CAAC;AAEhD,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,WAAW,EACX,8BAA8B,GAC/B,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { FastifyInstance } from "fastify";
2
- declare const extendUserSchema: (fastify: FastifyInstance) => Promise<void>;
3
- export default extendUserSchema;
4
- //# sourceMappingURL=extendUserSchema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extendUserSchema.d.ts","sourceRoot":"","sources":["../../../src/graphql/extendUserSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAQ/C,QAAA,MAAM,gBAAgB,GAAU,SAAS,eAAe,kBAUvD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1,20 +0,0 @@
1
- import type { PhoneAuthConfig } from "./types";
2
- declare module "@prefabs.tech/fastify-config" {
3
- interface ApiConfig {
4
- phoneAuth?: PhoneAuthConfig;
5
- }
6
- }
7
- declare module "@prefabs.tech/fastify-user" {
8
- interface User {
9
- phoneNumber?: string;
10
- }
11
- }
12
- export * from "./constants";
13
- export { default as getTwilioClient } from "./lib/getTwilioClient";
14
- export { default } from "./plugin";
15
- export { default as getPasswordlessRecipeConfig } from "./recipe/config";
16
- export { default as consumeCode } from "./recipe/consumeCode";
17
- export { default as consumeCodePOST } from "./recipe/consumeCodePost";
18
- export { default as initPasswordlessRecipe } from "./recipe/initPasswordlessRecipe";
19
- export type * from "./types";
20
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,QAAQ,8BAA8B,CAAC;IAC5C,UAAU,SAAS;QACjB,SAAS,CAAC,EAAE,eAAe,CAAC;KAC7B;CACF;AAED,OAAO,QAAQ,4BAA4B,CAAC;IAC1C,UAAU,IAAI;QACZ,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB;CACF;AAED,cAAc,aAAa,CAAC;AAE5B,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,OAAO,IAAI,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEpF,mBAAmB,SAAS,CAAC"}
@@ -1,7 +0,0 @@
1
- import type { TwilioConfig } from "../types";
2
- declare const getTwilioClient: (config: TwilioConfig | undefined) => {
3
- client: import("twilio/lib/rest/Twilio");
4
- verifyServiceSid: string;
5
- };
6
- export default getTwilioClient;
7
- //# sourceMappingURL=getTwilioClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getTwilioClient.d.ts","sourceRoot":"","sources":["../../../src/lib/getTwilioClient.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,QAAA,MAAM,eAAe,GAAI,QAAQ,YAAY,GAAG,SAAS;;;CAuBxD,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1,5 +0,0 @@
1
- import type { ApiConfig } from "@prefabs.tech/fastify-config";
2
- import type { QuerySqlToken } from "slonik";
3
- declare const addPhoneNumberInUsersTableQuery: (config: ApiConfig) => QuerySqlToken;
4
- export { addPhoneNumberInUsersTableQuery };
5
- //# sourceMappingURL=queries.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/migrations/queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAK5C,QAAA,MAAM,+BAA+B,GAAI,QAAQ,SAAS,KAAG,aAO5D,CAAC;AAEF,OAAO,EAAE,+BAA+B,EAAE,CAAC"}
@@ -1,5 +0,0 @@
1
- import type { ApiConfig } from "@prefabs.tech/fastify-config";
2
- import type { Database } from "@prefabs.tech/fastify-slonik";
3
- declare const runMigrations: (config: ApiConfig, database: Database) => Promise<void>;
4
- export default runMigrations;
5
- //# sourceMappingURL=runMigrations.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runMigrations.d.ts","sourceRoot":"","sources":["../../../src/migrations/runMigrations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAI7D,QAAA,MAAM,aAAa,GAAU,QAAQ,SAAS,EAAE,UAAU,QAAQ,kBAIjE,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { FastifyPluginAsync } from "fastify";
2
- declare const _default: FastifyPluginAsync;
3
- export default _default;
4
- //# sourceMappingURL=plugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;;AA8BlD,wBAA8C"}
@@ -1,5 +0,0 @@
1
- import type { FastifyInstance } from "fastify";
2
- import type { TypeInput as PasswordlessRecipeConfig } from "supertokens-node/recipe/passwordless/types";
3
- declare const getPasswordlessRecipeConfig: (fastify: FastifyInstance) => PasswordlessRecipeConfig;
4
- export default getPasswordlessRecipeConfig;
5
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/recipe/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EAEV,SAAS,IAAI,wBAAwB,EAEtC,MAAM,4CAA4C,CAAC;AA4BpD,QAAA,MAAM,2BAA2B,GAC/B,SAAS,eAAe,KACvB,wBAoJF,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
@@ -1,5 +0,0 @@
1
- import type { FastifyInstance } from "fastify";
2
- import type { RecipeInterface } from "supertokens-node/recipe/passwordless/types";
3
- declare const consumeCode: (originalImplementation: RecipeInterface, fastify: FastifyInstance) => RecipeInterface["consumeCode"];
4
- export default consumeCode;
5
- //# sourceMappingURL=consumeCode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"consumeCode.d.ts","sourceRoot":"","sources":["../../../src/recipe/consumeCode.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAkB,MAAM,SAAS,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAclF,QAAA,MAAM,WAAW,GACf,wBAAwB,eAAe,EACvC,SAAS,eAAe,KACvB,eAAe,CAAC,aAAa,CAuG/B,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,5 +0,0 @@
1
- import type { FastifyInstance } from "fastify";
2
- import type { APIInterface } from "supertokens-node/recipe/passwordless/types";
3
- declare const consumeCodePOST: (originalImplementation: APIInterface, fastify: FastifyInstance) => APIInterface["consumeCodePOST"];
4
- export default consumeCodePOST;
5
- //# sourceMappingURL=consumeCodePost.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"consumeCodePost.d.ts","sourceRoot":"","sources":["../../../src/recipe/consumeCodePost.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AA0B/E,QAAA,MAAM,eAAe,GACnB,wBAAwB,YAAY,EACpC,SAAS,eAAe,KACvB,YAAY,CAAC,iBAAiB,CAkFhC,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { FastifyInstance } from "fastify";
2
- declare const initPasswordlessRecipe: (fastify: FastifyInstance) => import("supertokens-node/types").RecipeListFunction;
3
- export default initPasswordlessRecipe;
4
- //# sourceMappingURL=initPasswordlessRecipe.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"initPasswordlessRecipe.d.ts","sourceRoot":"","sources":["../../../src/recipe/initPasswordlessRecipe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAM/C,QAAA,MAAM,sBAAsB,GAAI,SAAS,eAAe,wDAQvD,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -1,56 +0,0 @@
1
- import type { FastifyInstance } from "fastify";
2
- import type { TwilioServiceConfig } from "supertokens-node/lib/build/ingredients/smsdelivery/services/twilio";
3
- import type { APIInterface, TypeInput as PasswordlessRecipeConfig, RecipeInterface } from "supertokens-node/recipe/passwordless/types";
4
- type APIInterfaceWrapper = {
5
- [key in keyof APIInterface]?: (originalImplementation: APIInterface, fastify: FastifyInstance) => APIInterface[key];
6
- };
7
- interface PhoneAuthConfig {
8
- /**
9
- * Phone numbers that skip Twilio entirely and are verified against
10
- * `devModeOtp` instead.
11
- */
12
- bypassSmsFor?: string[];
13
- /**
14
- * @default "PHONE"
15
- */
16
- contactMethod?: "EMAIL" | "EMAIL_OR_PHONE" | "PHONE";
17
- /**
18
- * Required when `enableDevMode` is true.
19
- */
20
- devModeOtp?: string;
21
- /**
22
- * @default true
23
- */
24
- enabled?: boolean;
25
- /**
26
- * Skip Twilio and accept `devModeOtp` for every number.
27
- * @default false
28
- */
29
- enableDevMode?: boolean;
30
- /**
31
- * SuperTokens requires an email, so passwordless users get a synthetic
32
- * `<phoneNumber>@<fallbackEmailDomain>` one. Defaults to the app name.
33
- */
34
- fallbackEmailDomain?: string;
35
- /**
36
- * @default "USER_INPUT_CODE"
37
- */
38
- flowType?: "USER_INPUT_CODE";
39
- override?: {
40
- apis?: APIInterfaceWrapper;
41
- functions?: RecipeInterfaceWrapper;
42
- };
43
- /**
44
- * Full escape hatch: replaces the generated recipe config entirely.
45
- */
46
- recipe?: (fastify: FastifyInstance) => PasswordlessRecipeConfig;
47
- twilio?: TwilioConfig;
48
- }
49
- type RecipeInterfaceWrapper = {
50
- [key in keyof RecipeInterface]?: (originalImplementation: RecipeInterface, fastify: FastifyInstance) => RecipeInterface[key];
51
- };
52
- type TwilioConfig = Omit<TwilioServiceConfig, "from" | "messagingServiceSid"> & {
53
- verifyServiceSid: string;
54
- };
55
- export type { APIInterfaceWrapper, PhoneAuthConfig, RecipeInterfaceWrapper, TwilioConfig, };
56
- //# sourceM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