@fefade/common 1.0.7 → 1.0.9

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
@@ -45,12 +45,18 @@ declare function export_default<E extends HasRequest>(handler: Handler<E>, secre
45
45
  declare const ORG_NAME = "Fefade";
46
46
  declare const ACRONYM = "ff";
47
47
  declare const DEFAULT_LOCALE = "en";
48
- declare const SUPPORT_EMAIL = "support@fefade.com";
49
48
  declare const IS_PROD: boolean;
49
+ declare const DOMAIN: string;
50
+ declare const SUPPORT_EMAIL: string;
50
51
  declare const PROTOCOL: string;
52
+ declare const SEARCH_PARAMS: {
53
+ serviceName: string;
54
+ redirectUri: string;
55
+ };
51
56
  declare const URLS: {
52
57
  base: string;
53
58
  auth: string;
59
+ account: string;
54
60
  email: string;
55
61
  play_store: string;
56
62
  github: string;
@@ -59,14 +65,16 @@ declare const LANG_STRATEGY: ("cookie" | "baseLocale" | "globalVariable" | "url"
59
65
 
60
66
  declare const constants_ACRONYM: typeof ACRONYM;
61
67
  declare const constants_DEFAULT_LOCALE: typeof DEFAULT_LOCALE;
68
+ declare const constants_DOMAIN: typeof DOMAIN;
62
69
  declare const constants_IS_PROD: typeof IS_PROD;
63
70
  declare const constants_LANG_STRATEGY: typeof LANG_STRATEGY;
64
71
  declare const constants_ORG_NAME: typeof ORG_NAME;
65
72
  declare const constants_PROTOCOL: typeof PROTOCOL;
73
+ declare const constants_SEARCH_PARAMS: typeof SEARCH_PARAMS;
66
74
  declare const constants_SUPPORT_EMAIL: typeof SUPPORT_EMAIL;
67
75
  declare const constants_URLS: typeof URLS;
68
76
  declare namespace constants {
69
- 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_SUPPORT_EMAIL as SUPPORT_EMAIL, constants_URLS as URLS };
77
+ export { constants_ACRONYM as ACRONYM, constants_DEFAULT_LOCALE as DEFAULT_LOCALE, constants_DOMAIN as DOMAIN, constants_IS_PROD as IS_PROD, constants_LANG_STRATEGY as LANG_STRATEGY, constants_ORG_NAME as ORG_NAME, constants_PROTOCOL as PROTOCOL, constants_SEARCH_PARAMS as SEARCH_PARAMS, constants_SUPPORT_EMAIL as SUPPORT_EMAIL, constants_URLS as URLS };
70
78
  }
71
79
 
72
80
  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
@@ -45,12 +45,18 @@ declare function export_default<E extends HasRequest>(handler: Handler<E>, secre
45
45
  declare const ORG_NAME = "Fefade";
46
46
  declare const ACRONYM = "ff";
47
47
  declare const DEFAULT_LOCALE = "en";
48
- declare const SUPPORT_EMAIL = "support@fefade.com";
49
48
  declare const IS_PROD: boolean;
49
+ declare const DOMAIN: string;
50
+ declare const SUPPORT_EMAIL: string;
50
51
  declare const PROTOCOL: string;
52
+ declare const SEARCH_PARAMS: {
53
+ serviceName: string;
54
+ redirectUri: string;
55
+ };
51
56
  declare const URLS: {
52
57
  base: string;
53
58
  auth: string;
59
+ account: string;
54
60
  email: string;
55
61
  play_store: string;
56
62
  github: string;
@@ -59,14 +65,16 @@ declare const LANG_STRATEGY: ("cookie" | "baseLocale" | "globalVariable" | "url"
59
65
 
60
66
  declare const constants_ACRONYM: typeof ACRONYM;
61
67
  declare const constants_DEFAULT_LOCALE: typeof DEFAULT_LOCALE;
68
+ declare const constants_DOMAIN: typeof DOMAIN;
62
69
  declare const constants_IS_PROD: typeof IS_PROD;
63
70
  declare const constants_LANG_STRATEGY: typeof LANG_STRATEGY;
64
71
  declare const constants_ORG_NAME: typeof ORG_NAME;
65
72
  declare const constants_PROTOCOL: typeof PROTOCOL;
73
+ declare const constants_SEARCH_PARAMS: typeof SEARCH_PARAMS;
66
74
  declare const constants_SUPPORT_EMAIL: typeof SUPPORT_EMAIL;
67
75
  declare const constants_URLS: typeof URLS;
68
76
  declare namespace constants {
69
- 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_SUPPORT_EMAIL as SUPPORT_EMAIL, constants_URLS as URLS };
77
+ export { constants_ACRONYM as ACRONYM, constants_DEFAULT_LOCALE as DEFAULT_LOCALE, constants_DOMAIN as DOMAIN, constants_IS_PROD as IS_PROD, constants_LANG_STRATEGY as LANG_STRATEGY, constants_ORG_NAME as ORG_NAME, constants_PROTOCOL as PROTOCOL, constants_SEARCH_PARAMS as SEARCH_PARAMS, constants_SUPPORT_EMAIL as SUPPORT_EMAIL, constants_URLS as URLS };
70
78
  }
71
79
 
72
80
  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.js CHANGED
@@ -14046,7 +14046,8 @@ function isRateLimiterRes(err) {
14046
14046
  }
14047
14047
  function withRateLimit_default(handler, limiter) {
14048
14048
  return async (event) => {
14049
- const ipAddress = getIp_default(event.request);
14049
+ const requestCloned = event.request.clone();
14050
+ const ipAddress = getIp_default(requestCloned);
14050
14051
  try {
14051
14052
  await limiter.consume(ipAddress);
14052
14053
  } catch (err) {
@@ -14076,7 +14077,8 @@ function validateTurnstile_default(handler, secretKey) {
14076
14077
  }
14077
14078
  });
14078
14079
  }
14079
- const body = await event.request.json();
14080
+ const requestCloned = event.request.clone();
14081
+ const body = await requestCloned.json();
14080
14082
  const token = body["cf-turnstile-response"];
14081
14083
  const ipAddress = getIp_default(event.request);
14082
14084
  if (!token) {
@@ -14118,22 +14120,30 @@ var constants_exports = {};
14118
14120
  __export(constants_exports, {
14119
14121
  ACRONYM: () => ACRONYM,
14120
14122
  DEFAULT_LOCALE: () => DEFAULT_LOCALE,
14123
+ DOMAIN: () => DOMAIN,
14121
14124
  IS_PROD: () => IS_PROD,
14122
14125
  LANG_STRATEGY: () => LANG_STRATEGY,
14123
14126
  ORG_NAME: () => ORG_NAME,
14124
14127
  PROTOCOL: () => PROTOCOL,
14128
+ SEARCH_PARAMS: () => SEARCH_PARAMS,
14125
14129
  SUPPORT_EMAIL: () => SUPPORT_EMAIL,
14126
14130
  URLS: () => URLS
14127
14131
  });
14128
14132
  var ORG_NAME = "Fefade";
14129
14133
  var ACRONYM = "ff";
14130
14134
  var DEFAULT_LOCALE = "en";
14131
- var SUPPORT_EMAIL = "support@fefade.com";
14132
14135
  var IS_PROD = process.env.NODE_ENV === "production";
14136
+ var DOMAIN = IS_PROD ? "fefade.com" : "localhost";
14137
+ var SUPPORT_EMAIL = `support@${DOMAIN}`;
14133
14138
  var PROTOCOL = IS_PROD ? "https" : "http";
14139
+ var SEARCH_PARAMS = {
14140
+ serviceName: "service_name",
14141
+ redirectUri: "redirect_uri"
14142
+ };
14134
14143
  var URLS = {
14135
- base: "https://fefade.com",
14136
- auth: "https://auth.fefade.com",
14144
+ base: `https://${DOMAIN}`,
14145
+ auth: `https://auth.${DOMAIN}`,
14146
+ account: `https://account.${DOMAIN}`,
14137
14147
  email: `mailto:${SUPPORT_EMAIL}`,
14138
14148
  play_store: "https://play.google.com/store/apps/dev?id=7701571155946352525",
14139
14149
  github: "https://github.com/fefade"
package/dist/index.mjs CHANGED
@@ -14018,7 +14018,8 @@ function isRateLimiterRes(err) {
14018
14018
  }
14019
14019
  function withRateLimit_default(handler, limiter) {
14020
14020
  return async (event) => {
14021
- const ipAddress = getIp_default(event.request);
14021
+ const requestCloned = event.request.clone();
14022
+ const ipAddress = getIp_default(requestCloned);
14022
14023
  try {
14023
14024
  await limiter.consume(ipAddress);
14024
14025
  } catch (err) {
@@ -14048,7 +14049,8 @@ function validateTurnstile_default(handler, secretKey) {
14048
14049
  }
14049
14050
  });
14050
14051
  }
14051
- const body = await event.request.json();
14052
+ const requestCloned = event.request.clone();
14053
+ const body = await requestCloned.json();
14052
14054
  const token = body["cf-turnstile-response"];
14053
14055
  const ipAddress = getIp_default(event.request);
14054
14056
  if (!token) {
@@ -14090,22 +14092,30 @@ var constants_exports = {};
14090
14092
  __export(constants_exports, {
14091
14093
  ACRONYM: () => ACRONYM,
14092
14094
  DEFAULT_LOCALE: () => DEFAULT_LOCALE,
14095
+ DOMAIN: () => DOMAIN,
14093
14096
  IS_PROD: () => IS_PROD,
14094
14097
  LANG_STRATEGY: () => LANG_STRATEGY,
14095
14098
  ORG_NAME: () => ORG_NAME,
14096
14099
  PROTOCOL: () => PROTOCOL,
14100
+ SEARCH_PARAMS: () => SEARCH_PARAMS,
14097
14101
  SUPPORT_EMAIL: () => SUPPORT_EMAIL,
14098
14102
  URLS: () => URLS
14099
14103
  });
14100
14104
  var ORG_NAME = "Fefade";
14101
14105
  var ACRONYM = "ff";
14102
14106
  var DEFAULT_LOCALE = "en";
14103
- var SUPPORT_EMAIL = "support@fefade.com";
14104
14107
  var IS_PROD = process.env.NODE_ENV === "production";
14108
+ var DOMAIN = IS_PROD ? "fefade.com" : "localhost";
14109
+ var SUPPORT_EMAIL = `support@${DOMAIN}`;
14105
14110
  var PROTOCOL = IS_PROD ? "https" : "http";
14111
+ var SEARCH_PARAMS = {
14112
+ serviceName: "service_name",
14113
+ redirectUri: "redirect_uri"
14114
+ };
14106
14115
  var URLS = {
14107
- base: "https://fefade.com",
14108
- auth: "https://auth.fefade.com",
14116
+ base: `https://${DOMAIN}`,
14117
+ auth: `https://auth.${DOMAIN}`,
14118
+ account: `https://account.${DOMAIN}`,
14109
14119
  email: `mailto:${SUPPORT_EMAIL}`,
14110
14120
  play_store: "https://play.google.com/store/apps/dev?id=7701571155946352525",
14111
14121
  github: "https://github.com/fefade"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fefade/common",
3
3
  "description": "Containing common resources, constants, images, and utility functions that are used across various projects. This package aims to promote reusability and maintain consistency across different applications by centralizing commonly used assets and code.",
4
- "version": "1.0.7",
4
+ "version": "1.0.9",
5
5
  "private": false,
6
6
  "publishConfig": {
7
7
  "access": "public"