@proveanything/smartlinks 1.3.34 → 1.3.35

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.
@@ -20,6 +20,24 @@ export declare namespace product {
20
20
  /**
21
21
  * Create a new product for a collection (admin only).
22
22
  * The `data` payload follows the same shape as ProductResponse minus `id` and `collectionId`.
23
+ *
24
+ * **Hero Image Auto-Fetch:**
25
+ * You can pass `heroImage` as either:
26
+ * - A full asset object: `{ url: '...', thumbnails: {...} }`
27
+ * - A string URL: The system automatically fetches and stores the image
28
+ *
29
+ * @example
30
+ * ```typescript
31
+ * // Using a URL - auto-fetched and stored
32
+ * const product = await product.create(collectionId, {
33
+ * name: 'Wine Bottle',
34
+ * description: 'Premium red wine',
35
+ * heroImage: 'https://example.com/wine.jpg', // Auto-fetched!
36
+ * tags: {},
37
+ * data: {}
38
+ * });
39
+ * ```
40
+ *
23
41
  * @param collectionId – Identifier of the parent collection
24
42
  * @param data – Product creation data (see ProductCreateRequest)
25
43
  * @returns Promise resolving to a ProductResponse object
@@ -29,6 +47,20 @@ export declare namespace product {
29
47
  /**
30
48
  * Update a product for a collection (admin only).
31
49
  * The `data` payload is a partial of ProductResponse minus `id` and `collectionId`.
50
+ *
51
+ * **Hero Image Auto-Fetch:**
52
+ * You can pass `heroImage` as either:
53
+ * - A full asset object: `{ url: '...', thumbnails: {...} }`
54
+ * - A string URL: The system automatically fetches and stores the image
55
+ *
56
+ * @example
57
+ * ```typescript
58
+ * // Update with new URL - auto-fetched and stored
59
+ * const product = await product.update(collectionId, productId, {
60
+ * heroImage: 'https://example.com/new-wine.jpg' // Auto-fetched!
61
+ * });
62
+ * ```
63
+ *
32
64
  * @param collectionId – Identifier of the parent collection
33
65
  * @param productId – Identifier of the product
34
66
  * @param data – Product update data (see ProductUpdateRequest)
@@ -32,6 +32,24 @@ export var product;
32
32
  /**
33
33
  * Create a new product for a collection (admin only).
34
34
  * The `data` payload follows the same shape as ProductResponse minus `id` and `collectionId`.
35
+ *
36
+ * **Hero Image Auto-Fetch:**
37
+ * You can pass `heroImage` as either:
38
+ * - A full asset object: `{ url: '...', thumbnails: {...} }`
39
+ * - A string URL: The system automatically fetches and stores the image
40
+ *
41
+ * @example
42
+ * ```typescript
43
+ * // Using a URL - auto-fetched and stored
44
+ * const product = await product.create(collectionId, {
45
+ * name: 'Wine Bottle',
46
+ * description: 'Premium red wine',
47
+ * heroImage: 'https://example.com/wine.jpg', // Auto-fetched!
48
+ * tags: {},
49
+ * data: {}
50
+ * });
51
+ * ```
52
+ *
35
53
  * @param collectionId – Identifier of the parent collection
36
54
  * @param data – Product creation data (see ProductCreateRequest)
37
55
  * @returns Promise resolving to a ProductResponse object
@@ -45,6 +63,20 @@ export var product;
45
63
  /**
46
64
  * Update a product for a collection (admin only).
47
65
  * The `data` payload is a partial of ProductResponse minus `id` and `collectionId`.
66
+ *
67
+ * **Hero Image Auto-Fetch:**
68
+ * You can pass `heroImage` as either:
69
+ * - A full asset object: `{ url: '...', thumbnails: {...} }`
70
+ * - A string URL: The system automatically fetches and stores the image
71
+ *
72
+ * @example
73
+ * ```typescript
74
+ * // Update with new URL - auto-fetched and stored
75
+ * const product = await product.update(collectionId, productId, {
76
+ * heroImage: 'https://example.com/new-wine.jpg' // Auto-fetched!
77
+ * });
78
+ * ```
79
+ *
48
80
  * @param collectionId – Identifier of the parent collection
49
81
  * @param productId – Identifier of the product
50
82
  * @param data – Product update data (see ProductUpdateRequest)
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.3.34 | Generated: 2026-02-16T09:46:01.466Z
3
+ Version: 1.3.35 | Generated: 2026-02-16T09:53:23.211Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -3363,6 +3363,10 @@ interface Product {
3363
3363
  description: string
3364
3364
  gtin?: string
3365
3365
  type?: string
3366
+ * Hero image asset object.
3367
+ * When creating/updating, you can pass either:
3368
+ * - A full asset object with url and thumbnails
3369
+ * - A string URL - the system will automatically fetch and store the image
3366
3370
  heroImage: {
3367
3371
  url: string
3368
3372
  thumbnails: {
@@ -3382,9 +3386,9 @@ interface Product {
3382
3386
 
3383
3387
  **ProductResponse** = `Product`
3384
3388
 
3385
- **ProductCreateRequest** = `Omit<Product, 'id' | 'collectionId'>`
3389
+ **ProductCreateRequest** = `Omit<Product, 'id' | 'collectionId'> & {`
3386
3390
 
3387
- **ProductUpdateRequest** = `Partial<Omit<Product, 'id' | 'collectionId'>>`
3391
+ **ProductUpdateRequest** = `Partial<Omit<Product, 'id' | 'collectionId'>> & {`
3388
3392
 
3389
3393
  ### proof
3390
3394
 
@@ -4778,12 +4782,12 @@ List all Product Items for a Collection.
4778
4782
 
4779
4783
  **create**(collectionId: string,
4780
4784
  data: ProductCreateRequest) → `Promise<ProductResponse>`
4781
- Create a new product for a collection (admin only). The `data` payload follows the same shape as ProductResponse minus `id` and `collectionId`.
4785
+ Create a new product for a collection (admin only). The `data` payload follows the same shape as ProductResponse minus `id` and `collectionId`. **Hero Image Auto-Fetch:** You can pass `heroImage` as either: - A full asset object: `{ url: '...', thumbnails: {...} }` - A string URL: The system automatically fetches and stores the image ```typescript // Using a URL - auto-fetched and stored const product = await product.create(collectionId, { name: 'Wine Bottle', description: 'Premium red wine', heroImage: 'https://example.com/wine.jpg', // Auto-fetched! tags: {}, data: {} }); ```
4782
4786
 
4783
4787
  **update**(collectionId: string,
4784
4788
  productId: string,
4785
4789
  data: ProductUpdateRequest) → `Promise<ProductResponse>`
4786
- Update a product for a collection (admin only). The `data` payload is a partial of ProductResponse minus `id` and `collectionId`.
4790
+ Update a product for a collection (admin only). The `data` payload is a partial of ProductResponse minus `id` and `collectionId`. **Hero Image Auto-Fetch:** You can pass `heroImage` as either: - A full asset object: `{ url: '...', thumbnails: {...} }` - A string URL: The system automatically fetches and stores the image ```typescript // Update with new URL - auto-fetched and stored const product = await product.update(collectionId, productId, { heroImage: 'https://example.com/new-wine.jpg' // Auto-fetched! }); ```
4787
4791
 
4788
4792
  **remove**(collectionId: string,
4789
4793
  productId: string) → `Promise<void>`
@@ -14,7 +14,12 @@ export interface Product {
14
14
  gtin?: string;
15
15
  /** An optional product type from the standard smartlinks types */
16
16
  type?: string;
17
- /** Hero image asset object */
17
+ /**
18
+ * Hero image asset object.
19
+ * When creating/updating, you can pass either:
20
+ * - A full asset object with url and thumbnails
21
+ * - A string URL - the system will automatically fetch and store the image
22
+ */
18
23
  heroImage: {
19
24
  /** URL to the asset */
20
25
  url: string;
@@ -35,5 +40,9 @@ export interface Product {
35
40
  };
36
41
  }
37
42
  export type ProductResponse = Product;
38
- export type ProductCreateRequest = Omit<Product, 'id' | 'collectionId'>;
39
- export type ProductUpdateRequest = Partial<Omit<Product, 'id' | 'collectionId'>>;
43
+ export type ProductCreateRequest = Omit<Product, 'id' | 'collectionId'> & {
44
+ heroImage?: Product['heroImage'] | string;
45
+ };
46
+ export type ProductUpdateRequest = Partial<Omit<Product, 'id' | 'collectionId'>> & {
47
+ heroImage?: Product['heroImage'] | string;
48
+ };
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.3.34 | Generated: 2026-02-16T09:46:01.466Z
3
+ Version: 1.3.35 | Generated: 2026-02-16T09:53:23.211Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -3363,6 +3363,10 @@ interface Product {
3363
3363
  description: string
3364
3364
  gtin?: string
3365
3365
  type?: string
3366
+ * Hero image asset object.
3367
+ * When creating/updating, you can pass either:
3368
+ * - A full asset object with url and thumbnails
3369
+ * - A string URL - the system will automatically fetch and store the image
3366
3370
  heroImage: {
3367
3371
  url: string
3368
3372
  thumbnails: {
@@ -3382,9 +3386,9 @@ interface Product {
3382
3386
 
3383
3387
  **ProductResponse** = `Product`
3384
3388
 
3385
- **ProductCreateRequest** = `Omit<Product, 'id' | 'collectionId'>`
3389
+ **ProductCreateRequest** = `Omit<Product, 'id' | 'collectionId'> & {`
3386
3390
 
3387
- **ProductUpdateRequest** = `Partial<Omit<Product, 'id' | 'collectionId'>>`
3391
+ **ProductUpdateRequest** = `Partial<Omit<Product, 'id' | 'collectionId'>> & {`
3388
3392
 
3389
3393
  ### proof
3390
3394
 
@@ -4778,12 +4782,12 @@ List all Product Items for a Collection.
4778
4782
 
4779
4783
  **create**(collectionId: string,
4780
4784
  data: ProductCreateRequest) → `Promise<ProductResponse>`
4781
- Create a new product for a collection (admin only). The `data` payload follows the same shape as ProductResponse minus `id` and `collectionId`.
4785
+ Create a new product for a collection (admin only). The `data` payload follows the same shape as ProductResponse minus `id` and `collectionId`. **Hero Image Auto-Fetch:** You can pass `heroImage` as either: - A full asset object: `{ url: '...', thumbnails: {...} }` - A string URL: The system automatically fetches and stores the image ```typescript // Using a URL - auto-fetched and stored const product = await product.create(collectionId, { name: 'Wine Bottle', description: 'Premium red wine', heroImage: 'https://example.com/wine.jpg', // Auto-fetched! tags: {}, data: {} }); ```
4782
4786
 
4783
4787
  **update**(collectionId: string,
4784
4788
  productId: string,
4785
4789
  data: ProductUpdateRequest) → `Promise<ProductResponse>`
4786
- Update a product for a collection (admin only). The `data` payload is a partial of ProductResponse minus `id` and `collectionId`.
4790
+ Update a product for a collection (admin only). The `data` payload is a partial of ProductResponse minus `id` and `collectionId`. **Hero Image Auto-Fetch:** You can pass `heroImage` as either: - A full asset object: `{ url: '...', thumbnails: {...} }` - A string URL: The system automatically fetches and stores the image ```typescript // Update with new URL - auto-fetched and stored const product = await product.update(collectionId, productId, { heroImage: 'https://example.com/new-wine.jpg' // Auto-fetched! }); ```
4787
4791
 
4788
4792
  **remove**(collectionId: string,
4789
4793
  productId: string) → `Promise<void>`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.3.34",
3
+ "version": "1.3.35",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",