@proveanything/smartlinks-utils-ui 1.13.13 → 1.13.14

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.
@@ -28,7 +28,16 @@ var scopesEqual = (a, b) => {
28
28
 
29
29
  // src/components/RecordsAdmin/data/records.ts
30
30
  var listRecords = async (ctx, params = {}) => {
31
- const { limit = 100, offset, ref, refPrefix, q, sort } = params;
31
+ const {
32
+ limit = 100,
33
+ offset,
34
+ ref,
35
+ refPrefix,
36
+ q,
37
+ sort,
38
+ includeExpired = true,
39
+ includeScheduled = true
40
+ } = params;
32
41
  const res = await ctx.SL.app.records.list(
33
42
  ctx.collectionId,
34
43
  ctx.appId,
@@ -39,7 +48,9 @@ var listRecords = async (ctx, params = {}) => {
39
48
  ref,
40
49
  refPrefix,
41
50
  q,
42
- sort
51
+ sort,
52
+ includeExpired,
53
+ includeScheduled
43
54
  },
44
55
  true
45
56
  );
@@ -226,5 +237,5 @@ var bulkDelete = async (ctx, input) => {
226
237
  };
227
238
 
228
239
  export { bulkDelete, bulkUpsert, createRecord, getRecordById, listRecords, matchRecords, parsedRefToScope, parsedRefToTarget, removeRecord, restoreRecord, scopesEqual, updateRecord, upsertRecord, upsertRecordForScope };
229
- //# sourceMappingURL=chunk-KA4MKRHL.js.map
230
- //# sourceMappingURL=chunk-KA4MKRHL.js.map
240
+ //# sourceMappingURL=chunk-W5ZEH3RT.js.map
241
+ //# sourceMappingURL=chunk-W5ZEH3RT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/RecordsAdmin/data/scopeBridge.ts","../src/components/RecordsAdmin/data/records.ts"],"names":[],"mappings":";AA4BO,IAAM,gBAAA,GAAmB,CAAC,GAAA,KAAkC;AACjE,EAAA,MAAM,UAAyB,EAAC;AAChC,EAAA,IAAI,GAAA,CAAI,SAAA,EAAW,OAAA,CAAQ,SAAA,GAAY,GAAA,CAAI,SAAA;AAC3C,EAAA,IAAI,GAAA,CAAI,S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,CAAI,EAAA,CAAG,IAAI,OAAA,CAAQ,UAAA;AAAA,MACrD,GAAA,CAAI,YAAA;AAAA,MAAc,GAAA,CAAI,KAAA;AAAA,MACtB,EAAE,IAAA,EAAM,KAAA,EAAO,GAAI,GAAA,CAAI,UAAA,GAAa,EAAE,UAAA,EAAY,GAAA,CAAI,UAAA,EAAW,GAAI,EAAC;AAAG,KAC3E;AACA,IAAA,OAAA,IAAW,IAAI,OAAA,IAAW,CAAA;AAAA,EAC5B;AACA,EAAA,OAAO,EAAE,OAAA,EAAQ;AACnB","file":"chunk-W5ZEH3RT.js","sourcesContent":["// =============================================================================\r\n// scopeBridge — Convert between our UI `ParsedRef` and the SDK record anchors.\r\n//\r\n// SDK 1.10.2 flattened `AppRecord`: anchor IDs (`productId`, `variantId`,\r\n// `batchId`, `proofId`) live at the top level and the nested `RecordScope`\r\n// type was removed. Facet selection moved to `facetRule` (rule records),\r\n// handled separately via the FacetRuleEditor.\r\n//\r\n// `parsedRefToScope` keeps its public name (it's re-exported from the\r\n// package entrypoint) but now returns the flat anchor object that Upsert /\r\n// Bulk inputs accept directly.\r\n// =============================================================================\r\nimport type { RecordTarget } from './sdkTypes';\r\nimport type { ParsedRef } from '../types';\r\n\r\n/** Flat anchor shape — matches `UpsertRecordInput` / `BulkUpsertItem`. */\r\nexport interface RecordAnchors {\r\n productId?: string | null;\r\n variantId?: string | null;\r\n batchId?: string | null;\r\n proofId?: string | null;\r\n}\r\n\r\n/**\r\n * Project a `ParsedRef` to the flat anchor IDs the SDK writes. Facet\r\n * components on the ref are intentionally ignored — facet targeting now\r\n * lives on `facetRule` (rule records), not as a record anchor.\r\n */\r\nexport const parsedRefToScope = (ref: ParsedRef): RecordAnchors => {\r\n const anchors: RecordAnchors = {};\r\n if (ref.productId) anchors.productId = ref.productId;\r\n if (ref.variantId) anchors.variantId = ref.variantId;\r\n if (ref.batchId) anchors.batchId = ref.batchId;\r\n if (ref.proofId) anchors.proofId = ref.proofId;\r\n return anchors;\r\n};\r\n\r\nexport const parsedRefToTarget = (ref: ParsedRef): RecordTarget => {\r\n const target: RecordTarget = {};\r\n if (ref.productId) target.productId = ref.productId;\r\n if (ref.variantId) target.variantId = ref.variantId;\r\n if (ref.batchId) target.batchId = ref.batchId;\r\n if (ref.proofId) target.proofId = ref.proofId;\r\n if (ref.facetId && ref.facetValue) {\r\n target.facets = { [ref.facetId]: [ref.facetValue] };\r\n }\r\n return target;\r\n};\r\n\r\n/**\r\n * True when two anchor sets refer to the same node. Used to decide\r\n * \"self\" vs \"inherited\" when consuming `match()` results: compare the\r\n * winning record's flat anchor IDs against the editing scope.\r\n */\r\nexport const scopesEqual = (a: RecordAnchors, b: RecordAnchors): boolean => {\r\n if ((a.productId ?? null) !== (b.productId ?? null)) return false;\r\n if ((a.variantId ?? null) !== (b.variantId ?? null)) return false;\r\n if ((a.batchId ?? null) !== (b.batchId ?? null)) return false;\r\n if ((a.proofId ?? null) !== (b.proofId ?? null)) return false;\r\n return true;\r\n};","// =============================================================================\r\n// Thin wrappers over SL.app.records.* — always admin: true here.\r\n//\r\n// As of `@proveanything/smartlinks` 1.9.0 the records surface ships a proper\r\n// `upsert()`, server-side `match()`, and atomic `bulkUpsert` / `bulkDelete`.\r\n// We delegate to those rather than rolling our own list+update sequences,\r\n// which were racy and ignored facet AND-of-OR semantics.\r\n//\r\n// Identity model (1.10.3+): every record has a stable UUID `id`. The shell\r\n// addresses existing records by id (`update`, `remove`); only genuinely new\r\n// records go via `upsert` (or `create`). We deliberately do NOT synthesise\r\n// a `ref` from anchor IDs anymore — anchors alone are sufficient for the\r\n// server to address the record, and a synthetic ref masks bugs by making\r\n// the editor \"find\" records that don't exist yet.\r\n// =============================================================================\r\nimport type {\r\n AppRecord, RecordTarget, BulkUpsertItem, BulkDeleteResult,\r\n MatchResult, FacetRule,\r\n} from './sdkTypes';\r\nimport type { ParsedRef, SmartLinksSDK } from '../types';\r\nimport { parsedRefToScope, type RecordAnchors } from './scopeBridge';\r\n\r\nexport interface RecordsCtx {\r\n SL: SmartLinksSDK;\r\n collectionId: string;\r\n appId: string;\r\n /** Optional — when omitted, records are stored against the app id alone\r\n * (no type qualifier). Set this only when an app uses multiple record types\r\n * and needs to query/scope by type. */\r\n recordType?: string;\r\n}\r\n\r\n/**\r\n * Shape of a single record write. SDK 1.10.2 takes flat anchor IDs\r\n * directly on the upsert payload (`productId`, `variantId`, `batchId`,\r\n * `proofId`); the legacy nested `scope` object is gone. Set `facetRule`\r\n * for rule records — mutually exclusive with anchor IDs.\r\n */\r\nexport interface RecordWrite<T = unknown> {\r\n /**\r\n * Optional caller-supplied external ref (e.g. a SKU or user-typed key).\r\n * When omitted the server addresses the record by anchors / facetRule\r\n * alone — we no longer synthesise one from anchor IDs client-side.\r\n */\r\n ref?: string;\r\n /** Flat anchor IDs. Drives specificity and `match()` server-side. */\r\n scope: RecordAnchors;\r\n data: T;\r\n visibility?: 'public' | 'owner' | 'admin';\r\n status?: string;\r\n startsAt?: string | null;\r\n expiresAt?: string | null;\r\n customId?: string;\r\n sourceSystem?: string;\r\n /**\r\n * Optional facet rule. When set, the record is targeted via this rule and\r\n * anchor IDs must be empty (SDK enforces mutual exclusion). Used by\r\n * the rule editor / Targeting section.\r\n */\r\n facetRule?: FacetRule | null;\r\n}\r\n\r\nexport const listRecords = async (\r\n ctx: RecordsCtx,\r\n params: {\r\n ref?: string;\r\n refPrefix?: string;\r\n q?: string;\r\n limit?: number;\r\n offset?: number;\r\n sort?: string;\r\n /**\r\n * Include records past their `expiresAt`. Defaults to `true` — the admin\r\n * shell needs to see expired records so operators can review, extend or\r\n * delete them. Pass `false` on public-facing surfaces that should only\r\n * see currently-live records.\r\n */\r\n includeExpired?: boolean;\r\n /**\r\n * Include records whose `startsAt` is in the future. Defaults to `true`\r\n * for the same admin-surface reason as `includeExpired`.\r\n */\r\n includeScheduled?: boolean;\r\n } = {},\r\n): Promise<{ data: AppRecord[]; total: number; hasMore: boolean }> => {\r\n const {\r\n limit = 100, offset, ref, refPrefix, q, sort,\r\n includeExpired = true, includeScheduled = true,\r\n } = params;\r\n const res = await ctx.SL.app.records.list(\r\n ctx.collectionId,\r\n ctx.appId,\r\n {\r\n ...(ctx.recordType ? { recordType: ctx.recordType } : {}),\r\n limit, offset, ref, refPrefix, q, sort,\r\n includeExpired, includeScheduled,\r\n },\r\n true,\r\n );\r\n return {\r\n data: res?.data ?? [],\r\n total: res?.pagination?.total ?? (res?.data?.length ?? 0),\r\n hasMore: res?.pagination?.hasMore ?? false,\r\n };\r\n};\r\n\r\n/**\r\n * Look up a single record by its UUID id. The id-primary read path used by\r\n * deep-link restore (`?recordId=`).\r\n */\r\nexport const getRecordById = async (\r\n ctx: RecordsCtx,\r\n recordId: string,\r\n): Promise<AppRecord | null> => {\r\n try {\r\n const record = await ctx.SL.app.records.get(ctx.collectionId, ctx.appId, recordId, true);\r\n return record;\r\n } catch (error) {\r\n // Some host environments appear to lag the id-primary `get()` path even\r\n // though the same record is visible in `list()`. Fall back to a bounded\r\n // scan so item selection still resolves instead of looking dead.\r\n // eslint-disable-next-line no-console\r\n console.warn('[RecordsAdmin/getRecordById] direct get failed, falling back to list scan', {\r\n recordId,\r\n error: error instanceof Error ? error.message : String(error),\r\n });\r\n let offset = 0;\r\n const limit = 100;\r\n for (let page = 0; page < 10; page += 1) {\r\n const res = await listRecords(ctx, { limit, offset }).catch(() => null);\r\n const hit = res?.data.find((rec) => rec.id === recordId) ?? null;\r\n if (hit) {\r\n return hit;\r\n }\r\n if (!res?.hasMore) break;\r\n offset += res.data.length;\r\n }\r\n // eslint-disable-next-line no-console\r\n console.warn('[RecordsAdmin/getRecordById] record not found after fallback scan', { recordId });\r\n return null;\r\n }\r\n};\r\n\r\n/**\r\n * Create-or-update by (anchors + recordType) — used when we don't yet know\r\n * the record's UUID id. The server addresses the row by anchors (or the\r\n * supplied `ref`/`facetRule`) and returns the row with its stable `id`.\r\n *\r\n * Prefer `updateRecord(ctx, id, …)` whenever an id is already in hand:\r\n * it's an unambiguous PATCH against a known row and never accidentally\r\n * resurrects a sibling at the same anchor.\r\n */\r\nexport const upsertRecord = async <T,>(\r\n ctx: RecordsCtx,\r\n write: RecordWrite<T>,\r\n): Promise<{ record: AppRecord; isCreate: boolean }> => {\r\n const payload: Record<string, unknown> = {\r\n ...(ctx.recordType ? { recordType: ctx.recordType } : {}),\r\n data: write.data as Record<string, unknown>,\r\n status: write.status,\r\n startsAt: write.startsAt,\r\n expiresAt: write.expiresAt,\r\n customId: write.customId,\r\n sourceSystem: write.sourceSystem,\r\n };\r\n // Only send `ref` when the caller supplied one explicitly (external key\r\n // such as a SKU). We no longer synthesise one from anchors.\r\n if (write.ref) payload.ref = write.ref;\r\n\r\n // SDK 1.10.3 enforces mutual exclusion between anchor IDs and `facetRule`.\r\n // Send exactly one. When a rule is supplied the server resolves matches\r\n // against it; otherwise the flat anchor IDs drive specificity.\r\n if (write.facetRule && write.facetRule.all && write.facetRule.all.length > 0) {\r\n payload.facetRule = write.facetRule;\r\n } else {\r\n if (write.scope.productId) payload.productId = write.scope.productId;\r\n if (write.scope.variantId) payload.variantId = write.scope.variantId;\r\n if (write.scope.batchId) payload.batchId = write.scope.batchId;\r\n if (write.scope.proofId) payload.proofId = write.scope.proofId;\r\n }\r\n const res = await ctx.SL.app.records.upsert(\r\n ctx.collectionId, ctx.appId, payload as Parameters<typeof ctx.SL.app.records.upsert>[2],\r\n );\r\n return { record: res, isCreate: !!res?.created };\r\n};\r\n\r\n/**\r\n * Create a brand-new record. Use this for collection-cardinality items\r\n * where each save must produce a distinct row (no upsert key collision).\r\n * Unlike `upsert`, the server allows omitting `ref` here — every call\r\n * inserts a new row and returns its UUID.\r\n */\r\nexport const createRecord = async <T,>(\r\n ctx: RecordsCtx,\r\n write: RecordWrite<T>,\r\n): Promise<AppRecord> => {\r\n const payload: Record<string, unknown> = {\r\n ...(ctx.recordType ? { recordType: ctx.recordType } : {}),\r\n data: write.data as Record<string, unknown>,\r\n status: write.status,\r\n startsAt: write.startsAt,\r\n expiresAt: write.expiresAt,\r\n customId: write.customId,\r\n sourceSystem: write.sourceSystem,\r\n };\r\n if (write.ref) payload.ref = write.ref;\r\n if (write.facetRule && write.facetRule.all && write.facetRule.all.length > 0) {\r\n payload.facetRule = write.facetRule;\r\n } else {\r\n if (write.scope.productId) payload.productId = write.scope.productId;\r\n if (write.scope.variantId) payload.variantId = write.scope.variantId;\r\n if (write.scope.batchId) payload.batchId = write.scope.batchId;\r\n if (write.scope.proofId) payload.proofId = write.scope.proofId;\r\n }\r\n return ctx.SL.app.records.create(\r\n ctx.collectionId, ctx.appId,\r\n payload as Parameters<typeof ctx.SL.app.records.create>[2],\r\n true,\r\n );\r\n};\r\n\r\n/**\r\n * PATCH an existing record by its UUID id. The id-primary save path —\r\n * preferred over `upsertRecord` whenever the resolver has handed us a\r\n * `recordId`. Anchors are passed through verbatim; pass `null` for an\r\n * anchor to clear it.\r\n */\r\nexport const updateRecord = async <T,>(\r\n ctx: RecordsCtx,\r\n recordId: string,\r\n patch: {\r\n data?: T;\r\n scope?: RecordAnchors;\r\n facetRule?: FacetRule | null;\r\n status?: string;\r\n startsAt?: string | null;\r\n expiresAt?: string | null;\r\n },\r\n): Promise<AppRecord> => {\r\n const payload: Record<string, unknown> = {\r\n ...(ctx.recordType ? { recordType: ctx.recordType } : {}),\r\n };\r\n if (patch.data !== undefined) payload.data = patch.data as Record<string, unknown>;\r\n if (patch.status !== undefined) payload.status = patch.status;\r\n if (patch.startsAt !== undefined) payload.startsAt = patch.startsAt;\r\n if (patch.expiresAt !== undefined) payload.expiresAt = patch.expiresAt;\r\n if (patch.scope) {\r\n if (patch.scope.productId !== undefined) payload.productId = patch.scope.productId;\r\n if (patch.scope.variantId !== undefined) payload.variantId = patch.scope.variantId;\r\n if (patch.scope.batchId !== undefined) payload.batchId = patch.scope.batchId;\r\n if (patch.scope.proofId !== undefined) payload.proofId = patch.scope.proofId;\r\n }\r\n if (patch.facetRule !== undefined) payload.facetRule = patch.facetRule;\r\n return ctx.SL.app.records.update(\r\n ctx.collectionId, ctx.appId, recordId,\r\n payload as Parameters<typeof ctx.SL.app.records.update>[3],\r\n true,\r\n );\r\n};\r\n\r\n/** Delete a record by its UUID id. The id-primary delete path. */\r\nexport const removeRecord = async (\r\n ctx: RecordsCtx,\r\n recordId: string,\r\n): Promise<void> => {\r\n await ctx.SL.app.records.remove(ctx.collectionId, ctx.appId, recordId, true);\r\n};\r\n\r\n/**\r\n * Convenience wrapper for callers that only have a `ParsedRef` and a payload —\r\n * matches the previous (`ref`, `data`) call shape used by the editor hook.\r\n */\r\nexport const upsertRecordForScope = async <T,>(\r\n ctx: RecordsCtx,\r\n scope: ParsedRef,\r\n data: T,\r\n extra: { visibility?: 'public' | 'owner' | 'admin' } = {},\r\n) => upsertRecord<T>(ctx, {\r\n ref: scope.raw || undefined,\r\n scope: parsedRefToScope(scope),\r\n data,\r\n visibility: extra.visibility,\r\n});\r\n\r\n/** Restore a soft-deleted record by ID (admin only). */\r\nexport const restoreRecord = async (\r\n ctx: RecordsCtx,\r\n recordId: string,\r\n): Promise<AppRecord> => ctx.SL.app.records.restore(ctx.collectionId, ctx.appId, recordId);\r\n\r\n/**\r\n * Server-side match — single round trip that returns every record whose\r\n * `scope` is satisfied by `target`, ordered by descending `specificity`.\r\n * Replaces the per-scope N+1 chain walk we used pre-1.9.\r\n */\r\nexport const matchRecords = async (\r\n ctx: RecordsCtx,\r\n target: RecordTarget,\r\n opts: {\r\n strategy?: 'all' | 'best';\r\n at?: string;\r\n includeScheduled?: boolean;\r\n includeExpired?: boolean;\r\n limit?: number;\r\n } = {},\r\n): Promise<MatchResult> => ctx.SL.app.records.match(\r\n ctx.collectionId,\r\n ctx.appId,\r\n {\r\n target,\r\n ...(ctx.recordType ? { recordType: ctx.recordType } : {}),\r\n strategy: opts.strategy ?? 'all',\r\n at: opts.at,\r\n includeScheduled: opts.includeScheduled,\r\n includeExpired: opts.includeExpired,\r\n limit: opts.limit,\r\n },\r\n true,\r\n);\r\n\r\n/**\r\n * Server-side bulk upsert. Up to 500 rows per call; any leftover is chunked.\r\n * Each row is error-isolated by the server.\r\n */\r\nexport const bulkUpsert = async <T,>(\r\n ctx: RecordsCtx,\r\n entries: Array<{ ref?: string; scope: RecordAnchors; data: T; status?: string }>,\r\n): Promise<{ saved: number; failed: number }> => {\r\n const CHUNK = 500;\r\n let saved = 0;\r\n let failed = 0;\r\n for (let i = 0; i < entries.length; i += CHUNK) {\r\n const slice = entries.slice(i, i + CHUNK);\r\n const items: BulkUpsertItem[] = slice.map((e) => {\r\n const item: BulkUpsertItem = {\r\n ...(ctx.recordType ? { recordType: ctx.recordType } : {}),\r\n productId: e.scope.productId ?? null,\r\n variantId: e.scope.variantId ?? null,\r\n batchId: e.scope.batchId ?? null,\r\n proofId: e.scope.proofId ?? null,\r\n data: e.data as Record<string, unknown>,\r\n status: e.status,\r\n } as BulkUpsertItem;\r\n // Caller-supplied external refs only — we no longer derive one from\r\n // anchors. Bulk imports without an external key rely on the server\r\n // matching on (recordType + anchors) for the upsert key.\r\n if (e.ref) (item as { ref?: string }).ref = e.ref;\r\n return item;\r\n });\r\n const res = await ctx.SL.app.records.bulkUpsert(ctx.collectionId, ctx.appId, items)\r\n .catch((): { saved: number; failed: number } => ({ saved: 0, failed: items.length }));\r\n saved += res.saved ?? 0;\r\n failed += res.failed ?? 0;\r\n }\r\n return { saved, failed };\r\n};\r\n\r\n/**\r\n * Server-side bulk delete. Accepts an explicit ref list (max 1000 per call,\r\n * chunked here) or a scope anchor (single call).\r\n */\r\nexport const bulkDelete = async (\r\n ctx: RecordsCtx,\r\n input: { refs: string[] } | { scope: RecordAnchors },\r\n): Promise<{ removed: number }> => {\r\n if ('scope' in input) {\r\n // SDK `BulkDeleteInput.scope` accepts the flat anchor object directly.\r\n const scope: Record<string, string> = {};\r\n if (input.scope.productId) scope.productId = input.scope.productId;\r\n if (input.scope.variantId) scope.variantId = input.scope.variantId;\r\n if (input.scope.batchId) scope.batchId = input.scope.batchId;\r\n if (input.scope.proofId) scope.proofId = input.scope.proofId;\r\n const res: BulkDeleteResult = await ctx.SL.app.records.bulkDelete(\r\n ctx.collectionId, ctx.appId,\r\n { scope, ...(ctx.recordType ? { recordType: ctx.recordType } : {}) },\r\n );\r\n return { removed: res.deleted ?? 0 };\r\n }\r\n\r\n const CHUNK = 1000;\r\n let removed = 0;\r\n for (let i = 0; i < input.refs.length; i += CHUNK) {\r\n const slice = input.refs.slice(i, i + CHUNK);\r\n const res: BulkDeleteResult = await ctx.SL.app.records.bulkDelete(\r\n ctx.collectionId, ctx.appId,\r\n { refs: slice, ...(ctx.recordType ? { recordType: ctx.recordType } : {}) },\r\n );\r\n removed += res.deleted ?? 0;\r\n }\r\n return { removed };\r\n};"]}
@@ -2036,6 +2036,18 @@ declare const listRecords: (ctx: RecordsCtx, params?: {
2036
2036
  limit?: number;
2037
2037
  offset?: number;
2038
2038
  sort?: string;
2039
+ /**
2040
+ * Include records past their `expiresAt`. Defaults to `true` — the admin
2041
+ * shell needs to see expired records so operators can review, extend or
2042
+ * delete them. Pass `false` on public-facing surfaces that should only
2043
+ * see currently-live records.
2044
+ */
2045
+ includeExpired?: boolean;
2046
+ /**
2047
+ * Include records whose `startsAt` is in the future. Defaults to `true`
2048
+ * for the same admin-surface reason as `includeExpired`.
2049
+ */
2050
+ includeScheduled?: boolean;
2039
2051
  }) => Promise<{
2040
2052
  data: AppRecord[];
2041
2053
  total: number;
@@ -1,5 +1,5 @@
1
- import { parsedRefToTarget, parsedRefToScope, matchRecords, scopesEqual, getRecordById, listRecords, upsertRecord, updateRecord, createRecord, removeRecord } from '../../chunk-KA4MKRHL.js';
2
- export { bulkDelete, bulkUpsert, createRecord, getRecordById, listRecords, matchRecords, parsedRefToScope, parsedRefToTarget, removeRecord, restoreRecord, scopesEqual, upsertRecord } from '../../chunk-KA4MKRHL.js';
1
+ import { parsedRefToTarget, parsedRefToScope, matchRecords, scopesEqual, getRecordById, listRecords, upsertRecord, updateRecord, createRecord, removeRecord } from '../../chunk-W5ZEH3RT.js';
2
+ export { bulkDelete, bulkUpsert, createRecord, getRecordById, listRecords, matchRecords, parsedRefToScope, parsedRefToTarget, removeRecord, restoreRecord, scopesEqual, upsertRecord } from '../../chunk-W5ZEH3RT.js';
3
3
  import { useIntroState, ErrorBoundary, AdminPageHeader } from '../../chunk-XASZS7EA.js';
4
4
  export { ErrorBoundary } from '../../chunk-XASZS7EA.js';
5
5
  import { FacetRuleEditor } from '../../chunk-WVCNIX7N.js';
@@ -713,7 +713,12 @@ var useProductSubRecords = (args) => {
713
713
  {
714
714
  ...recordType ? { recordType } : {},
715
715
  limit,
716
- offset
716
+ offset,
717
+ // Admin discovery: include expired + scheduled so the rail
718
+ // exposes every variant/batch that has *ever* held a record,
719
+ // matching the rest of the admin shell's list semantics.
720
+ includeExpired: true,
721
+ includeScheduled: true
717
722
  },
718
723
  true
719
724
  ).catch(() => null);
@@ -2655,7 +2660,7 @@ function useShellNavigation(args) {
2655
2660
  }
2656
2661
  }
2657
2662
  try {
2658
- const { removeRecord: removeRecord2 } = await import('../../records-4NN757SG.js');
2663
+ const { removeRecord: removeRecord2 } = await import('../../records-GPSKUNST.js');
2659
2664
  await removeRecord2(ctx, itemId);
2660
2665
  onTelemetry?.({ type: "item.delete", recordType, scopeRef: baseScopeRef, itemId });
2661
2666
  if (selectedItemId === itemId) setSelectedItemId(null);