@proveanything/smartlinks 2.0.31 → 2.0.32

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.
@@ -421,15 +421,30 @@ export var app;
421
421
  * Build a query string from an object of parameters
422
422
  */
423
423
  function buildQueryString(params) {
424
- const entries = Object.entries(params).filter(([_, value]) => value !== undefined && value !== null);
425
- if (entries.length === 0)
426
- return '';
427
- const queryString = entries
428
- .map(([key, value]) => {
429
- const encodedKey = encodeURIComponent(key);
430
- const encodedValue = encodeURIComponent(String(value));
431
- return `${encodedKey}=${encodedValue}`;
432
- })
433
- .join('&');
434
- return `?${queryString}`;
424
+ const parts = [];
425
+ const add = (key, value) => {
426
+ if (value === undefined || value === null)
427
+ return;
428
+ parts.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
429
+ };
430
+ for (const [key, value] of Object.entries(params)) {
431
+ if (value === undefined || value === null)
432
+ continue;
433
+ if (Array.isArray(value)) {
434
+ add(key, value.join(',')); // unchanged: top-level arrays are sent comma-joined
435
+ }
436
+ else if (typeof value === 'object' && !(value instanceof Date)) {
437
+ // Nested filter objects (e.g. dataFilter: { versionId: 'x', zone: 'in:a,b' }) → dataFilter[versionId]=x
438
+ for (const [sub, subValue] of Object.entries(value)) {
439
+ if (Array.isArray(subValue))
440
+ subValue.forEach((v) => add(`${key}[${sub}]`, v));
441
+ else
442
+ add(`${key}[${sub}]`, subValue);
443
+ }
444
+ }
445
+ else {
446
+ add(key, value instanceof Date ? value.toISOString() : value);
447
+ }
448
+ }
449
+ return parts.length ? `?${parts.join('&')}` : '';
435
450
  }
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 2.0.31 | Generated: 2026-09-29T19:37:17.528Z
3
+ Version: 2.0.32 | Generated: 2026-10-01T17:18:44.658Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
package/dist/openapi.yaml CHANGED
@@ -14509,6 +14509,21 @@ paths:
14509
14509
  required: false
14510
14510
  schema:
14511
14511
  type: string
14512
+ - name: qFields
14513
+ in: query
14514
+ required: false
14515
+ schema:
14516
+ type: string
14517
+ - name: dataFilter
14518
+ in: query
14519
+ required: false
14520
+ schema:
14521
+ type: object
14522
+ additionalProperties:
14523
+ type: array
14524
+ items:
14525
+ type: object
14526
+ additionalProperties: true
14512
14527
  - name: authorId
14513
14528
  in: query
14514
14529
  required: false
@@ -20052,6 +20067,15 @@ components:
20052
20067
  type: string
20053
20068
  q:
20054
20069
  type: string
20070
+ qFields:
20071
+ type: string
20072
+ dataFilter:
20073
+ type: object
20074
+ additionalProperties:
20075
+ type: array
20076
+ items:
20077
+ type: object
20078
+ additionalProperties: true
20055
20079
  authorId:
20056
20080
  type: string
20057
20081
  parentType:
@@ -620,8 +620,19 @@ export interface RecordListQueryParams extends ListQueryParams {
620
620
  variantId?: string;
621
621
  /** Filter by batchId (indexed flat column) */
622
622
  batchId?: string;
623
- /** Full-text filter on data.label (case-insensitive substring) */
623
+ /** Full-text filter (case-insensitive substring) on data.label — or on `qFields` (admin) */
624
624
  q?: string;
625
+ /**
626
+ * Admin only: which top-level `data` keys `q` searches (comma-separated, max 5).
627
+ * Default `label`. Example: `'value,label'`.
628
+ */
629
+ qFields?: string;
630
+ /**
631
+ * Admin only: filter on top-level `data` keys. Each value is an exact match, an
632
+ * `in:a,b,c` list, or an array of values (any match). Max 10 keys.
633
+ * Example: `{ versionId: 'v1', zone: 'in:on_pack,unclear' }`.
634
+ */
635
+ dataFilter?: Record<string, string | string[]>;
625
636
  authorId?: string;
626
637
  parentType?: string;
627
638
  parentId?: string;
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 2.0.31 | Generated: 2026-09-29T19:37:17.528Z
3
+ Version: 2.0.32 | Generated: 2026-10-01T17:18:44.658Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
package/openapi.yaml CHANGED
@@ -14509,6 +14509,21 @@ paths:
14509
14509
  required: false
14510
14510
  schema:
14511
14511
  type: string
14512
+ - name: qFields
14513
+ in: query
14514
+ required: false
14515
+ schema:
14516
+ type: string
14517
+ - name: dataFilter
14518
+ in: query
14519
+ required: false
14520
+ schema:
14521
+ type: object
14522
+ additionalProperties:
14523
+ type: array
14524
+ items:
14525
+ type: object
14526
+ additionalProperties: true
14512
14527
  - name: authorId
14513
14528
  in: query
14514
14529
  required: false
@@ -20052,6 +20067,15 @@ components:
20052
20067
  type: string
20053
20068
  q:
20054
20069
  type: string
20070
+ qFields:
20071
+ type: string
20072
+ dataFilter:
20073
+ type: object
20074
+ additionalProperties:
20075
+ type: array
20076
+ items:
20077
+ type: object
20078
+ additionalProperties: true
20055
20079
  authorId:
20056
20080
  type: string
20057
20081
  parentType:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "2.0.31",
3
+ "version": "2.0.32",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",