/** * Compile-time-only type-accuracy check for the fields whose DECLARED shape * disagreed with the wire (all found 01.08.2026). * * Same pattern as types.superpass-employee.typecheck.ts: no runtime * assertions, never imported by index.ts — `bun:test` won't pick it up (the * name doesn't match `*.test.ts`) and `bun build` won't bundle it, but * `tsc --noEmit` / `tsc --emitDeclarationOnly` fails loudly if either type * drifts back: * * 1. `Notification` — the API serialized the DB row (`readAt`, `payload`) * while this interface declared only `isRead`/`data`, and nothing * translated. Reading the typed fields therefore yielded `undefined` * forever: bells rendered read notifications as unread, deep links never * fired. gamecore-api now emits BOTH spellings, so the canonical fields * AND the deprecated aliases must stay declared until the last raw * consumer (szmarket, site 14) moves off them — a type that carries only * one half of a dual-emit wire is how this class of bug starts. * * 2. `OrderItem.cdKeys` — the delivered keys arrive as the RAW `cd_keys` * TEXT column (a JSON *string*), never as the singular `cdKey` the * interface used to declare alone. A reader that trusts `cdKey` shows * the buyer no key at all after a reload. * * 2b. `OrderItem.keys` (added 03.08.2026) — not a past disagreement but the * one field here whose drift would be SILENT AND WRONG rather than * silently absent: it is the parse the client is told to trust instead of * its own, and the `keyRef` it carries is what a mark is written against. * Widen `state` to `string`, drop a literal, or make `keyRef` optional and * nothing fails — the buyer just gets a mark on a code he did not mark. * * 2c. `orders.setKeyState` (added 03.08.2026) — the write half, pinned next * to the read half so the two cannot drift apart about what a mark is. * Its `state` parameter is REQUIRED and separately nullable; a default or * a `?` there would turn a forgotten argument into a silent clear, and no * runtime test can catch that because every test passes a value. * * 4. Review dimensions (added 04.08.2026) — `deliveryRating` / `supportRating` * and the four `ReviewStats` aggregates. The columns are nullable and the * API maps review rows field-by-field, so an unrated dimension arrives as * an explicit `null`. So does the merged Telegram half of the same feed: * it has no such column, and rather than omitting the key it sends a * literal `null` for both (review-service.ts, `tgReviews`). Declaring * `?: number` alone would therefore be the Notification bug again in * miniature: `typeof r.deliveryRating` says "number | undefined", the * value is `null`, and `null <= 5` is TRUE — a zero-star row rendered for * a buyer who simply skipped the question. The `?` is NOT about the * Telegram half; it is about API version, since a deployment predating * 0.62.0 omits the key entirely and this SDK still has to compile and * read correctly against one. * * The `ReviewStats` averages are declared nullable as TOLERANCE, not * because this API sends null: `getReviewStats` funnels every average * through `roundOneDecimal`, which maps a NULL `AVG()` over an empty * population to `0`. The "nobody has rated this dimension" signal on the * wire is therefore `count === 0`, NOT a null average — a consumer that * branches on `deliveryAverage === null` never fires and renders 0.0 * stars. The counts are plain numbers: COUNT is never null and nothing * coerces it. * * 5. `reviews.create` (added 04.08.2026) — the write half, pinned next to the * read half. The signature is a REST-TUPLE UNION (`[id, rating, text?] | * [id, options]`), not a per-parameter union, and the difference is the * whole point: a per-parameter `number | ReviewCreateOptions` would accept * `create(id, { rating: 5 }, "text")` — the natural half-finished migration * edit, where someone wraps the rating in an object and forgets the * trailing argument — and silently DROP the buyer's review text, invisibly * on both ends. As a tuple union that call matches neither member and * fails to compile. `Parameters<>` on a single signature still yields the * tuple union, so every pin below reads naturally off it. * * The pin that matters most is still that the POSITIONAL member survives: * collapsing the signature to options-only would break every existing * storefront call silently at runtime (the object lands where the API * expects an integer rating) while still type-checking on the SDK side. */ import type { GameCoreClient } from "./client"; import type { Notification, OrderItem, OrderKeyState, OrderKeyStateResult, OrderUpdateEvent, Product, Review, ReviewCreateResult, ReviewGuestCreateResult, ReviewStats } from "./types"; declare const _dualEmit: Notification; declare const _read: Notification; declare const _canonicalOnly: Notification; declare const _readAtIsIsoOrNull: string | null | undefined; declare const _payloadIsRecordOrNull: Record | null | undefined; declare const _missingIsRead: Notification; declare const _readAtIsNotADate: Notification; declare const _dataIsNotNullable: Notification; declare const _delivered: OrderItem["cdKeys"]; declare const _undelivered: OrderItem["cdKeys"]; declare const _notAnArray: OrderItem["cdKeys"]; type SseOrderItem = NonNullable[number]; declare const _sseCarriesSingular: SseOrderItem; declare const _restSingularIsStringOrAbsent: string | undefined; declare const _keyList: OrderItem["keys"]; declare const _noKeysDelivered: OrderItem["keys"]; type _KeysOptional = undefined extends OrderItem["keys"] ? true : never; declare const _keysIsOptional: _KeysOptional; type OrderKeyEntry = NonNullable[number]; declare const _codeIsString: string; declare const _keyRefIsString: string; declare const _stateIsUnionOrNull: "activated" | "not_working" | null; declare const _stateAcceptsActivated: OrderKeyEntry["state"]; declare const _stateAcceptsNotWorking: OrderKeyEntry["state"]; declare const _stateAcceptsNull: OrderKeyEntry["state"]; declare const _keysNotRawString: OrderItem["keys"]; declare const _keysNotBareCodes: OrderItem["keys"]; declare const _keysNeedRef: OrderItem["keys"]; declare const _keysNeedState: OrderItem["keys"]; declare const _keysRejectUnknownState: OrderItem["keys"]; declare const _markFromRead: OrderKeyState | null; declare const _markToWrite: NonNullable[number]["state"]; type SetKeyStateParams = Parameters; type _StateParamRequired = undefined extends SetKeyStateParams[3] ? never : true; declare const _stateParamIsRequired: _StateParamRequired; declare const _nullIsALegalMark: SetKeyStateParams[3]; declare const _activatedIsALegalMark: SetKeyStateParams[3]; declare const _notWorkingIsALegalMark: SetKeyStateParams[3]; declare const _keyStateParamOrder: [string, number, string]; declare const _keyStateOk: OrderKeyStateResult; declare const _keyStateFailed: OrderKeyStateResult; declare const _keyStateFailedBare: OrderKeyStateResult; declare const _keyStateRejectsUnknownOutcome: OrderKeyStateResult; declare const _gameSlugIsStringOrAbsent: string | undefined; type _GameSlugOptional = undefined extends Product["gameSlug"] ? true : never; declare const _gameSlugIsOptional: _GameSlugOptional; declare const _reviewNoDimensions: Review; declare const _reviewBothDimensions: Review; declare const _reviewNullDimension: Review; declare const _telegramImportedReview: Review; type _DeliveryOptional = undefined extends Review["deliveryRating"] ? true : never; declare const _deliveryIsOptional: _DeliveryOptional; type _SupportOptional = undefined extends Review["supportRating"] ? true : never; declare const _supportIsOptional: _SupportOptional; declare const _dimensionIsNotALabel: Review; declare const _statsLegacy: ReviewStats; declare const _statsWithDimensions: ReviewStats; declare const _statsEmptyDimension: ReviewStats; declare const _statsNullAverageTolerated: ReviewStats; declare const _countIsNeverNull: ReviewStats; declare const _totalIsRequired: number; declare const _deliveryCountIsSeparate: number | undefined; declare const _createEchoesDimensions: ReviewCreateResult; declare const _guestCreated: ReviewGuestCreateResult; declare const _guestBonusIsNeverGranted: null | undefined; type ReviewCreateParams = Parameters; declare const _positionalStillTypes: ReviewCreateParams; declare const _positionalWithoutText: ReviewCreateParams; declare const _optionsForm: ReviewCreateParams; declare const _optionsNeedRating: ReviewCreateParams; declare const _noStrayTextAfterOptions: ReviewCreateParams; type ReviewGuestParams = Parameters; declare const _guestParamOrder: ReviewGuestParams; type _GuestOptionsRequired = undefined extends ReviewGuestParams[1] ? never : true; declare const _guestOptionsIsRequired: _GuestOptionsRequired; declare const _guestBonusIsNullOrAbsent: null | undefined; export type _ResponseShapeTypecheck = [ typeof _dualEmit, typeof _read, typeof _canonicalOnly, typeof _readAtIsIsoOrNull, typeof _payloadIsRecordOrNull, typeof _missingIsRead, typeof _readAtIsNotADate, typeof _dataIsNotNullable, typeof _delivered, typeof _undelivered, typeof _notAnArray, typeof _sseCarriesSingular, typeof _restSingularIsStringOrAbsent, typeof _keyList, typeof _noKeysDelivered, typeof _keysIsOptional, typeof _codeIsString, typeof _keyRefIsString, typeof _stateIsUnionOrNull, typeof _stateAcceptsActivated, typeof _stateAcceptsNotWorking, typeof _stateAcceptsNull, typeof _keysNotRawString, typeof _keysNotBareCodes, typeof _keysNeedRef, typeof _keysNeedState, typeof _keysRejectUnknownState, typeof _markFromRead, typeof _markToWrite, typeof _stateParamIsRequired, typeof _nullIsALegalMark, typeof _activatedIsALegalMark, typeof _notWorkingIsALegalMark, typeof _keyStateParamOrder, typeof _keyStateOk, typeof _keyStateFailed, typeof _keyStateFailedBare, typeof _keyStateRejectsUnknownOutcome, typeof _gameSlugIsStringOrAbsent, typeof _gameSlugIsOptional, typeof _reviewNoDimensions, typeof _reviewBothDimensions, typeof _reviewNullDimension, typeof _telegramImportedReview, typeof _deliveryIsOptional, typeof _supportIsOptional, typeof _dimensionIsNotALabel, typeof _statsLegacy, typeof _statsWithDimensions, typeof _statsEmptyDimension, typeof _statsNullAverageTolerated, typeof _countIsNeverNull, typeof _totalIsRequired, typeof _deliveryCountIsSeparate, typeof _createEchoesDimensions, typeof _guestCreated, typeof _guestBonusIsNeverGranted, typeof _positionalStillTypes, typeof _positionalWithoutText, typeof _optionsForm, typeof _optionsNeedRating, typeof _noStrayTextAfterOptions, typeof _guestParamOrder, typeof _guestOptionsIsRequired, typeof _guestBonusIsNullOrAbsent ]; export {};