refactor: edit tailwindcss classes and change code formatting, therefore added .prettierrc file
fix: frontend bug where the passwords won't be checked when the password is changed
This commit is contained in:
+13
-5
@@ -2,16 +2,24 @@
|
||||
"name": "@stockhome/shared",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"type": "commonjs",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"prebuild": "barrelsby --directory src --delete --single",
|
||||
"build": "tsc -b",
|
||||
"build:esm": "tsc -p tsconfig.esm.json",
|
||||
"build:cjs": "tsc -p tsconfig.cjs.json",
|
||||
"build": "npm run prebuild && npm run build:esm && npm run build:cjs",
|
||||
"lint": "eslint ."
|
||||
},
|
||||
"main": "./dist/src/index.js",
|
||||
"types": "./dist/src/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/types/index.d.ts",
|
||||
"import": "./dist/esm/index.js",
|
||||
"require": "./dist/cjs/index.js"
|
||||
}
|
||||
},
|
||||
"types": "./dist/types/index.d.ts",
|
||||
"devDependencies": {
|
||||
"barrelsby": "^2.8.1",
|
||||
"typescript": "~6.0.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +1,42 @@
|
||||
export const GENERAL_ERROR_CODE = {
|
||||
UNEXPECTED_SERVER_ERROR: ["EG001", "Unexpected server error"],
|
||||
UNEXPECTED_SERVER_ERROR: ["EG001", "Unexpected server error"],
|
||||
} as const;
|
||||
|
||||
export const USER_ERROR_CODE = {
|
||||
WRONG_USERNAME_PASSWORD: ["EU001", "Username or password is wrong"],
|
||||
USER_IS_DEACTIVATED: ["EU002", "User is deactivated"],
|
||||
INVALID_REQUEST_BODY: ["EU003", "Invalid request body. Username and password are required."],
|
||||
INVALID_PARAMETERS: ["EU004", "Invalid or missing parameters."],
|
||||
TOKEN_GENERATION_FAILED: ["EU005", "Failed to generate user token."],
|
||||
LOGIN_FAILED: ["EU006", "Failed to log in user."],
|
||||
PASSWORD_CHANGE_FAILED: ["EU007", "Failed to change password."],
|
||||
SETTINGS_NOT_UPDATED: ["EU008", "Settings could not be updated."],
|
||||
SETTINGS_NOT_FOUND: ["EU009", "Settings could not be retrieved."],
|
||||
WRONG_USERNAME_PASSWORD: ["EU001", "Username or password is wrong"],
|
||||
USER_IS_DEACTIVATED: ["EU002", "User is deactivated"],
|
||||
INVALID_REQUEST_BODY: [
|
||||
"EU003",
|
||||
"Invalid request body. Username and password are required.",
|
||||
],
|
||||
INVALID_PARAMETERS: ["EU004", "Invalid or missing parameters."],
|
||||
TOKEN_GENERATION_FAILED: ["EU005", "Failed to generate user token."],
|
||||
LOGIN_FAILED: ["EU006", "Failed to log in user."],
|
||||
PASSWORD_CHANGE_FAILED: ["EU007", "Failed to change password."],
|
||||
SETTINGS_NOT_UPDATED: ["EU008", "Settings could not be updated."],
|
||||
SETTINGS_NOT_FOUND: ["EU009", "Settings could not be retrieved."],
|
||||
PASSWORDS_NOT_MATCHED: ["EU010", "The two passwords are not matching."],
|
||||
} as const;
|
||||
|
||||
export const STORAGE_ERROR_CODE = {
|
||||
INVALID_REQUEST_BODY: ["ES001", "Invalid request body"],
|
||||
INVALID_PARAMETERS: ["ES002", "Parameter storageUUID or/and parameter values are/is missing."],
|
||||
STORAGE_NOT_UPDATED: ["ES003", "Storage is not updated."],
|
||||
STORAGE_NOT_DELETED: ["ES004", "Storage is not deleted."],
|
||||
NO_STORAGE_LOCATIONS_FOUND: ["ES005", "No storage locations found"],
|
||||
STORAGE_NOT_CREATED: ["ES006", "Storage is not created."],
|
||||
INVALID_REQUEST_BODY: ["ES001", "Invalid request body"],
|
||||
INVALID_PARAMETERS: [
|
||||
"ES002",
|
||||
"Parameter storageUUID or/and parameter values are/is missing.",
|
||||
],
|
||||
STORAGE_NOT_UPDATED: ["ES003", "Storage is not updated."],
|
||||
STORAGE_NOT_DELETED: ["ES004", "Storage is not deleted."],
|
||||
NO_STORAGE_LOCATIONS_FOUND: ["ES005", "No storage locations found"],
|
||||
STORAGE_NOT_CREATED: ["ES006", "Storage is not created."],
|
||||
} as const;
|
||||
|
||||
export const PRODUCT_ERROR_CODE = {
|
||||
PRODUCT_NOT_CREATED: ["EP001", "Error while creating product"],
|
||||
NO_PRODUCTS_FOUND: ["EP002", "No products found"],
|
||||
PRODUCT_NOT_FOUND: ["EP003", "Product not found"],
|
||||
PRODUCT_AMOUNT_NOT_UPDATED: ["EP004", "Error while updating product amount"],
|
||||
PRODUCT_NOT_UPDATED: ["EP005", "Error while updating product"],
|
||||
PRODUCT_NOT_DELETED: ["EP006", "Error while deleting product"],
|
||||
INVALID_REQUEST_BODY: ["EP007", "Invalid request body. Name is required."],
|
||||
INVALID_PARAMETERS: ["EP008", "Invalid or missing parameters."],
|
||||
} as const;
|
||||
PRODUCT_NOT_CREATED: ["EP001", "Error while creating product"],
|
||||
NO_PRODUCTS_FOUND: ["EP002", "No products found"],
|
||||
PRODUCT_NOT_FOUND: ["EP003", "Product not found"],
|
||||
PRODUCT_AMOUNT_NOT_UPDATED: ["EP004", "Error while updating product amount"],
|
||||
PRODUCT_NOT_UPDATED: ["EP005", "Error while updating product"],
|
||||
PRODUCT_NOT_DELETED: ["EP006", "Error while deleting product"],
|
||||
INVALID_REQUEST_BODY: ["EP007", "Invalid request body. Name is required."],
|
||||
INVALID_PARAMETERS: ["EP008", "Invalid or missing parameters."],
|
||||
} as const;
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"rootDir": "./src",
|
||||
"target": "ES2022",
|
||||
"strict": true,
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist/cjs",
|
||||
"module": "CommonJS",
|
||||
"moduleResolution": "Node",
|
||||
"declaration": false,
|
||||
"declarationMap": false,
|
||||
"ignoreDeprecations": "6.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"outDir": "./dist/esm",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"declaration": true,
|
||||
"declarationDir": "./dist/types",
|
||||
"declarationMap": true
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,5 @@
|
||||
"skipLibCheck": true,
|
||||
"ignoreDeprecations": "6.0"
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts"
|
||||
]
|
||||
}
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user