@proveanything/smartlinks 1.3.4 → 1.3.6
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/dist/api/tags.d.ts +22 -8
- package/dist/api/tags.js +34 -11
- package/docs/API_SUMMARY.md +17 -7
- package/package.json +1 -1
package/dist/api/tags.d.ts
CHANGED
|
@@ -128,12 +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 (global).
|
|
132
132
|
* Optionally embed related collection, product, or proof data.
|
|
133
133
|
* No authentication required.
|
|
134
134
|
*
|
|
135
|
-
* @param
|
|
136
|
-
* @param tagId - Unique tag identifier
|
|
135
|
+
* @param tagId - Unique tag identifier (globally unique)
|
|
137
136
|
* @param params - Optional parameters (embed)
|
|
138
137
|
* @returns Promise resolving to a PublicGetTagResponse with optional embedded data
|
|
139
138
|
* @throws ErrorResponse if the request fails
|
|
@@ -141,16 +140,21 @@ export declare namespace tags {
|
|
|
141
140
|
* @example
|
|
142
141
|
* ```typescript
|
|
143
142
|
* // Simple lookup
|
|
144
|
-
* const result = await tags.
|
|
143
|
+
* const result = await tags.getTag('TAG001')
|
|
145
144
|
*
|
|
146
145
|
* // With embedded data
|
|
147
|
-
* const withData = await tags.
|
|
146
|
+
* const withData = await tags.getTag('TAG001', {
|
|
148
147
|
* embed: 'collection,product,proof'
|
|
149
148
|
* })
|
|
150
149
|
* console.log(withData.tag, withData.collection, withData.product, withData.proof)
|
|
151
150
|
* ```
|
|
152
151
|
*/
|
|
153
|
-
function
|
|
152
|
+
function getTag(tagId: string, params?: PublicGetTagRequest): Promise<PublicGetTagResponse>;
|
|
153
|
+
/**
|
|
154
|
+
* Backward-compat: Public lookup with collectionId parameter (ignored).
|
|
155
|
+
* Calls global route under /public/tags/:tagId.
|
|
156
|
+
*/
|
|
157
|
+
function publicGet(_collectionId: string, tagId: string, params?: PublicGetTagRequest): Promise<PublicGetTagResponse>;
|
|
154
158
|
/**
|
|
155
159
|
* Public batch lookup of multiple tags in a single request (POST).
|
|
156
160
|
* Only returns tags from the specified collection.
|
|
@@ -175,7 +179,12 @@ export declare namespace tags {
|
|
|
175
179
|
* console.log(result.products)
|
|
176
180
|
* ```
|
|
177
181
|
*/
|
|
178
|
-
function
|
|
182
|
+
function lookupTags(data: PublicBatchLookupRequest): Promise<PublicBatchLookupResponse>;
|
|
183
|
+
/**
|
|
184
|
+
* Backward-compat: Public batch lookup with collectionId parameter (ignored).
|
|
185
|
+
* Calls global route under /public/tags/lookup.
|
|
186
|
+
*/
|
|
187
|
+
function publicBatchLookup(_collectionId: string, data: PublicBatchLookupRequest): Promise<PublicBatchLookupResponse>;
|
|
179
188
|
/**
|
|
180
189
|
* Public batch lookup of multiple tags using query parameters (GET).
|
|
181
190
|
* Only returns tags from the specified collection.
|
|
@@ -195,5 +204,10 @@ export declare namespace tags {
|
|
|
195
204
|
* })
|
|
196
205
|
* ```
|
|
197
206
|
*/
|
|
198
|
-
function
|
|
207
|
+
function lookupTagsQuery(params: PublicBatchLookupQueryRequest): Promise<PublicBatchLookupQueryResponse>;
|
|
208
|
+
/**
|
|
209
|
+
* Backward-compat: Public batch lookup (GET) with collectionId parameter (ignored).
|
|
210
|
+
* Calls global route under /public/tags/lookup.
|
|
211
|
+
*/
|
|
212
|
+
function publicBatchLookupQuery(_collectionId: string, params: PublicBatchLookupQueryRequest): Promise<PublicBatchLookupQueryResponse>;
|
|
199
213
|
}
|
package/dist/api/tags.js
CHANGED
|
@@ -172,12 +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 (global).
|
|
176
176
|
* Optionally embed related collection, product, or proof data.
|
|
177
177
|
* No authentication required.
|
|
178
178
|
*
|
|
179
|
-
* @param
|
|
180
|
-
* @param tagId - Unique tag identifier
|
|
179
|
+
* @param tagId - Unique tag identifier (globally unique)
|
|
181
180
|
* @param params - Optional parameters (embed)
|
|
182
181
|
* @returns Promise resolving to a PublicGetTagResponse with optional embedded data
|
|
183
182
|
* @throws ErrorResponse if the request fails
|
|
@@ -185,23 +184,31 @@ export var tags;
|
|
|
185
184
|
* @example
|
|
186
185
|
* ```typescript
|
|
187
186
|
* // Simple lookup
|
|
188
|
-
* const result = await tags.
|
|
187
|
+
* const result = await tags.getTag('TAG001')
|
|
189
188
|
*
|
|
190
189
|
* // With embedded data
|
|
191
|
-
* const withData = await tags.
|
|
190
|
+
* const withData = await tags.getTag('TAG001', {
|
|
192
191
|
* embed: 'collection,product,proof'
|
|
193
192
|
* })
|
|
194
193
|
* console.log(withData.tag, withData.collection, withData.product, withData.proof)
|
|
195
194
|
* ```
|
|
196
195
|
*/
|
|
197
|
-
async function
|
|
196
|
+
async function getTag(tagId, params) {
|
|
198
197
|
const queryParams = new URLSearchParams();
|
|
199
198
|
if (params === null || params === void 0 ? void 0 : params.embed)
|
|
200
199
|
queryParams.append('embed', params.embed);
|
|
201
200
|
const query = queryParams.toString();
|
|
202
|
-
const path = `/public/
|
|
201
|
+
const path = `/public/tags/${encodeURIComponent(tagId)}${query ? `?${query}` : ''}`;
|
|
203
202
|
return request(path);
|
|
204
203
|
}
|
|
204
|
+
tags.getTag = getTag;
|
|
205
|
+
/**
|
|
206
|
+
* Backward-compat: Public lookup with collectionId parameter (ignored).
|
|
207
|
+
* Calls global route under /public/tags/:tagId.
|
|
208
|
+
*/
|
|
209
|
+
async function publicGet(_collectionId, tagId, params) {
|
|
210
|
+
return getTag(tagId, params);
|
|
211
|
+
}
|
|
205
212
|
tags.publicGet = publicGet;
|
|
206
213
|
/**
|
|
207
214
|
* Public batch lookup of multiple tags in a single request (POST).
|
|
@@ -227,10 +234,18 @@ export var tags;
|
|
|
227
234
|
* console.log(result.products)
|
|
228
235
|
* ```
|
|
229
236
|
*/
|
|
230
|
-
async function
|
|
231
|
-
const path = `/public/
|
|
237
|
+
async function lookupTags(data) {
|
|
238
|
+
const path = `/public/tags/lookup`;
|
|
232
239
|
return post(path, data);
|
|
233
240
|
}
|
|
241
|
+
tags.lookupTags = lookupTags;
|
|
242
|
+
/**
|
|
243
|
+
* Backward-compat: Public batch lookup with collectionId parameter (ignored).
|
|
244
|
+
* Calls global route under /public/tags/lookup.
|
|
245
|
+
*/
|
|
246
|
+
async function publicBatchLookup(_collectionId, data) {
|
|
247
|
+
return lookupTags(data);
|
|
248
|
+
}
|
|
234
249
|
tags.publicBatchLookup = publicBatchLookup;
|
|
235
250
|
/**
|
|
236
251
|
* Public batch lookup of multiple tags using query parameters (GET).
|
|
@@ -251,13 +266,21 @@ export var tags;
|
|
|
251
266
|
* })
|
|
252
267
|
* ```
|
|
253
268
|
*/
|
|
254
|
-
async function
|
|
269
|
+
async function lookupTagsQuery(params) {
|
|
255
270
|
const queryParams = new URLSearchParams();
|
|
256
271
|
queryParams.append('tagIds', params.tagIds);
|
|
257
272
|
if (params.embed)
|
|
258
273
|
queryParams.append('embed', params.embed);
|
|
259
|
-
const path = `/public/
|
|
274
|
+
const path = `/public/tags/lookup?${queryParams.toString()}`;
|
|
260
275
|
return request(path);
|
|
261
276
|
}
|
|
277
|
+
tags.lookupTagsQuery = lookupTagsQuery;
|
|
278
|
+
/**
|
|
279
|
+
* Backward-compat: Public batch lookup (GET) with collectionId parameter (ignored).
|
|
280
|
+
* Calls global route under /public/tags/lookup.
|
|
281
|
+
*/
|
|
282
|
+
async function publicBatchLookupQuery(_collectionId, params) {
|
|
283
|
+
return lookupTagsQuery(params);
|
|
284
|
+
}
|
|
262
285
|
tags.publicBatchLookupQuery = publicBatchLookupQuery;
|
|
263
286
|
})(tags || (tags = {}));
|
package/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.6 | Generated: 2026-02-04T13:17:46.204Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -3506,19 +3506,29 @@ 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
|
-
**
|
|
3509
|
+
**getTag**(tagId: string,
|
|
3510
|
+
params?: PublicGetTagRequest) → `Promise<PublicGetTagResponse>`
|
|
3511
|
+
Public lookup of a single tag by tagId (global). Optionally embed related collection, product, or proof data. No authentication required. ```typescript // Simple lookup const result = await tags.getTag('TAG001') // With embedded data const withData = await tags.getTag('TAG001', { embed: 'collection,product,proof' }) console.log(withData.tag, withData.collection, withData.product, withData.proof) ```
|
|
3512
|
+
|
|
3513
|
+
**publicGet**(_collectionId: string,
|
|
3510
3514
|
tagId: string,
|
|
3511
3515
|
params?: PublicGetTagRequest) → `Promise<PublicGetTagResponse>`
|
|
3512
|
-
Public lookup
|
|
3516
|
+
Backward-compat: Public lookup with collectionId parameter (ignored). Calls global route under /public/tags/:tagId.
|
|
3513
3517
|
|
|
3514
|
-
**
|
|
3515
|
-
data: PublicBatchLookupRequest) → `Promise<PublicBatchLookupResponse>`
|
|
3518
|
+
**lookupTags**(data: PublicBatchLookupRequest) → `Promise<PublicBatchLookupResponse>`
|
|
3516
3519
|
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) ```
|
|
3517
3520
|
|
|
3518
|
-
**
|
|
3519
|
-
|
|
3521
|
+
**publicBatchLookup**(_collectionId: string,
|
|
3522
|
+
data: PublicBatchLookupRequest) → `Promise<PublicBatchLookupResponse>`
|
|
3523
|
+
Backward-compat: Public batch lookup with collectionId parameter (ignored). Calls global route under /public/tags/lookup.
|
|
3524
|
+
|
|
3525
|
+
**lookupTagsQuery**(params: PublicBatchLookupQueryRequest) → `Promise<PublicBatchLookupQueryResponse>`
|
|
3520
3526
|
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' }) ```
|
|
3521
3527
|
|
|
3528
|
+
**publicBatchLookupQuery**(_collectionId: string,
|
|
3529
|
+
params: PublicBatchLookupQueryRequest) → `Promise<PublicBatchLookupQueryResponse>`
|
|
3530
|
+
Backward-compat: Public batch lookup (GET) with collectionId parameter (ignored). Calls global route under /public/tags/lookup.
|
|
3531
|
+
|
|
3522
3532
|
### template
|
|
3523
3533
|
|
|
3524
3534
|
**getAll**(collectionId: string) → `Promise<Template[]>`
|