identity-admin 1.25.9 → 1.25.11

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.
Files changed (117) hide show
  1. package/README.md +126 -126
  2. package/lib/Dashboard.d.ts +14 -14
  3. package/lib/Dashboard.js +95 -95
  4. package/lib/container/helpers/HelperInversify.d.ts +6 -6
  5. package/lib/container/helpers/HelperInversify.js +10 -10
  6. package/lib/container/helpers/HelperTypes.d.ts +5 -5
  7. package/lib/container/helpers/HelperTypes.js +7 -7
  8. package/lib/container/index.d.ts +1 -1
  9. package/lib/container/index.js +14 -14
  10. package/lib/container/repositories/RepositoryInversify.d.ts +4 -4
  11. package/lib/container/repositories/RepositoryInversify.js +13 -13
  12. package/lib/container/repositories/RepositoryTypes.d.ts +4 -4
  13. package/lib/container/repositories/RepositoryTypes.js +6 -6
  14. package/lib/container/types.d.ts +8 -8
  15. package/lib/container/types.js +9 -9
  16. package/lib/controllers/ActionController.d.ts +8 -8
  17. package/lib/controllers/ActionController.js +79 -79
  18. package/lib/controllers/DashboardController.d.ts +41 -41
  19. package/lib/controllers/DashboardController.js +589 -589
  20. package/lib/controllers/ResourceController.d.ts +13 -13
  21. package/lib/controllers/ResourceController.js +124 -124
  22. package/lib/helpers/ActionsGenerator.d.ts +11 -11
  23. package/lib/helpers/ActionsGenerator.js +175 -175
  24. package/lib/helpers/FiltersHelper.d.ts +9 -9
  25. package/lib/helpers/FiltersHelper.js +105 -105
  26. package/lib/helpers/LocalesHelper.d.ts +4 -4
  27. package/lib/helpers/LocalesHelper.js +73 -73
  28. package/lib/helpers/LocalizedStringHelper.d.ts +9 -9
  29. package/lib/helpers/LocalizedStringHelper.js +57 -57
  30. package/lib/helpers/PopulationHelper.d.ts +12 -12
  31. package/lib/helpers/PopulationHelper.js +50 -50
  32. package/lib/helpers/ResourceGenerator.d.ts +7 -7
  33. package/lib/helpers/ResourceGenerator.js +171 -171
  34. package/lib/helpers/ResourceHelper.d.ts +28 -28
  35. package/lib/helpers/ResourceHelper.js +376 -376
  36. package/lib/helpers/SchemaGenerator.d.ts +5 -5
  37. package/lib/helpers/SchemaGenerator.js +96 -96
  38. package/lib/helpers/SchemaHelper.d.ts +5 -5
  39. package/lib/helpers/SchemaHelper.js +21 -21
  40. package/lib/locales/en.json +53 -53
  41. package/lib/middlewares/isAuth.d.ts +13 -13
  42. package/lib/middlewares/isAuth.js +43 -43
  43. package/lib/models/ModelNames.d.ts +4 -4
  44. package/lib/models/ModelNames.js +7 -7
  45. package/lib/models/customPage/CustomPage.d.ts +2 -2
  46. package/lib/models/customPage/CustomPage.js +38 -33
  47. package/lib/models/customPage/ICustomPage.d.ts +17 -16
  48. package/lib/models/customPage/ICustomPage.js +2 -2
  49. package/lib/models/file/File.d.ts +2 -2
  50. package/lib/models/file/File.js +23 -23
  51. package/lib/models/file/IFile.d.ts +15 -15
  52. package/lib/models/file/IFile.js +2 -2
  53. package/lib/models/location/ILocation.d.ts +14 -14
  54. package/lib/models/location/ILocation.js +2 -2
  55. package/lib/models/location/Location.d.ts +2 -2
  56. package/lib/models/location/Location.js +21 -21
  57. package/lib/models/modelConfiguration/IModelConfigurations.d.ts +29 -29
  58. package/lib/models/modelConfiguration/IModelConfigurations.js +2 -2
  59. package/lib/models/modelConfiguration/ModelConfiguration.d.ts +13 -13
  60. package/lib/models/modelConfiguration/ModelConfiguration.js +95 -95
  61. package/lib/models/request-log/IRequestLog.d.ts +22 -22
  62. package/lib/models/request-log/IRequestLog.js +2 -2
  63. package/lib/models/request-log/RequestLog.d.ts +3 -3
  64. package/lib/models/request-log/RequestLog.js +51 -51
  65. package/lib/repositories/DashboardRepository.d.ts +5 -5
  66. package/lib/repositories/DashboardRepository.js +12 -12
  67. package/lib/repositories/Repository.d.ts +68 -68
  68. package/lib/repositories/Repository.js +212 -212
  69. package/lib/repositories/RequestLogRepository.d.ts +10 -10
  70. package/lib/repositories/RequestLogRepository.js +54 -54
  71. package/lib/repositories/SaveResult.d.ts +14 -14
  72. package/lib/repositories/SaveResult.js +18 -18
  73. package/lib/router/index.d.ts +8 -8
  74. package/lib/router/index.js +104 -104
  75. package/lib/types/DashbordConfig.d.ts +21 -21
  76. package/lib/types/DashbordConfig.js +2 -2
  77. package/lib/types/IConfigurationFile.d.ts +6 -6
  78. package/lib/types/IConfigurationFile.js +2 -2
  79. package/lib/types/IResourceFile.d.ts +566 -559
  80. package/lib/types/IResourceFile.js +2 -2
  81. package/lib/types/IResourceResponse.d.ts +95 -95
  82. package/lib/types/IResourceResponse.js +2 -2
  83. package/lib/types/helpers.d.ts +60 -60
  84. package/lib/types/helpers.js +70 -70
  85. package/lib/utils/ResourceUtils.d.ts +2 -2
  86. package/lib/utils/ResourceUtils.js +7 -7
  87. package/lib/utils/ResponseUtils.d.ts +11 -11
  88. package/lib/utils/ResponseUtils.js +41 -41
  89. package/lib/utils/StringUtils.d.ts +9 -9
  90. package/lib/utils/StringUtils.js +46 -46
  91. package/lib/view/asset-manifest.json +18 -18
  92. package/lib/view/assets/icons/delete_icon.svg +3 -3
  93. package/lib/view/assets/icons/flags/ic_flag_cn.svg +9 -9
  94. package/lib/view/assets/icons/flags/ic_flag_sa.svg +9 -9
  95. package/lib/view/assets/icons/flags/ic_flag_vn.svg +9 -9
  96. package/lib/view/assets/icons/info_icon.svg +3 -3
  97. package/lib/view/assets/icons/navbar/ic_banking.svg +5 -5
  98. package/lib/view/assets/icons/navbar/ic_invoice.svg +4 -4
  99. package/lib/view/assets/icons/navbar/ic_kanban.svg +7 -7
  100. package/lib/view/assets/icons/navbar/ic_menu_item.svg +8 -8
  101. package/lib/view/assets/icons/small_info_icon.svg +3 -3
  102. package/lib/view/assets/illustrations/Group 16.svg +4 -4
  103. package/lib/view/assets/illustrations/logo.svg +5 -5
  104. package/lib/view/favicon/browserconfig.xml +9 -9
  105. package/lib/view/favicon/safari-pinned-tab.svg +182 -182
  106. package/lib/view/favicon/site.webmanifest +19 -19
  107. package/lib/view/fonts/index.css +18 -18
  108. package/lib/view/index.html +52 -52
  109. package/lib/view/manifest.json +20 -20
  110. package/lib/view/robots.txt +3 -3
  111. package/lib/view/static/css/main.54de06ef.css +1 -1
  112. package/lib/view/static/js/574.778b5963.chunk.js +1 -1
  113. package/lib/view/static/js/678.521704a3.chunk.js +1 -1
  114. package/lib/view/static/js/798.54856416.chunk.js +1 -1
  115. package/lib/view/static/js/main.4687f255.js +2 -2
  116. package/lib/view/static/js/main.4687f255.js.LICENSE.txt +214 -214
  117. package/package.json +51 -51
@@ -1,5 +1,5 @@
1
- import { IResourceFile } from "../types/IResourceFile";
2
- export default class SchemaGenerator {
3
- static generateSchema(schema: any, model: any, modelName: string, resource: IResourceFile): any[];
4
- private static setNestedSchema;
5
- }
1
+ import { IResourceFile } from "../types/IResourceFile";
2
+ export default class SchemaGenerator {
3
+ static generateSchema(schema: any, model: any, modelName: string, resource: IResourceFile): any[];
4
+ private static setNestedSchema;
5
+ }
@@ -1,96 +1,96 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const StringUtils_1 = __importDefault(require("../utils/StringUtils"));
7
- const ResourceHelper_1 = __importDefault(require("./ResourceHelper"));
8
- const helpers_1 = require("../types/helpers");
9
- var pluralize = require('pluralize');
10
- class SchemaGenerator {
11
- static generateSchema(schema, model, modelName, resource) {
12
- const schemaFields = Object.keys(schema);
13
- var populatedString = '';
14
- if (!model) {
15
- model = {};
16
- }
17
- schemaFields.forEach(field => {
18
- const schemaField = schema[field];
19
- const refCheck = schemaField.options.ref;
20
- const translation = ResourceHelper_1.default.checkResourceTranslation(resource, field);
21
- const fieldType = ResourceHelper_1.default.getFieldType(schemaField);
22
- model[field] = model[field] ? model[field] : {};
23
- if (fieldType === helpers_1.FieldTypes.REFERENCE) {
24
- populatedString = StringUtils_1.default.getPopulatedString(populatedString, field);
25
- model[field].path = StringUtils_1.default.lowerCaseFirstLetter(refCheck);
26
- const resourceModel = resource.properties.model;
27
- if (resourceModel && resourceModel[field] && resourceModel[field].mediaUploader) {
28
- model[field].mediaUploader = true;
29
- }
30
- }
31
- if (fieldType === helpers_1.FieldTypes.NESTEDSCHEMA) {
32
- const modelAndPopulatedString = this.setNestedSchema(schema[field].schema.paths, modelName, model, field, populatedString, resource);
33
- model = modelAndPopulatedString[0];
34
- populatedString = modelAndPopulatedString[1];
35
- }
36
- if (fieldType === helpers_1.FieldTypes.DATE) {
37
- model[field].withTime = model[field].withTime ? model[field].withTime : false;
38
- }
39
- else if (fieldType === helpers_1.FieldTypes.ARRAY) {
40
- model[field].required = schema[field].caster.isRequired;
41
- if (schema[field].schema) {
42
- const modelAndPopulatedString = this.setNestedSchema(schema[field].schema.paths, modelName, model, field, populatedString, resource);
43
- model = modelAndPopulatedString[0];
44
- populatedString = modelAndPopulatedString[1];
45
- model[field].arrayType = model[field].arrayType ? model[field].arrayType : helpers_1.FieldTypes.NESTEDSCHEMA;
46
- }
47
- else if (schema[field].caster.options.ref) {
48
- populatedString = StringUtils_1.default.getPopulatedString(populatedString, field);
49
- model[field].path = StringUtils_1.default.lowerCaseFirstLetter(schema[field].caster.options.ref);
50
- model[field].apiRoute = 'admin/' + StringUtils_1.default.lowerCaseFirstLetter(pluralize(schema[field].caster.options.ref));
51
- model[field].arrayType = model[field].arrayType ? model[field].arrayType : helpers_1.FieldTypes.REFERENCE;
52
- }
53
- else {
54
- model[field].arrayType = model[field].arrayType ? model[field].arrayType : schema[field].caster.instance;
55
- }
56
- }
57
- model[field].type = model[field].type ? model[field].type : fieldType;
58
- model[field].defaultValue = schema[field].defaultValue ? schema[field].defaultValue : undefined;
59
- model[field].required = model[field].required ? model[field].required : schemaField.isRequired ? schemaField.isRequired : false;
60
- model[field].apiRoute = model[field].apiRoute ? model[field].apiRoute : schemaField.options.ref ? 'admin/' + StringUtils_1.default.lowerCaseFirstLetter(pluralize(schemaField.options.ref)) : undefined;
61
- model[field].enumValues = (model[field].type === helpers_1.FieldTypes.ENUM || model[field].arrayType === helpers_1.FieldTypes.ENUM) ? model[field].enumValues ? model[field].enumValues : schemaField.enumValues : undefined;
62
- model[field].value = model[field].value ? model[field].value : translation ? translation : refCheck ? StringUtils_1.default.checkRefId(field) ? StringUtils_1.default.convertCamelCaseToWord(field.slice(0, -2)) : StringUtils_1.default.convertCamelCaseToWord(field) : StringUtils_1.default.convertCamelCaseToWord(field);
63
- model[field].isDraggable = model[field].isDraggable === false ? false : true;
64
- });
65
- if (model.virtuals) {
66
- for (const extraField in model.virtuals) {
67
- model[extraField] = model[extraField] ? model[extraField] : {};
68
- model[extraField].type = model.virtuals[extraField].type;
69
- model[extraField].arrayType = model.virtuals[extraField].arrayType ? model.virtuals[extraField].arrayType : undefined;
70
- model[extraField].required = model.virtuals[extraField].required;
71
- model[extraField].value = ResourceHelper_1.default.checkResourceTranslation(resource, extraField) ? ResourceHelper_1.default.checkResourceTranslation(resource, extraField) : StringUtils_1.default.convertCamelCaseToWord(extraField);
72
- model[extraField].path = StringUtils_1.default.getRefPath(extraField);
73
- }
74
- }
75
- return [model, populatedString];
76
- }
77
- static setNestedSchema(paths, modelName, model, field, populatedString, resource) {
78
- var nestedSchema = {};
79
- var nestedSchemaKeys = [];
80
- const nestedModelodelAndPopulatedString = this.generateSchema(paths, nestedSchema, modelName, resource);
81
- model[field].schema = nestedModelodelAndPopulatedString[0];
82
- model[field].populatedString = nestedModelodelAndPopulatedString[1];
83
- const populatedStringArray = nestedModelodelAndPopulatedString[1].split(' ');
84
- populatedStringArray.forEach((nestedSchemaPopulatedString) => {
85
- if (nestedSchemaPopulatedString) {
86
- populatedString = StringUtils_1.default.getPopulatedString(populatedString, field + '.' + nestedSchemaPopulatedString);
87
- }
88
- });
89
- for (const key in model[field].schema) {
90
- nestedSchemaKeys.push(key);
91
- }
92
- model[field].keys = nestedSchemaKeys;
93
- return [model, populatedString];
94
- }
95
- }
96
- exports.default = SchemaGenerator;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const StringUtils_1 = __importDefault(require("../utils/StringUtils"));
7
+ const ResourceHelper_1 = __importDefault(require("./ResourceHelper"));
8
+ const helpers_1 = require("../types/helpers");
9
+ var pluralize = require('pluralize');
10
+ class SchemaGenerator {
11
+ static generateSchema(schema, model, modelName, resource) {
12
+ const schemaFields = Object.keys(schema);
13
+ var populatedString = '';
14
+ if (!model) {
15
+ model = {};
16
+ }
17
+ schemaFields.forEach(field => {
18
+ const schemaField = schema[field];
19
+ const refCheck = schemaField.options.ref;
20
+ const translation = ResourceHelper_1.default.checkResourceTranslation(resource, field);
21
+ const fieldType = ResourceHelper_1.default.getFieldType(schemaField);
22
+ model[field] = model[field] ? model[field] : {};
23
+ if (fieldType === helpers_1.FieldTypes.REFERENCE) {
24
+ populatedString = StringUtils_1.default.getPopulatedString(populatedString, field);
25
+ model[field].path = StringUtils_1.default.lowerCaseFirstLetter(refCheck);
26
+ const resourceModel = resource.properties.model;
27
+ if (resourceModel && resourceModel[field] && resourceModel[field].mediaUploader) {
28
+ model[field].mediaUploader = true;
29
+ }
30
+ }
31
+ if (fieldType === helpers_1.FieldTypes.NESTEDSCHEMA) {
32
+ const modelAndPopulatedString = this.setNestedSchema(schema[field].schema.paths, modelName, model, field, populatedString, resource);
33
+ model = modelAndPopulatedString[0];
34
+ populatedString = modelAndPopulatedString[1];
35
+ }
36
+ if (fieldType === helpers_1.FieldTypes.DATE) {
37
+ model[field].withTime = model[field].withTime ? model[field].withTime : false;
38
+ }
39
+ else if (fieldType === helpers_1.FieldTypes.ARRAY) {
40
+ model[field].required = schema[field].caster.isRequired;
41
+ if (schema[field].schema) {
42
+ const modelAndPopulatedString = this.setNestedSchema(schema[field].schema.paths, modelName, model, field, populatedString, resource);
43
+ model = modelAndPopulatedString[0];
44
+ populatedString = modelAndPopulatedString[1];
45
+ model[field].arrayType = model[field].arrayType ? model[field].arrayType : helpers_1.FieldTypes.NESTEDSCHEMA;
46
+ }
47
+ else if (schema[field].caster.options.ref) {
48
+ populatedString = StringUtils_1.default.getPopulatedString(populatedString, field);
49
+ model[field].path = StringUtils_1.default.lowerCaseFirstLetter(schema[field].caster.options.ref);
50
+ model[field].apiRoute = 'admin/' + StringUtils_1.default.lowerCaseFirstLetter(pluralize(schema[field].caster.options.ref));
51
+ model[field].arrayType = model[field].arrayType ? model[field].arrayType : helpers_1.FieldTypes.REFERENCE;
52
+ }
53
+ else {
54
+ model[field].arrayType = model[field].arrayType ? model[field].arrayType : schema[field].caster.instance;
55
+ }
56
+ }
57
+ model[field].type = model[field].type ? model[field].type : fieldType;
58
+ model[field].defaultValue = schema[field].defaultValue ? schema[field].defaultValue : undefined;
59
+ model[field].required = model[field].required ? model[field].required : schemaField.isRequired ? schemaField.isRequired : false;
60
+ model[field].apiRoute = model[field].apiRoute ? model[field].apiRoute : schemaField.options.ref ? 'admin/' + StringUtils_1.default.lowerCaseFirstLetter(pluralize(schemaField.options.ref)) : undefined;
61
+ model[field].enumValues = (model[field].type === helpers_1.FieldTypes.ENUM || model[field].arrayType === helpers_1.FieldTypes.ENUM) ? model[field].enumValues ? model[field].enumValues : schemaField.enumValues : undefined;
62
+ model[field].value = model[field].value ? model[field].value : translation ? translation : refCheck ? StringUtils_1.default.checkRefId(field) ? StringUtils_1.default.convertCamelCaseToWord(field.slice(0, -2)) : StringUtils_1.default.convertCamelCaseToWord(field) : StringUtils_1.default.convertCamelCaseToWord(field);
63
+ model[field].isDraggable = model[field].isDraggable === false ? false : true;
64
+ });
65
+ if (model.virtuals) {
66
+ for (const extraField in model.virtuals) {
67
+ model[extraField] = model[extraField] ? model[extraField] : {};
68
+ model[extraField].type = model.virtuals[extraField].type;
69
+ model[extraField].arrayType = model.virtuals[extraField].arrayType ? model.virtuals[extraField].arrayType : undefined;
70
+ model[extraField].required = model.virtuals[extraField].required;
71
+ model[extraField].value = ResourceHelper_1.default.checkResourceTranslation(resource, extraField) ? ResourceHelper_1.default.checkResourceTranslation(resource, extraField) : StringUtils_1.default.convertCamelCaseToWord(extraField);
72
+ model[extraField].path = StringUtils_1.default.getRefPath(extraField);
73
+ }
74
+ }
75
+ return [model, populatedString];
76
+ }
77
+ static setNestedSchema(paths, modelName, model, field, populatedString, resource) {
78
+ var nestedSchema = {};
79
+ var nestedSchemaKeys = [];
80
+ const nestedModelodelAndPopulatedString = this.generateSchema(paths, nestedSchema, modelName, resource);
81
+ model[field].schema = nestedModelodelAndPopulatedString[0];
82
+ model[field].populatedString = nestedModelodelAndPopulatedString[1];
83
+ const populatedStringArray = nestedModelodelAndPopulatedString[1].split(' ');
84
+ populatedStringArray.forEach((nestedSchemaPopulatedString) => {
85
+ if (nestedSchemaPopulatedString) {
86
+ populatedString = StringUtils_1.default.getPopulatedString(populatedString, field + '.' + nestedSchemaPopulatedString);
87
+ }
88
+ });
89
+ for (const key in model[field].schema) {
90
+ nestedSchemaKeys.push(key);
91
+ }
92
+ model[field].keys = nestedSchemaKeys;
93
+ return [model, populatedString];
94
+ }
95
+ }
96
+ exports.default = SchemaGenerator;
@@ -1,5 +1,5 @@
1
- import { Schema } from 'mongoose';
2
- export default class SchemaHelper {
3
- static belongsTo(schema: Schema, modelName: string): void;
4
- private static lowerFirstLetter;
5
- }
1
+ import { Schema } from 'mongoose';
2
+ export default class SchemaHelper {
3
+ static belongsTo(schema: Schema, modelName: string): void;
4
+ private static lowerFirstLetter;
5
+ }
@@ -1,21 +1,21 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class SchemaHelper {
4
- static belongsTo(schema, modelName) {
5
- const fieldName = this.lowerFirstLetter(modelName);
6
- const localFieldName = fieldName + 'Id';
7
- schema.virtual(fieldName, {
8
- ref: modelName,
9
- localField: localFieldName,
10
- foreignField: '_id',
11
- justOne: true
12
- });
13
- }
14
- static lowerFirstLetter(value) {
15
- if (value.length == 0) {
16
- return '';
17
- }
18
- return value.charAt(0).toLowerCase() + value.slice(1);
19
- }
20
- }
21
- exports.default = SchemaHelper;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class SchemaHelper {
4
+ static belongsTo(schema, modelName) {
5
+ const fieldName = this.lowerFirstLetter(modelName);
6
+ const localFieldName = fieldName + 'Id';
7
+ schema.virtual(fieldName, {
8
+ ref: modelName,
9
+ localField: localFieldName,
10
+ foreignField: '_id',
11
+ justOne: true
12
+ });
13
+ }
14
+ static lowerFirstLetter(value) {
15
+ if (value.length == 0) {
16
+ return '';
17
+ }
18
+ return value.charAt(0).toLowerCase() + value.slice(1);
19
+ }
20
+ }
21
+ exports.default = SchemaHelper;
@@ -1,54 +1,54 @@
1
- {
2
- "actions_edit": "Edit",
3
- "actions_delete": "Delete",
4
- "actions_delete_confirmMessage_title": "Do you really want to delete this record?",
5
- "actions_delete_confirmMessage_body": "If you clicked yes, this record will be permanently deleted.",
6
- "actions_bulkDelete_confirmMessage_title": "Do you really want to delete these records?",
7
- "actions_bulkDelete_confirmMessage_body": "If you clicked yes, these records will be permanently deleted.",
8
- "actions_delete_options_yes": "Delete",
9
- "actions_delete_options_no": "No",
10
- "ana": "ana",
11
- "Admin": "Admin",
12
- "User": "User",
13
- "ALL": "ALL",
14
- "EMAIL": "EMAIL",
15
- "GOOGLE": "GOOGLE",
16
- "APPLE": "APPLE",
17
- "GUEST": "GUEST",
18
- "Recipient": "Recipient",
19
- "Home View Section": "Home View Section",
20
- "Options": "Options",
21
- "Product": "Product",
22
- "Active": "Active",
23
- "Draft": "Draft",
24
- "Cart": "Cart",
25
- "ACTIVE": "ACTIVE",
26
- "EXPIRED": "EXPIRED",
27
- "Inventory Item": "Inventory Item",
28
- "Collection": "Collection",
29
- "SMART": "SMART",
30
- "MANUAL": "MANUAL",
31
- "Image": "Image",
32
- "Banner": "Banner",
33
- "Brand": "Brand",
34
- "Color": "Color",
35
- "Location": "Location",
36
- "Product Option": "Product Option",
37
- "Product Variant": "Product Variant",
38
- "Flower Type": "Flower Type",
39
- "Collection Product": "Collection Product",
40
- "Device": "Device",
41
- "Favorite Product": "Favorite Product",
42
- "Settings": "Settings",
43
- "Delivery Slot": "Delivery Slot",
44
- "Push Notification": "Push Notification",
45
- "Request Log": "Request Log",
46
- "Success": "Success",
47
- "Unauthorized": "Unauthorized",
48
- "unprocessable": "unprocessable",
49
- "Server Error": "Server Error",
50
- "actions_new": "actions_new",
51
- "Setup": "Setup",
52
- "Country": "Country",
53
- "Country User": "Country User"
1
+ {
2
+ "actions_edit": "Edit",
3
+ "actions_delete": "Delete",
4
+ "actions_delete_confirmMessage_title": "Do you really want to delete this record?",
5
+ "actions_delete_confirmMessage_body": "If you clicked yes, this record will be permanently deleted.",
6
+ "actions_bulkDelete_confirmMessage_title": "Do you really want to delete these records?",
7
+ "actions_bulkDelete_confirmMessage_body": "If you clicked yes, these records will be permanently deleted.",
8
+ "actions_delete_options_yes": "Delete",
9
+ "actions_delete_options_no": "No",
10
+ "ana": "ana",
11
+ "Admin": "Admin",
12
+ "User": "User",
13
+ "ALL": "ALL",
14
+ "EMAIL": "EMAIL",
15
+ "GOOGLE": "GOOGLE",
16
+ "APPLE": "APPLE",
17
+ "GUEST": "GUEST",
18
+ "Recipient": "Recipient",
19
+ "Home View Section": "Home View Section",
20
+ "Options": "Options",
21
+ "Product": "Product",
22
+ "Active": "Active",
23
+ "Draft": "Draft",
24
+ "Cart": "Cart",
25
+ "ACTIVE": "ACTIVE",
26
+ "EXPIRED": "EXPIRED",
27
+ "Inventory Item": "Inventory Item",
28
+ "Collection": "Collection",
29
+ "SMART": "SMART",
30
+ "MANUAL": "MANUAL",
31
+ "Image": "Image",
32
+ "Banner": "Banner",
33
+ "Brand": "Brand",
34
+ "Color": "Color",
35
+ "Location": "Location",
36
+ "Product Option": "Product Option",
37
+ "Product Variant": "Product Variant",
38
+ "Flower Type": "Flower Type",
39
+ "Collection Product": "Collection Product",
40
+ "Device": "Device",
41
+ "Favorite Product": "Favorite Product",
42
+ "Settings": "Settings",
43
+ "Delivery Slot": "Delivery Slot",
44
+ "Push Notification": "Push Notification",
45
+ "Request Log": "Request Log",
46
+ "Success": "Success",
47
+ "Unauthorized": "Unauthorized",
48
+ "unprocessable": "unprocessable",
49
+ "Server Error": "Server Error",
50
+ "actions_new": "actions_new",
51
+ "Setup": "Setup",
52
+ "Country": "Country",
53
+ "Country User": "Country User"
54
54
  }
@@ -1,13 +1,13 @@
1
- import { NextFunction, Request, Response } from "express";
2
- import { AuthenticateMiddleWare } from "../types/DashbordConfig";
3
- import { Document } from "mongoose";
4
- export interface IRequest extends Request {
5
- user: Document;
6
- language: string;
7
- timezone: string;
8
- startTime: Date;
9
- }
10
- export declare const defaultHeaders: (req: IRequest, res: Response, next: NextFunction) => void;
11
- export declare const authenticate: (req: IRequest, res: Response, next: NextFunction, authenticate: AuthenticateMiddleWare) => Promise<void>;
12
- declare const isAuth: (req: IRequest, res: Response, next: NextFunction) => void;
13
- export default isAuth;
1
+ import { NextFunction, Request, Response } from "express";
2
+ import { AuthenticateMiddleWare } from "../types/DashbordConfig";
3
+ import { Document } from "mongoose";
4
+ export interface IRequest extends Request {
5
+ user: Document;
6
+ language: string;
7
+ timezone: string;
8
+ startTime: Date;
9
+ }
10
+ export declare const defaultHeaders: (req: IRequest, res: Response, next: NextFunction) => void;
11
+ export declare const authenticate: (req: IRequest, res: Response, next: NextFunction, authenticate: AuthenticateMiddleWare) => Promise<void>;
12
+ declare const isAuth: (req: IRequest, res: Response, next: NextFunction) => void;
13
+ export default isAuth;
@@ -1,43 +1,43 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.authenticate = exports.defaultHeaders = void 0;
16
- const ResponseUtils_1 = __importDefault(require("../utils/ResponseUtils"));
17
- const defaultHeaders = function (req, res, next) {
18
- req.language = req.headers['accept-language'] ? req.headers['accept-language'] : 'en';
19
- req.timezone = req.headers.timezone ? req.headers.timezone : 'UTC';
20
- next();
21
- };
22
- exports.defaultHeaders = defaultHeaders;
23
- const authenticate = (req, res, next, authenticate) => __awaiter(void 0, void 0, void 0, function* () {
24
- const adminCredentials = {
25
- email: req.body.user.email,
26
- password: req.body.user.password
27
- };
28
- const user = yield authenticate(adminCredentials);
29
- if (!user) {
30
- return ResponseUtils_1.default.unauthorized(res);
31
- }
32
- req.user = user;
33
- next();
34
- });
35
- exports.authenticate = authenticate;
36
- const isAuth = function (req, res, next) {
37
- const session = req.session;
38
- if (!session.userName) {
39
- return ResponseUtils_1.default.unauthorized(res);
40
- }
41
- next();
42
- };
43
- exports.default = isAuth;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.authenticate = exports.defaultHeaders = void 0;
16
+ const ResponseUtils_1 = __importDefault(require("../utils/ResponseUtils"));
17
+ const defaultHeaders = function (req, res, next) {
18
+ req.language = req.headers['accept-language'] ? req.headers['accept-language'] : 'en';
19
+ req.timezone = req.headers.timezone ? req.headers.timezone : 'UTC';
20
+ next();
21
+ };
22
+ exports.defaultHeaders = defaultHeaders;
23
+ const authenticate = (req, res, next, authenticate) => __awaiter(void 0, void 0, void 0, function* () {
24
+ const adminCredentials = {
25
+ email: req.body.user.email,
26
+ password: req.body.user.password
27
+ };
28
+ const user = yield authenticate(adminCredentials);
29
+ if (!user) {
30
+ return ResponseUtils_1.default.unauthorized(res);
31
+ }
32
+ req.user = user;
33
+ next();
34
+ });
35
+ exports.authenticate = authenticate;
36
+ const isAuth = function (req, res, next) {
37
+ const session = req.session;
38
+ if (!session.userName) {
39
+ return ResponseUtils_1.default.unauthorized(res);
40
+ }
41
+ next();
42
+ };
43
+ exports.default = isAuth;
@@ -1,4 +1,4 @@
1
- export default class ModelNames {
2
- static User: string;
3
- static RequestLog: string;
4
- }
1
+ export default class ModelNames {
2
+ static User: string;
3
+ static RequestLog: string;
4
+ }
@@ -1,7 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class ModelNames {
4
- }
5
- exports.default = ModelNames;
6
- ModelNames.User = 'IdentityUser';
7
- ModelNames.RequestLog = 'RequestLog';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class ModelNames {
4
+ }
5
+ exports.default = ModelNames;
6
+ ModelNames.User = 'IdentityUser';
7
+ ModelNames.RequestLog = 'RequestLog';
@@ -1,2 +1,2 @@
1
- import { Schema, SchemaOptions } from "mongoose";
2
- export declare function getCustomPageSchema(schemaOptions: SchemaOptions): Schema;
1
+ import { Schema, SchemaOptions } from "mongoose";
2
+ export declare function getCustomPageSchema(schemaOptions: SchemaOptions): Schema;
@@ -1,33 +1,38 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCustomPageSchema = void 0;
4
- const mongoose_1 = require("mongoose");
5
- function getCustomPageSchema(schemaOptions) {
6
- return new mongoose_1.Schema({
7
- key: {
8
- type: String,
9
- required: true,
10
- index: true,
11
- unique: true
12
- },
13
- title: {
14
- type: String,
15
- required: true,
16
- },
17
- content: {
18
- type: String,
19
- required: true,
20
- },
21
- disableMainLayoutHeader: {
22
- type: Boolean,
23
- required: false,
24
- default: false
25
- },
26
- disableMainLayoutFooter: {
27
- type: Boolean,
28
- required: false,
29
- default: false
30
- },
31
- }, schemaOptions);
32
- }
33
- exports.getCustomPageSchema = getCustomPageSchema;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCustomPageSchema = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ function getCustomPageSchema(schemaOptions) {
6
+ return new mongoose_1.Schema({
7
+ key: {
8
+ type: String,
9
+ required: true,
10
+ index: true,
11
+ unique: true,
12
+ },
13
+ title: {
14
+ type: String,
15
+ required: true,
16
+ },
17
+ content: {
18
+ type: String,
19
+ required: true,
20
+ },
21
+ visible: {
22
+ type: Boolean,
23
+ required: false,
24
+ default: true,
25
+ },
26
+ disableMainLayoutHeader: {
27
+ type: Boolean,
28
+ required: false,
29
+ default: false,
30
+ },
31
+ disableMainLayoutFooter: {
32
+ type: Boolean,
33
+ required: false,
34
+ default: false,
35
+ },
36
+ }, schemaOptions);
37
+ }
38
+ exports.getCustomPageSchema = getCustomPageSchema;
@@ -1,16 +1,17 @@
1
- import { Document, Model, Types } from "mongoose";
2
- export interface ICustomPageProps {
3
- _id?: Types.ObjectId;
4
- key: string;
5
- title: string;
6
- content: string;
7
- disableMainLayoutHeader?: boolean;
8
- disableMainLayoutFooter?: boolean;
9
- }
10
- export interface ICustomPageDocument extends ICustomPageProps, Document {
11
- _id: Types.ObjectId;
12
- createdAt: Date;
13
- updatedAt: Date;
14
- }
15
- export default interface ICustomPageModel extends Model<ICustomPageDocument> {
16
- }
1
+ import { Document, Model, Types } from "mongoose";
2
+ export interface ICustomPageProps {
3
+ _id?: Types.ObjectId;
4
+ key: string;
5
+ title: string;
6
+ content: string;
7
+ visible?: boolean;
8
+ disableMainLayoutHeader?: boolean;
9
+ disableMainLayoutFooter?: boolean;
10
+ }
11
+ export interface ICustomPageDocument extends ICustomPageProps, Document {
12
+ _id: Types.ObjectId;
13
+ createdAt: Date;
14
+ updatedAt: Date;
15
+ }
16
+ export default interface ICustomPageModel extends Model<ICustomPageDocument> {
17
+ }
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +1,2 @@
1
- import { Schema, SchemaOptions } from "mongoose";
2
- export declare function getFileSchema(schemaOptions: SchemaOptions): Schema;
1
+ import { Schema, SchemaOptions } from "mongoose";
2
+ export declare function getFileSchema(schemaOptions: SchemaOptions): Schema;