@proveanything/smartlinks 1.0.38 → 1.0.39

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
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.0.38 | Generated: 2025-10-04T11:16:35.687Z
3
+ Version: 1.0.39 | Generated: 2025-10-07T14:54:51.574Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -129,6 +129,38 @@ interface AttestationUpdateRequest {
129
129
 
130
130
  **BatchUpdateRequest** = `any`
131
131
 
132
+ ### claimSet
133
+
134
+ **ClaimCodeRef** (interface)
135
+ ```typescript
136
+ interface ClaimCodeRef {
137
+ codeId: string
138
+ claimId: string
139
+ }
140
+ ```
141
+
142
+ **UpdateClaimDataRequest** (interface)
143
+ ```typescript
144
+ interface UpdateClaimDataRequest {
145
+ data: Record<string, any>
146
+ codes: ClaimCodeRef[]
147
+ }
148
+ ```
149
+
150
+ **AssignClaimsRequest** (interface)
151
+ ```typescript
152
+ interface AssignClaimsRequest {
153
+ id: string
154
+ collectionId: string
155
+ productId: string
156
+ batchId?: string
157
+ start?: number
158
+ end?: number
159
+ codeId?: string
160
+ data?: Record<string, any>
161
+ }
162
+ ```
163
+
132
164
  ### collection
133
165
 
134
166
  **CollectionResponse** (interface)
@@ -743,10 +775,10 @@ Update a claim set for a collection.
743
775
  **makeClaim**(collectionId: string, params: any) → `Promise<any>`
744
776
  Make a claim for a claim set.
745
777
 
746
- **assignClaims**(collectionId: string, data: any) → `Promise<any>`
747
- Assign claims to a claim set.
778
+ **assignClaims**(collectionId: string, data: AssignClaimsRequest) → `Promise<any>`
779
+ Assign claims to a claim set. { id: string, // claim set id (required) collectionId: string,// required productId: string, // required batchId?: string, // optional start?: number, // optional bulk range start end?: number, // optional bulk range end codeId?: string, // optional single code data?: { [k: string]: any } // optional claim key/values }
748
780
 
749
- **updateClaimData**(collectionId: string, data: any) → `Promise<any>`
781
+ **updateClaimData**(collectionId: string, data: UpdateClaimDataRequest) → `Promise<any>`
750
782
  Update claim data for a collection.
751
783
 
752
784
  **getAllForCollection**(collectionId: string) → `Promise<any[]>`
@@ -779,10 +811,10 @@ Update a claim set for a collection.
779
811
  **makeClaim**(collectionId: string, params: any) → `Promise<any>`
780
812
  Make a claim for a claim set.
781
813
 
782
- **assignClaims**(collectionId: string, data: any) → `Promise<any>`
783
- Assign claims to a claim set.
814
+ **assignClaims**(collectionId: string, data: AssignClaimsRequest) → `Promise<any>`
815
+ Assign claims to a claim set. { id: string, // claim set id (required) collectionId: string,// required productId: string, // required batchId?: string, // optional start?: number, // optional bulk range start end?: number, // optional bulk range end codeId?: string, // optional single code data?: { [k: string]: any } // optional claim key/values }
784
816
 
785
- **updateClaimData**(collectionId: string, data: any) → `Promise<any>`
817
+ **updateClaimData**(collectionId: string, data: UpdateClaimDataRequest) → `Promise<any>`
786
818
  Update claim data for a collection.
787
819
 
788
820
  ### collection
@@ -793,6 +825,12 @@ Retrieves a single Collection by its ID.
793
825
  **list**(admin?: boolean) → `Promise<CollectionResponse[]>`
794
826
  Retrieves all Collections.
795
827
 
828
+ **getShortId**(shortId: string) → `Promise<CollectionResponse>`
829
+ Retrieve a collection by its shortId (public endpoint).
830
+
831
+ **getSettings**(collectionId: string, settingGroup: string) → `Promise<any>`
832
+ Retrieve a specific settings group for a collection (public endpoint).
833
+
796
834
  **create**(data: any) → `Promise<CollectionResponse>`
797
835
  Create a new collection (admin only).
798
836
 
@@ -822,6 +860,12 @@ Retrieves a single Collection by its ID.
822
860
  **list**(admin?: boolean) → `Promise<CollectionResponse[]>`
823
861
  Retrieves all Collections.
824
862
 
863
+ **getShortId**(shortId: string) → `Promise<CollectionResponse>`
864
+ Retrieve a collection by its shortId (public endpoint).
865
+
866
+ **getSettings**(collectionId: string, settingGroup: string) → `Promise<any>`
867
+ Retrieve a specific settings group for a collection (public endpoint).
868
+
825
869
  **create**(data: any) → `Promise<CollectionResponse>`
826
870
  Create a new collection (admin only).
827
871
 
@@ -1,3 +1,4 @@
1
+ import { UpdateClaimDataRequest, AssignClaimsRequest } from "../types";
1
2
  export declare namespace claimSet {
2
3
  /**
3
4
  * Get all claim sets for a collection.
@@ -71,12 +72,22 @@ export declare namespace claimSet {
71
72
  * Assign claims to a claim set.
72
73
  * @param collectionId – The collection identifier
73
74
  * @param data – The claims data to assign
75
+ * {
76
+ * id: string, // claim set id (required)
77
+ * collectionId: string,// required
78
+ * productId: string, // required
79
+ * batchId?: string, // optional
80
+ * start?: number, // optional bulk range start
81
+ * end?: number, // optional bulk range end
82
+ * codeId?: string, // optional single code
83
+ * data?: { [k: string]: any } // optional claim key/values
84
+ * }
74
85
  */
75
- function assignClaims(collectionId: string, data: any): Promise<any>;
86
+ function assignClaims(collectionId: string, data: AssignClaimsRequest): Promise<any>;
76
87
  /**
77
88
  * Update claim data for a collection.
78
89
  * @param collectionId – The collection identifier
79
90
  * @param data – The claim data to update
80
91
  */
81
- function updateClaimData(collectionId: string, data: any): Promise<any>;
92
+ function updateClaimData(collectionId: string, data: UpdateClaimDataRequest): Promise<any>;
82
93
  }
@@ -113,6 +113,16 @@ export var claimSet;
113
113
  * Assign claims to a claim set.
114
114
  * @param collectionId – The collection identifier
115
115
  * @param data – The claims data to assign
116
+ * {
117
+ * id: string, // claim set id (required)
118
+ * collectionId: string,// required
119
+ * productId: string, // required
120
+ * batchId?: string, // optional
121
+ * start?: number, // optional bulk range start
122
+ * end?: number, // optional bulk range end
123
+ * codeId?: string, // optional single code
124
+ * data?: { [k: string]: any } // optional claim key/values
125
+ * }
116
126
  */
117
127
  async function assignClaims(collectionId, data) {
118
128
  const path = `/admin/collection/${encodeURIComponent(collectionId)}/claimSet/${encodeURIComponent(data.id)}/assignClaims`;
@@ -15,6 +15,19 @@ export declare namespace collection {
15
15
  * @throws ErrorResponse if the request fails
16
16
  */
17
17
  function list(admin?: boolean): Promise<CollectionResponse[]>;
18
+ /**
19
+ * Retrieve a collection by its shortId (public endpoint).
20
+ * @param shortId – The short identifier of the collection
21
+ * @returns Promise resolving to a CollectionResponse object
22
+ */
23
+ function getShortId(shortId: string): Promise<CollectionResponse>;
24
+ /**
25
+ * Retrieve a specific settings group for a collection (public endpoint).
26
+ * @param collectionId – Identifier of the collection
27
+ * @param settingGroup – The settings group name
28
+ * @returns Promise resolving to the settings object
29
+ */
30
+ function getSettings(collectionId: string, settingGroup: string): Promise<any>;
18
31
  /**
19
32
  * Create a new collection (admin only).
20
33
  * @param data – Collection creation data
@@ -27,6 +27,27 @@ export var collection;
27
27
  return request(path);
28
28
  }
29
29
  collection.list = list;
30
+ /**
31
+ * Retrieve a collection by its shortId (public endpoint).
32
+ * @param shortId – The short identifier of the collection
33
+ * @returns Promise resolving to a CollectionResponse object
34
+ */
35
+ async function getShortId(shortId) {
36
+ const path = `/public/collection/getShortId/${encodeURIComponent(shortId)}`;
37
+ return request(path);
38
+ }
39
+ collection.getShortId = getShortId;
40
+ /**
41
+ * Retrieve a specific settings group for a collection (public endpoint).
42
+ * @param collectionId – Identifier of the collection
43
+ * @param settingGroup – The settings group name
44
+ * @returns Promise resolving to the settings object
45
+ */
46
+ async function getSettings(collectionId, settingGroup) {
47
+ const path = `/public/collection/${encodeURIComponent(collectionId)}/settings/${encodeURIComponent(settingGroup)}`;
48
+ return request(path);
49
+ }
50
+ collection.getSettings = getSettings;
30
51
  /**
31
52
  * Create a new collection (admin only).
32
53
  * @param data – Collection creation data
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Reference to a specific claim attached to a code/tag.
3
+ */
4
+ export interface ClaimCodeRef {
5
+ /** Identifier of the code (e.g., tag or QR code) */
6
+ codeId: string;
7
+ /** Identifier of the claim within the claim set */
8
+ claimId: string;
9
+ }
10
+ /**
11
+ * Request body for updating claim data on a claim set.
12
+ * Contains arbitrary key/value pairs and a list of code+claim references to update.
13
+ */
14
+ export interface UpdateClaimDataRequest {
15
+ /** Arbitrary key/value pairs for the claim data update */
16
+ data: Record<string, any>;
17
+ /** Array of code+claim references affected by this update */
18
+ codes: ClaimCodeRef[];
19
+ }
20
+ /**
21
+ * Request body for assigning claims to codes or ranges within a collection.
22
+ */
23
+ export interface AssignClaimsRequest {
24
+ /** The claim set ID (required) */
25
+ id: string;
26
+ /** The collection ID (required) */
27
+ collectionId: string;
28
+ /** The product ID (required) */
29
+ productId: string;
30
+ /** Optional batch identifier */
31
+ batchId?: string;
32
+ /** Optional start index for bulk assignment */
33
+ start?: number;
34
+ /** Optional end index for bulk assignment */
35
+ end?: number;
36
+ /** Optional single code identifier for single assignment */
37
+ codeId?: string;
38
+ /** Optional key/value pairs to set on the claim */
39
+ data?: Record<string, any>;
40
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -6,3 +6,4 @@ export * from "./error";
6
6
  export * from "./asset";
7
7
  export * from "./batch";
8
8
  export * from "./variant";
9
+ export * from "./claimSet";
@@ -8,3 +8,4 @@ export * from "./error";
8
8
  export * from "./asset";
9
9
  export * from "./batch";
10
10
  export * from "./variant";
11
+ export * from "./claimSet";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.0.38",
3
+ "version": "1.0.39",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",