@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
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockServer.js","sourceRoot":"","sources":["../mockServer.ts"],"names":[],"mappings":";;;AAAA,6BAA2B;AA2CV,qFA3CR,UAAI,OA2CQ;AA1CrB,mCAAuC;AAEvC,MAAM,MAAM,GAAG,IAAA,kBAAW,EACxB,UAAI,CAAC,IAAI,CAAC,GA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AAG,CACR,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EACf,GAAG,CAAC,IAAI,CAAC;YACP,YAAY,EAAE,YAAY;YAC1B,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE;SACvB,CAAC,CACH,CAAC;IACJ,CAAC,CACF;CACF,CAAC;AAEqB,4BAAQ"}
@@ -1,15 +0,0 @@
1
- import { ClientCtx } from '../types';
2
- export default function (ctx: ClientCtx): {
3
- readonly getAll: ({ companyId }: {
4
- companyId: string;
5
- }) => Promise<import("axios").AxiosResponse<any>>;
6
- readonly get: ({ channelAccountId }: {
7
- channelAccountId: string;
8
- }) => Promise<import("axios").AxiosResponse<any>>;
9
- readonly getEstateHash: ({ estateId, channelAccountId, }: {
10
- estateId: string;
11
- channelAccountId: string;
12
- }) => Promise<{
13
- hash: string;
14
- }>;
15
- };
@@ -1,16 +0,0 @@
1
- import { ClientCtx } from '../types';
2
- interface ReferenceDetails {
3
- reference_code: string;
4
- estate_id: string;
5
- channel_id: string;
6
- channel_account_id: string;
7
- company_id: string;
8
- }
9
- export interface ChannelsResolveReferencesResult {
10
- data: ReferenceDetails[];
11
- }
12
- export default function (ctx: ClientCtx): {
13
- getPropertyIdFromReference: (channel: string, referenceId: string) => Promise<import("axios").AxiosResponse<any>>;
14
- resolveReferences: (channel_id: string, reference_code: string, company_id?: string | undefined) => Promise<ChannelsResolveReferencesResult>;
15
- };
16
- export {};
@@ -1,7 +0,0 @@
1
- import { ClientCtx } from '../types';
2
- export default function (ctx: ClientCtx): {
3
- get: (attributes: {
4
- companyId: string;
5
- includes?: string[];
6
- }) => Promise<import("axios").AxiosResponse<any>>;
7
- };
@@ -1,6 +0,0 @@
1
- import { ClientCtx } from '../types';
2
- export default function contact_preferences(ctx: ClientCtx): {
3
- getAll: (attributes: {
4
- contactId: string;
5
- }) => Promise<import("axios").AxiosResponse<any>>;
6
- };
@@ -1,14 +0,0 @@
1
- import { ClientCtx } from '../types';
2
- export default function (ctx: ClientCtx): {
3
- getOne: (attributes: {
4
- contactId: string;
5
- }) => Promise<import("axios").AxiosResponse<any>>;
6
- getOneWithNegotiators: (attributes: {
7
- contactId: string;
8
- }) => Promise<import("axios").AxiosResponse<any>>;
9
- getAll: (attributes: {
10
- companyId: string;
11
- page?: number;
12
- limit?: number;
13
- }) => Promise<import("axios").AxiosResponse<any>>;
14
- };
@@ -1,43 +0,0 @@
1
- import { Property } from '../entities/property';
2
- import { ClientCtx, EstateInclude, GetUnitsInput, PropertiesOutput, UnitsOutput } from '../types';
3
- export default function (ctx: ClientCtx): {
4
- getOne: (attributes: {
5
- estateId: string;
6
- companyId: string;
7
- includes?: EstateInclude[];
8
- }) => Promise<Property>;
9
- getAll: (attributes: {
10
- companyId: string;
11
- page?: number;
12
- limit?: number;
13
- archived?: boolean;
14
- }) => Promise<PropertiesOutput>;
15
- getUnits: (projectId: string, { page, limit, includes }?: GetUnitsInput) => Promise<UnitsOutput>;
16
- createPublication: (attributes: {
17
- estateId: string;
18
- channelAccountId: string;
19
- config: Record<string, any>;
20
- }) => Promise<import("axios").AxiosResponse<any>>;
21
- updatePublication: (attributes: {
22
- estateId: string;
23
- channelAccountId: string;
24
- config: Record<string, any>;
25
- }) => Promise<import("axios").AxiosResponse<any>>;
26
- unpublishPublication: (attributes: {
27
- estateId: string;
28
- channelAccountId: string;
29
- }) => Promise<import("axios").AxiosResponse<any>>;
30
- scheduleVisit: (estateId: string, attributes: {
31
- first_name: string;
32
- last_name: string;
33
- email: string;
34
- phone: string;
35
- preferences?: {
36
- locale: string;
37
- };
38
- }) => Promise<import("axios").AxiosResponse<any>>;
39
- unstable_setPublicationUrl: ({ estateId, url, }: {
40
- estateId: string;
41
- url: string;
42
- }) => Promise<import("axios").AxiosResponse<any>>;
43
- };
@@ -1,39 +0,0 @@
1
- import { ClientCtx } from '../types';
2
- export default function (ctx: ClientCtx): {
3
- createLead: (attributes: {
4
- firstName?: string;
5
- lastName: string;
6
- propertyId: string;
7
- email?: string;
8
- phone?: string;
9
- message: string;
10
- portal: string;
11
- location_preference?: {
12
- country: string;
13
- postal_codes: string[];
14
- };
15
- }) => Promise<import("axios").AxiosResponse<any>>;
16
- createUnassignedLead: (companyId: string, attributes: {
17
- first_name: string;
18
- last_name: string;
19
- phone: string;
20
- email: string;
21
- message: string;
22
- source_type: 'channel';
23
- external_source: string;
24
- preferences?: {
25
- types: string[];
26
- negotiation: 'sale' | 'let';
27
- condition: string;
28
- min_price?: number;
29
- max_price?: number;
30
- wishes: string[];
31
- min_rooms: number;
32
- locale: string;
33
- };
34
- location_preference?: {
35
- country: string;
36
- postal_codes: string[];
37
- };
38
- }) => Promise<import("axios").AxiosResponse<any>>;
39
- };
@@ -1,10 +0,0 @@
1
- import { ClientCtx } from '../types';
2
- import { NegotiatorInfo } from '../types';
3
- export default function (ctx: ClientCtx): {
4
- getNegotiatorsByIdCompanyId: (attributes: {
5
- ids: string;
6
- companyId: string;
7
- }) => Promise<{
8
- data: NegotiatorInfo[];
9
- }>;
10
- };
@@ -1,6 +0,0 @@
1
- import { ClientCtx } from '../types';
2
- export default function (ctx: ClientCtx): {
3
- getOffice: (attributes: {
4
- officeId: string;
5
- }) => Promise<import("axios").AxiosResponse<any>>;
6
- };
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const __1 = require("../");
4
- const mockServer_1 = require("../../mockServer");
5
- describe('authorization', () => {
6
- it('can fetch an auth token', async () => {
7
- const client = (0, __1.createClient)({
8
- clientId: 'FAKE_ID',
9
- clientSecret: 'FAKE_SECRET',
10
- });
11
- mockServer_1.server.use(mockServer_1.handlers.authHandler);
12
- await client.authorize({});
13
- });
14
- });
15
- //# sourceMappingURL=auth.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.test.js","sourceRoot":"","sources":["../../../src/__tests__/auth.test.ts"],"names":[],"mappings":";;AAAA,2BAAmC;AACnC,iDAAoD;AAEpD,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,yBAAyB,EAAE,KAAK,IAAI,EAAE;QACvC,MAAM,MAAM,GAAG,IAAA,gBAAY,EAAC;YAC1B,QAAQ,EAAE,SAAS;YACnB,YAAY,EAAE,aAAa;SAC5B,CAAC,CAAC;QAEH,mBAAM,CAAC,GAAG,CAAC,qBAAQ,CAAC,WAAW,CAAC,CAAC;QACjC,MAAM,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,77 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const __1 = require("../");
4
- const mockServer_1 = require("../../mockServer");
5
- describe('channels', () => {
6
- it('can fetch a references list', async () => {
7
- const client = (0, __1.createClient)({
8
- clientId: 'FAKE_ID',
9
- clientSecret: 'FAKE_SECRET',
10
- });
11
- mockServer_1.server.use(mockServer_1.handlers.authHandler);
12
- await client.authorize();
13
- const estateId = 'FAKE_ESTATE_ID';
14
- const reference = 'FAKE_REFERENCE';
15
- const channelAccountId = 'FAKE_CHANNEL_ACCOUNT_ID';
16
- const companyId = 'FAKE_COMPANY_ID';
17
- const channelId = 'FAKE_CHANNEL_ID';
18
- mockServer_1.server.use(mockServer_1.rest.get('https://api.sweepbright.com/services/channel-references', (req, res, ctx) => {
19
- return res(ctx.status(200), ctx.json({
20
- data: [
21
- {
22
- reference_code: req.url.searchParams.get('reference_code'),
23
- company_id: req.url.searchParams.get('company_id'),
24
- channel_id: req.url.searchParams.get('channel_id'),
25
- estate_id: estateId,
26
- channel_account_id: channelAccountId,
27
- },
28
- ],
29
- }));
30
- }));
31
- const result = await client.channels.resolveReferences(channelId, reference, companyId);
32
- expect(result).toEqual({
33
- data: [
34
- {
35
- reference_code: reference,
36
- estate_id: estateId,
37
- channel_account_id: channelAccountId,
38
- channel_id: channelId,
39
- company_id: companyId,
40
- },
41
- ],
42
- });
43
- });
44
- it('it does not send a company_id when not set', async () => {
45
- const client = (0, __1.createClient)({
46
- clientId: 'FAKE_ID',
47
- clientSecret: 'FAKE_SECRET',
48
- });
49
- mockServer_1.server.use(mockServer_1.handlers.authHandler);
50
- await client.authorize();
51
- const estateId = 'FAKE_ESTATE_ID';
52
- const reference = 'FAKE_REFERENCE';
53
- const channelAccountId = 'FAKE_CHANNEL_ACCOUNT_ID';
54
- const channelId = 'FAKE_CHANNEL_ID';
55
- mockServer_1.server.use(mockServer_1.rest.get('https://api.sweepbright.com/services/channel-references', (req, res, ctx) => {
56
- try {
57
- expect(req.url.search).toEqual(`?channel_id=${channelId}&reference_code=${reference}`);
58
- }
59
- catch (e) {
60
- return res(ctx.status(500), ctx.json({ error: e }));
61
- }
62
- return res(ctx.status(200), ctx.json({
63
- data: [
64
- {
65
- reference_code: req.url.searchParams.get('reference_code'),
66
- company_id: 'FAKE',
67
- channel_id: req.url.searchParams.get('channel_id'),
68
- estate_id: estateId,
69
- channel_account_id: channelAccountId,
70
- },
71
- ],
72
- }));
73
- }));
74
- await client.channels.resolveReferences(channelId, reference, undefined);
75
- });
76
- });
77
- //# sourceMappingURL=channels.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"channels.test.js","sourceRoot":"","sources":["../../../src/__tests__/channels.test.ts"],"names":[],"mappings":";;AAAA,2BAAmC;AACnC,iDAA0D;AAE1D,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,EAAE,CAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;QAC3C,MAAM,MAAM,GAAG,IAAA,gBAAY,EAAC;YAC1B,QAAQ,EAAE,SAAS;YACnB,YAAY,EAAE,aAAa;SAC5B,CAAC,CAAC;QACH,mBAAM,CAAC,GAAG,CAAC,qBAAQ,CAAC,WAAW,CAAC,CAAC;QACjC,MAAM,MAAM,CAAC,SAAS,EAAE,CAAC;QAEzB,MAAM,QAAQ,GAAG,gBAAgB,CAAC;QAClC,MAAM,SAAS,GAAG,gBAAgB,CAAC;QACnC,MAAM,gBAAgB,GA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-1,61 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const __1 = require("../");
4
- const mockServer_1 = require("../../mockServer");
5
- describe('contacts', () => {
6
- it('requires authentication', async () => {
7
- const client = (0, __1.createClient)({
8
- clientId: 'FAKE_ID',
9
- clientSecret: 'FAKE_SECRET',
10
- });
11
- try {
12
- await client.contacts.getOne({
13
- contactId: 'foo',
14
- });
15
- }
16
- catch (err) {
17
- expect(err.message).toEqual('client is not authenticated');
18
- }
19
- });
20
- it('can fetch a contact', async () => {
21
- const client = (0, __1.createClient)({
22
- clientId: 'FAKE_ID',
23
- clientSecret: 'FAKE_SECRET',
24
- });
25
- mockServer_1.server.use(mockServer_1.handlers.authHandler);
26
- await client.authorize();
27
- const contactId = 'FAKE_CONTACT_ID';
28
- mockServer_1.server.use(mockServer_1.rest.get('https://api.sweepbright.com/services/contacts/:contactId', (req, res, ctx) => {
29
- return res(ctx.status(200), ctx.json({
30
- data: {
31
- id: req.params.contactId,
32
- },
33
- }));
34
- }));
35
- const result = await client.contacts.getOne({
36
- contactId: contactId,
37
- });
38
- expect(result).toEqual({ data: { id: contactId } });
39
- });
40
- it('can fetch a contact with negotiators', async () => {
41
- const client = (0, __1.createClient)({
42
- clientId: 'FAKE_ID',
43
- clientSecret: 'FAKE_SECRET',
44
- });
45
- mockServer_1.server.use(mockServer_1.handlers.authHandler);
46
- await client.authorize();
47
- const contactId = 'FAKE_CONTACT_ID';
48
- mockServer_1.server.use(mockServer_1.rest.get('https://api.sweepbright.com/services/contacts/:contactId?includes=negotiators', (req, res, ctx) => {
49
- return res(ctx.status(200), ctx.json({
50
- data: {
51
- id: req.params.contactId,
52
- },
53
- }));
54
- }));
55
- const result = await client.contacts.getOneWithNegotiators({
56
- contactId: contactId,
57
- });
58
- expect(result).toEqual({ data: { id: contactId } });
59
- });
60
- });
61
- //# sourceMappingURL=contacts.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contacts.test.js","sourceRoot":"","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;YAC1C,SAAS,EAAE,SAAS;SACrB,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE,KAAK,IAAI,EAAE;QACpD,MAAM,MAAM,GAAG,IAAA,gBAAY,EAAC;YAC1B,QAAQ,EAAE,SAAS;YACnB,YAAY,EAAE,aAAa;SAC5B,CAAC,CAAC;QAEH,mBAAM,CAAC,GAAG,CAAC,qBAAQ,CAAC,WAAW,CAAC,CAAC;QACjC,MAAM,MAAM,CAAC,SAAS,EAAE,CAAC;QAEzB,MAAM,SAAS,GAAG,iBAAiB,CAAC;QACpC,mBAAM,CAAC,GAAG,CACR,iBAAI,CAAC,GAAG,CACN,+EAA+E,EAC/E,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;YAChB,OAAO,GAAG,CACR,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EACf,GAAG,CAAC,IAAI,CAAC;gBACP,IAAI,EAAE;oBACJ,EAAE,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS;iBACzB;aACF,CAAC,CACH,CAAC;QACJ,CAAC,CACF,CACF,CAAC;QAEF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAAC;YACzD,SAAS,EAAE,SAAS;SACrB,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const __1 = require("../");
4
- const mockServer_1 = require("../../mockServer");
5
- describe('estates', () => {
6
- it('requires authentication', async () => {
7
- const client = (0, __1.createClient)({
8
- clientId: 'FAKE_ID',
9
- clientSecret: 'FAKE_SECRET',
10
- });
11
- try {
12
- await client.estates.getOne({
13
- estateId: 'FAKE_ESTATE_ID',
14
- companyId: 'FAKE_COMPANY_ID',
15
- });
16
- }
17
- catch (err) {
18
- await expect(err.message).toEqual('client is not authenticated');
19
- }
20
- });
21
- it('can fetch a estate', async () => {
22
- const client = (0, __1.createClient)({
23
- clientId: 'FAKE_ID',
24
- clientSecret: 'FAKE_SECRET',
25
- });
26
- mockServer_1.server.use(mockServer_1.handlers.authHandler);
27
- await client.authorize();
28
- const estateId = 'FAKE_ESTATE_ID';
29
- mockServer_1.server.use(mockServer_1.rest.get('https://api.sweepbright.com/services/estates/:estateId', (req, res, ctx) => {
30
- return res(ctx.status(200), ctx.json({
31
- data: {
32
- id: req.params.estateId,
33
- },
34
- }));
35
- }));
36
- const result = await client.estates.getOne({
37
- estateId: estateId,
38
- companyId: 'FAKE_COMPANY_ID',
39
- });
40
- expect(result).toEqual({ id: estateId });
41
- });
42
- });
43
- //# sourceMappingURL=estates.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"estates.test.js","sourceRoot":"","sources":["../../../src/__tests__/estates.test.ts"],"names":[],"mappings":";;AAAA,2BAAmC;AACnC,iDAA0D;AAE1D,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,EAAE,CAAC,yBAAyB,EAAE,KAAK,IAAI,EAAE;QACvC,MAAM,MAAM,GAAG,IAAA,gBAAY,EAAC;YAC1B,QAAQ,EAAE,SAAS;YACnB,YAAY,EAAE,aAAa;SAC5B,CAAC,CAAC;QACH,IAAI;YACF,MAAM,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;gBAC1B,QAAQ,EAAE,gBAAgB;gBAC1B,SAAS,EAAE,iBAAiB;aAC7B,CAAC,CAAC;SACJ;QAAC,OAAO,GAAG,EAAE;YACZ,MAAM,MAAM,CAAE,GAAW,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC;SAC3E;IACH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oBAAoB,EAAE,KAAK,IAAI,EAAE;QAClC,MAAM,MAAM,GAAG,IAAA,gBAAY,EAAC;YAC1B,QAAQ,EAAE,SAAS;YACnB,YAAY,EAAE,aAAa;SAC5B,CAAC,CAAC;QACH,mBAAM,CAAC,GAAG,CAAC,qBAAQ,CAAC,WAAW,CAAC,CAAC;QACjC,MAAM,MAAM,CAAC,SAAS,EAAE,CAAC;QAEzB,MAAM,QAAQ,GAAG,gBAAgB,CAAC;QAClC,mBAAM,CAAC,GAAG,CACR,iBAAI,CAAC,GAAG,CACN,wDAAwD,EACxD,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;YAChB,OAAO,GAAG,CACR,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EACf,GAAG,CAAC,IAAI,CAAC;gBACP,IAAI,EAAE;oBACJ,EAAE,EAAE,GAAG,CAAC,MAAM,CAAC,QAAQ;iBACxB;aACF,CAAC,CACH,CAAC;QACJ,CAAC,CACF,CACF,CAAC;QACF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;YACzC,QAAQ,EAAE,QAAQ;YAClB,SAAS,EAAE,iBAAiB;SAC7B,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const __1 = require("../");
4
- const mockServer_1 = require("../../mockServer");
5
- describe('leads', () => {
6
- it('requires authentication', async () => {
7
- const client = (0, __1.createClient)({
8
- clientId: 'FAKE_ID',
9
- clientSecret: 'FAKE_SECRET',
10
- });
11
- try {
12
- await client.leads.createLead({
13
- firstName: 'foo',
14
- lastName: 'bar',
15
- propertyId: 'baz',
16
- email: 'john@example.com',
17
- phone: '999',
18
- message: "I'm not authenticated",
19
- portal: 'portal',
20
- });
21
- }
22
- catch (err) {
23
- expect(err.message).toEqual('client is not authenticated');
24
- }
25
- });
26
- it('can put a lead', async () => {
27
- const client = (0, __1.createClient)({
28
- clientId: 'FAKE_ID',
29
- clientSecret: 'FAKE_SECRET',
30
- });
31
- mockServer_1.server.use(mockServer_1.handlers.authHandler);
32
- await client.authorize();
33
- const lead = {
34
- firstName: 'foo',
35
- lastName: 'bar',
36
- propertyId: 'PROPERTY_ID',
37
- email: 'john@example.com',
38
- phone: '999',
39
- message: "I'm authenticated",
40
- portal: 'portal',
41
- location_preference: {
42
- country: 'BR',
43
- postal_codes: ['06010'],
44
- },
45
- };
46
- mockServer_1.server.use(mockServer_1.rest.put('https://api.sweepbright.com/estates/PROPERTY_ID/leads', (_, res, ctx) => {
47
- return res(ctx.status(200), ctx.json({
48
- data: lead,
49
- }));
50
- }));
51
- const result = await client.leads.createLead(lead);
52
- expect(result).toEqual({ data: lead });
53
- });
54
- });
55
- //# sourceMappingURL=leads.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"leads.test.js","sourceRoot":"","sources":["../../../src/__tests__/leads.test.ts"],"names":[],"mappings":";;AAAA,2BAAmC;AACnC,iDAA0D;AAE1D,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACrB,EAAE,CAAC,yBAAyB,EAAE,KAAK,IAAI,EAAE;QACvC,MAAM,MAAM,GAAG,IAAA,gBAAY,EAAC;YAC1B,QAAQ,EAAE,SAAS;YACnB,YAAY,EAAE,aAAa;SAC5B,CAAC,CAAC;QAEH,IAAI;YACF,MAAM,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC;gBAC5B,SAAS,EAAE,KAAK;gBAChB,QAAQ,EAAE,KAAK;gBACf,UAAU,EAAE,KAAK;gBACjB,KAAK,EAAE,kBAAkB;gBACzB,KAAK,EAAE,KAA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CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const convict_1 = __importDefault(require("convict"));
7
- const convict_format_with_validator_1 = __importDefault(require("convict-format-with-validator"));
8
- convict_1.default.addFormats(convict_format_with_validator_1.default);
9
- const config = (0, convict_1.default)({
10
- env: {
11
- doc: "The application environment.",
12
- format: ["production", "dev", "staging"],
13
- default: "dev",
14
- env: "STAGE",
15
- },
16
- nodeEnv: {
17
- env: "NODE_ENV",
18
- doc: "Node env",
19
- format: String,
20
- default: ""
21
- },
22
- service: {
23
- name: {
24
- doc: "The name of the service.",
25
- format: String,
26
- default: "my-service",
27
- env: "SERVICE_NAME",
28
- },
29
- },
30
- });
31
- // Perform validation
32
- config.validate({ allowed: "strict" });
33
- exports.default = config;
34
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/common/config.ts"],"names":[],"mappings":";;;;;AAAA,sDAA8B;AAC9B,kGAAmE;AAEnE,iBAAO,CAAC,UAAU,CAAC,uCAAsB,CAAC,CAAC;AAE3C,MAAM,MAAM,GAAG,IAAA,iBAAO,EAAC;IACnB,GAAG,EAAE;QACD,GAAG,EAAE,8BAA8B;QACnC,MAAM,EAAE,CAAC,YAAY,EAAE,KAAK,EAAE,SAAS,CAAC;QACxC,OAAO,EAAE,KAAK;QACd,GAAG,EAAE,OAAO;KACf;IACD,OAAO,EAAE;QACL,GAAG,EAAE,UAAU;QACf,GAAG,EAAE,UAAU;QACf,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,EAAE;KACd;IACD,OAAO,EAAE;QACL,IAAI,EAAE;YACF,GAAG,EAAE,0BAA0B;YAC/B,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,YAAY;YACrB,GAAG,EAAE,cAAc;SACtB;KACJ;CACJ,CAAC,CAAC;AAEH,qBAAqB;AACrB,MAAM,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;AAEvC,kBAAe,MAAM,CAAC"}
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Currency = void 0;
4
- var Currency;
5
- (function (Currency) {
6
- Currency["EUR"] = "EUR";
7
- Currency["AUD"] = "AUD";
8
- Currency["USD"] = "USD";
9
- Currency["AFN"] = "AFN";
10
- Currency["GBP"] = "GBP";
11
- Currency["XPF"] = "XPF";
12
- Currency["MXN"] = "MXN";
13
- Currency["PHP"] = "PHP";
14
- Currency["CAD"] = "CAD";
15
- Currency["RON"] = "RON";
16
- Currency["BRL"] = "BRL";
17
- Currency["UYU"] = "UYU";
18
- Currency["HRK"] = "HRK";
19
- Currency["GEL"] = "GEL";
20
- Currency["RSD"] = "RSD";
21
- Currency["ILS"] = "ILS";
22
- Currency["ARS"] = "ARS";
23
- Currency["NZD"] = "NZD";
24
- Currency["ZAR"] = "ZAR";
25
- Currency["INR"] = "INR";
26
- Currency["DZD"] = "DZD";
27
- Currency["LKR"] = "LKR";
28
- Currency["CLP"] = "CLP";
29
- Currency["ALL"] = "ALL";
30
- Currency["RUB"] = "RUB";
31
- Currency["TRY"] = "TRY";
32
- Currency["UAH"] = "UAH";
33
- Currency["MUR"] = "MUR";
34
- Currency["COP"] = "COP";
35
- Currency["AED"] = "AED";
36
- Currency["MZN"] = "MZN";
37
- Currency["EGP"] = "EGP";
38
- Currency["AOA"] = "AOA";
39
- Currency["XOF"] = "XOF";
40
- Currency["CNY"] = "CNY";
41
- Currency["XCD"] = "XCD";
42
- Currency["VND"] = "VND";
43
- Currency["JPY"] = "JPY";
44
- Currency["MAD"] = "MAD";
45
- Currency["CHF"] = "CHF";
46
- Currency["IRR"] = "IRR";
47
- Currency["KHR"] = "KHR";
48
- Currency["XAF"] = "XAF";
49
- Currency["AMD"] = "AMD";
50
- Currency["ETB"] = "ETB";
51
- Currency["SGD"] = "SGD";
52
- Currency["NGN"] = "NGN";
53
- Currency["PKP"] = "PKP";
54
- })(Currency || (exports.Currency = Currency = {}));
55
- //# sourceMappingURL=currencies.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"currencies.js","sourceRoot":"","sources":["../../../src/common/currencies.ts"],"names":[],"mappings":";;;AAAA,IAAY,QAiDX;AAjDD,WAAY,QAAQ;IAClB,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;AACb,CAAC,EAjDW,QAAQ,wBAAR,QAAQ,QAiDnB"}
@@ -1,50 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.makeLogger = exports.getLogger = exports.WinstonLogger = void 0;
7
- const winston_1 = __importDefault(require("winston"));
8
- const config_1 = __importDefault(require("./config"));
9
- let logger;
10
- class WinstonLogger {
11
- constructor(logger) {
12
- this.logger = logger;
13
- }
14
- error(message, ...meta) {
15
- this.logger.log("error", message, ...meta);
16
- }
17
- warn(message, ...meta) {
18
- this.logger.log("warn", message, ...meta);
19
- }
20
- info(message, ...meta) {
21
- if (config_1.default.get('nodeEnv') !== 'test') {
22
- this.logger.log("info", message, ...meta);
23
- }
24
- }
25
- debug(message, ...meta) {
26
- this.logger.log("debug", message, ...meta);
27
- }
28
- }
29
- exports.WinstonLogger = WinstonLogger;
30
- function getLogger() {
31
- const logger = winston_1.default.createLogger({
32
- transports: [new winston_1.default.transports.Console()],
33
- format: winston_1.default.format.json(),
34
- defaultMeta: {
35
- service: config_1.default.get("service.name"),
36
- env: config_1.default.get("env"),
37
- },
38
- });
39
- return logger;
40
- }
41
- exports.getLogger = getLogger;
42
- function makeLogger() {
43
- if (logger) {
44
- return logger;
45
- }
46
- logger = new WinstonLogger(getLogger());
47
- return logger;
48
- }
49
- exports.makeLogger = makeLogger;
50
- //# sourceMappingURL=logger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/common/logger.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA8B;AAC9B,sDAA8B;AAe9B,IAAI,MAAc,CAAC;AAEnB,MAAa,aAAa;IACtB,YAAoB,MAAsB;QAAtB,WAAM,GAAN,MAAM,CAAgB;IAAG,CAAC;IAG9C,KAAK,CAAC,OAAe,EAAE,GAAG,IAAW;QACjC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,GA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@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MeasurementSystem = void 0;
4
- var MeasurementSystem;
5
- (function (MeasurementSystem) {
6
- MeasurementSystem["metric"] = "metric";
7
- MeasurementSystem["imperial"] = "imperial";
8
- })(MeasurementSystem || (exports.MeasurementSystem = MeasurementSystem = {}));
9
- //# sourceMappingURL=office.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"office.js","sourceRoot":"","sources":["../../../src/entities/office.ts"],"names":[],"mappings":";;;AAGA,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,0CAAqB,CAAA;AACvB,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B"}