@nomalism-com/api 0.8.19 → 0.8.21
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/{src/index.ts → dist/index.d.ts} +115 -231
- package/dist/index.js +257 -0
- package/dist/modules/documentManagement/index.d.ts +2 -0
- package/dist/modules/documentManagement/index.js +7 -0
- package/dist/modules/documentManagement/multimedia.d.ts +5 -0
- package/dist/modules/documentManagement/multimedia.js +69 -0
- package/dist/modules/integration/dynamicData.d.ts +8 -0
- package/dist/modules/integration/dynamicData.js +103 -0
- package/dist/modules/integration/field.d.ts +26 -0
- package/dist/modules/integration/field.js +93 -0
- package/dist/modules/integration/fieldGroup.d.ts +12 -0
- package/dist/modules/integration/fieldGroup.js +118 -0
- package/dist/modules/integration/file.d.ts +5 -0
- package/dist/modules/integration/file.js +83 -0
- package/dist/modules/integration/history.d.ts +11 -0
- package/dist/modules/integration/history.js +63 -0
- package/dist/modules/integration/index.d.ts +2 -0
- package/dist/modules/integration/index.js +7 -0
- package/dist/modules/integration/observation.d.ts +8 -0
- package/dist/modules/integration/observation.js +94 -0
- package/dist/modules/integration/observationType.d.ts +10 -0
- package/dist/modules/integration/observationType.js +107 -0
- package/dist/modules/integration/task.d.ts +10 -0
- package/dist/modules/integration/task.js +113 -0
- package/dist/modules/integration/taskAttachment.d.ts +7 -0
- package/dist/modules/integration/taskAttachment.js +72 -0
- package/dist/modules/integration/taskGroup.d.ts +8 -0
- package/dist/modules/integration/taskGroup.js +103 -0
- package/dist/modules/integration/taskNote.d.ts +8 -0
- package/dist/modules/integration/taskNote.js +92 -0
- package/dist/modules/print/index.d.ts +4 -0
- package/dist/modules/print/index.js +9 -0
- package/dist/modules/print/npc.d.ts +5 -0
- package/dist/modules/print/npc.js +70 -0
- package/dist/modules/print/printer.d.ts +6 -0
- package/dist/modules/print/printer.js +70 -0
- package/dist/modules/print/schedulePrintJob.d.ts +8 -0
- package/dist/modules/print/schedulePrintJob.js +139 -0
- package/dist/modules/stock/attribute.d.ts +16 -0
- package/dist/modules/stock/attribute.js +143 -0
- package/dist/modules/stock/attributeValue.d.ts +12 -0
- package/dist/modules/stock/attributeValue.js +140 -0
- package/dist/modules/stock/cabide.d.ts +15 -0
- package/dist/modules/stock/cabide.js +151 -0
- package/dist/modules/stock/cabideProduct.d.ts +10 -0
- package/dist/modules/stock/cabideProduct.js +127 -0
- package/dist/modules/stock/clientCurrentAccount.d.ts +5 -0
- package/dist/modules/stock/clientCurrentAccount.js +61 -0
- package/dist/modules/stock/color.d.ts +13 -0
- package/dist/modules/stock/color.js +139 -0
- package/dist/modules/stock/composition.d.ts +12 -0
- package/dist/modules/stock/composition.js +127 -0
- package/dist/modules/stock/compositionMaterial.d.ts +13 -0
- package/dist/modules/stock/compositionMaterial.js +140 -0
- package/dist/modules/stock/documentHeader.d.ts +45 -0
- package/dist/modules/stock/documentHeader.js +361 -0
- package/dist/modules/stock/documentLine.d.ts +24 -0
- package/dist/modules/stock/documentLine.js +125 -0
- package/dist/modules/stock/documentLineAssoc.d.ts +20 -0
- package/dist/modules/stock/documentLineAssoc.js +154 -0
- package/dist/modules/stock/documentLineFolder.d.ts +6 -0
- package/dist/modules/stock/documentLineFolder.js +92 -0
- package/dist/modules/stock/documentLineState.d.ts +10 -0
- package/dist/modules/stock/documentLineState.js +114 -0
- package/dist/modules/stock/documentLineStateCriteria.d.ts +20 -0
- package/dist/modules/stock/documentLineStateCriteria.js +121 -0
- package/dist/modules/stock/documentSet.d.ts +8 -0
- package/dist/modules/stock/documentSet.js +114 -0
- package/dist/modules/stock/documentType.d.ts +14 -0
- package/dist/modules/stock/documentType.js +117 -0
- package/dist/modules/stock/externalDocumentHeader.d.ts +15 -0
- package/dist/modules/stock/externalDocumentHeader.js +135 -0
- package/dist/modules/stock/externalDocumentType.d.ts +6 -0
- package/dist/modules/stock/externalDocumentType.js +70 -0
- package/dist/modules/stock/index.d.ts +3 -0
- package/dist/modules/stock/index.js +8 -0
- package/dist/modules/stock/location.d.ts +12 -0
- package/dist/modules/stock/location.js +140 -0
- package/dist/modules/stock/maintenance.d.ts +12 -0
- package/dist/modules/stock/maintenance.js +140 -0
- package/dist/modules/stock/maintenanceAssoc.d.ts +12 -0
- package/dist/modules/stock/maintenanceAssoc.js +127 -0
- package/dist/modules/stock/maintenancePreset.d.ts +10 -0
- package/dist/modules/stock/maintenancePreset.js +114 -0
- package/dist/modules/stock/maintenancePresetAssoc.d.ts +8 -0
- package/dist/modules/stock/maintenancePresetAssoc.js +91 -0
- package/dist/modules/stock/maintenanceType.d.ts +13 -0
- package/dist/modules/stock/maintenanceType.js +140 -0
- package/dist/modules/stock/moloniRequest.d.ts +5 -0
- package/dist/modules/stock/moloniRequest.js +59 -0
- package/dist/modules/stock/orderManagement.d.ts +11 -0
- package/dist/modules/stock/orderManagement.js +88 -0
- package/dist/modules/stock/payment.d.ts +22 -0
- package/dist/modules/stock/payment.js +210 -0
- package/dist/modules/stock/plot.d.ts +32 -0
- package/dist/modules/stock/plot.js +238 -0
- package/dist/modules/stock/preSale.d.ts +11 -0
- package/dist/modules/stock/preSale.js +125 -0
- package/dist/modules/stock/preSaleProduct.d.ts +4 -0
- package/dist/modules/stock/preSaleProduct.js +70 -0
- package/dist/modules/stock/primaryColor.d.ts +13 -0
- package/dist/modules/stock/primaryColor.js +140 -0
- package/dist/modules/stock/product.d.ts +31 -0
- package/dist/modules/stock/product.js +239 -0
- package/dist/modules/stock/productAttribute.d.ts +12 -0
- package/dist/modules/stock/productAttribute.js +127 -0
- package/dist/modules/stock/productCategory.d.ts +13 -0
- package/dist/modules/stock/productCategory.js +140 -0
- package/dist/modules/stock/productColor.d.ts +12 -0
- package/dist/modules/stock/productColor.js +127 -0
- package/dist/modules/stock/productImage.d.ts +14 -0
- package/dist/modules/stock/productImage.js +130 -0
- package/dist/modules/stock/productName.d.ts +13 -0
- package/dist/modules/stock/productName.js +140 -0
- package/dist/modules/stock/productNamePreset.d.ts +13 -0
- package/dist/modules/stock/productNamePreset.js +140 -0
- package/dist/modules/stock/productPart.d.ts +14 -0
- package/dist/modules/stock/productPart.js +139 -0
- package/dist/modules/stock/productSubCategory.d.ts +13 -0
- package/dist/modules/stock/productSubCategory.js +139 -0
- package/dist/modules/stock/productUse.d.ts +13 -0
- package/dist/modules/stock/productUse.js +140 -0
- package/dist/modules/stock/productUseAssoc.d.ts +12 -0
- package/dist/modules/stock/productUseAssoc.js +126 -0
- package/dist/modules/stock/promotion.d.ts +13 -0
- package/dist/modules/stock/promotion.js +140 -0
- package/dist/modules/stock/promotionAssoc.d.ts +12 -0
- package/dist/modules/stock/promotionAssoc.js +127 -0
- package/dist/modules/stock/providerCurrentAccount.d.ts +5 -0
- package/dist/modules/stock/providerCurrentAccount.js +61 -0
- package/dist/modules/stock/queryList.d.ts +11 -0
- package/dist/modules/stock/queryList.js +116 -0
- package/dist/modules/stock/queryParameter.d.ts +8 -0
- package/dist/modules/stock/queryParameter.js +105 -0
- package/dist/modules/stock/returnReason.d.ts +6 -0
- package/dist/modules/stock/returnReason.js +92 -0
- package/dist/modules/stock/similarProduct.d.ts +12 -0
- package/dist/modules/stock/similarProduct.js +127 -0
- package/dist/modules/stock/stockMovement.d.ts +8 -0
- package/dist/modules/stock/stockMovement.js +75 -0
- package/dist/modules/stock/topMenu.d.ts +5 -0
- package/dist/modules/stock/topMenu.js +61 -0
- package/dist/modules/stock/typeOfInventory.d.ts +13 -0
- package/dist/modules/stock/typeOfInventory.js +140 -0
- package/dist/modules/stock/typeOfLocation.d.ts +13 -0
- package/dist/modules/stock/typeOfLocation.js +140 -0
- package/dist/modules/stock/unitOfMeasure.d.ts +13 -0
- package/dist/modules/stock/unitOfMeasure.js +140 -0
- package/dist/modules/stock/vatTax.d.ts +13 -0
- package/dist/modules/stock/vatTax.js +140 -0
- package/dist/modules/stock/vatTaxZone.d.ts +14 -0
- package/dist/modules/stock/vatTaxZone.js +140 -0
- package/dist/modules/stock/vatValidation.d.ts +4 -0
- package/dist/modules/stock/vatValidation.js +63 -0
- package/dist/modules/stock/websiteRequest.d.ts +10 -0
- package/dist/modules/stock/websiteRequest.js +96 -0
- package/dist/modules/stock/workflow.d.ts +8 -0
- package/dist/modules/stock/workflow.js +103 -0
- package/dist/modules/user/address.d.ts +12 -0
- package/dist/modules/user/address.js +127 -0
- package/dist/modules/user/bankData.d.ts +12 -0
- package/dist/modules/user/bankData.js +127 -0
- package/dist/modules/user/clientType.d.ts +12 -0
- package/dist/modules/user/clientType.js +127 -0
- package/dist/modules/user/clients.d.ts +17 -0
- package/dist/modules/user/clients.js +140 -0
- package/dist/modules/user/commissioner.d.ts +15 -0
- package/dist/modules/user/commissioner.js +140 -0
- package/dist/modules/user/contactTypes.d.ts +12 -0
- package/dist/modules/user/contactTypes.js +127 -0
- package/dist/modules/user/contacts.d.ts +14 -0
- package/dist/modules/user/contacts.js +149 -0
- package/dist/modules/user/country.d.ts +12 -0
- package/dist/modules/user/country.js +140 -0
- package/dist/modules/user/deliveryMethods.d.ts +8 -0
- package/dist/modules/user/deliveryMethods.js +116 -0
- package/dist/modules/user/entityList.d.ts +7 -0
- package/dist/modules/user/entityList.js +105 -0
- package/dist/modules/user/favorites.d.ts +7 -0
- package/dist/modules/user/favorites.js +92 -0
- package/dist/modules/user/groupPermission.d.ts +7 -0
- package/dist/modules/user/groupPermission.js +94 -0
- package/dist/modules/user/index.d.ts +3 -0
- package/dist/modules/user/index.js +8 -0
- package/dist/modules/user/language.d.ts +12 -0
- package/dist/modules/user/language.js +127 -0
- package/dist/modules/user/logout.d.ts +2 -0
- package/dist/modules/user/logout.js +58 -0
- package/dist/modules/user/maturityDates.d.ts +8 -0
- package/dist/modules/user/maturityDates.js +116 -0
- package/dist/modules/user/password.d.ts +5 -0
- package/dist/modules/user/password.js +68 -0
- package/dist/modules/user/paymentCondition.d.ts +11 -0
- package/dist/modules/user/paymentCondition.js +127 -0
- package/dist/modules/user/paymentMethods.d.ts +8 -0
- package/dist/modules/user/paymentMethods.js +116 -0
- package/dist/modules/user/permission.d.ts +7 -0
- package/dist/modules/user/permission.js +94 -0
- package/dist/modules/user/provider.d.ts +15 -0
- package/dist/modules/user/provider.js +153 -0
- package/dist/modules/user/providerType.d.ts +12 -0
- package/dist/modules/user/providerType.js +127 -0
- package/dist/modules/user/purchaseCondition.d.ts +12 -0
- package/dist/modules/user/purchaseCondition.js +127 -0
- package/dist/modules/user/reasonForExemption.d.ts +12 -0
- package/dist/modules/user/reasonForExemption.js +127 -0
- package/dist/modules/user/refreshToken.d.ts +5 -0
- package/dist/modules/user/refreshToken.js +59 -0
- package/dist/modules/user/segmentsArea.d.ts +12 -0
- package/dist/modules/user/segmentsArea.js +127 -0
- package/dist/modules/user/sessions.d.ts +5 -0
- package/dist/modules/user/sessions.js +59 -0
- package/dist/modules/user/shippings.d.ts +11 -0
- package/dist/modules/user/shippings.js +127 -0
- package/dist/modules/user/socialMedia.d.ts +11 -0
- package/dist/modules/user/socialMedia.js +127 -0
- package/dist/modules/user/storeOperator.d.ts +16 -0
- package/dist/modules/user/storeOperator.js +151 -0
- package/dist/modules/user/swift.d.ts +12 -0
- package/dist/modules/user/swift.js +127 -0
- package/dist/modules/user/tenant.d.ts +6 -0
- package/dist/modules/user/tenant.js +92 -0
- package/dist/modules/user/user.d.ts +18 -0
- package/dist/modules/user/user.js +151 -0
- package/dist/modules/user/userPermission.d.ts +7 -0
- package/dist/modules/user/userPermission.js +83 -0
- package/dist/modules/user/userPositions.d.ts +12 -0
- package/dist/modules/user/userPositions.js +127 -0
- package/dist/modules/user/userToken.d.ts +9 -0
- package/dist/modules/user/userToken.js +116 -0
- package/dist/modules/user/vehicles.d.ts +6 -0
- package/dist/modules/user/vehicles.js +92 -0
- package/dist/modules/user/zipCode.d.ts +6 -0
- package/dist/modules/user/zipCode.js +69 -0
- package/dist/shared/client.d.ts +2 -0
- package/dist/shared/client.js +9 -0
- package/package.json +53 -48
- package/.editorconfig +0 -9
- package/.eslintignore +0 -3
- package/.eslintrc.json +0 -51
- package/.nvmrc +0 -1
- package/package-lock.json +0 -6181
- package/prettier.config.js +0 -5
- package/src/modules/documentManagement/index.ts +0 -6
- package/src/modules/documentManagement/multimedia.ts +0 -33
- package/src/modules/integration/dynamicData.ts +0 -45
- package/src/modules/integration/field.ts +0 -38
- package/src/modules/integration/fieldGroup.ts +0 -68
- package/src/modules/integration/file.ts +0 -30
- package/src/modules/integration/history.ts +0 -30
- package/src/modules/integration/index.ts +0 -6
- package/src/modules/integration/observation.ts +0 -43
- package/src/modules/integration/observationType.ts +0 -55
- package/src/modules/integration/task.ts +0 -66
- package/src/modules/integration/taskAttachment.ts +0 -26
- package/src/modules/integration/taskGroup.ts +0 -45
- package/src/modules/integration/taskNote.ts +0 -39
- package/src/modules/print/index.ts +0 -10
- package/src/modules/print/npc.ts +0 -24
- package/src/modules/print/printer.ts +0 -26
- package/src/modules/print/schedulePrintJob.ts +0 -75
- package/src/modules/stock/attribute.ts +0 -101
- package/src/modules/stock/attributeValue.ts +0 -91
- package/src/modules/stock/cabide.ts +0 -105
- package/src/modules/stock/cabideProduct.ts +0 -67
- package/src/modules/stock/clientCurrentAccount.ts +0 -22
- package/src/modules/stock/color.ts +0 -90
- package/src/modules/stock/composition.ts +0 -81
- package/src/modules/stock/compositionMaterial.ts +0 -92
- package/src/modules/stock/documentHeader.ts +0 -324
- package/src/modules/stock/documentLine.ts +0 -89
- package/src/modules/stock/documentLineAssoc.ts +0 -117
- package/src/modules/stock/documentLineFolder.ts +0 -43
- package/src/modules/stock/documentLineState.ts +0 -66
- package/src/modules/stock/documentLineStateCriteria.ts +0 -90
- package/src/modules/stock/documentSet.ts +0 -53
- package/src/modules/stock/documentType.ts +0 -68
- package/src/modules/stock/externalDocumentHeader.ts +0 -85
- package/src/modules/stock/externalDocumentType.ts +0 -26
- package/src/modules/stock/index.ts +0 -8
- package/src/modules/stock/location.ts +0 -91
- package/src/modules/stock/maintenance.ts +0 -91
- package/src/modules/stock/maintenanceAssoc.ts +0 -81
- package/src/modules/stock/maintenancePreset.ts +0 -55
- package/src/modules/stock/maintenancePresetAssoc.ts +0 -42
- package/src/modules/stock/maintenanceType.ts +0 -92
- package/src/modules/stock/moloniRequest.ts +0 -18
- package/src/modules/stock/orderManagement.ts +0 -41
- package/src/modules/stock/payment.ts +0 -161
- package/src/modules/stock/plot.ts +0 -196
- package/src/modules/stock/preSale.ts +0 -76
- package/src/modules/stock/preSaleProduct.ts +0 -23
- package/src/modules/stock/primaryColor.ts +0 -92
- package/src/modules/stock/product.ts +0 -197
- package/src/modules/stock/productAttribute.ts +0 -81
- package/src/modules/stock/productCategory.ts +0 -92
- package/src/modules/stock/productColor.ts +0 -81
- package/src/modules/stock/productImage.ts +0 -86
- package/src/modules/stock/productName.ts +0 -92
- package/src/modules/stock/productNamePreset.ts +0 -92
- package/src/modules/stock/productPart.ts +0 -91
- package/src/modules/stock/productSubCategory.ts +0 -90
- package/src/modules/stock/productUse.ts +0 -92
- package/src/modules/stock/productUseAssoc.ts +0 -78
- package/src/modules/stock/promotion.ts +0 -93
- package/src/modules/stock/promotionAssoc.ts +0 -81
- package/src/modules/stock/providerCurrentAccount.ts +0 -22
- package/src/modules/stock/queryList.ts +0 -61
- package/src/modules/stock/queryParameter.ts +0 -50
- package/src/modules/stock/returnReason.ts +0 -40
- package/src/modules/stock/similarProduct.ts +0 -81
- package/src/modules/stock/stockMovement.ts +0 -32
- package/src/modules/stock/topMenu.ts +0 -22
- package/src/modules/stock/typeOfInventory.ts +0 -92
- package/src/modules/stock/typeOfLocation.ts +0 -92
- package/src/modules/stock/unitOfMeasure.ts +0 -92
- package/src/modules/stock/vatTax.ts +0 -92
- package/src/modules/stock/vatTaxZone.ts +0 -94
- package/src/modules/stock/vatValidation.ts +0 -20
- package/src/modules/stock/websiteRequest.ts +0 -51
- package/src/modules/stock/workflow.ts +0 -50
- package/src/modules/user/address.ts +0 -81
- package/src/modules/user/bankData.ts +0 -81
- package/src/modules/user/clientType.ts +0 -80
- package/src/modules/user/clients.ts +0 -100
- package/src/modules/user/commissioner.ts +0 -96
- package/src/modules/user/contactTypes.ts +0 -80
- package/src/modules/user/contacts.ts +0 -100
- package/src/modules/user/country.ts +0 -90
- package/src/modules/user/deliveryMethods.ts +0 -60
- package/src/modules/user/entityList.ts +0 -42
- package/src/modules/user/favorites.ts +0 -36
- package/src/modules/user/groupPermission.ts +0 -44
- package/src/modules/user/index.ts +0 -8
- package/src/modules/user/language.ts +0 -80
- package/src/modules/user/logout.ts +0 -12
- package/src/modules/user/maturityDates.ts +0 -60
- package/src/modules/user/password.ts +0 -21
- package/src/modules/user/paymentCondition.ts +0 -79
- package/src/modules/user/paymentMethods.ts +0 -60
- package/src/modules/user/permission.ts +0 -44
- package/src/modules/user/provider.ts +0 -106
- package/src/modules/user/providerType.ts +0 -80
- package/src/modules/user/purchaseCondition.ts +0 -82
- package/src/modules/user/reasonForExemption.ts +0 -80
- package/src/modules/user/refreshToken.ts +0 -18
- package/src/modules/user/segmentsArea.ts +0 -80
- package/src/modules/user/sessions.ts +0 -18
- package/src/modules/user/shippings.ts +0 -79
- package/src/modules/user/socialMedia.ts +0 -79
- package/src/modules/user/storeOperator.ts +0 -104
- package/src/modules/user/swift.ts +0 -80
- package/src/modules/user/tenant.ts +0 -36
- package/src/modules/user/user.ts +0 -111
- package/src/modules/user/userPermission.ts +0 -37
- package/src/modules/user/userPositions.ts +0 -80
- package/src/modules/user/userToken.ts +0 -69
- package/src/modules/user/vehicles.ts +0 -40
- package/src/modules/user/zipCode.ts +0 -23
- package/src/shared/client.ts +0 -5
- package/tsconfig.json +0 -19
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { shared, SegmentsArea as Entity } from '@nomalism-com/types';
|
|
2
|
-
import api from '../../shared/client';
|
|
3
|
-
import { serviceHostname, serviceAuthPath } from '.';
|
|
4
|
-
|
|
5
|
-
export import IFindRequest = Entity.IFindRequest;
|
|
6
|
-
export import IFindResponse = Entity.IFindResponse;
|
|
7
|
-
|
|
8
|
-
export import IFindPaginatedRequest = Entity.IFindPaginatedRequest;
|
|
9
|
-
|
|
10
|
-
export import IFindMinifiedRequest = shared.IFindMinifiedRequest;
|
|
11
|
-
export import IFindMinifiedResponse = shared.IFindMinifiedResponse;
|
|
12
|
-
|
|
13
|
-
export import ICreateRequest = Entity.ICreateRequest;
|
|
14
|
-
export import IEntity = Entity.Entity;
|
|
15
|
-
|
|
16
|
-
export import IUpdateRequest = Entity.IUpdateRequest;
|
|
17
|
-
export type IPaginationResponse =
|
|
18
|
-
shared.IPaginationResponse<Entity.IFindResponse>;
|
|
19
|
-
|
|
20
|
-
export const route = `${serviceHostname}${serviceAuthPath}segments_area/`;
|
|
21
|
-
|
|
22
|
-
const repository: Entity.IRepository = {
|
|
23
|
-
find: async (params: IFindRequest): Promise<IFindResponse[]> => {
|
|
24
|
-
const response = await api.get(`${route}`, { params });
|
|
25
|
-
return response.data;
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
findPaginated: async (
|
|
29
|
-
params: IFindPaginatedRequest,
|
|
30
|
-
): Promise<IPaginationResponse> => {
|
|
31
|
-
const response = await api.get(`${route}paginated`, { params });
|
|
32
|
-
return response.data;
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
findMinified: async (
|
|
36
|
-
params?: IFindMinifiedRequest,
|
|
37
|
-
): Promise<IFindMinifiedResponse[]> => {
|
|
38
|
-
const response = await api.get(`${route}minified`, {
|
|
39
|
-
params,
|
|
40
|
-
});
|
|
41
|
-
return response.data;
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
findById: async (
|
|
45
|
-
selector: shared.IFindByIdRequest,
|
|
46
|
-
): Promise<IFindResponse | null> => {
|
|
47
|
-
const response = await api.get(`${route}${selector.id}`);
|
|
48
|
-
return response.data;
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
create: async (body: ICreateRequest): Promise<IEntity> => {
|
|
52
|
-
const response = await api.post(`${route}`, body);
|
|
53
|
-
return response.data;
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
update: async (
|
|
57
|
-
selector: shared.IFindByIdRequest,
|
|
58
|
-
body: IUpdateRequest,
|
|
59
|
-
): Promise<IEntity | null> => {
|
|
60
|
-
const response = await api.put(`${route}${selector.id}`, body);
|
|
61
|
-
return response.data;
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
deleteOne: async (
|
|
65
|
-
selector: shared.IFindByIdRequest,
|
|
66
|
-
): Promise<IEntity | null> => {
|
|
67
|
-
const response = await api.delete(`${route}${selector.id}`);
|
|
68
|
-
return response.data;
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export const {
|
|
73
|
-
find,
|
|
74
|
-
findPaginated,
|
|
75
|
-
findMinified,
|
|
76
|
-
findById,
|
|
77
|
-
create,
|
|
78
|
-
update,
|
|
79
|
-
deleteOne,
|
|
80
|
-
} = repository;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/* eslint-disable import/prefer-default-export */
|
|
2
|
-
import { Sessions as Entity } from '@nomalism-com/types';
|
|
3
|
-
import api from '../../shared/client';
|
|
4
|
-
import { serviceHostname, servicePublicPath } from '.';
|
|
5
|
-
|
|
6
|
-
export import ICreateRequest = Entity.ICreateRequest;
|
|
7
|
-
export import ICreateResponse = Entity.ICreateResponse;
|
|
8
|
-
|
|
9
|
-
export const route = `${serviceHostname}${servicePublicPath}sessions/`;
|
|
10
|
-
|
|
11
|
-
const repository = {
|
|
12
|
-
create: async (body: ICreateRequest): Promise<ICreateResponse> => {
|
|
13
|
-
const response = await api.post(`${route}`, body);
|
|
14
|
-
return response.data;
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const { create } = repository;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { shared, Shippings as Entity } from '@nomalism-com/types';
|
|
2
|
-
import api from '../../shared/client';
|
|
3
|
-
import { serviceHostname, serviceAuthPath } from '.';
|
|
4
|
-
|
|
5
|
-
export import IFindRequest = Entity.IFindRequest;
|
|
6
|
-
export import IFindResponse = Entity.IFindResponse;
|
|
7
|
-
|
|
8
|
-
export import IFindPaginatedRequest = Entity.IFindPaginatedRequest;
|
|
9
|
-
|
|
10
|
-
export import IFindByOwnerIdRequest = shared.IFindByOwnerIdRequest;
|
|
11
|
-
|
|
12
|
-
export import ICreateRequest = Entity.ICreateRequest;
|
|
13
|
-
export import IEntity = Entity.Entity;
|
|
14
|
-
|
|
15
|
-
export import IUpdateRequest = Entity.IUpdateRequest;
|
|
16
|
-
export type IPaginationResponse =
|
|
17
|
-
shared.IPaginationResponse<Entity.IFindResponse>;
|
|
18
|
-
|
|
19
|
-
export const route = `${serviceHostname}${serviceAuthPath}shipping/`;
|
|
20
|
-
|
|
21
|
-
const repository: Entity.IRepository = {
|
|
22
|
-
find: async (params: IFindRequest): Promise<IFindResponse[]> => {
|
|
23
|
-
const response = await api.get(`${route}`, { params });
|
|
24
|
-
return response.data;
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
findPaginated: async (
|
|
28
|
-
params: IFindPaginatedRequest,
|
|
29
|
-
): Promise<IPaginationResponse> => {
|
|
30
|
-
const response = await api.get(`${route}paginated`, { params });
|
|
31
|
-
return response.data;
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
findByOwnerId: async (
|
|
35
|
-
params: IFindByOwnerIdRequest,
|
|
36
|
-
): Promise<IFindResponse[]> => {
|
|
37
|
-
const response = await api.get(`${route}by_owner`, {
|
|
38
|
-
params,
|
|
39
|
-
});
|
|
40
|
-
return response.data;
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
findById: async (
|
|
44
|
-
selector: shared.IFindByIdRequest,
|
|
45
|
-
): Promise<IFindResponse | null> => {
|
|
46
|
-
const response = await api.get(`${route}${selector.id}`);
|
|
47
|
-
return response.data;
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
create: async (body: ICreateRequest): Promise<IEntity> => {
|
|
51
|
-
const response = await api.post(`${route}`, body);
|
|
52
|
-
return response.data;
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
update: async (
|
|
56
|
-
selector: shared.IFindByIdRequest,
|
|
57
|
-
body: IUpdateRequest,
|
|
58
|
-
): Promise<IEntity | null> => {
|
|
59
|
-
const response = await api.put(`${route}${selector.id}`, body);
|
|
60
|
-
return response.data;
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
deleteOne: async (
|
|
64
|
-
selector: shared.IFindByIdRequest,
|
|
65
|
-
): Promise<IEntity | null> => {
|
|
66
|
-
const response = await api.delete(`${route}${selector.id}`);
|
|
67
|
-
return response.data;
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export const {
|
|
72
|
-
find,
|
|
73
|
-
findPaginated,
|
|
74
|
-
findByOwnerId,
|
|
75
|
-
findById,
|
|
76
|
-
create,
|
|
77
|
-
update,
|
|
78
|
-
deleteOne,
|
|
79
|
-
} = repository;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { shared, SocialMedia as Entity } from '@nomalism-com/types';
|
|
2
|
-
import api from '../../shared/client';
|
|
3
|
-
import { serviceHostname, serviceAuthPath } from '.';
|
|
4
|
-
|
|
5
|
-
export import IFindRequest = Entity.IFindRequest;
|
|
6
|
-
export import IFindResponse = Entity.IFindResponse;
|
|
7
|
-
|
|
8
|
-
export import IFindPaginatedRequest = Entity.IFindPaginatedRequest;
|
|
9
|
-
|
|
10
|
-
export import IFindByOwnerIdRequest = shared.IFindByOwnerIdRequest;
|
|
11
|
-
|
|
12
|
-
export import ICreateRequest = Entity.ICreateRequest;
|
|
13
|
-
export import IEntity = Entity.Entity;
|
|
14
|
-
|
|
15
|
-
export import IUpdateRequest = Entity.IUpdateRequest;
|
|
16
|
-
export type IPaginationResponse =
|
|
17
|
-
shared.IPaginationResponse<Entity.IFindResponse>;
|
|
18
|
-
|
|
19
|
-
export const route = `${serviceHostname}${serviceAuthPath}social_media/`;
|
|
20
|
-
|
|
21
|
-
const repository: Entity.IRepository = {
|
|
22
|
-
find: async (params: IFindRequest): Promise<IFindResponse[]> => {
|
|
23
|
-
const response = await api.get(`${route}`, { params });
|
|
24
|
-
return response.data;
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
findPaginated: async (
|
|
28
|
-
params: IFindPaginatedRequest,
|
|
29
|
-
): Promise<IPaginationResponse> => {
|
|
30
|
-
const response = await api.get(`${route}paginated`, { params });
|
|
31
|
-
return response.data;
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
findByOwnerId: async (
|
|
35
|
-
params: IFindByOwnerIdRequest,
|
|
36
|
-
): Promise<IFindResponse[]> => {
|
|
37
|
-
const response = await api.get(`${route}by_owner`, {
|
|
38
|
-
params,
|
|
39
|
-
});
|
|
40
|
-
return response.data;
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
findById: async (
|
|
44
|
-
selector: shared.IFindByIdRequest,
|
|
45
|
-
): Promise<IFindResponse | null> => {
|
|
46
|
-
const response = await api.get(`${route}${selector.id}`);
|
|
47
|
-
return response.data;
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
create: async (body: ICreateRequest): Promise<IEntity> => {
|
|
51
|
-
const response = await api.post(`${route}`, body);
|
|
52
|
-
return response.data;
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
update: async (
|
|
56
|
-
selector: shared.IFindByIdRequest,
|
|
57
|
-
body: IUpdateRequest,
|
|
58
|
-
): Promise<IEntity | null> => {
|
|
59
|
-
const response = await api.put(`${route}${selector.id}`, body);
|
|
60
|
-
return response.data;
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
deleteOne: async (
|
|
64
|
-
selector: shared.IFindByIdRequest,
|
|
65
|
-
): Promise<IEntity | null> => {
|
|
66
|
-
const response = await api.delete(`${route}${selector.id}`);
|
|
67
|
-
return response.data;
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export const {
|
|
72
|
-
find,
|
|
73
|
-
findPaginated,
|
|
74
|
-
findByOwnerId,
|
|
75
|
-
findById,
|
|
76
|
-
create,
|
|
77
|
-
update,
|
|
78
|
-
deleteOne,
|
|
79
|
-
} = repository;
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { shared, StoreOperator as Entity } from '@nomalism-com/types';
|
|
2
|
-
import api from '../../shared/client';
|
|
3
|
-
import { serviceHostname, serviceAuthPath } from '.';
|
|
4
|
-
|
|
5
|
-
export import IFindRequest = Entity.IFindRequest;
|
|
6
|
-
export import IFindResponse = Entity.IFindResponse;
|
|
7
|
-
|
|
8
|
-
export import IFindPaginatedRequest = Entity.IFindPaginatedRequest;
|
|
9
|
-
|
|
10
|
-
export import IFindMinifiedRequest = shared.IFindMinifiedRequest;
|
|
11
|
-
export import IFindMinifiedResponse = shared.IFindMinifiedResponse;
|
|
12
|
-
|
|
13
|
-
export import IFindByOwnerIdRequest = shared.IFindByOwnerIdRequest;
|
|
14
|
-
export import IFindByOwnerIdResponse = Entity.IFindByOwnerIdResponse;
|
|
15
|
-
|
|
16
|
-
export import IFindByIdResponse = Entity.IFindByIdResponse;
|
|
17
|
-
|
|
18
|
-
export import ICreateRequest = Entity.ICreateRequest;
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20
|
-
export import IEntity = Entity.Entity;
|
|
21
|
-
|
|
22
|
-
export import IUpdateRequest = Entity.IUpdateRequest;
|
|
23
|
-
|
|
24
|
-
export import ICheckPinRequest = Entity.ICheckPinRequest;
|
|
25
|
-
export type IPaginationResponse =
|
|
26
|
-
shared.IPaginationResponse<Entity.IFindResponse>;
|
|
27
|
-
|
|
28
|
-
export const route = `${serviceHostname}${serviceAuthPath}store_operator/`;
|
|
29
|
-
|
|
30
|
-
const repository: Omit<Entity.IRepository, 'findUnique'> = {
|
|
31
|
-
find: async (params: IFindRequest): Promise<IFindResponse[]> => {
|
|
32
|
-
const response = await api.get(`${route}`, { params });
|
|
33
|
-
return response.data;
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
findPaginated: async (
|
|
37
|
-
params: IFindPaginatedRequest,
|
|
38
|
-
): Promise<IPaginationResponse> => {
|
|
39
|
-
const response = await api.get(`${route}paginated`, { params });
|
|
40
|
-
return response.data;
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
findMinified: async (
|
|
44
|
-
params?: IFindMinifiedRequest,
|
|
45
|
-
): Promise<IFindMinifiedResponse[]> => {
|
|
46
|
-
const response = await api.get(`${route}minified`, {
|
|
47
|
-
params,
|
|
48
|
-
});
|
|
49
|
-
return response.data;
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
findByOwnerId: async (
|
|
53
|
-
params: IFindByOwnerIdRequest,
|
|
54
|
-
): Promise<IFindByOwnerIdResponse[]> => {
|
|
55
|
-
const response = await api.get(`${route}by_owner`, {
|
|
56
|
-
params,
|
|
57
|
-
});
|
|
58
|
-
return response.data;
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
findById: async (
|
|
62
|
-
selector: shared.IFindByIdRequest,
|
|
63
|
-
): Promise<IFindByIdResponse | null> => {
|
|
64
|
-
const response = await api.get(`${route}${selector.id}`);
|
|
65
|
-
return response.data;
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
create: async (body: ICreateRequest): Promise<IFindResponse> => {
|
|
69
|
-
const response = await api.post(`${route}`, body);
|
|
70
|
-
return response.data;
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
update: async (
|
|
74
|
-
selector: shared.IFindByIdRequest,
|
|
75
|
-
body: IUpdateRequest,
|
|
76
|
-
): Promise<IFindResponse | null> => {
|
|
77
|
-
const response = await api.put(`${route}${selector.id}`, body);
|
|
78
|
-
return response.data;
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
deleteOne: async (
|
|
82
|
-
selector: shared.IFindByIdRequest,
|
|
83
|
-
): Promise<IFindResponse | null> => {
|
|
84
|
-
const response = await api.delete(`${route}${selector.id}`);
|
|
85
|
-
return response.data;
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
checkPin: async (data: ICheckPinRequest): Promise<IFindResponse> => {
|
|
89
|
-
const response = await api.post(`${route}pin`, data);
|
|
90
|
-
return response.data;
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export const {
|
|
95
|
-
find,
|
|
96
|
-
findPaginated,
|
|
97
|
-
findMinified,
|
|
98
|
-
findByOwnerId,
|
|
99
|
-
findById,
|
|
100
|
-
create,
|
|
101
|
-
update,
|
|
102
|
-
deleteOne,
|
|
103
|
-
checkPin,
|
|
104
|
-
} = repository;
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { shared, Swift as Entity } from '@nomalism-com/types';
|
|
2
|
-
import api from '../../shared/client';
|
|
3
|
-
import { serviceHostname, serviceAuthPath } from '.';
|
|
4
|
-
|
|
5
|
-
export import IFindRequest = Entity.IFindRequest;
|
|
6
|
-
export import IFindResponse = Entity.IFindResponse;
|
|
7
|
-
|
|
8
|
-
export import IFindPaginatedRequest = Entity.IFindPaginatedRequest;
|
|
9
|
-
|
|
10
|
-
export import IFindMinifiedRequest = shared.IFindMinifiedRequest;
|
|
11
|
-
export import IFindMinifiedResponse = shared.IFindMinifiedResponse;
|
|
12
|
-
|
|
13
|
-
export import ICreateRequest = Entity.ICreateRequest;
|
|
14
|
-
export import IEntity = Entity.Entity;
|
|
15
|
-
|
|
16
|
-
export import IUpdateRequest = Entity.IUpdateRequest;
|
|
17
|
-
export type IPaginationResponse =
|
|
18
|
-
shared.IPaginationResponse<Entity.IFindResponse>;
|
|
19
|
-
|
|
20
|
-
export const route = `${serviceHostname}${serviceAuthPath}swift/`;
|
|
21
|
-
|
|
22
|
-
const repository: Entity.IRepository = {
|
|
23
|
-
find: async (params: IFindRequest): Promise<IFindResponse[]> => {
|
|
24
|
-
const response = await api.get(`${route}`, { params });
|
|
25
|
-
return response.data;
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
findPaginated: async (
|
|
29
|
-
params: IFindPaginatedRequest,
|
|
30
|
-
): Promise<IPaginationResponse> => {
|
|
31
|
-
const response = await api.get(`${route}paginated`, { params });
|
|
32
|
-
return response.data;
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
findMinified: async (
|
|
36
|
-
params?: IFindMinifiedRequest,
|
|
37
|
-
): Promise<IFindMinifiedResponse[]> => {
|
|
38
|
-
const response = await api.get(`${route}minified`, {
|
|
39
|
-
params,
|
|
40
|
-
});
|
|
41
|
-
return response.data;
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
findById: async (
|
|
45
|
-
selector: shared.IFindByIdRequest,
|
|
46
|
-
): Promise<IFindResponse | null> => {
|
|
47
|
-
const response = await api.get(`${route}${selector.id}`);
|
|
48
|
-
return response.data;
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
create: async (body: ICreateRequest): Promise<IEntity> => {
|
|
52
|
-
const response = await api.post(`${route}`, body);
|
|
53
|
-
return response.data;
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
update: async (
|
|
57
|
-
selector: shared.IFindByIdRequest,
|
|
58
|
-
body: IUpdateRequest,
|
|
59
|
-
): Promise<IEntity | null> => {
|
|
60
|
-
const response = await api.put(`${route}${selector.id}`, body);
|
|
61
|
-
return response.data;
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
deleteOne: async (
|
|
65
|
-
selector: shared.IFindByIdRequest,
|
|
66
|
-
): Promise<IEntity | null> => {
|
|
67
|
-
const response = await api.delete(`${route}${selector.id}`);
|
|
68
|
-
return response.data;
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export const {
|
|
73
|
-
find,
|
|
74
|
-
findPaginated,
|
|
75
|
-
findMinified,
|
|
76
|
-
findById,
|
|
77
|
-
create,
|
|
78
|
-
update,
|
|
79
|
-
deleteOne,
|
|
80
|
-
} = repository;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { shared, Tenant as Entity } from '@nomalism-com/types';
|
|
2
|
-
import api from '../../shared/client';
|
|
3
|
-
import { serviceHostname, serviceAuthPath } from '.';
|
|
4
|
-
|
|
5
|
-
export import IEntity = Entity.Entity;
|
|
6
|
-
|
|
7
|
-
export import ICreateRequest = Entity.ICreateRequest;
|
|
8
|
-
export import IUpdateRequest = Entity.IUpdateRequest;
|
|
9
|
-
|
|
10
|
-
export const route = `${serviceHostname}${serviceAuthPath}tenant/`;
|
|
11
|
-
|
|
12
|
-
const repository: Entity.IRepository = {
|
|
13
|
-
create: async (body: ICreateRequest): Promise<IEntity> => {
|
|
14
|
-
const response = await api.post(`${route}`, body);
|
|
15
|
-
return response.data;
|
|
16
|
-
},
|
|
17
|
-
find: async (): Promise<IEntity[]> => {
|
|
18
|
-
const response = await api.get(`${route}`);
|
|
19
|
-
return response.data;
|
|
20
|
-
},
|
|
21
|
-
findById: async (
|
|
22
|
-
selector: shared.IFindByIdRequest,
|
|
23
|
-
): Promise<IEntity | null> => {
|
|
24
|
-
const response = await api.get(`${route}${selector.id}`);
|
|
25
|
-
return response.data;
|
|
26
|
-
},
|
|
27
|
-
update: async (
|
|
28
|
-
selector: shared.IFindByIdRequest,
|
|
29
|
-
body: IUpdateRequest,
|
|
30
|
-
): Promise<IEntity | null> => {
|
|
31
|
-
const response = await api.put(`${route}${selector.id}`, body);
|
|
32
|
-
return response.data;
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const { create, update, find, findById } = repository;
|
package/src/modules/user/user.ts
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { shared, Users as Entity } from '@nomalism-com/types';
|
|
2
|
-
import api from '../../shared/client';
|
|
3
|
-
import { serviceHostname, serviceAuthPath } from '.';
|
|
4
|
-
|
|
5
|
-
export import IFindRequest = Entity.IFindRequest;
|
|
6
|
-
export import IFindResponse = Entity.IFindResponse;
|
|
7
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
8
|
-
export import IFindByEmailResponse = Entity.IFindByEmailResponse;
|
|
9
|
-
|
|
10
|
-
export import IFindPaginatedRequest = Entity.IFindPaginatedRequest;
|
|
11
|
-
|
|
12
|
-
export import IFindMinifiedRequest = shared.IFindMinifiedRequest;
|
|
13
|
-
export import IFindMinifiedResponse = shared.IFindMinifiedResponse;
|
|
14
|
-
|
|
15
|
-
export import IFindByIdResponse = Entity.IFindByIdResponse;
|
|
16
|
-
|
|
17
|
-
export import IFindProvidersWithClientIdRequest = Entity.IFindProvidersWithClientIdRequest;
|
|
18
|
-
export import IFindProvidersWithClientIdResponse = Entity.IFindProvidersWithClientIdResponse;
|
|
19
|
-
|
|
20
|
-
export import ICreateRequest = Entity.ICreateRequest;
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
22
|
-
export import IEntity = Entity.Entity;
|
|
23
|
-
|
|
24
|
-
export import IUpdateRequest = Entity.IUpdateRequest;
|
|
25
|
-
export import IFindFromClientOrProviderRequest = Entity.IFindFromClientOrProviderRequest;
|
|
26
|
-
export import IFindFromClientOrProviderResponse = Entity.IFindFromClientOrProviderResponse;
|
|
27
|
-
export type IPaginationResponse =
|
|
28
|
-
shared.IPaginationResponse<Entity.IFindResponse>;
|
|
29
|
-
|
|
30
|
-
export const route = `${serviceHostname}${serviceAuthPath}users/`;
|
|
31
|
-
|
|
32
|
-
const repository: Omit<
|
|
33
|
-
Entity.IRepository,
|
|
34
|
-
'findByEmail' | 'resetPassword' | 'softDelete' | 'restoreDelete'
|
|
35
|
-
> = {
|
|
36
|
-
find: async (params: IFindRequest): Promise<IFindResponse[]> => {
|
|
37
|
-
const response = await api.get(`${route}`, { params });
|
|
38
|
-
return response.data;
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
findPaginated: async (
|
|
42
|
-
params: IFindPaginatedRequest,
|
|
43
|
-
): Promise<IPaginationResponse> => {
|
|
44
|
-
const response = await api.get(`${route}paginated`, { params });
|
|
45
|
-
return response.data;
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
findMinified: async (
|
|
49
|
-
params?: IFindMinifiedRequest,
|
|
50
|
-
): Promise<IFindMinifiedResponse[]> => {
|
|
51
|
-
const response = await api.get(`${route}minified`, {
|
|
52
|
-
params,
|
|
53
|
-
});
|
|
54
|
-
return response.data;
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
findById: async (
|
|
58
|
-
selector: shared.IFindByIdRequest,
|
|
59
|
-
): Promise<IFindByIdResponse | null> => {
|
|
60
|
-
const response = await api.get(`${route}${selector.id}`);
|
|
61
|
-
return response.data;
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
create: async (body: ICreateRequest): Promise<IFindResponse> => {
|
|
65
|
-
const response = await api.post(`${route}`, body);
|
|
66
|
-
return response.data;
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
update: async (
|
|
70
|
-
selector: shared.IFindByIdRequest,
|
|
71
|
-
body: IUpdateRequest,
|
|
72
|
-
): Promise<IFindResponse | null> => {
|
|
73
|
-
const response = await api.put(`${route}${selector.id}`, body);
|
|
74
|
-
return response.data;
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
deleteOne: async (
|
|
78
|
-
selector: shared.IFindByIdRequest,
|
|
79
|
-
): Promise<IFindResponse | null> => {
|
|
80
|
-
const response = await api.delete(`${route}${selector.id}`);
|
|
81
|
-
return response.data;
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
findProvidersWithClientId: async (
|
|
85
|
-
params: IFindProvidersWithClientIdRequest,
|
|
86
|
-
): Promise<IFindProvidersWithClientIdResponse[]> => {
|
|
87
|
-
const response = await api.get(`${route}/providers`, { params });
|
|
88
|
-
return response.data;
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
findFromClientOrProviderId: async (
|
|
92
|
-
params: IFindFromClientOrProviderRequest,
|
|
93
|
-
): Promise<IFindFromClientOrProviderResponse[]> => {
|
|
94
|
-
const response = await api.get(`${route}/from_client_or_provider_id`, {
|
|
95
|
-
params,
|
|
96
|
-
});
|
|
97
|
-
return response.data;
|
|
98
|
-
},
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
export const {
|
|
102
|
-
find,
|
|
103
|
-
findPaginated,
|
|
104
|
-
findMinified,
|
|
105
|
-
findById,
|
|
106
|
-
create,
|
|
107
|
-
update,
|
|
108
|
-
deleteOne,
|
|
109
|
-
findProvidersWithClientId,
|
|
110
|
-
findFromClientOrProviderId,
|
|
111
|
-
} = repository;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { shared, UserPermissions as Entity } from '@nomalism-com/types';
|
|
2
|
-
import api from '../../shared/client';
|
|
3
|
-
import { serviceHostname, serviceAuthPath } from '.';
|
|
4
|
-
|
|
5
|
-
export import IFindByOwnerIdRequest = shared.IFindByOwnerIdRequest;
|
|
6
|
-
export import IFindByOwnerIdResponse = Entity.IFindByOwnerIdResponse;
|
|
7
|
-
|
|
8
|
-
export import ICreateRequest = Entity.ICreateRequest;
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10
|
-
export import IEntity = Entity.Entity;
|
|
11
|
-
|
|
12
|
-
export const route = `${serviceHostname}${serviceAuthPath}user_permission/`;
|
|
13
|
-
|
|
14
|
-
const repository: Entity.IRepository = {
|
|
15
|
-
findByOwnerId: async (
|
|
16
|
-
params: IFindByOwnerIdRequest,
|
|
17
|
-
): Promise<IFindByOwnerIdResponse[]> => {
|
|
18
|
-
const response = await api.get(`${route}by_owner`, {
|
|
19
|
-
params,
|
|
20
|
-
});
|
|
21
|
-
return response.data;
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
create: async (body: ICreateRequest): Promise<IFindByOwnerIdResponse> => {
|
|
25
|
-
const response = await api.post(`${route}`, body);
|
|
26
|
-
return response.data;
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
deleteOne: async (
|
|
30
|
-
selector: shared.IFindByIdNumberRequest,
|
|
31
|
-
): Promise<IFindByOwnerIdResponse | null> => {
|
|
32
|
-
const response = await api.delete(`${route}${selector.id}`);
|
|
33
|
-
return response.data;
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const { findByOwnerId, create, deleteOne } = repository;
|