@candlerip/shared3 0.0.63 → 0.0.64
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/environment/environment-variable/configs/index.d.ts +1 -0
- package/src/environment/environment-variable/configs/index.js +1 -0
- package/src/environment/environment-variables/configs/index.d.ts +1 -1
- package/src/environment/environment-variables/configs/index.js +1 -1
- package/src/error/custom-error/workers/custom-error-worker/index.js +3 -0
- package/src/page/page/configs/index.d.ts +1 -1
- package/src/page/page/configs/index.js +1 -1
- package/src/type/index.d.ts +1 -0
- package/src/type/index.js +1 -0
- package/src/type/object/index.d.ts +1 -0
- package/src/type/object/index.js +1 -0
- package/src/type/object/utils/add-prefix-to-object-props/index.d.ts +2 -0
- package/src/type/object/utils/add-prefix-to-object-props/index.js +1 -0
- package/src/type/object/utils/add-prefix-to-object-props/types.d.ts +1 -0
- package/src/type/object/utils/add-prefix-to-object-props/types.js +1 -0
- package/src/type/object/utils/index.d.ts +1 -0
- package/src/type/object/utils/index.js +1 -0
- package/src/type/string/index.d.ts +1 -0
- package/src/type/string/index.js +1 -0
- package/src/type/string/validators/index.d.ts +1 -0
- package/src/type/string/validators/index.js +1 -0
- package/src/type/string/validators/validate-string/index.d.ts +2 -0
- package/src/type/string/validators/validate-string/index.js +19 -0
- package/src/type/string/validators/validate-string/types.d.ts +6 -0
- package/src/type/string/validators/validate-string/types.js +1 -0
package/package.json
CHANGED
@@ -4,6 +4,7 @@ export declare const ENVIRONMENT_VARIABLE: {
|
|
4
4
|
readonly APP_PORT: "number";
|
5
5
|
readonly AUTHENTICATION_AUDIENCE: "string";
|
6
6
|
readonly AUTHENTICATION_DOMAIN: "string";
|
7
|
+
readonly BACKEND_URL: "string";
|
7
8
|
readonly CACHE_ENABLED: "boolean";
|
8
9
|
readonly CACHE_SERVICE_PORT: "number";
|
9
10
|
readonly DATABASE_URL: "string";
|
@@ -1,5 +1,5 @@
|
|
1
1
|
export declare const ENVIRONMENT_VARIABLES: {
|
2
|
-
readonly app: readonly ["APP_PORT", "DATABASE_URL", "NODE_ENV", "RABBITMQ_URL", "REDIS_PWD", "REDIS_URL", "S3_IMAGES_BUCKET_NAME"];
|
2
|
+
readonly app: readonly ["APP_PORT", "BACKEND_URL", "DATABASE_URL", "NODE_ENV", "RABBITMQ_URL", "REDIS_PWD", "REDIS_URL", "S3_IMAGES_BUCKET_NAME"];
|
3
3
|
readonly 'cache-service': readonly ["CACHE_ENABLED", "CACHE_SERVICE_PORT", "DATABASE_URL", "NODE_ENV", "RABBITMQ_URL", "REDIS_PWD", "REDIS_URL"];
|
4
4
|
readonly images: readonly ["NODE_ENV", "S3_IMAGES_BUCKET_NAME"];
|
5
5
|
readonly 'images-init': readonly ["FRONTEND_URL", "NODE_ENV", "S3_IMAGES_BUCKET_NAME"];
|
@@ -1,5 +1,5 @@
|
|
1
1
|
export const ENVIRONMENT_VARIABLES = {
|
2
|
-
app: ['APP_PORT', 'DATABASE_URL', 'NODE_ENV', 'RABBITMQ_URL', 'REDIS_PWD', 'REDIS_URL', 'S3_IMAGES_BUCKET_NAME'],
|
2
|
+
app: ['APP_PORT', 'BACKEND_URL', 'DATABASE_URL', 'NODE_ENV', 'RABBITMQ_URL', 'REDIS_PWD', 'REDIS_URL', 'S3_IMAGES_BUCKET_NAME'],
|
3
3
|
'cache-service': ['CACHE_ENABLED', 'CACHE_SERVICE_PORT', 'DATABASE_URL', 'NODE_ENV', 'RABBITMQ_URL', 'REDIS_PWD', 'REDIS_URL'],
|
4
4
|
images: ['NODE_ENV', 'S3_IMAGES_BUCKET_NAME'],
|
5
5
|
'images-init': ['FRONTEND_URL', 'NODE_ENV', 'S3_IMAGES_BUCKET_NAME'],
|
@@ -1 +1 @@
|
|
1
|
-
export declare const PAGES: readonly ["homePage", "contactPage"];
|
1
|
+
export declare const PAGES: readonly ["homePage", "contactPage", "helpPage", "termsAndConditionsPage"];
|
@@ -1 +1 @@
|
|
1
|
-
export const PAGES = ['homePage', 'contactPage'];
|
1
|
+
export const PAGES = ['homePage', 'contactPage', 'helpPage', 'termsAndConditionsPage'];
|
package/src/type/index.d.ts
CHANGED
package/src/type/index.js
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
export * from './utils/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './utils/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export const addPrefixToObjectProps = (obj, prefix) => Object.fromEntries(Object.entries(obj).map(([key, value]) => [`${prefix}-${key}`, value]));
|
@@ -0,0 +1 @@
|
|
1
|
+
export type AddPrefixToObjectProps = (obj: Record<string, string>, prefix: string) => Record<string, string>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './add-prefix-to-object-props/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './add-prefix-to-object-props/index.js';
|
package/src/type/string/index.js
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
export * from './validate-string/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './validate-string/index.js';
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { customErrorWorker } from '../../../../error/index.js';
|
2
|
+
import { isString } from '../../type-guards/index.js';
|
3
|
+
export const validateString = (data, name, regexp) => {
|
4
|
+
const { composeCustomError } = customErrorWorker({ data, name, regexp: JSON.stringify(regexp) });
|
5
|
+
if (!data) {
|
6
|
+
return composeCustomError(`Missing ${name}`);
|
7
|
+
}
|
8
|
+
if (!isString(data)) {
|
9
|
+
return composeCustomError(`${name} not string`);
|
10
|
+
}
|
11
|
+
if (regexp) {
|
12
|
+
if (!regexp.test(data)) {
|
13
|
+
return composeCustomError(`Invalid ${name}`);
|
14
|
+
}
|
15
|
+
}
|
16
|
+
return {
|
17
|
+
data,
|
18
|
+
};
|
19
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|