@nomalism-com/api 0.36.28 → 0.37.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +174 -247
- package/dist/index.d.ts +173 -204
- package/dist/index.js +174 -247
- package/package.json +17 -21
- package/.editorconfig +0 -9
- package/.prettierrc +0 -7
- package/eslint.config.mjs +0 -39
- package/package-lock.json +0 -4616
- package/src/index.ts +0 -3
- package/src/main.ts +0 -805
- package/src/modules/document/billOfLading.ts +0 -24
- package/src/modules/document/inventario.ts +0 -21
- package/src/modules/document/materialEntrance.ts +0 -81
- package/src/modules/document/order.ts +0 -52
- package/src/modules/document/productionOrder.ts +0 -23
- package/src/modules/document/proforma.ts +0 -22
- package/src/modules/document/propostaFornecedor.ts +0 -24
- package/src/modules/document/propostaSheets.ts +0 -87
- package/src/modules/document/providerCreditNoteFromReturn.ts +0 -32
- package/src/modules/document/providerFinancialCreditNote.ts +0 -32
- package/src/modules/document/providerServiceInvoice.ts +0 -23
- package/src/modules/document/purchase.ts +0 -40
- package/src/modules/document/quebra.ts +0 -41
- package/src/modules/document/returnToProvider.ts +0 -37
- package/src/modules/document/transformado.ts +0 -27
- package/src/modules/document/upfrontReturn.ts +0 -25
- package/src/modules/documentManagement/multimedia.ts +0 -39
- package/src/modules/integration/emailLog.ts +0 -43
- package/src/modules/integration/emailTemplate.ts +0 -44
- package/src/modules/integration/emailTemplateAttachment.ts +0 -26
- package/src/modules/integration/emailVerification.ts +0 -34
- package/src/modules/integration/googleFilePermission.ts +0 -43
- package/src/modules/integration/googleSheets.ts +0 -47
- package/src/modules/integration/observation.ts +0 -55
- package/src/modules/integration/observationType.ts +0 -53
- package/src/modules/integration/projectInfo.ts +0 -21
- package/src/modules/integration/settings.ts +0 -48
- package/src/modules/print/npc.ts +0 -39
- package/src/modules/print/printer.ts +0 -48
- package/src/modules/print/schedulePrintJob.ts +0 -45
- package/src/modules/stock/chat.ts +0 -54
- package/src/modules/stock/chatRapidMessage.ts +0 -48
- package/src/modules/stock/dashboard.ts +0 -24
- package/src/modules/stock/file.ts +0 -45
- package/src/modules/stock/location.ts +0 -74
- package/src/modules/stock/prison.ts +0 -46
- package/src/modules/stock/productGoogleSheets.ts +0 -175
- package/src/modules/stock/productImage.ts +0 -67
- package/src/modules/stock/promotion.ts +0 -107
- package/src/modules/stock/promotionAssoc.ts +0 -69
- package/src/modules/stock/queryList.ts +0 -72
- package/src/modules/stock/queryParameter.ts +0 -56
- package/src/modules/stock/recurrentTasks.ts +0 -25
- package/src/modules/stock/returnReason.ts +0 -42
- package/src/modules/stock/savedEmPicking.ts +0 -35
- package/src/modules/stock/savedProviderProposal.ts +0 -42
- package/src/modules/stock/schedule.ts +0 -21
- package/src/modules/stock/sideMenu.ts +0 -45
- package/src/modules/stock/stockMovement.ts +0 -56
- package/src/modules/stock/tag.ts +0 -37
- package/src/modules/stock/task.ts +0 -57
- package/src/modules/stock/taskMessage.ts +0 -33
- package/src/modules/stock/taskRead.ts +0 -25
- package/src/modules/stock/typeOfLocation.ts +0 -78
- package/src/modules/stock/unitOfMeasure.ts +0 -78
- package/src/modules/stock/vatTax.ts +0 -74
- package/src/modules/stock/vatTaxZone.ts +0 -78
- package/src/modules/supply/clientCurrentAccount.ts +0 -71
- package/src/modules/supply/documentHeader.ts +0 -195
- package/src/modules/supply/documentHeaderHistory.ts +0 -24
- package/src/modules/supply/documentLine.ts +0 -75
- package/src/modules/supply/documentLineAssoc.ts +0 -57
- package/src/modules/supply/documentLineMt.ts +0 -28
- package/src/modules/supply/documentLineNote.ts +0 -35
- package/src/modules/supply/documentLineRm.ts +0 -28
- package/src/modules/supply/documentSet.ts +0 -56
- package/src/modules/supply/documentType.ts +0 -60
- package/src/modules/supply/externalDocumentHeader.ts +0 -96
- package/src/modules/supply/externalDocumentType.ts +0 -29
- package/src/modules/supply/orderManagement.ts +0 -33
- package/src/modules/supply/payment.ts +0 -156
- package/src/modules/supply/preSale.ts +0 -72
- package/src/modules/supply/preSaleProduct.ts +0 -29
- package/src/modules/supply/providerCurrentAccount.ts +0 -26
- package/src/modules/supply/startDocumentHeaderLastUpdate.ts +0 -24
- package/src/modules/supply/vatValidation.ts +0 -26
- package/src/modules/supply/workflow.ts +0 -53
- package/src/modules/tickets/channel.ts +0 -54
- package/src/modules/tickets/clt.ts +0 -50
- package/src/modules/tickets/language.ts +0 -56
- package/src/modules/tickets/tickets.ts +0 -41
- package/src/modules/user/bankData.ts +0 -67
- package/src/modules/user/chatSubscriber.ts +0 -49
- package/src/modules/user/clientType.ts +0 -67
- package/src/modules/user/clients.ts +0 -89
- package/src/modules/user/commissioner.ts +0 -81
- package/src/modules/user/country.ts +0 -77
- package/src/modules/user/deliveryMethods.ts +0 -60
- package/src/modules/user/favorites.ts +0 -39
- package/src/modules/user/groupPermission.ts +0 -45
- package/src/modules/user/language.ts +0 -68
- package/src/modules/user/logout.ts +0 -20
- package/src/modules/user/maturityDates.ts +0 -60
- package/src/modules/user/password.ts +0 -25
- package/src/modules/user/paymentMethods.ts +0 -60
- package/src/modules/user/permission.ts +0 -43
- package/src/modules/user/persona.ts +0 -92
- package/src/modules/user/provider.ts +0 -90
- package/src/modules/user/providerType.ts +0 -70
- package/src/modules/user/purchaseCondition.ts +0 -69
- package/src/modules/user/reasonForExemption.ts +0 -69
- package/src/modules/user/refreshToken.ts +0 -24
- package/src/modules/user/segmentsArea.ts +0 -67
- package/src/modules/user/sessions.ts +0 -22
- package/src/modules/user/shippings.ts +0 -65
- package/src/modules/user/storeOperator.ts +0 -56
- package/src/modules/user/swift.ts +0 -65
- package/src/modules/user/tenant.ts +0 -42
- package/src/modules/user/theme.ts +0 -21
- package/src/modules/user/user.ts +0 -79
- package/src/modules/user/userPermission.ts +0 -40
- package/src/modules/user/userPositions.ts +0 -69
- package/src/modules/user/vehicles.ts +0 -42
- package/src/modules/user/zipCode.ts +0 -28
- package/src/modules/view/adminPanel.ts +0 -24
- package/src/modules/view/errorLog.ts +0 -21
- package/tsconfig.json +0 -18
- package/tsup.config.ts +0 -13
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import Nomalism from '@nomalism-com/types';
|
|
2
|
-
import { AxiosInstance } from 'axios';
|
|
3
|
-
import { IModuleConstructor } from '../../main';
|
|
4
|
-
|
|
5
|
-
export default class Repository implements Nomalism.ReasonForExemption.IRepository {
|
|
6
|
-
public route: string;
|
|
7
|
-
|
|
8
|
-
public publicRoute: string;
|
|
9
|
-
|
|
10
|
-
private api: AxiosInstance;
|
|
11
|
-
|
|
12
|
-
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
13
|
-
this.api = api;
|
|
14
|
-
this.route = route;
|
|
15
|
-
this.publicRoute = publicRoute;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async find(
|
|
19
|
-
params: Nomalism.ReasonForExemption.IFindRequest,
|
|
20
|
-
): Promise<Nomalism.ReasonForExemption.IFindResponse[]> {
|
|
21
|
-
const response = await this.api.get(`${this.route}`, { params });
|
|
22
|
-
return response.data;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async findPaginated(
|
|
26
|
-
params: Nomalism.ReasonForExemption.IFindPaginatedRequest,
|
|
27
|
-
): Promise<Nomalism.shared.IPaginationResponse<Nomalism.ReasonForExemption.IFindResponse>> {
|
|
28
|
-
const response = await this.api.get(`${this.route}paginated`, { params });
|
|
29
|
-
return response.data;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
async findMinified(
|
|
33
|
-
params?: Nomalism.shared.IFindMinifiedRequest,
|
|
34
|
-
): Promise<Nomalism.shared.IFindMinifiedResponse[]> {
|
|
35
|
-
const response = await this.api.get(`${this.route}minified`, {
|
|
36
|
-
params,
|
|
37
|
-
});
|
|
38
|
-
return response.data;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
async findById(
|
|
42
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
43
|
-
): Promise<Nomalism.ReasonForExemption.IFindResponse | null> {
|
|
44
|
-
const response = await this.api.get(`${this.route}${selector.id}`);
|
|
45
|
-
return response.data;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
async create(
|
|
49
|
-
body: Nomalism.ReasonForExemption.ICreateRequest,
|
|
50
|
-
): Promise<Nomalism.ReasonForExemption.Entity> {
|
|
51
|
-
const response = await this.api.post(`${this.route}`, body);
|
|
52
|
-
return response.data;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
async update(
|
|
56
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
57
|
-
body: Nomalism.ReasonForExemption.IUpdateRequest,
|
|
58
|
-
): Promise<Nomalism.ReasonForExemption.Entity | null> {
|
|
59
|
-
const response = await this.api.put(`${this.route}${selector.id}`, body);
|
|
60
|
-
return response.data;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
async deleteOne(
|
|
64
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
65
|
-
): Promise<Nomalism.ReasonForExemption.Entity | null> {
|
|
66
|
-
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
67
|
-
return response.data;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import Nomalism from '@nomalism-com/types';
|
|
2
|
-
import { AxiosInstance } from 'axios';
|
|
3
|
-
import { IModuleConstructor } from '../../main';
|
|
4
|
-
|
|
5
|
-
export default class Repository implements Nomalism.RefreshToken.IRepository {
|
|
6
|
-
public route: string;
|
|
7
|
-
|
|
8
|
-
public publicRoute: string;
|
|
9
|
-
|
|
10
|
-
private api: AxiosInstance;
|
|
11
|
-
|
|
12
|
-
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
13
|
-
this.api = api;
|
|
14
|
-
this.route = route;
|
|
15
|
-
this.publicRoute = publicRoute;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async create(
|
|
19
|
-
body: Nomalism.RefreshToken.ICreateRequest,
|
|
20
|
-
): Promise<Nomalism.RefreshToken.ICreateResponse> {
|
|
21
|
-
const response = await this.api.post(`${this.publicRoute}`, body);
|
|
22
|
-
return response.data;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import Nomalism from '@nomalism-com/types';
|
|
2
|
-
import { AxiosInstance } from 'axios';
|
|
3
|
-
import { IModuleConstructor } from '../../main';
|
|
4
|
-
|
|
5
|
-
export default class Repository implements Nomalism.SegmentsArea.IRepository {
|
|
6
|
-
public route: string;
|
|
7
|
-
|
|
8
|
-
public publicRoute: string;
|
|
9
|
-
|
|
10
|
-
private api: AxiosInstance;
|
|
11
|
-
|
|
12
|
-
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
13
|
-
this.api = api;
|
|
14
|
-
this.route = route;
|
|
15
|
-
this.publicRoute = publicRoute;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async find(
|
|
19
|
-
params: Nomalism.SegmentsArea.IFindRequest,
|
|
20
|
-
): Promise<Nomalism.SegmentsArea.IFindResponse[]> {
|
|
21
|
-
const response = await this.api.get(`${this.route}`, { params });
|
|
22
|
-
return response.data;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async findPaginated(
|
|
26
|
-
params: Nomalism.SegmentsArea.IFindPaginatedRequest,
|
|
27
|
-
): Promise<Nomalism.shared.IPaginationResponse<Nomalism.SegmentsArea.IFindResponse>> {
|
|
28
|
-
const response = await this.api.get(`${this.route}paginated`, { params });
|
|
29
|
-
return response.data;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
async findMinified(
|
|
33
|
-
params?: Nomalism.shared.IFindMinifiedRequest,
|
|
34
|
-
): Promise<Nomalism.shared.IFindMinifiedResponse[]> {
|
|
35
|
-
const response = await this.api.get(`${this.route}minified`, {
|
|
36
|
-
params,
|
|
37
|
-
});
|
|
38
|
-
return response.data;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
async findById(
|
|
42
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
43
|
-
): Promise<Nomalism.SegmentsArea.IFindResponse | null> {
|
|
44
|
-
const response = await this.api.get(`${this.route}${selector.id}`);
|
|
45
|
-
return response.data;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
async create(body: Nomalism.SegmentsArea.ICreateRequest): Promise<Nomalism.SegmentsArea.Entity> {
|
|
49
|
-
const response = await this.api.post(`${this.route}`, body);
|
|
50
|
-
return response.data;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
async update(
|
|
54
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
55
|
-
body: Nomalism.SegmentsArea.IUpdateRequest,
|
|
56
|
-
): Promise<Nomalism.SegmentsArea.Entity | null> {
|
|
57
|
-
const response = await this.api.put(`${this.route}${selector.id}`, body);
|
|
58
|
-
return response.data;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
async deleteOne(
|
|
62
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
63
|
-
): Promise<Nomalism.SegmentsArea.Entity | null> {
|
|
64
|
-
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
65
|
-
return response.data;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import Nomalism from '@nomalism-com/types';
|
|
2
|
-
import { AxiosInstance } from 'axios';
|
|
3
|
-
import { IModuleConstructor } from '../../main';
|
|
4
|
-
|
|
5
|
-
export default class Repository implements Nomalism.Sessions.IRepository {
|
|
6
|
-
public route: string;
|
|
7
|
-
|
|
8
|
-
public publicRoute: string;
|
|
9
|
-
|
|
10
|
-
private api: AxiosInstance;
|
|
11
|
-
|
|
12
|
-
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
13
|
-
this.api = api;
|
|
14
|
-
this.route = route;
|
|
15
|
-
this.publicRoute = publicRoute;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async create(body: Nomalism.Sessions.ICreateRequest): Promise<Nomalism.Sessions.ICreateResponse> {
|
|
19
|
-
const response = await this.api.post(`${this.publicRoute}`, body);
|
|
20
|
-
return response.data;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import Nomalism from '@nomalism-com/types';
|
|
2
|
-
import { AxiosInstance } from 'axios';
|
|
3
|
-
import { IModuleConstructor } from '../../main';
|
|
4
|
-
|
|
5
|
-
export default class Repository implements Nomalism.Shippings.IRepository {
|
|
6
|
-
public route: string;
|
|
7
|
-
|
|
8
|
-
public publicRoute: string;
|
|
9
|
-
|
|
10
|
-
private api: AxiosInstance;
|
|
11
|
-
|
|
12
|
-
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
13
|
-
this.api = api;
|
|
14
|
-
this.route = route;
|
|
15
|
-
this.publicRoute = publicRoute;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async find(params: Nomalism.Shippings.IFindRequest): Promise<Nomalism.Shippings.IFindResponse[]> {
|
|
19
|
-
const response = await this.api.get(`${this.route}`, { params });
|
|
20
|
-
return response.data;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async findPaginated(
|
|
24
|
-
params: Nomalism.Shippings.IFindPaginatedRequest,
|
|
25
|
-
): Promise<Nomalism.shared.IPaginationResponse<Nomalism.Shippings.IFindResponse>> {
|
|
26
|
-
const response = await this.api.get(`${this.route}paginated`, { params });
|
|
27
|
-
return response.data;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
async findByOwnerId(
|
|
31
|
-
params: Nomalism.shared.IFindByOwnerIdRequest,
|
|
32
|
-
): Promise<Nomalism.Shippings.IFindResponse[]> {
|
|
33
|
-
const response = await this.api.get(`${this.route}by_owner`, {
|
|
34
|
-
params,
|
|
35
|
-
});
|
|
36
|
-
return response.data;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
async findById(
|
|
40
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
41
|
-
): Promise<Nomalism.Shippings.IFindResponse | null> {
|
|
42
|
-
const response = await this.api.get(`${this.route}${selector.id}`);
|
|
43
|
-
return response.data;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async create(body: Nomalism.Shippings.ICreateRequest): Promise<Nomalism.Shippings.Entity> {
|
|
47
|
-
const response = await this.api.post(`${this.route}`, body);
|
|
48
|
-
return response.data;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
async update(
|
|
52
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
53
|
-
body: Nomalism.Shippings.IUpdateRequest,
|
|
54
|
-
): Promise<Nomalism.Shippings.Entity | null> {
|
|
55
|
-
const response = await this.api.put(`${this.route}${selector.id}`, body);
|
|
56
|
-
return response.data;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
async deleteOne(
|
|
60
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
61
|
-
): Promise<Nomalism.Shippings.Entity | null> {
|
|
62
|
-
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
63
|
-
return response.data;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import Nomalism from '@nomalism-com/types';
|
|
2
|
-
import { AxiosInstance } from 'axios';
|
|
3
|
-
import { IModuleConstructor } from '../../main';
|
|
4
|
-
|
|
5
|
-
export default class Repository implements Nomalism.StoreOperator.IRepository {
|
|
6
|
-
public route: string;
|
|
7
|
-
|
|
8
|
-
public publicRoute: string;
|
|
9
|
-
|
|
10
|
-
private api: AxiosInstance;
|
|
11
|
-
|
|
12
|
-
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
13
|
-
this.api = api;
|
|
14
|
-
this.route = route;
|
|
15
|
-
this.publicRoute = publicRoute;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async find(): Promise<Nomalism.StoreOperator.IFindResponse[]> {
|
|
19
|
-
const response = await this.api.get(`${this.route}`);
|
|
20
|
-
return response.data;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async findPaginated(
|
|
24
|
-
params: Nomalism.StoreOperator.IFindPaginatedRequest,
|
|
25
|
-
): Promise<Nomalism.shared.IPaginationResponse<Nomalism.StoreOperator.IFindResponse>> {
|
|
26
|
-
const response = await this.api.get(`${this.route}paginated`, { params });
|
|
27
|
-
return response.data;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
async findMinified(
|
|
31
|
-
params?: Nomalism.shared.IFindMinifiedRequest,
|
|
32
|
-
): Promise<Nomalism.shared.IFindMinifiedResponse[]> {
|
|
33
|
-
const response = await this.api.get(`${this.route}minified`, {
|
|
34
|
-
params,
|
|
35
|
-
});
|
|
36
|
-
return response.data;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
async create(body: Nomalism.StoreOperator.ICreateRequest): Promise<string> {
|
|
40
|
-
const response = await this.api.post(`${this.route}`, body);
|
|
41
|
-
return response.data;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
async update(
|
|
45
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
46
|
-
body: Nomalism.StoreOperator.IUpdateRequest,
|
|
47
|
-
): Promise<void> {
|
|
48
|
-
const response = await this.api.put(`${this.route}${selector.id}`, body);
|
|
49
|
-
return response.data;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
async deleteOne(selector: Nomalism.shared.IFindByIdRequest): Promise<void> {
|
|
53
|
-
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
54
|
-
return response.data;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import Nomalism from '@nomalism-com/types';
|
|
2
|
-
import { AxiosInstance } from 'axios';
|
|
3
|
-
import { IModuleConstructor } from '../../main';
|
|
4
|
-
|
|
5
|
-
export type IPaginationResponse = Nomalism.shared.IPaginationResponse<Nomalism.Swift.IFindResponse>;
|
|
6
|
-
|
|
7
|
-
export default class Repository implements Nomalism.Swift.IRepository {
|
|
8
|
-
public route: string;
|
|
9
|
-
|
|
10
|
-
public publicRoute: string;
|
|
11
|
-
|
|
12
|
-
private api: AxiosInstance;
|
|
13
|
-
|
|
14
|
-
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
15
|
-
this.api = api;
|
|
16
|
-
this.route = route;
|
|
17
|
-
this.publicRoute = publicRoute;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async find(params: Nomalism.Swift.IFindRequest): Promise<Nomalism.Swift.IFindResponse[]> {
|
|
21
|
-
const response = await this.api.get(`${this.route}`, { params });
|
|
22
|
-
return response.data;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async findPaginated(params: Nomalism.Swift.IFindPaginatedRequest): Promise<IPaginationResponse> {
|
|
26
|
-
const response = await this.api.get(`${this.route}paginated`, { params });
|
|
27
|
-
return response.data;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
async findMinified(
|
|
31
|
-
params?: Nomalism.shared.IFindMinifiedRequest,
|
|
32
|
-
): Promise<Nomalism.shared.IFindMinifiedResponse[]> {
|
|
33
|
-
const response = await this.api.get(`${this.route}minified`, {
|
|
34
|
-
params,
|
|
35
|
-
});
|
|
36
|
-
return response.data;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
async findById(
|
|
40
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
41
|
-
): Promise<Nomalism.Swift.IFindResponse | null> {
|
|
42
|
-
const response = await this.api.get(`${this.route}${selector.id}`);
|
|
43
|
-
return response.data;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async create(body: Nomalism.Swift.ICreateRequest): Promise<Nomalism.Swift.Entity> {
|
|
47
|
-
const response = await this.api.post(`${this.route}`, body);
|
|
48
|
-
return response.data;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
async update(
|
|
52
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
53
|
-
body: Nomalism.Swift.IUpdateRequest,
|
|
54
|
-
): Promise<Nomalism.Swift.Entity | null> {
|
|
55
|
-
const response = await this.api.put(`${this.route}${selector.id}`, body);
|
|
56
|
-
return response.data;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
async deleteOne(
|
|
60
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
61
|
-
): Promise<Nomalism.Swift.Entity | null> {
|
|
62
|
-
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
63
|
-
return response.data;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import Nomalism from '@nomalism-com/types';
|
|
2
|
-
import { AxiosInstance } from 'axios';
|
|
3
|
-
import { IModuleConstructor } from '../../main';
|
|
4
|
-
|
|
5
|
-
export default class Repository implements Nomalism.Tenant.IRepository {
|
|
6
|
-
public route: string;
|
|
7
|
-
|
|
8
|
-
public publicRoute: string;
|
|
9
|
-
|
|
10
|
-
private api: AxiosInstance;
|
|
11
|
-
|
|
12
|
-
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
13
|
-
this.api = api;
|
|
14
|
-
this.route = route;
|
|
15
|
-
this.publicRoute = publicRoute;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async create(body: Nomalism.Tenant.ICreateRequest): Promise<Nomalism.Tenant.Entity> {
|
|
19
|
-
const response = await this.api.post(`${this.route}`, body);
|
|
20
|
-
return response.data;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async find(): Promise<Nomalism.Tenant.Entity[]> {
|
|
24
|
-
const response = await this.api.get(`${this.route}`);
|
|
25
|
-
return response.data;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
async findById(
|
|
29
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
30
|
-
): Promise<Nomalism.Tenant.Entity | null> {
|
|
31
|
-
const response = await this.api.get(`${this.route}${selector.id}`);
|
|
32
|
-
return response.data;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
async update(
|
|
36
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
37
|
-
body: Nomalism.Tenant.IUpdateRequest,
|
|
38
|
-
): Promise<Nomalism.Tenant.Entity | null> {
|
|
39
|
-
const response = await this.api.put(`${this.route}${selector.id}`, body);
|
|
40
|
-
return response.data;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import Nomalism from '@nomalism-com/types';
|
|
2
|
-
import { AxiosInstance } from 'axios';
|
|
3
|
-
import { IModuleConstructor } from '../../main';
|
|
4
|
-
|
|
5
|
-
export default class Repository implements Nomalism.Theme.IRepository {
|
|
6
|
-
public route: string;
|
|
7
|
-
|
|
8
|
-
public publicRoute: string;
|
|
9
|
-
|
|
10
|
-
private api: AxiosInstance;
|
|
11
|
-
|
|
12
|
-
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
13
|
-
this.api = api;
|
|
14
|
-
this.route = route;
|
|
15
|
-
this.publicRoute = publicRoute;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async createOrUpdate(body: Nomalism.Theme.ICreateOrUpdateRequest): Promise<void> {
|
|
19
|
-
await this.api.post(`${this.route}`, body);
|
|
20
|
-
}
|
|
21
|
-
}
|
package/src/modules/user/user.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import Nomalism from '@nomalism-com/types';
|
|
2
|
-
import { AxiosInstance } from 'axios';
|
|
3
|
-
import { IModuleConstructor } from '../../main';
|
|
4
|
-
|
|
5
|
-
export default class Repository implements Nomalism.Users.IApi {
|
|
6
|
-
public route: string;
|
|
7
|
-
|
|
8
|
-
public publicRoute: string;
|
|
9
|
-
|
|
10
|
-
private api: AxiosInstance;
|
|
11
|
-
|
|
12
|
-
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
13
|
-
this.api = api;
|
|
14
|
-
this.route = route;
|
|
15
|
-
this.publicRoute = publicRoute;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async find(params: Nomalism.Users.IFindRequest): Promise<Nomalism.Users.IFindResponse[]> {
|
|
19
|
-
const response = await this.api.get(`${this.route}`, { params });
|
|
20
|
-
return response.data;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async findPaginated(
|
|
24
|
-
params: Nomalism.Users.IFindPaginatedRequest,
|
|
25
|
-
): Promise<Nomalism.shared.IPaginationResponse<Nomalism.Users.IFindResponse>> {
|
|
26
|
-
const response = await this.api.get(`${this.route}paginated`, { params });
|
|
27
|
-
return response.data;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
async findMinified(
|
|
31
|
-
params?: Nomalism.shared.IFindMinifiedRequest,
|
|
32
|
-
): Promise<Nomalism.shared.IFindMinifiedResponse[]> {
|
|
33
|
-
const response = await this.api.get(`${this.route}minified`, {
|
|
34
|
-
params,
|
|
35
|
-
});
|
|
36
|
-
return response.data;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
async findById(
|
|
40
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
41
|
-
): Promise<Nomalism.Users.IFindByIdResponse | null> {
|
|
42
|
-
const response = await this.api.get(`${this.route}${selector.id}`);
|
|
43
|
-
return response.data;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async create(body: Nomalism.Users.ICreateRequest): Promise<Nomalism.Users.IFindResponse> {
|
|
47
|
-
const response = await this.api.post(`${this.route}`, body);
|
|
48
|
-
return response.data;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
async update(
|
|
52
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
53
|
-
body: Nomalism.Users.IUpdateRequest,
|
|
54
|
-
): Promise<Nomalism.Users.IFindResponse | null> {
|
|
55
|
-
const response = await this.api.put(`${this.route}${selector.id}`, body);
|
|
56
|
-
return response.data;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
async deleteOne(
|
|
60
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
61
|
-
): Promise<Nomalism.Users.IFindResponse | null> {
|
|
62
|
-
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
63
|
-
return response.data;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
async findProvidersWithClientId(
|
|
67
|
-
body: Nomalism.Users.IFindProvidersWithClientIdRequest,
|
|
68
|
-
): Promise<Nomalism.Users.IFindProvidersWithClientIdResponse[]> {
|
|
69
|
-
const response = await this.api.post(`${this.route}providers`, body);
|
|
70
|
-
return response.data;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
async findFromClientOrProviderId(
|
|
74
|
-
body: Nomalism.Users.IFindFromClientOrProviderRequest,
|
|
75
|
-
): Promise<Nomalism.Users.IFindFromClientOrProviderResponse[]> {
|
|
76
|
-
const response = await this.api.post(`${this.route}from_client_or_provider_id`, body);
|
|
77
|
-
return response.data;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import Nomalism from '@nomalism-com/types';
|
|
2
|
-
import { AxiosInstance } from 'axios';
|
|
3
|
-
import { IModuleConstructor } from '../../main';
|
|
4
|
-
|
|
5
|
-
export default class Repository implements Nomalism.UserPermissions.IRepository {
|
|
6
|
-
public route: string;
|
|
7
|
-
|
|
8
|
-
public publicRoute: string;
|
|
9
|
-
|
|
10
|
-
private api: AxiosInstance;
|
|
11
|
-
|
|
12
|
-
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
13
|
-
this.api = api;
|
|
14
|
-
this.route = route;
|
|
15
|
-
this.publicRoute = publicRoute;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async findByOwnerId(
|
|
19
|
-
params: Nomalism.shared.IFindByOwnerIdRequest,
|
|
20
|
-
): Promise<Nomalism.UserPermissions.IFindByOwnerIdResponse[]> {
|
|
21
|
-
const response = await this.api.get(`${this.route}by_owner`, {
|
|
22
|
-
params,
|
|
23
|
-
});
|
|
24
|
-
return response.data;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async create(
|
|
28
|
-
body: Nomalism.UserPermissions.ICreateRequest,
|
|
29
|
-
): Promise<Nomalism.UserPermissions.IFindByOwnerIdResponse> {
|
|
30
|
-
const response = await this.api.post(`${this.route}`, body);
|
|
31
|
-
return response.data;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
async deleteOne(
|
|
35
|
-
selector: Nomalism.shared.IFindByIdNumberRequest,
|
|
36
|
-
): Promise<Nomalism.UserPermissions.IFindByOwnerIdResponse | null> {
|
|
37
|
-
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
38
|
-
return response.data;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import Nomalism from '@nomalism-com/types';
|
|
2
|
-
import { AxiosInstance } from 'axios';
|
|
3
|
-
import { IModuleConstructor } from '../../main';
|
|
4
|
-
|
|
5
|
-
export default class Repository implements Nomalism.UserPositions.IRepository {
|
|
6
|
-
public route: string;
|
|
7
|
-
|
|
8
|
-
public publicRoute: string;
|
|
9
|
-
|
|
10
|
-
private api: AxiosInstance;
|
|
11
|
-
|
|
12
|
-
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
13
|
-
this.api = api;
|
|
14
|
-
this.route = route;
|
|
15
|
-
this.publicRoute = publicRoute;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async find(
|
|
19
|
-
params: Nomalism.UserPositions.IFindRequest,
|
|
20
|
-
): Promise<Nomalism.UserPositions.IFindResponse[]> {
|
|
21
|
-
const response = await this.api.get(`${this.route}`, { params });
|
|
22
|
-
return response.data;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async findPaginated(
|
|
26
|
-
params: Nomalism.UserPositions.IFindPaginatedRequest,
|
|
27
|
-
): Promise<Nomalism.shared.IPaginationResponse<Nomalism.UserPositions.IFindResponse>> {
|
|
28
|
-
const response = await this.api.get(`${this.route}paginated`, { params });
|
|
29
|
-
return response.data;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
async findMinified(
|
|
33
|
-
params?: Nomalism.shared.IFindMinifiedRequest,
|
|
34
|
-
): Promise<Nomalism.shared.IFindMinifiedResponse[]> {
|
|
35
|
-
const response = await this.api.get(`${this.route}minified`, {
|
|
36
|
-
params,
|
|
37
|
-
});
|
|
38
|
-
return response.data;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
async findById(
|
|
42
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
43
|
-
): Promise<Nomalism.UserPositions.IFindResponse | null> {
|
|
44
|
-
const response = await this.api.get(`${this.route}${selector.id}`);
|
|
45
|
-
return response.data;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
async create(
|
|
49
|
-
body: Nomalism.UserPositions.ICreateRequest,
|
|
50
|
-
): Promise<Nomalism.UserPositions.Entity> {
|
|
51
|
-
const response = await this.api.post(`${this.route}`, body);
|
|
52
|
-
return response.data;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
async update(
|
|
56
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
57
|
-
body: Nomalism.UserPositions.IUpdateRequest,
|
|
58
|
-
): Promise<Nomalism.UserPositions.Entity | null> {
|
|
59
|
-
const response = await this.api.put(`${this.route}${selector.id}`, body);
|
|
60
|
-
return response.data;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
async deleteOne(
|
|
64
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
65
|
-
): Promise<Nomalism.UserPositions.Entity | null> {
|
|
66
|
-
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
67
|
-
return response.data;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import Nomalism from '@nomalism-com/types';
|
|
2
|
-
import { AxiosInstance } from 'axios';
|
|
3
|
-
import { IModuleConstructor } from '../../main';
|
|
4
|
-
|
|
5
|
-
export default class Repository implements Nomalism.Vehicles.IApi {
|
|
6
|
-
public route: string;
|
|
7
|
-
|
|
8
|
-
public publicRoute: string;
|
|
9
|
-
|
|
10
|
-
private api: AxiosInstance;
|
|
11
|
-
|
|
12
|
-
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
13
|
-
this.api = api;
|
|
14
|
-
this.route = route;
|
|
15
|
-
this.publicRoute = publicRoute;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async find(): Promise<Nomalism.Vehicles.Entity[]> {
|
|
19
|
-
const response = await this.api.get(`${this.route}`);
|
|
20
|
-
return response.data;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async create(body: Nomalism.Vehicles.ICreateRequest): Promise<Nomalism.Vehicles.Entity> {
|
|
24
|
-
const response = await this.api.post(`${this.route}`, body);
|
|
25
|
-
return response.data;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
async update(
|
|
29
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
30
|
-
body: Nomalism.Vehicles.IUpdateRequest,
|
|
31
|
-
): Promise<Nomalism.Vehicles.Entity | null> {
|
|
32
|
-
const response = await this.api.put(`${this.route}${selector.id}`, body);
|
|
33
|
-
return response.data;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
async deleteOne(
|
|
37
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
38
|
-
): Promise<Nomalism.Vehicles.Entity | null> {
|
|
39
|
-
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
40
|
-
return response.data;
|
|
41
|
-
}
|
|
42
|
-
}
|