@opendoor/partner-sdk-server-js-core 1.2.1-beta.100.1 → 1.2.1-beta.102.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.
@@ -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;AAmGpB,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,YAAY,CAAC;AAE3D;;;;;;;;;;GAUG;AACH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AA6ED,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAU;IAChC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;gBAE7B,MAAM,EAAE,oBAAoB;I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AEG;YACW,eAAe;IAqC7B;;;;;OAKG;IACG,WAAW,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAoBzE;;;;;;;OAOG;IACG,WAAW,CACf,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,mBAAmB,CAAC;IAoC/B;;;;;;OAMG;IACG,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAc1D;;;;OAIG;IACG,6BAA6B,CACjC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,2BAA2B,CAAC;IAcvC;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,2BAA2B,CAC/B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,mCAAmC,CAAC;IAkB/C;;;;;;OAMG;IACG,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,39 +441,19 @@ export class OpendoorClient {
441
441
  if (!params.offerId?.trim()) {
442
442
  throw new ValidationError('offerId is required', 'offerId');
443
443
  }
444
- // The /v2/* REST routes are served by the cloudflare-worker on the
445
- // *address* domain (demo.simplersell.com staging / www.opendoor.com prod),
446
- // not the partnership-bff GraphQL host. They live under /partner-api-proxy/*.
447
- const apiBase = new URL(this.addressEndpoint).origin;
448
- const url = `${apiBase}/partner-api-proxy/v2/exterior_assessment_slots`;
449
- this.log(`REST POST → ${url}`);
450
- const response = await this.fetchWithTimeout(url, {
451
- method: 'POST',
452
- headers: {
453
- 'Content-Type': 'application/json',
454
- Authorization: `Basic ${this.apiKey}`,
455
- },
456
- body: JSON.stringify({
457
- partnerId: this.apiKey,
458
- sellerInputUuid: params.offerId,
459
- // Default: pre-UW assessment (the post-IFO Lennar Trade-In path).
460
- // 'DILIGENCE_VISIT' is the post-contract Inspectify visit.
461
- calendarType: params.calendarType ?? 'ASSESSMENT_VISIT',
462
- }),
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',
463
449
  });
464
- if (!response.ok) {
465
- throw new OpendoorAPIError(`Assessment slots request failed: ${response.status} ${response.statusText}`, 'NETWORK_ERROR', response.status);
466
- }
467
- const raw = (await response.json());
468
- if (!raw.success) {
469
- throw new OpendoorAPIError(raw.error ?? 'Assessment slots request failed', 'API_ERROR', 200);
470
- }
450
+ const slots = result.exteriorAssessmentSlots;
471
451
  return {
472
- currentInspectionTime: raw.currentInspectionTime ?? null,
473
- availableSlots: raw.availableSlots ?? [],
474
- isSlotBased: raw.isSlotBased ?? false,
475
- visitId: raw.visitId ?? '',
476
- timezone: raw.timezone ?? 'UTC',
452
+ currentInspectionTime: slots.currentInspectionTime ?? null,
453
+ availableSlots: slots.availableSlots ?? [],
454
+ isSlotBased: slots.isSlotBased ?? false,
455
+ visitId: slots.visitId ?? '',
456
+ timezone: slots.timezone ?? 'UTC',
477
457
  };
478
458
  }
479
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"}
@@ -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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opendoor/partner-sdk-server-js-core",
3
- "version": "1.2.1-beta.100.1",
3
+ "version": "1.2.1-beta.102.1",
4
4
  "description": "Server-side SDK for Opendoor partner integrations",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",