@nomalism-com/api 0.8.17 → 0.8.19
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/.editorconfig +9 -0
- package/.eslintignore +3 -0
- package/.eslintrc.json +51 -0
- package/.nvmrc +1 -0
- package/package-lock.json +6181 -0
- package/package.json +7 -12
- package/prettier.config.js +5 -0
- package/{dist/index.d.ts → src/index.ts} +118 -1
- package/src/modules/documentManagement/index.ts +6 -0
- package/src/modules/documentManagement/multimedia.ts +33 -0
- package/src/modules/integration/dynamicData.ts +45 -0
- package/src/modules/integration/field.ts +38 -0
- package/src/modules/integration/fieldGroup.ts +68 -0
- package/src/modules/integration/file.ts +30 -0
- package/src/modules/integration/history.ts +30 -0
- package/src/modules/integration/index.ts +6 -0
- package/src/modules/integration/observation.ts +43 -0
- package/src/modules/integration/observationType.ts +55 -0
- package/src/modules/integration/task.ts +66 -0
- package/src/modules/integration/taskAttachment.ts +26 -0
- package/src/modules/integration/taskGroup.ts +45 -0
- package/src/modules/integration/taskNote.ts +39 -0
- package/src/modules/print/index.ts +10 -0
- package/src/modules/print/npc.ts +24 -0
- package/src/modules/print/printer.ts +26 -0
- package/src/modules/print/schedulePrintJob.ts +75 -0
- package/src/modules/stock/attribute.ts +101 -0
- package/src/modules/stock/attributeValue.ts +91 -0
- package/src/modules/stock/cabide.ts +105 -0
- package/src/modules/stock/cabideProduct.ts +67 -0
- package/src/modules/stock/clientCurrentAccount.ts +22 -0
- package/src/modules/stock/color.ts +90 -0
- package/src/modules/stock/composition.ts +81 -0
- package/src/modules/stock/compositionMaterial.ts +92 -0
- package/src/modules/stock/documentHeader.ts +324 -0
- package/src/modules/stock/documentLine.ts +89 -0
- package/src/modules/stock/documentLineAssoc.ts +117 -0
- package/src/modules/stock/documentLineFolder.ts +43 -0
- package/src/modules/stock/documentLineState.ts +66 -0
- package/src/modules/stock/documentLineStateCriteria.ts +90 -0
- package/src/modules/stock/documentSet.ts +53 -0
- package/src/modules/stock/documentType.ts +68 -0
- package/src/modules/stock/externalDocumentHeader.ts +85 -0
- package/src/modules/stock/externalDocumentType.ts +26 -0
- package/src/modules/stock/index.ts +8 -0
- package/src/modules/stock/location.ts +91 -0
- package/src/modules/stock/maintenance.ts +91 -0
- package/src/modules/stock/maintenanceAssoc.ts +81 -0
- package/src/modules/stock/maintenancePreset.ts +55 -0
- package/src/modules/stock/maintenancePresetAssoc.ts +42 -0
- package/src/modules/stock/maintenanceType.ts +92 -0
- package/src/modules/stock/moloniRequest.ts +18 -0
- package/src/modules/stock/orderManagement.ts +41 -0
- package/src/modules/stock/payment.ts +161 -0
- package/src/modules/stock/plot.ts +196 -0
- package/src/modules/stock/preSale.ts +76 -0
- package/src/modules/stock/preSaleProduct.ts +23 -0
- package/src/modules/stock/primaryColor.ts +92 -0
- package/src/modules/stock/product.ts +197 -0
- package/src/modules/stock/productAttribute.ts +81 -0
- package/src/modules/stock/productCategory.ts +92 -0
- package/src/modules/stock/productColor.ts +81 -0
- package/src/modules/stock/productImage.ts +86 -0
- package/src/modules/stock/productName.ts +92 -0
- package/src/modules/stock/productNamePreset.ts +92 -0
- package/src/modules/stock/productPart.ts +91 -0
- package/src/modules/stock/productSubCategory.ts +90 -0
- package/src/modules/stock/productUse.ts +92 -0
- package/src/modules/stock/productUseAssoc.ts +78 -0
- package/src/modules/stock/promotion.ts +93 -0
- package/src/modules/stock/promotionAssoc.ts +81 -0
- package/src/modules/stock/providerCurrentAccount.ts +22 -0
- package/src/modules/stock/queryList.ts +61 -0
- package/src/modules/stock/queryParameter.ts +50 -0
- package/src/modules/stock/returnReason.ts +40 -0
- package/src/modules/stock/similarProduct.ts +81 -0
- package/src/modules/stock/stockMovement.ts +32 -0
- package/src/modules/stock/topMenu.ts +22 -0
- package/src/modules/stock/typeOfInventory.ts +92 -0
- package/src/modules/stock/typeOfLocation.ts +92 -0
- package/src/modules/stock/unitOfMeasure.ts +92 -0
- package/src/modules/stock/vatTax.ts +92 -0
- package/src/modules/stock/vatTaxZone.ts +94 -0
- package/src/modules/stock/vatValidation.ts +20 -0
- package/src/modules/stock/websiteRequest.ts +51 -0
- package/src/modules/stock/workflow.ts +50 -0
- package/src/modules/user/address.ts +81 -0
- package/src/modules/user/bankData.ts +81 -0
- package/src/modules/user/clientType.ts +80 -0
- package/src/modules/user/clients.ts +100 -0
- package/src/modules/user/commissioner.ts +96 -0
- package/src/modules/user/contactTypes.ts +80 -0
- package/src/modules/user/contacts.ts +100 -0
- package/src/modules/user/country.ts +90 -0
- package/src/modules/user/deliveryMethods.ts +60 -0
- package/src/modules/user/entityList.ts +42 -0
- package/src/modules/user/favorites.ts +36 -0
- package/src/modules/user/groupPermission.ts +44 -0
- package/src/modules/user/index.ts +8 -0
- package/src/modules/user/language.ts +80 -0
- package/src/modules/user/logout.ts +12 -0
- package/src/modules/user/maturityDates.ts +60 -0
- package/src/modules/user/password.ts +21 -0
- package/src/modules/user/paymentCondition.ts +79 -0
- package/src/modules/user/paymentMethods.ts +60 -0
- package/src/modules/user/permission.ts +44 -0
- package/src/modules/user/provider.ts +106 -0
- package/src/modules/user/providerType.ts +80 -0
- package/src/modules/user/purchaseCondition.ts +82 -0
- package/src/modules/user/reasonForExemption.ts +80 -0
- package/src/modules/user/refreshToken.ts +18 -0
- package/src/modules/user/segmentsArea.ts +80 -0
- package/src/modules/user/sessions.ts +18 -0
- package/src/modules/user/shippings.ts +79 -0
- package/src/modules/user/socialMedia.ts +79 -0
- package/src/modules/user/storeOperator.ts +104 -0
- package/src/modules/user/swift.ts +80 -0
- package/src/modules/user/tenant.ts +36 -0
- package/src/modules/user/user.ts +111 -0
- package/src/modules/user/userPermission.ts +37 -0
- package/src/modules/user/userPositions.ts +80 -0
- package/src/modules/user/userToken.ts +69 -0
- package/src/modules/user/vehicles.ts +40 -0
- package/src/modules/user/zipCode.ts +23 -0
- package/src/shared/client.ts +5 -0
- package/tsconfig.json +19 -0
- package/dist/index.js +0 -256
- package/dist/modules/documentManagement/index.d.ts +0 -2
- package/dist/modules/documentManagement/index.js +0 -7
- package/dist/modules/documentManagement/multimedia.d.ts +0 -5
- package/dist/modules/documentManagement/multimedia.js +0 -69
- package/dist/modules/integration/dynamicData.d.ts +0 -8
- package/dist/modules/integration/dynamicData.js +0 -103
- package/dist/modules/integration/field.d.ts +0 -26
- package/dist/modules/integration/field.js +0 -93
- package/dist/modules/integration/fieldGroup.d.ts +0 -12
- package/dist/modules/integration/fieldGroup.js +0 -119
- package/dist/modules/integration/file.d.ts +0 -5
- package/dist/modules/integration/file.js +0 -83
- package/dist/modules/integration/history.d.ts +0 -11
- package/dist/modules/integration/history.js +0 -66
- package/dist/modules/integration/index.d.ts +0 -2
- package/dist/modules/integration/index.js +0 -7
- package/dist/modules/integration/observation.d.ts +0 -8
- package/dist/modules/integration/observation.js +0 -94
- package/dist/modules/integration/observationType.d.ts +0 -10
- package/dist/modules/integration/observationType.js +0 -107
- package/dist/modules/integration/task.d.ts +0 -10
- package/dist/modules/integration/task.js +0 -113
- package/dist/modules/integration/taskAttachment.d.ts +0 -7
- package/dist/modules/integration/taskAttachment.js +0 -72
- package/dist/modules/integration/taskGroup.d.ts +0 -8
- package/dist/modules/integration/taskGroup.js +0 -103
- package/dist/modules/integration/taskNote.d.ts +0 -8
- package/dist/modules/integration/taskNote.js +0 -92
- package/dist/modules/print/index.d.ts +0 -4
- package/dist/modules/print/index.js +0 -9
- package/dist/modules/print/npc.d.ts +0 -5
- package/dist/modules/print/npc.js +0 -70
- package/dist/modules/print/printer.d.ts +0 -6
- package/dist/modules/print/printer.js +0 -70
- package/dist/modules/print/schedulePrintJob.d.ts +0 -8
- package/dist/modules/print/schedulePrintJob.js +0 -139
- package/dist/modules/stock/attribute.d.ts +0 -16
- package/dist/modules/stock/attribute.js +0 -145
- package/dist/modules/stock/attributeValue.d.ts +0 -12
- package/dist/modules/stock/attributeValue.js +0 -140
- package/dist/modules/stock/cabide.d.ts +0 -15
- package/dist/modules/stock/cabide.js +0 -152
- package/dist/modules/stock/cabideProduct.d.ts +0 -10
- package/dist/modules/stock/cabideProduct.js +0 -127
- package/dist/modules/stock/clientCurrentAccount.d.ts +0 -5
- package/dist/modules/stock/clientCurrentAccount.js +0 -61
- package/dist/modules/stock/color.d.ts +0 -13
- package/dist/modules/stock/color.js +0 -139
- package/dist/modules/stock/composition.d.ts +0 -12
- package/dist/modules/stock/composition.js +0 -127
- package/dist/modules/stock/compositionMaterial.d.ts +0 -13
- package/dist/modules/stock/compositionMaterial.js +0 -140
- package/dist/modules/stock/documentHeader.d.ts +0 -45
- package/dist/modules/stock/documentHeader.js +0 -361
- package/dist/modules/stock/documentLine.d.ts +0 -14
- package/dist/modules/stock/documentLine.js +0 -123
- package/dist/modules/stock/documentLineAssoc.d.ts +0 -20
- package/dist/modules/stock/documentLineAssoc.js +0 -154
- package/dist/modules/stock/documentLineFolder.d.ts +0 -6
- package/dist/modules/stock/documentLineFolder.js +0 -92
- package/dist/modules/stock/documentLineState.d.ts +0 -10
- package/dist/modules/stock/documentLineState.js +0 -114
- package/dist/modules/stock/documentLineStateCriteria.d.ts +0 -20
- package/dist/modules/stock/documentLineStateCriteria.js +0 -124
- package/dist/modules/stock/documentSet.d.ts +0 -8
- package/dist/modules/stock/documentSet.js +0 -114
- package/dist/modules/stock/documentType.d.ts +0 -14
- package/dist/modules/stock/documentType.js +0 -119
- package/dist/modules/stock/externalDocumentHeader.d.ts +0 -15
- package/dist/modules/stock/externalDocumentHeader.js +0 -135
- package/dist/modules/stock/externalDocumentType.d.ts +0 -6
- package/dist/modules/stock/externalDocumentType.js +0 -70
- package/dist/modules/stock/index.d.ts +0 -3
- package/dist/modules/stock/index.js +0 -8
- package/dist/modules/stock/location.d.ts +0 -12
- package/dist/modules/stock/location.js +0 -140
- package/dist/modules/stock/maintenance.d.ts +0 -12
- package/dist/modules/stock/maintenance.js +0 -140
- package/dist/modules/stock/maintenanceAssoc.d.ts +0 -12
- package/dist/modules/stock/maintenanceAssoc.js +0 -127
- package/dist/modules/stock/maintenancePreset.d.ts +0 -10
- package/dist/modules/stock/maintenancePreset.js +0 -114
- package/dist/modules/stock/maintenancePresetAssoc.d.ts +0 -8
- package/dist/modules/stock/maintenancePresetAssoc.js +0 -91
- package/dist/modules/stock/maintenanceType.d.ts +0 -13
- package/dist/modules/stock/maintenanceType.js +0 -140
- package/dist/modules/stock/moloniRequest.d.ts +0 -5
- package/dist/modules/stock/moloniRequest.js +0 -59
- package/dist/modules/stock/orderManagement.d.ts +0 -11
- package/dist/modules/stock/orderManagement.js +0 -88
- package/dist/modules/stock/payment.d.ts +0 -22
- package/dist/modules/stock/payment.js +0 -210
- package/dist/modules/stock/plot.d.ts +0 -32
- package/dist/modules/stock/plot.js +0 -240
- package/dist/modules/stock/preSale.d.ts +0 -11
- package/dist/modules/stock/preSale.js +0 -125
- package/dist/modules/stock/preSaleProduct.d.ts +0 -4
- package/dist/modules/stock/preSaleProduct.js +0 -70
- package/dist/modules/stock/primaryColor.d.ts +0 -13
- package/dist/modules/stock/primaryColor.js +0 -140
- package/dist/modules/stock/product.d.ts +0 -30
- package/dist/modules/stock/product.js +0 -241
- package/dist/modules/stock/productAttribute.d.ts +0 -12
- package/dist/modules/stock/productAttribute.js +0 -127
- package/dist/modules/stock/productCategory.d.ts +0 -13
- package/dist/modules/stock/productCategory.js +0 -140
- package/dist/modules/stock/productColor.d.ts +0 -12
- package/dist/modules/stock/productColor.js +0 -127
- package/dist/modules/stock/productImage.d.ts +0 -14
- package/dist/modules/stock/productImage.js +0 -132
- package/dist/modules/stock/productName.d.ts +0 -13
- package/dist/modules/stock/productName.js +0 -140
- package/dist/modules/stock/productNamePreset.d.ts +0 -13
- package/dist/modules/stock/productNamePreset.js +0 -140
- package/dist/modules/stock/productPart.d.ts +0 -14
- package/dist/modules/stock/productPart.js +0 -139
- package/dist/modules/stock/productSubCategory.d.ts +0 -13
- package/dist/modules/stock/productSubCategory.js +0 -139
- package/dist/modules/stock/productUse.d.ts +0 -13
- package/dist/modules/stock/productUse.js +0 -140
- package/dist/modules/stock/productUseAssoc.d.ts +0 -12
- package/dist/modules/stock/productUseAssoc.js +0 -126
- package/dist/modules/stock/promotion.d.ts +0 -13
- package/dist/modules/stock/promotion.js +0 -140
- package/dist/modules/stock/promotionAssoc.d.ts +0 -12
- package/dist/modules/stock/promotionAssoc.js +0 -127
- package/dist/modules/stock/providerCurrentAccount.d.ts +0 -5
- package/dist/modules/stock/providerCurrentAccount.js +0 -61
- package/dist/modules/stock/queryList.d.ts +0 -11
- package/dist/modules/stock/queryList.js +0 -116
- package/dist/modules/stock/queryParameter.d.ts +0 -8
- package/dist/modules/stock/queryParameter.js +0 -106
- package/dist/modules/stock/returnReason.d.ts +0 -6
- package/dist/modules/stock/returnReason.js +0 -92
- package/dist/modules/stock/similarProduct.d.ts +0 -12
- package/dist/modules/stock/similarProduct.js +0 -127
- package/dist/modules/stock/stockMovement.d.ts +0 -8
- package/dist/modules/stock/stockMovement.js +0 -75
- package/dist/modules/stock/topMenu.d.ts +0 -5
- package/dist/modules/stock/topMenu.js +0 -61
- package/dist/modules/stock/typeOfInventory.d.ts +0 -13
- package/dist/modules/stock/typeOfInventory.js +0 -140
- package/dist/modules/stock/typeOfLocation.d.ts +0 -13
- package/dist/modules/stock/typeOfLocation.js +0 -140
- package/dist/modules/stock/unitOfMeasure.d.ts +0 -13
- package/dist/modules/stock/unitOfMeasure.js +0 -140
- package/dist/modules/stock/vatTax.d.ts +0 -13
- package/dist/modules/stock/vatTax.js +0 -140
- package/dist/modules/stock/vatTaxZone.d.ts +0 -14
- package/dist/modules/stock/vatTaxZone.js +0 -140
- package/dist/modules/stock/vatValidation.d.ts +0 -4
- package/dist/modules/stock/vatValidation.js +0 -63
- package/dist/modules/stock/websiteRequest.d.ts +0 -10
- package/dist/modules/stock/websiteRequest.js +0 -97
- package/dist/modules/stock/workflow.d.ts +0 -8
- package/dist/modules/stock/workflow.js +0 -103
- package/dist/modules/user/address.d.ts +0 -12
- package/dist/modules/user/address.js +0 -127
- package/dist/modules/user/bankData.d.ts +0 -12
- package/dist/modules/user/bankData.js +0 -127
- package/dist/modules/user/clientType.d.ts +0 -12
- package/dist/modules/user/clientType.js +0 -127
- package/dist/modules/user/clients.d.ts +0 -17
- package/dist/modules/user/clients.js +0 -140
- package/dist/modules/user/commissioner.d.ts +0 -15
- package/dist/modules/user/commissioner.js +0 -140
- package/dist/modules/user/contactTypes.d.ts +0 -12
- package/dist/modules/user/contactTypes.js +0 -127
- package/dist/modules/user/contacts.d.ts +0 -14
- package/dist/modules/user/contacts.js +0 -149
- package/dist/modules/user/country.d.ts +0 -12
- package/dist/modules/user/country.js +0 -140
- package/dist/modules/user/deliveryMethods.d.ts +0 -8
- package/dist/modules/user/deliveryMethods.js +0 -116
- package/dist/modules/user/entityList.d.ts +0 -7
- package/dist/modules/user/entityList.js +0 -106
- package/dist/modules/user/favorites.d.ts +0 -7
- package/dist/modules/user/favorites.js +0 -92
- package/dist/modules/user/groupPermission.d.ts +0 -7
- package/dist/modules/user/groupPermission.js +0 -94
- package/dist/modules/user/index.d.ts +0 -3
- package/dist/modules/user/index.js +0 -8
- package/dist/modules/user/language.d.ts +0 -12
- package/dist/modules/user/language.js +0 -127
- package/dist/modules/user/logout.d.ts +0 -2
- package/dist/modules/user/logout.js +0 -58
- package/dist/modules/user/maturityDates.d.ts +0 -8
- package/dist/modules/user/maturityDates.js +0 -116
- package/dist/modules/user/password.d.ts +0 -5
- package/dist/modules/user/password.js +0 -68
- package/dist/modules/user/paymentCondition.d.ts +0 -11
- package/dist/modules/user/paymentCondition.js +0 -127
- package/dist/modules/user/paymentMethods.d.ts +0 -8
- package/dist/modules/user/paymentMethods.js +0 -116
- package/dist/modules/user/permission.d.ts +0 -7
- package/dist/modules/user/permission.js +0 -94
- package/dist/modules/user/provider.d.ts +0 -15
- package/dist/modules/user/provider.js +0 -153
- package/dist/modules/user/providerType.d.ts +0 -12
- package/dist/modules/user/providerType.js +0 -127
- package/dist/modules/user/purchaseCondition.d.ts +0 -12
- package/dist/modules/user/purchaseCondition.js +0 -127
- package/dist/modules/user/reasonForExemption.d.ts +0 -12
- package/dist/modules/user/reasonForExemption.js +0 -127
- package/dist/modules/user/refreshToken.d.ts +0 -5
- package/dist/modules/user/refreshToken.js +0 -59
- package/dist/modules/user/segmentsArea.d.ts +0 -12
- package/dist/modules/user/segmentsArea.js +0 -127
- package/dist/modules/user/sessions.d.ts +0 -5
- package/dist/modules/user/sessions.js +0 -59
- package/dist/modules/user/shippings.d.ts +0 -11
- package/dist/modules/user/shippings.js +0 -127
- package/dist/modules/user/socialMedia.d.ts +0 -11
- package/dist/modules/user/socialMedia.js +0 -127
- package/dist/modules/user/storeOperator.d.ts +0 -16
- package/dist/modules/user/storeOperator.js +0 -151
- package/dist/modules/user/swift.d.ts +0 -12
- package/dist/modules/user/swift.js +0 -127
- package/dist/modules/user/tenant.d.ts +0 -6
- package/dist/modules/user/tenant.js +0 -92
- package/dist/modules/user/user.d.ts +0 -18
- package/dist/modules/user/user.js +0 -151
- package/dist/modules/user/userPermission.d.ts +0 -7
- package/dist/modules/user/userPermission.js +0 -83
- package/dist/modules/user/userPositions.d.ts +0 -12
- package/dist/modules/user/userPositions.js +0 -127
- package/dist/modules/user/userToken.d.ts +0 -9
- package/dist/modules/user/userToken.js +0 -116
- package/dist/modules/user/vehicles.d.ts +0 -6
- package/dist/modules/user/vehicles.js +0 -92
- package/dist/modules/user/zipCode.d.ts +0 -6
- package/dist/modules/user/zipCode.js +0 -69
- package/dist/shared/client.d.ts +0 -2
- package/dist/shared/client.js +0 -9
- package/dist/tsconfig.tsbuildinfo +0 -1
package/package.json
CHANGED
|
@@ -9,12 +9,7 @@
|
|
|
9
9
|
"typescript",
|
|
10
10
|
"helper"
|
|
11
11
|
],
|
|
12
|
-
"version": "0.8.
|
|
13
|
-
"main": "dist/index.js",
|
|
14
|
-
"types": "./dist/index.d.ts",
|
|
15
|
-
"files": [
|
|
16
|
-
"dist"
|
|
17
|
-
],
|
|
12
|
+
"version": "0.8.19",
|
|
18
13
|
"license": "UNLICENSED",
|
|
19
14
|
"homepage": "https://gitlab.com/nomalism-develop/api",
|
|
20
15
|
"bugs": {
|
|
@@ -25,16 +20,17 @@
|
|
|
25
20
|
"url": "git+https://gitlab.com/nomalism-develop/api.git"
|
|
26
21
|
},
|
|
27
22
|
"scripts": {
|
|
28
|
-
"start": "ts-node -r tsconfig-paths/register --transpile-only src/index.ts",
|
|
29
|
-
"build": "rm -rf dist && tsc --build --incremental",
|
|
30
|
-
"build:local": "tsc --incremental --noEmit",
|
|
31
23
|
"lint": "eslint src --ext .ts,.js --ignore-pattern node_modules --ignore-pattern dist --fix --cache",
|
|
32
|
-
"
|
|
24
|
+
"build": "tsc --project tsconfig.json --noEmit",
|
|
25
|
+
"start": "ts-node --transpile-only src/index.ts",
|
|
26
|
+
"prepack": "concurrently --success all \"npm run lint\" \"npm run build\" \"npm run start\""
|
|
33
27
|
},
|
|
34
28
|
"devDependencies": {
|
|
35
29
|
"@types/convert-units": "^2.3.5",
|
|
30
|
+
"@types/node": "^18.11.18",
|
|
36
31
|
"@typescript-eslint/eslint-plugin": "^5.49.0",
|
|
37
32
|
"@typescript-eslint/parser": "^5.49.0",
|
|
33
|
+
"concurrently": "^7.6.0",
|
|
38
34
|
"eslint": "^8.32.0",
|
|
39
35
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
40
36
|
"eslint-config-prettier": "^8.6.0",
|
|
@@ -46,8 +42,7 @@
|
|
|
46
42
|
"typescript": "^4.9.4"
|
|
47
43
|
},
|
|
48
44
|
"dependencies": {
|
|
49
|
-
"@nomalism-com/types": "^0.9.
|
|
50
|
-
"@types/node": "^18.11.18",
|
|
45
|
+
"@nomalism-com/types": "^0.9.20",
|
|
51
46
|
"axios": "^0.27.2"
|
|
52
47
|
}
|
|
53
48
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { shared } from '@nomalism-com/types';
|
|
2
2
|
import api from './shared/client';
|
|
3
|
+
|
|
3
4
|
import * as Address from './modules/user/address';
|
|
4
5
|
import * as Attribute from './modules/stock/attribute';
|
|
5
6
|
import * as AttributeValue from './modules/stock/attributeValue';
|
|
@@ -12,6 +13,7 @@ import * as Composition from './modules/stock/composition';
|
|
|
12
13
|
import * as CompositionMaterial from './modules/stock/compositionMaterial';
|
|
13
14
|
import * as Contacts from './modules/user/contacts';
|
|
14
15
|
import * as ContactType from './modules/user/contactTypes';
|
|
16
|
+
// import * as Counter from './modules/stock/counter';
|
|
15
17
|
import * as Country from './modules/user/country';
|
|
16
18
|
import * as DocumentHeader from './modules/stock/documentHeader';
|
|
17
19
|
import * as DocumentLine from './modules/stock/documentLine';
|
|
@@ -110,5 +112,120 @@ import * as Printer from './modules/print/printer';
|
|
|
110
112
|
import * as SchedulePrintJob from './modules/print/schedulePrintJob';
|
|
111
113
|
import * as QueryList from './modules/stock/queryList';
|
|
112
114
|
import * as QueryParameter from './modules/stock/queryParameter';
|
|
115
|
+
|
|
113
116
|
export default api;
|
|
114
|
-
|
|
117
|
+
|
|
118
|
+
export {
|
|
119
|
+
shared,
|
|
120
|
+
Address,
|
|
121
|
+
Attribute,
|
|
122
|
+
AttributeValue,
|
|
123
|
+
BankData,
|
|
124
|
+
Client,
|
|
125
|
+
ClientType,
|
|
126
|
+
Color,
|
|
127
|
+
Commissioner,
|
|
128
|
+
Composition,
|
|
129
|
+
CompositionMaterial,
|
|
130
|
+
Contacts,
|
|
131
|
+
ContactType,
|
|
132
|
+
Payment,
|
|
133
|
+
// Counter,
|
|
134
|
+
Country,
|
|
135
|
+
DocumentHeader,
|
|
136
|
+
DocumentLine,
|
|
137
|
+
DocumentLineAssoc,
|
|
138
|
+
DocumentLineFolder,
|
|
139
|
+
DocumentLineState,
|
|
140
|
+
DocumentType,
|
|
141
|
+
EntityList,
|
|
142
|
+
Favorites,
|
|
143
|
+
Field,
|
|
144
|
+
FieldGroup,
|
|
145
|
+
File,
|
|
146
|
+
GroupPermissions,
|
|
147
|
+
History,
|
|
148
|
+
Language,
|
|
149
|
+
Location,
|
|
150
|
+
Logout,
|
|
151
|
+
Maintenance,
|
|
152
|
+
MaintenanceAssoc,
|
|
153
|
+
MaintenancePreset,
|
|
154
|
+
MaintenancePresetAssoc,
|
|
155
|
+
MaintenanceType,
|
|
156
|
+
Multimedia,
|
|
157
|
+
Observation,
|
|
158
|
+
ObservationType,
|
|
159
|
+
PaymentConditions,
|
|
160
|
+
Password,
|
|
161
|
+
Permissions,
|
|
162
|
+
Plot,
|
|
163
|
+
PrimaryColor,
|
|
164
|
+
Product,
|
|
165
|
+
ProductAttribute,
|
|
166
|
+
ProductCategory,
|
|
167
|
+
ProductColor,
|
|
168
|
+
ProductImage,
|
|
169
|
+
ProductPart,
|
|
170
|
+
ProductSubCategory,
|
|
171
|
+
ProductUse,
|
|
172
|
+
ProductUseAssoc,
|
|
173
|
+
ProductName,
|
|
174
|
+
Promotion,
|
|
175
|
+
PromotionAssoc,
|
|
176
|
+
Providers,
|
|
177
|
+
ProviderType,
|
|
178
|
+
PurchaseConditions,
|
|
179
|
+
ReasonForExemption,
|
|
180
|
+
RefreshToken,
|
|
181
|
+
SegmentsArea,
|
|
182
|
+
Sessions,
|
|
183
|
+
Shippings,
|
|
184
|
+
SimilarProduct,
|
|
185
|
+
SocialMedia,
|
|
186
|
+
StoreOperator,
|
|
187
|
+
Swift,
|
|
188
|
+
TaskAttachment,
|
|
189
|
+
TaskNote,
|
|
190
|
+
Tasks,
|
|
191
|
+
TasksGroup,
|
|
192
|
+
TopMenu,
|
|
193
|
+
TypeOfInventory,
|
|
194
|
+
TypeOfLocation,
|
|
195
|
+
UnitOfMeasure,
|
|
196
|
+
UserPermissions,
|
|
197
|
+
UserPositions,
|
|
198
|
+
Users,
|
|
199
|
+
UserTokens,
|
|
200
|
+
VatTax,
|
|
201
|
+
VatTaxZone,
|
|
202
|
+
WebsiteRequest,
|
|
203
|
+
Workflow,
|
|
204
|
+
DynamicData,
|
|
205
|
+
DeliveryMethods,
|
|
206
|
+
MaturityDates,
|
|
207
|
+
PaymentMethods,
|
|
208
|
+
Vehicles,
|
|
209
|
+
ExternalDocumentType,
|
|
210
|
+
ExternalDocumentHeader,
|
|
211
|
+
DocumentSet,
|
|
212
|
+
DocumentLineStateCriteria,
|
|
213
|
+
ClientCurrentAccount,
|
|
214
|
+
ProviderCurrentAccount,
|
|
215
|
+
MoloniRequest,
|
|
216
|
+
VatValidation,
|
|
217
|
+
ProductNamePreset,
|
|
218
|
+
StockMovement,
|
|
219
|
+
ZipCode,
|
|
220
|
+
Tenant,
|
|
221
|
+
PreSale,
|
|
222
|
+
PreSaleProduct,
|
|
223
|
+
Cabide,
|
|
224
|
+
CabideProduct,
|
|
225
|
+
Npc,
|
|
226
|
+
Printer,
|
|
227
|
+
SchedulePrintJob,
|
|
228
|
+
OrderManagement,
|
|
229
|
+
QueryList,
|
|
230
|
+
QueryParameter,
|
|
231
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* eslint-disable no-param-reassign */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
import { Multimedia as Entity } from '@nomalism-com/types';
|
|
4
|
+
import api from '../../shared/client';
|
|
5
|
+
import { serviceHostname, servicePath } from '.';
|
|
6
|
+
|
|
7
|
+
export import IEntity = Entity.Entity;
|
|
8
|
+
|
|
9
|
+
export const route = `${serviceHostname}${servicePath}`;
|
|
10
|
+
|
|
11
|
+
const publicRoute =
|
|
12
|
+
process.env.REACT_APP_ENV === 'development' ? '' : 'public/';
|
|
13
|
+
|
|
14
|
+
const authRoute = process.env.REACT_APP_ENV === 'development' ? '' : 'auth/';
|
|
15
|
+
|
|
16
|
+
export const getUrl = (multimediaId: string) =>
|
|
17
|
+
`${route}${publicRoute}multimedia/${multimediaId}`;
|
|
18
|
+
|
|
19
|
+
const repository: Omit<Entity.IRepository, 'findById'> = {
|
|
20
|
+
create: async (multipartFormData: any, headers?: any): Promise<IEntity> => {
|
|
21
|
+
headers = headers || { 'content-type': 'multipart/form-data' };
|
|
22
|
+
const response = await api.post(
|
|
23
|
+
`${route}${authRoute}multimedia/upload`,
|
|
24
|
+
multipartFormData,
|
|
25
|
+
{
|
|
26
|
+
headers,
|
|
27
|
+
},
|
|
28
|
+
);
|
|
29
|
+
return response.data;
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const { create } = repository;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { DynamicData as Entity, shared } from '@nomalism-com/types';
|
|
2
|
+
import api from '../../shared/client';
|
|
3
|
+
import { serviceHostname, servicePath } from '.';
|
|
4
|
+
|
|
5
|
+
export import IEntity = Entity.Entity;
|
|
6
|
+
|
|
7
|
+
export import IFindRequest = Entity.IFindRequest;
|
|
8
|
+
|
|
9
|
+
export import IFindByTypeRequest = Entity.IFindByTypeRequest;
|
|
10
|
+
|
|
11
|
+
export import ICreateRequest = Entity.ICreateRequest;
|
|
12
|
+
|
|
13
|
+
export import IUpdateRequest = Entity.IUpdateRequest;
|
|
14
|
+
|
|
15
|
+
export const route = `${serviceHostname}${servicePath}dynamic_data/`;
|
|
16
|
+
|
|
17
|
+
const repository: Entity.IRepository = {
|
|
18
|
+
findByType: async (params?: IFindByTypeRequest): Promise<IEntity[]> => {
|
|
19
|
+
const response = await api.get(`${route}`, { params });
|
|
20
|
+
return response.data;
|
|
21
|
+
},
|
|
22
|
+
find: async (params?: IFindRequest): Promise<IEntity[]> => {
|
|
23
|
+
const response = await api.get(`${route}`, { params });
|
|
24
|
+
return response.data;
|
|
25
|
+
},
|
|
26
|
+
create: async (body: ICreateRequest): Promise<IEntity> => {
|
|
27
|
+
const response = await api.post(`${route}`, body);
|
|
28
|
+
return response.data;
|
|
29
|
+
},
|
|
30
|
+
update: async (
|
|
31
|
+
selector: shared.IFindByIdRequest,
|
|
32
|
+
body: IUpdateRequest,
|
|
33
|
+
): Promise<IEntity | null> => {
|
|
34
|
+
const response = await api.put(`${route}${selector.id}`, body);
|
|
35
|
+
return response.data;
|
|
36
|
+
},
|
|
37
|
+
deleteOne: async (
|
|
38
|
+
selector: shared.IFindByIdRequest,
|
|
39
|
+
): Promise<IEntity | null> => {
|
|
40
|
+
const response = await api.delete(`${route}${selector.id}`);
|
|
41
|
+
return response.data;
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const { findByType, find, create, update, deleteOne } = repository;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Field as Entity, shared } from '@nomalism-com/types';
|
|
2
|
+
import api from '../../shared/client';
|
|
3
|
+
import { serviceHostname, servicePath } from '.';
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
|
+
export import IDatatype = Entity.IDatatype;
|
|
7
|
+
|
|
8
|
+
export import ICreateRequest = Entity.ICreateRequest;
|
|
9
|
+
export import IEntity = Entity.Entity;
|
|
10
|
+
|
|
11
|
+
export import IUpdateRequest = Entity.IUpdateRequest;
|
|
12
|
+
|
|
13
|
+
export const { dataTypes, IDataTypeEnum } = Entity;
|
|
14
|
+
|
|
15
|
+
export const route = `${serviceHostname}${servicePath}field/`;
|
|
16
|
+
|
|
17
|
+
const repository: Entity.IRepository = {
|
|
18
|
+
find: async (): Promise<IEntity[]> => {
|
|
19
|
+
const response = await api.get(`${route}`);
|
|
20
|
+
return response.data;
|
|
21
|
+
},
|
|
22
|
+
create: async (data: ICreateRequest): Promise<IEntity> => {
|
|
23
|
+
const response = await api.post(`${route}`, data);
|
|
24
|
+
return response.data;
|
|
25
|
+
},
|
|
26
|
+
update: async (
|
|
27
|
+
selector: shared.IFindByIdRequest,
|
|
28
|
+
data: IUpdateRequest,
|
|
29
|
+
): Promise<IEntity | null> => {
|
|
30
|
+
const response = await api.put(`${route}${selector.id}`, data);
|
|
31
|
+
return response.data;
|
|
32
|
+
},
|
|
33
|
+
deleteOne: async (selector: shared.IFindByIdRequest): Promise<void> => {
|
|
34
|
+
await api.delete(`${route}${selector.id}`);
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const { find, create, update, deleteOne } = repository;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { shared, FieldGroup as Entity } from '@nomalism-com/types';
|
|
2
|
+
import api from '../../shared/client';
|
|
3
|
+
import { serviceHostname, servicePath } from '.';
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
|
+
export import IEntityType = Entity.IEntity;
|
|
7
|
+
|
|
8
|
+
export import IFindByEntityRequest = Entity.IFindByEntityRequest;
|
|
9
|
+
export import IFindByEntityResponse = Entity.IFindByEntityResponse;
|
|
10
|
+
|
|
11
|
+
export import IFindRequest = Entity.IFindRequest;
|
|
12
|
+
|
|
13
|
+
export import IFindMinifiedRequest = shared.IFindMinifiedRequest;
|
|
14
|
+
export import IFindMinifiedResponse = shared.IFindMinifiedResponse;
|
|
15
|
+
|
|
16
|
+
export import ICreateRequest = Entity.ICreateRequest;
|
|
17
|
+
export import IEntity = Entity.Entity;
|
|
18
|
+
|
|
19
|
+
export import IUpdateRequest = Entity.IUpdateRequest;
|
|
20
|
+
|
|
21
|
+
export const route = `${serviceHostname}${servicePath}field_group/`;
|
|
22
|
+
|
|
23
|
+
const repository: Omit<Entity.IRepository, 'findById' | 'findByName'> = {
|
|
24
|
+
findByEntity: async (
|
|
25
|
+
params?: IFindByEntityRequest,
|
|
26
|
+
): Promise<IFindByEntityResponse[]> => {
|
|
27
|
+
const response = await api.get(`${route}find_by_entity`, {
|
|
28
|
+
params,
|
|
29
|
+
});
|
|
30
|
+
return response.data;
|
|
31
|
+
},
|
|
32
|
+
findDetailed: async (params?: IFindRequest): Promise<IEntity[]> => {
|
|
33
|
+
const response = await api.get(`${route}`, { params });
|
|
34
|
+
return response.data;
|
|
35
|
+
},
|
|
36
|
+
findMinified: async (
|
|
37
|
+
params?: IFindMinifiedRequest,
|
|
38
|
+
): Promise<IFindMinifiedResponse[]> => {
|
|
39
|
+
const response = await api.get(`${route}minified`, { params });
|
|
40
|
+
return response.data;
|
|
41
|
+
},
|
|
42
|
+
create: async (body: ICreateRequest): Promise<IEntity> => {
|
|
43
|
+
const response = await api.post(`${route}`, body);
|
|
44
|
+
return response.data;
|
|
45
|
+
},
|
|
46
|
+
update: async (
|
|
47
|
+
selector: shared.IFindByIdRequest,
|
|
48
|
+
body: IUpdateRequest,
|
|
49
|
+
): Promise<IEntity | null> => {
|
|
50
|
+
const response = await api.put(`${route}${selector.id}`, body);
|
|
51
|
+
return response.data;
|
|
52
|
+
},
|
|
53
|
+
deleteOne: async (
|
|
54
|
+
selector: shared.IFindByIdRequest,
|
|
55
|
+
): Promise<IEntity | null> => {
|
|
56
|
+
const response = await api.delete(`${route}${selector.id}`);
|
|
57
|
+
return response.data;
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const {
|
|
62
|
+
findByEntity,
|
|
63
|
+
findDetailed,
|
|
64
|
+
findMinified,
|
|
65
|
+
create,
|
|
66
|
+
update,
|
|
67
|
+
deleteOne,
|
|
68
|
+
} = repository;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { shared, File as Entity } from '@nomalism-com/types';
|
|
2
|
+
import api from '../../shared/client';
|
|
3
|
+
import { serviceHostname, servicePath } from '.';
|
|
4
|
+
|
|
5
|
+
export import IFindByOwnerIdRequest = shared.IFindByOwnerIdRequest;
|
|
6
|
+
export import IEntity = Entity.Entity;
|
|
7
|
+
export import ICreateRequest = Entity.ICreateRequest;
|
|
8
|
+
|
|
9
|
+
const route = `${serviceHostname}${servicePath}file/`;
|
|
10
|
+
|
|
11
|
+
const repository: Entity.IRepository = {
|
|
12
|
+
findByOwnerId: async (params: IFindByOwnerIdRequest): Promise<IEntity[]> => {
|
|
13
|
+
const response = await api.get(`${route}by_owner`, {
|
|
14
|
+
params,
|
|
15
|
+
});
|
|
16
|
+
return response.data;
|
|
17
|
+
},
|
|
18
|
+
create: async (body: ICreateRequest): Promise<IEntity> => {
|
|
19
|
+
const response = await api.post(`${route}`, body);
|
|
20
|
+
return response.data;
|
|
21
|
+
},
|
|
22
|
+
deleteOne: async (
|
|
23
|
+
selector: shared.IFindByIdRequest,
|
|
24
|
+
): Promise<IEntity | null> => {
|
|
25
|
+
const response = await api.delete(`${route}${selector.id}`);
|
|
26
|
+
return response.data;
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const { findByOwnerId, create, deleteOne } = repository;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { History as Entity } from '@nomalism-com/types';
|
|
2
|
+
import api from '../../shared/client';
|
|
3
|
+
import { serviceHostname, servicePath } from '.';
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
|
+
export import IEntityType = Entity.IEntity;
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
8
|
+
export import IActionType = Entity.ActionType;
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10
|
+
export import IOrigin = Entity.Origin;
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12
|
+
export import IEntityMap = Entity.EntityMap;
|
|
13
|
+
export import IObjectType = Entity.ObjectType;
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
15
|
+
export import IObject = Entity.IObject;
|
|
16
|
+
export import IFindRequest = Entity.IFindRequest;
|
|
17
|
+
export import IFindResponse = Entity.IFindResponse;
|
|
18
|
+
|
|
19
|
+
export const route = `${serviceHostname}${servicePath}history/`;
|
|
20
|
+
|
|
21
|
+
const repository: Entity.IRepository = {
|
|
22
|
+
findByEntityAndId: async (
|
|
23
|
+
params: IFindRequest,
|
|
24
|
+
): Promise<IFindResponse<IObjectType>[]> => {
|
|
25
|
+
const response = await api.get(`${route}`, { params });
|
|
26
|
+
return response.data;
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const { findByEntityAndId } = repository;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Observation as Entity, shared } from '@nomalism-com/types';
|
|
2
|
+
import api from '../../shared/client';
|
|
3
|
+
import { serviceHostname, servicePath } from '.';
|
|
4
|
+
|
|
5
|
+
export import IFindByOwnerIdRequest = shared.IFindByOwnerIdRequest;
|
|
6
|
+
export import IFindByOwnerResponse = Entity.IFindByOwnerResponse;
|
|
7
|
+
|
|
8
|
+
export import ICreateRequest = Entity.ICreateRequest;
|
|
9
|
+
export import IEntity = Entity.Entity;
|
|
10
|
+
|
|
11
|
+
export import IUpdateRequest = Entity.IUpdateRequest;
|
|
12
|
+
|
|
13
|
+
export const route = `${serviceHostname}${servicePath}observation/`;
|
|
14
|
+
|
|
15
|
+
const repository: Omit<Entity.IRepository, 'findById' | 'findByQuery'> = {
|
|
16
|
+
findByOwner: async (
|
|
17
|
+
params: IFindByOwnerIdRequest,
|
|
18
|
+
): Promise<IFindByOwnerResponse[]> => {
|
|
19
|
+
const response = await api.get(`${route}`, {
|
|
20
|
+
params,
|
|
21
|
+
});
|
|
22
|
+
return response.data;
|
|
23
|
+
},
|
|
24
|
+
create: async (body: ICreateRequest): Promise<IFindByOwnerResponse> => {
|
|
25
|
+
const response = await api.post(`${route}`, body);
|
|
26
|
+
return response.data;
|
|
27
|
+
},
|
|
28
|
+
update: async (
|
|
29
|
+
selector: shared.IFindByIdRequest,
|
|
30
|
+
body: IUpdateRequest,
|
|
31
|
+
): Promise<IFindByOwnerResponse | null> => {
|
|
32
|
+
const response = await api.put(`${route}${selector.id}`, body);
|
|
33
|
+
return response.data;
|
|
34
|
+
},
|
|
35
|
+
deleteOne: async (
|
|
36
|
+
selector: shared.IFindByIdRequest,
|
|
37
|
+
): Promise<IEntity | null> => {
|
|
38
|
+
const response = await api.delete(`${route}${selector.id}`);
|
|
39
|
+
return response.data;
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const { findByOwner, create, update, deleteOne } = repository;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { shared, ObservationType as Entity } from '@nomalism-com/types';
|
|
2
|
+
import api from '../../shared/client';
|
|
3
|
+
import { serviceHostname, servicePath } from '.';
|
|
4
|
+
|
|
5
|
+
export import IFindRequest = Entity.IFindRequest;
|
|
6
|
+
export import IFindDetailedResponse = Entity.IFindDetailedResponse;
|
|
7
|
+
|
|
8
|
+
export import IFindMinifiedRequest = shared.IFindMinifiedRequest;
|
|
9
|
+
export import IFindMinifiedResponse = shared.IFindMinifiedResponse;
|
|
10
|
+
|
|
11
|
+
export import ICreateRequest = Entity.ICreateRequest;
|
|
12
|
+
export import IEntity = Entity.Entity;
|
|
13
|
+
|
|
14
|
+
export import IUpdateRequest = Entity.IUpdateRequest;
|
|
15
|
+
|
|
16
|
+
export const route = `${serviceHostname}${servicePath}observation_type/`;
|
|
17
|
+
|
|
18
|
+
const repository: Omit<Entity.IRepository, 'findById' | 'findByQuery'> = {
|
|
19
|
+
findDetailed: async (
|
|
20
|
+
params?: IFindRequest,
|
|
21
|
+
): Promise<IFindDetailedResponse[]> => {
|
|
22
|
+
const response = await api.get(`${route}`, {
|
|
23
|
+
params,
|
|
24
|
+
});
|
|
25
|
+
return response.data;
|
|
26
|
+
},
|
|
27
|
+
findMinified: async (
|
|
28
|
+
params?: IFindMinifiedRequest,
|
|
29
|
+
): Promise<IFindMinifiedResponse[]> => {
|
|
30
|
+
const response = await api.get(`${route}minified`, {
|
|
31
|
+
params,
|
|
32
|
+
});
|
|
33
|
+
return response.data;
|
|
34
|
+
},
|
|
35
|
+
create: async (body: ICreateRequest): Promise<IEntity> => {
|
|
36
|
+
const response = await api.post(`${route}`, body);
|
|
37
|
+
return response.data;
|
|
38
|
+
},
|
|
39
|
+
update: async (
|
|
40
|
+
selector: shared.IFindByIdRequest,
|
|
41
|
+
body: IUpdateRequest,
|
|
42
|
+
): Promise<IEntity | null> => {
|
|
43
|
+
const response = await api.put(`${route}${selector.id}`, body);
|
|
44
|
+
return response.data;
|
|
45
|
+
},
|
|
46
|
+
deleteOne: async (
|
|
47
|
+
selector: shared.IFindByIdRequest,
|
|
48
|
+
): Promise<IEntity | null> => {
|
|
49
|
+
const response = await api.delete(`${route}${selector.id}`);
|
|
50
|
+
return response.data;
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const { findDetailed, findMinified, create, update, deleteOne } =
|
|
55
|
+
repository;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { shared, Tasks as Entity } from '@nomalism-com/types';
|
|
2
|
+
import api from '../../shared/client';
|
|
3
|
+
import { serviceHostname, servicePath } from '.';
|
|
4
|
+
|
|
5
|
+
export import IFindByQueryRequest = Entity.IFindByQueryRequest;
|
|
6
|
+
export import IFindByQueryResponse = Entity.IFindByQueryResponse;
|
|
7
|
+
|
|
8
|
+
export import IBasicSearchRequest = Entity.IBasicSearchRequest;
|
|
9
|
+
export import IBasicSearchResponse = Entity.IBasicSearchResponse;
|
|
10
|
+
|
|
11
|
+
export import IUpdateRequest = Entity.IUpdateRequest;
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13
|
+
export import IEntity = Entity.Entity;
|
|
14
|
+
|
|
15
|
+
export import ICreateRequest = Entity.ICreateRequest;
|
|
16
|
+
|
|
17
|
+
export const route = `${serviceHostname}${servicePath}task/`;
|
|
18
|
+
|
|
19
|
+
const repository: Omit<Entity.IRepository, 'findById'> = {
|
|
20
|
+
findByQuery: async (
|
|
21
|
+
params: IFindByQueryRequest,
|
|
22
|
+
): Promise<IFindByQueryResponse[]> => {
|
|
23
|
+
const response = await api.get(`${route}`, { params });
|
|
24
|
+
return (response.data as IFindByQueryResponse[]).map(
|
|
25
|
+
(task: IFindByQueryResponse) => {
|
|
26
|
+
return {
|
|
27
|
+
...task,
|
|
28
|
+
children: task.children.map((child: IFindByQueryResponse) => {
|
|
29
|
+
return {
|
|
30
|
+
...child,
|
|
31
|
+
parent_id: task.id,
|
|
32
|
+
};
|
|
33
|
+
}),
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
);
|
|
37
|
+
},
|
|
38
|
+
basicSearch: async (
|
|
39
|
+
params: IBasicSearchRequest,
|
|
40
|
+
): Promise<shared.IPaginationResponse<IBasicSearchResponse>> => {
|
|
41
|
+
const response = await api.get(`${route}basic_search`, {
|
|
42
|
+
params,
|
|
43
|
+
});
|
|
44
|
+
return response.data;
|
|
45
|
+
},
|
|
46
|
+
update: async (
|
|
47
|
+
selector: shared.IFindByIdRequest,
|
|
48
|
+
body: IUpdateRequest,
|
|
49
|
+
): Promise<IFindByQueryResponse | null> => {
|
|
50
|
+
const response = await api.put(`${route}${selector.id}`, body);
|
|
51
|
+
return response.data;
|
|
52
|
+
},
|
|
53
|
+
create: async (
|
|
54
|
+
body: ICreateRequest,
|
|
55
|
+
reply_to?: string,
|
|
56
|
+
): Promise<IFindByQueryResponse> => {
|
|
57
|
+
const response = await api.post(`${route}`, body, {
|
|
58
|
+
params: {
|
|
59
|
+
reply_to,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
return response.data;
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const { findByQuery, basicSearch, update, create } = repository;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { TaskAttachment as Entity } from '@nomalism-com/types';
|
|
2
|
+
import api from '../../shared/client';
|
|
3
|
+
import { serviceHostname, servicePath } from '.';
|
|
4
|
+
|
|
5
|
+
export import IFindRequest = Entity.IFindRequest;
|
|
6
|
+
export import IFindResponse = Entity.IFindResponse;
|
|
7
|
+
|
|
8
|
+
export import ICreateRequest = Entity.ICreateRequest;
|
|
9
|
+
export import IEntity = Entity.Entity;
|
|
10
|
+
|
|
11
|
+
export const route = `${serviceHostname}${servicePath}task_attachment/`;
|
|
12
|
+
|
|
13
|
+
const repository: Omit<Entity.IRepository, 'findById'> = {
|
|
14
|
+
findByTaskId: async (params: IFindRequest): Promise<IFindResponse[]> => {
|
|
15
|
+
const response = await api.get(`${route}`, {
|
|
16
|
+
params,
|
|
17
|
+
});
|
|
18
|
+
return response.data;
|
|
19
|
+
},
|
|
20
|
+
create: async (body: ICreateRequest): Promise<IEntity> => {
|
|
21
|
+
const response = await api.post(`${route}`, body);
|
|
22
|
+
return response.data;
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const { findByTaskId, create } = repository;
|