@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.
Files changed (73) hide show
  1. package/package.json +3 -3
  2. package/dist/api-client.cjs.development.js +0 -1322
  3. package/dist/api-client.cjs.development.js.map +0 -1
  4. package/dist/api-client.cjs.production.min.js +0 -2
  5. package/dist/api-client.cjs.production.min.js.map +0 -1
  6. package/dist/api-client.esm.js +0 -1318
  7. package/dist/api-client.esm.js.map +0 -1
  8. package/dist/common/config.d.ts +0 -2
  9. package/dist/common/currencies.d.ts +0 -50
  10. package/dist/common/logger.d.ts +0 -27
  11. package/dist/common/types.d.ts +0 -1
  12. package/dist/entities/property.d.ts +0 -523
  13. package/dist/index.d.ts +0 -142
  14. package/dist/index.js +0 -8
  15. package/dist/mockServer.js +0 -27
  16. package/dist/mockServer.js.map +0 -1
  17. package/dist/resources/channel_accounts.d.ts +0 -15
  18. package/dist/resources/channels.d.ts +0 -16
  19. package/dist/resources/companies.d.ts +0 -7
  20. package/dist/resources/contact_preferences.d.ts +0 -6
  21. package/dist/resources/contacts.d.ts +0 -14
  22. package/dist/resources/estates.d.ts +0 -43
  23. package/dist/resources/leads.d.ts +0 -39
  24. package/dist/resources/negotiators.d.ts +0 -10
  25. package/dist/resources/offices.d.ts +0 -6
  26. package/dist/src/__tests__/auth.test.js +0 -15
  27. package/dist/src/__tests__/auth.test.js.map +0 -1
  28. package/dist/src/__tests__/channels.test.js +0 -77
  29. package/dist/src/__tests__/channels.test.js.map +0 -1
  30. package/dist/src/__tests__/contacts.test.js +0 -61
  31. package/dist/src/__tests__/contacts.test.js.map +0 -1
  32. package/dist/src/__tests__/estates.test.js +0 -43
  33. package/dist/src/__tests__/estates.test.js.map +0 -1
  34. package/dist/src/__tests__/leads.test.js +0 -55
  35. package/dist/src/__tests__/leads.test.js.map +0 -1
  36. package/dist/src/common/config.js +0 -34
  37. package/dist/src/common/config.js.map +0 -1
  38. package/dist/src/common/currencies.js +0 -55
  39. package/dist/src/common/currencies.js.map +0 -1
  40. package/dist/src/common/logger.js +0 -50
  41. package/dist/src/common/logger.js.map +0 -1
  42. package/dist/src/common/types.js +0 -3
  43. package/dist/src/common/types.js.map +0 -1
  44. package/dist/src/entities/office.js +0 -9
  45. package/dist/src/entities/office.js.map +0 -1
  46. package/dist/src/entities/property.js +0 -220
  47. package/dist/src/entities/property.js.map +0 -1
  48. package/dist/src/index.js +0 -94
  49. package/dist/src/index.js.map +0 -1
  50. package/dist/src/resources/channel_accounts.js +0 -31
  51. package/dist/src/resources/channel_accounts.js.map +0 -1
  52. package/dist/src/resources/channels.js +0 -32
  53. package/dist/src/resources/channels.js.map +0 -1
  54. package/dist/src/resources/companies.js +0 -16
  55. package/dist/src/resources/companies.js.map +0 -1
  56. package/dist/src/resources/contact_preferences.js +0 -14
  57. package/dist/src/resources/contact_preferences.js.map +0 -1
  58. package/dist/src/resources/contacts.js +0 -29
  59. package/dist/src/resources/contacts.js.map +0 -1
  60. package/dist/src/resources/estates.js +0 -73
  61. package/dist/src/resources/estates.js.map +0 -1
  62. package/dist/src/resources/leads.js +0 -26
  63. package/dist/src/resources/leads.js.map +0 -1
  64. package/dist/src/resources/negotiators.js +0 -16
  65. package/dist/src/resources/negotiators.js.map +0 -1
  66. package/dist/src/resources/offices.js +0 -12
  67. package/dist/src/resources/offices.js.map +0 -1
  68. package/dist/src/types.js +0 -40
  69. package/dist/src/types.js.map +0 -1
  70. package/dist/src/utils.js +0 -28
  71. package/dist/src/utils.js.map +0 -1
  72. package/dist/types.d.ts +0 -75
  73. 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
@@ -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
@@ -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
- }
package/dist/utils.d.ts DELETED
@@ -1,7 +0,0 @@
1
- export declare function getData(response: any): any;
2
- export declare function handleRequestFailure(exception: {
3
- response?: {
4
- status: number;
5
- data: any;
6
- };
7
- }): Promise<never>;