@opendoor/partner-sdk-server-js-core 1.2.0 → 1.2.1-beta.101.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/dist/client.d.ts.map +1 -1
- package/dist/client.js +12 -30
- package/dist/graphql/queries.d.ts +8 -0
- package/dist/graphql/queries.d.ts.map +1 -1
- package/dist/graphql/queries.js +18 -0
- package/package.json +1 -1
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,KAAK,EACV,0BAA0B,EAC1B,OAAO,EACP,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,2BAA2B,EAC3B,mCAAmC,EACnC,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC1B,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,yBAAyB,EAC1B,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,KAAK,EACV,0BAA0B,EAC1B,OAAO,EACP,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,2BAA2B,EAC3B,mCAAmC,EACnC,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC1B,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,yBAAyB,EAC1B,MAAM,YAAY,CAAC;AAoGpB,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,YAAY,CAAC;AAE3D;;;;;;;;;;GAUG;AACH,MAAM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ACG,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAwB3E;;;;;;;;OAQG;IACG,iBAAiB,CACrB,OAAO,EAAE,OAAO,EAChB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,yBAAyB,CAAC;IA6BrC;;;;OAIG;IACG,eAAe,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAsEzD;;;;;OAKG;IACG,kBAAkB,CACtB,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,0BAA0B,CAAC;IA8BtC;;;;;;;;;;;;;OAaG;IACG,kBAAkB,CACtB,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,0BAA0B,CAAC;IA+BtC;;;;;;OAMG;IACG,aAAa,CACjB,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,qBAAqB,CAAC;YA8BnB,OAAO;YAoDP,gBAAgB;IAgC9B,OAAO,CAAC,GAAG;CAKZ"}
|
package/dist/client.js
CHANGED
|
@@ -26,7 +26,7 @@ import { ValidationError } from './errors.js';
|
|
|
26
26
|
import { validateCreateOfferRequest, validateUpdateOfferRequest, } from './validators.js';
|
|
27
27
|
import { OFFER_REQUEST_CREATE, OFFER_REQUEST_UPDATE, SCHEDULE_EXTERIOR_ASSESSMENT, } from './graphql/mutations.js';
|
|
28
28
|
import { transformAnswersToOfferInput, POOL_TYPE_NORMALIZE, } from './answerKeyMapping.js';
|
|
29
|
-
import { OFFER_REQUEST_QUERY, OFFER_REQUEST_WITH_SELL_DIRECT_PRICING, OFFER_REQUEST_WITH_PRODUCTS_PRICING, ADDRESS_UNIT_CHECK, SELLER_INPUT_PREFILLS_QUERY, LIST_PARTNERS_QUERY, ADDRESS_DETAILS_QUERY, } from './graphql/queries.js';
|
|
29
|
+
import { OFFER_REQUEST_QUERY, OFFER_REQUEST_WITH_SELL_DIRECT_PRICING, OFFER_REQUEST_WITH_PRODUCTS_PRICING, ADDRESS_UNIT_CHECK, SELLER_INPUT_PREFILLS_QUERY, LIST_PARTNERS_QUERY, ADDRESS_DETAILS_QUERY, EXTERIOR_ASSESSMENT_SLOTS_QUERY, } from './graphql/queries.js';
|
|
30
30
|
// ============================================================================
|
|
31
31
|
// Valid GraphQL OfferInput fields (from schema-public.graphql)
|
|
32
32
|
// ============================================================================
|
|
@@ -441,37 +441,19 @@ export class OpendoorClient {
|
|
|
441
441
|
if (!params.offerId?.trim()) {
|
|
442
442
|
throw new ValidationError('offerId is required', 'offerId');
|
|
443
443
|
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
method: 'POST',
|
|
450
|
-
headers: {
|
|
451
|
-
'Content-Type': 'application/json',
|
|
452
|
-
Authorization: `Basic ${this.apiKey}`,
|
|
453
|
-
},
|
|
454
|
-
body: JSON.stringify({
|
|
455
|
-
partnerId: this.apiKey,
|
|
456
|
-
sellerInputUuid: params.offerId,
|
|
457
|
-
// Default: pre-UW assessment (the post-IFO Lennar Trade-In path).
|
|
458
|
-
// 'DILIGENCE_VISIT' is the post-contract Inspectify visit.
|
|
459
|
-
calendarType: params.calendarType ?? 'ASSESSMENT_VISIT',
|
|
460
|
-
}),
|
|
444
|
+
const result = await this.graphql(EXTERIOR_ASSESSMENT_SLOTS_QUERY, {
|
|
445
|
+
sellerInputUuid: params.offerId,
|
|
446
|
+
// Default: pre-UW assessment (the post-IFO Lennar Trade-In path).
|
|
447
|
+
// 'DILIGENCE_VISIT' is the post-contract Inspectify visit.
|
|
448
|
+
calendarType: params.calendarType ?? 'ASSESSMENT_VISIT',
|
|
461
449
|
});
|
|
462
|
-
|
|
463
|
-
throw new OpendoorAPIError(`Assessment slots request failed: ${response.status} ${response.statusText}`, 'NETWORK_ERROR', response.status);
|
|
464
|
-
}
|
|
465
|
-
const raw = (await response.json());
|
|
466
|
-
if (!raw.success) {
|
|
467
|
-
throw new OpendoorAPIError(raw.error ?? 'Assessment slots request failed', 'API_ERROR', 200);
|
|
468
|
-
}
|
|
450
|
+
const slots = result.exteriorAssessmentSlots;
|
|
469
451
|
return {
|
|
470
|
-
currentInspectionTime:
|
|
471
|
-
availableSlots:
|
|
472
|
-
isSlotBased:
|
|
473
|
-
visitId:
|
|
474
|
-
timezone:
|
|
452
|
+
currentInspectionTime: slots.currentInspectionTime ?? null,
|
|
453
|
+
availableSlots: slots.availableSlots ?? [],
|
|
454
|
+
isSlotBased: slots.isSlotBased ?? false,
|
|
455
|
+
visitId: slots.visitId ?? '',
|
|
456
|
+
timezone: slots.timezone ?? 'UTC',
|
|
475
457
|
};
|
|
476
458
|
}
|
|
477
459
|
/**
|
|
@@ -16,6 +16,14 @@ export declare const OFFER_REQUEST_WITH_SELL_DIRECT_PRICING = "\n query OfferRe
|
|
|
16
16
|
* Per-product blocks may be null when the partner does not offer that product.
|
|
17
17
|
*/
|
|
18
18
|
export declare const OFFER_REQUEST_WITH_PRODUCTS_PRICING = "\n query OfferRequestWithProductsPricing($opendoorOfferRequestId: String!) {\n offerRequestWithProductsPricing(opendoorOfferRequestId: $opendoorOfferRequestId) {\n opendoorOfferRequestId\n offerStatus\n denialInfo {\n deniedAt\n code\n explanation\n }\n handoverAt\n authenticatedDashboardUrl\n sellDirect {\n offerStatus\n denialInfo {\n deniedAt\n code\n explanation\n }\n offerData {\n netProceeds\n sentAt\n expirationAt\n expirationAtDisplayDate\n mortgageBalance\n sellerName\n sellerEmail\n headlinePriceCents\n opendoorFeeCents\n repairCostCents\n closingCostsCents\n }\n }\n cnml {\n offerStatus\n denialInfo {\n deniedAt\n code\n explanation\n }\n offerData {\n estimatedSalePriceCents\n upfrontCashCents\n estimatedAdditionalProceedsCents\n estimatedTotalProceedsCents\n programFeeCents\n repairCostCents\n closingCostCents\n }\n }\n }\n }\n";
|
|
19
|
+
/**
|
|
20
|
+
* Available assessment / inspection slots for an offer.
|
|
21
|
+
*
|
|
22
|
+
* `calendarType` is `'ASSESSMENT_VISIT'` for the pre-underwriting home
|
|
23
|
+
* assessment (post-IFO Lennar Trade-In path) or `'DILIGENCE_VISIT'` for
|
|
24
|
+
* the post-contract Inspectify visit.
|
|
25
|
+
*/
|
|
26
|
+
export declare const EXTERIOR_ASSESSMENT_SLOTS_QUERY = "\n query ExteriorAssessmentSlots($sellerInputUuid: String!, $calendarType: CalendarType!) {\n exteriorAssessmentSlots(sellerInputUuid: $sellerInputUuid, calendarType: $calendarType) {\n timezone\n availableSlots\n currentInspectionTime\n isSlotBased\n visitId\n }\n }\n";
|
|
19
27
|
/**
|
|
20
28
|
* Check whether an address requires a unit number.
|
|
21
29
|
* Returns true when the building has multiple units and no unit was specified.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../src/graphql/queries.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,q2BAoC/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sCAAsC,mmBAyBlD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mCAAmC,ssCAoD/C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,6IAM9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,wRAW/B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,oZAmBjC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,2BAA2B,iKAMvC,CAAC"}
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../src/graphql/queries.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,q2BAoC/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sCAAsC,mmBAyBlD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mCAAmC,ssCAoD/C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B,mTAU3C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,6IAM9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,wRAW/B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,oZAmBjC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,2BAA2B,iKAMvC,CAAC"}
|
package/dist/graphql/queries.js
CHANGED
|
@@ -129,6 +129,24 @@ export const OFFER_REQUEST_WITH_PRODUCTS_PRICING = `
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
`;
|
|
132
|
+
/**
|
|
133
|
+
* Available assessment / inspection slots for an offer.
|
|
134
|
+
*
|
|
135
|
+
* `calendarType` is `'ASSESSMENT_VISIT'` for the pre-underwriting home
|
|
136
|
+
* assessment (post-IFO Lennar Trade-In path) or `'DILIGENCE_VISIT'` for
|
|
137
|
+
* the post-contract Inspectify visit.
|
|
138
|
+
*/
|
|
139
|
+
export const EXTERIOR_ASSESSMENT_SLOTS_QUERY = `
|
|
140
|
+
query ExteriorAssessmentSlots($sellerInputUuid: String!, $calendarType: CalendarType!) {
|
|
141
|
+
exteriorAssessmentSlots(sellerInputUuid: $sellerInputUuid, calendarType: $calendarType) {
|
|
142
|
+
timezone
|
|
143
|
+
availableSlots
|
|
144
|
+
currentInspectionTime
|
|
145
|
+
isSlotBased
|
|
146
|
+
visitId
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
`;
|
|
132
150
|
/**
|
|
133
151
|
* Check whether an address requires a unit number.
|
|
134
152
|
* Returns true when the building has multiple units and no unit was specified.
|