@fefade/common 1.0.2 → 1.0.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.
package/dist/index.d.mts CHANGED
@@ -1,7 +1,50 @@
1
+ import { RateLimiterMemory, IRateLimiterOptions } from 'rate-limiter-flexible';
2
+
3
+ declare function export_default$7(lang: string): string;
4
+
5
+ declare function export_default$6<E extends string>(url: string): {
6
+ on: <K extends keyof E>(event: K, handler: (data: E[K]) => void) => void;
7
+ close: () => void;
8
+ };
9
+
10
+ declare function export_default$5(): {
11
+ connect: () => Response;
12
+ broadcast: <E extends string, T>(event: E, data: T) => void;
13
+ };
14
+
15
+ type Props = {
16
+ origin: string | null;
17
+ domain: string;
18
+ cookieDomain: string;
19
+ };
20
+ declare function export_default$4({ origin, domain, cookieDomain }: Props): boolean;
21
+
22
+ declare class Errors extends Error {
23
+ code: string;
24
+ status: number;
25
+ constructor(message?: string, code?: string, status?: number);
26
+ }
27
+
28
+ declare function export_default$3(err: unknown): Errors;
29
+
30
+ declare function export_default$2<T extends string>(path: string | T, params?: string | string[][] | Record<string, string> | URLSearchParams | undefined): string;
31
+
32
+ type HasRequest<T = {}> = {
33
+ request: Request;
34
+ } & T;
35
+ type MaybePromise<T> = T | Promise<T>;
36
+ type Handler<E extends HasRequest> = (event: E) => MaybePromise<Response>;
37
+
38
+ declare function export_default$1<E extends HasRequest>(handler: Handler<E>, limiter: RateLimiterMemory): Handler<E>;
39
+
40
+ declare function export_default<E extends HasRequest>(handler: Handler<E>, secretKey: string): Handler<E>;
41
+
1
42
  declare const ORG_NAME = "Fefade";
2
43
  declare const ACRONYM = "ff";
3
44
  declare const DEFAULT_LOCALE = "en";
4
45
  declare const SUPPORT_EMAIL = "support@fefade.com";
46
+ declare const IS_PROD: boolean;
47
+ declare const PROTOCOL: string;
5
48
  declare const URLS: {
6
49
  base: string;
7
50
  auth: string;
@@ -9,14 +52,20 @@ declare const URLS: {
9
52
  play_store: string;
10
53
  github: string;
11
54
  };
55
+ declare const LANG_STRATEGY: string[];
56
+ declare const RATE_LIMIT_DEFAULT_OPTIONS: IRateLimiterOptions;
12
57
 
13
58
  declare const constants_ACRONYM: typeof ACRONYM;
14
59
  declare const constants_DEFAULT_LOCALE: typeof DEFAULT_LOCALE;
60
+ declare const constants_IS_PROD: typeof IS_PROD;
61
+ declare const constants_LANG_STRATEGY: typeof LANG_STRATEGY;
15
62
  declare const constants_ORG_NAME: typeof ORG_NAME;
63
+ declare const constants_PROTOCOL: typeof PROTOCOL;
64
+ declare const constants_RATE_LIMIT_DEFAULT_OPTIONS: typeof RATE_LIMIT_DEFAULT_OPTIONS;
16
65
  declare const constants_SUPPORT_EMAIL: typeof SUPPORT_EMAIL;
17
66
  declare const constants_URLS: typeof URLS;
18
67
  declare namespace constants {
19
- export { constants_ACRONYM as ACRONYM, constants_DEFAULT_LOCALE as DEFAULT_LOCALE, constants_ORG_NAME as ORG_NAME, constants_SUPPORT_EMAIL as SUPPORT_EMAIL, constants_URLS as URLS };
68
+ export { constants_ACRONYM as ACRONYM, constants_DEFAULT_LOCALE as DEFAULT_LOCALE, constants_IS_PROD as IS_PROD, constants_LANG_STRATEGY as LANG_STRATEGY, constants_ORG_NAME as ORG_NAME, constants_PROTOCOL as PROTOCOL, constants_RATE_LIMIT_DEFAULT_OPTIONS as RATE_LIMIT_DEFAULT_OPTIONS, constants_SUPPORT_EMAIL as SUPPORT_EMAIL, constants_URLS as URLS };
20
69
  }
21
70
 
22
- export { constants as Constants };
71
+ export { constants as Constants, export_default$3 as handleError, export_default$4 as isAllowedOrigin, export_default$7 as normalizeLang, export_default$2 as pathWithParams, export_default$6 as sseClient, export_default$5 as sseServer, export_default as validateTurnstile, export_default$1 as withRateLimit };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,50 @@
1
+ import { RateLimiterMemory, IRateLimiterOptions } from 'rate-limiter-flexible';
2
+
3
+ declare function export_default$7(lang: string): string;
4
+
5
+ declare function export_default$6<E extends string>(url: string): {
6
+ on: <K extends keyof E>(event: K, handler: (data: E[K]) => void) => void;
7
+ close: () => void;
8
+ };
9
+
10
+ declare function export_default$5(): {
11
+ connect: () => Response;
12
+ broadcast: <E extends string, T>(event: E, data: T) => void;
13
+ };
14
+
15
+ type Props = {
16
+ origin: string | null;
17
+ domain: string;
18
+ cookieDomain: string;
19
+ };
20
+ declare function export_default$4({ origin, domain, cookieDomain }: Props): boolean;
21
+
22
+ declare class Errors extends Error {
23
+ code: string;
24
+ status: number;
25
+ constructor(message?: string, code?: string, status?: number);
26
+ }
27
+
28
+ declare function export_default$3(err: unknown): Errors;
29
+
30
+ declare function export_default$2<T extends string>(path: string | T, params?: string | string[][] | Record<string, string> | URLSearchParams | undefined): string;
31
+
32
+ type HasRequest<T = {}> = {
33
+ request: Request;
34
+ } & T;
35
+ type MaybePromise<T> = T | Promise<T>;
36
+ type Handler<E extends HasRequest> = (event: E) => MaybePromise<Response>;
37
+
38
+ declare function export_default$1<E extends HasRequest>(handler: Handler<E>, limiter: RateLimiterMemory): Handler<E>;
39
+
40
+ declare function export_default<E extends HasRequest>(handler: Handler<E>, secretKey: string): Handler<E>;
41
+
1
42
  declare const ORG_NAME = "Fefade";
2
43
  declare const ACRONYM = "ff";
3
44
  declare const DEFAULT_LOCALE = "en";
4
45
  declare const SUPPORT_EMAIL = "support@fefade.com";
46
+ declare const IS_PROD: boolean;
47
+ declare const PROTOCOL: string;
5
48
  declare const URLS: {
6
49
  base: string;
7
50
  auth: string;
@@ -9,14 +52,20 @@ declare const URLS: {
9
52
  play_store: string;
10
53
  github: string;
11
54
  };
55
+ declare const LANG_STRATEGY: string[];
56
+ declare const RATE_LIMIT_DEFAULT_OPTIONS: IRateLimiterOptions;
12
57
 
13
58
  declare const constants_ACRONYM: typeof ACRONYM;
14
59
  declare const constants_DEFAULT_LOCALE: typeof DEFAULT_LOCALE;
60
+ declare const constants_IS_PROD: typeof IS_PROD;
61
+ declare const constants_LANG_STRATEGY: typeof LANG_STRATEGY;
15
62
  declare const constants_ORG_NAME: typeof ORG_NAME;
63
+ declare const constants_PROTOCOL: typeof PROTOCOL;
64
+ declare const constants_RATE_LIMIT_DEFAULT_OPTIONS: typeof RATE_LIMIT_DEFAULT_OPTIONS;
16
65
  declare const constants_SUPPORT_EMAIL: typeof SUPPORT_EMAIL;
17
66
  declare const constants_URLS: typeof URLS;
18
67
  declare namespace constants {
19
- export { constants_ACRONYM as ACRONYM, constants_DEFAULT_LOCALE as DEFAULT_LOCALE, constants_ORG_NAME as ORG_NAME, constants_SUPPORT_EMAIL as SUPPORT_EMAIL, constants_URLS as URLS };
68
+ export { constants_ACRONYM as ACRONYM, constants_DEFAULT_LOCALE as DEFAULT_LOCALE, constants_IS_PROD as IS_PROD, constants_LANG_STRATEGY as LANG_STRATEGY, constants_ORG_NAME as ORG_NAME, constants_PROTOCOL as PROTOCOL, constants_RATE_LIMIT_DEFAULT_OPTIONS as RATE_LIMIT_DEFAULT_OPTIONS, constants_SUPPORT_EMAIL as SUPPORT_EMAIL, constants_URLS as URLS };
20
69
  }
21
70
 
22
- export { constants as Constants };
71
+ export { constants as Constants, export_default$3 as handleError, export_default$4 as isAllowedOrigin, export_default$7 as normalizeLang, export_default$2 as pathWithParams, export_default$6 as sseClient, export_default$5 as sseServer, export_default as validateTurnstile, export_default$1 as withRateLimit };