@sweepbright/api-client 0.29.8 → 0.30.1
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/package.json +3 -3
- package/dist/api-client.cjs.development.js +0 -1322
- package/dist/api-client.cjs.development.js.map +0 -1
- package/dist/api-client.cjs.production.min.js +0 -2
- package/dist/api-client.cjs.production.min.js.map +0 -1
- package/dist/api-client.esm.js +0 -1318
- package/dist/api-client.esm.js.map +0 -1
- package/dist/common/config.d.ts +0 -2
- package/dist/common/currencies.d.ts +0 -50
- package/dist/common/logger.d.ts +0 -27
- package/dist/common/types.d.ts +0 -1
- package/dist/entities/property.d.ts +0 -523
- package/dist/index.d.ts +0 -142
- package/dist/index.js +0 -8
- package/dist/mockServer.js +0 -27
- package/dist/mockServer.js.map +0 -1
- package/dist/resources/channel_accounts.d.ts +0 -15
- package/dist/resources/channels.d.ts +0 -16
- package/dist/resources/companies.d.ts +0 -7
- package/dist/resources/contact_preferences.d.ts +0 -6
- package/dist/resources/contacts.d.ts +0 -14
- package/dist/resources/estates.d.ts +0 -43
- package/dist/resources/leads.d.ts +0 -39
- package/dist/resources/negotiators.d.ts +0 -10
- package/dist/resources/offices.d.ts +0 -6
- package/dist/src/__tests__/auth.test.js +0 -15
- package/dist/src/__tests__/auth.test.js.map +0 -1
- package/dist/src/__tests__/channels.test.js +0 -77
- package/dist/src/__tests__/channels.test.js.map +0 -1
- package/dist/src/__tests__/contacts.test.js +0 -61
- package/dist/src/__tests__/contacts.test.js.map +0 -1
- package/dist/src/__tests__/estates.test.js +0 -43
- package/dist/src/__tests__/estates.test.js.map +0 -1
- package/dist/src/__tests__/leads.test.js +0 -55
- package/dist/src/__tests__/leads.test.js.map +0 -1
- package/dist/src/common/config.js +0 -34
- package/dist/src/common/config.js.map +0 -1
- package/dist/src/common/currencies.js +0 -55
- package/dist/src/common/currencies.js.map +0 -1
- package/dist/src/common/logger.js +0 -50
- package/dist/src/common/logger.js.map +0 -1
- package/dist/src/common/types.js +0 -3
- package/dist/src/common/types.js.map +0 -1
- package/dist/src/entities/office.js +0 -9
- package/dist/src/entities/office.js.map +0 -1
- package/dist/src/entities/property.js +0 -220
- package/dist/src/entities/property.js.map +0 -1
- package/dist/src/index.js +0 -94
- package/dist/src/index.js.map +0 -1
- package/dist/src/resources/channel_accounts.js +0 -31
- package/dist/src/resources/channel_accounts.js.map +0 -1
- package/dist/src/resources/channels.js +0 -32
- package/dist/src/resources/channels.js.map +0 -1
- package/dist/src/resources/companies.js +0 -16
- package/dist/src/resources/companies.js.map +0 -1
- package/dist/src/resources/contact_preferences.js +0 -14
- package/dist/src/resources/contact_preferences.js.map +0 -1
- package/dist/src/resources/contacts.js +0 -29
- package/dist/src/resources/contacts.js.map +0 -1
- package/dist/src/resources/estates.js +0 -73
- package/dist/src/resources/estates.js.map +0 -1
- package/dist/src/resources/leads.js +0 -26
- package/dist/src/resources/leads.js.map +0 -1
- package/dist/src/resources/negotiators.js +0 -16
- package/dist/src/resources/negotiators.js.map +0 -1
- package/dist/src/resources/offices.js +0 -12
- package/dist/src/resources/offices.js.map +0 -1
- package/dist/src/types.js +0 -40
- package/dist/src/types.js.map +0 -1
- package/dist/src/utils.js +0 -28
- package/dist/src/utils.js.map +0 -1
- package/dist/types.d.ts +0 -75
- package/dist/utils.d.ts +0 -7
package/dist/src/types.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TokenType = exports.EstateInclude = exports.Env = void 0;
|
|
4
|
-
var Env;
|
|
5
|
-
(function (Env) {
|
|
6
|
-
Env["PRODUCTION"] = "production";
|
|
7
|
-
Env["STAGING"] = "staging";
|
|
8
|
-
Env["DEV"] = "dev";
|
|
9
|
-
})(Env || (exports.Env = Env = {}));
|
|
10
|
-
var EstateInclude;
|
|
11
|
-
(function (EstateInclude) {
|
|
12
|
-
EstateInclude["settings"] = "settings";
|
|
13
|
-
EstateInclude["channels"] = "channels";
|
|
14
|
-
EstateInclude["negotiator"] = "negotiator";
|
|
15
|
-
EstateInclude["office.settings"] = "office.settings";
|
|
16
|
-
EstateInclude["project.settings"] = "project.settings";
|
|
17
|
-
EstateInclude["project.office.settings"] = "project.office.settings";
|
|
18
|
-
EstateInclude["project.properties.office.settings"] = "project.properties.office.settings";
|
|
19
|
-
EstateInclude["project.properties.settings"] = "project.properties.settings";
|
|
20
|
-
EstateInclude["properties.settings"] = "properties.settings";
|
|
21
|
-
EstateInclude["properties.office.settings"] = "properties.office.settings";
|
|
22
|
-
EstateInclude["properties.negotiator"] = "properties.negotiator";
|
|
23
|
-
EstateInclude["item.settings"] = "item.settings";
|
|
24
|
-
EstateInclude["item.office.settings"] = "item.office.settings";
|
|
25
|
-
EstateInclude["item.channels"] = "item.channels";
|
|
26
|
-
EstateInclude["item.project.settings"] = "item.project.settings";
|
|
27
|
-
EstateInclude["item.project.office.settings"] = "item.project.office.settings";
|
|
28
|
-
EstateInclude["item.project.properties.office.settings"] = "item.project.properties.office.settings";
|
|
29
|
-
EstateInclude["item.project.properties.settings"] = "item.project.properties.settings";
|
|
30
|
-
EstateInclude["item.properties.settings"] = "item.properties.settings";
|
|
31
|
-
EstateInclude["item.properties.office.settings"] = "item.properties.office.settings";
|
|
32
|
-
EstateInclude["item.negotiator"] = "item.negotiator";
|
|
33
|
-
EstateInclude["item.properties.negotiator"] = "item.properties.negotiator";
|
|
34
|
-
})(EstateInclude || (exports.EstateInclude = EstateInclude = {}));
|
|
35
|
-
var TokenType;
|
|
36
|
-
(function (TokenType) {
|
|
37
|
-
TokenType[TokenType["USER_TOKEN"] = 0] = "USER_TOKEN";
|
|
38
|
-
TokenType[TokenType["API_TOKEN"] = 1] = "API_TOKEN";
|
|
39
|
-
})(TokenType || (exports.TokenType = TokenType = {}));
|
|
40
|
-
//# sourceMappingURL=types.js.map
|
package/dist/src/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAGA,IAAY,GAIX;AAJD,WAAY,GAAG;IACb,gCAAyB,CAAA;IACzB,0BAAmB,CAAA;IACnB,kBAAW,CAAA;AACb,CAAC,EAJW,GAAG,mBAAH,GAAG,QAId;AAED,IAAY,aAuBX;AAvBD,WAAY,aAAa;IACvB,sCAAqB,CAAA;IACrB,sCAAqB,CAAA;IACrB,0CAAyB,CAAA;IACzB,oDAAqC,CAAA;IACrC,sDAAuC,CAAA;IACvC,oEAAqD,CAAA;IACrD,0FAA2E,CAAA;IAC3E,4EAA6D,CAAA;IAC7D,4DAA6C,CAAA;IAC7C,0EAA2D,CAAA;IAC3D,gEAAiD,CAAA;IACjD,gDAAiC,CAAA;IACjC,8DAA+C,CAAA;IAC/C,gDAAiC,CAAA;IACjC,gEAAiD,CAAA;IACjD,8EAA+D,CAAA;IAC/D,oGAAqF,CAAA;IACrF,sFAAuE,CAAA;IACvE,sEAAuD,CAAA;IACvD,oFAAqE,CAAA;IACrE,oDAAqC,CAAA;IACrC,0EAA2D,CAAA;AAC7D,CAAC,EAvBW,aAAa,6BAAb,aAAa,QAuBxB;AAaD,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,qDAAU,CAAA;IACV,mDAAS,CAAA;AACX,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB"}
|
package/dist/src/utils.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handleRequestFailure = exports.getData = void 0;
|
|
4
|
-
function getData(response) {
|
|
5
|
-
return response.data;
|
|
6
|
-
}
|
|
7
|
-
exports.getData = getData;
|
|
8
|
-
function handleRequestFailure(exception) {
|
|
9
|
-
if (exception.response) {
|
|
10
|
-
const { response: { status, data }, } = exception;
|
|
11
|
-
const error = new Error(`${status}: ${JSON.stringify(data)}`);
|
|
12
|
-
// remove parts of the stack trace so the error message (codeframe) shows up
|
|
13
|
-
// at the code where the actual problem is.
|
|
14
|
-
error.stack = (error.stack || '')
|
|
15
|
-
.split('\n')
|
|
16
|
-
.filter((line) => !line.includes('at handleRequestFailure') &&
|
|
17
|
-
!line.includes('at processTicksAndRejections'))
|
|
18
|
-
.join('\n');
|
|
19
|
-
error.status = status;
|
|
20
|
-
error.data = data;
|
|
21
|
-
return Promise.reject(error);
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
return Promise.reject(exception);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
exports.handleRequestFailure = handleRequestFailure;
|
|
28
|
-
//# sourceMappingURL=utils.js.map
|
package/dist/src/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;AAAA,SAAgB,OAAO,CAAC,QAAa;IACnC,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC;AAFD,0BAEC;AAED,SAAgB,oBAAoB,CAAC,SAKpC;IACC,IAAI,SAAS,CAAC,QAAQ,EAAE;QACtB,MAAM,EACJ,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAC3B,GAAG,SAAS,CAAC;QAEd,MAAM,KAAK,GAAQ,IAAI,KAAK,CAAC,GAAG,MAAM,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACnE,4EAA4E;QAC5E,2CAA2C;QAC3C,KAAK,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;aAC9B,KAAK,CAAC,IAAI,CAAC;aACX,MAAM,CACL,CAAC,IAAY,EAAE,EAAE,CACf,CAAC,IAAI,CAAC,QAAQ,CAAC,yBAAyB,CAAC;YACzC,CAAC,IAAI,CAAC,QAAQ,CAAC,8BAA8B,CAAC,CACjD;aACA,IAAI,CAAC,IAAI,CAAC,CAAC;QAEd,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;QACtB,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;QAElB,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;KAC9B;SAAM;QACL,OAAO,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;KAClC;AACH,CAAC;AA9BD,oDA8BC"}
|
package/dist/types.d.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { AxiosInstance } from 'axios';
|
|
2
|
-
import { Property } from './entities/property';
|
|
3
|
-
export declare enum EstateInclude {
|
|
4
|
-
settings = "settings",
|
|
5
|
-
channels = "channels",
|
|
6
|
-
negotiator = "negotiator",
|
|
7
|
-
'office.settings' = "office.settings",
|
|
8
|
-
'project.settings' = "project.settings",
|
|
9
|
-
'project.office.settings' = "project.office.settings",
|
|
10
|
-
'project.properties.office.settings' = "project.properties.office.settings",
|
|
11
|
-
'project.properties.settings' = "project.properties.settings",
|
|
12
|
-
'properties.settings' = "properties.settings",
|
|
13
|
-
'properties.office.settings' = "properties.office.settings",
|
|
14
|
-
'properties.negotiator' = "properties.negotiator",
|
|
15
|
-
'item.settings' = "item.settings",
|
|
16
|
-
'item.office.settings' = "item.office.settings",
|
|
17
|
-
'item.channels' = "item.channels",
|
|
18
|
-
'item.project.settings' = "item.project.settings",
|
|
19
|
-
'item.project.office.settings' = "item.project.office.settings",
|
|
20
|
-
'item.project.properties.office.settings' = "item.project.properties.office.settings",
|
|
21
|
-
'item.project.properties.settings' = "item.project.properties.settings",
|
|
22
|
-
'item.properties.settings' = "item.properties.settings",
|
|
23
|
-
'item.properties.office.settings' = "item.properties.office.settings",
|
|
24
|
-
'item.negotiator' = "item.negotiator",
|
|
25
|
-
'item.properties.negotiator' = "item.properties.negotiator"
|
|
26
|
-
}
|
|
27
|
-
export declare type ClientConf = {
|
|
28
|
-
clientId?: string;
|
|
29
|
-
clientSecret?: string;
|
|
30
|
-
env?: Env;
|
|
31
|
-
version?: string;
|
|
32
|
-
};
|
|
33
|
-
export declare type InitConf = {
|
|
34
|
-
scopes?: string[];
|
|
35
|
-
};
|
|
36
|
-
export declare enum TokenType {
|
|
37
|
-
USER_TOKEN = 0,
|
|
38
|
-
API_TOKEN = 1
|
|
39
|
-
}
|
|
40
|
-
export declare type Auth = {
|
|
41
|
-
token: string;
|
|
42
|
-
expiresIn?: string;
|
|
43
|
-
type: TokenType;
|
|
44
|
-
};
|
|
45
|
-
export declare type Maybe<T> = T | null;
|
|
46
|
-
export declare type ClientCtx = {
|
|
47
|
-
checkAuth: (tokenType: TokenType) => void;
|
|
48
|
-
httpClient: AxiosInstance;
|
|
49
|
-
};
|
|
50
|
-
export declare enum Env {
|
|
51
|
-
PRODUCTION = "production",
|
|
52
|
-
STAGING = "staging",
|
|
53
|
-
DEV = "dev"
|
|
54
|
-
}
|
|
55
|
-
export interface NegotiatorInfo {
|
|
56
|
-
id: number;
|
|
57
|
-
first_name?: string;
|
|
58
|
-
last_name?: string;
|
|
59
|
-
picture_url?: string;
|
|
60
|
-
full_name?: string;
|
|
61
|
-
}
|
|
62
|
-
export interface GetUnitsInput {
|
|
63
|
-
page?: number;
|
|
64
|
-
limit?: number;
|
|
65
|
-
includes?: EstateInclude[];
|
|
66
|
-
}
|
|
67
|
-
export interface UnitsOutput {
|
|
68
|
-
data: Property[];
|
|
69
|
-
}
|
|
70
|
-
export interface PropertyOutput {
|
|
71
|
-
data: Property;
|
|
72
|
-
}
|
|
73
|
-
export interface PropertiesOutput {
|
|
74
|
-
data: Property[];
|
|
75
|
-
}
|