@eleva-io/erp-sdk 0.1.0 → 0.1.3
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/client/http.d.ts +1 -0
- package/dist/client/http.js +6 -0
- package/dist/client/resources/horizontal/api.d.ts +2 -2
- package/dist/client/resources/horizontal/api.js +3 -3
- package/dist/client/resources/horizontal/communities.d.ts +13 -0
- package/dist/client/resources/horizontal/communities.js +53 -0
- package/dist/client/resources/horizontal/types.d.ts +47 -0
- package/dist/client/resources/horizontal/types.js +2 -0
- package/dist/client/resources/ticketing/types.d.ts +0 -3
- package/dist/client/utils/crud.d.ts +22 -0
- package/dist/client/utils/crud.js +52 -0
- package/dist/erp.d.ts +15 -12
- package/dist/erp.d.ts.map +1 -0
- package/dist/erp.js +22 -21
- package/dist/erp.js.map +1 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -21
- package/dist/index.js.map +1 -0
- package/dist/modules/contacts/api.d.ts +9 -0
- package/dist/modules/contacts/api.d.ts.map +1 -0
- package/dist/modules/contacts/api.js +13 -0
- package/dist/modules/contacts/api.js.map +1 -0
- package/dist/modules/contacts/index.d.ts +3 -0
- package/dist/modules/contacts/index.d.ts.map +1 -0
- package/dist/modules/contacts/index.js +3 -0
- package/dist/modules/contacts/index.js.map +1 -0
- package/dist/modules/contacts/persons/api/addresses.d.ts +11 -0
- package/dist/modules/contacts/persons/api/addresses.d.ts.map +1 -0
- package/dist/modules/contacts/persons/api/addresses.js +23 -0
- package/dist/modules/contacts/persons/api/addresses.js.map +1 -0
- package/dist/modules/contacts/persons/api/index.d.ts +3 -0
- package/dist/modules/contacts/persons/api/index.d.ts.map +1 -0
- package/dist/modules/contacts/persons/api/index.js +3 -0
- package/dist/modules/contacts/persons/api/index.js.map +1 -0
- package/dist/modules/contacts/persons/api/persons.d.ts +10 -0
- package/dist/modules/contacts/persons/api/persons.d.ts.map +1 -0
- package/dist/modules/contacts/persons/api/persons.js +19 -0
- package/dist/modules/contacts/persons/api/persons.js.map +1 -0
- package/dist/modules/contacts/persons/index.d.ts +3 -0
- package/dist/modules/contacts/persons/index.d.ts.map +1 -0
- package/dist/modules/contacts/persons/index.js +3 -0
- package/dist/modules/contacts/persons/index.js.map +1 -0
- package/dist/modules/contacts/persons/types/address.d.ts +21 -0
- package/dist/modules/contacts/persons/types/address.d.ts.map +1 -0
- package/dist/modules/contacts/persons/types/address.js +2 -0
- package/dist/modules/contacts/persons/types/address.js.map +1 -0
- package/dist/modules/contacts/persons/types/index.d.ts +4 -0
- package/dist/modules/contacts/persons/types/index.d.ts.map +1 -0
- package/dist/modules/contacts/persons/types/index.js +4 -0
- package/dist/modules/contacts/persons/types/index.js.map +1 -0
- package/dist/modules/contacts/persons/types/person.d.ts +32 -0
- package/dist/modules/contacts/persons/types/person.d.ts.map +1 -0
- package/dist/modules/contacts/persons/types/person.js +6 -0
- package/dist/modules/contacts/persons/types/person.js.map +1 -0
- package/dist/modules/contacts/persons/types/person_address.d.ts +20 -0
- package/dist/modules/contacts/persons/types/person_address.d.ts.map +1 -0
- package/dist/modules/contacts/persons/types/person_address.js +2 -0
- package/dist/modules/contacts/persons/types/person_address.js.map +1 -0
- package/dist/modules/horizontal/api.d.ts +9 -0
- package/dist/modules/horizontal/api.d.ts.map +1 -0
- package/dist/modules/horizontal/api.js +13 -0
- package/dist/modules/horizontal/api.js.map +1 -0
- package/dist/modules/horizontal/communities/api/agents.d.ts +5 -0
- package/dist/modules/horizontal/communities/api/agents.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/api/agents.js +4 -0
- package/dist/modules/horizontal/communities/api/agents.js.map +1 -0
- package/dist/modules/horizontal/communities/api/blocks.d.ts +10 -0
- package/dist/modules/horizontal/communities/api/blocks.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/api/blocks.js +19 -0
- package/dist/modules/horizontal/communities/api/blocks.js.map +1 -0
- package/dist/modules/horizontal/communities/api/communities.d.ts +24 -0
- package/dist/modules/horizontal/communities/api/communities.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/api/communities.js +75 -0
- package/dist/modules/horizontal/communities/api/communities.js.map +1 -0
- package/dist/modules/horizontal/communities/api/communities_config.d.ts +11 -0
- package/dist/modules/horizontal/communities/api/communities_config.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/api/communities_config.js +32 -0
- package/dist/modules/horizontal/communities/api/communities_config.js.map +1 -0
- package/dist/modules/horizontal/communities/api/documents.d.ts +17 -0
- package/dist/modules/horizontal/communities/api/documents.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/api/documents.js +35 -0
- package/dist/modules/horizontal/communities/api/documents.js.map +1 -0
- package/dist/modules/horizontal/communities/api/employees.d.ts +13 -0
- package/dist/modules/horizontal/communities/api/employees.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/api/employees.js +24 -0
- package/dist/modules/horizontal/communities/api/employees.js.map +1 -0
- package/dist/modules/horizontal/communities/api/index.d.ts +11 -0
- package/dist/modules/horizontal/communities/api/index.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/api/index.js +11 -0
- package/dist/modules/horizontal/communities/api/index.js.map +1 -0
- package/dist/modules/horizontal/communities/api/properties.d.ts +9 -0
- package/dist/modules/horizontal/communities/api/properties.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/api/properties.js +21 -0
- package/dist/modules/horizontal/communities/api/properties.js.map +1 -0
- package/dist/modules/horizontal/communities/api/providers.d.ts +13 -0
- package/dist/modules/horizontal/communities/api/providers.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/api/providers.js +24 -0
- package/dist/modules/horizontal/communities/api/providers.js.map +1 -0
- package/dist/modules/horizontal/communities/api/receipts.d.ts +20 -0
- package/dist/modules/horizontal/communities/api/receipts.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/api/receipts.js +40 -0
- package/dist/modules/horizontal/communities/api/receipts.js.map +1 -0
- package/dist/modules/horizontal/communities/api/roles.d.ts +5 -0
- package/dist/modules/horizontal/communities/api/roles.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/api/roles.js +4 -0
- package/dist/modules/horizontal/communities/api/roles.js.map +1 -0
- package/dist/modules/horizontal/communities/index.d.ts +3 -0
- package/dist/modules/horizontal/communities/index.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/index.js +3 -0
- package/dist/modules/horizontal/communities/index.js.map +1 -0
- package/dist/modules/horizontal/communities/types/address.d.ts +25 -0
- package/dist/modules/horizontal/communities/types/address.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/types/address.js +2 -0
- package/dist/modules/horizontal/communities/types/address.js.map +1 -0
- package/dist/modules/horizontal/communities/types/agent.d.ts +9 -0
- package/dist/modules/horizontal/communities/types/agent.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/types/agent.js +2 -0
- package/dist/modules/horizontal/communities/types/agent.js.map +1 -0
- package/dist/modules/horizontal/communities/types/block.d.ts +20 -0
- package/dist/modules/horizontal/communities/types/block.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/types/block.js +2 -0
- package/dist/modules/horizontal/communities/types/block.js.map +1 -0
- package/dist/modules/horizontal/communities/types/community.d.ts +34 -0
- package/dist/modules/horizontal/communities/types/community.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/types/community.js +2 -0
- package/dist/modules/horizontal/communities/types/community.js.map +1 -0
- package/dist/modules/horizontal/communities/types/community_config.d.ts +16 -0
- package/dist/modules/horizontal/communities/types/community_config.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/types/community_config.js +2 -0
- package/dist/modules/horizontal/communities/types/community_config.js.map +1 -0
- package/dist/modules/horizontal/communities/types/document.d.ts +42 -0
- package/dist/modules/horizontal/communities/types/document.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/types/document.js +23 -0
- package/dist/modules/horizontal/communities/types/document.js.map +1 -0
- package/dist/modules/horizontal/communities/types/employee.d.ts +40 -0
- package/dist/modules/horizontal/communities/types/employee.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/types/employee.js +29 -0
- package/dist/modules/horizontal/communities/types/employee.js.map +1 -0
- package/dist/modules/horizontal/communities/types/index.d.ts +10 -0
- package/dist/modules/horizontal/communities/types/index.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/types/index.js +10 -0
- package/dist/modules/horizontal/communities/types/index.js.map +1 -0
- package/dist/modules/horizontal/communities/types/property.d.ts +45 -0
- package/dist/modules/horizontal/communities/types/property.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/types/property.js +15 -0
- package/dist/modules/horizontal/communities/types/property.js.map +1 -0
- package/dist/modules/horizontal/communities/types/provider.d.ts +40 -0
- package/dist/modules/horizontal/communities/types/provider.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/types/provider.js +29 -0
- package/dist/modules/horizontal/communities/types/provider.js.map +1 -0
- package/dist/modules/horizontal/communities/types/receipt.d.ts +63 -0
- package/dist/modules/horizontal/communities/types/receipt.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/types/receipt.js +16 -0
- package/dist/modules/horizontal/communities/types/receipt.js.map +1 -0
- package/dist/modules/horizontal/communities/types/roles.d.ts +12 -0
- package/dist/modules/horizontal/communities/types/roles.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/types/roles.js +2 -0
- package/dist/modules/horizontal/communities/types/roles.js.map +1 -0
- package/dist/modules/horizontal/communities/types/tag.d.ts +2 -0
- package/dist/modules/horizontal/communities/types/tag.d.ts.map +1 -0
- package/dist/modules/horizontal/communities/types/tag.js +2 -0
- package/dist/modules/horizontal/communities/types/tag.js.map +1 -0
- package/dist/modules/horizontal/index.d.ts +3 -0
- package/dist/modules/horizontal/index.d.ts.map +1 -0
- package/dist/modules/horizontal/index.js +3 -0
- package/dist/modules/horizontal/index.js.map +1 -0
- package/dist/modules/index.d.ts +4 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/index.js +4 -0
- package/dist/modules/index.js.map +1 -0
- package/dist/modules/ticketing/api.d.ts +18 -0
- package/dist/modules/ticketing/api.d.ts.map +1 -0
- package/dist/modules/ticketing/api.js +42 -0
- package/dist/modules/ticketing/api.js.map +1 -0
- package/dist/modules/ticketing/index.d.ts +3 -0
- package/dist/modules/ticketing/index.d.ts.map +1 -0
- package/dist/modules/ticketing/index.js +3 -0
- package/dist/modules/ticketing/index.js.map +1 -0
- package/dist/modules/ticketing/types.d.ts +59 -0
- package/dist/modules/ticketing/types.d.ts.map +1 -0
- package/dist/modules/ticketing/types.js +22 -0
- package/dist/modules/ticketing/types.js.map +1 -0
- package/dist/tasks/std.d.ts +3 -2
- package/dist/tasks/std.js +4 -0
- package/dist/types.d.ts +1 -5
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -2
- package/dist/types.js.map +1 -0
- package/dist/utils/crud.d.ts +26 -0
- package/dist/utils/crud.d.ts.map +1 -0
- package/dist/utils/crud.js +68 -0
- package/dist/utils/crud.js.map +1 -0
- package/dist/utils/http.d.ts +19 -0
- package/dist/utils/http.d.ts.map +1 -0
- package/dist/utils/http.js +108 -0
- package/dist/utils/http.js.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/signature.d.ts +6 -0
- package/dist/utils/signature.d.ts.map +1 -0
- package/dist/utils/signature.js +14 -0
- package/dist/utils/signature.js.map +1 -0
- package/dist/utils/types.d.ts +7 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/types.js +2 -0
- package/dist/utils/types.js.map +1 -0
- package/package.json +8 -6
package/dist/client/http.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare class HTTPClient {
|
|
|
7
7
|
get<T>(path: string, params?: Record<string, unknown>): Promise<APIResponse<T>>;
|
|
8
8
|
post<T>(path: string, data?: unknown, params?: Record<string, unknown>): Promise<APIResponse<T>>;
|
|
9
9
|
put<T>(path: string, data?: unknown, params?: Record<string, unknown>): Promise<APIResponse<T>>;
|
|
10
|
+
patch<T>(path: string, data?: unknown, params?: Record<string, unknown>): Promise<APIResponse<T>>;
|
|
10
11
|
delete<T>(path: string, params?: Record<string, unknown>): Promise<APIResponse<T>>;
|
|
11
12
|
getBinary(path: string, params?: Record<string, unknown>): Promise<Buffer>;
|
|
12
13
|
}
|
package/dist/client/http.js
CHANGED
|
@@ -63,6 +63,12 @@ class HTTPClient {
|
|
|
63
63
|
});
|
|
64
64
|
return response.data;
|
|
65
65
|
}
|
|
66
|
+
async patch(path, data, params) {
|
|
67
|
+
const response = await this.client.patch(path, data, {
|
|
68
|
+
params,
|
|
69
|
+
});
|
|
70
|
+
return response.data;
|
|
71
|
+
}
|
|
66
72
|
async delete(path, params) {
|
|
67
73
|
const response = await this.client.delete(path, {
|
|
68
74
|
params,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { HTTPClient } from "../../http";
|
|
2
|
-
import { CommunitiesAPI } from "./communities
|
|
2
|
+
import { CommunitiesAPI } from "./communities";
|
|
3
3
|
export declare class HorizontalAPI {
|
|
4
4
|
private httpClient;
|
|
5
5
|
constructor(httpClient: HTTPClient);
|
|
6
6
|
communities(): CommunitiesAPI;
|
|
7
7
|
}
|
|
8
|
-
export * from "./
|
|
8
|
+
export * from "./types";
|
|
@@ -15,14 +15,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.HorizontalAPI = void 0;
|
|
18
|
-
const
|
|
18
|
+
const communities_1 = require("./communities");
|
|
19
19
|
class HorizontalAPI {
|
|
20
20
|
constructor(httpClient) {
|
|
21
21
|
this.httpClient = httpClient;
|
|
22
22
|
}
|
|
23
23
|
communities() {
|
|
24
|
-
return new
|
|
24
|
+
return new communities_1.CommunitiesAPI(this.httpClient);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
exports.HorizontalAPI = HorizontalAPI;
|
|
28
|
-
__exportStar(require("./
|
|
28
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HTTPClient } from "../../http";
|
|
2
|
+
import { CRUD } from "../../utils/crud";
|
|
3
|
+
import { Community, CommunityAgent } from "./types";
|
|
4
|
+
export declare class CommunitiesAPI extends CRUD<Community> {
|
|
5
|
+
private communityId?;
|
|
6
|
+
constructor(httpClient: HTTPClient, communityId?: string | undefined);
|
|
7
|
+
config(): {
|
|
8
|
+
agents(): CRUD<CommunityAgent, CommunityAgent, CommunityAgent, CommunityAgent>;
|
|
9
|
+
roles(): CRUD<CommunityAgent, CommunityAgent, CommunityAgent, CommunityAgent>;
|
|
10
|
+
};
|
|
11
|
+
agents(): CRUD<CommunityAgent>;
|
|
12
|
+
}
|
|
13
|
+
export * from "./types";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.CommunitiesAPI = void 0;
|
|
18
|
+
const crud_1 = require("../../utils/crud");
|
|
19
|
+
class CommunitiesAPI extends crud_1.CRUD {
|
|
20
|
+
constructor(httpClient, communityId) {
|
|
21
|
+
super(httpClient, `/api/v1/horizontal/communities`, undefined, communityId);
|
|
22
|
+
this.communityId = communityId;
|
|
23
|
+
}
|
|
24
|
+
config() {
|
|
25
|
+
const self = this;
|
|
26
|
+
return {
|
|
27
|
+
agents() {
|
|
28
|
+
return new crud_1.CRUD(self.httpClient, `${self.basePath}/config/agents`, {
|
|
29
|
+
isCreateEnabled: false,
|
|
30
|
+
isUpdateEnabled: false,
|
|
31
|
+
isDeleteEnabled: false,
|
|
32
|
+
isReadEnabled: false,
|
|
33
|
+
}, self.communityId);
|
|
34
|
+
},
|
|
35
|
+
roles() {
|
|
36
|
+
return new crud_1.CRUD(self.httpClient, `${self.basePath}/config/roles`, {
|
|
37
|
+
isCreateEnabled: false,
|
|
38
|
+
isUpdateEnabled: false,
|
|
39
|
+
isDeleteEnabled: false,
|
|
40
|
+
isReadEnabled: false,
|
|
41
|
+
}, self.communityId);
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
agents() {
|
|
46
|
+
if (!this.communityId) {
|
|
47
|
+
throw new Error("Community ID is required");
|
|
48
|
+
}
|
|
49
|
+
return new crud_1.CRUD(this.httpClient, `${this.basePath}/${this.communityId}/agents`, undefined, this.communityId);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.CommunitiesAPI = CommunitiesAPI;
|
|
53
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export interface Community {
|
|
2
|
+
id: string;
|
|
3
|
+
domainId: string;
|
|
4
|
+
name: string;
|
|
5
|
+
personId: string;
|
|
6
|
+
enrollmentDate: string | null;
|
|
7
|
+
macrocommunityId: string | null;
|
|
8
|
+
coefficient: number | null;
|
|
9
|
+
churnDate: string | null;
|
|
10
|
+
churnReasonId: number | null;
|
|
11
|
+
tags: string[] | null;
|
|
12
|
+
customFields: Record<string, any>;
|
|
13
|
+
updatedAt: string;
|
|
14
|
+
neighbors: Array<{
|
|
15
|
+
personId: string;
|
|
16
|
+
typeId: number;
|
|
17
|
+
}>;
|
|
18
|
+
person: {
|
|
19
|
+
id: string;
|
|
20
|
+
domainId: string;
|
|
21
|
+
typeId: number;
|
|
22
|
+
langId: number;
|
|
23
|
+
fullName: string;
|
|
24
|
+
legalId: string | null;
|
|
25
|
+
legalRepresentative: string | null;
|
|
26
|
+
bornAt: string | null;
|
|
27
|
+
phones: string[] | null;
|
|
28
|
+
emails: string[] | null;
|
|
29
|
+
notificationEmail: boolean;
|
|
30
|
+
notificationPhone: boolean;
|
|
31
|
+
notificationPostal: boolean;
|
|
32
|
+
tags: string[] | null;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface CommunityAgent {
|
|
36
|
+
communityId: string;
|
|
37
|
+
agentId: string;
|
|
38
|
+
roleId: number;
|
|
39
|
+
updatedAt: string;
|
|
40
|
+
}
|
|
41
|
+
export interface AgentRole {
|
|
42
|
+
id: number;
|
|
43
|
+
domainId: string;
|
|
44
|
+
name: string;
|
|
45
|
+
required: boolean;
|
|
46
|
+
unique: boolean;
|
|
47
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ResourceInfo } from "../types";
|
|
2
1
|
export declare enum TaskPriority {
|
|
3
2
|
low = 1,
|
|
4
3
|
medium = 2,
|
|
@@ -37,7 +36,6 @@ export interface Task {
|
|
|
37
36
|
dueDate: string | null;
|
|
38
37
|
firstResponseDue: string | null;
|
|
39
38
|
updatedAt: string;
|
|
40
|
-
resourceInfo?: ResourceInfo;
|
|
41
39
|
}
|
|
42
40
|
export interface CreateTaskDTO {
|
|
43
41
|
title: string;
|
|
@@ -50,7 +48,6 @@ export interface CreateTaskDTO {
|
|
|
50
48
|
parentId?: string;
|
|
51
49
|
dueDate?: string | null;
|
|
52
50
|
description?: string;
|
|
53
|
-
resourceInfo?: ResourceInfo;
|
|
54
51
|
}
|
|
55
52
|
export interface TaskCategory {
|
|
56
53
|
id: number;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { APIResponse } from "../../types";
|
|
2
|
+
import { HTTPClient } from "../http";
|
|
3
|
+
export interface MethodsConfig {
|
|
4
|
+
isCreateEnabled: boolean;
|
|
5
|
+
isReadEnabled: boolean;
|
|
6
|
+
isUpdateEnabled: boolean;
|
|
7
|
+
isDeleteEnabled: boolean;
|
|
8
|
+
isFindEnabled: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare class CRUD<T, C = T, U = T, F = T> {
|
|
11
|
+
protected readonly httpClient: HTTPClient;
|
|
12
|
+
protected readonly basePath: string;
|
|
13
|
+
protected readonly id?: string | undefined;
|
|
14
|
+
private readonly methodsConfig;
|
|
15
|
+
constructor(httpClient: HTTPClient, basePath: string, methodsConfig?: Partial<MethodsConfig>, id?: string | undefined);
|
|
16
|
+
get(): Promise<APIResponse<T[]>>;
|
|
17
|
+
get(id: string): Promise<APIResponse<T>>;
|
|
18
|
+
create(data: C): Promise<APIResponse<T>>;
|
|
19
|
+
update(id: string, data: Partial<U>): Promise<APIResponse<T>>;
|
|
20
|
+
delete(id: string): Promise<APIResponse<void>>;
|
|
21
|
+
find(query?: Record<string, unknown>): Promise<APIResponse<F[]>>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CRUD = void 0;
|
|
4
|
+
const DEFAULT_METHODS_CONFIG = {
|
|
5
|
+
isCreateEnabled: true,
|
|
6
|
+
isReadEnabled: true,
|
|
7
|
+
isUpdateEnabled: true,
|
|
8
|
+
isDeleteEnabled: true,
|
|
9
|
+
isFindEnabled: true,
|
|
10
|
+
};
|
|
11
|
+
class CRUD {
|
|
12
|
+
constructor(httpClient, basePath, methodsConfig = DEFAULT_METHODS_CONFIG, id) {
|
|
13
|
+
this.httpClient = httpClient;
|
|
14
|
+
this.basePath = basePath;
|
|
15
|
+
this.id = id;
|
|
16
|
+
this.methodsConfig = {
|
|
17
|
+
...DEFAULT_METHODS_CONFIG,
|
|
18
|
+
...methodsConfig,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
async get(id) {
|
|
22
|
+
if (!this.methodsConfig.isReadEnabled) {
|
|
23
|
+
throw new Error("Read method is not enabled");
|
|
24
|
+
}
|
|
25
|
+
return this.httpClient.get(`${this.basePath}/${id || this.id}`);
|
|
26
|
+
}
|
|
27
|
+
async create(data) {
|
|
28
|
+
if (!this.methodsConfig.isCreateEnabled) {
|
|
29
|
+
throw new Error("Create method is not enabled");
|
|
30
|
+
}
|
|
31
|
+
return this.httpClient.post(`${this.basePath}`, data);
|
|
32
|
+
}
|
|
33
|
+
async update(id, data) {
|
|
34
|
+
if (!this.methodsConfig.isUpdateEnabled) {
|
|
35
|
+
throw new Error("Update method is not enabled");
|
|
36
|
+
}
|
|
37
|
+
return this.httpClient.patch(`${this.basePath}/${id || this.id}`, data);
|
|
38
|
+
}
|
|
39
|
+
async delete(id) {
|
|
40
|
+
if (!this.methodsConfig.isDeleteEnabled) {
|
|
41
|
+
throw new Error("Delete method is not enabled");
|
|
42
|
+
}
|
|
43
|
+
return this.httpClient.delete(`${this.basePath}/${id || this.id}`);
|
|
44
|
+
}
|
|
45
|
+
async find(query) {
|
|
46
|
+
if (!this.methodsConfig.isFindEnabled) {
|
|
47
|
+
throw new Error("Find method is not enabled");
|
|
48
|
+
}
|
|
49
|
+
return this.httpClient.get(`${this.basePath}`, query);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.CRUD = CRUD;
|
package/dist/erp.d.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { HorizontalAPI } from "./modules/horizontal";
|
|
2
|
+
import { TicketingAPI } from "./modules/ticketing";
|
|
3
|
+
import { ContactsAPI } from "./modules/contacts/api";
|
|
4
|
+
export interface ERPClientConfig {
|
|
5
|
+
baseURL: string;
|
|
6
|
+
apiKey: string;
|
|
7
|
+
apiSecret: string;
|
|
8
8
|
}
|
|
9
|
-
export declare class
|
|
10
|
-
private
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
export declare class ERPClient {
|
|
10
|
+
private readonly _baseUrl;
|
|
11
|
+
private _httpClient;
|
|
12
|
+
constructor(config: ERPClientConfig);
|
|
13
|
+
contacts(): ContactsAPI;
|
|
14
|
+
horizontal(): HorizontalAPI;
|
|
15
|
+
tasks(): TicketingAPI;
|
|
14
16
|
}
|
|
17
|
+
//# sourceMappingURL=erp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erp.d.ts","sourceRoot":"","sources":["../src/erp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IAE9C,OAAO,CAAC,WAAW,CAAa;gBAEpB,MAAM,EAAE,eAAe;IAYnC,QAAQ,IAAI,WAAW;IAIvB,UAAU,IAAI,aAAa;IAI3B,KAAK,IAAI,YAAY;CAGtB"}
|
package/dist/erp.js
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
this._erp = _erp;
|
|
9
|
-
}
|
|
10
|
-
creator() {
|
|
11
|
-
return new creator_1.TaskCreator(this._erp);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.ElevaERPTasks = ElevaERPTasks;
|
|
15
|
-
class ElevaERP {
|
|
1
|
+
import { HTTPClient } from "./utils/http";
|
|
2
|
+
import { HorizontalAPI } from "./modules/horizontal";
|
|
3
|
+
import { TicketingAPI } from "./modules/ticketing";
|
|
4
|
+
import { ContactsAPI } from "./modules/contacts/api";
|
|
5
|
+
export class ERPClient {
|
|
6
|
+
_baseUrl = "/api/v1";
|
|
7
|
+
_httpClient;
|
|
16
8
|
constructor(config) {
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
if (!config.baseURL || !config.apiKey || !config.apiSecret) {
|
|
10
|
+
throw new Error("Missing required configuration");
|
|
11
|
+
}
|
|
12
|
+
this._httpClient = new HTTPClient({
|
|
13
|
+
baseURL: config.baseURL,
|
|
14
|
+
apiKey: config.apiKey,
|
|
15
|
+
apiSecret: config.apiSecret,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
contacts() {
|
|
19
|
+
return new ContactsAPI(this._httpClient, this._baseUrl);
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
-
return this.
|
|
21
|
+
horizontal() {
|
|
22
|
+
return new HorizontalAPI(this._httpClient, this._baseUrl);
|
|
22
23
|
}
|
|
23
24
|
tasks() {
|
|
24
|
-
return new
|
|
25
|
+
return new TicketingAPI(this._httpClient, this._baseUrl);
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
|
-
|
|
28
|
+
//# sourceMappingURL=erp.js.map
|
package/dist/erp.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erp.js","sourceRoot":"","sources":["../src/erp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAQrD,MAAM,OAAO,SAAS;IACH,QAAQ,GAAW,SAAS,CAAC;IAEtC,WAAW,CAAa;IAEhC,YAAY,MAAuB;QACjC,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;YAC3D,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;QACpD,CAAC;QAED,IAAI,CAAC,WAAW,GAAG,IAAI,UAAU,CAAC;YAChC,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,SAAS,EAAE,MAAM,CAAC,SAAS;SAC5B,CAAC,CAAC;IACL,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1D,CAAC;IAED,UAAU;QACR,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK;QACH,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3D,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./erp";
|
|
2
1
|
export * from "./types";
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
2
|
+
export * from "./utils";
|
|
3
|
+
export * from "./modules";
|
|
4
|
+
export * from "./erp";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./erp"), exports);
|
|
18
|
-
__exportStar(require("./types"), exports);
|
|
19
|
-
__exportStar(require("./tasks/template"), exports);
|
|
20
|
-
__exportStar(require("./tasks/creator"), exports);
|
|
21
|
-
__exportStar(require("./client/resources/ticketing/types"), exports);
|
|
1
|
+
export * from "./types";
|
|
2
|
+
export * from "./utils";
|
|
3
|
+
export * from "./modules";
|
|
4
|
+
export * from "./erp";
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HTTPClient } from "@src/utils/http";
|
|
2
|
+
import { ContactsPersonsAPI } from "./persons";
|
|
3
|
+
export declare class ContactsAPI {
|
|
4
|
+
private _httpClient;
|
|
5
|
+
private readonly _baseUrl;
|
|
6
|
+
constructor(_httpClient: HTTPClient, baseUrl: string);
|
|
7
|
+
persons(id?: string): ContactsPersonsAPI;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/modules/contacts/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,qBAAa,WAAW;IAGV,OAAO,CAAC,WAAW;IAF/B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;gBAEd,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM;IAI5D,OAAO,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,kBAAkB;CAOzC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ContactsPersonsAPI } from "./persons";
|
|
2
|
+
export class ContactsAPI {
|
|
3
|
+
_httpClient;
|
|
4
|
+
_baseUrl;
|
|
5
|
+
constructor(_httpClient, baseUrl) {
|
|
6
|
+
this._httpClient = _httpClient;
|
|
7
|
+
this._baseUrl = `${baseUrl}/contacts`;
|
|
8
|
+
}
|
|
9
|
+
persons(id) {
|
|
10
|
+
return new ContactsPersonsAPI(this._httpClient, `${this._baseUrl}/persons`, id);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/modules/contacts/api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,OAAO,WAAW;IAGF;IAFH,QAAQ,CAAS;IAElC,YAAoB,WAAuB,EAAE,OAAe;QAAxC,gBAAW,GAAX,WAAW,CAAY;QACzC,IAAI,CAAC,QAAQ,GAAG,GAAG,OAAO,WAAW,CAAC;IACxC,CAAC;IAED,OAAO,CAAC,EAAW;QACjB,OAAO,IAAI,kBAAkB,CAC3B,IAAI,CAAC,WAAW,EAChB,GAAG,IAAI,CAAC,QAAQ,UAAU,EAC1B,EAAE,CACH,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/contacts/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/contacts/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTTPClient } from "@src/utils/http";
|
|
2
|
+
import { ContactPersonAddress, CreateContactPersonAddressDTO, UpdateContactPersonAddressDTO } from "../types";
|
|
3
|
+
export declare class ContactsPersonsAddressesAPI {
|
|
4
|
+
private _crud;
|
|
5
|
+
constructor(httpClient: HTTPClient, baseUrl: string, addressId?: string);
|
|
6
|
+
create(data: CreateContactPersonAddressDTO): Promise<ContactPersonAddress>;
|
|
7
|
+
update(id: string, data: UpdateContactPersonAddressDTO): Promise<ContactPersonAddress>;
|
|
8
|
+
delete(id?: string): Promise<void>;
|
|
9
|
+
find(query?: Record<string, unknown>): Promise<ContactPersonAddress[]>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=addresses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../../../../src/modules/contacts/persons/api/addresses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EACL,oBAAoB,EACpB,6BAA6B,EAC7B,6BAA6B,EAC9B,MAAM,UAAU,CAAC;AAElB,qBAAa,2BAA2B;IACtC,OAAO,CAAC,KAAK,CAIX;gBAEU,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;IAOvE,MAAM,CAAC,IAAI,EAAE,6BAA6B,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAI1E,MAAM,CACJ,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,6BAA6B,GAClC,OAAO,CAAC,oBAAoB,CAAC;IAIhC,MAAM,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlC,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;CAGvE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CRUD } from "@src/utils/crud";
|
|
2
|
+
export class ContactsPersonsAddressesAPI {
|
|
3
|
+
_crud;
|
|
4
|
+
constructor(httpClient, baseUrl, addressId) {
|
|
5
|
+
this._crud = new CRUD(httpClient, {
|
|
6
|
+
basePath: baseUrl,
|
|
7
|
+
id: addressId,
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
create(data) {
|
|
11
|
+
return this._crud.create(data);
|
|
12
|
+
}
|
|
13
|
+
update(id, data) {
|
|
14
|
+
return this._crud.update(id, data);
|
|
15
|
+
}
|
|
16
|
+
delete(id) {
|
|
17
|
+
return this._crud.delete(id);
|
|
18
|
+
}
|
|
19
|
+
find(query) {
|
|
20
|
+
return this._crud.find(query);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=addresses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addresses.js","sourceRoot":"","sources":["../../../../../src/modules/contacts/persons/api/addresses.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAOvC,MAAM,OAAO,2BAA2B;IAC9B,KAAK,CAIX;IAEF,YAAY,UAAsB,EAAE,OAAe,EAAE,SAAkB;QACrE,IAAI,CAAC,KAAK,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE;YAChC,QAAQ,EAAE,OAAO;YACjB,EAAE,EAAE,SAAS;SACd,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,IAAmC;QACxC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,MAAM,CACJ,EAAU,EACV,IAAmC;QAEnC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,CAAC,EAAW;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;IAED,IAAI,CAAC,KAA+B;QAClC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/contacts/persons/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/contacts/persons/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HTTPClient } from "@src/utils/http";
|
|
2
|
+
import { CRUD } from "@src/utils/crud";
|
|
3
|
+
import { ContactPerson, ContactPersonExtended, CreateContactPersonDTO, UpdateContactPersonDTO } from "../types";
|
|
4
|
+
import { ContactsPersonsAddressesAPI } from "./addresses";
|
|
5
|
+
export declare class ContactsPersonsAPI extends CRUD<ContactPersonExtended, CreateContactPersonDTO, UpdateContactPersonDTO, ContactPerson | ContactPersonExtended> {
|
|
6
|
+
private readonly _personId?;
|
|
7
|
+
constructor(httpClient: HTTPClient, baseUrl: string, _personId?: string | undefined);
|
|
8
|
+
addresses(id?: string): ContactsPersonsAddressesAPI;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=persons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persons.d.ts","sourceRoot":"","sources":["../../../../../src/modules/contacts/persons/api/persons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAE1D,qBAAa,kBAAmB,SAAQ,IAAI,CAC1C,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,aAAa,GAAG,qBAAqB,CACtC;IAIG,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC;gBAF3B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,MAAM,EACE,SAAS,CAAC,EAAE,MAAM,YAAA;IAQrC,SAAS,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,2BAA2B;CAWpD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CRUD } from "@src/utils/crud";
|
|
2
|
+
import { ContactsPersonsAddressesAPI } from "./addresses";
|
|
3
|
+
export class ContactsPersonsAPI extends CRUD {
|
|
4
|
+
_personId;
|
|
5
|
+
constructor(httpClient, baseUrl, _personId) {
|
|
6
|
+
super(httpClient, {
|
|
7
|
+
basePath: baseUrl,
|
|
8
|
+
id: _personId,
|
|
9
|
+
});
|
|
10
|
+
this._personId = _personId;
|
|
11
|
+
}
|
|
12
|
+
addresses(id) {
|
|
13
|
+
if (!this._personId) {
|
|
14
|
+
throw new Error("Person ID is required");
|
|
15
|
+
}
|
|
16
|
+
return new ContactsPersonsAddressesAPI(this._httpClient, `${this._config.basePath}/${this._personId}/addresses`, id);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=persons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persons.js","sourceRoot":"","sources":["../../../../../src/modules/contacts/persons/api/persons.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAOvC,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAE1D,MAAM,OAAO,kBAAmB,SAAQ,IAKvC;IAIoB;IAHnB,YACE,UAAsB,EACtB,OAAe,EACE,SAAkB;QAEnC,KAAK,CAAC,UAAU,EAAE;YAChB,QAAQ,EAAE,OAAO;YACjB,EAAE,EAAE,SAAS;SACd,CAAC,CAAC;QALc,cAAS,GAAT,SAAS,CAAS;IAMrC,CAAC;IAED,SAAS,CAAC,EAAW;QACnB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAC3C,CAAC;QAED,OAAO,IAAI,2BAA2B,CACpC,IAAI,CAAC,WAAW,EAChB,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,SAAS,YAAY,EACtD,EAAE,CACH,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/contacts/persons/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/contacts/persons/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface ContactAddressGplacesRaw {
|
|
2
|
+
placeId: string;
|
|
3
|
+
value: string;
|
|
4
|
+
updatedAt: Date;
|
|
5
|
+
}
|
|
6
|
+
export type CreateContactAddressGplacesRawDTO = Omit<ContactAddressGplacesRaw, "updatedAt">;
|
|
7
|
+
export interface ContactAddress {
|
|
8
|
+
id: string;
|
|
9
|
+
gplacesRawId: string;
|
|
10
|
+
countryId: number;
|
|
11
|
+
coords: [number, number];
|
|
12
|
+
adminstrativeAreas: string[];
|
|
13
|
+
locality: string;
|
|
14
|
+
streetName: string;
|
|
15
|
+
streetNumber: string;
|
|
16
|
+
postalCode: string;
|
|
17
|
+
updatedAt: Date;
|
|
18
|
+
sublocality?: string;
|
|
19
|
+
neighborhood?: string;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=address.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../../../../src/modules/contacts/persons/types/address.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,MAAM,iCAAiC,GAAG,IAAI,CAClD,wBAAwB,EACxB,WAAW,CACZ,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,IAAI,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../../../../src/modules/contacts/persons/types/address.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/contacts/persons/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC"}
|