@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,39 +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.Favorites.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 findByUrl(params: Nomalism.Favorites.IFindOneRequest): Promise<boolean> {
|
|
19
|
-
const response = await this.api.get(`${this.route}`, { params });
|
|
20
|
-
return response.data;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async list(): Promise<Nomalism.Favorites.Entity[]> {
|
|
24
|
-
const response = await this.api.get(`${this.route}list`);
|
|
25
|
-
return response.data;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
async create(body: Nomalism.Favorites.ICreateRequest): Promise<Nomalism.Favorites.Entity> {
|
|
29
|
-
const response = await this.api.post(`${this.route}`, body);
|
|
30
|
-
return response.data;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
async deleteOne(
|
|
34
|
-
params: Nomalism.Favorites.IDeleteRequest,
|
|
35
|
-
): Promise<Nomalism.Favorites.Entity | null> {
|
|
36
|
-
const response = await this.api.delete(`${this.route}`, { params });
|
|
37
|
-
return response.data;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,45 +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.GroupPermissions.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.GroupPermissions.Entity[]> {
|
|
19
|
-
const response = await this.api.get(`${this.route}`);
|
|
20
|
-
return response.data;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async findMinified(
|
|
24
|
-
params?: Nomalism.shared.IFindMinifiedRequest,
|
|
25
|
-
): Promise<Nomalism.shared.IFindMinifiedResponse[]> {
|
|
26
|
-
const response = await this.api.get(`${this.route}minified`, {
|
|
27
|
-
params,
|
|
28
|
-
});
|
|
29
|
-
return response.data;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
async create(
|
|
33
|
-
body: Nomalism.GroupPermissions.ICreateRequest,
|
|
34
|
-
): Promise<Nomalism.GroupPermissions.Entity> {
|
|
35
|
-
const response = await this.api.post(`${this.route}`, body);
|
|
36
|
-
return response.data;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
async deleteOne(
|
|
40
|
-
selector: Nomalism.shared.IFindByIdNumberRequest,
|
|
41
|
-
): Promise<Nomalism.GroupPermissions.Entity | null> {
|
|
42
|
-
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
43
|
-
return response.data;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import Nomalism from '@nomalism-com/types';
|
|
2
|
-
import { AxiosInstance } from 'axios';
|
|
3
|
-
import { IModuleConstructor } from '../../main';
|
|
4
|
-
|
|
5
|
-
export type IPaginationResponse =
|
|
6
|
-
Nomalism.shared.IPaginationResponse<Nomalism.Language.IFindResponse>;
|
|
7
|
-
|
|
8
|
-
export default class Repository implements Nomalism.Language.IRepository {
|
|
9
|
-
public route: string;
|
|
10
|
-
|
|
11
|
-
public publicRoute: string;
|
|
12
|
-
|
|
13
|
-
private api: AxiosInstance;
|
|
14
|
-
|
|
15
|
-
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
16
|
-
this.api = api;
|
|
17
|
-
this.route = route;
|
|
18
|
-
this.publicRoute = publicRoute;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
async find(params: Nomalism.Language.IFindRequest): Promise<Nomalism.Language.IFindResponse[]> {
|
|
22
|
-
const response = await this.api.get(`${this.route}`, { params });
|
|
23
|
-
return response.data;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
async findPaginated(
|
|
27
|
-
params: Nomalism.Language.IFindPaginatedRequest,
|
|
28
|
-
): Promise<IPaginationResponse> {
|
|
29
|
-
const response = await this.api.get(`${this.route}paginated`, { params });
|
|
30
|
-
return response.data;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
async findMinified(
|
|
34
|
-
params?: Nomalism.shared.IFindMinifiedRequest,
|
|
35
|
-
): Promise<Nomalism.shared.IFindMinifiedResponse[]> {
|
|
36
|
-
const response = await this.api.get(`${this.route}minified`, {
|
|
37
|
-
params,
|
|
38
|
-
});
|
|
39
|
-
return response.data;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
async findById(
|
|
43
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
44
|
-
): Promise<Nomalism.Language.IFindResponse | null> {
|
|
45
|
-
const response = await this.api.get(`${this.route}${selector.id}`);
|
|
46
|
-
return response.data;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
async create(body: Nomalism.Language.ICreateRequest): Promise<Nomalism.Language.Entity> {
|
|
50
|
-
const response = await this.api.post(`${this.route}`, body);
|
|
51
|
-
return response.data;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
async update(
|
|
55
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
56
|
-
body: Nomalism.Language.IUpdateRequest,
|
|
57
|
-
): Promise<Nomalism.Language.Entity | null> {
|
|
58
|
-
const response = await this.api.put(`${this.route}${selector.id}`, body);
|
|
59
|
-
return response.data;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
async deleteOne(
|
|
63
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
64
|
-
): Promise<Nomalism.Language.Entity | null> {
|
|
65
|
-
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
66
|
-
return response.data;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { AxiosInstance } from 'axios';
|
|
2
|
-
import { IModuleConstructor } from '../../main';
|
|
3
|
-
|
|
4
|
-
export default class Repository {
|
|
5
|
-
public route: string;
|
|
6
|
-
|
|
7
|
-
public publicRoute: string;
|
|
8
|
-
|
|
9
|
-
private api: AxiosInstance;
|
|
10
|
-
|
|
11
|
-
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
12
|
-
this.api = api;
|
|
13
|
-
this.route = route;
|
|
14
|
-
this.publicRoute = publicRoute;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
async logout(): Promise<void> {
|
|
18
|
-
await this.api.post(`${this.route}`);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,60 +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.MaturityDates.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.MaturityDates.Entity[]> {
|
|
19
|
-
const response = await this.api.get(`${this.route}`);
|
|
20
|
-
return response.data;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async findById(
|
|
24
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
25
|
-
): Promise<Nomalism.MaturityDates.Entity | null> {
|
|
26
|
-
const response = await this.api.get(`${this.route}${selector.id}`);
|
|
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(
|
|
40
|
-
body: Nomalism.MaturityDates.ICreateRequest,
|
|
41
|
-
): Promise<Nomalism.MaturityDates.Entity> {
|
|
42
|
-
const response = await this.api.post(`${this.route}`, body);
|
|
43
|
-
return response.data;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async update(
|
|
47
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
48
|
-
body: Nomalism.MaturityDates.IUpdateRequest,
|
|
49
|
-
): Promise<Nomalism.MaturityDates.Entity | null> {
|
|
50
|
-
const response = await this.api.put(`${this.route}${selector.id}`, body);
|
|
51
|
-
return response.data;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
async deleteOne(
|
|
55
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
56
|
-
): Promise<Nomalism.MaturityDates.Entity | null> {
|
|
57
|
-
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
58
|
-
return response.data;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
@@ -1,25 +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.Password.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 forgotPassword(body: Nomalism.Password.IForgotPassword): Promise<void> {
|
|
19
|
-
await this.api.post(`${this.publicRoute}forgot`, body);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
async resetPassword(body: Nomalism.Password.IResetPassword): Promise<void> {
|
|
23
|
-
await this.api.post(`${this.publicRoute}reset`, body);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,60 +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.PaymentMethods.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.PaymentMethods.Entity[]> {
|
|
19
|
-
const response = await this.api.get(`${this.route}`);
|
|
20
|
-
return response.data;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async findById(
|
|
24
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
25
|
-
): Promise<Nomalism.PaymentMethods.Entity | null> {
|
|
26
|
-
const response = await this.api.get(`${this.route}${selector.id}`);
|
|
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(
|
|
40
|
-
body: Nomalism.PaymentMethods.ICreateRequest,
|
|
41
|
-
): Promise<Nomalism.PaymentMethods.Entity> {
|
|
42
|
-
const response = await this.api.post(`${this.route}`, body);
|
|
43
|
-
return response.data;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async update(
|
|
47
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
48
|
-
body: Nomalism.PaymentMethods.IUpdateRequest,
|
|
49
|
-
): Promise<Nomalism.PaymentMethods.Entity | null> {
|
|
50
|
-
const response = await this.api.put(`${this.route}${selector.id}`, body);
|
|
51
|
-
return response.data;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
async deleteOne(
|
|
55
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
56
|
-
): Promise<Nomalism.PaymentMethods.Entity | null> {
|
|
57
|
-
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
58
|
-
return response.data;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
@@ -1,43 +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.Permissions.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.Permissions.Entity[]> {
|
|
19
|
-
const response = await this.api.get(`${this.route}`);
|
|
20
|
-
return response.data;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async findMinified(
|
|
24
|
-
params?: Nomalism.shared.IFindMinifiedRequest,
|
|
25
|
-
): Promise<Nomalism.shared.IFindMinifiedResponse[]> {
|
|
26
|
-
const response = await this.api.get(`${this.route}minified`, {
|
|
27
|
-
params,
|
|
28
|
-
});
|
|
29
|
-
return response.data;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
async create(body: Nomalism.Permissions.ICreateRequest): Promise<Nomalism.Permissions.Entity> {
|
|
33
|
-
const response = await this.api.post(`${this.route}`, body);
|
|
34
|
-
return response.data;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
async deleteOne(
|
|
38
|
-
selector: Nomalism.shared.IFindByIdNumberRequest,
|
|
39
|
-
): Promise<Nomalism.Permissions.Entity | null> {
|
|
40
|
-
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
41
|
-
return response.data;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
@@ -1,92 +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.Persona.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.Persona.IFindByOwnerIdResponse[]> {
|
|
21
|
-
const response = await this.api.get(`${this.route}by_owner`, {
|
|
22
|
-
params,
|
|
23
|
-
});
|
|
24
|
-
return response.data;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async findById(
|
|
28
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
29
|
-
): Promise<Nomalism.Persona.IEntityExtended | null> {
|
|
30
|
-
const response = await this.api.get(`${this.route}${selector.id}`);
|
|
31
|
-
return response.data;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
async findContactPersonaByOwnerId(
|
|
35
|
-
params: Nomalism.shared.IFindByOwnerIdRequest,
|
|
36
|
-
): Promise<Nomalism.Persona.IFindContactPersonaByOwnerId> {
|
|
37
|
-
const response = await this.api.get(`${this.route}contact`, { params });
|
|
38
|
-
return response.data;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
async create(body: Nomalism.Persona.ICreateRequest): Promise<Nomalism.Persona.IEntityExtended> {
|
|
42
|
-
const response = await this.api.post(`${this.route}`, body);
|
|
43
|
-
return response.data;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async update(
|
|
47
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
48
|
-
body: Nomalism.Persona.IUpdateRequest,
|
|
49
|
-
): Promise<Nomalism.Persona.IEntityExtended | null> {
|
|
50
|
-
const response = await this.api.put(`${this.route}${selector.id}`, body);
|
|
51
|
-
return response.data;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
async deleteOne(
|
|
55
|
-
params: Nomalism.Persona.IDeletePersonaRequest,
|
|
56
|
-
): Promise<Nomalism.Persona.IEntityExtended | null> {
|
|
57
|
-
const response = await this.api.delete(`${this.route}`, { params });
|
|
58
|
-
return response.data;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
async findByBasic(
|
|
62
|
-
params: Nomalism.Persona.IBasicSearchRequest,
|
|
63
|
-
): Promise<Nomalism.shared.IPaginationResponse<Nomalism.Persona.IBasicSearchResponse>> {
|
|
64
|
-
const response = await this.api.get(`${this.route}basic_search`, {
|
|
65
|
-
params,
|
|
66
|
-
});
|
|
67
|
-
return response.data;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
async find(data: Nomalism.Persona.IFindRequest): Promise<Nomalism.Persona.IFindResponse[]> {
|
|
71
|
-
const response = await this.api.get(`${this.route}`, {
|
|
72
|
-
data,
|
|
73
|
-
});
|
|
74
|
-
return response.data;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
async findByEmail(
|
|
78
|
-
data: Nomalism.Persona.IFindByEmailRequest,
|
|
79
|
-
): Promise<Nomalism.Persona.IFindByEmailResponse[]> {
|
|
80
|
-
const response = await this.api.get(`${this.route}by_email`, {
|
|
81
|
-
data,
|
|
82
|
-
});
|
|
83
|
-
return response.data;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
async findClientOrProvider(
|
|
87
|
-
params: Nomalism.Persona.IFindClientOrProviderRequest,
|
|
88
|
-
): Promise<Nomalism.Persona.IFindClientOrProviderResponse[]> {
|
|
89
|
-
const response = await this.api.get(`${this.route}find_client_or_provider`, { params });
|
|
90
|
-
return response.data;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
@@ -1,90 +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.Providers.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 findByQuery(
|
|
19
|
-
data: Nomalism.Providers.IFindRequest,
|
|
20
|
-
): Promise<Nomalism.Providers.IFindResponse[]> {
|
|
21
|
-
const response = await this.api.post(`${this.route}query`, data);
|
|
22
|
-
return response.data;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async find(params: Nomalism.Providers.IFindRequest): Promise<Nomalism.Providers.IFindResponse[]> {
|
|
26
|
-
const response = await this.api.get(`${this.route}`, { params });
|
|
27
|
-
return response.data;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
async findPaginated(
|
|
31
|
-
params: Nomalism.Providers.IFindPaginatedRequest,
|
|
32
|
-
): Promise<Nomalism.shared.IPaginationResponse<Nomalism.Providers.IFindResponse>> {
|
|
33
|
-
const response = await this.api.get(`${this.route}paginated`, { params });
|
|
34
|
-
return response.data;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
async findMinified(
|
|
38
|
-
params?: Nomalism.shared.IFindMinifiedRequest,
|
|
39
|
-
): Promise<Nomalism.shared.IFindMinifiedResponse[]> {
|
|
40
|
-
const response = await this.api.get(`${this.route}minified`, {
|
|
41
|
-
params,
|
|
42
|
-
});
|
|
43
|
-
return response.data;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async findMinifiedManufacturer(
|
|
47
|
-
params?: Nomalism.shared.IFindMinifiedRequest,
|
|
48
|
-
): Promise<Nomalism.shared.IFindMinifiedResponse[]> {
|
|
49
|
-
const response = await this.api.get(`${this.route}minified_manufacturer`, {
|
|
50
|
-
params,
|
|
51
|
-
});
|
|
52
|
-
return response.data;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
async findByOwnerId(
|
|
56
|
-
params: Nomalism.shared.IFindByOwnerIdRequest,
|
|
57
|
-
): Promise<Nomalism.Providers.IFindByOwnerIdResponse[]> {
|
|
58
|
-
const response = await this.api.get(`${this.route}by_owner`, {
|
|
59
|
-
params,
|
|
60
|
-
});
|
|
61
|
-
return response.data;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
async findById(
|
|
65
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
66
|
-
): Promise<Nomalism.Providers.IFindByIdResponse | null> {
|
|
67
|
-
const response = await this.api.get(`${this.route}${selector.id}`);
|
|
68
|
-
return response.data;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
async create(body: Nomalism.Providers.ICreateRequest): Promise<Nomalism.Providers.IFindResponse> {
|
|
72
|
-
const response = await this.api.post(`${this.route}`, body);
|
|
73
|
-
return response.data;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
async update(
|
|
77
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
78
|
-
body: Nomalism.Providers.IUpdateRequest,
|
|
79
|
-
): Promise<Nomalism.Providers.IFindResponse | null> {
|
|
80
|
-
const response = await this.api.put(`${this.route}${selector.id}`, body);
|
|
81
|
-
return response.data;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
async deleteOne(
|
|
85
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
86
|
-
): Promise<Nomalism.Providers.IFindResponse | null> {
|
|
87
|
-
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
88
|
-
return response.data;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import Nomalism from '@nomalism-com/types';
|
|
2
|
-
import { AxiosInstance } from 'axios';
|
|
3
|
-
import { IModuleConstructor } from '../../main';
|
|
4
|
-
|
|
5
|
-
export type IPaginationResponse =
|
|
6
|
-
Nomalism.shared.IPaginationResponse<Nomalism.ProviderType.IFindResponse>;
|
|
7
|
-
|
|
8
|
-
export default class Repository implements Nomalism.ProviderType.IRepository {
|
|
9
|
-
public route: string;
|
|
10
|
-
|
|
11
|
-
public publicRoute: string;
|
|
12
|
-
|
|
13
|
-
private api: AxiosInstance;
|
|
14
|
-
|
|
15
|
-
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
16
|
-
this.api = api;
|
|
17
|
-
this.route = route;
|
|
18
|
-
this.publicRoute = publicRoute;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
async find(
|
|
22
|
-
params: Nomalism.ProviderType.IFindRequest,
|
|
23
|
-
): Promise<Nomalism.ProviderType.IFindResponse[]> {
|
|
24
|
-
const response = await this.api.get(`${this.route}`, { params });
|
|
25
|
-
return response.data;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
async findPaginated(
|
|
29
|
-
params: Nomalism.ProviderType.IFindPaginatedRequest,
|
|
30
|
-
): Promise<IPaginationResponse> {
|
|
31
|
-
const response = await this.api.get(`${this.route}paginated`, { params });
|
|
32
|
-
return response.data;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
async findMinified(
|
|
36
|
-
params?: Nomalism.shared.IFindMinifiedRequest,
|
|
37
|
-
): Promise<Nomalism.shared.IFindMinifiedResponse[]> {
|
|
38
|
-
const response = await this.api.get(`${this.route}minified`, {
|
|
39
|
-
params,
|
|
40
|
-
});
|
|
41
|
-
return response.data;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
async findById(
|
|
45
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
46
|
-
): Promise<Nomalism.ProviderType.IFindResponse | null> {
|
|
47
|
-
const response = await this.api.get(`${this.route}${selector.id}`);
|
|
48
|
-
return response.data;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
async create(body: Nomalism.ProviderType.ICreateRequest): Promise<Nomalism.ProviderType.Entity> {
|
|
52
|
-
const response = await this.api.post(`${this.route}`, body);
|
|
53
|
-
return response.data;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
async update(
|
|
57
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
58
|
-
body: Nomalism.ProviderType.IUpdateRequest,
|
|
59
|
-
): Promise<Nomalism.ProviderType.Entity | null> {
|
|
60
|
-
const response = await this.api.put(`${this.route}${selector.id}`, body);
|
|
61
|
-
return response.data;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
async deleteOne(
|
|
65
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
66
|
-
): Promise<Nomalism.ProviderType.Entity | null> {
|
|
67
|
-
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
68
|
-
return response.data;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
@@ -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.PurchaseConditions.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.PurchaseConditions.IFindRequest,
|
|
20
|
-
): Promise<Nomalism.PurchaseConditions.Entity[]> {
|
|
21
|
-
const response = await this.api.get(`${this.route}`, { params });
|
|
22
|
-
return response.data;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async findPaginated(
|
|
26
|
-
params: Nomalism.PurchaseConditions.IFindPaginatedRequest,
|
|
27
|
-
): Promise<Nomalism.shared.IPaginationResponse<Nomalism.PurchaseConditions.Entity>> {
|
|
28
|
-
const response = await this.api.get(`${this.route}paginated`, { params });
|
|
29
|
-
return response.data;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
async findByOwnerId(
|
|
33
|
-
params: Nomalism.shared.IFindByOwnerIdRequest,
|
|
34
|
-
): Promise<Nomalism.PurchaseConditions.Entity[]> {
|
|
35
|
-
const response = await this.api.get(`${this.route}by_owner`, {
|
|
36
|
-
params,
|
|
37
|
-
});
|
|
38
|
-
return response.data;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
async findById(
|
|
42
|
-
selector: Nomalism.shared.IFindByIdRequest,
|
|
43
|
-
): Promise<Nomalism.PurchaseConditions.Entity | null> {
|
|
44
|
-
const response = await this.api.get(`${this.route}${selector.id}`);
|
|
45
|
-
return response.data;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
async create(
|
|
49
|
-
body: Nomalism.PurchaseConditions.ICreateRequest,
|
|
50
|
-
): Promise<Nomalism.PurchaseConditions.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.PurchaseConditions.IUpdateRequest,
|
|
58
|
-
): Promise<Nomalism.PurchaseConditions.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.PurchaseConditions.Entity | null> {
|
|
66
|
-
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
67
|
-
return response.data;
|
|
68
|
-
}
|
|
69
|
-
}
|