@fire-spark/core 0.38.1 → 0.38.2
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/index.d.ts +17 -2
- package/dist/index.js +281 -3
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Money, PaymentAdapter, PaymentCollectAt, PaymentContext, PaymentResult, PaymentReversal, PaymentStorage, PaymentUI, RedeemLike, RedeemSource, isRealPaymentMethod, orderRedeems } from "@fire-spark/payments";
|
|
2
|
-
import { AndConditions, ApplyFeesInput, ApplyFeesOrderScope, CheckoutMode, CheckoutResolved, CmsBlock, Condition, Customer, CustomerIdentifyInput, CustomerRegisterInput, CustomerUpdateInput, Fee, Fulfillment, FulfillmentEligibilityInput, FulfillmentEligibilityInput as FulfillmentEligibilityInput$1, FulfillmentListInput, GroupDisplayType, KioskDeviceConfig, KioskDeviceConfigInput, KioskDeviceOverrides, KioskHealthBatchInput, KioskHealthBatchResult, KioskHeartbeatInput, KioskHeartbeatResult, KioskPickupNameRules, KioskRealtimeToken, LocalServerConfig, LocalServerConfig as LocalServerConfig$1, LocalServerHealthResult, LocalServerHealthResult as LocalServerHealthResult$1, MasivoTotpCode, MasivoTotpCreateInput, MasivoTotpVerification, MasivoTotpVerifyInput, MatchResult, MatchableRule, Menu, Menu as Menu$1, MenuLookup, MenuLookup as MenuLookup$1, MerchantPayment, ModifierControlType, ModifierGroup, OrConditions, Order as Order$1, Order as Order$2, OrderCancelInput, OrderCancelInput as OrderCancelInput$1, OrderCancelType, OrderCancelType as OrderCancelType$1, OrderDeviceListInput, OrderDeviceListResult, OrderFulfillment, OrderFulfillmentWorkflow, OrderFulfillmentWorkflowEdge, OrderFulfillmentWorkflowNode, OrderInsertInput, OrderLine, OrderListInput, OrderRateInput, OrderRating, OrderRecord, OrderRecordPaymentInput, OrderRedeem, OrderRedemptionStep, OrderReorderInput, OrderRouteKind, OrderRouteKind as OrderRouteKind$1, OrderRouteStatus, OrderRoutes, OrderRoutes as OrderRoutes$1, OrderSetCustomerInput, OrderTotals, OrderUpdateInput, OrderValidateInput, OrderValidateOutput, PaymentCollectAt as PaymentCollectAt$1, PaymentEligibilityInput, PaymentEligibilityInput as PaymentEligibilityInput$1, PaymentIntentPutInput, PaymentMethod, PaymentProvider, PaymentTender, PaymentTenderInput, PlaceOrderResult, PosCatalog, PosFloorInput, PosFloorOccupancy, PosFloorPlan, PosFloorRealtimeToken, PosHealthBatchInput, PosHealthBatchResult, PosHeartbeatInput, PosHeartbeatResult, PosKioskOrder, PosKioskSettleInput, PosKioskSettleResult, PosOrderInput, PosOrderResult, PosTableAttachOrderInput, PosTableCloseInput, PosTableJoinInput, PosTableSeatInput, PosTableSeatReservationInput, PosTableSplitInput, PricingModifier, Product, Product as Product$1, Recommendation, RecurringDateCronFormatter, RecurringDateCronResult, RecurringDateCronSummary, RecurringDateCronValues, RouteEligibility, RouteEligibility as RouteEligibility$1, RouteEligibilityDetail, RouteEligibilityFlags, RouteEligibilityReason, RouteFailureKind, RouteFailureKind as RouteFailureKind$1, RouteHealthEvent, RouteHealthEvent as RouteHealthEvent$1, RouteHealthListener, RouteHealthListener as RouteHealthListener$1, RulesEngineOrder, RulesEngineOrderLine, RulesEngineParams, RulesEngineRuntime, Schedule, SdkLogContext, SdkLogErrorInfo, SdkLogLevel, SdkLogOptions, Store, StoreGetInput, StoreListInput, StoreNearbyInput, StorefrontAvailability, StorefrontMenu, StorefrontMenuScope, StorefrontMenuStreamOptions, StorefrontPaymentsListInput, StorefrontPreferences, SwitchCustomerArg, SwitchCustomerArg as SwitchCustomerArg$1, SwitchCustomerIdToken, SwitchCustomerResult, SwitchCustomerResult as SwitchCustomerResult$1, TenderRefundInput, TenderReplaceInput, TenderVoidInput, Variant, VariantGroup, WordFilterCheckInput, WordFilterCheckResult } from "@fire-spark/types";
|
|
2
|
+
import { AndConditions, ApplyFeesInput, ApplyFeesOrderScope, CheckoutMode, CheckoutResolved, CmsBlock, Condition, Customer, CustomerIdentifyInput, CustomerRegisterInput, CustomerUpdateInput, DeviceSecretStorage, DeviceSecretsConfigureOptions, DeviceSecretsConfigureOptions as DeviceSecretsConfigureOptions$1, DeviceSecretsPayload, DeviceSecretsPayload as DeviceSecretsPayload$1, Fee, Fulfillment, FulfillmentEligibilityInput, FulfillmentEligibilityInput as FulfillmentEligibilityInput$1, FulfillmentListInput, GroupDisplayType, KioskDeviceConfig, KioskDeviceConfigInput, KioskDeviceOverrides, KioskHealthBatchInput, KioskHealthBatchResult, KioskHeartbeatInput, KioskHeartbeatResult, KioskPickupNameRules, KioskRealtimeToken, LocalServerConfig, LocalServerConfig as LocalServerConfig$1, LocalServerHealthResult, LocalServerHealthResult as LocalServerHealthResult$1, MasivoTotpCode, MasivoTotpCreateInput, MasivoTotpVerification, MasivoTotpVerifyInput, MatchResult, MatchableRule, Menu, Menu as Menu$1, MenuLookup, MenuLookup as MenuLookup$1, MerchantPayment, ModifierControlType, ModifierGroup, OrConditions, Order as Order$1, Order as Order$2, OrderCancelInput, OrderCancelInput as OrderCancelInput$1, OrderCancelType, OrderCancelType as OrderCancelType$1, OrderDeviceListInput, OrderDeviceListResult, OrderFulfillment, OrderFulfillmentWorkflow, OrderFulfillmentWorkflowEdge, OrderFulfillmentWorkflowNode, OrderInsertInput, OrderLine, OrderListInput, OrderRateInput, OrderRating, OrderRecord, OrderRecordPaymentInput, OrderRedeem, OrderRedemptionStep, OrderReorderInput, OrderRouteKind, OrderRouteKind as OrderRouteKind$1, OrderRouteStatus, OrderRoutes, OrderRoutes as OrderRoutes$1, OrderSetCustomerInput, OrderTotals, OrderUpdateInput, OrderValidateInput, OrderValidateOutput, PaymentCollectAt as PaymentCollectAt$1, PaymentEligibilityInput, PaymentEligibilityInput as PaymentEligibilityInput$1, PaymentIntentPutInput, PaymentMethod, PaymentProvider, PaymentTender, PaymentTenderInput, PlaceOrderResult, PosCatalog, PosFloorInput, PosFloorOccupancy, PosFloorPlan, PosFloorRealtimeToken, PosHealthBatchInput, PosHealthBatchResult, PosHeartbeatInput, PosHeartbeatResult, PosKioskOrder, PosKioskSettleInput, PosKioskSettleResult, PosOrderInput, PosOrderResult, PosTableAttachOrderInput, PosTableCloseInput, PosTableJoinInput, PosTableSeatInput, PosTableSeatReservationInput, PosTableSplitInput, PricingModifier, Product, Product as Product$1, Recommendation, RecurringDateCronFormatter, RecurringDateCronResult, RecurringDateCronSummary, RecurringDateCronValues, RouteEligibility, RouteEligibility as RouteEligibility$1, RouteEligibilityDetail, RouteEligibilityFlags, RouteEligibilityReason, RouteFailureKind, RouteFailureKind as RouteFailureKind$1, RouteHealthEvent, RouteHealthEvent as RouteHealthEvent$1, RouteHealthListener, RouteHealthListener as RouteHealthListener$1, RulesEngineOrder, RulesEngineOrderLine, RulesEngineParams, RulesEngineRuntime, Schedule, SdkLogContext, SdkLogErrorInfo, SdkLogLevel, SdkLogOptions, Store, StoreGetInput, StoreListInput, StoreNearbyInput, StorefrontAvailability, StorefrontMenu, StorefrontMenuScope, StorefrontMenuStreamOptions, StorefrontPaymentsListInput, StorefrontPreferences, SwitchCustomerArg, SwitchCustomerArg as SwitchCustomerArg$1, SwitchCustomerIdToken, SwitchCustomerResult, SwitchCustomerResult as SwitchCustomerResult$1, TenderRefundInput, TenderReplaceInput, TenderVoidInput, Variant, VariantGroup, WordFilterCheckInput, WordFilterCheckResult } from "@fire-spark/types";
|
|
3
3
|
import { Big } from "big.js";
|
|
4
4
|
//#region src/productCustomization/catalog.utils.d.ts
|
|
5
5
|
/** Image for a product inside one modifier group, else the product image. */
|
|
@@ -1940,6 +1940,21 @@ declare const getLocalTlsPinning: () => PinnedFetchFactory | null;
|
|
|
1940
1940
|
/** True when the current host can enforce TLS-layer certificate pinning. */
|
|
1941
1941
|
declare const hasLocalTlsPinning: () => boolean;
|
|
1942
1942
|
//#endregion
|
|
1943
|
+
//#region src/devices/deviceSecrets.d.ts
|
|
1944
|
+
interface DeviceSecretsStore {
|
|
1945
|
+
configure: (options: DeviceSecretsConfigureOptions$1) => void;
|
|
1946
|
+
sync: (payload?: DeviceSecretsPayload$1 | null) => Promise<void>;
|
|
1947
|
+
getSecret: (name: string) => Promise<string | null>;
|
|
1948
|
+
listSecretKeys: () => Promise<string[]>;
|
|
1949
|
+
clear: () => Promise<void>;
|
|
1950
|
+
}
|
|
1951
|
+
declare const createDeviceSecretsStore: (initial?: DeviceSecretsConfigureOptions$1) => DeviceSecretsStore;
|
|
1952
|
+
declare const configureDeviceSecrets: (options: DeviceSecretsConfigureOptions$1) => void;
|
|
1953
|
+
declare const syncDeviceSecrets: (payload?: DeviceSecretsPayload$1 | null) => Promise<void>;
|
|
1954
|
+
declare const getSecret: (name: string) => Promise<string | null>;
|
|
1955
|
+
declare const listSecretKeys: () => Promise<string[]>;
|
|
1956
|
+
declare const clearDeviceSecrets: () => Promise<void>;
|
|
1957
|
+
//#endregion
|
|
1943
1958
|
//#region src/schedule/schedule.d.ts
|
|
1944
1959
|
type ScheduleWindow = {
|
|
1945
1960
|
active: true;
|
|
@@ -4151,4 +4166,4 @@ declare const hpkeSeal: (input: HpkeSealInput) => Promise<{
|
|
|
4151
4166
|
/** Opens a sealed message; throws when anything was altered. */
|
|
4152
4167
|
declare const hpkeOpen: (input: HpkeOpenInput) => Promise<Uint8Array<ArrayBuffer>>;
|
|
4153
4168
|
//#endregion
|
|
4154
|
-
export { type AdvanceAndEnterConfig, type AdvanceAndEnterResult, type ApplyRedeemInput, type AuthConfigureOptions, type BuildRouteHttpInput, type BuildScheduleSlotsConfig, CALLBACK_MISSING_LOCAL_URL, CANONICAL_MAX_DEPTH, CANONICAL_MAX_EXPONENT, CARD_BRANDS, CUSTOMER_INFO_PLACEHOLDERS, type CallbackMissingLocalUrlDetails, type CanonicalInput, type CanonicalizationError, type CanonicalizationErrorCode, type CardBrand, type CardBrandSpec, type CardCvcError, type CardExpiry, type CardExpiryError, type CardNumberError, type CardPreviewSlot, type CardholderNameError, type CmsBlockScope, type CmsVisibilityBlock, type CmsVisibilityContext, type CmsVisibilityRules, type CreateOrderOptions, type CreateSessionOptions, type CustomizationPath, type CustomizationSession, DEFAULT_LOCALE, DEFAULT_MAX_INCOMPLETE_MINUTES, DEFAULT_MAX_SNAPSHOT_AGE_MS, DEFAULT_RECOMMENDATION_TYPES, DEFAULT_ROUTE_COOLDOWN_MS, DEFAULT_WEBHOOK_TIMEOUT_S, DelegatedSessionExpiredError, type DeunaCallbackUrls, type DeunaOrderStatus, type DispatchWebhooksConfig, type EngineCallbackRun, type EngineCallbackRunError, type EngineExecutionContext, type EngineFlagReviewInput, type EngineFulfillmentPatch, type EngineOrder, type EngineOrderChangedEvent, type EngineOrderFulfillment, type EngineOrderStatus, type EngineOrderStatusPatch, type EngineScope, type EngineStepLog, type EngineStepLogEntry, type EngineStepsLogs, type EngineWebhookEnvelope, type EngineWebhookFailureEvent, type EngineWebhookNodeRun, type EngineWebhookTarget, type EnterAndPauseResult, type EnterRunResult, type ExchangeOptions, FULFILLMENT_WORKFLOW_TERMINAL_STATUSES, type FailedCharge, type FinalizePlaceOrderConfig, type FiresparkOrigin, type FlatMenuCategory, type FulfillmentEligibilityInput, type FulfillmentExecutionPort, type FulfillmentPorts, type FulfillmentRunStatus, type FulfillmentStepName, type FulfillmentStoragePort, type FulfillmentTerminalOrderStatus, type GenOrderIdOptions, type GetCmsBlockOptions, type GroupDisplayType, HPKE_ALG, type HpkeAead, type HpkeEnvelope, type HpkeOpenInput, type HpkePrivateJwk, type HpkePublicJwk, type HpkeSealInput, ID_HASH_FORMATS, type IdBuilder, type IdHashFormat, type InvokeCallbackAttemptConfig, type InvokeCallbackAttemptResult, type ListMenusStreamOptions, type ListPaymentsOptions, type LocalDeviceCredentials, type LocalRouteProbeResult, type LocalServerConfig, type LocalServerHealthResult, LosslessNumber, type LosslessNumberLike, MAX_MAX_INCOMPLETE_MINUTES, MAX_SUPPORTED_WORKFLOW_SCHEMA_VERSION, MIN_MAX_INCOMPLETE_MINUTES, MODE_HINT_HEADER, type MarkRouteDownInput, type Menu, type MenuCategoryNode, type MenuLookup, type MilestoneSteps, type MilestoneTrackItem, type ModifierControlType, type ModifierCtx, type ModifierGroupCtx, type NestedMenuCategory, OFFLINE_NO_LOCAL_URL, ORIGIN_HEADER, Order, OrderAuthPinnedError, type OrderCancelInput, type OrderCancelOptions, type OrderCancelResult, type OrderCancelType, type OrderCustomerSource, type OrderDeviceCredential, type OrderDraft, type OrderIssue, type OrderIssueCode, type OrderLineDiff, type OrderLineIssue, type OrderLineIssueCode, OrderNotOpenError, OrderPaymentRequiredError, type OrderRouteKind, type OrderRouteStatus, OrderRouteUnavailableError, type OrderRoutes, type OrderScope, OrderSyncPendingError, OrderSyncRejectedError, OrderValidationError, type OrderValidationResult, type OriginListener, type OriginState, type PauseForAdvanceConfig, type PayIntentOptions, type PayIntentResult, type PayOptions, type PaymentCardBrand, type PaymentEligibilityInput, type PaymentProgressEvent, type PaymentProgressListener, type PaymentRunOptions, type PaymentSessionOptions, type PendingWebhooks, PickupNameIssue, type PinnedFetchFactory, type PinnedFetchOptions, type PosOrderHttpOptions, type PricingModifier, type ProbeLocalRouteHealthOptions, type ProcessStateNodeCallbackJob, type ProcessStateNodeConfig, type ProcessStateNodeResult, type Product, type ProductCtx, type QuantitiesByPath, RESERVED_FULFILLMENT_STATUSES, type RecommendationType, RecurringDateCron, type RedeemPaymentRow, type RemoveRedeemInput, type ReorderOrderOptions, type ResetOptions, type ResolveRouteEligibilityInput, type ResolvedPaymentEligibility, type ResumeFromAdvanceConfig, type ReversalOutcome, type ReverseAllOptions, type RouteEligibility, type RouteEligibilityDetail, type RouteEligibilityFlags, type RouteEligibilityReason, type RouteFailureClassification, type RouteFailureKind, type RouteHealthEvent, type RouteHealthListener, type RouteHealthSnapshot, type RouteTenderCandidate, RulesEngine, type RunNodeCallbacksResult, SCHEDULED_AT_ERROR_CODES, SCHEDULED_ORDER_MAX_HORIZON_HOURS, SCHEDULED_ORDER_MAX_HORIZON_MINUTES, SCHEDULED_ORDER_MIN_LEAD_MINUTES, SCHEDULED_ORDER_SLOT_MINUTES, SCHEDULED_STATUS, SDK_PAYMENT_ELIGIBILITY_CEILINGS, STATE_ALGO, STATE_HASH_PREFIX, type ScheduleSlot, type ScheduleSlotCart, type ScheduleSlotCartLine, type ScheduleWindow, type ScheduledSuccessorConfig, type SdkPaymentEligibility, type SelectionStatus, type SelectionsByPath, type SerializedError, type ServiceHttpOptions, type SimpleTenderPayment, type Snapshot, type StateGoldenRootVector, type StateGoldenVector, type StateGoldenVectors, type StateManifest, type StateManifestSection, type StateRootInput, type StateScope, type StateVectorFailure, type StepOutcome, type StorefrontAccessToken, type StorefrontErrorDetails, StorefrontHttpError, type SwitchCustomerArg, type SwitchCustomerIdToken, type SwitchCustomerResult, TLS_FINGERPRINT_RESPONSE_HEADER, TLS_PIN_HEADER, type TestLocalServerHealthOptions, TlsFingerprintMismatchError, TokenExchangeError, type TrackWorkflow, type ValidateOptions, type ValidateOrderAgainstMenuInput, type Variant, type VariantGroup, type VariantGroupCtx, type VariantOptionCtx, type VariantSelection, type VerifyWebhookSignatureInput, type VisitedState, WORKFLOW_SCHEMA_VERSION, WORKFLOW_TIMEOUT, WorkflowSchemaVersionError, type WorkflowTimeoutDetails, addLines, advanceAndEnter, appendEngineStepLog, appendNodeLog, applyCmsVisibility, applyFees, applyManualAdvanceNote, assertSupportedWorkflowSchemaVersion, auth, autoEnterSuccessTerminal, base64UrlDecode, base64UrlEncode, beginEngineStepLog, buildCustomerSnapshot, buildEngineCallbackError, buildEngineCallbackRun, buildRouteHttpOptions, buildRulesEngineFromOrder, buildScheduleSlots, buildWorkflowTimeoutDetails, callbackIdsFromNode, canEnterJoin, canPauseNow, cancelTypeOf, canonicalNumber, canonicalString, canonicalize, canonicalizeJson, capRedeems, cappedRedeems, cardBrandSpec, cardDigits, cardNumberGaps, cardNumberMaxLength, cardPreviewGroups, caretAfterDigits, certFingerprintsMatch, certMatchesAnyPin, classifyRouteFailure, clearEdgeTaken, clearNodeVisit, cmsVisibilityNeedsTimezone, collectCheckoutIssues, collectOrderLineDiffs, completeEngineStepLog, computeOrderExpiresAt, computeStartingPrice, configureLocalTlsPinning, countCartProducts, coveredAmount, createCanonicalizationError, createDeunaWidgetApi, createNodePinnedFetch, createSession, currentNodes, cvcMaxLength, defaultConditionError, defaultIsPaymentCaptured, defaultOutgoingEdge, defaultWebhookEventsForStatus, defaultWebhookRetryDelayMs, detectCardBrand, dispatchOrderWebhooks, dispatchPendingWebhooks, engineHmacSha256Hex, engineOrderStatusForFailedRun, engineWebhookDeliveryId, engineWebhookRunsForEnteredNodes, engineWebhookStatusKey, engineWebhookTransitionStates, enterAndPause, enterWorkflowNode, executeAdvance, executeScheduledWake, executeStart, failActiveEngineStepLog, finalizePlaceOrder, findFirstState, findLocaleKey, findMappedStatusNode, findNodeById, findStartNode, fitRedeems, flattenMenuCategories, flushLogs, formatCardNumber, formatCvc, formatExpiry, formatLocalServerUrl, formatRecurringDateCronSummary, fromOrderLines, fulfillmentStatusesEqual, genId, genOrderId, getLocalTlsPinning, getLogContext, getOrigin, getRouteHealth, getScheduleWindow, hasInFlightPayment, hasLocalTlsPinning, hasSmartRouting, hpkeOpen, hpkeSeal, incomingEdges, indexMenu, indexOutgoingBySource, injectingMetadataFromCallback, invokeCallbackAttempt, isCanonicalizationError, isCardNumberComplete, isCardNumberDefinitelyInvalid, isCheckoutFieldFilled, isCustomerInfoFieldFilled, isCustomerInfoPlaceholder, isCustomerInfoValueValid, isCvcComplete, isDelegatedSessionExpiredError, isDeviceCharged, isDeviceNotLinked, isExpiredFulfillment, isExpiryComplete, isGenId, isInterruptTerminalStatus, isKioskUnauthorized, isLocalOrderUnknown, isMilestoneStepDone, isNodeRuntime, isOnSchedule, isOrderNotOpenError, isOrderPaymentRequiredError, isOrderRouteUnavailableError, isOrderValidationError, isPosDeviceNotLinked, isPosUnauthorized, isRealPaymentMethod, isReservedFulfillmentStatus, isRouteCircuitOpen, isScheduleSlot, isScheduledAtError, isStateHash, isStorefrontNotFound, isSupportedWorkflowSchemaVersion, isTerminalFulfillmentStatus, isTerminalMappedStatus, isTlsFingerprintMismatchError, isVariantBase, linePayableTotal, listMenusStream, localizePosError, log, logError, luhnCheck, markEdgeTaken, markNodeEntered, markNodeExited, markNodeSkipped, markNodesAdvance, markNodesReady, markRouteDown, markRouteHealthy, matchAbsoluteDateOperator, matchBooleanOperator, matchCurrencyOperator, matchEnumOperator, matchNumberOperator, matchRecurringDateOperator, matchRelativeDateOperator, matchStringOperator, matchingPrimaryOutgoing, milestoneSteps, milestoneTrack, nestMenuCategories, nextCurrentNodeIds, normalizeCardholderName, normalizeCertFingerprint, normalizeCustomerPhone, normalizeFulfillmentStatus, normalizeLocaleKey, normalizeMaxIncompleteMinutes, normalizePickupName, normalizeStateScope, onOriginChange, onRouteHealth, orderFactsFromOrder, orderFieldsFromNode, orderPayableTotal, orderRedeemedTotal, orderRedeems, orderStatusForFulfillmentStatus, outgoingEdges, parseExpiry, parseLosslessJson, pathKindForTargetNode, pauseForAdvance, paymentMatchesClientConditions, pendingWebhooksOf, pickAdvanceTarget, pickMultiLanguageText, placeCartLines, probeLocalRouteHealth, processStateNode, rebuildOrderLinesWithFees, rebuildRootGroups, recomputeTotals, redeemedTotal, redeemsForPayment, redemptionCap, redemptionSteps, remainingAmount, removeLine, replaceLine, resolveAdvanceEdge, resolveAdvanceEdges, resolveCallbackFailTerminal, resolveCheckout, resolveFailureTerminalEdge, resolveLocalPins, resolveLocalRouteUrl, resolveModifierImageUrl, resolveOrderRouteEligibility, resolvePaymentEligibility, resolveSchedulePrepMinutes, resolveSdkPaymentEligibilityCeiling, resolveSuccessTerminalEdges, resolveWebhookTargetUrl, resumeFromAdvance, reversePayment, reversedWhenCaptured, roundFeeAmount, runIsTerminal, runNodeCallbacks, runPaymentAttempt, runStateGoldenVectors, scheduledInstant, scheduledSuccessorStatus, selectMatchingFees, selectablePayments, serializeError, services, setLineQuantity, settleEnter, sha256Hex, sha256HexOfString, sittingWorkflowNode, stateRootHash, stateScopeKey, stateSectionHash, stateSectionHashOfJson, storefrontJson, stripFeeLines, stubUnsupportedFeeAmount, summarizeRecurringDateCron, testLocalServerHealth, toOrderLines, toPaymentCardBrand, unusedOutgoing, utf8Encode, validateCardNumber, validateCardholderName, validateCvc, validateExpiry, validateOrderAgainstMenu, validatePickupName, verifyLocalRoutePin, verifyWebhookSignature, visitedStates, warnNoEdge, workflowSchemaVersionOf };
|
|
4169
|
+
export { type AdvanceAndEnterConfig, type AdvanceAndEnterResult, type ApplyRedeemInput, type AuthConfigureOptions, type BuildRouteHttpInput, type BuildScheduleSlotsConfig, CALLBACK_MISSING_LOCAL_URL, CANONICAL_MAX_DEPTH, CANONICAL_MAX_EXPONENT, CARD_BRANDS, CUSTOMER_INFO_PLACEHOLDERS, type CallbackMissingLocalUrlDetails, type CanonicalInput, type CanonicalizationError, type CanonicalizationErrorCode, type CardBrand, type CardBrandSpec, type CardCvcError, type CardExpiry, type CardExpiryError, type CardNumberError, type CardPreviewSlot, type CardholderNameError, type CmsBlockScope, type CmsVisibilityBlock, type CmsVisibilityContext, type CmsVisibilityRules, type CreateOrderOptions, type CreateSessionOptions, type CustomizationPath, type CustomizationSession, DEFAULT_LOCALE, DEFAULT_MAX_INCOMPLETE_MINUTES, DEFAULT_MAX_SNAPSHOT_AGE_MS, DEFAULT_RECOMMENDATION_TYPES, DEFAULT_ROUTE_COOLDOWN_MS, DEFAULT_WEBHOOK_TIMEOUT_S, DelegatedSessionExpiredError, type DeunaCallbackUrls, type DeunaOrderStatus, type DeviceSecretStorage, type DeviceSecretsConfigureOptions, type DeviceSecretsPayload, type DeviceSecretsStore, type DispatchWebhooksConfig, type EngineCallbackRun, type EngineCallbackRunError, type EngineExecutionContext, type EngineFlagReviewInput, type EngineFulfillmentPatch, type EngineOrder, type EngineOrderChangedEvent, type EngineOrderFulfillment, type EngineOrderStatus, type EngineOrderStatusPatch, type EngineScope, type EngineStepLog, type EngineStepLogEntry, type EngineStepsLogs, type EngineWebhookEnvelope, type EngineWebhookFailureEvent, type EngineWebhookNodeRun, type EngineWebhookTarget, type EnterAndPauseResult, type EnterRunResult, type ExchangeOptions, FULFILLMENT_WORKFLOW_TERMINAL_STATUSES, type FailedCharge, type FinalizePlaceOrderConfig, type FiresparkOrigin, type FlatMenuCategory, type FulfillmentEligibilityInput, type FulfillmentExecutionPort, type FulfillmentPorts, type FulfillmentRunStatus, type FulfillmentStepName, type FulfillmentStoragePort, type FulfillmentTerminalOrderStatus, type GenOrderIdOptions, type GetCmsBlockOptions, type GroupDisplayType, HPKE_ALG, type HpkeAead, type HpkeEnvelope, type HpkeOpenInput, type HpkePrivateJwk, type HpkePublicJwk, type HpkeSealInput, ID_HASH_FORMATS, type IdBuilder, type IdHashFormat, type InvokeCallbackAttemptConfig, type InvokeCallbackAttemptResult, type ListMenusStreamOptions, type ListPaymentsOptions, type LocalDeviceCredentials, type LocalRouteProbeResult, type LocalServerConfig, type LocalServerHealthResult, LosslessNumber, type LosslessNumberLike, MAX_MAX_INCOMPLETE_MINUTES, MAX_SUPPORTED_WORKFLOW_SCHEMA_VERSION, MIN_MAX_INCOMPLETE_MINUTES, MODE_HINT_HEADER, type MarkRouteDownInput, type Menu, type MenuCategoryNode, type MenuLookup, type MilestoneSteps, type MilestoneTrackItem, type ModifierControlType, type ModifierCtx, type ModifierGroupCtx, type NestedMenuCategory, OFFLINE_NO_LOCAL_URL, ORIGIN_HEADER, Order, OrderAuthPinnedError, type OrderCancelInput, type OrderCancelOptions, type OrderCancelResult, type OrderCancelType, type OrderCustomerSource, type OrderDeviceCredential, type OrderDraft, type OrderIssue, type OrderIssueCode, type OrderLineDiff, type OrderLineIssue, type OrderLineIssueCode, OrderNotOpenError, OrderPaymentRequiredError, type OrderRouteKind, type OrderRouteStatus, OrderRouteUnavailableError, type OrderRoutes, type OrderScope, OrderSyncPendingError, OrderSyncRejectedError, OrderValidationError, type OrderValidationResult, type OriginListener, type OriginState, type PauseForAdvanceConfig, type PayIntentOptions, type PayIntentResult, type PayOptions, type PaymentCardBrand, type PaymentEligibilityInput, type PaymentProgressEvent, type PaymentProgressListener, type PaymentRunOptions, type PaymentSessionOptions, type PendingWebhooks, PickupNameIssue, type PinnedFetchFactory, type PinnedFetchOptions, type PosOrderHttpOptions, type PricingModifier, type ProbeLocalRouteHealthOptions, type ProcessStateNodeCallbackJob, type ProcessStateNodeConfig, type ProcessStateNodeResult, type Product, type ProductCtx, type QuantitiesByPath, RESERVED_FULFILLMENT_STATUSES, type RecommendationType, RecurringDateCron, type RedeemPaymentRow, type RemoveRedeemInput, type ReorderOrderOptions, type ResetOptions, type ResolveRouteEligibilityInput, type ResolvedPaymentEligibility, type ResumeFromAdvanceConfig, type ReversalOutcome, type ReverseAllOptions, type RouteEligibility, type RouteEligibilityDetail, type RouteEligibilityFlags, type RouteEligibilityReason, type RouteFailureClassification, type RouteFailureKind, type RouteHealthEvent, type RouteHealthListener, type RouteHealthSnapshot, type RouteTenderCandidate, RulesEngine, type RunNodeCallbacksResult, SCHEDULED_AT_ERROR_CODES, SCHEDULED_ORDER_MAX_HORIZON_HOURS, SCHEDULED_ORDER_MAX_HORIZON_MINUTES, SCHEDULED_ORDER_MIN_LEAD_MINUTES, SCHEDULED_ORDER_SLOT_MINUTES, SCHEDULED_STATUS, SDK_PAYMENT_ELIGIBILITY_CEILINGS, STATE_ALGO, STATE_HASH_PREFIX, type ScheduleSlot, type ScheduleSlotCart, type ScheduleSlotCartLine, type ScheduleWindow, type ScheduledSuccessorConfig, type SdkPaymentEligibility, type SelectionStatus, type SelectionsByPath, type SerializedError, type ServiceHttpOptions, type SimpleTenderPayment, type Snapshot, type StateGoldenRootVector, type StateGoldenVector, type StateGoldenVectors, type StateManifest, type StateManifestSection, type StateRootInput, type StateScope, type StateVectorFailure, type StepOutcome, type StorefrontAccessToken, type StorefrontErrorDetails, StorefrontHttpError, type SwitchCustomerArg, type SwitchCustomerIdToken, type SwitchCustomerResult, TLS_FINGERPRINT_RESPONSE_HEADER, TLS_PIN_HEADER, type TestLocalServerHealthOptions, TlsFingerprintMismatchError, TokenExchangeError, type TrackWorkflow, type ValidateOptions, type ValidateOrderAgainstMenuInput, type Variant, type VariantGroup, type VariantGroupCtx, type VariantOptionCtx, type VariantSelection, type VerifyWebhookSignatureInput, type VisitedState, WORKFLOW_SCHEMA_VERSION, WORKFLOW_TIMEOUT, WorkflowSchemaVersionError, type WorkflowTimeoutDetails, addLines, advanceAndEnter, appendEngineStepLog, appendNodeLog, applyCmsVisibility, applyFees, applyManualAdvanceNote, assertSupportedWorkflowSchemaVersion, auth, autoEnterSuccessTerminal, base64UrlDecode, base64UrlEncode, beginEngineStepLog, buildCustomerSnapshot, buildEngineCallbackError, buildEngineCallbackRun, buildRouteHttpOptions, buildRulesEngineFromOrder, buildScheduleSlots, buildWorkflowTimeoutDetails, callbackIdsFromNode, canEnterJoin, canPauseNow, cancelTypeOf, canonicalNumber, canonicalString, canonicalize, canonicalizeJson, capRedeems, cappedRedeems, cardBrandSpec, cardDigits, cardNumberGaps, cardNumberMaxLength, cardPreviewGroups, caretAfterDigits, certFingerprintsMatch, certMatchesAnyPin, classifyRouteFailure, clearDeviceSecrets, clearEdgeTaken, clearNodeVisit, cmsVisibilityNeedsTimezone, collectCheckoutIssues, collectOrderLineDiffs, completeEngineStepLog, computeOrderExpiresAt, computeStartingPrice, configureDeviceSecrets, configureLocalTlsPinning, countCartProducts, coveredAmount, createCanonicalizationError, createDeunaWidgetApi, createDeviceSecretsStore, createNodePinnedFetch, createSession, currentNodes, cvcMaxLength, defaultConditionError, defaultIsPaymentCaptured, defaultOutgoingEdge, defaultWebhookEventsForStatus, defaultWebhookRetryDelayMs, detectCardBrand, dispatchOrderWebhooks, dispatchPendingWebhooks, engineHmacSha256Hex, engineOrderStatusForFailedRun, engineWebhookDeliveryId, engineWebhookRunsForEnteredNodes, engineWebhookStatusKey, engineWebhookTransitionStates, enterAndPause, enterWorkflowNode, executeAdvance, executeScheduledWake, executeStart, failActiveEngineStepLog, finalizePlaceOrder, findFirstState, findLocaleKey, findMappedStatusNode, findNodeById, findStartNode, fitRedeems, flattenMenuCategories, flushLogs, formatCardNumber, formatCvc, formatExpiry, formatLocalServerUrl, formatRecurringDateCronSummary, fromOrderLines, fulfillmentStatusesEqual, genId, genOrderId, getLocalTlsPinning, getLogContext, getOrigin, getRouteHealth, getScheduleWindow, getSecret, hasInFlightPayment, hasLocalTlsPinning, hasSmartRouting, hpkeOpen, hpkeSeal, incomingEdges, indexMenu, indexOutgoingBySource, injectingMetadataFromCallback, invokeCallbackAttempt, isCanonicalizationError, isCardNumberComplete, isCardNumberDefinitelyInvalid, isCheckoutFieldFilled, isCustomerInfoFieldFilled, isCustomerInfoPlaceholder, isCustomerInfoValueValid, isCvcComplete, isDelegatedSessionExpiredError, isDeviceCharged, isDeviceNotLinked, isExpiredFulfillment, isExpiryComplete, isGenId, isInterruptTerminalStatus, isKioskUnauthorized, isLocalOrderUnknown, isMilestoneStepDone, isNodeRuntime, isOnSchedule, isOrderNotOpenError, isOrderPaymentRequiredError, isOrderRouteUnavailableError, isOrderValidationError, isPosDeviceNotLinked, isPosUnauthorized, isRealPaymentMethod, isReservedFulfillmentStatus, isRouteCircuitOpen, isScheduleSlot, isScheduledAtError, isStateHash, isStorefrontNotFound, isSupportedWorkflowSchemaVersion, isTerminalFulfillmentStatus, isTerminalMappedStatus, isTlsFingerprintMismatchError, isVariantBase, linePayableTotal, listMenusStream, listSecretKeys, localizePosError, log, logError, luhnCheck, markEdgeTaken, markNodeEntered, markNodeExited, markNodeSkipped, markNodesAdvance, markNodesReady, markRouteDown, markRouteHealthy, matchAbsoluteDateOperator, matchBooleanOperator, matchCurrencyOperator, matchEnumOperator, matchNumberOperator, matchRecurringDateOperator, matchRelativeDateOperator, matchStringOperator, matchingPrimaryOutgoing, milestoneSteps, milestoneTrack, nestMenuCategories, nextCurrentNodeIds, normalizeCardholderName, normalizeCertFingerprint, normalizeCustomerPhone, normalizeFulfillmentStatus, normalizeLocaleKey, normalizeMaxIncompleteMinutes, normalizePickupName, normalizeStateScope, onOriginChange, onRouteHealth, orderFactsFromOrder, orderFieldsFromNode, orderPayableTotal, orderRedeemedTotal, orderRedeems, orderStatusForFulfillmentStatus, outgoingEdges, parseExpiry, parseLosslessJson, pathKindForTargetNode, pauseForAdvance, paymentMatchesClientConditions, pendingWebhooksOf, pickAdvanceTarget, pickMultiLanguageText, placeCartLines, probeLocalRouteHealth, processStateNode, rebuildOrderLinesWithFees, rebuildRootGroups, recomputeTotals, redeemedTotal, redeemsForPayment, redemptionCap, redemptionSteps, remainingAmount, removeLine, replaceLine, resolveAdvanceEdge, resolveAdvanceEdges, resolveCallbackFailTerminal, resolveCheckout, resolveFailureTerminalEdge, resolveLocalPins, resolveLocalRouteUrl, resolveModifierImageUrl, resolveOrderRouteEligibility, resolvePaymentEligibility, resolveSchedulePrepMinutes, resolveSdkPaymentEligibilityCeiling, resolveSuccessTerminalEdges, resolveWebhookTargetUrl, resumeFromAdvance, reversePayment, reversedWhenCaptured, roundFeeAmount, runIsTerminal, runNodeCallbacks, runPaymentAttempt, runStateGoldenVectors, scheduledInstant, scheduledSuccessorStatus, selectMatchingFees, selectablePayments, serializeError, services, setLineQuantity, settleEnter, sha256Hex, sha256HexOfString, sittingWorkflowNode, stateRootHash, stateScopeKey, stateSectionHash, stateSectionHashOfJson, storefrontJson, stripFeeLines, stubUnsupportedFeeAmount, summarizeRecurringDateCron, syncDeviceSecrets, testLocalServerHealth, toOrderLines, toPaymentCardBrand, unusedOutgoing, utf8Encode, validateCardNumber, validateCardholderName, validateCvc, validateExpiry, validateOrderAgainstMenu, validatePickupName, verifyLocalRoutePin, verifyWebhookSignature, visitedStates, warnNoEdge, workflowSchemaVersionOf };
|
package/dist/index.js
CHANGED
|
@@ -2883,6 +2883,257 @@ const getFulfillment = (id, input = {}, options) => {
|
|
|
2883
2883
|
return storefrontJson(withChannelQuery(fulfillmentPath(id), input), {}, options);
|
|
2884
2884
|
};
|
|
2885
2885
|
//#endregion
|
|
2886
|
+
//#region src/devices/deviceSecrets.ts
|
|
2887
|
+
const DEFAULT_KEY_PREFIX = "fs_device_secret_";
|
|
2888
|
+
const SENSITIVE_KEYS_SUFFIX = "__sensitive_keys";
|
|
2889
|
+
const PUBLIC_MAP_SUFFIX = "__public_map";
|
|
2890
|
+
/** Keep every SecureStore entry safely below Android's 2048-byte limit. */
|
|
2891
|
+
const MANIFEST_CHUNK_MAX_BYTES = 1600;
|
|
2892
|
+
const hasOwn = Object.prototype.hasOwnProperty;
|
|
2893
|
+
/** Hermes-safe UTF-8 byte length without Node Buffer or Intl. */
|
|
2894
|
+
const utf8ByteLength = (value) => {
|
|
2895
|
+
let bytes = 0;
|
|
2896
|
+
for (let i = 0; i < value.length; i++) {
|
|
2897
|
+
const code = value.charCodeAt(i);
|
|
2898
|
+
if (code < 128) bytes += 1;
|
|
2899
|
+
else if (code < 2048) bytes += 2;
|
|
2900
|
+
else if (code >= 55296 && code <= 56319 && i + 1 < value.length) {
|
|
2901
|
+
bytes += 4;
|
|
2902
|
+
i += 1;
|
|
2903
|
+
} else bytes += 3;
|
|
2904
|
+
}
|
|
2905
|
+
return bytes;
|
|
2906
|
+
};
|
|
2907
|
+
const parseJsonRecord = (raw) => {
|
|
2908
|
+
if (!raw) return {};
|
|
2909
|
+
try {
|
|
2910
|
+
const parsed = JSON.parse(raw);
|
|
2911
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
2912
|
+
const out = {};
|
|
2913
|
+
for (const [k, v] of Object.entries(parsed)) if (typeof v === "string") out[k] = v;
|
|
2914
|
+
return out;
|
|
2915
|
+
} catch {
|
|
2916
|
+
return {};
|
|
2917
|
+
}
|
|
2918
|
+
};
|
|
2919
|
+
const parseKeyList = (raw) => {
|
|
2920
|
+
if (!raw) return [];
|
|
2921
|
+
try {
|
|
2922
|
+
const parsed = JSON.parse(raw);
|
|
2923
|
+
if (!Array.isArray(parsed)) return [];
|
|
2924
|
+
return parsed.filter((item) => typeof item === "string");
|
|
2925
|
+
} catch {
|
|
2926
|
+
return [];
|
|
2927
|
+
}
|
|
2928
|
+
};
|
|
2929
|
+
const parseManifestHeader = (raw) => {
|
|
2930
|
+
if (!raw) return null;
|
|
2931
|
+
try {
|
|
2932
|
+
const parsed = JSON.parse(raw);
|
|
2933
|
+
if (Array.isArray(parsed)) return {
|
|
2934
|
+
version: 1,
|
|
2935
|
+
keys: parsed.filter((item) => {
|
|
2936
|
+
return typeof item === "string";
|
|
2937
|
+
})
|
|
2938
|
+
};
|
|
2939
|
+
if (parsed && typeof parsed === "object") {
|
|
2940
|
+
const rec = parsed;
|
|
2941
|
+
if (rec.v === 2 && typeof rec.n === "number" && rec.n >= 0) return {
|
|
2942
|
+
version: 2,
|
|
2943
|
+
chunks: Math.floor(rec.n)
|
|
2944
|
+
};
|
|
2945
|
+
}
|
|
2946
|
+
return null;
|
|
2947
|
+
} catch {
|
|
2948
|
+
return null;
|
|
2949
|
+
}
|
|
2950
|
+
};
|
|
2951
|
+
/** Packs sorted key names into JSON-array chunks each <= MANIFEST_CHUNK_MAX_BYTES. */
|
|
2952
|
+
const chunkKeyList = (keys) => {
|
|
2953
|
+
if (keys.length === 0) return [];
|
|
2954
|
+
const chunks = [];
|
|
2955
|
+
let current = [];
|
|
2956
|
+
let currentBytes = 2;
|
|
2957
|
+
for (const key of keys) {
|
|
2958
|
+
const entryBytes = utf8ByteLength(JSON.stringify(key));
|
|
2959
|
+
const sepBytes = current.length > 0 ? 1 : 0;
|
|
2960
|
+
if (current.length > 0 && currentBytes + sepBytes + entryBytes > MANIFEST_CHUNK_MAX_BYTES) {
|
|
2961
|
+
chunks.push(current);
|
|
2962
|
+
current = [key];
|
|
2963
|
+
currentBytes = 2 + entryBytes;
|
|
2964
|
+
} else {
|
|
2965
|
+
current.push(key);
|
|
2966
|
+
currentBytes += sepBytes + entryBytes;
|
|
2967
|
+
}
|
|
2968
|
+
}
|
|
2969
|
+
if (current.length > 0) chunks.push(current);
|
|
2970
|
+
return chunks;
|
|
2971
|
+
};
|
|
2972
|
+
const createDeviceSecretsStore = (initial) => {
|
|
2973
|
+
let secureStorage = initial?.secureStorage ?? null;
|
|
2974
|
+
let publicStorage = initial?.publicStorage ?? null;
|
|
2975
|
+
let keyPrefix = initial?.keyPrefix ?? DEFAULT_KEY_PREFIX;
|
|
2976
|
+
let publicValues = {};
|
|
2977
|
+
let publicLoaded = false;
|
|
2978
|
+
let sensitiveLoaded = false;
|
|
2979
|
+
let manifestChunkCount = 0;
|
|
2980
|
+
const sensitiveKeys = /* @__PURE__ */ new Set();
|
|
2981
|
+
const sensitiveMemory = /* @__PURE__ */ new Map();
|
|
2982
|
+
const itemKey = (name) => `${keyPrefix}${name}`;
|
|
2983
|
+
const manifestKey = () => `${keyPrefix}${SENSITIVE_KEYS_SUFFIX}`;
|
|
2984
|
+
const manifestChunkKey = (index) => {
|
|
2985
|
+
return `${keyPrefix}${SENSITIVE_KEYS_SUFFIX}_${index}`;
|
|
2986
|
+
};
|
|
2987
|
+
const publicMapKey = () => `${keyPrefix}${PUBLIC_MAP_SUFFIX}`;
|
|
2988
|
+
const loadPublicIfNeeded = async () => {
|
|
2989
|
+
if (publicLoaded || !publicStorage) return;
|
|
2990
|
+
publicLoaded = true;
|
|
2991
|
+
try {
|
|
2992
|
+
const raw = await publicStorage.getItemAsync(publicMapKey());
|
|
2993
|
+
publicValues = parseJsonRecord(raw);
|
|
2994
|
+
} catch {
|
|
2995
|
+
publicValues = {};
|
|
2996
|
+
}
|
|
2997
|
+
};
|
|
2998
|
+
const loadSensitiveKeysIfNeeded = async () => {
|
|
2999
|
+
if (sensitiveLoaded || !secureStorage) return;
|
|
3000
|
+
sensitiveLoaded = true;
|
|
3001
|
+
try {
|
|
3002
|
+
const raw = await secureStorage.getItemAsync(manifestKey());
|
|
3003
|
+
const header = parseManifestHeader(raw);
|
|
3004
|
+
if (!header) return;
|
|
3005
|
+
if (header.version === 1) {
|
|
3006
|
+
for (const key of header.keys) sensitiveKeys.add(key);
|
|
3007
|
+
manifestChunkCount = 0;
|
|
3008
|
+
return;
|
|
3009
|
+
}
|
|
3010
|
+
manifestChunkCount = header.chunks;
|
|
3011
|
+
for (let i = 0; i < header.chunks; i++) {
|
|
3012
|
+
const chunkRaw = await secureStorage.getItemAsync(manifestChunkKey(i));
|
|
3013
|
+
for (const key of parseKeyList(chunkRaw)) sensitiveKeys.add(key);
|
|
3014
|
+
}
|
|
3015
|
+
} catch {}
|
|
3016
|
+
};
|
|
3017
|
+
const writeSensitiveManifest = async (keys) => {
|
|
3018
|
+
if (!secureStorage) return;
|
|
3019
|
+
const chunks = chunkKeyList(keys);
|
|
3020
|
+
for (let i = 0; i < chunks.length; i++) await secureStorage.setItemAsync(manifestChunkKey(i), JSON.stringify(chunks[i]));
|
|
3021
|
+
await secureStorage.setItemAsync(manifestKey(), JSON.stringify({
|
|
3022
|
+
v: 2,
|
|
3023
|
+
n: chunks.length
|
|
3024
|
+
}));
|
|
3025
|
+
for (let i = chunks.length; i < manifestChunkCount; i++) await secureStorage.deleteItemAsync(manifestChunkKey(i));
|
|
3026
|
+
manifestChunkCount = chunks.length;
|
|
3027
|
+
};
|
|
3028
|
+
const configure = (options) => {
|
|
3029
|
+
if (options.secureStorage !== void 0) {
|
|
3030
|
+
secureStorage = options.secureStorage;
|
|
3031
|
+
sensitiveLoaded = false;
|
|
3032
|
+
manifestChunkCount = 0;
|
|
3033
|
+
}
|
|
3034
|
+
if (options.publicStorage !== void 0) {
|
|
3035
|
+
publicStorage = options.publicStorage;
|
|
3036
|
+
publicLoaded = false;
|
|
3037
|
+
}
|
|
3038
|
+
if (options.keyPrefix !== void 0) {
|
|
3039
|
+
keyPrefix = options.keyPrefix || DEFAULT_KEY_PREFIX;
|
|
3040
|
+
publicLoaded = false;
|
|
3041
|
+
sensitiveLoaded = false;
|
|
3042
|
+
manifestChunkCount = 0;
|
|
3043
|
+
}
|
|
3044
|
+
};
|
|
3045
|
+
const sync = async (payload) => {
|
|
3046
|
+
if (!payload) return;
|
|
3047
|
+
await loadSensitiveKeysIfNeeded();
|
|
3048
|
+
const nextPublic = payload.public ?? {};
|
|
3049
|
+
const nextSensitive = payload.sensitive ?? {};
|
|
3050
|
+
publicValues = { ...nextPublic };
|
|
3051
|
+
publicLoaded = true;
|
|
3052
|
+
if (publicStorage) await publicStorage.setItemAsync(publicMapKey(), JSON.stringify(publicValues));
|
|
3053
|
+
const nextSensitiveKeys = new Set(Object.keys(nextSensitive));
|
|
3054
|
+
const removedKeys = [];
|
|
3055
|
+
for (const prevKey of sensitiveKeys) if (!nextSensitiveKeys.has(prevKey)) removedKeys.push(prevKey);
|
|
3056
|
+
if (secureStorage) {
|
|
3057
|
+
for (const key of removedKeys) {
|
|
3058
|
+
await secureStorage.deleteItemAsync(itemKey(key));
|
|
3059
|
+
sensitiveKeys.delete(key);
|
|
3060
|
+
}
|
|
3061
|
+
for (const [key, value] of Object.entries(nextSensitive)) {
|
|
3062
|
+
await secureStorage.setItemAsync(itemKey(key), value);
|
|
3063
|
+
sensitiveKeys.add(key);
|
|
3064
|
+
}
|
|
3065
|
+
const keyList = Array.from(sensitiveKeys).sort();
|
|
3066
|
+
await writeSensitiveManifest(keyList);
|
|
3067
|
+
sensitiveMemory.clear();
|
|
3068
|
+
return;
|
|
3069
|
+
}
|
|
3070
|
+
for (const key of removedKeys) {
|
|
3071
|
+
sensitiveMemory.delete(key);
|
|
3072
|
+
sensitiveKeys.delete(key);
|
|
3073
|
+
}
|
|
3074
|
+
for (const [key, value] of Object.entries(nextSensitive)) {
|
|
3075
|
+
sensitiveMemory.set(key, value);
|
|
3076
|
+
sensitiveKeys.add(key);
|
|
3077
|
+
}
|
|
3078
|
+
};
|
|
3079
|
+
const getSecret = async (name) => {
|
|
3080
|
+
if (!name) return null;
|
|
3081
|
+
await loadPublicIfNeeded();
|
|
3082
|
+
if (hasOwn.call(publicValues, name)) return publicValues[name] ?? null;
|
|
3083
|
+
if (secureStorage) try {
|
|
3084
|
+
return await secureStorage.getItemAsync(itemKey(name)) ?? null;
|
|
3085
|
+
} catch {
|
|
3086
|
+
return null;
|
|
3087
|
+
}
|
|
3088
|
+
return sensitiveMemory.get(name) ?? null;
|
|
3089
|
+
};
|
|
3090
|
+
const listSecretKeys = async () => {
|
|
3091
|
+
await loadPublicIfNeeded();
|
|
3092
|
+
await loadSensitiveKeysIfNeeded();
|
|
3093
|
+
const keys = new Set(Object.keys(publicValues));
|
|
3094
|
+
for (const key of sensitiveKeys) keys.add(key);
|
|
3095
|
+
return Array.from(keys).sort();
|
|
3096
|
+
};
|
|
3097
|
+
const clear = async () => {
|
|
3098
|
+
await loadSensitiveKeysIfNeeded();
|
|
3099
|
+
publicValues = {};
|
|
3100
|
+
publicLoaded = true;
|
|
3101
|
+
if (publicStorage) await publicStorage.deleteItemAsync(publicMapKey());
|
|
3102
|
+
if (secureStorage) {
|
|
3103
|
+
for (const key of sensitiveKeys) await secureStorage.deleteItemAsync(itemKey(key));
|
|
3104
|
+
for (let i = 0; i < manifestChunkCount; i++) await secureStorage.deleteItemAsync(manifestChunkKey(i));
|
|
3105
|
+
await secureStorage.deleteItemAsync(manifestKey());
|
|
3106
|
+
}
|
|
3107
|
+
manifestChunkCount = 0;
|
|
3108
|
+
sensitiveKeys.clear();
|
|
3109
|
+
sensitiveMemory.clear();
|
|
3110
|
+
sensitiveLoaded = true;
|
|
3111
|
+
};
|
|
3112
|
+
return {
|
|
3113
|
+
configure,
|
|
3114
|
+
sync,
|
|
3115
|
+
getSecret,
|
|
3116
|
+
listSecretKeys,
|
|
3117
|
+
clear
|
|
3118
|
+
};
|
|
3119
|
+
};
|
|
3120
|
+
const defaultStore = createDeviceSecretsStore();
|
|
3121
|
+
const configureDeviceSecrets = (options) => {
|
|
3122
|
+
defaultStore.configure(options);
|
|
3123
|
+
};
|
|
3124
|
+
const syncDeviceSecrets = (payload) => {
|
|
3125
|
+
return defaultStore.sync(payload);
|
|
3126
|
+
};
|
|
3127
|
+
const getSecret = (name) => {
|
|
3128
|
+
return defaultStore.getSecret(name);
|
|
3129
|
+
};
|
|
3130
|
+
const listSecretKeys = () => {
|
|
3131
|
+
return defaultStore.listSecretKeys();
|
|
3132
|
+
};
|
|
3133
|
+
const clearDeviceSecrets = () => {
|
|
3134
|
+
return defaultStore.clear();
|
|
3135
|
+
};
|
|
3136
|
+
//#endregion
|
|
2886
3137
|
//#region src/services/kiosk.ts
|
|
2887
3138
|
const kioskBases = (options) => {
|
|
2888
3139
|
const fallback = options?.fallbackBaseUrl;
|
|
@@ -2928,6 +3179,9 @@ const isKioskUnauthorized = (error) => {
|
|
|
2928
3179
|
const throwKioskError = (body, status) => {
|
|
2929
3180
|
throw new StorefrontHttpError(body.error ?? "Request failed", status, body.code);
|
|
2930
3181
|
};
|
|
3182
|
+
const shouldClearSecrets = (status, code) => {
|
|
3183
|
+
return status === 401 || status === 403 || code === "DEVICE_NOT_LINKED";
|
|
3184
|
+
};
|
|
2931
3185
|
const getKioskConfig = async (input, options) => {
|
|
2932
3186
|
const path = "/api/storefront/v1/kiosk/devices/link";
|
|
2933
3187
|
const init = {
|
|
@@ -2937,10 +3191,12 @@ const getKioskConfig = async (input, options) => {
|
|
|
2937
3191
|
const response = await kioskFetch(path, init, options);
|
|
2938
3192
|
if (!response.ok) {
|
|
2939
3193
|
const body = await readError$1(response);
|
|
3194
|
+
if (shouldClearSecrets(response.status, body.code)) await clearDeviceSecrets();
|
|
2940
3195
|
throwKioskError(body, response.status);
|
|
2941
3196
|
}
|
|
2942
3197
|
const json = await response.json();
|
|
2943
3198
|
captureLogDeviceConfig(json.data);
|
|
3199
|
+
await syncDeviceSecrets(json.data.secrets);
|
|
2944
3200
|
return json.data;
|
|
2945
3201
|
};
|
|
2946
3202
|
const postKioskHeartbeat = async (input, options) => {
|
|
@@ -2952,10 +3208,13 @@ const postKioskHeartbeat = async (input, options) => {
|
|
|
2952
3208
|
const response = await kioskFetch(path, init, options);
|
|
2953
3209
|
if (!response.ok) {
|
|
2954
3210
|
const body = await readError$1(response);
|
|
3211
|
+
if (shouldClearSecrets(response.status, body.code)) await clearDeviceSecrets();
|
|
2955
3212
|
throwKioskError(body, response.status);
|
|
2956
3213
|
}
|
|
2957
3214
|
captureLogDevice(input.device_uid);
|
|
2958
|
-
|
|
3215
|
+
const data = await response.json();
|
|
3216
|
+
await syncDeviceSecrets(data.secrets);
|
|
3217
|
+
return data;
|
|
2959
3218
|
};
|
|
2960
3219
|
const postKioskHealthSamples = async (input, options) => {
|
|
2961
3220
|
const path = "/api/storefront/v1/kiosk/devices/me/health";
|
|
@@ -2996,6 +3255,7 @@ const unlinkKioskSelf = async (input, options) => {
|
|
|
2996
3255
|
throwKioskError(body, response.status);
|
|
2997
3256
|
}
|
|
2998
3257
|
clearLogDevice();
|
|
3258
|
+
await clearDeviceSecrets();
|
|
2999
3259
|
return (await response.json()).data;
|
|
3000
3260
|
};
|
|
3001
3261
|
/** 403 wrong or expired code, 429 too many tries for the current code. */
|
|
@@ -3442,6 +3702,8 @@ const enUS = {
|
|
|
3442
3702
|
DEVICE_NOT_LINKED: "This register is not linked.",
|
|
3443
3703
|
DEVICE_NOT_ACTIVE: "This register is not active.",
|
|
3444
3704
|
PAIRING_CODE_INVALID: "That pairing code is not valid.",
|
|
3705
|
+
PAIRING_CODE_EXPIRED: "That pairing code has expired.",
|
|
3706
|
+
PAIRING_RATE_LIMITED: "Too many attempts. Try again in a moment.",
|
|
3445
3707
|
RELINK_CODE_INVALID: "That re-link code is not valid.",
|
|
3446
3708
|
RELINK_CODE_EXPIRED: "That re-link code has expired.",
|
|
3447
3709
|
PIN_INVALID: "The PIN is incorrect.",
|
|
@@ -3475,6 +3737,8 @@ const posErrorMessages = {
|
|
|
3475
3737
|
DEVICE_NOT_LINKED: "Esta caja no está vinculada.",
|
|
3476
3738
|
DEVICE_NOT_ACTIVE: "Esta caja no está activa.",
|
|
3477
3739
|
PAIRING_CODE_INVALID: "Ese código de vinculación no es válido.",
|
|
3740
|
+
PAIRING_CODE_EXPIRED: "Ese código de vinculación expiró.",
|
|
3741
|
+
PAIRING_RATE_LIMITED: "Demasiados intentos. Inténtalo en un momento.",
|
|
3478
3742
|
RELINK_CODE_INVALID: "Ese código de revinculación no es válido.",
|
|
3479
3743
|
RELINK_CODE_EXPIRED: "Ese código de revinculación expiró.",
|
|
3480
3744
|
PIN_INVALID: "El PIN es incorrecto.",
|
|
@@ -3505,6 +3769,8 @@ const posErrorMessages = {
|
|
|
3505
3769
|
DEVICE_NOT_LINKED: "Este caixa não está vinculado.",
|
|
3506
3770
|
DEVICE_NOT_ACTIVE: "Este caixa não está ativo.",
|
|
3507
3771
|
PAIRING_CODE_INVALID: "Esse código de vinculação não é válido.",
|
|
3772
|
+
PAIRING_CODE_EXPIRED: "Esse código de vinculação expirou.",
|
|
3773
|
+
PAIRING_RATE_LIMITED: "Muitas tentativas. Tente novamente em instantes.",
|
|
3508
3774
|
RELINK_CODE_INVALID: "Esse código de revinculação não é válido.",
|
|
3509
3775
|
RELINK_CODE_EXPIRED: "Esse código de revinculação expirou.",
|
|
3510
3776
|
PIN_INVALID: "O PIN está incorreto.",
|
|
@@ -5168,15 +5434,27 @@ const localizePosError = (error, locale = "en-US") => {
|
|
|
5168
5434
|
const pairPosDevice = async (input, options) => {
|
|
5169
5435
|
const json = await postJson("/api/storefront/v1/pos/devices/pair", input, options);
|
|
5170
5436
|
captureLinkedDevice(json.data, input.device_secret, options);
|
|
5437
|
+
const secrets = json.data?.secrets;
|
|
5438
|
+
await syncDeviceSecrets(secrets);
|
|
5171
5439
|
return json.data;
|
|
5172
5440
|
};
|
|
5173
5441
|
const relinkPosDevice = async (input, options) => {
|
|
5174
5442
|
const json = await postJson("/api/storefront/v1/pos/devices/relink", input, options);
|
|
5175
5443
|
captureLinkedDevice(json.data, input.device_secret, options);
|
|
5444
|
+
const secrets = json.data?.secrets;
|
|
5445
|
+
await syncDeviceSecrets(secrets);
|
|
5176
5446
|
return json.data;
|
|
5177
5447
|
};
|
|
5178
5448
|
const postPosHeartbeat = async (input, options) => {
|
|
5179
|
-
|
|
5449
|
+
const path = "/api/storefront/v1/pos/devices/me";
|
|
5450
|
+
try {
|
|
5451
|
+
const data = await postJson(path, input, options);
|
|
5452
|
+
await syncDeviceSecrets(data.secrets);
|
|
5453
|
+
return data;
|
|
5454
|
+
} catch (error) {
|
|
5455
|
+
if (error instanceof StorefrontHttpError && (error.status === 401 || error.status === 403 || error.code === "DEVICE_NOT_LINKED")) await clearDeviceSecrets();
|
|
5456
|
+
throw error;
|
|
5457
|
+
}
|
|
5180
5458
|
};
|
|
5181
5459
|
const postPosHealthSamples = async (input, options) => {
|
|
5182
5460
|
return postJson("/api/storefront/v1/pos/devices/me/health", input, options);
|
|
@@ -17524,4 +17802,4 @@ const hpkeOpen = async (input) => {
|
|
|
17524
17802
|
return new Uint8Array(opened);
|
|
17525
17803
|
};
|
|
17526
17804
|
//#endregion
|
|
17527
|
-
export { CALLBACK_MISSING_LOCAL_URL, CANONICAL_MAX_DEPTH, CANONICAL_MAX_EXPONENT, CARD_BRANDS, CUSTOMER_INFO_PLACEHOLDERS, DEFAULT_LOCALE, DEFAULT_MAX_INCOMPLETE_MINUTES, DEFAULT_MAX_SNAPSHOT_AGE_MS, DEFAULT_RECOMMENDATION_TYPES, DEFAULT_ROUTE_COOLDOWN_MS, DEFAULT_WEBHOOK_TIMEOUT_S, DelegatedSessionExpiredError, FULFILLMENT_WORKFLOW_TERMINAL_STATUSES, HPKE_ALG, ID_HASH_FORMATS, LosslessNumber, MAX_MAX_INCOMPLETE_MINUTES, MAX_SUPPORTED_WORKFLOW_SCHEMA_VERSION, MIN_MAX_INCOMPLETE_MINUTES, MODE_HINT_HEADER, OFFLINE_NO_LOCAL_URL, ORIGIN_HEADER, Order, OrderAuthPinnedError, OrderNotOpenError, OrderPaymentRequiredError, OrderRouteUnavailableError, OrderSyncPendingError, OrderSyncRejectedError, OrderValidationError, RESERVED_FULFILLMENT_STATUSES, RecurringDateCron, RulesEngine, SCHEDULED_AT_ERROR_CODES, SCHEDULED_ORDER_MAX_HORIZON_HOURS, SCHEDULED_ORDER_MAX_HORIZON_MINUTES, SCHEDULED_ORDER_MIN_LEAD_MINUTES, SCHEDULED_ORDER_SLOT_MINUTES, SCHEDULED_STATUS, SDK_PAYMENT_ELIGIBILITY_CEILINGS, STATE_ALGO, STATE_HASH_PREFIX, StorefrontHttpError, TLS_FINGERPRINT_RESPONSE_HEADER, TLS_PIN_HEADER, TlsFingerprintMismatchError, TokenExchangeError, WORKFLOW_SCHEMA_VERSION, WORKFLOW_TIMEOUT, WorkflowSchemaVersionError, addLines, advanceAndEnter, appendEngineStepLog, appendNodeLog, applyCmsVisibility, applyFees, applyManualAdvanceNote, assertSupportedWorkflowSchemaVersion, auth, autoEnterSuccessTerminal, base64UrlDecode, base64UrlEncode, beginEngineStepLog, buildCustomerSnapshot, buildEngineCallbackError, buildEngineCallbackRun, buildRouteHttpOptions, buildRulesEngineFromOrder, buildScheduleSlots, buildWorkflowTimeoutDetails, callbackIdsFromNode, canEnterJoin, canPauseNow, cancelTypeOf, canonicalNumber, canonicalString, canonicalize, canonicalizeJson, capRedeems, cappedRedeems, cardBrandSpec, cardDigits, cardNumberGaps, cardNumberMaxLength, cardPreviewGroups, caretAfterDigits, certFingerprintsMatch, certMatchesAnyPin, classifyRouteFailure, clearEdgeTaken, clearNodeVisit, cmsVisibilityNeedsTimezone, collectCheckoutIssues, collectOrderLineDiffs, completeEngineStepLog, computeOrderExpiresAt, computeStartingPrice, configureLocalTlsPinning, countCartProducts, coveredAmount, createCanonicalizationError, createDeunaWidgetApi, createNodePinnedFetch, createSession, currentNodes, cvcMaxLength, defaultConditionError, defaultIsPaymentCaptured, defaultOutgoingEdge, defaultWebhookEventsForStatus, defaultWebhookRetryDelayMs, detectCardBrand, dispatchOrderWebhooks, dispatchPendingWebhooks, engineHmacSha256Hex, engineOrderStatusForFailedRun, engineWebhookDeliveryId, engineWebhookRunsForEnteredNodes, engineWebhookStatusKey, engineWebhookTransitionStates, enterAndPause, enterWorkflowNode, executeAdvance, executeScheduledWake, executeStart, failActiveEngineStepLog, finalizePlaceOrder, findFirstState, findLocaleKey, findMappedStatusNode, findNodeById, findStartNode, fitRedeems, flattenMenuCategories, flushLogs, formatCardNumber, formatCvc, formatExpiry, formatLocalServerUrl, formatRecurringDateCronSummary, fromOrderLines, fulfillmentStatusesEqual, genId, genOrderId, getLocalTlsPinning, getLogContext, getOrigin, getRouteHealth, getScheduleWindow, hasInFlightPayment, hasLocalTlsPinning, hasSmartRouting, hpkeOpen, hpkeSeal, incomingEdges, indexMenu, indexOutgoingBySource, injectingMetadataFromCallback, invokeCallbackAttempt, isCanonicalizationError, isCardNumberComplete, isCardNumberDefinitelyInvalid, isCheckoutFieldFilled, isCustomerInfoFieldFilled, isCustomerInfoPlaceholder, isCustomerInfoValueValid, isCvcComplete, isDelegatedSessionExpiredError, isDeviceCharged, isDeviceNotLinked, isExpiredFulfillment, isExpiryComplete, isGenId, isInterruptTerminalStatus, isKioskUnauthorized, isLocalOrderUnknown, isMilestoneStepDone, isNodeRuntime, isOnSchedule, isOrderNotOpenError, isOrderPaymentRequiredError, isOrderRouteUnavailableError, isOrderValidationError, isPosDeviceNotLinked, isPosUnauthorized, isRealPaymentMethod, isReservedFulfillmentStatus, isRouteCircuitOpen, isScheduleSlot, isScheduledAtError, isStateHash, isStorefrontNotFound, isSupportedWorkflowSchemaVersion, isTerminalFulfillmentStatus, isTerminalMappedStatus, isTlsFingerprintMismatchError, isVariantBase, linePayableTotal, listMenusStream, localizePosError, log, logError, luhnCheck, markEdgeTaken, markNodeEntered, markNodeExited, markNodeSkipped, markNodesAdvance, markNodesReady, markRouteDown, markRouteHealthy, matchAbsoluteDateOperator, matchBooleanOperator, matchCurrencyOperator, matchEnumOperator, matchNumberOperator, matchRecurringDateOperator, matchRelativeDateOperator, matchStringOperator, matchingPrimaryOutgoing, milestoneSteps, milestoneTrack, nestMenuCategories, nextCurrentNodeIds, normalizeCardholderName, normalizeCertFingerprint, normalizeCustomerPhone, normalizeFulfillmentStatus, normalizeLocaleKey, normalizeMaxIncompleteMinutes, normalizePickupName, normalizeStateScope, onOriginChange, onRouteHealth, orderFactsFromOrder, orderFieldsFromNode, orderPayableTotal, orderRedeemedTotal, orderRedeems, orderStatusForFulfillmentStatus, outgoingEdges, parseExpiry, parseLosslessJson, pathKindForTargetNode, pauseForAdvance, paymentMatchesClientConditions, pendingWebhooksOf, pickAdvanceTarget, pickMultiLanguageText, placeCartLines, probeLocalRouteHealth, processStateNode, rebuildOrderLinesWithFees, rebuildRootGroups, recomputeTotals, redeemedTotal, redeemsForPayment, redemptionCap, redemptionSteps, remainingAmount, removeLine, replaceLine, resolveAdvanceEdge, resolveAdvanceEdges, resolveCallbackFailTerminal, resolveCheckout, resolveFailureTerminalEdge, resolveLocalPins, resolveLocalRouteUrl, resolveModifierImageUrl, resolveOrderRouteEligibility, resolvePaymentEligibility, resolveSchedulePrepMinutes, resolveSdkPaymentEligibilityCeiling, resolveSuccessTerminalEdges, resolveWebhookTargetUrl, resumeFromAdvance, reversePayment, reversedWhenCaptured, roundFeeAmount, runIsTerminal, runNodeCallbacks, runPaymentAttempt, runStateGoldenVectors, scheduledInstant, scheduledSuccessorStatus, selectMatchingFees, selectablePayments, serializeError, services, setLineQuantity, settleEnter, sha256Hex, sha256HexOfString, sittingWorkflowNode, stateRootHash, stateScopeKey, stateSectionHash, stateSectionHashOfJson, storefrontJson, stripFeeLines, stubUnsupportedFeeAmount, summarizeRecurringDateCron, testLocalServerHealth, toOrderLines, toPaymentCardBrand, unusedOutgoing, utf8Encode, validateCardNumber, validateCardholderName, validateCvc, validateExpiry, validateOrderAgainstMenu, validatePickupName, verifyLocalRoutePin, verifyWebhookSignature, visitedStates, warnNoEdge, workflowSchemaVersionOf };
|
|
17805
|
+
export { CALLBACK_MISSING_LOCAL_URL, CANONICAL_MAX_DEPTH, CANONICAL_MAX_EXPONENT, CARD_BRANDS, CUSTOMER_INFO_PLACEHOLDERS, DEFAULT_LOCALE, DEFAULT_MAX_INCOMPLETE_MINUTES, DEFAULT_MAX_SNAPSHOT_AGE_MS, DEFAULT_RECOMMENDATION_TYPES, DEFAULT_ROUTE_COOLDOWN_MS, DEFAULT_WEBHOOK_TIMEOUT_S, DelegatedSessionExpiredError, FULFILLMENT_WORKFLOW_TERMINAL_STATUSES, HPKE_ALG, ID_HASH_FORMATS, LosslessNumber, MAX_MAX_INCOMPLETE_MINUTES, MAX_SUPPORTED_WORKFLOW_SCHEMA_VERSION, MIN_MAX_INCOMPLETE_MINUTES, MODE_HINT_HEADER, OFFLINE_NO_LOCAL_URL, ORIGIN_HEADER, Order, OrderAuthPinnedError, OrderNotOpenError, OrderPaymentRequiredError, OrderRouteUnavailableError, OrderSyncPendingError, OrderSyncRejectedError, OrderValidationError, RESERVED_FULFILLMENT_STATUSES, RecurringDateCron, RulesEngine, SCHEDULED_AT_ERROR_CODES, SCHEDULED_ORDER_MAX_HORIZON_HOURS, SCHEDULED_ORDER_MAX_HORIZON_MINUTES, SCHEDULED_ORDER_MIN_LEAD_MINUTES, SCHEDULED_ORDER_SLOT_MINUTES, SCHEDULED_STATUS, SDK_PAYMENT_ELIGIBILITY_CEILINGS, STATE_ALGO, STATE_HASH_PREFIX, StorefrontHttpError, TLS_FINGERPRINT_RESPONSE_HEADER, TLS_PIN_HEADER, TlsFingerprintMismatchError, TokenExchangeError, WORKFLOW_SCHEMA_VERSION, WORKFLOW_TIMEOUT, WorkflowSchemaVersionError, addLines, advanceAndEnter, appendEngineStepLog, appendNodeLog, applyCmsVisibility, applyFees, applyManualAdvanceNote, assertSupportedWorkflowSchemaVersion, auth, autoEnterSuccessTerminal, base64UrlDecode, base64UrlEncode, beginEngineStepLog, buildCustomerSnapshot, buildEngineCallbackError, buildEngineCallbackRun, buildRouteHttpOptions, buildRulesEngineFromOrder, buildScheduleSlots, buildWorkflowTimeoutDetails, callbackIdsFromNode, canEnterJoin, canPauseNow, cancelTypeOf, canonicalNumber, canonicalString, canonicalize, canonicalizeJson, capRedeems, cappedRedeems, cardBrandSpec, cardDigits, cardNumberGaps, cardNumberMaxLength, cardPreviewGroups, caretAfterDigits, certFingerprintsMatch, certMatchesAnyPin, classifyRouteFailure, clearDeviceSecrets, clearEdgeTaken, clearNodeVisit, cmsVisibilityNeedsTimezone, collectCheckoutIssues, collectOrderLineDiffs, completeEngineStepLog, computeOrderExpiresAt, computeStartingPrice, configureDeviceSecrets, configureLocalTlsPinning, countCartProducts, coveredAmount, createCanonicalizationError, createDeunaWidgetApi, createDeviceSecretsStore, createNodePinnedFetch, createSession, currentNodes, cvcMaxLength, defaultConditionError, defaultIsPaymentCaptured, defaultOutgoingEdge, defaultWebhookEventsForStatus, defaultWebhookRetryDelayMs, detectCardBrand, dispatchOrderWebhooks, dispatchPendingWebhooks, engineHmacSha256Hex, engineOrderStatusForFailedRun, engineWebhookDeliveryId, engineWebhookRunsForEnteredNodes, engineWebhookStatusKey, engineWebhookTransitionStates, enterAndPause, enterWorkflowNode, executeAdvance, executeScheduledWake, executeStart, failActiveEngineStepLog, finalizePlaceOrder, findFirstState, findLocaleKey, findMappedStatusNode, findNodeById, findStartNode, fitRedeems, flattenMenuCategories, flushLogs, formatCardNumber, formatCvc, formatExpiry, formatLocalServerUrl, formatRecurringDateCronSummary, fromOrderLines, fulfillmentStatusesEqual, genId, genOrderId, getLocalTlsPinning, getLogContext, getOrigin, getRouteHealth, getScheduleWindow, getSecret, hasInFlightPayment, hasLocalTlsPinning, hasSmartRouting, hpkeOpen, hpkeSeal, incomingEdges, indexMenu, indexOutgoingBySource, injectingMetadataFromCallback, invokeCallbackAttempt, isCanonicalizationError, isCardNumberComplete, isCardNumberDefinitelyInvalid, isCheckoutFieldFilled, isCustomerInfoFieldFilled, isCustomerInfoPlaceholder, isCustomerInfoValueValid, isCvcComplete, isDelegatedSessionExpiredError, isDeviceCharged, isDeviceNotLinked, isExpiredFulfillment, isExpiryComplete, isGenId, isInterruptTerminalStatus, isKioskUnauthorized, isLocalOrderUnknown, isMilestoneStepDone, isNodeRuntime, isOnSchedule, isOrderNotOpenError, isOrderPaymentRequiredError, isOrderRouteUnavailableError, isOrderValidationError, isPosDeviceNotLinked, isPosUnauthorized, isRealPaymentMethod, isReservedFulfillmentStatus, isRouteCircuitOpen, isScheduleSlot, isScheduledAtError, isStateHash, isStorefrontNotFound, isSupportedWorkflowSchemaVersion, isTerminalFulfillmentStatus, isTerminalMappedStatus, isTlsFingerprintMismatchError, isVariantBase, linePayableTotal, listMenusStream, listSecretKeys, localizePosError, log, logError, luhnCheck, markEdgeTaken, markNodeEntered, markNodeExited, markNodeSkipped, markNodesAdvance, markNodesReady, markRouteDown, markRouteHealthy, matchAbsoluteDateOperator, matchBooleanOperator, matchCurrencyOperator, matchEnumOperator, matchNumberOperator, matchRecurringDateOperator, matchRelativeDateOperator, matchStringOperator, matchingPrimaryOutgoing, milestoneSteps, milestoneTrack, nestMenuCategories, nextCurrentNodeIds, normalizeCardholderName, normalizeCertFingerprint, normalizeCustomerPhone, normalizeFulfillmentStatus, normalizeLocaleKey, normalizeMaxIncompleteMinutes, normalizePickupName, normalizeStateScope, onOriginChange, onRouteHealth, orderFactsFromOrder, orderFieldsFromNode, orderPayableTotal, orderRedeemedTotal, orderRedeems, orderStatusForFulfillmentStatus, outgoingEdges, parseExpiry, parseLosslessJson, pathKindForTargetNode, pauseForAdvance, paymentMatchesClientConditions, pendingWebhooksOf, pickAdvanceTarget, pickMultiLanguageText, placeCartLines, probeLocalRouteHealth, processStateNode, rebuildOrderLinesWithFees, rebuildRootGroups, recomputeTotals, redeemedTotal, redeemsForPayment, redemptionCap, redemptionSteps, remainingAmount, removeLine, replaceLine, resolveAdvanceEdge, resolveAdvanceEdges, resolveCallbackFailTerminal, resolveCheckout, resolveFailureTerminalEdge, resolveLocalPins, resolveLocalRouteUrl, resolveModifierImageUrl, resolveOrderRouteEligibility, resolvePaymentEligibility, resolveSchedulePrepMinutes, resolveSdkPaymentEligibilityCeiling, resolveSuccessTerminalEdges, resolveWebhookTargetUrl, resumeFromAdvance, reversePayment, reversedWhenCaptured, roundFeeAmount, runIsTerminal, runNodeCallbacks, runPaymentAttempt, runStateGoldenVectors, scheduledInstant, scheduledSuccessorStatus, selectMatchingFees, selectablePayments, serializeError, services, setLineQuantity, settleEnter, sha256Hex, sha256HexOfString, sittingWorkflowNode, stateRootHash, stateScopeKey, stateSectionHash, stateSectionHashOfJson, storefrontJson, stripFeeLines, stubUnsupportedFeeAmount, summarizeRecurringDateCron, syncDeviceSecrets, testLocalServerHealth, toOrderLines, toPaymentCardBrand, unusedOutgoing, utf8Encode, validateCardNumber, validateCardholderName, validateCvc, validateExpiry, validateOrderAgainstMenu, validatePickupName, verifyLocalRoutePin, verifyWebhookSignature, visitedStates, warnNoEdge, workflowSchemaVersionOf };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fire-spark/core",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.2",
|
|
4
4
|
"description": "Fire Spark headless SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"big.js": "6.2.1",
|
|
21
21
|
"dayjs": "1.11.9",
|
|
22
22
|
"@types/big.js": "6.2.2",
|
|
23
|
-
"@fire-spark/payments": "^0.38.
|
|
24
|
-
"@fire-spark/types": "^0.38.
|
|
23
|
+
"@fire-spark/payments": "^0.38.2",
|
|
24
|
+
"@fire-spark/types": "^0.38.2"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"tsdown": "^0.22.14",
|