Repository navigation
v0.11.0
- Breaking: discriminated unions narrow on their discriminator.
Item,EntityandBatchResultare now unions of the kinds this SDK models, soif (item.objectType === "qbd_service_item")or aswitchgives aServiceItem; before, the fallback stayed in the union and the narrowed value wasServiceItem | UnrecognizedItem. The fallbacksUnrecognizedItem,UnrecognizedEntityandUnknownBatchResultare separate types, and new type guards test each kind:isServiceItem(item),isVendor(entity),isBatchCustomerCreateResult(result)and so on, plusisUnrecognizedItem,isUnrecognizedEntityandisUnknownBatchResultfor a kind this SDK does not model. Such a kind still arrives unchanged at runtime. Migration: test it with the fallback guard before narrowing (if (isUnrecognizedItem(item)) { ... }), instead of comparingobjectTypewith"qbd_unrecognized_item"or another string this SDK does not list (a type error now), assigning anUnrecognizedItemtoItem, or reading fields in thedefaultbranch of aswitchover every kind (the value isneverthere). - Breaking: a write whose outcome was unknown and that the platform later recovered (request
succeeded,outcomeapplied,recovered: true,resultnull,recoveredObjectIdset) throws the newResultUnavailableErrorfromRequestHandle.wait(),RequestHandle.result()and the long poll after504 QBD_REQUEST_TIMEOUT. They returnednulltyped as the result. The error is anInternalErrorwithrequestId,outcomeapplied,retryablefalse andrecoveredObjectId; retrieve the object by that ID and do not send the write again. This holds also when the result is past retention (resultExpiredtrue). 500 INTERNAL_ERRORwithdetails.reasonresult_unavailable(the result is no longer available) throwsResultUnavailableError(recoveredObjectIdnull) and is never retried, even whenDaapi-Should-Retrysays true. For a write that was applied (outcome: applied), never send it again and read the object instead; for a read (outcome: not_applicable), it is safe to send the read again.client.qbd.priceLevels.list()acceptsitemId, an alias ofitemIdswith Conductor's name for this filter, so Conductor code ports unchanged. Both take one item ID; sending both with different values returns400 INVALID_PARAMETER. Batch members (BatchPriceLevelListInputQuery) accept it too.
All versions: CHANGELOG.md.