@proveanything/smartlinks 1.0.33 → 1.0.34

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/API_SUMMARY.md CHANGED
@@ -207,6 +207,10 @@ interface ProductResponse {
207
207
  }
208
208
  ```
209
209
 
210
+ **ProductCreateRequest** = `Omit<ProductResponse, 'id' | 'collectionId'>`
211
+
212
+ **ProductUpdateRequest** = `Partial<Omit<ProductResponse, 'id' | 'collectionId'>>`
213
+
210
214
  ### proof
211
215
 
212
216
  **ProofResponse** (interface)
@@ -806,13 +810,13 @@ Retrieves a single Product Item by Collection ID and Product ID.
806
810
  List all Product Items for a Collection.
807
811
 
808
812
  **create**(collectionId: string,
809
- data: any) → `Promise<ProductResponse>`
810
- Create a new product for a collection (admin only).
813
+ data: ProductCreateRequest) → `Promise<ProductResponse>`
814
+ Create a new product for a collection (admin only). The `data` payload follows the same shape as ProductResponse minus `id` and `collectionId`.
811
815
 
812
816
  **update**(collectionId: string,
813
817
  productId: string,
814
- data: any) → `Promise<ProductResponse>`
815
- Update a product for a collection (admin only).
818
+ data: ProductUpdateRequest) → `Promise<ProductResponse>`
819
+ Update a product for a collection (admin only). The `data` payload is a partial of ProductResponse minus `id` and `collectionId`.
816
820
 
817
821
  **remove**(collectionId: string,
818
822
  productId: string) → `Promise<void>`
@@ -839,13 +843,13 @@ Retrieves a single Product Item by Collection ID and Product ID.
839
843
  List all Product Items for a Collection.
840
844
 
841
845
  **create**(collectionId: string,
842
- data: any) → `Promise<ProductResponse>`
843
- Create a new product for a collection (admin only).
846
+ data: ProductCreateRequest) → `Promise<ProductResponse>`
847
+ Create a new product for a collection (admin only). The `data` payload follows the same shape as ProductResponse minus `id` and `collectionId`.
844
848
 
845
849
  **update**(collectionId: string,
846
850
  productId: string,
847
- data: any) → `Promise<ProductResponse>`
848
- Update a product for a collection (admin only).
851
+ data: ProductUpdateRequest) → `Promise<ProductResponse>`
852
+ Update a product for a collection (admin only). The `data` payload is a partial of ProductResponse minus `id` and `collectionId`.
849
853
 
850
854
  **remove**(collectionId: string,
851
855
  productId: string) → `Promise<void>`
@@ -1,4 +1,4 @@
1
- import { ProductResponse } from "../types/product";
1
+ import { ProductResponse, ProductCreateRequest, ProductUpdateRequest } from "../types/product";
2
2
  export declare namespace product {
3
3
  /**
4
4
  * Retrieves a single Product Item by Collection ID and Product ID.
@@ -19,21 +19,23 @@ export declare namespace product {
19
19
  function list(collectionId: string, admin?: boolean): Promise<ProductResponse[]>;
20
20
  /**
21
21
  * Create a new product for a collection (admin only).
22
+ * The `data` payload follows the same shape as ProductResponse minus `id` and `collectionId`.
22
23
  * @param collectionId – Identifier of the parent collection
23
- * @param data – Product creation data
24
+ * @param data – Product creation data (see ProductCreateRequest)
24
25
  * @returns Promise resolving to a ProductResponse object
25
26
  * @throws ErrorResponse if the request fails
26
27
  */
27
- function create(collectionId: string, data: any): Promise<ProductResponse>;
28
+ function create(collectionId: string, data: ProductCreateRequest): Promise<ProductResponse>;
28
29
  /**
29
30
  * Update a product for a collection (admin only).
31
+ * The `data` payload is a partial of ProductResponse minus `id` and `collectionId`.
30
32
  * @param collectionId – Identifier of the parent collection
31
33
  * @param productId – Identifier of the product
32
- * @param data – Product update data
34
+ * @param data – Product update data (see ProductUpdateRequest)
33
35
  * @returns Promise resolving to a ProductResponse object
34
36
  * @throws ErrorResponse if the request fails
35
37
  */
36
- function update(collectionId: string, productId: string, data: any): Promise<ProductResponse>;
38
+ function update(collectionId: string, productId: string, data: ProductUpdateRequest): Promise<ProductResponse>;
37
39
  /**
38
40
  * Delete a product for a collection (admin only).
39
41
  * @param collectionId – Identifier of the parent collection
@@ -31,8 +31,9 @@ export var product;
31
31
  product.list = list;
32
32
  /**
33
33
  * Create a new product for a collection (admin only).
34
+ * The `data` payload follows the same shape as ProductResponse minus `id` and `collectionId`.
34
35
  * @param collectionId – Identifier of the parent collection
35
- * @param data – Product creation data
36
+ * @param data – Product creation data (see ProductCreateRequest)
36
37
  * @returns Promise resolving to a ProductResponse object
37
38
  * @throws ErrorResponse if the request fails
38
39
  */
@@ -43,9 +44,10 @@ export var product;
43
44
  product.create = create;
44
45
  /**
45
46
  * Update a product for a collection (admin only).
47
+ * The `data` payload is a partial of ProductResponse minus `id` and `collectionId`.
46
48
  * @param collectionId – Identifier of the parent collection
47
49
  * @param productId – Identifier of the product
48
- * @param data – Product update data
50
+ * @param data – Product update data (see ProductUpdateRequest)
49
51
  * @returns Promise resolving to a ProductResponse object
50
52
  * @throws ErrorResponse if the request fails
51
53
  */
package/dist/index.d.ts CHANGED
@@ -6,3 +6,4 @@ export type { AttestationResponse, AttestationCreateRequest, AttestationUpdateRe
6
6
  export type { BatchResponse, BatchCreateRequest, BatchUpdateRequest, } from "./types/batch";
7
7
  export type { VariantResponse, VariantCreateRequest, VariantUpdateRequest, } from "./types/variant";
8
8
  export type { AppConfigOptions } from "./api/appConfiguration";
9
+ export type { ProductCreateRequest, ProductUpdateRequest, } from "./types/product";
@@ -30,3 +30,5 @@ export interface ProductResponse {
30
30
  [key: string]: any;
31
31
  };
32
32
  }
33
+ export type ProductCreateRequest = Omit<ProductResponse, 'id' | 'collectionId'>;
34
+ export type ProductUpdateRequest = Partial<Omit<ProductResponse, 'id' | 'collectionId'>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.0.33",
3
+ "version": "1.0.34",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",