@proveanything/smartlinks 1.14.17 → 1.15.0
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/README.md +2 -1
- package/dist/api/products.d.ts +20 -1
- package/dist/api/products.js +22 -2
- package/dist/docs/API_SUMMARY.md +13 -2
- package/dist/openapi.yaml +0 -33
- package/docs/API_SUMMARY.md +13 -2
- package/openapi.yaml +0 -33
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -123,7 +123,8 @@ import { products } from '@proveanything/smartlinks'
|
|
|
123
123
|
|
|
124
124
|
await products.get(collectionId, productId, false)
|
|
125
125
|
await products.list(collectionId, false)
|
|
126
|
-
await products.query(collectionId, { query: { search: 'cabernet' } })
|
|
126
|
+
await products.query(collectionId, { query: { search: 'cabernet' } }) // public
|
|
127
|
+
await products.query(collectionId, { query: { search: 'cabernet' } }, true) // admin
|
|
127
128
|
```
|
|
128
129
|
|
|
129
130
|
Quick mapping:
|
package/dist/api/products.d.ts
CHANGED
|
@@ -5,7 +5,26 @@ export declare namespace products {
|
|
|
5
5
|
function create(collectionId: string, data: ProductCreateRequest): Promise<ProductResponse>;
|
|
6
6
|
function update(collectionId: string, productId: string, data: ProductUpdateRequest): Promise<ProductResponse>;
|
|
7
7
|
function remove(collectionId: string, productId: string): Promise<void>;
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Query products in a collection with filtering, sorting, and pagination.
|
|
10
|
+
*
|
|
11
|
+
* @param collectionId - Identifier of the parent collection
|
|
12
|
+
* @param body - Query parameters with filters, sorting, and pagination
|
|
13
|
+
* @param admin - When `true`, targets the `/admin` endpoint (requires an
|
|
14
|
+
* authenticated admin context). Defaults to `false`, which targets the
|
|
15
|
+
* `/public` endpoint — consistent with `get`, `list`, and `listAssets`.
|
|
16
|
+
* @returns Promise resolving to a ProductQueryResponse
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* // Public query (default)
|
|
21
|
+
* await products.query(collectionId, { query: { search: 'cabernet' } })
|
|
22
|
+
*
|
|
23
|
+
* // Admin query (authenticated)
|
|
24
|
+
* await products.query(collectionId, { query: { search: 'cabernet' } }, true)
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
function query(collectionId: string, body: ProductQueryRequest, admin?: boolean): Promise<ProductQueryResponse>;
|
|
9
28
|
function clone(collectionId: string, productId: string, body?: Record<string, JsonValue>): Promise<ProductResponse>;
|
|
10
29
|
function listAssets(collectionId: string, productId: string, admin?: boolean): Promise<unknown>;
|
|
11
30
|
function createClaimWindow(collectionId: string, productId: string, body: Record<string, JsonValue>): Promise<unknown>;
|
package/dist/api/products.js
CHANGED
|
@@ -28,8 +28,28 @@ export var products;
|
|
|
28
28
|
return del(path);
|
|
29
29
|
}
|
|
30
30
|
products.remove = remove;
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Query products in a collection with filtering, sorting, and pagination.
|
|
33
|
+
*
|
|
34
|
+
* @param collectionId - Identifier of the parent collection
|
|
35
|
+
* @param body - Query parameters with filters, sorting, and pagination
|
|
36
|
+
* @param admin - When `true`, targets the `/admin` endpoint (requires an
|
|
37
|
+
* authenticated admin context). Defaults to `false`, which targets the
|
|
38
|
+
* `/public` endpoint — consistent with `get`, `list`, and `listAssets`.
|
|
39
|
+
* @returns Promise resolving to a ProductQueryResponse
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* // Public query (default)
|
|
44
|
+
* await products.query(collectionId, { query: { search: 'cabernet' } })
|
|
45
|
+
*
|
|
46
|
+
* // Admin query (authenticated)
|
|
47
|
+
* await products.query(collectionId, { query: { search: 'cabernet' } }, true)
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
async function query(collectionId, body, admin) {
|
|
51
|
+
const base = admin ? '/admin' : '/public';
|
|
52
|
+
const path = `${base}/collection/${encodeURIComponent(collectionId)}/products/query`;
|
|
33
53
|
return post(path, body);
|
|
34
54
|
}
|
|
35
55
|
products.query = query;
|
package/dist/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.15.0 | Generated: 2026-06-03T10:03:05.999Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -9399,44 +9399,55 @@ Look up a serial number by code for a product (admin only).
|
|
|
9399
9399
|
productId: string) → `Promise<void>`
|
|
9400
9400
|
|
|
9401
9401
|
**query**(collectionId: string,
|
|
9402
|
-
body: ProductQueryRequest
|
|
9402
|
+
body: ProductQueryRequest,
|
|
9403
|
+
admin?: boolean) → `Promise<ProductQueryResponse>`
|
|
9404
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9403
9405
|
|
|
9404
9406
|
**clone**(collectionId: string,
|
|
9405
9407
|
productId: string,
|
|
9406
9408
|
body: Record<string, JsonValue> = {}) → `Promise<ProductResponse>`
|
|
9409
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9407
9410
|
|
|
9408
9411
|
**listAssets**(collectionId: string,
|
|
9409
9412
|
productId: string,
|
|
9410
9413
|
admin?: boolean) → `Promise<unknown>`
|
|
9414
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9411
9415
|
|
|
9412
9416
|
**createClaimWindow**(collectionId: string,
|
|
9413
9417
|
productId: string,
|
|
9414
9418
|
body: Record<string, JsonValue>) → `Promise<unknown>`
|
|
9419
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9415
9420
|
|
|
9416
9421
|
**updateClaimWindow**(collectionId: string,
|
|
9417
9422
|
productId: string,
|
|
9418
9423
|
claimId: string,
|
|
9419
9424
|
body: Record<string, JsonValue>) → `Promise<unknown>`
|
|
9425
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9420
9426
|
|
|
9421
9427
|
**refresh**(collectionId: string,
|
|
9422
9428
|
productId: string) → `Promise<ProductResponse>`
|
|
9429
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9423
9430
|
|
|
9424
9431
|
**getSN**(collectionId: string,
|
|
9425
9432
|
productId: string,
|
|
9426
9433
|
startIndex: number = 0,
|
|
9427
9434
|
count: number = 10) → `Promise<unknown>`
|
|
9435
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9428
9436
|
|
|
9429
9437
|
**lookupSN**(collectionId: string,
|
|
9430
9438
|
productId: string,
|
|
9431
9439
|
codeId: string) → `Promise<unknown>`
|
|
9440
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9432
9441
|
|
|
9433
9442
|
**publicLookupClaim**(collectionId: string,
|
|
9434
9443
|
productId: string,
|
|
9435
9444
|
claimId: string) → `Promise<unknown>`
|
|
9445
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9436
9446
|
|
|
9437
9447
|
**publicCreateClaim**(collectionId: string,
|
|
9438
9448
|
productId: string,
|
|
9439
9449
|
body: ProductClaimCreateRequestBody) → `Promise<unknown>`
|
|
9450
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9440
9451
|
|
|
9441
9452
|
### proof
|
|
9442
9453
|
|
package/dist/openapi.yaml
CHANGED
|
@@ -6639,39 +6639,6 @@ paths:
|
|
|
6639
6639
|
application/json:
|
|
6640
6640
|
schema:
|
|
6641
6641
|
$ref: "#/components/schemas/ProductCreateRequest"
|
|
6642
|
-
/admin/collection/{collectionId}/products/query:
|
|
6643
|
-
post:
|
|
6644
|
-
tags:
|
|
6645
|
-
- products
|
|
6646
|
-
summary: products.query
|
|
6647
|
-
operationId: products_query
|
|
6648
|
-
security:
|
|
6649
|
-
- bearerAuth: []
|
|
6650
|
-
parameters:
|
|
6651
|
-
- name: collectionId
|
|
6652
|
-
in: path
|
|
6653
|
-
required: true
|
|
6654
|
-
schema:
|
|
6655
|
-
type: string
|
|
6656
|
-
responses:
|
|
6657
|
-
200:
|
|
6658
|
-
description: Success
|
|
6659
|
-
content:
|
|
6660
|
-
application/json:
|
|
6661
|
-
schema:
|
|
6662
|
-
$ref: "#/components/schemas/ProductQueryResponse"
|
|
6663
|
-
400:
|
|
6664
|
-
description: Bad request
|
|
6665
|
-
401:
|
|
6666
|
-
description: Unauthorized
|
|
6667
|
-
404:
|
|
6668
|
-
description: Not found
|
|
6669
|
-
requestBody:
|
|
6670
|
-
required: true
|
|
6671
|
-
content:
|
|
6672
|
-
application/json:
|
|
6673
|
-
schema:
|
|
6674
|
-
$ref: "#/components/schemas/ProductQueryRequest"
|
|
6675
6642
|
/admin/collection/{collectionId}/products/{productId}:
|
|
6676
6643
|
put:
|
|
6677
6644
|
tags:
|
package/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.15.0 | Generated: 2026-06-03T10:03:05.999Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -9399,44 +9399,55 @@ Look up a serial number by code for a product (admin only).
|
|
|
9399
9399
|
productId: string) → `Promise<void>`
|
|
9400
9400
|
|
|
9401
9401
|
**query**(collectionId: string,
|
|
9402
|
-
body: ProductQueryRequest
|
|
9402
|
+
body: ProductQueryRequest,
|
|
9403
|
+
admin?: boolean) → `Promise<ProductQueryResponse>`
|
|
9404
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9403
9405
|
|
|
9404
9406
|
**clone**(collectionId: string,
|
|
9405
9407
|
productId: string,
|
|
9406
9408
|
body: Record<string, JsonValue> = {}) → `Promise<ProductResponse>`
|
|
9409
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9407
9410
|
|
|
9408
9411
|
**listAssets**(collectionId: string,
|
|
9409
9412
|
productId: string,
|
|
9410
9413
|
admin?: boolean) → `Promise<unknown>`
|
|
9414
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9411
9415
|
|
|
9412
9416
|
**createClaimWindow**(collectionId: string,
|
|
9413
9417
|
productId: string,
|
|
9414
9418
|
body: Record<string, JsonValue>) → `Promise<unknown>`
|
|
9419
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9415
9420
|
|
|
9416
9421
|
**updateClaimWindow**(collectionId: string,
|
|
9417
9422
|
productId: string,
|
|
9418
9423
|
claimId: string,
|
|
9419
9424
|
body: Record<string, JsonValue>) → `Promise<unknown>`
|
|
9425
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9420
9426
|
|
|
9421
9427
|
**refresh**(collectionId: string,
|
|
9422
9428
|
productId: string) → `Promise<ProductResponse>`
|
|
9429
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9423
9430
|
|
|
9424
9431
|
**getSN**(collectionId: string,
|
|
9425
9432
|
productId: string,
|
|
9426
9433
|
startIndex: number = 0,
|
|
9427
9434
|
count: number = 10) → `Promise<unknown>`
|
|
9435
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9428
9436
|
|
|
9429
9437
|
**lookupSN**(collectionId: string,
|
|
9430
9438
|
productId: string,
|
|
9431
9439
|
codeId: string) → `Promise<unknown>`
|
|
9440
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9432
9441
|
|
|
9433
9442
|
**publicLookupClaim**(collectionId: string,
|
|
9434
9443
|
productId: string,
|
|
9435
9444
|
claimId: string) → `Promise<unknown>`
|
|
9445
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9436
9446
|
|
|
9437
9447
|
**publicCreateClaim**(collectionId: string,
|
|
9438
9448
|
productId: string,
|
|
9439
9449
|
body: ProductClaimCreateRequestBody) → `Promise<unknown>`
|
|
9450
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9440
9451
|
|
|
9441
9452
|
### proof
|
|
9442
9453
|
|
package/openapi.yaml
CHANGED
|
@@ -6639,39 +6639,6 @@ paths:
|
|
|
6639
6639
|
application/json:
|
|
6640
6640
|
schema:
|
|
6641
6641
|
$ref: "#/components/schemas/ProductCreateRequest"
|
|
6642
|
-
/admin/collection/{collectionId}/products/query:
|
|
6643
|
-
post:
|
|
6644
|
-
tags:
|
|
6645
|
-
- products
|
|
6646
|
-
summary: products.query
|
|
6647
|
-
operationId: products_query
|
|
6648
|
-
security:
|
|
6649
|
-
- bearerAuth: []
|
|
6650
|
-
parameters:
|
|
6651
|
-
- name: collectionId
|
|
6652
|
-
in: path
|
|
6653
|
-
required: true
|
|
6654
|
-
schema:
|
|
6655
|
-
type: string
|
|
6656
|
-
responses:
|
|
6657
|
-
200:
|
|
6658
|
-
description: Success
|
|
6659
|
-
content:
|
|
6660
|
-
application/json:
|
|
6661
|
-
schema:
|
|
6662
|
-
$ref: "#/components/schemas/ProductQueryResponse"
|
|
6663
|
-
400:
|
|
6664
|
-
description: Bad request
|
|
6665
|
-
401:
|
|
6666
|
-
description: Unauthorized
|
|
6667
|
-
404:
|
|
6668
|
-
description: Not found
|
|
6669
|
-
requestBody:
|
|
6670
|
-
required: true
|
|
6671
|
-
content:
|
|
6672
|
-
application/json:
|
|
6673
|
-
schema:
|
|
6674
|
-
$ref: "#/components/schemas/ProductQueryRequest"
|
|
6675
6642
|
/admin/collection/{collectionId}/products/{productId}:
|
|
6676
6643
|
put:
|
|
6677
6644
|
tags:
|