aws-service-stack 0.17.268 → 0.17.270
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/_examples/controller/branch/branch-config.d.ts +6 -0
- package/dist/_examples/controller/branch/branch-config.js +47 -0
- package/dist/_examples/controller/branch/branch-config.js.map +1 -0
- package/dist/_examples/controller/branch/branch-controller.d.ts +16 -0
- package/dist/_examples/controller/branch/branch-controller.js +77 -0
- package/dist/_examples/controller/branch/branch-controller.js.map +1 -0
- package/dist/_examples/controller/branch/branch-crud.d.ts +4 -0
- package/dist/_examples/controller/branch/branch-crud.js +57 -0
- package/dist/_examples/controller/branch/branch-crud.js.map +1 -0
- package/dist/_examples/controller/commission/commission-controller.d.ts +9 -0
- package/dist/_examples/controller/commission/commission-controller.js +66 -0
- package/dist/_examples/controller/commission/commission-controller.js.map +1 -0
- package/dist/_examples/controller/commission/commission-crud.d.ts +4 -0
- package/dist/_examples/controller/commission/commission-crud.js +57 -0
- package/dist/_examples/controller/commission/commission-crud.js.map +1 -0
- package/dist/_examples/controller/commission/commission.config.d.ts +6 -0
- package/dist/_examples/controller/commission/commission.config.js +41 -0
- package/dist/_examples/controller/commission/commission.config.js.map +1 -0
- package/dist/_examples/controller/raccount/raccount-config.d.ts +6 -0
- package/dist/_examples/controller/raccount/raccount-config.js +60 -0
- package/dist/_examples/controller/raccount/raccount-config.js.map +1 -0
- package/dist/_examples/controller/raccount/raccount-controller.d.ts +14 -0
- package/dist/_examples/controller/raccount/raccount-controller.js +73 -0
- package/dist/_examples/controller/raccount/raccount-controller.js.map +1 -0
- package/dist/_examples/controller/raccount/raccount-crud.d.ts +4 -0
- package/dist/_examples/controller/raccount/raccount-crud.js +57 -0
- package/dist/_examples/controller/raccount/raccount-crud.js.map +1 -0
- package/dist/_examples/controller/rorder/order-config.js +3 -5
- package/dist/_examples/controller/rorder/order-config.js.map +1 -1
- package/dist/_examples/controller/supplier/supplier-config.js +8 -8
- package/dist/_examples/controller/supplier/supplier-config.js.map +1 -1
- package/dist/_examples/controller/supplier/supplier-controller-api.d.ts +1 -1
- package/dist/_examples/controller/supplier/supplier-controller-api.js.map +1 -1
- package/dist/_examples/model-shared/address.model.d.ts +18 -0
- package/dist/_examples/model-shared/address.model.js +3 -0
- package/dist/_examples/model-shared/address.model.js.map +1 -0
- package/dist/_examples/model-shared/branch.model.d.ts +72 -0
- package/dist/_examples/model-shared/branch.model.js +64 -0
- package/dist/_examples/model-shared/branch.model.js.map +1 -0
- package/dist/_examples/model-shared/commission.model.d.ts +30 -0
- package/dist/_examples/model-shared/commission.model.js +38 -0
- package/dist/_examples/model-shared/commission.model.js.map +1 -0
- package/dist/_examples/model-shared/raccount.model.d.ts +134 -0
- package/dist/_examples/model-shared/raccount.model.js +187 -0
- package/dist/_examples/model-shared/raccount.model.js.map +1 -0
- package/dist/_examples/model-shared/{suppler.model.js → suppler.model-to-remove.js} +1 -1
- package/dist/_examples/model-shared/suppler.model-to-remove.js.map +1 -0
- package/dist/_examples/model-shared/supplier-portal.model.d.ts +4 -0
- package/dist/_examples/model-shared/supplier-portal.model.js.map +1 -1
- package/dist/_examples/model-shared/supplier.model.d.ts +77 -0
- package/dist/_examples/model-shared/supplier.model.js +124 -0
- package/dist/_examples/model-shared/supplier.model.js.map +1 -0
- package/dist/_examples/repositories/branch/branch-db.repo.d.ts +6 -0
- package/dist/_examples/repositories/branch/branch-db.repo.interface.d.ts +4 -0
- package/dist/_examples/repositories/branch/branch-db.repo.interface.js +3 -0
- package/dist/_examples/repositories/branch/branch-db.repo.interface.js.map +1 -0
- package/dist/_examples/repositories/branch/branch-db.repo.js +19 -0
- package/dist/_examples/repositories/branch/branch-db.repo.js.map +1 -0
- package/dist/_examples/repositories/commission/commission-repo-db.d.ts +5 -0
- package/dist/_examples/repositories/commission/commission-repo-db.interface.d.ts +4 -0
- package/dist/_examples/repositories/commission/commission-repo-db.interface.js +3 -0
- package/dist/_examples/repositories/commission/commission-repo-db.interface.js.map +1 -0
- package/dist/_examples/repositories/commission/commission-repo-db.js +18 -0
- package/dist/_examples/repositories/commission/commission-repo-db.js.map +1 -0
- package/dist/_examples/repositories/raccount/raccount-db.repo.d.ts +5 -0
- package/dist/_examples/repositories/raccount/raccount-db.repo.interface.d.ts +4 -0
- package/dist/_examples/repositories/raccount/raccount-db.repo.interface.js +3 -0
- package/dist/_examples/repositories/raccount/raccount-db.repo.interface.js.map +1 -0
- package/dist/_examples/repositories/raccount/raccount-db.repo.js +18 -0
- package/dist/_examples/repositories/raccount/raccount-db.repo.js.map +1 -0
- package/dist/_examples/repositories/raccount/raccount-es.repo.d.ts +6 -0
- package/dist/_examples/repositories/raccount/raccount-es.repo.interface.d.ts +4 -0
- package/dist/_examples/repositories/raccount/raccount-es.repo.interface.js +3 -0
- package/dist/_examples/repositories/raccount/raccount-es.repo.interface.js.map +1 -0
- package/dist/_examples/repositories/raccount/raccount-es.repo.js +19 -0
- package/dist/_examples/repositories/raccount/raccount-es.repo.js.map +1 -0
- package/dist/_examples/repositories/supplier/supplier-repo-db.d.ts +1 -1
- package/dist/_examples/repositories/supplier/supplier-repo-db.interface.d.ts +1 -1
- package/dist/_examples/repositories/supplier/supplier-repo-db.interface.js.map +1 -1
- package/dist/_examples/repositories/supplier/supplier-repo-db.js.map +1 -1
- package/dist/_examples/repositories/supplier/supplier-repo-es.d.ts +1 -1
- package/dist/_examples/repositories/supplier/supplier-repo-es.interface.d.ts +1 -1
- package/dist/_examples/repositories/supplier/supplier-repo-es.interface.js.map +1 -1
- package/dist/_examples/repositories/supplier/supplier-repo-es.js.map +1 -1
- package/dist/_examples/service/branch/branch-service.d.ts +13 -0
- package/dist/_examples/service/branch/branch-service.interface.d.ts +4 -0
- package/dist/_examples/service/branch/branch-service.interface.js +3 -0
- package/dist/_examples/service/branch/branch-service.interface.js.map +1 -0
- package/dist/_examples/service/branch/branch-service.js +70 -0
- package/dist/_examples/service/branch/branch-service.js.map +1 -0
- package/dist/_examples/service/commission/commission-service.d.ts +15 -0
- package/dist/_examples/service/commission/commission-service.interface.d.ts +6 -0
- package/dist/_examples/service/commission/commission-service.interface.js +3 -0
- package/dist/_examples/service/commission/commission-service.interface.js.map +1 -0
- package/dist/_examples/service/commission/commission-service.js +114 -0
- package/dist/_examples/service/commission/commission-service.js.map +1 -0
- package/dist/_examples/service/raccount/raccount-service.d.ts +10 -0
- package/dist/_examples/service/raccount/raccount-service.interface.d.ts +4 -0
- package/dist/_examples/service/raccount/raccount-service.interface.js +3 -0
- package/dist/_examples/service/raccount/raccount-service.interface.js.map +1 -0
- package/dist/_examples/service/raccount/raccount-service.js +64 -0
- package/dist/_examples/service/raccount/raccount-service.js.map +1 -0
- package/dist/_examples/service/supplier/supplier-service-crud.d.ts +1 -1
- package/dist/_examples/service/supplier/supplier-service-crud.interface.d.ts +1 -1
- package/dist/_examples/service/supplier/supplier-service-crud.interface.js.map +1 -1
- package/dist/_examples/service/supplier/supplier-service-crud.js.map +1 -1
- package/dist/_examples/service/supplier/supplier-service-stream.d.ts +1 -1
- package/dist/_examples/service/supplier/supplier-service-stream.interface.d.ts +1 -1
- package/dist/_examples/service/supplier/supplier-service-stream.interface.js.map +1 -1
- package/dist/_examples/service/supplier/supplier-service-stream.js.map +1 -1
- package/dist/controller/controller-api.js +3 -3
- package/dist/controller/controller-api.js.map +1 -1
- package/dist/exception/exception-handler.js +4 -0
- package/dist/exception/exception-handler.js.map +1 -1
- package/dist/model/base.config.d.ts +4 -4
- package/dist/model/base.config.js +8 -6
- package/dist/model/base.config.js.map +1 -1
- package/dist/model/dynamodb.model.d.ts +2 -4
- package/dist/model/dynamodb.model.js +1 -3
- package/dist/model/dynamodb.model.js.map +1 -1
- package/dist/repositories/base-db.repo.d.ts +8 -7
- package/dist/repositories/base-db.repo.js +53 -31
- package/dist/repositories/base-db.repo.js.map +1 -1
- package/dist/service/crud.service.js +15 -8
- package/dist/service/crud.service.js.map +1 -1
- package/dist/utils/http/http.util.js +12 -2
- package/dist/utils/http/http.util.js.map +1 -1
- package/package.json +1 -1
- package/dist/_examples/model-shared/suppler.model.js.map +0 -1
- /package/dist/_examples/model-shared/{suppler.model.d.ts → suppler.model-to-remove.d.ts} +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONFIG_BRANCH = exports.BranchConfig = exports.path = void 0;
|
|
4
|
+
const core_1 = require("../../../index.js");
|
|
5
|
+
const branch_model_1 = require("src/_examples/model-shared/branch.model");
|
|
6
|
+
exports.path = "retailer/branches"; // url path base
|
|
7
|
+
// Branch configuration
|
|
8
|
+
class BranchConfig extends core_1.EntityConfigImpl {
|
|
9
|
+
constructor() {
|
|
10
|
+
// DYNAMODB
|
|
11
|
+
const tableName = "retailer-branch_DEV";
|
|
12
|
+
const indexMap = new core_1.DynamoIndexMap().set("byAccount", {
|
|
13
|
+
field: "accountId",
|
|
14
|
+
rFields: ["accountId"],
|
|
15
|
+
});
|
|
16
|
+
// PERMISSIONS
|
|
17
|
+
const ownerFieldName = "email";
|
|
18
|
+
const adminGroupName = ["adminUsers"];
|
|
19
|
+
const policies = [
|
|
20
|
+
{
|
|
21
|
+
method: core_1.HttpMethod.GET,
|
|
22
|
+
path: `/${exports.path}`,
|
|
23
|
+
access: [core_1.Access.PUBLIC, core_1.Access.USER, core_1.Access.OWNER, core_1.Access.ADMIN],
|
|
24
|
+
response: branch_model_1.RESPONSE_FIELDS_LIST_BRANCH,
|
|
25
|
+
},
|
|
26
|
+
{ method: core_1.HttpMethod.GET, path: `/${exports.path}/{id}`, access: [core_1.Access.OWNER, core_1.Access.ADMIN], response: branch_model_1.RESPONSE_FIELDS_DETAILS_BRANCH },
|
|
27
|
+
{ method: core_1.HttpMethod.POST, path: `/${exports.path}`, access: [core_1.Access.USER, core_1.Access.ADMIN], validator: branch_model_1.CREATE_BRANCH },
|
|
28
|
+
{
|
|
29
|
+
method: core_1.HttpMethod.PUT,
|
|
30
|
+
path: `/${exports.path}/{id}`,
|
|
31
|
+
access: [core_1.Access.ADMIN],
|
|
32
|
+
validator: branch_model_1.REPLACE_BRANCH,
|
|
33
|
+
response: branch_model_1.RESPONSE_FIELDS_DETAILS_BRANCH,
|
|
34
|
+
},
|
|
35
|
+
{ method: core_1.HttpMethod.PATCH, path: `/${exports.path}/{id}`, access: [core_1.Access.USER, core_1.Access.ADMIN], validator: branch_model_1.UPDATE_BRANCH },
|
|
36
|
+
{ method: core_1.HttpMethod.DELETE, path: `/${exports.path}/{id}`, access: [core_1.Access.USER, core_1.Access.ADMIN] },
|
|
37
|
+
];
|
|
38
|
+
// INIT
|
|
39
|
+
super(exports.path, adminGroupName);
|
|
40
|
+
this.setDynamoDB(tableName, ownerFieldName, indexMap).setPolicies(policies);
|
|
41
|
+
this.OWNER_ID_FIELD_NAME = "username";
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.BranchConfig = BranchConfig;
|
|
45
|
+
// Export default Branch configuration
|
|
46
|
+
exports.CONFIG_BRANCH = new BranchConfig();
|
|
47
|
+
//# sourceMappingURL=branch-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-config.js","sourceRoot":"","sources":["../../../../src/_examples/controller/branch/branch-config.ts"],"names":[],"mappings":";;;AAAA,yCAAgH;AAChH,0EAMiD;AAEpC,QAAA,IAAI,GAAG,mBAAmB,CAAC,CAAC,gBAAgB;AAEzD,uBAAuB;AACvB,MAAa,YAAa,SAAQ,uBAAgB;IAChD;QACE,WAAW;QACX,MAAM,SAAS,GAAG,qBAAqB,CAAC;QACxC,MAAM,QAAQ,GAAG,IAAI,qBAAc,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE;YACrD,KAAK,EAAE,WAAW;YAClB,OAAO,EAAE,CAAC,WAAW,CAAC;SACvB,CAAC,CAAC;QAEH,cAAc;QACd,MAAM,cAAc,GAAG,OAAO,CAAC;QAC/B,MAAM,cAAc,GAAG,CAAC,YAAY,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAqB;YACjC;gBACE,MAAM,EAAE,iBAAC,CAAC,GAAG;gBACb,IAAI,EAAE,IAAI,YAAI,EAAE;gBAChB,MAAM,EAAE,CAAC,aAAC,CAAC,MAAM,EAAE,aAAC,CAAC,IAAI,EAAE,aAAC,CAAC,KAAK,EAAE,aAAC,CAAC,KAAK,CAAC;gBAC5C,QAAQ,EAAE,0CAAQ;aACnB;YACD,EAAE,MAAM,EAAE,iBAAC,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,YAAI,OAAO,EAAE,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,EAAE,aAAC,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,6CAAQ,EAAE;YACxF,EAAE,MAAM,EAAE,iBAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,YAAI,EAAE,EAAE,MAAM,EAAE,CAAC,aAAC,CAAC,IAAI,EAAE,aAAC,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,4BAAM,EAAE;YAClF;gBACE,MAAM,EAAE,iBAAC,CAAC,GAAG;gBACb,IAAI,EAAE,IAAI,YAAI,OAAO;gBACrB,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,CAAC;gBACjB,SAAS,EAAE,6BAAO;gBAClB,QAAQ,EAAE,6CAAQ;aACnB;YACD,EAAE,MAAM,EAAE,iBAAC,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,YAAI,OAAO,EAAE,MAAM,EAAE,CAAC,aAAC,CAAC,IAAI,EAAE,aAAC,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,4BAAM,EAAE;YACxF,EAAE,MAAM,EAAE,iBAAC,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,YAAI,OAAO,EAAE,MAAM,EAAE,CAAC,aAAC,CAAC,IAAI,EAAE,aAAC,CAAC,KAAK,CAAC,EAAE;SACvE,CAAC;QAEF,OAAO;QACP,KAAK,CAAC,YAAI,EAAE,cAAc,CAAC,CAAC;QAC5B,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC5E,IAAI,CAAC,mBAAmB,GAAG,UAAU,CAAC;IACxC,CAAC;CACF;AArCD,oCAqCC;AAED,sCAAsC;AACzB,QAAA,aAAa,GAAG,IAAI,YAAY,EAAE,CAAC","sourcesContent":["import { Access as a, DynamoIndexMap, EndpointPolicy, EntityConfigImpl, HttpMethod as m } from \"@chinggis/core\";\nimport {\n CREATE_BRANCH as CREATE,\n UPDATE_BRANCH as UPDATE,\n RESPONSE_FIELDS_DETAILS_BRANCH as FIELDS_D,\n RESPONSE_FIELDS_LIST_BRANCH as FIELDS_L,\n REPLACE_BRANCH as REPLACE,\n} from \"src/_examples/model-shared/branch.model\";\n\nexport const path = \"retailer/branches\"; // url path base\n\n// Branch configuration\nexport class BranchConfig extends EntityConfigImpl {\n constructor() {\n // DYNAMODB\n const tableName = \"retailer-branch_DEV\";\n const indexMap = new DynamoIndexMap().set(\"byAccount\", {\n field: \"accountId\",\n rFields: [\"accountId\"],\n });\n\n // PERMISSIONS\n const ownerFieldName = \"email\";\n const adminGroupName = [\"adminUsers\"];\n const policies: EndpointPolicy[] = [\n {\n method: m.GET,\n path: `/${path}`,\n access: [a.PUBLIC, a.USER, a.OWNER, a.ADMIN],\n response: FIELDS_L,\n },\n { method: m.GET, path: `/${path}/{id}`, access: [a.OWNER, a.ADMIN], response: FIELDS_D },\n { method: m.POST, path: `/${path}`, access: [a.USER, a.ADMIN], validator: CREATE },\n {\n method: m.PUT,\n path: `/${path}/{id}`,\n access: [a.ADMIN],\n validator: REPLACE,\n response: FIELDS_D,\n },\n { method: m.PATCH, path: `/${path}/{id}`, access: [a.USER, a.ADMIN], validator: UPDATE },\n { method: m.DELETE, path: `/${path}/{id}`, access: [a.USER, a.ADMIN] },\n ];\n\n // INIT\n super(path, adminGroupName);\n this.setDynamoDB(tableName, ownerFieldName, indexMap).setPolicies(policies);\n this.OWNER_ID_FIELD_NAME = \"username\";\n }\n}\n\n// Export default Branch configuration\nexport const CONFIG_BRANCH = new BranchConfig();\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { APIGatewayProxyWebsocketEventV2, DynamoDBStreamEvent, ScheduledEvent, SQSEvent } from "aws-lambda";
|
|
2
|
+
import { ControllerApi } from "src/controller";
|
|
3
|
+
import { HttpRequest } from "src/utils";
|
|
4
|
+
import { RBranch } from "src/_examples/model-shared/branch.model";
|
|
5
|
+
import "src/_examples/service/raccount/raccount-service";
|
|
6
|
+
import { RBranchService } from "src/_examples/service/branch/branch-service.interface";
|
|
7
|
+
import "src/_examples/service/branch/branch-service";
|
|
8
|
+
export declare class RBranchController extends ControllerApi<RBranch, RBranchService> {
|
|
9
|
+
private readonly rAccountService;
|
|
10
|
+
constructor();
|
|
11
|
+
protected processCrudRequest(event: HttpRequest): Promise<any>;
|
|
12
|
+
protected processSQSEvent(sqsEvent: SQSEvent): Promise<any>;
|
|
13
|
+
protected processStreamEvent(event: DynamoDBStreamEvent): Promise<void>;
|
|
14
|
+
protected processScheduledEvent(event: ScheduledEvent): Promise<void>;
|
|
15
|
+
protected processWebSocketEvent(event: APIGatewayProxyWebsocketEventV2): Promise<void>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
42
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.RBranchController = void 0;
|
|
46
|
+
const controller_1 = require("src/controller");
|
|
47
|
+
const typedi_1 = __importStar(require("typedi"));
|
|
48
|
+
const branch_config_1 = require("./branch-config");
|
|
49
|
+
require("src/_examples/service/raccount/raccount-service");
|
|
50
|
+
require("src/_examples/service/branch/branch-service");
|
|
51
|
+
let RBranchController = class RBranchController extends controller_1.ControllerApi {
|
|
52
|
+
rAccountService = typedi_1.default.get("RAccountService");
|
|
53
|
+
constructor() {
|
|
54
|
+
super(typedi_1.default.get("RBranchService"), branch_config_1.CONFIG_BRANCH.toObject());
|
|
55
|
+
}
|
|
56
|
+
processCrudRequest(event) {
|
|
57
|
+
throw new Error("Method not implemented.");
|
|
58
|
+
}
|
|
59
|
+
processSQSEvent(sqsEvent) {
|
|
60
|
+
throw new Error("Method not implemented.");
|
|
61
|
+
}
|
|
62
|
+
async processStreamEvent(event) {
|
|
63
|
+
throw new Error("Method not implemented.");
|
|
64
|
+
}
|
|
65
|
+
async processScheduledEvent(event) {
|
|
66
|
+
throw new Error("Method not implemented.");
|
|
67
|
+
}
|
|
68
|
+
async processWebSocketEvent(event) {
|
|
69
|
+
throw new Error("Method not implemented.");
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
exports.RBranchController = RBranchController;
|
|
73
|
+
exports.RBranchController = RBranchController = __decorate([
|
|
74
|
+
(0, typedi_1.Service)("RBranchController"),
|
|
75
|
+
__metadata("design:paramtypes", [])
|
|
76
|
+
], RBranchController);
|
|
77
|
+
//# sourceMappingURL=branch-controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-controller.js","sourceRoot":"","sources":["../../../../src/_examples/controller/branch/branch-controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAA+C;AAE/C,iDAA4C;AAC5C,mDAAgD;AAQhD,2DAAyD;AAGzD,uDAAqD;AAG9C,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,0BAAsC;IAC1D,eAAe,GAAoB,gBAAS,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAErF;QACE,KAAK,CAAC,gBAAS,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE,6BAAa,CAAC,QAAQ,EAAE,CAAC,CAAC;IACnE,CAAC;IAES,kBAAkB,CAAC,KAAkB;QAC7C,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAES,eAAe,CAAC,QAAkB;QAC1C,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAES,KAAK,CAAC,kBAAkB,CAAC,KAA0B;QAC3D,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAES,KAAK,CAAC,qBAAqB,CAAC,KAAqB;QACzD,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAES,KAAK,CAAC,qBAAqB,CAAC,KAAsC;QAC1E,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;CACF,CAAA;AA1BY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,gBAAO,EAAC,mBAAmB,CAAC;;GAChB,iBAAiB,CA0B7B","sourcesContent":["import { APIGatewayProxyWebsocketEventV2, DynamoDBStreamEvent, ScheduledEvent, SQSEvent } from \"aws-lambda\";\nimport { ControllerApi } from \"src/controller\";\nimport { HttpRequest } from \"src/utils\";\nimport Container, { Service } from \"typedi\";\nimport { CONFIG_BRANCH } from \"./branch-config\";\n\nimport { RBranch } from \"src/_examples/model-shared/branch.model\";\n\n// import \"@retailer/services/raccount/raccount-service\";\n// import { RAccountService } from \"@retailer/services/raccount/raccount-service.interface\";\n\nimport { RAccountService } from \"src/_examples/service/raccount/raccount-service.interface\";\nimport \"src/_examples/service/raccount/raccount-service\";\n\nimport { RBranchService } from \"src/_examples/service/branch/branch-service.interface\";\nimport \"src/_examples/service/branch/branch-service\";\n\n@Service(\"RBranchController\")\nexport class RBranchController extends ControllerApi<RBranch, RBranchService> {\n private readonly rAccountService: RAccountService = Container.get(\"RAccountService\");\n\n constructor() {\n super(Container.get(\"RBranchService\"), CONFIG_BRANCH.toObject());\n }\n\n protected processCrudRequest(event: HttpRequest): Promise<any> {\n throw new Error(\"Method not implemented.\");\n }\n\n protected processSQSEvent(sqsEvent: SQSEvent): Promise<any> {\n throw new Error(\"Method not implemented.\");\n }\n\n protected async processStreamEvent(event: DynamoDBStreamEvent): Promise<void> {\n throw new Error(\"Method not implemented.\");\n }\n\n protected async processScheduledEvent(event: ScheduledEvent): Promise<void> {\n throw new Error(\"Method not implemented.\");\n }\n\n protected async processWebSocketEvent(event: APIGatewayProxyWebsocketEventV2): Promise<void> {\n throw new Error(\"Method not implemented.\");\n }\n}\n"]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.handler = void 0;
|
|
43
|
+
require("reflect-metadata");
|
|
44
|
+
const typedi_1 = __importStar(require("typedi"));
|
|
45
|
+
require("./branch-controller");
|
|
46
|
+
const handler = (event) => typedi_1.default.get(HelperCDI).process(event);
|
|
47
|
+
exports.handler = handler;
|
|
48
|
+
let HelperCDI = class HelperCDI {
|
|
49
|
+
controller = typedi_1.default.get("RBranchController");
|
|
50
|
+
async process(event) {
|
|
51
|
+
return this.controller.resolveCrudRequest(event);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
HelperCDI = __decorate([
|
|
55
|
+
(0, typedi_1.Service)()
|
|
56
|
+
], HelperCDI);
|
|
57
|
+
//# sourceMappingURL=branch-crud.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-crud.js","sourceRoot":"","sources":["../../../../src/_examples/controller/branch/branch-crud.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4BAA0B;AAC1B,iDAA4C;AAK5C,+BAA6B;AAEtB,MAAM,OAAO,GAAG,CAAC,KAA2B,EAAE,EAAE,CAAC,gBAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAAnF,QAAA,OAAO,WAA4E;AAGhG,IAAM,SAAS,GAAf,MAAM,SAAS;IACI,UAAU,GAAsB,gBAAS,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IAEpF,KAAK,CAAC,OAAO,CAAC,KAA2B;QACvC,OAAO,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACnD,CAAC;CACF,CAAA;AANK,SAAS;IADd,IAAA,gBAAO,GAAE;GACJ,SAAS,CAMd","sourcesContent":["import \"reflect-metadata\";\nimport Container, { Service } from \"typedi\";\nimport { APIGatewayProxyEvent } from \"aws-lambda\";\n\n// Controller\nimport { RBranchController } from \"./branch-controller\";\nimport \"./branch-controller\";\n\nexport const handler = (event: APIGatewayProxyEvent) => Container.get(HelperCDI).process(event);\n\n@Service()\nclass HelperCDI {\n private readonly controller: RBranchController = Container.get(\"RBranchController\");\n\n async process(event: APIGatewayProxyEvent) {\n return this.controller.resolveCrudRequest(event);\n }\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ControllerApi } from "src/controller";
|
|
2
|
+
import { HttpRequest } from "src/utils";
|
|
3
|
+
import { Commission } from "src/_examples/model-shared/commission.model";
|
|
4
|
+
import { CommissionService } from "src/_examples/service/commission/commission-service.interface";
|
|
5
|
+
import "src/_examples/service/commission/commission-service";
|
|
6
|
+
export declare class CommissionController extends ControllerApi<Commission, CommissionService> {
|
|
7
|
+
constructor();
|
|
8
|
+
protected processCrudRequest(req: HttpRequest): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
42
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.CommissionController = void 0;
|
|
46
|
+
const typedi_1 = __importStar(require("typedi"));
|
|
47
|
+
const controller_1 = require("src/controller");
|
|
48
|
+
const commission_config_1 = require("./commission.config");
|
|
49
|
+
require("src/_examples/service/commission/commission-service");
|
|
50
|
+
let CommissionController = class CommissionController extends controller_1.ControllerApi {
|
|
51
|
+
constructor() {
|
|
52
|
+
super(typedi_1.default.get("CommissionService"), commission_config_1.CONFIG_COMMISSION.toObject());
|
|
53
|
+
}
|
|
54
|
+
async processCrudRequest(req) {
|
|
55
|
+
if (req.resourcePath === `POST ${commission_config_1.path}/create`) {
|
|
56
|
+
const { supplierUsername, retailerUsername, toRetailerPercent } = req.body;
|
|
57
|
+
return await this.service.create(supplierUsername, retailerUsername, toRetailerPercent);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
exports.CommissionController = CommissionController;
|
|
62
|
+
exports.CommissionController = CommissionController = __decorate([
|
|
63
|
+
(0, typedi_1.Service)("CommissionController"),
|
|
64
|
+
__metadata("design:paramtypes", [])
|
|
65
|
+
], CommissionController);
|
|
66
|
+
//# sourceMappingURL=commission-controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commission-controller.js","sourceRoot":"","sources":["../../../../src/_examples/controller/commission/commission-controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4C;AAC5C,+CAA+C;AAE/C,2DAA8D;AAI9D,+DAA6D;AAGtD,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,0BAA4C;IACpF;QACE,KAAK,CAAC,gBAAS,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE,qCAAiB,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC1E,CAAC;IAES,KAAK,CAAC,kBAAkB,CAAC,GAAgB;QACjD,IAAI,GAAG,CAAC,YAAY,KAAK,QAAQ,wBAAI,SAAS,EAAE,CAAC;YAC/C,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC;YAC3E,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;QAC1F,CAAC;IACH,CAAC;CACF,CAAA;AAXY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,gBAAO,EAAC,sBAAsB,CAAC;;GACnB,oBAAoB,CAWhC","sourcesContent":["import Container, { Service } from \"typedi\";\nimport { ControllerApi } from \"src/controller\";\nimport { HttpRequest } from \"src/utils\";\nimport { CONFIG_COMMISSION, path } from \"./commission.config\";\nimport { Commission } from \"src/_examples/model-shared/commission.model\";\n\nimport { CommissionService } from \"src/_examples/service/commission/commission-service.interface\";\nimport \"src/_examples/service/commission/commission-service\";\n\n@Service(\"CommissionController\")\nexport class CommissionController extends ControllerApi<Commission, CommissionService> {\n constructor() {\n super(Container.get(\"CommissionService\"), CONFIG_COMMISSION.toObject());\n }\n\n protected async processCrudRequest(req: HttpRequest): Promise<any> {\n if (req.resourcePath === `POST ${path}/create`) {\n const { supplierUsername, retailerUsername, toRetailerPercent } = req.body;\n return await this.service.create(supplierUsername, retailerUsername, toRetailerPercent);\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.handler = void 0;
|
|
43
|
+
require("reflect-metadata");
|
|
44
|
+
const typedi_1 = __importStar(require("typedi"));
|
|
45
|
+
require("./commission-controller");
|
|
46
|
+
const handler = (event) => typedi_1.default.get(HelperCDI).process(event);
|
|
47
|
+
exports.handler = handler;
|
|
48
|
+
let HelperCDI = class HelperCDI {
|
|
49
|
+
controller = typedi_1.default.get("CommissionController");
|
|
50
|
+
async process(event) {
|
|
51
|
+
return this.controller.resolveCrudRequest(event);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
HelperCDI = __decorate([
|
|
55
|
+
(0, typedi_1.Service)()
|
|
56
|
+
], HelperCDI);
|
|
57
|
+
//# sourceMappingURL=commission-crud.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commission-crud.js","sourceRoot":"","sources":["../../../../src/_examples/controller/commission/commission-crud.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4BAA0B;AAC1B,iDAA4C;AAI5C,mCAAiC;AAE1B,MAAM,OAAO,GAAG,CAAC,KAA2B,EAAE,EAAE,CAAC,gBAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAAnF,QAAA,OAAO,WAA4E;AAGhG,IAAM,SAAS,GAAf,MAAM,SAAS;IACI,UAAU,GAAyB,gBAAS,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IAE1F,KAAK,CAAC,OAAO,CAAC,KAA2B;QACvC,OAAO,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACnD,CAAC;CACF,CAAA;AANK,SAAS;IADd,IAAA,gBAAO,GAAE;GACJ,SAAS,CAMd","sourcesContent":["import \"reflect-metadata\";\nimport Container, { Service } from \"typedi\";\nimport { APIGatewayProxyEvent } from \"aws-lambda\";\n\nimport { CommissionController } from \"./commission-controller\";\nimport \"./commission-controller\";\n\nexport const handler = (event: APIGatewayProxyEvent) => Container.get(HelperCDI).process(event);\n\n@Service()\nclass HelperCDI {\n private readonly controller: CommissionController = Container.get(\"CommissionController\");\n\n async process(event: APIGatewayProxyEvent) {\n return this.controller.resolveCrudRequest(event);\n }\n}\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONFIG_COMMISSION = exports.CommissionConfig = exports.path = void 0;
|
|
4
|
+
const core_1 = require("../../../index.js");
|
|
5
|
+
const commission_model_1 = require("src/_examples/model-shared/commission.model");
|
|
6
|
+
exports.path = "/retailer/commissions"; // url path base
|
|
7
|
+
class CommissionConfig extends core_1.EntityConfigImpl {
|
|
8
|
+
constructor() {
|
|
9
|
+
// DYNAMODB
|
|
10
|
+
const tableName = "retailer-commission_DEV";
|
|
11
|
+
const indexMap = new core_1.DynamoIndexMap()
|
|
12
|
+
.set("byOwner", { field: "supplierUsername", rFields: ["supplierUsername"] })
|
|
13
|
+
.set("byRetailer", { field: "retailerUsername", rFields: ["retailerUsername"] })
|
|
14
|
+
.set("bySupplierRetailer", {
|
|
15
|
+
field: "supplierUsername_retailerUsername",
|
|
16
|
+
rFields: ["supplierUsername", "retailerUsername"],
|
|
17
|
+
fieldSeparator: "_",
|
|
18
|
+
});
|
|
19
|
+
// PERMISSIONS
|
|
20
|
+
const ownerFieldName = "retailerUsername";
|
|
21
|
+
const adminGroupName = ["adminUsers"];
|
|
22
|
+
const policies = [
|
|
23
|
+
{
|
|
24
|
+
method: core_1.HttpMethod.GET,
|
|
25
|
+
path: `${exports.path}`,
|
|
26
|
+
access: [core_1.Access.OWNER, core_1.Access.ADMIN],
|
|
27
|
+
},
|
|
28
|
+
{ method: core_1.HttpMethod.GET, path: `${exports.path}/{id}`, access: [core_1.Access.OWNER, core_1.Access.ADMIN] },
|
|
29
|
+
{ method: core_1.HttpMethod.PUT, path: `${exports.path}/{id}`, validator: commission_model_1.REPLACE_COMMISSION, access: [core_1.Access.ADMIN] },
|
|
30
|
+
{ method: core_1.HttpMethod.PATCH, path: `${exports.path}/{id}`, validator: commission_model_1.UPDATE_COMMISSION, access: [core_1.Access.ADMIN] },
|
|
31
|
+
{ method: core_1.HttpMethod.DELETE, path: `${exports.path}/{id}`, access: [core_1.Access.ADMIN] },
|
|
32
|
+
{ method: core_1.HttpMethod.POST, path: `${exports.path}/create`, validator: commission_model_1.CREATE_COMMISSION, access: [core_1.Access.ADMIN] },
|
|
33
|
+
];
|
|
34
|
+
super(exports.path, adminGroupName);
|
|
35
|
+
this.setDynamoDB(tableName, ownerFieldName, indexMap).setPolicies(policies);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.CommissionConfig = CommissionConfig;
|
|
39
|
+
// Export default SalesReport configuration
|
|
40
|
+
exports.CONFIG_COMMISSION = new CommissionConfig();
|
|
41
|
+
//# sourceMappingURL=commission.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commission.config.js","sourceRoot":"","sources":["../../../../src/_examples/controller/commission/commission.config.ts"],"names":[],"mappings":";;;AAAA,yCAAgH;AAChH,kFAIqD;AAExC,QAAA,IAAI,GAAG,uBAAuB,CAAC,CAAC,gBAAgB;AAE7D,MAAa,gBAAiB,SAAQ,uBAAgB;IACpD;QACE,WAAW;QACX,MAAM,SAAS,GAAG,yBAAyB,CAAC;QAC5C,MAAM,QAAQ,GAAG,IAAI,qBAAc,EAAE;aAClC,GAAG,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,CAAC,kBAAkB,CAAC,EAAE,CAAC;aAC5E,GAAG,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,CAAC,kBAAkB,CAAC,EAAE,CAAC;aAC/E,GAAG,CAAC,oBAAoB,EAAE;YACzB,KAAK,EAAE,mCAAmC;YAC1C,OAAO,EAAE,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;YACjD,cAAc,EAAE,GAAG;SACpB,CAAC,CAAC;QAEL,cAAc;QACd,MAAM,cAAc,GAAG,kBAAkB,CAAC;QAC1C,MAAM,cAAc,GAAG,CAAC,YAAY,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAqB;YACjC;gBACE,MAAM,EAAE,iBAAC,CAAC,GAAG;gBACb,IAAI,EAAE,GAAG,YAAI,EAAE;gBACf,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,EAAE,aAAC,CAAC,KAAK,CAAC;aAC3B;YACD,EAAE,MAAM,EAAE,iBAAC,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,YAAI,OAAO,EAAE,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,EAAE,aAAC,CAAC,KAAK,CAAC,EAAE;YACnE,EAAE,MAAM,EAAE,iBAAC,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,YAAI,OAAO,EAAE,SAAS,EAAE,qCAAO,EAAE,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,CAAC,EAAE;YAC9E,EAAE,MAAM,EAAE,iBAAC,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,YAAI,OAAO,EAAE,SAAS,EAAE,oCAAM,EAAE,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,CAAC,EAAE;YAC/E,EAAE,MAAM,EAAE,iBAAC,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,YAAI,OAAO,EAAE,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,CAAC,EAAE;YAC7D,EAAE,MAAM,EAAE,iBAAC,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,YAAI,SAAS,EAAE,SAAS,EAAE,oCAAM,EAAE,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,CAAC,EAAE;SACjF,CAAC;QAEF,KAAK,CAAC,YAAI,EAAE,cAAc,CAAC,CAAC;QAE5B,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC9E,CAAC;CACF;AAjCD,4CAiCC;AAED,2CAA2C;AAC9B,QAAA,iBAAiB,GAAG,IAAI,gBAAgB,EAAE,CAAC","sourcesContent":["import { Access as a, DynamoIndexMap, EndpointPolicy, EntityConfigImpl, HttpMethod as m } from \"@chinggis/core\";\nimport {\n CREATE_COMMISSION as CREATE,\n REPLACE_COMMISSION as REPLACE,\n UPDATE_COMMISSION as UPDATE,\n} from \"src/_examples/model-shared/commission.model\";\n\nexport const path = \"/retailer/commissions\"; // url path base\n\nexport class CommissionConfig extends EntityConfigImpl {\n constructor() {\n // DYNAMODB\n const tableName = \"retailer-commission_DEV\";\n const indexMap = new DynamoIndexMap()\n .set(\"byOwner\", { field: \"supplierUsername\", rFields: [\"supplierUsername\"] })\n .set(\"byRetailer\", { field: \"retailerUsername\", rFields: [\"retailerUsername\"] })\n .set(\"bySupplierRetailer\", {\n field: \"supplierUsername_retailerUsername\",\n rFields: [\"supplierUsername\", \"retailerUsername\"],\n fieldSeparator: \"_\",\n });\n\n // PERMISSIONS\n const ownerFieldName = \"retailerUsername\";\n const adminGroupName = [\"adminUsers\"];\n const policies: EndpointPolicy[] = [\n {\n method: m.GET,\n path: `${path}`,\n access: [a.OWNER, a.ADMIN],\n },\n { method: m.GET, path: `${path}/{id}`, access: [a.OWNER, a.ADMIN] },\n { method: m.PUT, path: `${path}/{id}`, validator: REPLACE, access: [a.ADMIN] },\n { method: m.PATCH, path: `${path}/{id}`, validator: UPDATE, access: [a.ADMIN] },\n { method: m.DELETE, path: `${path}/{id}`, access: [a.ADMIN] },\n { method: m.POST, path: `${path}/create`, validator: CREATE, access: [a.ADMIN] },\n ];\n\n super(path, adminGroupName);\n\n this.setDynamoDB(tableName, ownerFieldName, indexMap).setPolicies(policies);\n }\n}\n\n// Export default SalesReport configuration\nexport const CONFIG_COMMISSION = new CommissionConfig();\n"]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONFIG_RETAILER = exports.RetailerConfig = exports.path = void 0;
|
|
4
|
+
const core_1 = require("../../../index.js");
|
|
5
|
+
const raccount_model_1 = require("src/_examples/model-shared/raccount.model");
|
|
6
|
+
exports.path = "/retailer/accounts"; // url path base
|
|
7
|
+
// Retailer Account configuration
|
|
8
|
+
class RetailerConfig extends core_1.EntityConfigImpl {
|
|
9
|
+
constructor() {
|
|
10
|
+
// DYNAMODB
|
|
11
|
+
const tableName = "retailer-profile_DEV";
|
|
12
|
+
const indexMap = new core_1.DynamoIndexMap().set("byUsername", {
|
|
13
|
+
field: "username",
|
|
14
|
+
rFields: ["username"],
|
|
15
|
+
});
|
|
16
|
+
// TODO remove after fully merged to new database structure.
|
|
17
|
+
if (process.env.ENV === "prod") {
|
|
18
|
+
indexMap.setFields("username");
|
|
19
|
+
}
|
|
20
|
+
// OPENSEARCH
|
|
21
|
+
const openSearch = {
|
|
22
|
+
domain: "https://search-amplify-opense-u395qzlqz9h6-i4pks35uvl6djkxq5ikogrmh2i.ap-southeast-1.es.amazonaws.com",
|
|
23
|
+
index: "raccount",
|
|
24
|
+
};
|
|
25
|
+
// PERMISSIONS
|
|
26
|
+
const ownerFieldName = "username";
|
|
27
|
+
const adminGroupName = ["adminUsers"];
|
|
28
|
+
const policies = [
|
|
29
|
+
{ method: core_1.HttpMethod.GET, path: `${exports.path}`, access: [core_1.Access.ADMIN], response: raccount_model_1.RESPONSE_FIELDS_LIST_RETAILER_ACCOUNT },
|
|
30
|
+
{ method: core_1.HttpMethod.GET, path: `${exports.path}/search`, access: [core_1.Access.ADMIN], response: raccount_model_1.RESPONSE_FIELDS_LIST_RETAILER_ACCOUNT },
|
|
31
|
+
{ method: core_1.HttpMethod.GET, path: `${exports.path}/{id}`, access: [core_1.Access.OWNER, core_1.Access.ADMIN], response: raccount_model_1.RESPONSE_FIELDS_DETAILS_RETAILER_ACCOUNT }, // retailer account details
|
|
32
|
+
{
|
|
33
|
+
method: core_1.HttpMethod.GET,
|
|
34
|
+
path: `${exports.path}/non-partner/{supplierUsername}`,
|
|
35
|
+
access: [core_1.Access.OWNER, core_1.Access.ADMIN],
|
|
36
|
+
response: raccount_model_1.RESPONSE_FIELDS_LIST_RETAILER_ACCOUNT,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
method: core_1.HttpMethod.PATCH,
|
|
40
|
+
path: `${exports.path}/{id}`,
|
|
41
|
+
access: [core_1.Access.ADMIN],
|
|
42
|
+
validator: raccount_model_1.UPDATE_RETAILER_ACCOUNT,
|
|
43
|
+
response: raccount_model_1.RESPONSE_FIELDS_DETAILS_RETAILER_ACCOUNT,
|
|
44
|
+
},
|
|
45
|
+
{ method: core_1.HttpMethod.POST, path: `${exports.path}`, access: [core_1.Access.ADMIN], validator: raccount_model_1.CREATE_RETAILER_ACCOUNT, response: raccount_model_1.RESPONSE_FIELDS_DETAILS_RETAILER_ACCOUNT },
|
|
46
|
+
{ method: core_1.HttpMethod.PUT, path: `${exports.path}`, access: [core_1.Access.ADMIN], validator: raccount_model_1.REPLACE_RETAILER_ACCOUNT, response: raccount_model_1.RESPONSE_FIELDS_DETAILS_RETAILER_ACCOUNT },
|
|
47
|
+
{ method: core_1.HttpMethod.DELETE, path: `${exports.path}/{id}`, access: [core_1.Access.ADMIN] },
|
|
48
|
+
];
|
|
49
|
+
// INIT
|
|
50
|
+
super(exports.path, adminGroupName);
|
|
51
|
+
this.setDynamoDB(tableName, ownerFieldName, indexMap)
|
|
52
|
+
.setOpenSearch(openSearch.domain, openSearch.index)
|
|
53
|
+
.setPolicies(policies);
|
|
54
|
+
this.OWNER_ID_FIELD_NAME = "username";
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.RetailerConfig = RetailerConfig;
|
|
58
|
+
// Export default Retailer Account configuration
|
|
59
|
+
exports.CONFIG_RETAILER = new RetailerConfig();
|
|
60
|
+
//# sourceMappingURL=raccount-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"raccount-config.js","sourceRoot":"","sources":["../../../../src/_examples/controller/raccount/raccount-config.ts"],"names":[],"mappings":";;;AAAA,yCAAgH;AAChH,8EAMmD;AAEtC,QAAA,IAAI,GAAG,oBAAoB,CAAC,CAAC,gBAAgB;AAE1D,iCAAiC;AACjC,MAAa,cAAe,SAAQ,uBAAgB;IAClD;QACE,WAAW;QACX,MAAM,SAAS,GAAG,sBAAsB,CAAC;QACzC,MAAM,QAAQ,GAAG,IAAI,qBAAc,EAAE,CAAC,GAAG,CAAC,YAAY,EAAE;YACtD,KAAK,EAAE,UAAU;YACjB,OAAO,EAAE,CAAC,UAAU,CAAC;SACtB,CAAC,CAAC;QAEH,4DAA4D;QAC5D,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,MAAM,EAAE,CAAC;YAC/B,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACjC,CAAC;QAED,aAAa;QACb,MAAM,UAAU,GAAG;YACjB,MAAM,EAAE,uGAAuG;YAC/G,KAAK,EAAE,UAAU;SAClB,CAAC;QAEF,cAAc;QACd,MAAM,cAAc,GAAG,UAAU,CAAC;QAClC,MAAM,cAAc,GAAG,CAAC,YAAY,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAqB;YACjC,EAAE,MAAM,EAAE,iBAAC,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,YAAI,EAAE,EAAE,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,sDAAQ,EAAE;YACzE,EAAE,MAAM,EAAE,iBAAC,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,YAAI,SAAS,EAAE,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,sDAAQ,EAAE;YAChF,EAAE,MAAM,EAAE,iBAAC,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,YAAI,OAAO,EAAE,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,EAAE,aAAC,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,yDAAQ,EAAE,EAAE,2BAA2B;YACpH;gBACE,MAAM,EAAE,iBAAC,CAAC,GAAG;gBACb,IAAI,EAAE,GAAG,YAAI,iCAAiC;gBAC9C,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,EAAE,aAAC,CAAC,KAAK,CAAC;gBAC1B,QAAQ,EAAE,sDAAQ;aACnB;YACD;gBACE,MAAM,EAAE,iBAAC,CAAC,KAAK;gBACf,IAAI,EAAE,GAAG,YAAI,OAAO;gBACpB,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,CAAC;gBACjB,SAAS,EAAE,wCAAM;gBACjB,QAAQ,EAAE,yDAAQ;aACnB;YACD,EAAE,MAAM,EAAE,iBAAC,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,YAAI,EAAE,EAAE,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,wCAAM,EAAE,QAAQ,EAAE,yDAAQ,EAAE;YAC7F,EAAE,MAAM,EAAE,iBAAC,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,YAAI,EAAE,EAAE,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,yCAAO,EAAE,QAAQ,EAAE,yDAAQ,EAAE;YAC7F,EAAE,MAAM,EAAE,iBAAC,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,YAAI,OAAO,EAAE,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,CAAC,EAAE;SAC9D,CAAC;QAEF,OAAO;QACP,KAAK,CAAC,YAAI,EAAE,cAAc,CAAC,CAAC;QAC5B,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,cAAc,EAAE,QAAQ,CAAC;aAClD,aAAa,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC;aAClD,WAAW,CAAC,QAAQ,CAAC,CAAC;QACzB,IAAI,CAAC,mBAAmB,GAAG,UAAU,CAAC;IACxC,CAAC;CACF;AApDD,wCAoDC;AAED,gDAAgD;AACnC,QAAA,eAAe,GAAG,IAAI,cAAc,EAAE,CAAC","sourcesContent":["import { Access as a, DynamoIndexMap, EndpointPolicy, EntityConfigImpl, HttpMethod as m } from \"@chinggis/core\";\nimport {\n CREATE_RETAILER_ACCOUNT as CREATE,\n REPLACE_RETAILER_ACCOUNT as REPLACE,\n RESPONSE_FIELDS_DETAILS_RETAILER_ACCOUNT as FIELDS_D,\n RESPONSE_FIELDS_LIST_RETAILER_ACCOUNT as FIELDS_L,\n UPDATE_RETAILER_ACCOUNT as UPDATE,\n} from \"src/_examples/model-shared/raccount.model\";\n\nexport const path = \"/retailer/accounts\"; // url path base\n\n// Retailer Account configuration\nexport class RetailerConfig extends EntityConfigImpl {\n constructor() {\n // DYNAMODB\n const tableName = \"retailer-profile_DEV\";\n const indexMap = new DynamoIndexMap().set(\"byUsername\", {\n field: \"username\",\n rFields: [\"username\"],\n });\n\n // TODO remove after fully merged to new database structure.\n if (process.env.ENV === \"prod\") {\n indexMap.setFields(\"username\");\n }\n\n // OPENSEARCH\n const openSearch = {\n domain: \"https://search-amplify-opense-u395qzlqz9h6-i4pks35uvl6djkxq5ikogrmh2i.ap-southeast-1.es.amazonaws.com\",\n index: \"raccount\",\n };\n\n // PERMISSIONS\n const ownerFieldName = \"username\";\n const adminGroupName = [\"adminUsers\"];\n const policies: EndpointPolicy[] = [\n { method: m.GET, path: `${path}`, access: [a.ADMIN], response: FIELDS_L },\n { method: m.GET, path: `${path}/search`, access: [a.ADMIN], response: FIELDS_L },\n { method: m.GET, path: `${path}/{id}`, access: [a.OWNER, a.ADMIN], response: FIELDS_D }, // retailer account details\n {\n method: m.GET,\n path: `${path}/non-partner/{supplierUsername}`,\n access: [a.OWNER, a.ADMIN],\n response: FIELDS_L,\n },\n {\n method: m.PATCH,\n path: `${path}/{id}`,\n access: [a.ADMIN],\n validator: UPDATE,\n response: FIELDS_D,\n },\n { method: m.POST, path: `${path}`, access: [a.ADMIN], validator: CREATE, response: FIELDS_D },\n { method: m.PUT, path: `${path}`, access: [a.ADMIN], validator: REPLACE, response: FIELDS_D },\n { method: m.DELETE, path: `${path}/{id}`, access: [a.ADMIN] },\n ];\n\n // INIT\n super(path, adminGroupName);\n this.setDynamoDB(tableName, ownerFieldName, indexMap)\n .setOpenSearch(openSearch.domain, openSearch.index)\n .setPolicies(policies);\n this.OWNER_ID_FIELD_NAME = \"username\";\n }\n}\n\n// Export default Retailer Account configuration\nexport const CONFIG_RETAILER = new RetailerConfig();\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Retailer } from "src/_examples/model-shared/raccount.model";
|
|
2
|
+
import { APIGatewayProxyWebsocketEventV2, DynamoDBStreamEvent, ScheduledEvent, SQSEvent } from "aws-lambda";
|
|
3
|
+
import { ControllerApi } from "src/controller";
|
|
4
|
+
import { HttpRequest } from "src/utils";
|
|
5
|
+
import { RAccountService } from "src/_examples/service/raccount/raccount-service.interface";
|
|
6
|
+
import "src/_examples/service/raccount/raccount-service";
|
|
7
|
+
export declare class RetailerController extends ControllerApi<Retailer, RAccountService> {
|
|
8
|
+
constructor();
|
|
9
|
+
protected processCrudRequest(req: HttpRequest): Promise<any>;
|
|
10
|
+
protected processSQSEvent(sqsEvent: SQSEvent): Promise<any>;
|
|
11
|
+
protected processStreamEvent(event: DynamoDBStreamEvent): Promise<void>;
|
|
12
|
+
protected processScheduledEvent(event: ScheduledEvent): Promise<void>;
|
|
13
|
+
protected processWebSocketEvent(event: APIGatewayProxyWebsocketEventV2): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
42
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.RetailerController = void 0;
|
|
46
|
+
const controller_1 = require("src/controller");
|
|
47
|
+
const typedi_1 = __importStar(require("typedi"));
|
|
48
|
+
const raccount_config_1 = require("./raccount-config");
|
|
49
|
+
require("src/_examples/service/raccount/raccount-service");
|
|
50
|
+
let RetailerController = class RetailerController extends controller_1.ControllerApi {
|
|
51
|
+
constructor() {
|
|
52
|
+
super(typedi_1.default.get("RAccountService"), raccount_config_1.CONFIG_RETAILER.toObject());
|
|
53
|
+
}
|
|
54
|
+
async processCrudRequest(req) { }
|
|
55
|
+
processSQSEvent(sqsEvent) {
|
|
56
|
+
throw new Error("Method not implemented.");
|
|
57
|
+
}
|
|
58
|
+
async processStreamEvent(event) {
|
|
59
|
+
throw new Error("Method not implemented.");
|
|
60
|
+
}
|
|
61
|
+
async processScheduledEvent(event) {
|
|
62
|
+
throw new Error("Method not implemented.");
|
|
63
|
+
}
|
|
64
|
+
async processWebSocketEvent(event) {
|
|
65
|
+
throw new Error("Method not implemented.");
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
exports.RetailerController = RetailerController;
|
|
69
|
+
exports.RetailerController = RetailerController = __decorate([
|
|
70
|
+
(0, typedi_1.Service)("RetailerController"),
|
|
71
|
+
__metadata("design:paramtypes", [])
|
|
72
|
+
], RetailerController);
|
|
73
|
+
//# sourceMappingURL=raccount-controller.js.map
|