@nomalism-com/api 0.12.8 → 0.12.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/dist/index.d.ts +281 -3
  2. package/dist/index.js +311 -5
  3. package/dist/modules/document/materialEntrance.d.ts +11 -3
  4. package/dist/modules/document/materialEntrance.js +43 -33
  5. package/dist/modules/document/order.d.ts +15 -2
  6. package/dist/modules/document/order.js +90 -75
  7. package/dist/modules/document/purchase.d.ts +11 -2
  8. package/dist/modules/document/purchase.js +58 -50
  9. package/dist/modules/documentManagement/multimedia.d.ts +11 -4
  10. package/dist/modules/documentManagement/multimedia.js +32 -51
  11. package/dist/modules/integration/dynamicData.d.ts +12 -2
  12. package/dist/modules/integration/dynamicData.js +70 -60
  13. package/dist/modules/integration/emailTemplate.d.ts +12 -2
  14. package/dist/modules/integration/emailTemplate.js +69 -59
  15. package/dist/modules/integration/emailTemplateAttachment.d.ts +9 -2
  16. package/dist/modules/integration/emailTemplateAttachment.js +33 -29
  17. package/dist/modules/integration/errorHandler.d.ts +8 -2
  18. package/dist/modules/integration/errorHandler.js +21 -19
  19. package/dist/modules/integration/field.d.ts +11 -2
  20. package/dist/modules/integration/field.js +58 -49
  21. package/dist/modules/integration/fieldGroup.d.ts +13 -2
  22. package/dist/modules/integration/fieldGroup.js +85 -72
  23. package/dist/modules/integration/file.d.ts +10 -2
  24. package/dist/modules/integration/file.js +48 -42
  25. package/dist/modules/integration/googleFilePermission.d.ts +11 -2
  26. package/dist/modules/integration/googleFilePermission.js +58 -50
  27. package/dist/modules/integration/googleSheets.d.ts +11 -2
  28. package/dist/modules/integration/googleSheets.js +59 -51
  29. package/dist/modules/integration/history.d.ts +8 -2
  30. package/dist/modules/integration/history.js +23 -20
  31. package/dist/modules/integration/observation.d.ts +11 -2
  32. package/dist/modules/integration/observation.js +60 -52
  33. package/dist/modules/integration/observationType.d.ts +12 -2
  34. package/dist/modules/integration/observationType.js +72 -62
  35. package/dist/modules/integration/projectInfo.d.ts +8 -2
  36. package/dist/modules/integration/projectInfo.js +21 -19
  37. package/dist/modules/integration/settings.d.ts +12 -3
  38. package/dist/modules/integration/settings.js +72 -61
  39. package/dist/modules/integration/task.d.ts +11 -2
  40. package/dist/modules/integration/task.js +68 -60
  41. package/dist/modules/integration/taskAttachment.d.ts +9 -2
  42. package/dist/modules/integration/taskAttachment.js +36 -32
  43. package/dist/modules/integration/taskGroup.d.ts +12 -2
  44. package/dist/modules/integration/taskGroup.js +70 -60
  45. package/dist/modules/integration/taskNote.d.ts +11 -2
  46. package/dist/modules/integration/taskNote.js +58 -50
  47. package/dist/modules/print/npc.d.ts +9 -2
  48. package/dist/modules/print/npc.js +34 -30
  49. package/dist/modules/print/printer.d.ts +10 -2
  50. package/dist/modules/print/printer.js +46 -40
  51. package/dist/modules/print/schedulePrintJob.d.ts +11 -2
  52. package/dist/modules/print/schedulePrintJob.js +56 -48
  53. package/dist/modules/stock/attribute.d.ts +15 -2
  54. package/dist/modules/stock/attribute.js +111 -94
  55. package/dist/modules/stock/attributeValue.d.ts +15 -2
  56. package/dist/modules/stock/attributeValue.js +110 -94
  57. package/dist/modules/stock/color.d.ts +15 -2
  58. package/dist/modules/stock/color.js +109 -93
  59. package/dist/modules/stock/composition.d.ts +14 -2
  60. package/dist/modules/stock/composition.js +96 -82
  61. package/dist/modules/stock/compositionMaterial.d.ts +15 -2
  62. package/dist/modules/stock/compositionMaterial.js +110 -94
  63. package/dist/modules/stock/location.d.ts +15 -2
  64. package/dist/modules/stock/location.js +110 -94
  65. package/dist/modules/stock/maintenance.d.ts +15 -2
  66. package/dist/modules/stock/maintenance.js +110 -94
  67. package/dist/modules/stock/maintenanceAssoc.d.ts +14 -2
  68. package/dist/modules/stock/maintenanceAssoc.js +96 -82
  69. package/dist/modules/stock/maintenancePreset.d.ts +13 -2
  70. package/dist/modules/stock/maintenancePreset.js +82 -70
  71. package/dist/modules/stock/maintenancePresetAssoc.d.ts +11 -2
  72. package/dist/modules/stock/maintenancePresetAssoc.js +57 -49
  73. package/dist/modules/stock/maintenanceType.d.ts +15 -2
  74. package/dist/modules/stock/maintenanceType.js +110 -94
  75. package/dist/modules/stock/plot.d.ts +24 -4
  76. package/dist/modules/stock/plot.js +219 -172
  77. package/dist/modules/stock/primaryColor.d.ts +15 -2
  78. package/dist/modules/stock/primaryColor.js +110 -94
  79. package/dist/modules/stock/product.d.ts +24 -4
  80. package/dist/modules/stock/product.js +221 -190
  81. package/dist/modules/stock/productAttribute.d.ts +14 -2
  82. package/dist/modules/stock/productAttribute.js +96 -82
  83. package/dist/modules/stock/productCategory.d.ts +15 -2
  84. package/dist/modules/stock/productCategory.js +110 -94
  85. package/dist/modules/stock/productColor.d.ts +14 -2
  86. package/dist/modules/stock/productColor.js +96 -82
  87. package/dist/modules/stock/productImage.d.ts +14 -2
  88. package/dist/modules/stock/productImage.js +97 -82
  89. package/dist/modules/stock/productName.d.ts +15 -2
  90. package/dist/modules/stock/productName.js +110 -94
  91. package/dist/modules/stock/productNamePreset.d.ts +15 -2
  92. package/dist/modules/stock/productNamePreset.js +110 -94
  93. package/dist/modules/stock/productPart.d.ts +15 -2
  94. package/dist/modules/stock/productPart.js +109 -93
  95. package/dist/modules/stock/productSubCategory.d.ts +15 -2
  96. package/dist/modules/stock/productSubCategory.js +109 -93
  97. package/dist/modules/stock/productUse.d.ts +15 -2
  98. package/dist/modules/stock/productUse.js +110 -94
  99. package/dist/modules/stock/productUseAssoc.d.ts +14 -2
  100. package/dist/modules/stock/productUseAssoc.js +95 -81
  101. package/dist/modules/stock/promotion.d.ts +16 -3
  102. package/dist/modules/stock/promotion.js +130 -115
  103. package/dist/modules/stock/promotionAssoc.d.ts +14 -2
  104. package/dist/modules/stock/promotionAssoc.js +96 -82
  105. package/dist/modules/stock/queryList.d.ts +14 -3
  106. package/dist/modules/stock/queryList.js +101 -89
  107. package/dist/modules/stock/queryParameter.d.ts +13 -2
  108. package/dist/modules/stock/queryParameter.js +83 -70
  109. package/dist/modules/stock/returnReason.d.ts +11 -2
  110. package/dist/modules/stock/returnReason.js +58 -50
  111. package/dist/modules/stock/savedEmPicking.d.ts +9 -2
  112. package/dist/modules/stock/savedEmPicking.js +34 -30
  113. package/dist/modules/stock/schedule.d.ts +8 -2
  114. package/dist/modules/stock/schedule.js +23 -20
  115. package/dist/modules/stock/similarProduct.d.ts +14 -2
  116. package/dist/modules/stock/similarProduct.js +96 -82
  117. package/dist/modules/stock/stockMovement.d.ts +11 -4
  118. package/dist/modules/stock/stockMovement.js +45 -43
  119. package/dist/modules/stock/typeOfInventory.d.ts +15 -2
  120. package/dist/modules/stock/typeOfInventory.js +110 -94
  121. package/dist/modules/stock/typeOfLocation.d.ts +15 -2
  122. package/dist/modules/stock/typeOfLocation.js +110 -94
  123. package/dist/modules/stock/unitOfMeasure.d.ts +15 -2
  124. package/dist/modules/stock/unitOfMeasure.js +110 -94
  125. package/dist/modules/stock/vatTax.d.ts +15 -2
  126. package/dist/modules/stock/vatTax.js +110 -94
  127. package/dist/modules/stock/vatTaxZone.d.ts +15 -2
  128. package/dist/modules/stock/vatTaxZone.js +110 -94
  129. package/dist/modules/supply/cabide.d.ts +17 -4
  130. package/dist/modules/supply/cabide.js +128 -109
  131. package/dist/modules/supply/cabideProduct.d.ts +15 -2
  132. package/dist/modules/supply/cabideProduct.js +99 -85
  133. package/dist/modules/supply/clientCurrentAccount.d.ts +13 -2
  134. package/dist/modules/supply/clientCurrentAccount.js +88 -74
  135. package/dist/modules/supply/documentHeader.d.ts +38 -4
  136. package/dist/modules/supply/documentHeader.js +378 -316
  137. package/dist/modules/supply/documentLine.d.ts +18 -3
  138. package/dist/modules/supply/documentLine.js +136 -114
  139. package/dist/modules/supply/documentLineAssoc.d.ts +11 -2
  140. package/dist/modules/supply/documentLineAssoc.js +57 -49
  141. package/dist/modules/supply/documentLineFolder.d.ts +11 -2
  142. package/dist/modules/supply/documentLineFolder.js +58 -50
  143. package/dist/modules/supply/documentSet.d.ts +13 -2
  144. package/dist/modules/supply/documentSet.js +82 -70
  145. package/dist/modules/supply/documentType.d.ts +13 -2
  146. package/dist/modules/supply/documentType.js +83 -70
  147. package/dist/modules/supply/externalDocumentHeader.d.ts +15 -2
  148. package/dist/modules/supply/externalDocumentHeader.js +105 -89
  149. package/dist/modules/supply/externalDocumentType.d.ts +9 -2
  150. package/dist/modules/supply/externalDocumentType.js +34 -30
  151. package/dist/modules/supply/moloniRequest.d.ts +8 -2
  152. package/dist/modules/supply/moloniRequest.js +21 -20
  153. package/dist/modules/supply/orderManagement.d.ts +10 -2
  154. package/dist/modules/supply/orderManagement.js +23 -20
  155. package/dist/modules/supply/payment.d.ts +23 -4
  156. package/dist/modules/supply/payment.js +208 -180
  157. package/dist/modules/supply/preSale.d.ts +15 -2
  158. package/dist/modules/supply/preSale.js +106 -90
  159. package/dist/modules/supply/preSaleProduct.d.ts +9 -2
  160. package/dist/modules/supply/preSaleProduct.js +34 -30
  161. package/dist/modules/supply/propostaSheets.d.ts +21 -10
  162. package/dist/modules/supply/propostaSheets.js +89 -76
  163. package/dist/modules/supply/providerCurrentAccount.d.ts +8 -2
  164. package/dist/modules/supply/providerCurrentAccount.js +24 -22
  165. package/dist/modules/supply/startDocumentHeaderLastUpdate.d.ts +10 -4
  166. package/dist/modules/supply/startDocumentHeaderLastUpdate.js +22 -20
  167. package/dist/modules/supply/transformado.d.ts +8 -2
  168. package/dist/modules/supply/transformado.js +22 -20
  169. package/dist/modules/supply/upfrontReturn.d.ts +10 -4
  170. package/dist/modules/supply/upfrontReturn.js +22 -20
  171. package/dist/modules/supply/vatValidation.d.ts +8 -2
  172. package/dist/modules/supply/vatValidation.js +26 -24
  173. package/dist/modules/supply/workflow.d.ts +15 -2
  174. package/dist/modules/supply/workflow.js +70 -60
  175. package/dist/modules/tickets/channel.d.ts +13 -2
  176. package/dist/modules/tickets/channel.js +82 -70
  177. package/dist/modules/tickets/clt.d.ts +13 -2
  178. package/dist/modules/tickets/clt.js +82 -70
  179. package/dist/modules/tickets/language.d.ts +13 -2
  180. package/dist/modules/tickets/language.js +82 -70
  181. package/dist/modules/tickets/tickets.d.ts +11 -2
  182. package/dist/modules/tickets/tickets.js +58 -50
  183. package/dist/modules/user/address.d.ts +15 -2
  184. package/dist/modules/user/address.js +108 -92
  185. package/dist/modules/user/bankData.d.ts +14 -2
  186. package/dist/modules/user/bankData.js +96 -82
  187. package/dist/modules/user/clientType.d.ts +14 -2
  188. package/dist/modules/user/clientType.js +96 -82
  189. package/dist/modules/user/clients.d.ts +16 -2
  190. package/dist/modules/user/clients.js +122 -104
  191. package/dist/modules/user/commissioner.d.ts +15 -2
  192. package/dist/modules/user/commissioner.js +110 -94
  193. package/dist/modules/user/contactTypes.d.ts +14 -2
  194. package/dist/modules/user/contactTypes.js +96 -82
  195. package/dist/modules/user/contacts.d.ts +16 -2
  196. package/dist/modules/user/contacts.js +122 -102
  197. package/dist/modules/user/country.d.ts +15 -2
  198. package/dist/modules/user/country.js +110 -94
  199. package/dist/modules/user/deliveryMethods.d.ts +13 -2
  200. package/dist/modules/user/deliveryMethods.js +84 -72
  201. package/dist/modules/user/entityList.d.ts +12 -2
  202. package/dist/modules/user/entityList.js +47 -42
  203. package/dist/modules/user/favorites.d.ts +11 -2
  204. package/dist/modules/user/favorites.js +58 -50
  205. package/dist/modules/user/groupPermission.d.ts +11 -2
  206. package/dist/modules/user/groupPermission.js +60 -52
  207. package/dist/modules/user/language.d.ts +14 -2
  208. package/dist/modules/user/language.js +96 -82
  209. package/dist/modules/user/logout.d.ts +8 -2
  210. package/dist/modules/user/logout.js +21 -19
  211. package/dist/modules/user/maturityDates.d.ts +13 -2
  212. package/dist/modules/user/maturityDates.js +84 -72
  213. package/dist/modules/user/password.d.ts +9 -2
  214. package/dist/modules/user/password.js +32 -28
  215. package/dist/modules/user/paymentCondition.d.ts +14 -2
  216. package/dist/modules/user/paymentCondition.js +96 -82
  217. package/dist/modules/user/paymentMethods.d.ts +13 -2
  218. package/dist/modules/user/paymentMethods.js +84 -72
  219. package/dist/modules/user/permission.d.ts +11 -2
  220. package/dist/modules/user/permission.js +60 -52
  221. package/dist/modules/user/persona.d.ts +12 -2
  222. package/dist/modules/user/persona.js +72 -62
  223. package/dist/modules/user/provider.d.ts +17 -2
  224. package/dist/modules/user/provider.js +136 -116
  225. package/dist/modules/user/providerType.d.ts +14 -2
  226. package/dist/modules/user/providerType.js +96 -82
  227. package/dist/modules/user/purchaseCondition.d.ts +14 -2
  228. package/dist/modules/user/purchaseCondition.js +96 -82
  229. package/dist/modules/user/reasonForExemption.d.ts +14 -2
  230. package/dist/modules/user/reasonForExemption.js +96 -82
  231. package/dist/modules/user/refreshToken.d.ts +8 -2
  232. package/dist/modules/user/refreshToken.js +22 -20
  233. package/dist/modules/user/segmentsArea.d.ts +14 -2
  234. package/dist/modules/user/segmentsArea.js +96 -82
  235. package/dist/modules/user/sessions.d.ts +8 -2
  236. package/dist/modules/user/sessions.js +22 -20
  237. package/dist/modules/user/shippings.d.ts +14 -2
  238. package/dist/modules/user/shippings.js +96 -82
  239. package/dist/modules/user/socialMedia.d.ts +14 -2
  240. package/dist/modules/user/socialMedia.js +96 -82
  241. package/dist/modules/user/storeOperator.d.ts +16 -2
  242. package/dist/modules/user/storeOperator.js +122 -104
  243. package/dist/modules/user/swift.d.ts +14 -2
  244. package/dist/modules/user/swift.js +96 -82
  245. package/dist/modules/user/tenant.d.ts +11 -2
  246. package/dist/modules/user/tenant.js +58 -50
  247. package/dist/modules/user/user.d.ts +16 -2
  248. package/dist/modules/user/user.js +120 -102
  249. package/dist/modules/user/userPermission.d.ts +10 -2
  250. package/dist/modules/user/userPermission.js +48 -42
  251. package/dist/modules/user/userPositions.d.ts +14 -2
  252. package/dist/modules/user/userPositions.js +96 -82
  253. package/dist/modules/user/vehicles.d.ts +11 -2
  254. package/dist/modules/user/vehicles.js +58 -50
  255. package/dist/modules/user/zipCode.d.ts +9 -2
  256. package/dist/modules/user/zipCode.js +33 -29
  257. package/dist/modules/view/eventHistory.d.ts +8 -2
  258. package/dist/modules/view/eventHistory.js +22 -20
  259. package/package.json +4 -4
  260. package/dist/modules/documentManagement/index.d.ts +0 -3
  261. package/dist/modules/documentManagement/index.js +0 -13
  262. package/dist/modules/integration/index.d.ts +0 -3
  263. package/dist/modules/integration/index.js +0 -13
  264. package/dist/modules/print/index.d.ts +0 -3
  265. package/dist/modules/print/index.js +0 -13
  266. package/dist/modules/stock/index.d.ts +0 -3
  267. package/dist/modules/stock/index.js +0 -13
  268. package/dist/modules/tickets/index.d.ts +0 -3
  269. package/dist/modules/tickets/index.js +0 -13
  270. package/dist/modules/user/index.d.ts +0 -3
  271. package/dist/modules/user/index.js +0 -13
  272. package/dist/modules/user/userToken.d.ts +0 -9
  273. package/dist/modules/user/userToken.js +0 -116
  274. package/dist/modules/view/index.d.ts +0 -2
  275. package/dist/modules/view/index.js +0 -12
  276. package/dist/shared/client.d.ts +0 -7
  277. package/dist/shared/client.js +0 -24
@@ -1,4 +1,5 @@
1
1
  import { shared, DocumentLine as Entity, DocumentLineAssoc } from '@nomalism-com/types';
2
+ import { IModuleConstructor } from '../..';
2
3
  export import IDocumentLineVirtuals = Entity.IDocumentLineVirtuals;
3
4
  export import IDocumentLineBaseVirtuals = Entity.IDocumentLineBaseVirtuals;
4
5
  export import IFindByOwnerIdRequest = shared.IFindByOwnerIdRequest;
@@ -17,6 +18,20 @@ export import IFindUnallocatedStockResponse = Entity.IFindUnallocatedStockRespon
17
18
  export import IFindByDocumentLineStateRequest = Entity.IFindByDocumentLineStateRequest;
18
19
  export import IFindByDocumentLineStateResponse = Entity.IFindByDocumentLineStateResponse;
19
20
  export declare const IMetadataPlugins: typeof Entity.IMetadataPlugins;
20
- export declare const route: string;
21
- export declare const printLabelToPdfUrl: ({ document_line_ids }: IPrintLabelParamsRequest, token: string) => string;
22
- export declare const findById: (selector: shared.IFindByIdRequest) => Promise<import("@nomalism-com/types/dist/shared/entities").DocumentLine | null>, findByOwnerId: (params: shared.IFindByOwnerIdRequest) => Promise<import("@nomalism-com/types/dist/shared/entities").DocumentLine[]>, findUnallocatedStock: () => Promise<Entity.IFindUnallocatedStockResponse[]>, create: (data: Entity.ICreateRequest[]) => Promise<DocumentLineAssoc.IEntityWithDocumentLine[]>, update: (selector: shared.IFindByIdRequest, data: Entity.IUpdateRequest) => Promise<void>, updateIndexes: (document_line_ids: string[]) => Promise<void>, updateData: (data: Entity.IUpdateDataRequestWithoutStamps) => Promise<DocumentLineAssoc.IEntityWithDocumentLine[]>, updateMany: (data: Entity.IUpdateManyRequest) => Promise<void>, deleteMany: (document_line_ids: string[]) => Promise<void>;
21
+ export default class Repository implements Entity.IApi {
22
+ route: string;
23
+ publicRoute: string;
24
+ private api;
25
+ constructor({ api, route, publicRoute }: IModuleConstructor);
26
+ findByState(params: IFindByDocumentLineStateRequest): Promise<IFindByDocumentLineStateResponse[]>;
27
+ findById(selector: shared.IFindByIdRequest): Promise<IEntity | null>;
28
+ findByOwnerId(params?: IFindByOwnerIdRequest): Promise<IEntity[]>;
29
+ findUnallocatedStock(): Promise<IFindUnallocatedStockResponse[]>;
30
+ create(body: ICreateRequest[]): Promise<DocumentLineAssoc.IEntityWithDocumentLine[]>;
31
+ update(selector: shared.IFindByIdRequest, body: IUpdateRequest): Promise<void>;
32
+ updateIndexes(document_line_ids: string[]): Promise<void>;
33
+ updateData(data: IUpdateDataRequest): Promise<DocumentLineAssoc.IEntityWithDocumentLine[]>;
34
+ updateMany(data: IUpdateManyRequest): Promise<void>;
35
+ deleteMany(document_line_ids: string[]): Promise<void>;
36
+ printLabelToPdfUrl({ document_line_ids }: IPrintLabelParamsRequest, token: string): string;
37
+ }
@@ -35,130 +35,152 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
36
  }
37
37
  };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
38
  Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.deleteMany = exports.updateMany = exports.updateData = exports.updateIndexes = exports.update = exports.create = exports.findUnallocatedStock = exports.findByOwnerId = exports.findById = exports.printLabelToPdfUrl = exports.route = exports.IMetadataPlugins = void 0;
39
+ exports.IMetadataPlugins = void 0;
43
40
  var types_1 = require("@nomalism-com/types");
44
- var client_1 = __importDefault(require("../../shared/client"));
45
- var stock_1 = require("../stock");
46
41
  exports.IMetadataPlugins = types_1.DocumentLine.IMetadataPlugins;
47
- exports.route = "".concat(stock_1.serviceHostname).concat(stock_1.serviceAuthPath, "document_line/");
48
- var repository = {
49
- findByState: function (params) { return __awaiter(void 0, void 0, void 0, function () {
50
- var response;
51
- return __generator(this, function (_a) {
52
- switch (_a.label) {
53
- case 0: return [4, client_1.default.get("".concat(exports.route, "find_by_state"), { params: params })];
54
- case 1:
55
- response = _a.sent();
56
- return [2, response.data];
57
- }
42
+ var Repository = (function () {
43
+ function Repository(_a) {
44
+ var api = _a.api, route = _a.route, publicRoute = _a.publicRoute;
45
+ this.api = api;
46
+ this.route = route;
47
+ this.publicRoute = publicRoute;
48
+ }
49
+ Repository.prototype.findByState = function (params) {
50
+ return __awaiter(this, void 0, void 0, function () {
51
+ var response;
52
+ return __generator(this, function (_a) {
53
+ switch (_a.label) {
54
+ case 0: return [4, this.api.get("".concat(this.route, "find_by_state"), {
55
+ params: params,
56
+ })];
57
+ case 1:
58
+ response = _a.sent();
59
+ return [2, response.data];
60
+ }
61
+ });
58
62
  });
59
- }); },
60
- findById: function (selector) { return __awaiter(void 0, void 0, void 0, function () {
61
- var response;
62
- return __generator(this, function (_a) {
63
- switch (_a.label) {
64
- case 0: return [4, client_1.default.get("".concat(exports.route).concat(selector.id))];
65
- case 1:
66
- response = _a.sent();
67
- return [2, response.data];
68
- }
63
+ };
64
+ Repository.prototype.findById = function (selector) {
65
+ return __awaiter(this, void 0, void 0, function () {
66
+ var response;
67
+ return __generator(this, function (_a) {
68
+ switch (_a.label) {
69
+ case 0: return [4, this.api.get("".concat(this.route).concat(selector.id))];
70
+ case 1:
71
+ response = _a.sent();
72
+ return [2, response.data];
73
+ }
74
+ });
69
75
  });
70
- }); },
71
- findByOwnerId: function (params) { return __awaiter(void 0, void 0, void 0, function () {
72
- var response;
73
- return __generator(this, function (_a) {
74
- switch (_a.label) {
75
- case 0: return [4, client_1.default.get("".concat(exports.route, "by_owner"), { params: params })];
76
- case 1:
77
- response = _a.sent();
78
- return [2, response.data];
79
- }
76
+ };
77
+ Repository.prototype.findByOwnerId = function (params) {
78
+ return __awaiter(this, void 0, void 0, function () {
79
+ var response;
80
+ return __generator(this, function (_a) {
81
+ switch (_a.label) {
82
+ case 0: return [4, this.api.get("".concat(this.route, "by_owner"), { params: params })];
83
+ case 1:
84
+ response = _a.sent();
85
+ return [2, response.data];
86
+ }
87
+ });
80
88
  });
81
- }); },
82
- findUnallocatedStock: function () { return __awaiter(void 0, void 0, void 0, function () {
83
- var response;
84
- return __generator(this, function (_a) {
85
- switch (_a.label) {
86
- case 0: return [4, client_1.default.get("".concat(exports.route, "unallocated_stock"))];
87
- case 1:
88
- response = _a.sent();
89
- return [2, response.data];
90
- }
89
+ };
90
+ Repository.prototype.findUnallocatedStock = function () {
91
+ return __awaiter(this, void 0, void 0, function () {
92
+ var response;
93
+ return __generator(this, function (_a) {
94
+ switch (_a.label) {
95
+ case 0: return [4, this.api.get("".concat(this.route, "unallocated_stock"))];
96
+ case 1:
97
+ response = _a.sent();
98
+ return [2, response.data];
99
+ }
100
+ });
91
101
  });
92
- }); },
93
- create: function (body) { return __awaiter(void 0, void 0, void 0, function () {
94
- var response;
95
- return __generator(this, function (_a) {
96
- switch (_a.label) {
97
- case 0: return [4, client_1.default.post("".concat(exports.route), body)];
98
- case 1:
99
- response = _a.sent();
100
- return [2, response.data];
101
- }
102
+ };
103
+ Repository.prototype.create = function (body) {
104
+ return __awaiter(this, void 0, void 0, function () {
105
+ var response;
106
+ return __generator(this, function (_a) {
107
+ switch (_a.label) {
108
+ case 0: return [4, this.api.post("".concat(this.route), body)];
109
+ case 1:
110
+ response = _a.sent();
111
+ return [2, response.data];
112
+ }
113
+ });
102
114
  });
103
- }); },
104
- update: function (selector, body) { return __awaiter(void 0, void 0, void 0, function () {
105
- return __generator(this, function (_a) {
106
- switch (_a.label) {
107
- case 0: return [4, client_1.default.put("".concat(exports.route).concat(selector.id), body)];
108
- case 1:
109
- _a.sent();
110
- return [2];
111
- }
115
+ };
116
+ Repository.prototype.update = function (selector, body) {
117
+ return __awaiter(this, void 0, void 0, function () {
118
+ return __generator(this, function (_a) {
119
+ switch (_a.label) {
120
+ case 0: return [4, this.api.put("".concat(this.route).concat(selector.id), body)];
121
+ case 1:
122
+ _a.sent();
123
+ return [2];
124
+ }
125
+ });
112
126
  });
113
- }); },
114
- updateIndexes: function (document_line_ids) { return __awaiter(void 0, void 0, void 0, function () {
115
- return __generator(this, function (_a) {
116
- switch (_a.label) {
117
- case 0: return [4, client_1.default.put("".concat(exports.route, "update_indexes"), document_line_ids)];
118
- case 1:
119
- _a.sent();
120
- return [2];
121
- }
127
+ };
128
+ Repository.prototype.updateIndexes = function (document_line_ids) {
129
+ return __awaiter(this, void 0, void 0, function () {
130
+ return __generator(this, function (_a) {
131
+ switch (_a.label) {
132
+ case 0: return [4, this.api.put("".concat(this.route, "update_indexes"), document_line_ids)];
133
+ case 1:
134
+ _a.sent();
135
+ return [2];
136
+ }
137
+ });
122
138
  });
123
- }); },
124
- updateData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
125
- var response;
126
- return __generator(this, function (_a) {
127
- switch (_a.label) {
128
- case 0: return [4, client_1.default.post("".concat(exports.route, "update_data"), data)];
129
- case 1:
130
- response = _a.sent();
131
- return [2, response.data];
132
- }
139
+ };
140
+ Repository.prototype.updateData = function (data) {
141
+ return __awaiter(this, void 0, void 0, function () {
142
+ var response;
143
+ return __generator(this, function (_a) {
144
+ switch (_a.label) {
145
+ case 0: return [4, this.api.post("".concat(this.route, "update_data"), data)];
146
+ case 1:
147
+ response = _a.sent();
148
+ return [2, response.data];
149
+ }
150
+ });
133
151
  });
134
- }); },
135
- updateMany: function (data) { return __awaiter(void 0, void 0, void 0, function () {
136
- var response;
137
- return __generator(this, function (_a) {
138
- switch (_a.label) {
139
- case 0: return [4, client_1.default.post("".concat(exports.route, "update_many"), data)];
140
- case 1:
141
- response = _a.sent();
142
- return [2, response.data];
143
- }
152
+ };
153
+ Repository.prototype.updateMany = function (data) {
154
+ return __awaiter(this, void 0, void 0, function () {
155
+ var response;
156
+ return __generator(this, function (_a) {
157
+ switch (_a.label) {
158
+ case 0: return [4, this.api.post("".concat(this.route, "update_many"), data)];
159
+ case 1:
160
+ response = _a.sent();
161
+ return [2, response.data];
162
+ }
163
+ });
144
164
  });
145
- }); },
146
- deleteMany: function (document_line_ids) { return __awaiter(void 0, void 0, void 0, function () {
147
- return __generator(this, function (_a) {
148
- switch (_a.label) {
149
- case 0: return [4, client_1.default.delete("".concat(exports.route), { data: document_line_ids })];
150
- case 1:
151
- _a.sent();
152
- return [2];
153
- }
165
+ };
166
+ Repository.prototype.deleteMany = function (document_line_ids) {
167
+ return __awaiter(this, void 0, void 0, function () {
168
+ return __generator(this, function (_a) {
169
+ switch (_a.label) {
170
+ case 0: return [4, this.api.delete("".concat(this.route), { data: document_line_ids })];
171
+ case 1:
172
+ _a.sent();
173
+ return [2];
174
+ }
175
+ });
154
176
  });
155
- }); },
156
- };
157
- var printLabelToPdfUrl = function (_a, token) {
158
- var document_line_ids = _a.document_line_ids;
159
- var qs = new URLSearchParams();
160
- qs.set('token', token);
161
- return "".concat(exports.route, "print_label_pdf/").concat(document_line_ids, "?").concat(qs.toString());
162
- };
163
- exports.printLabelToPdfUrl = printLabelToPdfUrl;
164
- exports.findById = repository.findById, exports.findByOwnerId = repository.findByOwnerId, exports.findUnallocatedStock = repository.findUnallocatedStock, exports.create = repository.create, exports.update = repository.update, exports.updateIndexes = repository.updateIndexes, exports.updateData = repository.updateData, exports.updateMany = repository.updateMany, exports.deleteMany = repository.deleteMany;
177
+ };
178
+ Repository.prototype.printLabelToPdfUrl = function (_a, token) {
179
+ var document_line_ids = _a.document_line_ids;
180
+ var qs = new URLSearchParams();
181
+ qs.set('token', token);
182
+ return "".concat(this.route, "print_label_pdf/").concat(document_line_ids, "?").concat(qs.toString());
183
+ };
184
+ return Repository;
185
+ }());
186
+ exports.default = Repository;
@@ -1,4 +1,5 @@
1
1
  import { shared, DocumentLineAssoc as Entity } from '@nomalism-com/types';
2
+ import { IModuleConstructor } from '../..';
2
3
  export import IEntity = Entity.Entity;
3
4
  export import IEntityWithDocumentLine = Entity.IEntityWithDocumentLine;
4
5
  export import IFindByOwnerIdRequest = shared.IFindByOwnerIdRequest;
@@ -6,5 +7,13 @@ export import IEntityExtended = Entity.IEntityExtended;
6
7
  export import ICreateRequest = Entity.ICreateRequest;
7
8
  export import IUpdateRequest = Entity.IUpdateRequest;
8
9
  export import IDeleteInventoryLossRequest = Entity.IDeleteInventoryLossRequest;
9
- export declare const route: string;
10
- export declare const findByOwnerId: (data: shared.IFindByOwnerIdRequest) => Promise<Entity.IEntityExtended[]>, create: (data: Entity.ICreateRequest[]) => Promise<Entity.IEntityWithDocumentLine[]>, update: (selector: shared.IFindByIdRequest, data: Entity.IUpdateRequest) => Promise<Entity.IEntityWithDocumentLine>, deleteInventoryLosses: (data: Entity.IDeleteInventoryLossRequest) => Promise<void>;
10
+ export default class Repository implements Entity.IApi {
11
+ route: string;
12
+ publicRoute: string;
13
+ private api;
14
+ constructor({ api, route, publicRoute }: IModuleConstructor);
15
+ findByOwnerId(params?: IFindByOwnerIdRequest): Promise<IEntityExtended[]>;
16
+ create(body: ICreateRequest[]): Promise<IEntityWithDocumentLine[]>;
17
+ update(selector: shared.IFindByIdRequest, body: IUpdateRequest): Promise<IEntityWithDocumentLine>;
18
+ deleteInventoryLosses(data: IDeleteInventoryLossRequest): Promise<void>;
19
+ }
@@ -35,57 +35,65 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
36
  }
37
37
  };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
38
  Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.deleteInventoryLosses = exports.update = exports.create = exports.findByOwnerId = exports.route = void 0;
43
- var client_1 = __importDefault(require("../../shared/client"));
44
- var stock_1 = require("../stock");
45
- exports.route = "".concat(stock_1.serviceHostname).concat(stock_1.serviceAuthPath, "document_line_assoc/");
46
- var repository = {
47
- findByOwnerId: function (params) { return __awaiter(void 0, void 0, void 0, function () {
48
- var response;
49
- return __generator(this, function (_a) {
50
- switch (_a.label) {
51
- case 0: return [4, client_1.default.get("".concat(exports.route, "by_owner"), { params: params })];
52
- case 1:
53
- response = _a.sent();
54
- return [2, response.data];
55
- }
39
+ var Repository = (function () {
40
+ function Repository(_a) {
41
+ var api = _a.api, route = _a.route, publicRoute = _a.publicRoute;
42
+ this.api = api;
43
+ this.route = route;
44
+ this.publicRoute = publicRoute;
45
+ }
46
+ Repository.prototype.findByOwnerId = function (params) {
47
+ return __awaiter(this, void 0, void 0, function () {
48
+ var response;
49
+ return __generator(this, function (_a) {
50
+ switch (_a.label) {
51
+ case 0: return [4, this.api.get("".concat(this.route, "by_owner"), { params: params })];
52
+ case 1:
53
+ response = _a.sent();
54
+ return [2, response.data];
55
+ }
56
+ });
56
57
  });
57
- }); },
58
- create: function (body) { return __awaiter(void 0, void 0, void 0, function () {
59
- var response;
60
- return __generator(this, function (_a) {
61
- switch (_a.label) {
62
- case 0: return [4, client_1.default.post("".concat(exports.route), body)];
63
- case 1:
64
- response = _a.sent();
65
- return [2, response.data];
66
- }
58
+ };
59
+ Repository.prototype.create = function (body) {
60
+ return __awaiter(this, void 0, void 0, function () {
61
+ var response;
62
+ return __generator(this, function (_a) {
63
+ switch (_a.label) {
64
+ case 0: return [4, this.api.post("".concat(this.route), body)];
65
+ case 1:
66
+ response = _a.sent();
67
+ return [2, response.data];
68
+ }
69
+ });
67
70
  });
68
- }); },
69
- update: function (selector, body) { return __awaiter(void 0, void 0, void 0, function () {
70
- var response;
71
- return __generator(this, function (_a) {
72
- switch (_a.label) {
73
- case 0: return [4, client_1.default.put("".concat(exports.route).concat(selector.id), body)];
74
- case 1:
75
- response = _a.sent();
76
- return [2, response.data];
77
- }
71
+ };
72
+ Repository.prototype.update = function (selector, body) {
73
+ return __awaiter(this, void 0, void 0, function () {
74
+ var response;
75
+ return __generator(this, function (_a) {
76
+ switch (_a.label) {
77
+ case 0: return [4, this.api.put("".concat(this.route).concat(selector.id), body)];
78
+ case 1:
79
+ response = _a.sent();
80
+ return [2, response.data];
81
+ }
82
+ });
78
83
  });
79
- }); },
80
- deleteInventoryLosses: function (data) { 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, "inventory_loss"), { data: data })];
84
- case 1:
85
- _a.sent();
86
- return [2];
87
- }
84
+ };
85
+ Repository.prototype.deleteInventoryLosses = function (data) {
86
+ return __awaiter(this, void 0, void 0, function () {
87
+ return __generator(this, function (_a) {
88
+ switch (_a.label) {
89
+ case 0: return [4, this.api.delete("".concat(this.route, "inventory_loss"), { data: data })];
90
+ case 1:
91
+ _a.sent();
92
+ return [2];
93
+ }
94
+ });
88
95
  });
89
- }); },
90
- };
91
- exports.findByOwnerId = repository.findByOwnerId, exports.create = repository.create, exports.update = repository.update, exports.deleteInventoryLosses = repository.deleteInventoryLosses;
96
+ };
97
+ return Repository;
98
+ }());
99
+ exports.default = Repository;
@@ -1,7 +1,16 @@
1
1
  import { shared, DocumentLineFolder as Entity } from '@nomalism-com/types';
2
+ import { IModuleConstructor } from '../..';
2
3
  export import IFindByOwnerIdRequest = shared.IFindByOwnerIdRequest;
3
4
  export import ICreateRequest = Entity.ICreateRequest;
4
5
  export import IUpdateRequest = Entity.IUpdateRequest;
5
6
  export import IEntity = Entity.Entity;
6
- export declare const route: string;
7
- export declare const findByOwnerId: (data: shared.IFindByOwnerIdRequest) => Promise<import("@nomalism-com/types/dist/shared/entities").DocumentLineFolder[]>, create: (data: Entity.ICreateRequest) => Promise<import("@nomalism-com/types/dist/shared/entities").DocumentLineFolder>, update: (selector: shared.IFindByIdRequest, data: Entity.IUpdateRequest) => Promise<import("@nomalism-com/types/dist/shared/entities").DocumentLineFolder | null>, deleteOne: (selector: shared.IFindByIdRequest) => Promise<import("@nomalism-com/types/dist/shared/entities").DocumentLineFolder | null>;
7
+ export default class Repository implements Entity.IApi {
8
+ route: string;
9
+ publicRoute: string;
10
+ private api;
11
+ constructor({ api, route, publicRoute }: IModuleConstructor);
12
+ findByOwnerId(params?: IFindByOwnerIdRequest): Promise<Entity.Entity[]>;
13
+ create(body: ICreateRequest): Promise<Entity.Entity>;
14
+ update(selector: shared.IFindByIdRequest, body: IUpdateRequest): Promise<IEntity | null>;
15
+ deleteOne(selector: shared.IFindByIdRequest): Promise<IEntity | null>;
16
+ }
@@ -35,58 +35,66 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
36
  }
37
37
  };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
38
  Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.deleteOne = exports.update = exports.create = exports.findByOwnerId = exports.route = void 0;
43
- var client_1 = __importDefault(require("../../shared/client"));
44
- var stock_1 = require("../stock");
45
- exports.route = "".concat(stock_1.serviceHostname).concat(stock_1.serviceAuthPath, "document_line_folder/");
46
- var repository = {
47
- findByOwnerId: function (params) { return __awaiter(void 0, void 0, void 0, function () {
48
- var response;
49
- return __generator(this, function (_a) {
50
- switch (_a.label) {
51
- case 0: return [4, client_1.default.get("".concat(exports.route, "by_owner"), { params: params })];
52
- case 1:
53
- response = _a.sent();
54
- return [2, response.data];
55
- }
39
+ var Repository = (function () {
40
+ function Repository(_a) {
41
+ var api = _a.api, route = _a.route, publicRoute = _a.publicRoute;
42
+ this.api = api;
43
+ this.route = route;
44
+ this.publicRoute = publicRoute;
45
+ }
46
+ Repository.prototype.findByOwnerId = function (params) {
47
+ return __awaiter(this, void 0, void 0, function () {
48
+ var response;
49
+ return __generator(this, function (_a) {
50
+ switch (_a.label) {
51
+ case 0: return [4, this.api.get("".concat(this.route, "by_owner"), { params: params })];
52
+ case 1:
53
+ response = _a.sent();
54
+ return [2, response.data];
55
+ }
56
+ });
56
57
  });
57
- }); },
58
- create: function (body) { return __awaiter(void 0, void 0, void 0, function () {
59
- var response;
60
- return __generator(this, function (_a) {
61
- switch (_a.label) {
62
- case 0: return [4, client_1.default.post("".concat(exports.route), body)];
63
- case 1:
64
- response = _a.sent();
65
- return [2, response.data];
66
- }
58
+ };
59
+ Repository.prototype.create = function (body) {
60
+ return __awaiter(this, void 0, void 0, function () {
61
+ var response;
62
+ return __generator(this, function (_a) {
63
+ switch (_a.label) {
64
+ case 0: return [4, this.api.post("".concat(this.route), body)];
65
+ case 1:
66
+ response = _a.sent();
67
+ return [2, response.data];
68
+ }
69
+ });
67
70
  });
68
- }); },
69
- update: function (selector, body) { return __awaiter(void 0, void 0, void 0, function () {
70
- var response;
71
- return __generator(this, function (_a) {
72
- switch (_a.label) {
73
- case 0: return [4, client_1.default.put("".concat(exports.route).concat(selector.id), body)];
74
- case 1:
75
- response = _a.sent();
76
- return [2, response.data];
77
- }
71
+ };
72
+ Repository.prototype.update = function (selector, body) {
73
+ return __awaiter(this, void 0, void 0, function () {
74
+ var response;
75
+ return __generator(this, function (_a) {
76
+ switch (_a.label) {
77
+ case 0: return [4, this.api.put("".concat(this.route).concat(selector.id), body)];
78
+ case 1:
79
+ response = _a.sent();
80
+ return [2, response.data];
81
+ }
82
+ });
78
83
  });
79
- }); },
80
- deleteOne: function (selector) { return __awaiter(void 0, void 0, void 0, function () {
81
- var response;
82
- return __generator(this, function (_a) {
83
- switch (_a.label) {
84
- case 0: return [4, client_1.default.delete("".concat(exports.route).concat(selector.id))];
85
- case 1:
86
- response = _a.sent();
87
- return [2, response.data];
88
- }
84
+ };
85
+ Repository.prototype.deleteOne = function (selector) {
86
+ return __awaiter(this, void 0, void 0, function () {
87
+ var response;
88
+ return __generator(this, function (_a) {
89
+ switch (_a.label) {
90
+ case 0: return [4, this.api.delete("".concat(this.route).concat(selector.id))];
91
+ case 1:
92
+ response = _a.sent();
93
+ return [2, response.data];
94
+ }
95
+ });
89
96
  });
90
- }); },
91
- };
92
- exports.findByOwnerId = repository.findByOwnerId, exports.create = repository.create, exports.update = repository.update, exports.deleteOne = repository.deleteOne;
97
+ };
98
+ return Repository;
99
+ }());
100
+ exports.default = Repository;
@@ -1,8 +1,19 @@
1
1
  import { DocumentSet as Entity, shared } from '@nomalism-com/types';
2
+ import { IModuleConstructor } from '../..';
2
3
  export import IEntity = Entity.Entity;
3
4
  export import IFindMinifiedRequest = shared.IFindMinifiedRequest;
4
5
  export import IFindMinifiedResponse = shared.IFindMinifiedResponse;
5
6
  export import ICreateRequest = Entity.ICreateRequest;
6
7
  export import IUpdateRequest = Entity.IUpdateRequest;
7
- export declare const route: string;
8
- export declare const find: () => Promise<import("@nomalism-com/types/dist/shared/entities").DocumentSet[]>, findById: (selector: shared.IFindByIdRequest) => Promise<import("@nomalism-com/types/dist/shared/entities").DocumentSet | null>, findMinified: (params?: shared.IFindMinifiedRequest | undefined) => Promise<shared.IFindMinifiedResponse[]>, create: (data: Entity.ICreateRequest) => Promise<import("@nomalism-com/types/dist/shared/entities").DocumentSet>, update: (selector: shared.IFindByIdRequest, data: Entity.IUpdateRequest) => Promise<import("@nomalism-com/types/dist/shared/entities").DocumentSet | null>, deleteOne: (selector: shared.IFindByIdRequest) => Promise<import("@nomalism-com/types/dist/shared/entities").DocumentSet | null>;
8
+ export default class Repository implements Entity.IRepository {
9
+ route: string;
10
+ publicRoute: string;
11
+ private api;
12
+ constructor({ api, route, publicRoute }: IModuleConstructor);
13
+ find(): Promise<IEntity[]>;
14
+ findById(selector: shared.IFindByIdRequest): Promise<IEntity | null>;
15
+ findMinified(params?: IFindMinifiedRequest): Promise<IFindMinifiedResponse[]>;
16
+ create(body: ICreateRequest): Promise<IEntity>;
17
+ update(selector: shared.IFindByIdRequest, body: IUpdateRequest): Promise<IEntity | null>;
18
+ deleteOne(selector: shared.IFindByIdRequest): Promise<IEntity | null>;
19
+ }