namirasoft-field-node 1.3.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/Application.d.ts +7 -0
- package/dist/Application.js +41 -0
- package/dist/Application.js.map +1 -0
- package/dist/controller/BaseEntityFieldController.d.ts +12 -0
- package/dist/controller/BaseEntityFieldController.js +16 -0
- package/dist/controller/BaseEntityFieldController.js.map +1 -0
- package/dist/controller/BaseEntityFieldControllerProps.d.ts +3 -0
- package/dist/controller/BaseEntityFieldControllerProps.js +3 -0
- package/dist/controller/BaseEntityFieldControllerProps.js.map +1 -0
- package/dist/controller/BaseEntityFieldControllerState.d.ts +3 -0
- package/dist/controller/BaseEntityFieldControllerState.js +3 -0
- package/dist/controller/BaseEntityFieldControllerState.js.map +1 -0
- package/dist/controller/entity_category/Create.d.ts +21 -0
- package/dist/controller/entity_category/Create.js +64 -0
- package/dist/controller/entity_category/Create.js.map +1 -0
- package/dist/controller/entity_category/Delete.d.ts +21 -0
- package/dist/controller/entity_category/Delete.js +63 -0
- package/dist/controller/entity_category/Delete.js.map +1 -0
- package/dist/controller/entity_category/Get.d.ts +22 -0
- package/dist/controller/entity_category/Get.js +65 -0
- package/dist/controller/entity_category/Get.js.map +1 -0
- package/dist/controller/entity_category/List.d.ts +27 -0
- package/dist/controller/entity_category/List.js +64 -0
- package/dist/controller/entity_category/List.js.map +1 -0
- package/dist/controller/entity_category/Update.d.ts +21 -0
- package/dist/controller/entity_category/Update.js +66 -0
- package/dist/controller/entity_category/Update.js.map +1 -0
- package/dist/controller/entity_field/Create.d.ts +21 -0
- package/dist/controller/entity_field/Create.js +66 -0
- package/dist/controller/entity_field/Create.js.map +1 -0
- package/dist/controller/entity_field/Delete.d.ts +21 -0
- package/dist/controller/entity_field/Delete.js +63 -0
- package/dist/controller/entity_field/Delete.js.map +1 -0
- package/dist/controller/entity_field/Get.d.ts +22 -0
- package/dist/controller/entity_field/Get.js +65 -0
- package/dist/controller/entity_field/Get.js.map +1 -0
- package/dist/controller/entity_field/List.d.ts +27 -0
- package/dist/controller/entity_field/List.js +64 -0
- package/dist/controller/entity_field/List.js.map +1 -0
- package/dist/controller/entity_field/Update.d.ts +21 -0
- package/dist/controller/entity_field/Update.js +68 -0
- package/dist/controller/entity_field/Update.js.map +1 -0
- package/dist/controller/entity_tag/Create.d.ts +21 -0
- package/dist/controller/entity_tag/Create.js +66 -0
- package/dist/controller/entity_tag/Create.js.map +1 -0
- package/dist/controller/entity_tag/Delete.d.ts +21 -0
- package/dist/controller/entity_tag/Delete.js +63 -0
- package/dist/controller/entity_tag/Delete.js.map +1 -0
- package/dist/controller/entity_tag/Get.d.ts +22 -0
- package/dist/controller/entity_tag/Get.js +65 -0
- package/dist/controller/entity_tag/Get.js.map +1 -0
- package/dist/controller/entity_tag/List.d.ts +27 -0
- package/dist/controller/entity_tag/List.js +64 -0
- package/dist/controller/entity_tag/List.js.map +1 -0
- package/dist/controller/entity_tag/Update.d.ts +21 -0
- package/dist/controller/entity_tag/Update.js +68 -0
- package/dist/controller/entity_tag/Update.js.map +1 -0
- package/dist/database/DatabaseTables.d.ts +13 -0
- package/dist/database/DatabaseTables.js +33 -0
- package/dist/database/DatabaseTables.js.map +1 -0
- package/dist/database/attributes/EntityCategoryAttributes.d.ts +3 -0
- package/dist/database/attributes/EntityCategoryAttributes.js +11 -0
- package/dist/database/attributes/EntityCategoryAttributes.js.map +1 -0
- package/dist/database/attributes/EntityFieldAttributes.d.ts +3 -0
- package/dist/database/attributes/EntityFieldAttributes.js +13 -0
- package/dist/database/attributes/EntityFieldAttributes.js.map +1 -0
- package/dist/database/attributes/EntityTagAttributes.d.ts +3 -0
- package/dist/database/attributes/EntityTagAttributes.js +13 -0
- package/dist/database/attributes/EntityTagAttributes.js.map +1 -0
- package/dist/database/model/EntityCategoryModel.d.ts +7 -0
- package/dist/database/model/EntityCategoryModel.js +9 -0
- package/dist/database/model/EntityCategoryModel.js.map +1 -0
- package/dist/database/model/EntityFieldModel.d.ts +9 -0
- package/dist/database/model/EntityFieldModel.js +8 -0
- package/dist/database/model/EntityFieldModel.js.map +1 -0
- package/dist/database/model/EntityTagModel.d.ts +9 -0
- package/dist/database/model/EntityTagModel.js +8 -0
- package/dist/database/model/EntityTagModel.js.map +1 -0
- package/dist/database/table/EntityCategoryTable.d.ts +17 -0
- package/dist/database/table/EntityCategoryTable.js +65 -0
- package/dist/database/table/EntityCategoryTable.js.map +1 -0
- package/dist/database/table/EntityFieldTable.d.ts +17 -0
- package/dist/database/table/EntityFieldTable.js +69 -0
- package/dist/database/table/EntityFieldTable.js.map +1 -0
- package/dist/database/table/EntityTagTable.d.ts +17 -0
- package/dist/database/table/EntityTagTable.js +69 -0
- package/dist/database/table/EntityTagTable.js.map +1 -0
- package/dist/enum/EntityCategoryNames.d.ts +3 -0
- package/dist/enum/EntityCategoryNames.js +9 -0
- package/dist/enum/EntityCategoryNames.js.map +1 -0
- package/dist/enum/EntityFieldNames.d.ts +3 -0
- package/dist/enum/EntityFieldNames.js +9 -0
- package/dist/enum/EntityFieldNames.js.map +1 -0
- package/dist/enum/EntityTagNames.d.ts +3 -0
- package/dist/enum/EntityTagNames.js +9 -0
- package/dist/enum/EntityTagNames.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/logo.png +0 -0
- package/package.json +28 -0
- package/src/Application.ts +43 -0
- package/src/controller/BaseEntityFieldController.ts +22 -0
- package/src/controller/BaseEntityFieldControllerProps.ts +5 -0
- package/src/controller/BaseEntityFieldControllerState.ts +5 -0
- package/src/controller/entity_category/Create.ts +52 -0
- package/src/controller/entity_category/Delete.ts +48 -0
- package/src/controller/entity_category/Get.ts +51 -0
- package/src/controller/entity_category/List.ts +50 -0
- package/src/controller/entity_category/Update.ts +53 -0
- package/src/controller/entity_field/Create.ts +55 -0
- package/src/controller/entity_field/Delete.ts +48 -0
- package/src/controller/entity_field/Get.ts +51 -0
- package/src/controller/entity_field/List.ts +50 -0
- package/src/controller/entity_field/Update.ts +57 -0
- package/src/controller/entity_tag/Create.ts +55 -0
- package/src/controller/entity_tag/Delete.ts +48 -0
- package/src/controller/entity_tag/Get.ts +51 -0
- package/src/controller/entity_tag/List.ts +50 -0
- package/src/controller/entity_tag/Update.ts +57 -0
- package/src/database/DatabaseTables.ts +40 -0
- package/src/database/attributes/EntityCategoryAttributes.ts +12 -0
- package/src/database/attributes/EntityFieldAttributes.ts +14 -0
- package/src/database/attributes/EntityTagAttributes.ts +14 -0
- package/src/database/model/EntityCategoryModel.ts +9 -0
- package/src/database/model/EntityFieldModel.ts +11 -0
- package/src/database/model/EntityTagModel.ts +11 -0
- package/src/database/table/EntityCategoryTable.ts +63 -0
- package/src/database/table/EntityFieldTable.ts +67 -0
- package/src/database/table/EntityTagTable.ts +67 -0
- package/src/enum/EntityCategoryNames.ts +4 -0
- package/src/enum/EntityFieldNames.ts +4 -0
- package/src/enum/EntityTagNames.ts +4 -0
- package/src/index.ts +1 -0
- package/tsconfig.json +42 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import express from 'express';
|
|
2
|
+
import { NSABaseApplication } from 'namirasoft-account-node';
|
|
3
|
+
import { BaseMySqlDatabase } from 'namirasoft-node-mysql';
|
|
4
|
+
import { DatabaseTables } from './database/DatabaseTables';
|
|
5
|
+
export declare class Application {
|
|
6
|
+
static getControllers(_getDatabase: () => BaseMySqlDatabase, tables: DatabaseTables<BaseMySqlDatabase>): ((app: NSABaseApplication<BaseMySqlDatabase>, req: express.Request, res: express.Response) => any)[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Application = void 0;
|
|
4
|
+
const Create_1 = require("./controller/entity_category/Create");
|
|
5
|
+
const Delete_1 = require("./controller/entity_category/Delete");
|
|
6
|
+
const Get_1 = require("./controller/entity_category/Get");
|
|
7
|
+
const List_1 = require("./controller/entity_category/List");
|
|
8
|
+
const Update_1 = require("./controller/entity_category/Update");
|
|
9
|
+
const Create_2 = require("./controller/entity_field/Create");
|
|
10
|
+
const Delete_2 = require("./controller/entity_field/Delete");
|
|
11
|
+
const Get_2 = require("./controller/entity_field/Get");
|
|
12
|
+
const List_2 = require("./controller/entity_field/List");
|
|
13
|
+
const Update_2 = require("./controller/entity_field/Update");
|
|
14
|
+
const Create_3 = require("./controller/entity_tag/Create");
|
|
15
|
+
const Delete_3 = require("./controller/entity_tag/Delete");
|
|
16
|
+
const Get_3 = require("./controller/entity_tag/Get");
|
|
17
|
+
const List_3 = require("./controller/entity_tag/List");
|
|
18
|
+
const Update_3 = require("./controller/entity_tag/Update");
|
|
19
|
+
class Application {
|
|
20
|
+
static getControllers(_getDatabase, tables) {
|
|
21
|
+
return [
|
|
22
|
+
(app, req, res) => new Create_1.Create(app, req, res, _getDatabase, tables),
|
|
23
|
+
(app, req, res) => new Delete_1.Delete(app, req, res, _getDatabase, tables),
|
|
24
|
+
(app, req, res) => new Get_1.Get(app, req, res, _getDatabase, tables),
|
|
25
|
+
(app, req, res) => new List_1.List(app, req, res, _getDatabase, tables),
|
|
26
|
+
(app, req, res) => new Update_1.Update(app, req, res, _getDatabase, tables),
|
|
27
|
+
(app, req, res) => new Create_2.Create(app, req, res, _getDatabase, tables),
|
|
28
|
+
(app, req, res) => new Delete_2.Delete(app, req, res, _getDatabase, tables),
|
|
29
|
+
(app, req, res) => new Get_2.Get(app, req, res, _getDatabase, tables),
|
|
30
|
+
(app, req, res) => new List_2.List(app, req, res, _getDatabase, tables),
|
|
31
|
+
(app, req, res) => new Update_2.Update(app, req, res, _getDatabase, tables),
|
|
32
|
+
(app, req, res) => new Create_3.Create(app, req, res, _getDatabase, tables),
|
|
33
|
+
(app, req, res) => new Delete_3.Delete(app, req, res, _getDatabase, tables),
|
|
34
|
+
(app, req, res) => new Get_3.Get(app, req, res, _getDatabase, tables),
|
|
35
|
+
(app, req, res) => new List_3.List(app, req, res, _getDatabase, tables),
|
|
36
|
+
(app, req, res) => new Update_3.Update(app, req, res, _getDatabase, tables),
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.Application = Application;
|
|
41
|
+
//# sourceMappingURL=Application.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Application.js","sourceRoot":"","sources":["../src/Application.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NSABaseApplication, NSABaseController } from "namirasoft-account-node";
|
|
2
|
+
import { BaseEntityFieldControllerState } from "./BaseEntityFieldControllerState";
|
|
3
|
+
import { BaseEntityFieldControllerProps } from "./BaseEntityFieldControllerProps";
|
|
4
|
+
import { BaseMySqlDatabase } from "namirasoft-node-mysql";
|
|
5
|
+
import express from "express";
|
|
6
|
+
import { DatabaseTables } from "../database/DatabaseTables";
|
|
7
|
+
export declare abstract class BaseEntityFieldController<Output> extends NSABaseController<BaseMySqlDatabase, BaseEntityFieldControllerState, BaseEntityFieldControllerProps, Output> {
|
|
8
|
+
private _getDatabase;
|
|
9
|
+
protected tables: DatabaseTables<BaseMySqlDatabase>;
|
|
10
|
+
constructor(app: NSABaseApplication<BaseMySqlDatabase>, req: express.Request, res: express.Response, _getDatabase: () => BaseMySqlDatabase, tables: DatabaseTables<BaseMySqlDatabase>);
|
|
11
|
+
getDatabase(): BaseMySqlDatabase;
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseEntityFieldController = void 0;
|
|
4
|
+
const namirasoft_account_node_1 = require("namirasoft-account-node");
|
|
5
|
+
class BaseEntityFieldController extends namirasoft_account_node_1.NSABaseController {
|
|
6
|
+
constructor(app, req, res, _getDatabase, tables) {
|
|
7
|
+
super(app, req, res);
|
|
8
|
+
this._getDatabase = _getDatabase;
|
|
9
|
+
this.tables = tables;
|
|
10
|
+
}
|
|
11
|
+
getDatabase() {
|
|
12
|
+
return this._getDatabase();
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.BaseEntityFieldController = BaseEntityFieldController;
|
|
16
|
+
//# sourceMappingURL=BaseEntityFieldController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseEntityFieldController.js","sourceRoot":"","sources":["../../src/controller/BaseEntityFieldController.ts"],"names":[],"mappings":";;;AAAA,qEAAgF;AAOhF,MAAsB,yBAAkC,SAAQ,2CAA4G;IAI3K,YAAY,GAA0C,EAAE,GAAoB,EAAE,GAAqB,EAAE,YAAqC,EAAE,MAAyC;QAEpL,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;QACpB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;IACQ,WAAW;QAEnB,OAAO,IAAI,CAAC,YAAY,EAAE,CAAC;IAC5B,CAAC;CACD;AAdD,8DAcC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseEntityFieldControllerProps.js","sourceRoot":"","sources":["../../src/controller/BaseEntityFieldControllerProps.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseEntityFieldControllerState.js","sourceRoot":"","sources":["../../src/controller/BaseEntityFieldControllerState.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HTTPMethod } from "namirasoft-core";
|
|
2
|
+
import { EntityCategoryModel } from "../../database/model/EntityCategoryModel";
|
|
3
|
+
import { BaseEntityFieldController } from "../BaseEntityFieldController";
|
|
4
|
+
export declare class Create extends BaseEntityFieldController<EntityCategoryModel> {
|
|
5
|
+
getInfo(): {
|
|
6
|
+
name: string;
|
|
7
|
+
tag: string;
|
|
8
|
+
method: HTTPMethod;
|
|
9
|
+
path: string;
|
|
10
|
+
summary: string;
|
|
11
|
+
};
|
|
12
|
+
getParametersSchema(): Promise<never[]>;
|
|
13
|
+
getQueriesSchema(): Promise<never[]>;
|
|
14
|
+
getBodySchema(): Promise<import("namirasoft-schema").ObjectSchema>;
|
|
15
|
+
getOutputSchema(): Promise<import("namirasoft-schema").ObjectSchema>;
|
|
16
|
+
getState(): Promise<{
|
|
17
|
+
check_auth: boolean;
|
|
18
|
+
auth_optional: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
handle(): Promise<any>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Create = void 0;
|
|
13
|
+
const namirasoft_core_1 = require("namirasoft-core");
|
|
14
|
+
const BaseEntityFieldController_1 = require("../BaseEntityFieldController");
|
|
15
|
+
const EntityFieldNames_1 = require("../../enum/EntityFieldNames");
|
|
16
|
+
class Create extends BaseEntityFieldController_1.BaseEntityFieldController {
|
|
17
|
+
getInfo() {
|
|
18
|
+
return {
|
|
19
|
+
name: "Create",
|
|
20
|
+
tag: "Category",
|
|
21
|
+
method: namirasoft_core_1.HTTPMethod.POST,
|
|
22
|
+
path: "/category",
|
|
23
|
+
summary: "Creates a new category"
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
getParametersSchema() {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
return [];
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
getQueriesSchema() {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
return [];
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
getBodySchema() {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
return this.tables.entity_category.getSchemaByName(true, EntityFieldNames_1.EntityFieldNames.EntityFieldInput);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
getOutputSchema() {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
return this.tables.entity_category.getSchemaByName(true);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
getState() {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
return {
|
|
49
|
+
check_auth: true,
|
|
50
|
+
auth_optional: false
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
handle() {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
let session = yield this.props.getSession();
|
|
57
|
+
let category_id = new namirasoft_core_1.ObjectService(this.req.body.category_id).getString();
|
|
58
|
+
let ans = yield this.tables.entity_category.create(session, category_id, null);
|
|
59
|
+
return yield this.tables.entity_category.secure(ans);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.Create = Create;
|
|
64
|
+
//# sourceMappingURL=Create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Create.js","sourceRoot":"","sources":["../../../src/controller/entity_category/Create.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA4D;AAE5D,4EAAyE;AACzE,kEAA+D;AAE/D,MAAa,MAAO,SAAQ,qDAA8C;IAEhE,OAAO;QAEf,OAAO;YACN,IAAI,EAAE,QAAQ;YACd,GAAG,EAAE,UAAU;YACf,MAAM,EAAE,4BAAU,CAAC,IAAI;YACvB,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,wBAAwB;SACjC,CAAA;IACF,CAAC;IACc,mBAAmB;;YAEjC,OAAO,EAAE,CAAC;QACX,CAAC;KAAA;IACc,gBAAgB;;YAE9B,OAAO,EAAE,CAAC;QACX,CAAC;KAAA;IACc,aAAa;;YAE3B,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,eAAe,CAAC,IAAI,EAAE,mCAAgB,CAAC,gBAAgB,CAAC,CAAC;QAC7F,CAAC;KAAA;IACc,eAAe;;YAE7B,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAC1D,CAAC;KAAA;IACc,QAAQ;;YAEtB,OAAO;gBACN,UAAU,EAAE,IAAI;gBAChB,aAAa,EAAE,KAAK;aACpB,CAAC;QACH,CAAC;KAAA;IACc,MAAM;;YAEpB,IAAI,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;YAE5C,IAAI,WAAW,GAAG,IAAI,+BAAa,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,SAAS,EAAE,CAAC;YAE3E,IAAI,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO,EACzD,WAAW,EACX,IAAI,CAAC,CAAC;YACP,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACtD,CAAC;KAAA;CACD;AA9CD,wBA8CC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HTTPMethod } from "namirasoft-core";
|
|
2
|
+
import { BaseEntityFieldController } from "../BaseEntityFieldController";
|
|
3
|
+
import { BaseVariableSchema } from "namirasoft-schema";
|
|
4
|
+
export declare class Delete extends BaseEntityFieldController<void> {
|
|
5
|
+
getInfo(): {
|
|
6
|
+
name: string;
|
|
7
|
+
tag: string;
|
|
8
|
+
method: HTTPMethod;
|
|
9
|
+
path: string;
|
|
10
|
+
summary: string;
|
|
11
|
+
};
|
|
12
|
+
getParametersSchema(): Promise<BaseVariableSchema[]>;
|
|
13
|
+
getQueriesSchema(): Promise<never[]>;
|
|
14
|
+
getBodySchema(): Promise<null>;
|
|
15
|
+
getOutputSchema(): Promise<null>;
|
|
16
|
+
getState(): Promise<{
|
|
17
|
+
check_auth: boolean;
|
|
18
|
+
auth_optional: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
handle(): Promise<void>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Delete = void 0;
|
|
13
|
+
const namirasoft_core_1 = require("namirasoft-core");
|
|
14
|
+
const BaseEntityFieldController_1 = require("../BaseEntityFieldController");
|
|
15
|
+
const namirasoft_schema_1 = require("namirasoft-schema");
|
|
16
|
+
class Delete extends BaseEntityFieldController_1.BaseEntityFieldController {
|
|
17
|
+
getInfo() {
|
|
18
|
+
return {
|
|
19
|
+
name: "Delete",
|
|
20
|
+
tag: "Category",
|
|
21
|
+
method: namirasoft_core_1.HTTPMethod.DELETE,
|
|
22
|
+
path: "/category/{id}",
|
|
23
|
+
summary: "Deletes an category by id."
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
getParametersSchema() {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
return [new namirasoft_schema_1.BaseVariableSchema("id", new namirasoft_schema_1.StringSchema(true))];
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
getQueriesSchema() {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
return [];
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
getBodySchema() {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
return null;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
getOutputSchema() {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
return null;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
getState() {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
return {
|
|
49
|
+
check_auth: true,
|
|
50
|
+
auth_optional: false
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
handle() {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
let session = yield this.props.getSession();
|
|
57
|
+
let id = new namirasoft_core_1.ObjectService(this.req.params.id).getString();
|
|
58
|
+
yield this.tables.entity_category.delete(session, id, null);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.Delete = Delete;
|
|
63
|
+
//# sourceMappingURL=Delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Delete.js","sourceRoot":"","sources":["../../../src/controller/entity_category/Delete.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA4D;AAC5D,4EAAyE;AACzE,yDAAqE;AAErE,MAAa,MAAO,SAAQ,qDAA+B;IAEjD,OAAO;QAEf,OAAO;YACN,IAAI,EAAE,QAAQ;YACd,GAAG,EAAE,UAAU;YACf,MAAM,EAAE,4BAAU,CAAC,MAAM;YACzB,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE,4BAA4B;SACrC,CAAA;IACF,CAAC;IACc,mBAAmB;;YAEjC,OAAO,CAAC,IAAI,sCAAkB,CAAC,IAAI,EAAE,IAAI,gCAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC/D,CAAC;KAAA;IACc,gBAAgB;;YAE9B,OAAO,EAAE,CAAC;QACX,CAAC;KAAA;IACc,aAAa;;YAE3B,OAAO,IAAI,CAAC;QACb,CAAC;KAAA;IACc,eAAe;;YAE7B,OAAO,IAAI,CAAC;QACb,CAAC;KAAA;IACc,QAAQ;;YAEtB,OAAO;gBACN,UAAU,EAAE,IAAI;gBAChB,aAAa,EAAE,KAAK;aACpB,CAAC;QACH,CAAC;KAAA;IACc,MAAM;;YAEpB,IAAI,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;YAE5C,IAAI,EAAE,GAAG,IAAI,+BAAa,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC;YAE3D,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QAC7D,CAAC;KAAA;CACD;AA3CD,wBA2CC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { HTTPMethod } from "namirasoft-core";
|
|
2
|
+
import { BaseEntityFieldController } from "../BaseEntityFieldController";
|
|
3
|
+
import { EntityCategoryModel } from "../../database/model/EntityCategoryModel";
|
|
4
|
+
import { BaseVariableSchema } from "namirasoft-schema";
|
|
5
|
+
export declare class Get extends BaseEntityFieldController<EntityCategoryModel> {
|
|
6
|
+
getInfo(): {
|
|
7
|
+
name: string;
|
|
8
|
+
tag: string;
|
|
9
|
+
method: HTTPMethod;
|
|
10
|
+
path: string;
|
|
11
|
+
summary: string;
|
|
12
|
+
};
|
|
13
|
+
getParametersSchema(): Promise<BaseVariableSchema[]>;
|
|
14
|
+
getQueriesSchema(): Promise<never[]>;
|
|
15
|
+
getBodySchema(): Promise<null>;
|
|
16
|
+
getOutputSchema(): Promise<import("namirasoft-schema").ObjectSchema>;
|
|
17
|
+
getState(): Promise<{
|
|
18
|
+
check_auth: boolean;
|
|
19
|
+
auth_optional: boolean;
|
|
20
|
+
}>;
|
|
21
|
+
handle(): Promise<any>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Get = void 0;
|
|
13
|
+
const namirasoft_core_1 = require("namirasoft-core");
|
|
14
|
+
const BaseEntityFieldController_1 = require("../BaseEntityFieldController");
|
|
15
|
+
const namirasoft_schema_1 = require("namirasoft-schema");
|
|
16
|
+
class Get extends BaseEntityFieldController_1.BaseEntityFieldController {
|
|
17
|
+
getInfo() {
|
|
18
|
+
return {
|
|
19
|
+
name: "Get",
|
|
20
|
+
tag: "Category",
|
|
21
|
+
method: namirasoft_core_1.HTTPMethod.GET,
|
|
22
|
+
path: "/category/{id}",
|
|
23
|
+
summary: "Returns an category by id."
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
getParametersSchema() {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
return [new namirasoft_schema_1.BaseVariableSchema("id", new namirasoft_schema_1.StringSchema(true))];
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
getQueriesSchema() {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
return [];
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
getBodySchema() {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
return null;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
getOutputSchema() {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
return this.tables.entity_category.getSchemaByName(true);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
getState() {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
return {
|
|
49
|
+
check_auth: true,
|
|
50
|
+
auth_optional: false
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
handle() {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
let session = yield this.props.getSession();
|
|
57
|
+
let user_id = session.user_id;
|
|
58
|
+
let id = new namirasoft_core_1.ObjectService(this.req.params.id).getString();
|
|
59
|
+
let ans = yield this.tables.entity_category.get(user_id, id, null);
|
|
60
|
+
return yield this.tables.entity_category.secure(ans);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.Get = Get;
|
|
65
|
+
//# sourceMappingURL=Get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Get.js","sourceRoot":"","sources":["../../../src/controller/entity_category/Get.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA4D;AAC5D,4EAAyE;AAEzE,yDAAqE;AAErE,MAAa,GAAI,SAAQ,qDAA8C;IAE7D,OAAO;QAEf,OAAO;YACN,IAAI,EAAE,KAAK;YACX,GAAG,EAAE,UAAU;YACf,MAAM,EAAE,4BAAU,CAAC,GAAG;YACtB,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE,4BAA4B;SACrC,CAAA;IACF,CAAC;IACc,mBAAmB;;YAEjC,OAAO,CAAC,IAAI,sCAAkB,CAAC,IAAI,EAAE,IAAI,gCAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC/D,CAAC;KAAA;IACc,gBAAgB;;YAE9B,OAAO,EAAE,CAAC;QACX,CAAC;KAAA;IACc,aAAa;;YAE3B,OAAO,IAAI,CAAC;QACb,CAAC;KAAA;IACc,eAAe;;YAE7B,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAC1D,CAAC;KAAA;IACc,QAAQ;;YAEtB,OAAO;gBACN,UAAU,EAAE,IAAI;gBAChB,aAAa,EAAE,KAAK;aACpB,CAAC;QACH,CAAC;KAAA;IACc,MAAM;;YAEpB,IAAI,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;YAC5C,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;YAE9B,IAAI,EAAE,GAAG,IAAI,+BAAa,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC;YAE3D,IAAI,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YACnE,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACtD,CAAC;KAAA;CACD;AA7CD,kBA6CC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { HTTPMethod } from "namirasoft-core";
|
|
2
|
+
import { BaseEntityFieldController } from "../BaseEntityFieldController";
|
|
3
|
+
import { EntityCategoryModel } from "../../database/model/EntityCategoryModel";
|
|
4
|
+
export declare class List extends BaseEntityFieldController<{
|
|
5
|
+
rows: EntityCategoryModel[];
|
|
6
|
+
count: number;
|
|
7
|
+
}> {
|
|
8
|
+
getInfo(): {
|
|
9
|
+
name: string;
|
|
10
|
+
tag: string;
|
|
11
|
+
method: HTTPMethod;
|
|
12
|
+
path: string;
|
|
13
|
+
summary: string;
|
|
14
|
+
};
|
|
15
|
+
getParametersSchema(): Promise<never[]>;
|
|
16
|
+
getQueriesSchema(): Promise<import("namirasoft-schema").BaseVariableSchema[]>;
|
|
17
|
+
getBodySchema(): Promise<null>;
|
|
18
|
+
getOutputSchema(): Promise<import("namirasoft-schema").ObjectSchema>;
|
|
19
|
+
getState(): Promise<{
|
|
20
|
+
check_auth: boolean;
|
|
21
|
+
auth_optional: boolean;
|
|
22
|
+
}>;
|
|
23
|
+
handle(): Promise<{
|
|
24
|
+
rows: EntityCategoryModel[];
|
|
25
|
+
count: number;
|
|
26
|
+
}>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.List = void 0;
|
|
13
|
+
const namirasoft_core_1 = require("namirasoft-core");
|
|
14
|
+
const BaseEntityFieldController_1 = require("../BaseEntityFieldController");
|
|
15
|
+
const namirasoft_site_node_1 = require("namirasoft-site-node");
|
|
16
|
+
class List extends BaseEntityFieldController_1.BaseEntityFieldController {
|
|
17
|
+
getInfo() {
|
|
18
|
+
return {
|
|
19
|
+
name: "List",
|
|
20
|
+
tag: "Category",
|
|
21
|
+
method: namirasoft_core_1.HTTPMethod.GET,
|
|
22
|
+
path: "/category/list",
|
|
23
|
+
summary: "Returns all categories."
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
getParametersSchema() {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
return [];
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
getQueriesSchema() {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
return namirasoft_site_node_1.NSControllerList.getQueriesSchema();
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
getBodySchema() {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
return null;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
getOutputSchema() {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
return namirasoft_site_node_1.NSControllerList.getOutputSchema(this.tables.entity_category.getArraySchemaByName(true));
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
getState() {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
return {
|
|
49
|
+
check_auth: true,
|
|
50
|
+
auth_optional: false
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
handle() {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
let session = yield this.props.getSession();
|
|
57
|
+
let user_id = session.user_id;
|
|
58
|
+
let { filters, page, size } = namirasoft_site_node_1.NSControllerList.handle_GetQueries(this.req);
|
|
59
|
+
return yield this.tables.entity_category.list({ user_id }, filters, page, size, {}, null);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.List = List;
|
|
64
|
+
//# sourceMappingURL=List.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"List.js","sourceRoot":"","sources":["../../../src/controller/entity_category/List.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA6C;AAC7C,4EAAyE;AAEzE,+DAAwD;AAExD,MAAa,IAAK,SAAQ,qDAAyE;IAEzF,OAAO;QAEf,OAAO;YACN,IAAI,EAAE,MAAM;YACZ,GAAG,EAAE,UAAU;YACf,MAAM,EAAE,4BAAU,CAAC,GAAG;YACtB,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE,yBAAyB;SAClC,CAAA;IACF,CAAC;IACc,mBAAmB;;YAEjC,OAAO,EAAE,CAAC;QACX,CAAC;KAAA;IACc,gBAAgB;;YAE9B,OAAO,uCAAgB,CAAC,gBAAgB,EAAE,CAAC;QAC5C,CAAC;KAAA;IACc,aAAa;;YAE3B,OAAO,IAAI,CAAC;QACb,CAAC;KAAA;IACc,eAAe;;YAE7B,OAAO,uCAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC;QACjG,CAAC;KAAA;IACc,QAAQ;;YAEtB,OAAO;gBACN,UAAU,EAAE,IAAI;gBAChB,aAAa,EAAE,KAAK;aACpB,CAAC;QACH,CAAC;KAAA;IACc,MAAM;;YAEpB,IAAI,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;YAC5C,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;YAE9B,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,uCAAgB,CAAC,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAE3E,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QAC3F,CAAC;KAAA;CACD;AA5CD,oBA4CC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HTTPMethod } from "namirasoft-core";
|
|
2
|
+
import { BaseEntityFieldController } from "../BaseEntityFieldController";
|
|
3
|
+
import { BaseVariableSchema } from "namirasoft-schema";
|
|
4
|
+
export declare class Update extends BaseEntityFieldController<string> {
|
|
5
|
+
getInfo(): {
|
|
6
|
+
name: string;
|
|
7
|
+
tag: string;
|
|
8
|
+
method: HTTPMethod;
|
|
9
|
+
path: string;
|
|
10
|
+
summary: string;
|
|
11
|
+
};
|
|
12
|
+
getParametersSchema(): Promise<BaseVariableSchema[]>;
|
|
13
|
+
getQueriesSchema(): Promise<never[]>;
|
|
14
|
+
getBodySchema(): Promise<import("namirasoft-schema").ObjectSchema>;
|
|
15
|
+
getOutputSchema(): Promise<import("namirasoft-schema").ObjectSchema>;
|
|
16
|
+
getState(): Promise<{
|
|
17
|
+
check_auth: boolean;
|
|
18
|
+
auth_optional: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
handle(): Promise<any>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Update = void 0;
|
|
13
|
+
const namirasoft_core_1 = require("namirasoft-core");
|
|
14
|
+
const BaseEntityFieldController_1 = require("../BaseEntityFieldController");
|
|
15
|
+
const namirasoft_schema_1 = require("namirasoft-schema");
|
|
16
|
+
const EntityCategoryNames_1 = require("../../enum/EntityCategoryNames");
|
|
17
|
+
class Update extends BaseEntityFieldController_1.BaseEntityFieldController {
|
|
18
|
+
getInfo() {
|
|
19
|
+
return {
|
|
20
|
+
name: "Update",
|
|
21
|
+
tag: "Category",
|
|
22
|
+
method: namirasoft_core_1.HTTPMethod.PUT,
|
|
23
|
+
path: "/category/{id}",
|
|
24
|
+
summary: "Updates a category"
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
getParametersSchema() {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
return [new namirasoft_schema_1.BaseVariableSchema("id", new namirasoft_schema_1.StringSchema(true))];
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
getQueriesSchema() {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
return [];
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
getBodySchema() {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
return this.tables.entity_category.getSchemaByName(true, EntityCategoryNames_1.EntityCategoryNames.EntityCategoryInput);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
getOutputSchema() {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
return this.tables.entity_category.getSchemaByName(true);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
getState() {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
return {
|
|
50
|
+
check_auth: true,
|
|
51
|
+
auth_optional: false
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
handle() {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
let session = yield this.props.getSession();
|
|
58
|
+
let id = new namirasoft_core_1.ObjectService(this.req.params.id).getString();
|
|
59
|
+
let categoryy_id = new namirasoft_core_1.ObjectService(this.req.body.categoryy_id).getString();
|
|
60
|
+
let ans = yield this.tables.entity_category.update(session, id, categoryy_id, null);
|
|
61
|
+
return yield this.tables.entity_category.secure(ans);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.Update = Update;
|
|
66
|
+
//# sourceMappingURL=Update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Update.js","sourceRoot":"","sources":["../../../src/controller/entity_category/Update.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA4D;AAC5D,4EAAyE;AACzE,yDAAqE;AACrE,wEAAqE;AACrE,MAAa,MAAO,SAAQ,qDAAiC;IAEnD,OAAO;QAEf,OAAO;YACN,IAAI,EAAE,QAAQ;YACd,GAAG,EAAE,UAAU;YACf,MAAM,EAAE,4BAAU,CAAC,GAAG;YACtB,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE,oBAAoB;SAC7B,CAAA;IACF,CAAC;IACc,mBAAmB;;YAEjC,OAAO,CAAC,IAAI,sCAAkB,CAAC,IAAI,EAAE,IAAI,gCAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC/D,CAAC;KAAA;IACc,gBAAgB;;YAE9B,OAAO,EAAE,CAAC;QACX,CAAC;KAAA;IACc,aAAa;;YAE3B,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,eAAe,CAAC,IAAI,EAAE,yCAAmB,CAAC,mBAAmB,CAAC,CAAC;QACnG,CAAC;KAAA;IACc,eAAe;;YAE7B,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAC1D,CAAC;KAAA;IACc,QAAQ;;YAEtB,OAAO;gBACN,UAAU,EAAE,IAAI;gBAChB,aAAa,EAAE,KAAK;aACpB,CAAC;QACH,CAAC;KAAA;IACc,MAAM;;YAEpB,IAAI,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;YAE5C,IAAI,EAAE,GAAG,IAAI,+BAAa,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC;YAE3D,IAAI,YAAY,GAAG,IAAI,+BAAa,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,SAAS,EAAE,CAAC;YAE7E,IAAI,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,EAC7D,YAAY,EACZ,IAAI,CAAC,CAAC;YACP,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACtD,CAAC;KAAA;CACD;AAhDD,wBAgDC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HTTPMethod } from "namirasoft-core";
|
|
2
|
+
import { BaseEntityFieldController } from "../BaseEntityFieldController";
|
|
3
|
+
import { EntityFieldModel } from "../../database/model/EntityFieldModel";
|
|
4
|
+
export declare class Create extends BaseEntityFieldController<EntityFieldModel> {
|
|
5
|
+
getInfo(): {
|
|
6
|
+
name: string;
|
|
7
|
+
tag: string;
|
|
8
|
+
method: HTTPMethod;
|
|
9
|
+
path: string;
|
|
10
|
+
summary: string;
|
|
11
|
+
};
|
|
12
|
+
getParametersSchema(): Promise<never[]>;
|
|
13
|
+
getQueriesSchema(): Promise<never[]>;
|
|
14
|
+
getBodySchema(): Promise<import("namirasoft-schema").ObjectSchema>;
|
|
15
|
+
getOutputSchema(): Promise<import("namirasoft-schema").ObjectSchema>;
|
|
16
|
+
getState(): Promise<{
|
|
17
|
+
check_auth: boolean;
|
|
18
|
+
auth_optional: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
handle(): Promise<any>;
|
|
21
|
+
}
|