@proveanything/smartlinks 1.7.8 → 1.7.10
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/order.d.ts +14 -5
- package/dist/api/order.js +19 -8
- package/dist/docs/API_SUMMARY.md +21 -25
- package/dist/docs/ai.md +27 -15
- package/dist/openapi.yaml +29 -19
- package/dist/types/order.d.ts +25 -28
- package/docs/API_SUMMARY.md +21 -25
- package/docs/ai.md +27 -15
- package/openapi.yaml +29 -19
- package/package.json +1 -1
package/dist/api/order.d.ts
CHANGED
|
@@ -252,13 +252,22 @@ export declare namespace order {
|
|
|
252
252
|
* includeItems: true
|
|
253
253
|
* })
|
|
254
254
|
*
|
|
255
|
-
|
|
255
|
+
* // Find orders containing a specific product batch
|
|
256
256
|
* const batchOrders = await order.query('coll_123', {
|
|
257
257
|
* query: {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
258
|
+
* productId: 'prod_789',
|
|
259
|
+
* batchId: 'BATCH-2024-001'
|
|
260
|
+
* },
|
|
261
|
+
* includeItems: true
|
|
262
|
+
* })
|
|
263
|
+
*
|
|
264
|
+
* // Find an order containing one of several specific items
|
|
265
|
+
* const matched = await order.query('coll_123', {
|
|
266
|
+
* query: {
|
|
267
|
+
* items: [
|
|
268
|
+
* { itemType: 'tag', itemId: 'TAG001' },
|
|
269
|
+
* { itemType: 'serial', itemId: 'SN12345' }
|
|
270
|
+
* ]
|
|
262
271
|
* },
|
|
263
272
|
* includeItems: true
|
|
264
273
|
* })
|
package/dist/api/order.js
CHANGED
|
@@ -287,9 +287,11 @@ export var order;
|
|
|
287
287
|
}
|
|
288
288
|
order.lookup = lookup;
|
|
289
289
|
function validateOrderQuery(data) {
|
|
290
|
-
|
|
291
|
-
if (
|
|
292
|
-
|
|
290
|
+
const query = data.query;
|
|
291
|
+
if (!query)
|
|
292
|
+
return;
|
|
293
|
+
if ((query.batchId || query.variantId) && !query.productId) {
|
|
294
|
+
throw new Error('query.productId is required when using query.batchId or query.variantId');
|
|
293
295
|
}
|
|
294
296
|
}
|
|
295
297
|
/**
|
|
@@ -325,13 +327,22 @@ export var order;
|
|
|
325
327
|
* includeItems: true
|
|
326
328
|
* })
|
|
327
329
|
*
|
|
328
|
-
|
|
330
|
+
* // Find orders containing a specific product batch
|
|
329
331
|
* const batchOrders = await order.query('coll_123', {
|
|
330
332
|
* query: {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
333
|
+
* productId: 'prod_789',
|
|
334
|
+
* batchId: 'BATCH-2024-001'
|
|
335
|
+
* },
|
|
336
|
+
* includeItems: true
|
|
337
|
+
* })
|
|
338
|
+
*
|
|
339
|
+
* // Find an order containing one of several specific items
|
|
340
|
+
* const matched = await order.query('coll_123', {
|
|
341
|
+
* query: {
|
|
342
|
+
* items: [
|
|
343
|
+
* { itemType: 'tag', itemId: 'TAG001' },
|
|
344
|
+
* { itemType: 'serial', itemId: 'SN12345' }
|
|
345
|
+
* ]
|
|
335
346
|
* },
|
|
336
347
|
* includeItems: true
|
|
337
348
|
* })
|
package/dist/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.10 | Generated: 2026-03-12T18:05:02.102Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -4503,38 +4503,34 @@ interface GetOrderItemsResponse {
|
|
|
4503
4503
|
}
|
|
4504
4504
|
```
|
|
4505
4505
|
|
|
4506
|
-
**
|
|
4507
|
-
```typescript
|
|
4508
|
-
interface QueryOrderItemFilter {
|
|
4509
|
-
productId: string
|
|
4510
|
-
batchId?: string
|
|
4511
|
-
variantId?: string
|
|
4512
|
-
}
|
|
4513
|
-
```
|
|
4514
|
-
|
|
4515
|
-
**QueryOrdersFilter** (interface)
|
|
4506
|
+
**QueryOrdersRequest** (interface)
|
|
4516
4507
|
```typescript
|
|
4517
|
-
interface
|
|
4508
|
+
interface QueryOrdersRequest {
|
|
4509
|
+
query?: {
|
|
4518
4510
|
status?: string
|
|
4519
4511
|
orderRef?: string
|
|
4520
4512
|
customerId?: string
|
|
4521
|
-
createdAfter?: string
|
|
4522
|
-
createdBefore?: string
|
|
4523
|
-
updatedAfter?: string
|
|
4524
|
-
updatedBefore?: string
|
|
4513
|
+
createdAfter?: string // ISO 8601 date
|
|
4514
|
+
createdBefore?: string // ISO 8601 date
|
|
4515
|
+
updatedAfter?: string // ISO 8601 date
|
|
4516
|
+
updatedBefore?: string // ISO 8601 date
|
|
4525
4517
|
minItemCount?: number
|
|
4526
4518
|
maxItemCount?: number
|
|
4519
|
+
productId?: string
|
|
4520
|
+
batchId?: string
|
|
4521
|
+
variantId?: string
|
|
4522
|
+
itemType?: 'tag' | 'proof' | 'serial'
|
|
4523
|
+
itemId?: string
|
|
4524
|
+
itemCollectionId?: string
|
|
4525
|
+
itemMetadata?: Record<string, any>
|
|
4526
|
+
items?: Array<{
|
|
4527
|
+
itemType: 'tag' | 'proof' | 'serial'
|
|
4528
|
+
itemId: string
|
|
4529
|
+
}>
|
|
4527
4530
|
metadata?: Record<string, any>
|
|
4528
|
-
item?: QueryOrderItemFilter
|
|
4529
4531
|
sortBy?: string
|
|
4530
4532
|
sortOrder?: 'asc' | 'desc'
|
|
4531
|
-
}
|
|
4532
|
-
```
|
|
4533
|
-
|
|
4534
|
-
**QueryOrdersRequest** (interface)
|
|
4535
|
-
```typescript
|
|
4536
|
-
interface QueryOrdersRequest {
|
|
4537
|
-
query?: QueryOrdersFilter
|
|
4533
|
+
}
|
|
4538
4534
|
limit?: number // Optional: Max results (default: 100)
|
|
4539
4535
|
offset?: number // Optional: Pagination offset (default: 0)
|
|
4540
4536
|
includeItems?: boolean // Optional: Include items array (default: false)
|
|
@@ -6430,7 +6426,7 @@ Find all orders containing specific items (tags, proofs, or serial numbers). Use
|
|
|
6430
6426
|
|
|
6431
6427
|
**query**(collectionId: string,
|
|
6432
6428
|
data: QueryOrdersRequest) → `Promise<QueryOrdersResponse>`
|
|
6433
|
-
Advanced query for orders with order-level and item-level filtering. More powerful than the basic list() function. ```typescript // Find pending orders created in January 2026 const result = await order.query('coll_123', { query: { status: 'pending', createdAfter: '2026-01-01T00:00:00Z', createdBefore: '2026-02-01T00:00:00Z', sortBy: 'createdAt', sortOrder: 'desc' }, limit: 50 }) // Find orders with specific metadata and item count const highPriority = await order.query('coll_123', { query: { metadata: { priority: 'high' }, minItemCount: 10, maxItemCount: 100 }, includeItems: true }) // Find orders containing a specific product batch const batchOrders = await order.query('coll_123', { query: {
|
|
6429
|
+
Advanced query for orders with order-level and item-level filtering. More powerful than the basic list() function. ```typescript // Find pending orders created in January 2026 const result = await order.query('coll_123', { query: { status: 'pending', createdAfter: '2026-01-01T00:00:00Z', createdBefore: '2026-02-01T00:00:00Z', sortBy: 'createdAt', sortOrder: 'desc' }, limit: 50 }) // Find orders with specific metadata and item count const highPriority = await order.query('coll_123', { query: { metadata: { priority: 'high' }, minItemCount: 10, maxItemCount: 100 }, includeItems: true }) // Find orders containing a specific product batch const batchOrders = await order.query('coll_123', { query: { productId: 'prod_789', batchId: 'BATCH-2024-001' }, includeItems: true }) // Find an order containing one of several specific items const matched = await order.query('coll_123', { query: { items: [ { itemType: 'tag', itemId: 'TAG001' }, { itemType: 'serial', itemId: 'SN12345' } ] }, includeItems: true }) ```
|
|
6434
6430
|
|
|
6435
6431
|
**reports**(collectionId: string,
|
|
6436
6432
|
params?: ReportsParams) → `Promise<ReportsResponse>`
|
package/dist/docs/ai.md
CHANGED
|
@@ -349,8 +349,11 @@ if (toolCall) {
|
|
|
349
349
|
const models = await ai.models.list('my-collection');
|
|
350
350
|
|
|
351
351
|
// Or filter by provider / capability
|
|
352
|
-
const
|
|
353
|
-
provider: '
|
|
352
|
+
const openAiModels = await ai.models.list('my-collection', {
|
|
353
|
+
provider: 'openai'
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
const visionModels = await ai.models.list('my-collection', {
|
|
354
357
|
capability: 'vision'
|
|
355
358
|
});
|
|
356
359
|
|
|
@@ -366,13 +369,18 @@ const model = await ai.models.get('my-collection', 'google/gemini-2.5-flash');
|
|
|
366
369
|
console.log(model.capabilities); // ['text', 'vision', 'audio', 'code']
|
|
367
370
|
```
|
|
368
371
|
|
|
372
|
+
Use `ai.models.list(collectionId)` as the source of truth for what your collection can use at runtime. The public docs provide recommendations, but actual availability depends on the SmartLinks model catalog exposed to that collection.
|
|
373
|
+
|
|
369
374
|
**Recommended Models:**
|
|
370
375
|
|
|
371
376
|
| Model | Use Case | Speed | Cost |
|
|
372
377
|
|-------|----------|-------|------|
|
|
373
|
-
| `
|
|
374
|
-
| `
|
|
375
|
-
| `google/gemini-2.5-
|
|
378
|
+
| `openai/gpt-5.4` | Default for new agentic and structured-output workflows | Balanced | Medium |
|
|
379
|
+
| `openai/gpt-5-mini` | Lower-cost general purpose and JSON tasks | Fast | Low |
|
|
380
|
+
| `google/gemini-2.5-flash` | Fast multimodal and cost-sensitive general use | Fast | Low |
|
|
381
|
+
| `google/gemini-2.5-pro` | Complex reasoning and heavier multimodal tasks | Slower | Higher |
|
|
382
|
+
|
|
383
|
+
If you want a safe default for most new work, start with `openai/gpt-5.4`. If you want a lower-cost fallback, use `openai/gpt-5-mini` or `google/gemini-2.5-flash` depending on your latency and pricing goals.
|
|
376
384
|
|
|
377
385
|
---
|
|
378
386
|
|
|
@@ -1577,23 +1585,27 @@ console.log('Rate limit reset for user-123');
|
|
|
1577
1585
|
### 1. Choose the Right Model
|
|
1578
1586
|
|
|
1579
1587
|
```typescript
|
|
1580
|
-
// For
|
|
1581
|
-
await ai.chat.
|
|
1582
|
-
model: '
|
|
1583
|
-
|
|
1588
|
+
// For most new workflows (recommended default)
|
|
1589
|
+
await ai.chat.responses.create('my-collection', {
|
|
1590
|
+
model: 'openai/gpt-5.4',
|
|
1591
|
+
input: 'Create a concise onboarding checklist.'
|
|
1584
1592
|
});
|
|
1585
1593
|
|
|
1586
|
-
// For
|
|
1587
|
-
await ai.chat.
|
|
1588
|
-
model: '
|
|
1589
|
-
|
|
1594
|
+
// For lower-cost structured or JSON-oriented work
|
|
1595
|
+
await ai.chat.responses.create('my-collection', {
|
|
1596
|
+
model: 'openai/gpt-5-mini',
|
|
1597
|
+
input: 'Return a color palette as JSON.'
|
|
1590
1598
|
});
|
|
1591
1599
|
|
|
1592
|
-
// For
|
|
1600
|
+
// For fast multimodal or cost-sensitive general use
|
|
1593
1601
|
await ai.chat.completions.create('my-collection', {
|
|
1594
|
-
model: 'google/gemini-2.5-
|
|
1602
|
+
model: 'google/gemini-2.5-flash',
|
|
1595
1603
|
messages: [...]
|
|
1596
1604
|
});
|
|
1605
|
+
|
|
1606
|
+
// When you need the actual available catalog for this collection
|
|
1607
|
+
const available = await ai.models.list('my-collection');
|
|
1608
|
+
console.log(available.data.map(model => model.id));
|
|
1597
1609
|
```
|
|
1598
1610
|
|
|
1599
1611
|
### 2. Use Streaming for Long Responses
|
package/dist/openapi.yaml
CHANGED
|
@@ -15881,20 +15881,12 @@ components:
|
|
|
15881
15881
|
- items
|
|
15882
15882
|
- limit
|
|
15883
15883
|
- offset
|
|
15884
|
-
|
|
15885
|
-
type: object
|
|
15886
|
-
properties:
|
|
15887
|
-
productId:
|
|
15888
|
-
type: string
|
|
15889
|
-
batchId:
|
|
15890
|
-
type: string
|
|
15891
|
-
variantId:
|
|
15892
|
-
type: string
|
|
15893
|
-
required:
|
|
15894
|
-
- productId
|
|
15895
|
-
QueryOrdersFilter:
|
|
15884
|
+
QueryOrdersRequest:
|
|
15896
15885
|
type: object
|
|
15897
15886
|
properties:
|
|
15887
|
+
query:
|
|
15888
|
+
type: object
|
|
15889
|
+
additionalProperties: true
|
|
15898
15890
|
status:
|
|
15899
15891
|
type: string
|
|
15900
15892
|
orderRef:
|
|
@@ -15913,11 +15905,31 @@ components:
|
|
|
15913
15905
|
type: number
|
|
15914
15906
|
maxItemCount:
|
|
15915
15907
|
type: number
|
|
15908
|
+
productId:
|
|
15909
|
+
type: string
|
|
15910
|
+
batchId:
|
|
15911
|
+
type: string
|
|
15912
|
+
variantId:
|
|
15913
|
+
type: string
|
|
15914
|
+
itemType:
|
|
15915
|
+
type: string
|
|
15916
|
+
enum:
|
|
15917
|
+
- tag
|
|
15918
|
+
- proof
|
|
15919
|
+
- serial
|
|
15920
|
+
itemId:
|
|
15921
|
+
type: string
|
|
15922
|
+
itemCollectionId:
|
|
15923
|
+
type: string
|
|
15924
|
+
itemMetadata:
|
|
15925
|
+
type: object
|
|
15926
|
+
additionalProperties: true
|
|
15927
|
+
items:
|
|
15928
|
+
type: object
|
|
15929
|
+
additionalProperties: true
|
|
15916
15930
|
metadata:
|
|
15917
15931
|
type: object
|
|
15918
15932
|
additionalProperties: true
|
|
15919
|
-
item:
|
|
15920
|
-
$ref: "#/components/schemas/QueryOrderItemFilter"
|
|
15921
15933
|
sortBy:
|
|
15922
15934
|
type: string
|
|
15923
15935
|
sortOrder:
|
|
@@ -15925,17 +15937,15 @@ components:
|
|
|
15925
15937
|
enum:
|
|
15926
15938
|
- asc
|
|
15927
15939
|
- desc
|
|
15928
|
-
QueryOrdersRequest:
|
|
15929
|
-
type: object
|
|
15930
|
-
properties:
|
|
15931
|
-
query:
|
|
15932
|
-
$ref: "#/components/schemas/QueryOrdersFilter"
|
|
15933
15940
|
limit:
|
|
15934
15941
|
type: number
|
|
15935
15942
|
offset:
|
|
15936
15943
|
type: number
|
|
15937
15944
|
includeItems:
|
|
15938
15945
|
type: boolean
|
|
15946
|
+
required:
|
|
15947
|
+
- itemType
|
|
15948
|
+
- itemId
|
|
15939
15949
|
QueryOrdersResponse:
|
|
15940
15950
|
type: object
|
|
15941
15951
|
properties:
|
package/dist/types/order.d.ts
CHANGED
|
@@ -175,38 +175,35 @@ export interface GetOrderItemsResponse {
|
|
|
175
175
|
limit: number;
|
|
176
176
|
offset: number;
|
|
177
177
|
}
|
|
178
|
-
/**
|
|
179
|
-
* Item-level filters for advanced order querying.
|
|
180
|
-
* Batch and variant identifiers are only meaningful within a product.
|
|
181
|
-
*/
|
|
182
|
-
export interface QueryOrderItemFilter {
|
|
183
|
-
productId: string;
|
|
184
|
-
batchId?: string;
|
|
185
|
-
variantId?: string;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Order-level and item-level filters for advanced order querying.
|
|
189
|
-
*/
|
|
190
|
-
export interface QueryOrdersFilter {
|
|
191
|
-
status?: string;
|
|
192
|
-
orderRef?: string;
|
|
193
|
-
customerId?: string;
|
|
194
|
-
createdAfter?: string;
|
|
195
|
-
createdBefore?: string;
|
|
196
|
-
updatedAfter?: string;
|
|
197
|
-
updatedBefore?: string;
|
|
198
|
-
minItemCount?: number;
|
|
199
|
-
maxItemCount?: number;
|
|
200
|
-
metadata?: Record<string, any>;
|
|
201
|
-
item?: QueryOrderItemFilter;
|
|
202
|
-
sortBy?: string;
|
|
203
|
-
sortOrder?: 'asc' | 'desc';
|
|
204
|
-
}
|
|
205
178
|
/**
|
|
206
179
|
* Request for advanced order querying.
|
|
207
180
|
*/
|
|
208
181
|
export interface QueryOrdersRequest {
|
|
209
|
-
query?:
|
|
182
|
+
query?: {
|
|
183
|
+
status?: string;
|
|
184
|
+
orderRef?: string;
|
|
185
|
+
customerId?: string;
|
|
186
|
+
createdAfter?: string;
|
|
187
|
+
createdBefore?: string;
|
|
188
|
+
updatedAfter?: string;
|
|
189
|
+
updatedBefore?: string;
|
|
190
|
+
minItemCount?: number;
|
|
191
|
+
maxItemCount?: number;
|
|
192
|
+
productId?: string;
|
|
193
|
+
batchId?: string;
|
|
194
|
+
variantId?: string;
|
|
195
|
+
itemType?: 'tag' | 'proof' | 'serial';
|
|
196
|
+
itemId?: string;
|
|
197
|
+
itemCollectionId?: string;
|
|
198
|
+
itemMetadata?: Record<string, any>;
|
|
199
|
+
items?: Array<{
|
|
200
|
+
itemType: 'tag' | 'proof' | 'serial';
|
|
201
|
+
itemId: string;
|
|
202
|
+
}>;
|
|
203
|
+
metadata?: Record<string, any>;
|
|
204
|
+
sortBy?: string;
|
|
205
|
+
sortOrder?: 'asc' | 'desc';
|
|
206
|
+
};
|
|
210
207
|
limit?: number;
|
|
211
208
|
offset?: number;
|
|
212
209
|
includeItems?: boolean;
|
package/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.10 | Generated: 2026-03-12T18:05:02.102Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -4503,38 +4503,34 @@ interface GetOrderItemsResponse {
|
|
|
4503
4503
|
}
|
|
4504
4504
|
```
|
|
4505
4505
|
|
|
4506
|
-
**
|
|
4507
|
-
```typescript
|
|
4508
|
-
interface QueryOrderItemFilter {
|
|
4509
|
-
productId: string
|
|
4510
|
-
batchId?: string
|
|
4511
|
-
variantId?: string
|
|
4512
|
-
}
|
|
4513
|
-
```
|
|
4514
|
-
|
|
4515
|
-
**QueryOrdersFilter** (interface)
|
|
4506
|
+
**QueryOrdersRequest** (interface)
|
|
4516
4507
|
```typescript
|
|
4517
|
-
interface
|
|
4508
|
+
interface QueryOrdersRequest {
|
|
4509
|
+
query?: {
|
|
4518
4510
|
status?: string
|
|
4519
4511
|
orderRef?: string
|
|
4520
4512
|
customerId?: string
|
|
4521
|
-
createdAfter?: string
|
|
4522
|
-
createdBefore?: string
|
|
4523
|
-
updatedAfter?: string
|
|
4524
|
-
updatedBefore?: string
|
|
4513
|
+
createdAfter?: string // ISO 8601 date
|
|
4514
|
+
createdBefore?: string // ISO 8601 date
|
|
4515
|
+
updatedAfter?: string // ISO 8601 date
|
|
4516
|
+
updatedBefore?: string // ISO 8601 date
|
|
4525
4517
|
minItemCount?: number
|
|
4526
4518
|
maxItemCount?: number
|
|
4519
|
+
productId?: string
|
|
4520
|
+
batchId?: string
|
|
4521
|
+
variantId?: string
|
|
4522
|
+
itemType?: 'tag' | 'proof' | 'serial'
|
|
4523
|
+
itemId?: string
|
|
4524
|
+
itemCollectionId?: string
|
|
4525
|
+
itemMetadata?: Record<string, any>
|
|
4526
|
+
items?: Array<{
|
|
4527
|
+
itemType: 'tag' | 'proof' | 'serial'
|
|
4528
|
+
itemId: string
|
|
4529
|
+
}>
|
|
4527
4530
|
metadata?: Record<string, any>
|
|
4528
|
-
item?: QueryOrderItemFilter
|
|
4529
4531
|
sortBy?: string
|
|
4530
4532
|
sortOrder?: 'asc' | 'desc'
|
|
4531
|
-
}
|
|
4532
|
-
```
|
|
4533
|
-
|
|
4534
|
-
**QueryOrdersRequest** (interface)
|
|
4535
|
-
```typescript
|
|
4536
|
-
interface QueryOrdersRequest {
|
|
4537
|
-
query?: QueryOrdersFilter
|
|
4533
|
+
}
|
|
4538
4534
|
limit?: number // Optional: Max results (default: 100)
|
|
4539
4535
|
offset?: number // Optional: Pagination offset (default: 0)
|
|
4540
4536
|
includeItems?: boolean // Optional: Include items array (default: false)
|
|
@@ -6430,7 +6426,7 @@ Find all orders containing specific items (tags, proofs, or serial numbers). Use
|
|
|
6430
6426
|
|
|
6431
6427
|
**query**(collectionId: string,
|
|
6432
6428
|
data: QueryOrdersRequest) → `Promise<QueryOrdersResponse>`
|
|
6433
|
-
Advanced query for orders with order-level and item-level filtering. More powerful than the basic list() function. ```typescript // Find pending orders created in January 2026 const result = await order.query('coll_123', { query: { status: 'pending', createdAfter: '2026-01-01T00:00:00Z', createdBefore: '2026-02-01T00:00:00Z', sortBy: 'createdAt', sortOrder: 'desc' }, limit: 50 }) // Find orders with specific metadata and item count const highPriority = await order.query('coll_123', { query: { metadata: { priority: 'high' }, minItemCount: 10, maxItemCount: 100 }, includeItems: true }) // Find orders containing a specific product batch const batchOrders = await order.query('coll_123', { query: {
|
|
6429
|
+
Advanced query for orders with order-level and item-level filtering. More powerful than the basic list() function. ```typescript // Find pending orders created in January 2026 const result = await order.query('coll_123', { query: { status: 'pending', createdAfter: '2026-01-01T00:00:00Z', createdBefore: '2026-02-01T00:00:00Z', sortBy: 'createdAt', sortOrder: 'desc' }, limit: 50 }) // Find orders with specific metadata and item count const highPriority = await order.query('coll_123', { query: { metadata: { priority: 'high' }, minItemCount: 10, maxItemCount: 100 }, includeItems: true }) // Find orders containing a specific product batch const batchOrders = await order.query('coll_123', { query: { productId: 'prod_789', batchId: 'BATCH-2024-001' }, includeItems: true }) // Find an order containing one of several specific items const matched = await order.query('coll_123', { query: { items: [ { itemType: 'tag', itemId: 'TAG001' }, { itemType: 'serial', itemId: 'SN12345' } ] }, includeItems: true }) ```
|
|
6434
6430
|
|
|
6435
6431
|
**reports**(collectionId: string,
|
|
6436
6432
|
params?: ReportsParams) → `Promise<ReportsResponse>`
|
package/docs/ai.md
CHANGED
|
@@ -349,8 +349,11 @@ if (toolCall) {
|
|
|
349
349
|
const models = await ai.models.list('my-collection');
|
|
350
350
|
|
|
351
351
|
// Or filter by provider / capability
|
|
352
|
-
const
|
|
353
|
-
provider: '
|
|
352
|
+
const openAiModels = await ai.models.list('my-collection', {
|
|
353
|
+
provider: 'openai'
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
const visionModels = await ai.models.list('my-collection', {
|
|
354
357
|
capability: 'vision'
|
|
355
358
|
});
|
|
356
359
|
|
|
@@ -366,13 +369,18 @@ const model = await ai.models.get('my-collection', 'google/gemini-2.5-flash');
|
|
|
366
369
|
console.log(model.capabilities); // ['text', 'vision', 'audio', 'code']
|
|
367
370
|
```
|
|
368
371
|
|
|
372
|
+
Use `ai.models.list(collectionId)` as the source of truth for what your collection can use at runtime. The public docs provide recommendations, but actual availability depends on the SmartLinks model catalog exposed to that collection.
|
|
373
|
+
|
|
369
374
|
**Recommended Models:**
|
|
370
375
|
|
|
371
376
|
| Model | Use Case | Speed | Cost |
|
|
372
377
|
|-------|----------|-------|------|
|
|
373
|
-
| `
|
|
374
|
-
| `
|
|
375
|
-
| `google/gemini-2.5-
|
|
378
|
+
| `openai/gpt-5.4` | Default for new agentic and structured-output workflows | Balanced | Medium |
|
|
379
|
+
| `openai/gpt-5-mini` | Lower-cost general purpose and JSON tasks | Fast | Low |
|
|
380
|
+
| `google/gemini-2.5-flash` | Fast multimodal and cost-sensitive general use | Fast | Low |
|
|
381
|
+
| `google/gemini-2.5-pro` | Complex reasoning and heavier multimodal tasks | Slower | Higher |
|
|
382
|
+
|
|
383
|
+
If you want a safe default for most new work, start with `openai/gpt-5.4`. If you want a lower-cost fallback, use `openai/gpt-5-mini` or `google/gemini-2.5-flash` depending on your latency and pricing goals.
|
|
376
384
|
|
|
377
385
|
---
|
|
378
386
|
|
|
@@ -1577,23 +1585,27 @@ console.log('Rate limit reset for user-123');
|
|
|
1577
1585
|
### 1. Choose the Right Model
|
|
1578
1586
|
|
|
1579
1587
|
```typescript
|
|
1580
|
-
// For
|
|
1581
|
-
await ai.chat.
|
|
1582
|
-
model: '
|
|
1583
|
-
|
|
1588
|
+
// For most new workflows (recommended default)
|
|
1589
|
+
await ai.chat.responses.create('my-collection', {
|
|
1590
|
+
model: 'openai/gpt-5.4',
|
|
1591
|
+
input: 'Create a concise onboarding checklist.'
|
|
1584
1592
|
});
|
|
1585
1593
|
|
|
1586
|
-
// For
|
|
1587
|
-
await ai.chat.
|
|
1588
|
-
model: '
|
|
1589
|
-
|
|
1594
|
+
// For lower-cost structured or JSON-oriented work
|
|
1595
|
+
await ai.chat.responses.create('my-collection', {
|
|
1596
|
+
model: 'openai/gpt-5-mini',
|
|
1597
|
+
input: 'Return a color palette as JSON.'
|
|
1590
1598
|
});
|
|
1591
1599
|
|
|
1592
|
-
// For
|
|
1600
|
+
// For fast multimodal or cost-sensitive general use
|
|
1593
1601
|
await ai.chat.completions.create('my-collection', {
|
|
1594
|
-
model: 'google/gemini-2.5-
|
|
1602
|
+
model: 'google/gemini-2.5-flash',
|
|
1595
1603
|
messages: [...]
|
|
1596
1604
|
});
|
|
1605
|
+
|
|
1606
|
+
// When you need the actual available catalog for this collection
|
|
1607
|
+
const available = await ai.models.list('my-collection');
|
|
1608
|
+
console.log(available.data.map(model => model.id));
|
|
1597
1609
|
```
|
|
1598
1610
|
|
|
1599
1611
|
### 2. Use Streaming for Long Responses
|
package/openapi.yaml
CHANGED
|
@@ -15881,20 +15881,12 @@ components:
|
|
|
15881
15881
|
- items
|
|
15882
15882
|
- limit
|
|
15883
15883
|
- offset
|
|
15884
|
-
|
|
15885
|
-
type: object
|
|
15886
|
-
properties:
|
|
15887
|
-
productId:
|
|
15888
|
-
type: string
|
|
15889
|
-
batchId:
|
|
15890
|
-
type: string
|
|
15891
|
-
variantId:
|
|
15892
|
-
type: string
|
|
15893
|
-
required:
|
|
15894
|
-
- productId
|
|
15895
|
-
QueryOrdersFilter:
|
|
15884
|
+
QueryOrdersRequest:
|
|
15896
15885
|
type: object
|
|
15897
15886
|
properties:
|
|
15887
|
+
query:
|
|
15888
|
+
type: object
|
|
15889
|
+
additionalProperties: true
|
|
15898
15890
|
status:
|
|
15899
15891
|
type: string
|
|
15900
15892
|
orderRef:
|
|
@@ -15913,11 +15905,31 @@ components:
|
|
|
15913
15905
|
type: number
|
|
15914
15906
|
maxItemCount:
|
|
15915
15907
|
type: number
|
|
15908
|
+
productId:
|
|
15909
|
+
type: string
|
|
15910
|
+
batchId:
|
|
15911
|
+
type: string
|
|
15912
|
+
variantId:
|
|
15913
|
+
type: string
|
|
15914
|
+
itemType:
|
|
15915
|
+
type: string
|
|
15916
|
+
enum:
|
|
15917
|
+
- tag
|
|
15918
|
+
- proof
|
|
15919
|
+
- serial
|
|
15920
|
+
itemId:
|
|
15921
|
+
type: string
|
|
15922
|
+
itemCollectionId:
|
|
15923
|
+
type: string
|
|
15924
|
+
itemMetadata:
|
|
15925
|
+
type: object
|
|
15926
|
+
additionalProperties: true
|
|
15927
|
+
items:
|
|
15928
|
+
type: object
|
|
15929
|
+
additionalProperties: true
|
|
15916
15930
|
metadata:
|
|
15917
15931
|
type: object
|
|
15918
15932
|
additionalProperties: true
|
|
15919
|
-
item:
|
|
15920
|
-
$ref: "#/components/schemas/QueryOrderItemFilter"
|
|
15921
15933
|
sortBy:
|
|
15922
15934
|
type: string
|
|
15923
15935
|
sortOrder:
|
|
@@ -15925,17 +15937,15 @@ components:
|
|
|
15925
15937
|
enum:
|
|
15926
15938
|
- asc
|
|
15927
15939
|
- desc
|
|
15928
|
-
QueryOrdersRequest:
|
|
15929
|
-
type: object
|
|
15930
|
-
properties:
|
|
15931
|
-
query:
|
|
15932
|
-
$ref: "#/components/schemas/QueryOrdersFilter"
|
|
15933
15940
|
limit:
|
|
15934
15941
|
type: number
|
|
15935
15942
|
offset:
|
|
15936
15943
|
type: number
|
|
15937
15944
|
includeItems:
|
|
15938
15945
|
type: boolean
|
|
15946
|
+
required:
|
|
15947
|
+
- itemType
|
|
15948
|
+
- itemId
|
|
15939
15949
|
QueryOrdersResponse:
|
|
15940
15950
|
type: object
|
|
15941
15951
|
properties:
|