@expofp/config 3.46.0 → 3.47.0

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 CHANGED
@@ -7,7 +7,7 @@ export { loadConfig } from './lib/load-config.js';
7
7
  export { type StorageLike } from './lib/local-storage-codec.js';
8
8
  export { type ConfigResourceStore, serializationFormat, serializeConfigResources, SERIALIZER_VERSION, } from './lib/serialize-config-resources.js';
9
9
  export { compactUrl, resolveUrl } from './lib/store-ref.js';
10
- export { parseFromUrlTolerant } from './lib/url-codec.js';
10
+ export { parseFromUrlTolerant, toQueryString } from './lib/url-codec.js';
11
11
  export { parseIntentsFromUrl, serializeIntentToUrl } from './lib/url-intents.js';
12
12
  export { type Config, type Consent, type Manifest, type Options } from '@expofp/schema';
13
13
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -8,5 +8,5 @@ export { parseLegacyQuery, serializeSelection, splitPlatformParams, } from './li
8
8
  export { loadConfig } from './lib/load-config.js';
9
9
  export { serializationFormat, serializeConfigResources, SERIALIZER_VERSION, } from './lib/serialize-config-resources.js';
10
10
  export { compactUrl, resolveUrl } from './lib/store-ref.js';
11
- export { parseFromUrlTolerant } from './lib/url-codec.js';
11
+ export { parseFromUrlTolerant, toQueryString } from './lib/url-codec.js';
12
12
  export { parseIntentsFromUrl, serializeIntentToUrl } from './lib/url-intents.js';
@@ -163,13 +163,44 @@ const directReadKeys = new Set(['layer', 'kiosk_x', 'kiosk_y', 'kiosk_z']);
163
163
  * slug of a params-classified query is never replayed as search text.)
164
164
  */
165
165
  const companionKeys = new Set(['title']);
166
+ /**
167
+ * Split a raw query into the config layer's own parts and the legacy remainder,
168
+ * at raw-segment level — the same partition {@link splitPlatformParams} performs
169
+ * for the platform's routing params, and for the same reason: the canonical
170
+ * bracketed form `toQueryString` writes travels OUTSIDE the legacy grammar's
171
+ * single-`encodeURIComponent`-unit payload, so its values are encoded once, not
172
+ * twice. Stripped after the blanket decode instead, a value holding `&` — the
173
+ * catalog really has a `Fish & Seafood` — would have had its `%26` decoded into
174
+ * a live separator first, and the orphaned tail (` seafood`) became the residual
175
+ * slug: a shared link classified as a booth selection instead of `ownedByConfig`.
176
+ *
177
+ * The legacy half is re-joined verbatim and decoded exactly as before, so a query
178
+ * carrying no config-owned raw part comes out byte-identical to the old path.
179
+ */
180
+ function splitConfigParts(rawQuery) {
181
+ const kept = [];
182
+ let owned = false;
183
+ for (const part of rawQuery.split('&')) {
184
+ if (part && isConsumedByConfig(safeDecode(part))) {
185
+ owned = true;
186
+ continue;
187
+ }
188
+ kept.push(part);
189
+ }
190
+ return { legacy: kept.join('&'), owned };
191
+ }
166
192
  export function parseLegacyQuery(search) {
167
193
  const rawQuery = search.startsWith('?') ? search.slice(1) : search;
168
194
  // the legacy contract: the payload is one encodeURIComponent unit
169
195
  const decoded = safeDecode(rawQuery);
196
+ // `params` keeps reading the WHOLE query: some config-owned keys are also read
197
+ // by a classifier (`?kiosk=`) or a one-shot, so the raw partition below must
198
+ // narrow the SLUG only — it is not a second reader of the query.
170
199
  const params = new URLSearchParams(decoded);
200
+ const { legacy, owned: ownedRaw } = splitConfigParts(rawQuery);
201
+ const decodedLegacy = legacy === rawQuery ? decoded : safeDecode(legacy);
171
202
  return {
172
- primary: classifyPrimary(residualSlug(decoded), params, hasOwnedParts(decoded)),
203
+ primary: classifyPrimary(residualSlug(decodedLegacy), params, ownedRaw || hasOwnedParts(decodedLegacy)),
173
204
  oneShots: collectOneShots(params),
174
205
  };
175
206
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expofp/config",
3
- "version": "3.46.0",
3
+ "version": "3.47.0",
4
4
  "type": "module",
5
5
  "description": "ExpoFP SDK internal: config layer and schemas",
6
6
  "homepage": "https://developer.expofp.com/",
@@ -29,8 +29,8 @@
29
29
  "debug": "^4.4.3",
30
30
  "tslib": "^2.3.0",
31
31
  "zod": "4.4.3",
32
- "@expofp/resolve": "3.46.0",
33
- "@expofp/schema": "3.46.0",
34
- "@expofp/utils": "3.46.0"
32
+ "@expofp/resolve": "3.47.0",
33
+ "@expofp/schema": "3.47.0",
34
+ "@expofp/utils": "3.47.0"
35
35
  }
36
36
  }