@proveanything/smartlinks 1.13.9 → 1.13.10

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.
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.13.9 | Generated: 2026-05-12T11:17:48.753Z
3
+ Version: 1.13.10 | Generated: 2026-05-12T16:12:33.784Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -6689,13 +6689,6 @@ interface ProductFacetValue {
6689
6689
  }
6690
6690
  ```
6691
6691
 
6692
- **ProductFacetMap** (interface)
6693
- ```typescript
6694
- interface ProductFacetMap {
6695
- [facetKey: string]: ProductFacetValue[]
6696
- }
6697
- ```
6698
-
6699
6692
  **ProductQueryRequest** (interface)
6700
6693
  ```typescript
6701
6694
  interface ProductQueryRequest {
@@ -6782,6 +6775,8 @@ interface ProductQueryResponse {
6782
6775
 
6783
6776
  **ISODateString** = `string`
6784
6777
 
6778
+ **ProductFacetMap** = `Record<string, string[]>`
6779
+
6785
6780
  **ProductClaimCreateRequestBody** = `Omit<ProductClaimCreateInput, 'collectionId' | 'id'>`
6786
6781
 
6787
6782
  **ProductResponse** = `Product`
@@ -7522,18 +7517,14 @@ interface UserInfo {
7522
7517
  interface ProductInfo {
7523
7518
  id: string
7524
7519
  tags?: Record<string, any>
7525
- * Facet values assigned to this product.
7526
- * Shape mirrors `ProductFacetMap`: a map of facet key array of value objects.
7527
- * Each value object must have at minimum a `key` string property.
7520
+ * Facet assignments on this product: maps each facet key to an array of assigned
7521
+ * value slugs/keys. Matches the slim shape returned by the Products API.
7528
7522
  *
7529
7523
  * @example
7530
7524
  * ```ts
7531
- * {
7532
- * material: [{ key: 'cotton', name: 'Cotton' }],
7533
- * certifications: [{ key: 'organic', name: 'Organic' }, { key: 'recycled', name: 'Recycled' }]
7534
- * }
7525
+ * { material: ['cotton'], certifications: ['organic', 'recycled'] }
7535
7526
  * ```
7536
- facets?: Record<string, Array<{ key: string; [k: string]: unknown }>>
7527
+ facets?: Record<string, string[]>
7537
7528
  }
7538
7529
  ```
7539
7530
 
package/dist/openapi.yaml CHANGED
@@ -23108,9 +23108,6 @@ components:
23108
23108
  required:
23109
23109
  - key
23110
23110
  - name
23111
- ProductFacetMap:
23112
- type: object
23113
- properties: {}
23114
23111
  ProductQueryRequest:
23115
23112
  type: object
23116
23113
  properties:
@@ -15,6 +15,10 @@ export interface AdditionalGtin {
15
15
  gtin: string;
16
16
  owner?: boolean | null;
17
17
  }
18
+ /**
19
+ * Full facet value definition — returned by the Facets API.
20
+ * Not embedded in product responses; use ProductFacetMap for product-level assignments.
21
+ */
18
22
  export interface ProductFacetValue {
19
23
  id?: string;
20
24
  key: string;
@@ -25,9 +29,14 @@ export interface ProductFacetValue {
25
29
  color?: string;
26
30
  icon?: string;
27
31
  }
28
- export interface ProductFacetMap {
29
- [facetKey: string]: ProductFacetValue[];
30
- }
32
+ /**
33
+ * Slim facet assignments on a product: maps each facet key to an array of assigned
34
+ * value slugs/keys. Full value metadata lives in the Facets API.
35
+ *
36
+ * @example
37
+ * { type: ['website'], certifications: ['organic', 'recycled'] }
38
+ */
39
+ export type ProductFacetMap = Record<string, string[]>;
31
40
  export interface ProductQueryRequest {
32
41
  query?: {
33
42
  search?: string;
@@ -219,22 +219,15 @@ export interface ProductInfo {
219
219
  id: string;
220
220
  tags?: Record<string, any>;
221
221
  /**
222
- * Facet values assigned to this product.
223
- * Shape mirrors `ProductFacetMap`: a map of facet key array of value objects.
224
- * Each value object must have at minimum a `key` string property.
222
+ * Facet assignments on this product: maps each facet key to an array of assigned
223
+ * value slugs/keys. Matches the slim shape returned by the Products API.
225
224
  *
226
225
  * @example
227
226
  * ```ts
228
- * {
229
- * material: [{ key: 'cotton', name: 'Cotton' }],
230
- * certifications: [{ key: 'organic', name: 'Organic' }, { key: 'recycled', name: 'Recycled' }]
231
- * }
227
+ * { material: ['cotton'], certifications: ['organic', 'recycled'] }
232
228
  * ```
233
229
  */
234
- facets?: Record<string, Array<{
235
- key: string;
236
- [k: string]: unknown;
237
- }>>;
230
+ facets?: Record<string, string[]>;
238
231
  }
239
232
  /**
240
233
  * Proof information for condition validation
@@ -753,20 +753,19 @@ async function validateFacet(condition, params) {
753
753
  context: { facetKey, matchMode },
754
754
  };
755
755
  }
756
- const assigned = (_c = facets === null || facets === void 0 ? void 0 : facets[facetKey]) !== null && _c !== void 0 ? _c : [];
757
- const assignedKeys = assigned.map(v => v.key);
756
+ const assignedKeys = (_c = facets === null || facets === void 0 ? void 0 : facets[facetKey]) !== null && _c !== void 0 ? _c : [];
758
757
  // Presence-only modes — ignore `values`
759
758
  if (matchMode === 'hasFacet') {
760
759
  return {
761
760
  passed: assignedKeys.length > 0,
762
- detail: `Product ${assigned.length > 0 ? 'has' : 'does not have'} values on facet '${facetKey}'.`,
761
+ detail: `Product ${assignedKeys.length > 0 ? 'has' : 'does not have'} values on facet '${facetKey}'.`,
763
762
  context: { facetKey, assignedKeys },
764
763
  };
765
764
  }
766
765
  if (matchMode === 'notHasFacet') {
767
766
  return {
768
767
  passed: assignedKeys.length === 0,
769
- detail: `Product ${assigned.length === 0 ? 'has no' : 'has'} values on facet '${facetKey}'.`,
768
+ detail: `Product ${assignedKeys.length === 0 ? 'has no' : 'has'} values on facet '${facetKey}'.`,
770
769
  context: { facetKey, assignedKeys },
771
770
  };
772
771
  }
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.13.9 | Generated: 2026-05-12T11:17:48.753Z
3
+ Version: 1.13.10 | Generated: 2026-05-12T16:12:33.784Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -6689,13 +6689,6 @@ interface ProductFacetValue {
6689
6689
  }
6690
6690
  ```
6691
6691
 
6692
- **ProductFacetMap** (interface)
6693
- ```typescript
6694
- interface ProductFacetMap {
6695
- [facetKey: string]: ProductFacetValue[]
6696
- }
6697
- ```
6698
-
6699
6692
  **ProductQueryRequest** (interface)
6700
6693
  ```typescript
6701
6694
  interface ProductQueryRequest {
@@ -6782,6 +6775,8 @@ interface ProductQueryResponse {
6782
6775
 
6783
6776
  **ISODateString** = `string`
6784
6777
 
6778
+ **ProductFacetMap** = `Record<string, string[]>`
6779
+
6785
6780
  **ProductClaimCreateRequestBody** = `Omit<ProductClaimCreateInput, 'collectionId' | 'id'>`
6786
6781
 
6787
6782
  **ProductResponse** = `Product`
@@ -7522,18 +7517,14 @@ interface UserInfo {
7522
7517
  interface ProductInfo {
7523
7518
  id: string
7524
7519
  tags?: Record<string, any>
7525
- * Facet values assigned to this product.
7526
- * Shape mirrors `ProductFacetMap`: a map of facet key array of value objects.
7527
- * Each value object must have at minimum a `key` string property.
7520
+ * Facet assignments on this product: maps each facet key to an array of assigned
7521
+ * value slugs/keys. Matches the slim shape returned by the Products API.
7528
7522
  *
7529
7523
  * @example
7530
7524
  * ```ts
7531
- * {
7532
- * material: [{ key: 'cotton', name: 'Cotton' }],
7533
- * certifications: [{ key: 'organic', name: 'Organic' }, { key: 'recycled', name: 'Recycled' }]
7534
- * }
7525
+ * { material: ['cotton'], certifications: ['organic', 'recycled'] }
7535
7526
  * ```
7536
- facets?: Record<string, Array<{ key: string; [k: string]: unknown }>>
7527
+ facets?: Record<string, string[]>
7537
7528
  }
7538
7529
  ```
7539
7530
 
package/openapi.yaml CHANGED
@@ -23108,9 +23108,6 @@ components:
23108
23108
  required:
23109
23109
  - key
23110
23110
  - name
23111
- ProductFacetMap:
23112
- type: object
23113
- properties: {}
23114
23111
  ProductQueryRequest:
23115
23112
  type: object
23116
23113
  properties:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.13.9",
3
+ "version": "1.13.10",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",