@proveanything/smartlinks 1.3.3 → 1.3.4

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.
@@ -128,10 +128,11 @@ export declare namespace tags {
128
128
  */
129
129
  function list(collectionId: string, params?: ListTagsRequest): Promise<ListTagsResponse>;
130
130
  /**
131
- * Public lookup of a single tag by tagId.
131
+ * Public lookup of a single tag by tagId within a specific collection.
132
132
  * Optionally embed related collection, product, or proof data.
133
133
  * No authentication required.
134
134
  *
135
+ * @param collectionId - Identifier of the collection to search within
135
136
  * @param tagId - Unique tag identifier
136
137
  * @param params - Optional parameters (embed)
137
138
  * @returns Promise resolving to a PublicGetTagResponse with optional embedded data
@@ -140,28 +141,30 @@ export declare namespace tags {
140
141
  * @example
141
142
  * ```typescript
142
143
  * // Simple lookup
143
- * const result = await tags.publicGet('TAG001')
144
+ * const result = await tags.publicGet('coll_123', 'TAG001')
144
145
  *
145
146
  * // With embedded data
146
- * const withData = await tags.publicGet('TAG001', {
147
+ * const withData = await tags.publicGet('coll_123', 'TAG001', {
147
148
  * embed: 'collection,product,proof'
148
149
  * })
149
150
  * console.log(withData.tag, withData.collection, withData.product, withData.proof)
150
151
  * ```
151
152
  */
152
- function publicGet(tagId: string, params?: PublicGetTagRequest): Promise<PublicGetTagResponse>;
153
+ function publicGet(collectionId: string, tagId: string, params?: PublicGetTagRequest): Promise<PublicGetTagResponse>;
153
154
  /**
154
155
  * Public batch lookup of multiple tags in a single request (POST).
156
+ * Only returns tags from the specified collection.
155
157
  * Optionally embed related data. Related data is deduplicated and batch-fetched.
156
158
  * No authentication required.
157
159
  *
160
+ * @param collectionId - Identifier of the collection to search within
158
161
  * @param data - Request containing array of tagIds and optional embed parameter
159
162
  * @returns Promise resolving to PublicBatchLookupResponse with deduplicated related data
160
163
  * @throws ErrorResponse if the request fails
161
164
  *
162
165
  * @example
163
166
  * ```typescript
164
- * const result = await tags.publicBatchLookup({
167
+ * const result = await tags.publicBatchLookup('coll_123', {
165
168
  * tagIds: ['TAG001', 'TAG002', 'TAG003'],
166
169
  * embed: 'collection,product'
167
170
  * })
@@ -172,23 +175,25 @@ export declare namespace tags {
172
175
  * console.log(result.products)
173
176
  * ```
174
177
  */
175
- function publicBatchLookup(data: PublicBatchLookupRequest): Promise<PublicBatchLookupResponse>;
178
+ function publicBatchLookup(collectionId: string, data: PublicBatchLookupRequest): Promise<PublicBatchLookupResponse>;
176
179
  /**
177
180
  * Public batch lookup of multiple tags using query parameters (GET).
181
+ * Only returns tags from the specified collection.
178
182
  * Alternative to publicBatchLookup for simple GET requests.
179
183
  * No authentication required.
180
184
  *
185
+ * @param collectionId - Identifier of the collection to search within
181
186
  * @param params - Query parameters with comma-separated tagIds and optional embed
182
187
  * @returns Promise resolving to PublicBatchLookupQueryResponse
183
188
  * @throws ErrorResponse if the request fails
184
189
  *
185
190
  * @example
186
191
  * ```typescript
187
- * const result = await tags.publicBatchLookupQuery({
192
+ * const result = await tags.publicBatchLookupQuery('coll_123', {
188
193
  * tagIds: 'TAG001,TAG002,TAG003',
189
194
  * embed: 'collection'
190
195
  * })
191
196
  * ```
192
197
  */
193
- function publicBatchLookupQuery(params: PublicBatchLookupQueryRequest): Promise<PublicBatchLookupQueryResponse>;
198
+ function publicBatchLookupQuery(collectionId: string, params: PublicBatchLookupQueryRequest): Promise<PublicBatchLookupQueryResponse>;
194
199
  }
package/dist/api/tags.js CHANGED
@@ -172,10 +172,11 @@ export var tags;
172
172
  // Public Endpoints
173
173
  // ============================================================================
174
174
  /**
175
- * Public lookup of a single tag by tagId.
175
+ * Public lookup of a single tag by tagId within a specific collection.
176
176
  * Optionally embed related collection, product, or proof data.
177
177
  * No authentication required.
178
178
  *
179
+ * @param collectionId - Identifier of the collection to search within
179
180
  * @param tagId - Unique tag identifier
180
181
  * @param params - Optional parameters (embed)
181
182
  * @returns Promise resolving to a PublicGetTagResponse with optional embedded data
@@ -184,36 +185,38 @@ export var tags;
184
185
  * @example
185
186
  * ```typescript
186
187
  * // Simple lookup
187
- * const result = await tags.publicGet('TAG001')
188
+ * const result = await tags.publicGet('coll_123', 'TAG001')
188
189
  *
189
190
  * // With embedded data
190
- * const withData = await tags.publicGet('TAG001', {
191
+ * const withData = await tags.publicGet('coll_123', 'TAG001', {
191
192
  * embed: 'collection,product,proof'
192
193
  * })
193
194
  * console.log(withData.tag, withData.collection, withData.product, withData.proof)
194
195
  * ```
195
196
  */
196
- async function publicGet(tagId, params) {
197
+ async function publicGet(collectionId, tagId, params) {
197
198
  const queryParams = new URLSearchParams();
198
199
  if (params === null || params === void 0 ? void 0 : params.embed)
199
200
  queryParams.append('embed', params.embed);
200
201
  const query = queryParams.toString();
201
- const path = `/public/tags/${encodeURIComponent(tagId)}${query ? `?${query}` : ''}`;
202
+ const path = `/public/collection/${encodeURIComponent(collectionId)}/tags/${encodeURIComponent(tagId)}${query ? `?${query}` : ''}`;
202
203
  return request(path);
203
204
  }
204
205
  tags.publicGet = publicGet;
205
206
  /**
206
207
  * Public batch lookup of multiple tags in a single request (POST).
208
+ * Only returns tags from the specified collection.
207
209
  * Optionally embed related data. Related data is deduplicated and batch-fetched.
208
210
  * No authentication required.
209
211
  *
212
+ * @param collectionId - Identifier of the collection to search within
210
213
  * @param data - Request containing array of tagIds and optional embed parameter
211
214
  * @returns Promise resolving to PublicBatchLookupResponse with deduplicated related data
212
215
  * @throws ErrorResponse if the request fails
213
216
  *
214
217
  * @example
215
218
  * ```typescript
216
- * const result = await tags.publicBatchLookup({
219
+ * const result = await tags.publicBatchLookup('coll_123', {
217
220
  * tagIds: ['TAG001', 'TAG002', 'TAG003'],
218
221
  * embed: 'collection,product'
219
222
  * })
@@ -224,34 +227,36 @@ export var tags;
224
227
  * console.log(result.products)
225
228
  * ```
226
229
  */
227
- async function publicBatchLookup(data) {
228
- const path = `/public/tags/lookup`;
230
+ async function publicBatchLookup(collectionId, data) {
231
+ const path = `/public/collection/${encodeURIComponent(collectionId)}/tags/lookup`;
229
232
  return post(path, data);
230
233
  }
231
234
  tags.publicBatchLookup = publicBatchLookup;
232
235
  /**
233
236
  * Public batch lookup of multiple tags using query parameters (GET).
237
+ * Only returns tags from the specified collection.
234
238
  * Alternative to publicBatchLookup for simple GET requests.
235
239
  * No authentication required.
236
240
  *
241
+ * @param collectionId - Identifier of the collection to search within
237
242
  * @param params - Query parameters with comma-separated tagIds and optional embed
238
243
  * @returns Promise resolving to PublicBatchLookupQueryResponse
239
244
  * @throws ErrorResponse if the request fails
240
245
  *
241
246
  * @example
242
247
  * ```typescript
243
- * const result = await tags.publicBatchLookupQuery({
248
+ * const result = await tags.publicBatchLookupQuery('coll_123', {
244
249
  * tagIds: 'TAG001,TAG002,TAG003',
245
250
  * embed: 'collection'
246
251
  * })
247
252
  * ```
248
253
  */
249
- async function publicBatchLookupQuery(params) {
254
+ async function publicBatchLookupQuery(collectionId, params) {
250
255
  const queryParams = new URLSearchParams();
251
256
  queryParams.append('tagIds', params.tagIds);
252
257
  if (params.embed)
253
258
  queryParams.append('embed', params.embed);
254
- const path = `/public/tags/lookup?${queryParams.toString()}`;
259
+ const path = `/public/collection/${encodeURIComponent(collectionId)}/tags/lookup?${queryParams.toString()}`;
255
260
  return request(path);
256
261
  }
257
262
  tags.publicBatchLookupQuery = publicBatchLookupQuery;
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.3.3 | Generated: 2026-02-02T14:12:19.424Z
3
+ Version: 1.3.4 | Generated: 2026-02-02T14:36:48.206Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -3506,15 +3506,18 @@ Get a single tag mapping by tagId. ```typescript const tag = await tags.get('col
3506
3506
  params?: ListTagsRequest) → `Promise<ListTagsResponse>`
3507
3507
  List all tags for a collection with optional filters and pagination. ```typescript // List all tags const all = await tags.list('coll_123') // List with filters const filtered = await tags.list('coll_123', { productId: 'prod_456', variantId: 'var_789', limit: 50, offset: 0 }) ```
3508
3508
 
3509
- **publicGet**(tagId: string,
3509
+ **publicGet**(collectionId: string,
3510
+ tagId: string,
3510
3511
  params?: PublicGetTagRequest) → `Promise<PublicGetTagResponse>`
3511
- Public lookup of a single tag by tagId. Optionally embed related collection, product, or proof data. No authentication required. ```typescript // Simple lookup const result = await tags.publicGet('TAG001') // With embedded data const withData = await tags.publicGet('TAG001', { embed: 'collection,product,proof' }) console.log(withData.tag, withData.collection, withData.product, withData.proof) ```
3512
+ Public lookup of a single tag by tagId within a specific collection. Optionally embed related collection, product, or proof data. No authentication required. ```typescript // Simple lookup const result = await tags.publicGet('coll_123', 'TAG001') // With embedded data const withData = await tags.publicGet('coll_123', 'TAG001', { embed: 'collection,product,proof' }) console.log(withData.tag, withData.collection, withData.product, withData.proof) ```
3512
3513
 
3513
- **publicBatchLookup**(data: PublicBatchLookupRequest) → `Promise<PublicBatchLookupResponse>`
3514
- Public batch lookup of multiple tags in a single request (POST). Optionally embed related data. Related data is deduplicated and batch-fetched. No authentication required. ```typescript const result = await tags.publicBatchLookup({ tagIds: ['TAG001', 'TAG002', 'TAG003'], embed: 'collection,product' }) // Access tags and deduplicated collections/products console.log(result.tags['TAG001']) console.log(result.collections) console.log(result.products) ```
3514
+ **publicBatchLookup**(collectionId: string,
3515
+ data: PublicBatchLookupRequest) `Promise<PublicBatchLookupResponse>`
3516
+ Public batch lookup of multiple tags in a single request (POST). Only returns tags from the specified collection. Optionally embed related data. Related data is deduplicated and batch-fetched. No authentication required. ```typescript const result = await tags.publicBatchLookup('coll_123', { tagIds: ['TAG001', 'TAG002', 'TAG003'], embed: 'collection,product' }) // Access tags and deduplicated collections/products console.log(result.tags['TAG001']) console.log(result.collections) console.log(result.products) ```
3515
3517
 
3516
- **publicBatchLookupQuery**(params: PublicBatchLookupQueryRequest) → `Promise<PublicBatchLookupQueryResponse>`
3517
- Public batch lookup of multiple tags using query parameters (GET). Alternative to publicBatchLookup for simple GET requests. No authentication required. ```typescript const result = await tags.publicBatchLookupQuery({ tagIds: 'TAG001,TAG002,TAG003', embed: 'collection' }) ```
3518
+ **publicBatchLookupQuery**(collectionId: string,
3519
+ params: PublicBatchLookupQueryRequest) `Promise<PublicBatchLookupQueryResponse>`
3520
+ Public batch lookup of multiple tags using query parameters (GET). Only returns tags from the specified collection. Alternative to publicBatchLookup for simple GET requests. No authentication required. ```typescript const result = await tags.publicBatchLookupQuery('coll_123', { tagIds: 'TAG001,TAG002,TAG003', embed: 'collection' }) ```
3518
3521
 
3519
3522
  ### template
3520
3523
 
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.3.3 | Generated: 2026-02-02T14:13:32.582Z
3
+ Version: 1.3.4 | Generated: 2026-02-02T14:37:47.335Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -3506,15 +3506,18 @@ Get a single tag mapping by tagId. ```typescript const tag = await tags.get('col
3506
3506
  params?: ListTagsRequest) → `Promise<ListTagsResponse>`
3507
3507
  List all tags for a collection with optional filters and pagination. ```typescript // List all tags const all = await tags.list('coll_123') // List with filters const filtered = await tags.list('coll_123', { productId: 'prod_456', variantId: 'var_789', limit: 50, offset: 0 }) ```
3508
3508
 
3509
- **publicGet**(tagId: string,
3509
+ **publicGet**(collectionId: string,
3510
+ tagId: string,
3510
3511
  params?: PublicGetTagRequest) → `Promise<PublicGetTagResponse>`
3511
- Public lookup of a single tag by tagId. Optionally embed related collection, product, or proof data. No authentication required. ```typescript // Simple lookup const result = await tags.publicGet('TAG001') // With embedded data const withData = await tags.publicGet('TAG001', { embed: 'collection,product,proof' }) console.log(withData.tag, withData.collection, withData.product, withData.proof) ```
3512
+ Public lookup of a single tag by tagId within a specific collection. Optionally embed related collection, product, or proof data. No authentication required. ```typescript // Simple lookup const result = await tags.publicGet('coll_123', 'TAG001') // With embedded data const withData = await tags.publicGet('coll_123', 'TAG001', { embed: 'collection,product,proof' }) console.log(withData.tag, withData.collection, withData.product, withData.proof) ```
3512
3513
 
3513
- **publicBatchLookup**(data: PublicBatchLookupRequest) → `Promise<PublicBatchLookupResponse>`
3514
- Public batch lookup of multiple tags in a single request (POST). Optionally embed related data. Related data is deduplicated and batch-fetched. No authentication required. ```typescript const result = await tags.publicBatchLookup({ tagIds: ['TAG001', 'TAG002', 'TAG003'], embed: 'collection,product' }) // Access tags and deduplicated collections/products console.log(result.tags['TAG001']) console.log(result.collections) console.log(result.products) ```
3514
+ **publicBatchLookup**(collectionId: string,
3515
+ data: PublicBatchLookupRequest) `Promise<PublicBatchLookupResponse>`
3516
+ Public batch lookup of multiple tags in a single request (POST). Only returns tags from the specified collection. Optionally embed related data. Related data is deduplicated and batch-fetched. No authentication required. ```typescript const result = await tags.publicBatchLookup('coll_123', { tagIds: ['TAG001', 'TAG002', 'TAG003'], embed: 'collection,product' }) // Access tags and deduplicated collections/products console.log(result.tags['TAG001']) console.log(result.collections) console.log(result.products) ```
3515
3517
 
3516
- **publicBatchLookupQuery**(params: PublicBatchLookupQueryRequest) → `Promise<PublicBatchLookupQueryResponse>`
3517
- Public batch lookup of multiple tags using query parameters (GET). Alternative to publicBatchLookup for simple GET requests. No authentication required. ```typescript const result = await tags.publicBatchLookupQuery({ tagIds: 'TAG001,TAG002,TAG003', embed: 'collection' }) ```
3518
+ **publicBatchLookupQuery**(collectionId: string,
3519
+ params: PublicBatchLookupQueryRequest) `Promise<PublicBatchLookupQueryResponse>`
3520
+ Public batch lookup of multiple tags using query parameters (GET). Only returns tags from the specified collection. Alternative to publicBatchLookup for simple GET requests. No authentication required. ```typescript const result = await tags.publicBatchLookupQuery('coll_123', { tagIds: 'TAG001,TAG002,TAG003', embed: 'collection' }) ```
3518
3521
 
3519
3522
  ### template
3520
3523
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",