@proveanything/smartlinks 1.7.4 → 1.7.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/openapi.yaml CHANGED
@@ -4132,75 +4132,11 @@ paths:
4132
4132
  application/json:
4133
4133
  schema:
4134
4134
  $ref: "#/components/schemas/TimelineRequest"
4135
- /admin/collection/{collectionId}/orders/batch/{batchId}:
4136
- get:
4137
- tags:
4138
- - order
4139
- summary: Find all orders containing items from a specific batch.
4140
- operationId: order_findByBatch
4141
- security:
4142
- - bearerAuth: []
4143
- parameters:
4144
- - name: collectionId
4145
- in: path
4146
- required: true
4147
- schema:
4148
- type: string
4149
- - name: batchId
4150
- in: path
4151
- required: true
4152
- schema:
4153
- type: string
4154
- responses:
4155
- 200:
4156
- description: Success
4157
- content:
4158
- application/json:
4159
- schema:
4160
- $ref: "#/components/schemas/FindOrdersByAttributeResponse"
4161
- 400:
4162
- description: Bad request
4163
- 401:
4164
- description: Unauthorized
4165
- 404:
4166
- description: Not found
4167
- /admin/collection/{collectionId}/orders/batch/{batchId}/items:
4168
- get:
4169
- tags:
4170
- - order
4171
- summary: Get individual order items (not full orders) for a specific batch.
4172
- operationId: order_findItemsByBatch
4173
- security:
4174
- - bearerAuth: []
4175
- parameters:
4176
- - name: collectionId
4177
- in: path
4178
- required: true
4179
- schema:
4180
- type: string
4181
- - name: batchId
4182
- in: path
4183
- required: true
4184
- schema:
4185
- type: string
4186
- responses:
4187
- 200:
4188
- description: Success
4189
- content:
4190
- application/json:
4191
- schema:
4192
- $ref: "#/components/schemas/FindItemsByAttributeResponse"
4193
- 400:
4194
- description: Bad request
4195
- 401:
4196
- description: Unauthorized
4197
- 404:
4198
- description: Not found
4199
4135
  /admin/collection/{collectionId}/orders/ids/{attribute}/{value}:
4200
4136
  get:
4201
4137
  tags:
4202
4138
  - order
4203
- summary: order.getOrderIdsByAttribute
4139
+ summary: Get unique order IDs containing items for a specific product.
4204
4140
  operationId: order_getOrderIdsByAttribute
4205
4141
  security:
4206
4142
  - bearerAuth: []
@@ -4390,70 +4326,6 @@ paths:
4390
4326
  description: Unauthorized
4391
4327
  404:
4392
4328
  description: Not found
4393
- /admin/collection/{collectionId}/orders/variant/{variantId}:
4394
- get:
4395
- tags:
4396
- - order
4397
- summary: Find all orders containing items from a specific variant.
4398
- operationId: order_findByVariant
4399
- security:
4400
- - bearerAuth: []
4401
- parameters:
4402
- - name: collectionId
4403
- in: path
4404
- required: true
4405
- schema:
4406
- type: string
4407
- - name: variantId
4408
- in: path
4409
- required: true
4410
- schema:
4411
- type: string
4412
- responses:
4413
- 200:
4414
- description: Success
4415
- content:
4416
- application/json:
4417
- schema:
4418
- $ref: "#/components/schemas/FindOrdersByAttributeResponse"
4419
- 400:
4420
- description: Bad request
4421
- 401:
4422
- description: Unauthorized
4423
- 404:
4424
- description: Not found
4425
- /admin/collection/{collectionId}/orders/variant/{variantId}/items:
4426
- get:
4427
- tags:
4428
- - order
4429
- summary: Get individual order items for a specific variant.
4430
- operationId: order_findItemsByVariant
4431
- security:
4432
- - bearerAuth: []
4433
- parameters:
4434
- - name: collectionId
4435
- in: path
4436
- required: true
4437
- schema:
4438
- type: string
4439
- - name: variantId
4440
- in: path
4441
- required: true
4442
- schema:
4443
- type: string
4444
- responses:
4445
- 200:
4446
- description: Success
4447
- content:
4448
- application/json:
4449
- schema:
4450
- $ref: "#/components/schemas/FindItemsByAttributeResponse"
4451
- 400:
4452
- description: Bad request
4453
- 401:
4454
- description: Unauthorized
4455
- 404:
4456
- description: Not found
4457
4329
  /admin/collection/{collectionId}/orders/{orderId}:
4458
4330
  get:
4459
4331
  tags:
@@ -9828,8 +9700,9 @@ components:
9828
9700
  id:
9829
9701
  type: string
9830
9702
  type:
9831
- type: object
9832
- additionalProperties: true
9703
+ type: string
9704
+ enum:
9705
+ - function
9833
9706
  function:
9834
9707
  type: object
9835
9708
  additionalProperties: true
@@ -9973,8 +9846,9 @@ components:
9973
9846
  id:
9974
9847
  type: string
9975
9848
  object:
9976
- type: object
9977
- additionalProperties: true
9849
+ type: string
9850
+ enum:
9851
+ - chat.completion
9978
9852
  created:
9979
9853
  type: number
9980
9854
  model:
@@ -10008,8 +9882,9 @@ components:
10008
9882
  id:
10009
9883
  type: string
10010
9884
  object:
10011
- type: object
10012
- additionalProperties: true
9885
+ type: string
9886
+ enum:
9887
+ - chat.completion.chunk
10013
9888
  created:
10014
9889
  type: number
10015
9890
  model:
@@ -12040,8 +11915,9 @@ components:
12040
11915
  items:
12041
11916
  $ref: "#/components/schemas/AttestationSummaryBucket"
12042
11917
  audience:
12043
- type: object
12044
- additionalProperties: true
11918
+ type: string
11919
+ enum:
11920
+ - public
12045
11921
  required:
12046
11922
  - summary
12047
11923
  - audience
@@ -12086,8 +11962,9 @@ components:
12086
11962
  items:
12087
11963
  $ref: "#/components/schemas/AttestationSummaryBucket"
12088
11964
  audience:
12089
- type: object
12090
- additionalProperties: true
11965
+ type: string
11966
+ enum:
11967
+ - public
12091
11968
  subjectCount:
12092
11969
  type: number
12093
11970
  required:
@@ -12114,8 +11991,9 @@ components:
12114
11991
  items:
12115
11992
  $ref: "#/components/schemas/LatestAttestation"
12116
11993
  audience:
12117
- type: object
12118
- additionalProperties: true
11994
+ type: string
11995
+ enum:
11996
+ - public
12119
11997
  subjectCount:
12120
11998
  type: number
12121
11999
  required:
@@ -13952,8 +13830,9 @@ components:
13952
13830
  type: object
13953
13831
  additionalProperties: true
13954
13832
  type:
13955
- type: object
13956
- additionalProperties: true
13833
+ type: string
13834
+ enum:
13835
+ - object
13957
13836
  required:
13958
13837
  type: array
13959
13838
  items:
@@ -14425,8 +14304,9 @@ components:
14425
14304
  type: object
14426
14305
  properties:
14427
14306
  type:
14428
- type: object
14429
- additionalProperties: true
14307
+ type: string
14308
+ enum:
14309
+ - smartlinks-route-change
14430
14310
  path:
14431
14311
  type: string
14432
14312
  context:
@@ -14531,8 +14411,9 @@ components:
14531
14411
  type: object
14532
14412
  additionalProperties: true
14533
14413
  phase:
14534
- type: object
14535
- additionalProperties: true
14414
+ type: string
14415
+ enum:
14416
+ - start
14536
14417
  id:
14537
14418
  type: string
14538
14419
  fields:
@@ -14563,8 +14444,9 @@ components:
14563
14444
  type: object
14564
14445
  additionalProperties: true
14565
14446
  phase:
14566
- type: object
14567
- additionalProperties: true
14447
+ type: string
14448
+ enum:
14449
+ - chunk
14568
14450
  id:
14569
14451
  type: string
14570
14452
  seq:
@@ -14584,8 +14466,9 @@ components:
14584
14466
  type: object
14585
14467
  additionalProperties: true
14586
14468
  phase:
14587
- type: object
14588
- additionalProperties: true
14469
+ type: string
14470
+ enum:
14471
+ - end
14589
14472
  id:
14590
14473
  type: string
14591
14474
  required:
@@ -14599,8 +14482,9 @@ components:
14599
14482
  type: object
14600
14483
  additionalProperties: true
14601
14484
  phase:
14602
- type: object
14603
- additionalProperties: true
14485
+ type: string
14486
+ enum:
14487
+ - ack
14604
14488
  id:
14605
14489
  type: string
14606
14490
  seq:
@@ -14617,8 +14501,9 @@ components:
14617
14501
  type: object
14618
14502
  additionalProperties: true
14619
14503
  phase:
14620
- type: object
14621
- additionalProperties: true
14504
+ type: string
14505
+ enum:
14506
+ - done
14622
14507
  id:
14623
14508
  type: string
14624
14509
  ok:
@@ -14673,8 +14558,9 @@ components:
14673
14558
  include:
14674
14559
  type: array
14675
14560
  items:
14676
- type: object
14677
- additionalProperties: true
14561
+ type: string
14562
+ enum:
14563
+ - interaction
14678
14564
  AdminInteractionsCountsByOutcomeRequest:
14679
14565
  type: object
14680
14566
  properties:
@@ -15734,12 +15620,20 @@ components:
15734
15620
  - items
15735
15621
  - limit
15736
15622
  - offset
15737
- QueryOrdersRequest:
15623
+ QueryOrderItemFilter:
15624
+ type: object
15625
+ properties:
15626
+ productId:
15627
+ type: string
15628
+ batchId:
15629
+ type: string
15630
+ variantId:
15631
+ type: string
15632
+ required:
15633
+ - productId
15634
+ QueryOrdersFilter:
15738
15635
  type: object
15739
15636
  properties:
15740
- query:
15741
- type: object
15742
- additionalProperties: true
15743
15637
  status:
15744
15638
  type: string
15745
15639
  orderRef:
@@ -15761,6 +15655,8 @@ components:
15761
15655
  metadata:
15762
15656
  type: object
15763
15657
  additionalProperties: true
15658
+ item:
15659
+ $ref: "#/components/schemas/QueryOrderItemFilter"
15764
15660
  sortBy:
15765
15661
  type: string
15766
15662
  sortOrder:
@@ -15768,6 +15664,11 @@ components:
15768
15664
  enum:
15769
15665
  - asc
15770
15666
  - desc
15667
+ QueryOrdersRequest:
15668
+ type: object
15669
+ properties:
15670
+ query:
15671
+ $ref: "#/components/schemas/QueryOrdersFilter"
15771
15672
  limit:
15772
15673
  type: number
15773
15674
  offset:
@@ -15955,9 +15856,7 @@ components:
15955
15856
  attribute:
15956
15857
  type: string
15957
15858
  enum:
15958
- - batchId
15959
15859
  - productId
15960
- - variantId
15961
15860
  value:
15962
15861
  type: string
15963
15862
  required:
@@ -16970,8 +16869,9 @@ components:
16970
16869
  type: object
16971
16870
  properties:
16972
16871
  engine:
16973
- type: object
16974
- additionalProperties: true
16872
+ type: string
16873
+ enum:
16874
+ - liquid
16975
16875
  source:
16976
16876
  type: string
16977
16877
  props:
@@ -175,24 +175,38 @@ 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
+ }
178
205
  /**
179
206
  * Request for advanced order querying.
180
207
  */
181
208
  export interface QueryOrdersRequest {
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
- metadata?: Record<string, any>;
193
- sortBy?: string;
194
- sortOrder?: 'asc' | 'desc';
195
- };
209
+ query?: QueryOrdersFilter;
196
210
  limit?: number;
197
211
  offset?: number;
198
212
  includeItems?: boolean;
@@ -302,7 +316,7 @@ export interface GetOrderIdsParams {
302
316
  export interface GetOrderIdsResponse {
303
317
  orderIds: string[];
304
318
  count: number;
305
- attribute: 'batchId' | 'productId' | 'variantId';
319
+ attribute: 'productId';
306
320
  value: string;
307
321
  }
308
322
  /**
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.7.4 | Generated: 2026-03-10T14:18:07.271Z
3
+ Version: 1.7.6 | Generated: 2026-03-12T15:07:14.383Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -4400,23 +4400,38 @@ interface GetOrderItemsResponse {
4400
4400
  }
4401
4401
  ```
4402
4402
 
4403
- **QueryOrdersRequest** (interface)
4403
+ **QueryOrderItemFilter** (interface)
4404
4404
  ```typescript
4405
- interface QueryOrdersRequest {
4406
- query?: {
4405
+ interface QueryOrderItemFilter {
4406
+ productId: string
4407
+ batchId?: string
4408
+ variantId?: string
4409
+ }
4410
+ ```
4411
+
4412
+ **QueryOrdersFilter** (interface)
4413
+ ```typescript
4414
+ interface QueryOrdersFilter {
4407
4415
  status?: string
4408
4416
  orderRef?: string
4409
4417
  customerId?: string
4410
- createdAfter?: string // ISO 8601 date
4411
- createdBefore?: string // ISO 8601 date
4412
- updatedAfter?: string // ISO 8601 date
4413
- updatedBefore?: string // ISO 8601 date
4418
+ createdAfter?: string // ISO 8601 date
4419
+ createdBefore?: string // ISO 8601 date
4420
+ updatedAfter?: string // ISO 8601 date
4421
+ updatedBefore?: string // ISO 8601 date
4414
4422
  minItemCount?: number
4415
4423
  maxItemCount?: number
4416
4424
  metadata?: Record<string, any>
4425
+ item?: QueryOrderItemFilter
4417
4426
  sortBy?: string
4418
4427
  sortOrder?: 'asc' | 'desc'
4419
- }
4428
+ }
4429
+ ```
4430
+
4431
+ **QueryOrdersRequest** (interface)
4432
+ ```typescript
4433
+ interface QueryOrdersRequest {
4434
+ query?: QueryOrdersFilter
4420
4435
  limit?: number // Optional: Max results (default: 100)
4421
4436
  offset?: number // Optional: Pagination offset (default: 0)
4422
4437
  includeItems?: boolean // Optional: Include items array (default: false)
@@ -4537,7 +4552,7 @@ interface GetOrderIdsParams {
4537
4552
  interface GetOrderIdsResponse {
4538
4553
  orderIds: string[]
4539
4554
  count: number
4540
- attribute: 'batchId' | 'productId' | 'variantId'
4555
+ attribute: 'productId'
4541
4556
  value: string
4542
4557
  }
4543
4558
  ```
@@ -6308,7 +6323,7 @@ Find all orders containing specific items (tags, proofs, or serial numbers). Use
6308
6323
 
6309
6324
  **query**(collectionId: string,
6310
6325
  data: QueryOrdersRequest) → `Promise<QueryOrdersResponse>`
6311
- Advanced query for orders with date filtering, metadata search, and sorting. 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 }) ```
6326
+ 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: { item: { productId: 'prod_789', batchId: 'BATCH-2024-001' } }, includeItems: true }) ```
6312
6327
 
6313
6328
  **reports**(collectionId: string,
6314
6329
  params?: ReportsParams) → `Promise<ReportsResponse>`
@@ -6341,41 +6356,21 @@ Get analytics summary for multiple orders at once. Efficient way to retrieve sca
6341
6356
  params?: SummaryRequest) → `Promise<CollectionSummaryResponse>`
6342
6357
  Get collection-wide analytics summary across all orders. Returns daily scan counts and admin activity overview. ```typescript // Get all-time collection summary const summary = await order.getCollectionSummary('coll_123') console.log(`Admin activity count: ${summary.adminActivity.count}`) console.log('Scans by day:') summary.scansByDay.forEach(day => { console.log(` ${day.date}: ${day.scanCount} scans`) }) // Get summary for last 30 days const recentSummary = await order.getCollectionSummary('coll_123', { from: '2026-01-08T00:00:00Z', to: '2026-02-08T00:00:00Z' }) ```
6343
6358
 
6344
- **findByBatch**(collectionId: string,
6345
- batchId: string,
6346
- params?: FindOrdersByAttributeParams) → `Promise<FindOrdersByAttributeResponse>`
6347
- Find all orders containing items from a specific batch. Uses indexed queries for fast lookups across order items. ```typescript // Find orders with items from a specific batch const { orders } = await order.findByBatch('coll_123', 'BATCH-2024-001', { includeItems: true, limit: 50 }) // Get unique customers who received this batch const customers = [...new Set(orders.map(o => o.customerId).filter(Boolean))] console.log(`Batch delivered to ${customers.length} customers`) ```
6348
-
6349
6359
  **findOrdersByProduct**(collectionId: string,
6350
6360
  productId: string,
6351
6361
  params?: FindOrdersByAttributeParams) → `Promise<FindOrdersByAttributeResponse>`
6352
6362
  Find all orders containing items from a specific product. Uses indexed queries for fast lookups across order items. ```typescript // Find all orders containing a product const { orders, limit, offset } = await order.findOrdersByProduct('coll_123', 'prod_789', { limit: 100 }) console.log(`Product appears in ${orders.length} orders`) ```
6353
6363
 
6354
- **findByVariant**(collectionId: string,
6355
- variantId: string,
6356
- params?: FindOrdersByAttributeParams) → `Promise<FindOrdersByAttributeResponse>`
6357
- Find all orders containing items from a specific variant. Uses indexed queries for fast lookups across order items. ```typescript // Find orders with a specific variant const { orders } = await order.findByVariant('coll_123', 'var_456', { includeItems: true }) console.log(`Variant ${variantId} in ${orders.length} orders`) ```
6358
-
6359
- **findItemsByBatch**(collectionId: string,
6360
- batchId: string,
6361
- params?: FindItemsByAttributeParams) → `Promise<FindItemsByAttributeResponse>`
6362
- Get individual order items (not full orders) for a specific batch. Returns all matching items with optional order summary. ```typescript // Get items from a batch with order info const { items, count } = await order.findItemsByBatch('coll_123', 'BATCH-2024-001', { includeOrder: true, limit: 100 }) // Group by order status const byStatus = items.reduce((acc, item) => { const status = item.order?.status || 'unknown' acc[status] = (acc[status] || 0) + 1 return acc }, {}) ```
6363
-
6364
6364
  **findItemsByProduct**(collectionId: string,
6365
6365
  productId: string,
6366
6366
  params?: FindItemsByAttributeParams) → `Promise<FindItemsByAttributeResponse>`
6367
6367
  Get individual order items for a specific product. Returns all matching items with optional order summary. ```typescript // Get all items for a product const { items } = await order.findItemsByProduct('coll_123', 'prod_789', { includeOrder: true }) console.log(`Product delivered in ${items.length} order items`) ```
6368
6368
 
6369
- **findItemsByVariant**(collectionId: string,
6370
- variantId: string,
6371
- params?: FindItemsByAttributeParams) → `Promise<FindItemsByAttributeResponse>`
6372
- Get individual order items for a specific variant. Returns all matching items with optional order summary. ```typescript // Get variant items with order details const { items, count } = await order.findItemsByVariant('coll_123', 'var_456', { includeOrder: true, limit: 50 }) ```
6373
-
6374
6369
  **getOrderIdsByAttribute**(collectionId: string,
6375
- attribute: 'batchId' | 'productId' | 'variantId',
6370
+ attribute: 'productId',
6376
6371
  value: string,
6377
6372
  params?: GetOrderIdsParams) → `Promise<GetOrderIdsResponse>`
6378
- Get unique order IDs containing items matching the specified attribute. Lightweight query that only returns order IDs, not full order objects. ```typescript // Get order IDs for a batch (fast count) const { orderIds, count } = await order.getOrderIdsByAttribute( 'coll_123', 'batchId', 'BATCH-2024-001' ) console.log(`Batch appears in ${count} orders`) // Get order IDs for a product const productOrders = await order.getOrderIdsByAttribute( 'coll_123', 'productId', 'prod_789', { limit: 500 } ) ```
6373
+ Get unique order IDs containing items for a specific product. Lightweight query that only returns order IDs, not full order objects. ```typescript // Get order IDs for a product const productOrders = await order.getOrderIdsByAttribute( 'coll_123', 'productId', 'prod_789', { limit: 500 } ) ```
6379
6374
 
6380
6375
  ### product
6381
6376