@nomalism-com/api 0.8.362 → 0.8.363
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.
|
@@ -7,4 +7,4 @@ export import ICreateProductByCabideProductIdRequest = Entity.ICreateProductByCa
|
|
|
7
7
|
export import IFindPaginatedRequest = Entity.IFindPaginatedRequest;
|
|
8
8
|
export import IFindWithPaginationResponse = Entity.IFindWithPaginationResponse;
|
|
9
9
|
export declare const route: string;
|
|
10
|
-
export declare const create: (data: Entity.ICreateRequest) => Promise<import("@nomalism-com/types/dist/shared/entities").CabideProduct>, deleteOne: (selector: shared.IFindByIdRequest) => Promise<void>, findByOwner: (selector: shared.IFindByOwnerIdRequest) => Promise<Entity.IFindCabideByOwnerResponse[]>, findByOwnerPaginated: (selector: Entity.IFindPaginatedRequest) => Promise<Entity.IFindWithPaginationResponse>, findProductByCabideProductId: (selector: shared.IFindByIdRequest) => Promise<Product.IEntityExtended[]>;
|
|
10
|
+
export declare const create: (data: Entity.ICreateRequest) => Promise<import("@nomalism-com/types/dist/shared/entities").CabideProduct>, createProductByCabideProductId: (data: Entity.ICreateProductByCabideProductIdRequest) => Promise<Product.IEntityExtended>, deleteOne: (selector: shared.IFindByIdRequest) => Promise<void>, findById: (select: shared.IFindByIdRequest) => Promise<import("@nomalism-com/types/dist/shared/entities").CabideProduct | null>, findByOwner: (selector: shared.IFindByOwnerIdRequest) => Promise<Entity.IFindCabideByOwnerResponse[]>, findByOwnerPaginated: (selector: Entity.IFindPaginatedRequest) => Promise<Entity.IFindWithPaginationResponse>, findProductByCabideProductId: (selector: shared.IFindByIdRequest) => Promise<Product.IEntityExtended[]>;
|
|
@@ -50,7 +50,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
50
50
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
51
|
};
|
|
52
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
-
exports.findProductByCabideProductId = exports.findByOwnerPaginated = exports.findByOwner = exports.deleteOne = exports.create = exports.route = void 0;
|
|
53
|
+
exports.findProductByCabideProductId = exports.findByOwnerPaginated = exports.findByOwner = exports.findById = exports.deleteOne = exports.createProductByCabideProductId = exports.create = exports.route = void 0;
|
|
54
54
|
var client_1 = __importDefault(require("../../shared/client"));
|
|
55
55
|
var stock_1 = require("../stock");
|
|
56
56
|
exports.route = "".concat(stock_1.serviceHostname).concat(stock_1.serviceAuthPath, "cabide_product/");
|
|
@@ -77,11 +77,35 @@ var repository = {
|
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
}); },
|
|
80
|
-
|
|
80
|
+
deleteOne: function (selector) { return __awaiter(void 0, void 0, void 0, function () {
|
|
81
|
+
return __generator(this, function (_a) {
|
|
82
|
+
switch (_a.label) {
|
|
83
|
+
case 0: return [4, client_1.default.delete("".concat(exports.route).concat(selector.id))];
|
|
84
|
+
case 1:
|
|
85
|
+
_a.sent();
|
|
86
|
+
return [2];
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}); },
|
|
90
|
+
findById: function (_a) {
|
|
91
|
+
var id = _a.id;
|
|
92
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
93
|
+
var response;
|
|
94
|
+
return __generator(this, function (_b) {
|
|
95
|
+
switch (_b.label) {
|
|
96
|
+
case 0: return [4, client_1.default.get("".concat(exports.route).concat(id))];
|
|
97
|
+
case 1:
|
|
98
|
+
response = _b.sent();
|
|
99
|
+
return [2, response.data];
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
},
|
|
104
|
+
findByOwner: function (params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
81
105
|
var response;
|
|
82
106
|
return __generator(this, function (_a) {
|
|
83
107
|
switch (_a.label) {
|
|
84
|
-
case 0: return [4, client_1.default.get("".concat(exports.route)
|
|
108
|
+
case 0: return [4, client_1.default.get("".concat(exports.route, "by_owner"), { params: params })];
|
|
85
109
|
case 1:
|
|
86
110
|
response = _a.sent();
|
|
87
111
|
return [2, response.data];
|
|
@@ -113,15 +137,5 @@ var repository = {
|
|
|
113
137
|
}
|
|
114
138
|
});
|
|
115
139
|
}); },
|
|
116
|
-
deleteOne: function (selector) { return __awaiter(void 0, void 0, void 0, function () {
|
|
117
|
-
return __generator(this, function (_a) {
|
|
118
|
-
switch (_a.label) {
|
|
119
|
-
case 0: return [4, client_1.default.delete("".concat(exports.route).concat(selector.id))];
|
|
120
|
-
case 1:
|
|
121
|
-
_a.sent();
|
|
122
|
-
return [2];
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
}); },
|
|
126
140
|
};
|
|
127
|
-
exports.create = repository.create, exports.deleteOne = repository.deleteOne, exports.findByOwner = repository.findByOwner, exports.findByOwnerPaginated = repository.findByOwnerPaginated, exports.findProductByCabideProductId = repository.findProductByCabideProductId;
|
|
141
|
+
exports.create = repository.create, exports.createProductByCabideProductId = repository.createProductByCabideProductId, exports.deleteOne = repository.deleteOne, exports.findById = repository.findById, exports.findByOwner = repository.findByOwner, exports.findByOwnerPaginated = repository.findByOwnerPaginated, exports.findProductByCabideProductId = repository.findProductByCabideProductId;
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"typescript",
|
|
10
10
|
"helper"
|
|
11
11
|
],
|
|
12
|
-
"version": "0.8.
|
|
12
|
+
"version": "0.8.363",
|
|
13
13
|
"main": "dist/index.js",
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
15
|
"files": [
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"typescript": "^5.1.6"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@nomalism-com/types": "^0.9.
|
|
50
|
+
"@nomalism-com/types": "^0.9.478",
|
|
51
51
|
"axios": "^0.27.2"
|
|
52
52
|
}
|
|
53
53
|
}
|