@proveanything/smartlinks 1.7.0 → 1.7.2
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 +160 -132
- package/dist/api/tags.js +206 -167
- package/dist/docs/API_SUMMARY.md +162 -143
- package/dist/docs/interactions.md +291 -0
- package/dist/docs/manifests.md +200 -0
- package/dist/docs/mpa.md +135 -0
- package/dist/docs/overview.md +372 -0
- package/dist/openapi.yaml +266 -145
- package/dist/types/appManifest.d.ts +7 -2
- package/dist/types/tags.d.ts +116 -113
- package/dist/types/tags.js +3 -2
- package/docs/API_SUMMARY.md +162 -143
- package/docs/interactions.md +291 -0
- package/docs/manifests.md +200 -0
- package/docs/mpa.md +135 -0
- package/docs/overview.md +372 -0
- package/openapi.yaml +266 -145
- package/package.json +1 -1
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.2 | Generated: 2026-03-04T07:38:45.571Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -8,9 +8,11 @@ This is a concise summary of all available API functions and types.
|
|
|
8
8
|
|
|
9
9
|
For detailed guides on specific features:
|
|
10
10
|
|
|
11
|
+
- **[SmartLinks Microapp Overview](overview.md)** - Platform architecture, data model, auth patterns, storage, anti-patterns, and quick-reference for all SDK docs
|
|
11
12
|
- **[AI & Chat Completions](ai.md)** - Chat completions, RAG (document-grounded Q&A), voice integration, streaming, tool calling, podcast generation
|
|
12
13
|
- **[Widgets](widgets.md)** - Embeddable React components for parent applications
|
|
13
14
|
- **[Containers](containers.md)** - Building full-app embeddable containers (lazy-loaded)
|
|
15
|
+
- **[Multi-Page App Architecture](mpa.md)** - Vite MPA build pipeline: public/admin entry points, widget/container/executor bundles, content-hashed CDN assets
|
|
14
16
|
- **[App Configuration Files](app-manifest.md)** - `app.manifest.json` and `app.admin.json` reference — bundles, components, setup questions, import schemas, tunable fields, and metrics
|
|
15
17
|
- **[Executor Model](executor.md)** - Programmatic JS bundles for AI-driven setup, server-side SEO metadata generation, and LLM content for AI crawlers
|
|
16
18
|
- **[Realtime](realtime.md)** - Real-time data updates and WebSocket connections
|
|
@@ -23,7 +25,9 @@ For detailed guides on specific features:
|
|
|
23
25
|
- **[App Data Storage](app-data-storage.md)** - User-specific and collection-scoped app data storage
|
|
24
26
|
- **[App Objects: Cases, Threads & Records](app-objects.md)** - Generic app-scoped building blocks for support cases, discussions, bookings, registrations, and more
|
|
25
27
|
- **[Communications](comms.md)** - Transactional sends, multi-channel broadcasts, consent management, push registration, and analytics
|
|
28
|
+
- **[Interactions & Event Tracking](interactions.md)** - Log user events, count outcomes, query history, and define interaction types with permissions
|
|
26
29
|
- **[Deep Link Discovery](deep-link-discovery.md)** - Registering and discovering navigable app states for portal menus and AI orchestration
|
|
30
|
+
- **[AI-Native App Manifests](manifests.md)** - How AI workflows discover, configure, and import apps via structured manifests and prose guides
|
|
27
31
|
- **[AI Guide Template](ai-guide-template.md)** - A sample for an app on how to build an AI setup guide
|
|
28
32
|
|
|
29
33
|
## API Namespaces
|
|
@@ -51,7 +55,7 @@ The Smartlinks SDK is organized into the following namespaces:
|
|
|
51
55
|
- **segments** - Define dynamic/static audience segments; estimate and list recipients; schedule calculations.
|
|
52
56
|
|
|
53
57
|
— Analytics & Events —
|
|
54
|
-
- **interactions** - Log and analyze interactions/outcomes; aggregates and actor lists; interaction definition CRUD.
|
|
58
|
+
- **interactions** - Log and analyze interactions/outcomes; aggregates and actor lists; interaction definition CRUD. → [Guide](interactions.md)
|
|
55
59
|
|
|
56
60
|
— Automation —
|
|
57
61
|
- **journeys** - Configure automated flows triggered by events or schedules; steps, rules; full CRUD.
|
|
@@ -847,7 +851,11 @@ interface AppManifestFiles {
|
|
|
847
851
|
umd: string;
|
|
848
852
|
esm?: string;
|
|
849
853
|
};
|
|
850
|
-
|
|
854
|
+
* CSS file path — set to `null` (or omit) when the bundle ships no CSS.
|
|
855
|
+
* Most widgets and containers use Tailwind/shadcn classes from the parent and produce no CSS file.
|
|
856
|
+
* Only set to a non-null string if an actual CSS file exists in dist/;
|
|
857
|
+
* a non-null value pointing to a missing file will cause a 404 in the parent portal.
|
|
858
|
+
css?: string | null;
|
|
851
859
|
}
|
|
852
860
|
```
|
|
853
861
|
|
|
@@ -4897,99 +4905,101 @@ interface SegmentRecipientsResponse {
|
|
|
4897
4905
|
**Tag** (interface)
|
|
4898
4906
|
```typescript
|
|
4899
4907
|
interface Tag {
|
|
4900
|
-
id:
|
|
4901
|
-
orgId:
|
|
4902
|
-
tagId:
|
|
4903
|
-
collectionId: string
|
|
4904
|
-
productId
|
|
4905
|
-
variantId
|
|
4906
|
-
batchId
|
|
4907
|
-
proofId
|
|
4908
|
-
* Polymorphic
|
|
4909
|
-
*
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4908
|
+
id: string // Internal UUID
|
|
4909
|
+
orgId: string // Organisation ID
|
|
4910
|
+
tagId: string // Physical tag identifier (NFC UID, QR code, etc.)
|
|
4911
|
+
collectionId: string // Owning collection
|
|
4912
|
+
productId: string | null // Linked product
|
|
4913
|
+
variantId: string | null // Product variant
|
|
4914
|
+
batchId: string | null // Production batch
|
|
4915
|
+
proofId: string | null // Proof / serial number
|
|
4916
|
+
* Polymorphic ref type: `'app_record'`, `'app_case'`, `'app_thread'`, `'container'`, etc.
|
|
4917
|
+
* Always paired with `refId`.
|
|
4918
|
+
refType: string | null
|
|
4919
|
+
refId: string | null
|
|
4920
|
+
metadata: Record<string, any>
|
|
4921
|
+
createdAt: string // ISO 8601
|
|
4922
|
+
updatedAt: string // ISO 8601
|
|
4923
|
+
}
|
|
4924
|
+
```
|
|
4925
|
+
|
|
4926
|
+
**TagIndexEntry** (interface)
|
|
4927
|
+
```typescript
|
|
4928
|
+
interface TagIndexEntry {
|
|
4929
|
+
tagId: string
|
|
4930
|
+
collectionId: string
|
|
4931
|
+
}
|
|
4932
|
+
```
|
|
4933
|
+
|
|
4934
|
+
**TagEmbedded** (interface)
|
|
4935
|
+
```typescript
|
|
4936
|
+
interface TagEmbedded {
|
|
4937
|
+
products?: Record<string, any>
|
|
4938
|
+
* `proofId → proof record or virtual serial-number proof`
|
|
4939
|
+
* (when `embed` includes `'proof'`)
|
|
4940
|
+
proofs?: Record<string, any>
|
|
4941
|
+
* `containerId → Container row`
|
|
4942
|
+
* (for tags where `refType === 'container'`, when `embed` includes `'container'`)
|
|
4943
|
+
containers?: Record<string, any>
|
|
4944
|
+
* `refId → app_record | app_case | app_thread | container`
|
|
4945
|
+
* (when `embed` includes `'ref'`)
|
|
4946
|
+
refs?: Record<string, any>
|
|
4916
4947
|
}
|
|
4917
4948
|
```
|
|
4918
4949
|
|
|
4919
4950
|
**CreateTagRequest** (interface)
|
|
4920
4951
|
```typescript
|
|
4921
4952
|
interface CreateTagRequest {
|
|
4922
|
-
tagId:
|
|
4923
|
-
productId?:
|
|
4924
|
-
variantId?:
|
|
4925
|
-
batchId?:
|
|
4926
|
-
proofId?:
|
|
4927
|
-
useSerialNumber?: boolean
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
metadata?: Record<string, any> // Optional: Additional metadata
|
|
4933
|
-
force?: boolean // Optional: Overwrite if tag exists in same collection (default: false)
|
|
4934
|
-
}
|
|
4935
|
-
```
|
|
4936
|
-
|
|
4937
|
-
**CreateTagsBatchRequest** (interface)
|
|
4938
|
-
```typescript
|
|
4939
|
-
interface CreateTagsBatchRequest {
|
|
4940
|
-
tags: Array<{
|
|
4941
|
-
tagId: string // Required: Unique tag identifier
|
|
4942
|
-
productId: string // Required: Product ID
|
|
4943
|
-
variantId?: string // Optional: Variant ID
|
|
4944
|
-
batchId?: string // Optional: Batch ID
|
|
4945
|
-
proofId?: string // Optional: If omitted, auto-generates serial number
|
|
4946
|
-
metadata?: Record<string, any> // Optional: Additional metadata
|
|
4947
|
-
}>
|
|
4948
|
-
force?: boolean // Optional: Overwrite existing tags in same collection (default: false)
|
|
4953
|
+
tagId: string // Required
|
|
4954
|
+
productId?: string
|
|
4955
|
+
variantId?: string
|
|
4956
|
+
batchId?: string
|
|
4957
|
+
proofId?: string // Required if productId set, unless useSerialNumber=true
|
|
4958
|
+
useSerialNumber?: boolean // Auto-generate a serial number as proofId
|
|
4959
|
+
refType?: string // Must be paired with refId
|
|
4960
|
+
refId?: string // Must be paired with refType
|
|
4961
|
+
metadata?: Record<string, any>
|
|
4962
|
+
force?: boolean // Overwrite if tag already exists in this collection
|
|
4949
4963
|
}
|
|
4950
4964
|
```
|
|
4951
4965
|
|
|
4952
|
-
**
|
|
4966
|
+
**BatchCreateTagRequest** (interface)
|
|
4953
4967
|
```typescript
|
|
4954
|
-
interface
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
created: number // Successfully created
|
|
4958
|
-
updated: number // Successfully updated (with force=true)
|
|
4959
|
-
failed: number // Failed to create/update
|
|
4960
|
-
conflicts: number // Already exist (without force=true)
|
|
4961
|
-
}
|
|
4962
|
-
results: {
|
|
4963
|
-
created: Tag[] // Array of successfully created tags
|
|
4964
|
-
updated: Tag[] // Array of successfully updated tags
|
|
4965
|
-
failed: Array<{
|
|
4966
|
-
tagId: string
|
|
4967
|
-
reason: string // Error code (e.g., "TAG_ASSIGNED_ELSEWHERE", "CREATE_FAILED")
|
|
4968
|
-
message: string // Human-readable error message
|
|
4969
|
-
existingTag?: Tag // Existing tag if applicable
|
|
4970
|
-
}>
|
|
4971
|
-
conflicts: Array<{
|
|
4972
|
-
tagId: string
|
|
4973
|
-
reason: string // "TAG_ALREADY_ASSIGNED"
|
|
4974
|
-
message: string
|
|
4975
|
-
existingTag: Tag // The existing tag
|
|
4976
|
-
}>
|
|
4977
|
-
}
|
|
4968
|
+
interface BatchCreateTagRequest {
|
|
4969
|
+
tags: Omit<CreateTagRequest, 'force'>[]
|
|
4970
|
+
force?: boolean
|
|
4978
4971
|
}
|
|
4979
4972
|
```
|
|
4980
4973
|
|
|
4981
4974
|
**UpdateTagRequest** (interface)
|
|
4982
4975
|
```typescript
|
|
4983
4976
|
interface UpdateTagRequest {
|
|
4984
|
-
productId?:
|
|
4985
|
-
variantId?:
|
|
4986
|
-
batchId?:
|
|
4987
|
-
proofId?:
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4977
|
+
productId?: string
|
|
4978
|
+
variantId?: string
|
|
4979
|
+
batchId?: string
|
|
4980
|
+
proofId?: string
|
|
4981
|
+
refType?: string | null
|
|
4982
|
+
refId?: string | null
|
|
4983
|
+
metadata?: Record<string, any> // Merged with existing metadata
|
|
4984
|
+
}
|
|
4985
|
+
```
|
|
4986
|
+
|
|
4987
|
+
**BatchCreateResult** (interface)
|
|
4988
|
+
```typescript
|
|
4989
|
+
interface BatchCreateResult {
|
|
4990
|
+
summary: {
|
|
4991
|
+
total: number
|
|
4992
|
+
created: number
|
|
4993
|
+
updated: number
|
|
4994
|
+
failed: number
|
|
4995
|
+
conflicts: number
|
|
4996
|
+
}
|
|
4997
|
+
results: {
|
|
4998
|
+
created: Tag[]
|
|
4999
|
+
updated: Tag[]
|
|
5000
|
+
failed: Array<{ tagId: string; reason: string; message: string }>
|
|
5001
|
+
conflicts: Array<{ tagId: string; reason: string; message: string; existingTag: Tag }>
|
|
5002
|
+
}
|
|
4993
5003
|
}
|
|
4994
5004
|
```
|
|
4995
5005
|
|
|
@@ -5003,73 +5013,73 @@ interface DeleteTagResponse {
|
|
|
5003
5013
|
**ListTagsRequest** (interface)
|
|
5004
5014
|
```typescript
|
|
5005
5015
|
interface ListTagsRequest {
|
|
5006
|
-
limit?:
|
|
5007
|
-
offset?:
|
|
5008
|
-
productId?: string
|
|
5009
|
-
variantId?: string
|
|
5010
|
-
batchId?:
|
|
5011
|
-
refType?:
|
|
5012
|
-
refId?:
|
|
5016
|
+
limit?: number
|
|
5017
|
+
offset?: number
|
|
5018
|
+
productId?: string
|
|
5019
|
+
variantId?: string
|
|
5020
|
+
batchId?: string
|
|
5021
|
+
refType?: string
|
|
5022
|
+
refId?: string
|
|
5013
5023
|
}
|
|
5014
5024
|
```
|
|
5015
5025
|
|
|
5016
5026
|
**ListTagsResponse** (interface)
|
|
5017
5027
|
```typescript
|
|
5018
5028
|
interface ListTagsResponse {
|
|
5019
|
-
tags:
|
|
5020
|
-
limit:
|
|
5029
|
+
tags: Tag[]
|
|
5030
|
+
limit: number
|
|
5021
5031
|
offset: number
|
|
5022
5032
|
}
|
|
5023
5033
|
```
|
|
5024
5034
|
|
|
5025
|
-
**
|
|
5035
|
+
**LookupTagsRequest** (interface)
|
|
5026
5036
|
```typescript
|
|
5027
|
-
interface
|
|
5028
|
-
|
|
5037
|
+
interface LookupTagsRequest {
|
|
5038
|
+
tagIds: string[]
|
|
5039
|
+
embed?: string
|
|
5029
5040
|
}
|
|
5030
5041
|
```
|
|
5031
5042
|
|
|
5032
|
-
**
|
|
5043
|
+
**LookupTagsQueryRequest** (interface)
|
|
5033
5044
|
```typescript
|
|
5034
|
-
interface
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
product?: any // Included if embed contains "product"
|
|
5038
|
-
proof?: any // Included if embed contains "proof"
|
|
5045
|
+
interface LookupTagsQueryRequest {
|
|
5046
|
+
tagIds: string
|
|
5047
|
+
embed?: string
|
|
5039
5048
|
}
|
|
5040
5049
|
```
|
|
5041
5050
|
|
|
5042
|
-
**
|
|
5051
|
+
**ByRefRequest** (interface)
|
|
5043
5052
|
```typescript
|
|
5044
|
-
interface
|
|
5045
|
-
|
|
5046
|
-
|
|
5053
|
+
interface ByRefRequest {
|
|
5054
|
+
refType: string
|
|
5055
|
+
refId: string
|
|
5056
|
+
embed?: string
|
|
5047
5057
|
}
|
|
5048
5058
|
```
|
|
5049
5059
|
|
|
5050
|
-
**
|
|
5060
|
+
**ReverseTagLookupParams** (interface)
|
|
5051
5061
|
```typescript
|
|
5052
|
-
interface
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
proofs?: Record<string, any> // Map: proofId → Proof (if embed=proof)
|
|
5062
|
+
interface ReverseTagLookupParams {
|
|
5063
|
+
refType: string
|
|
5064
|
+
refId: string
|
|
5065
|
+
embed?: string
|
|
5057
5066
|
}
|
|
5058
5067
|
```
|
|
5059
5068
|
|
|
5060
|
-
**
|
|
5069
|
+
**PublicGetTagResponse** (interface)
|
|
5061
5070
|
```typescript
|
|
5062
|
-
interface
|
|
5063
|
-
|
|
5064
|
-
|
|
5071
|
+
interface PublicGetTagResponse {
|
|
5072
|
+
tag: Tag
|
|
5073
|
+
embedded: TagEmbedded
|
|
5065
5074
|
}
|
|
5066
5075
|
```
|
|
5067
5076
|
|
|
5068
|
-
**
|
|
5077
|
+
**TagLookupResponse** (interface)
|
|
5069
5078
|
```typescript
|
|
5070
|
-
interface
|
|
5071
|
-
|
|
5072
|
-
|
|
5079
|
+
interface TagLookupResponse {
|
|
5080
|
+
count: number
|
|
5081
|
+
tags: Tag[]
|
|
5082
|
+
embedded: TagEmbedded
|
|
5073
5083
|
}
|
|
5074
5084
|
```
|
|
5075
5085
|
|
|
@@ -5080,6 +5090,14 @@ interface ReverseTagLookupResponse {
|
|
|
5080
5090
|
}
|
|
5081
5091
|
```
|
|
5082
5092
|
|
|
5093
|
+
**ByRefResponse** (interface)
|
|
5094
|
+
```typescript
|
|
5095
|
+
interface ByRefResponse {
|
|
5096
|
+
tags: Tag[]
|
|
5097
|
+
embedded: TagEmbedded
|
|
5098
|
+
}
|
|
5099
|
+
```
|
|
5100
|
+
|
|
5083
5101
|
### template
|
|
5084
5102
|
|
|
5085
5103
|
**TemplateBase** (interface)
|
|
@@ -6533,55 +6551,56 @@ Get aggregate statistics for records POST /records/aggregate
|
|
|
6533
6551
|
|
|
6534
6552
|
**create**(collectionId: string,
|
|
6535
6553
|
data: CreateTagRequest) → `Promise<CreateTagResponse>`
|
|
6536
|
-
Create a single tag mapping. If
|
|
6554
|
+
Create a single tag mapping (admin). If `productId` is set without `proofId`, a serial number is auto-generated unless `useSerialNumber: true` is explicitly passed. `refType` and `refId` can be set independently of or alongside product/proof. ```typescript // Auto-generate serial number const tag = await tags.create('coll_123', { tagId: 'NFC-001', productId: 'prod_456', batchId: 'batch_2026_01', }) // Explicit proof + polymorphic ref const tag2 = await tags.create('coll_123', { tagId: 'NFC-002', refType: 'container', refId: 'container-uuid', }) ```
|
|
6537
6555
|
|
|
6538
6556
|
**createBatch**(collectionId: string,
|
|
6539
|
-
data:
|
|
6540
|
-
|
|
6557
|
+
data: BatchCreateTagRequest) → `Promise<BatchCreateResult>`
|
|
6558
|
+
Batch-create tags (admin). Tags with `productId` but no `proofId` automatically get serial numbers. Serial number generation is grouped by `(productId, variantId, batchId)` for efficiency. Partial success is possible — check `results` for individual outcomes. ```typescript const result = await tags.createBatch('coll_123', { tags: [ { tagId: 'NFC-001', productId: 'prod_456', batchId: 'batch_2026_01' }, { tagId: 'NFC-002', productId: 'prod_456', batchId: 'batch_2026_01' }, ], }) console.log(`Created: ${result.summary.created}, Conflicts: ${result.summary.conflicts}`) ```
|
|
6559
|
+
|
|
6560
|
+
**get**(collectionId: string,
|
|
6561
|
+
tagId: string) → `Promise<GetTagResponse>`
|
|
6562
|
+
Get a single tag by `tagId` (admin).
|
|
6541
6563
|
|
|
6542
6564
|
**update**(collectionId: string,
|
|
6543
6565
|
tagId: string,
|
|
6544
6566
|
data: UpdateTagRequest) → `Promise<UpdateTagResponse>`
|
|
6545
|
-
Update
|
|
6567
|
+
Update a tag (admin). Partial update — only provided fields are changed. `metadata` is deep-merged with the existing value. Pass `refType: null, refId: null` to clear the polymorphic ref. ```typescript const updated = await tags.update('coll_123', 'NFC-001', { variantId: 'var_premium', metadata: { notes: 'Updated to premium variant' }, }) // Clear polymorphic ref await tags.update('coll_123', 'NFC-001', { refType: null, refId: null }) ```
|
|
6546
6568
|
|
|
6547
6569
|
**remove**(collectionId: string,
|
|
6548
6570
|
tagId: string) → `Promise<DeleteTagResponse>`
|
|
6549
|
-
Delete a tag
|
|
6550
|
-
|
|
6551
|
-
**get**(collectionId: string,
|
|
6552
|
-
tagId: string) → `Promise<GetTagResponse>`
|
|
6553
|
-
Get a single tag mapping by tagId. ```typescript const tag = await tags.get('coll_123', 'TAG001') ```
|
|
6571
|
+
Delete a tag (admin). Permanently removes the tag from the per-org shard and the shared index.
|
|
6554
6572
|
|
|
6555
6573
|
**list**(collectionId: string,
|
|
6556
6574
|
params?: ListTagsRequest) → `Promise<ListTagsResponse>`
|
|
6557
|
-
List
|
|
6575
|
+
List tags with optional filters and pagination (admin). ```typescript // All tags for a product const { tags: list } = await tags.list('coll_123', { productId: 'prod_456' }) // All tags linked to a container const { tags: linked } = await tags.list('coll_123', { refType: 'container', refId: 'container-uuid', }) ```
|
|
6558
6576
|
|
|
6559
6577
|
**byRef**(collectionId: string,
|
|
6560
6578
|
params: ReverseTagLookupParams) → `Promise<ReverseTagLookupResponse>`
|
|
6561
|
-
Reverse lookup
|
|
6579
|
+
Reverse lookup — find all tags linked to a given object (admin). Uses a compound index on `(orgId, refType, refId)` on the per-org shard. No embed support on the admin side. ```typescript const { tags: linked } = await tags.byRef('coll_123', { refType: 'container', refId: 'container-uuid', }) ```
|
|
6562
6580
|
|
|
6563
|
-
**
|
|
6564
|
-
|
|
6565
|
-
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) ```
|
|
6581
|
+
**resolveTag**(tagId: string) → `Promise<TagIndexEntry>`
|
|
6582
|
+
Global tag resolve — returns `{ tagId, collectionId }` only. Use this **only** when you have a raw `tagId` and do not yet know which collection it belongs to. Queries the shared `tag_index` shard. Once `collectionId` is resolved, call `publicGetByCollection` for full data. > The global `/public/tags/by-ref` endpoint has been removed. > Use the collection-scoped `publicByRef` instead. ```typescript // Step 1: resolve collection const { collectionId } = await tags.resolveTag('NFC-001') // Step 2: full lookup with embedded data const { tag, embedded } = await tags.publicGetByCollection( collectionId, 'NFC-001', 'product,proof' ) ```
|
|
6566
6583
|
|
|
6567
|
-
**
|
|
6584
|
+
**publicGetByCollection**(collectionId: string,
|
|
6568
6585
|
tagId: string,
|
|
6569
|
-
|
|
6570
|
-
|
|
6586
|
+
embed?: string) → `Promise<PublicGetTagResponse>`
|
|
6587
|
+
Single tag lookup with optional embedded data (public). `GET /public/collection/:collectionId/tags/:tagId?embed=product,proof,container,ref` Supported `embed` values: `'product'`, `'proof'`, `'container'`, `'ref'` (`'collection'` is not supported — the collection is already known from the URL). ```typescript const { tag, embedded } = await tags.publicGetByCollection( 'coll_123', 'NFC-001', 'product,proof' ) const product = embedded.products?.[tag.productId!] const proof = embedded.proofs?.[tag.proofId!] ```
|
|
6571
6588
|
|
|
6572
|
-
**lookupTags**(
|
|
6573
|
-
|
|
6589
|
+
**lookupTags**(collectionId: string,
|
|
6590
|
+
data: LookupTagsRequest) → `Promise<TagLookupResponse>`
|
|
6591
|
+
Batch tag lookup via POST (public). `POST /public/collection/:collectionId/tags/lookup` Tags not belonging to this collection are filtered out silently. Returns deduplicated embedded objects alongside the tag array. ```typescript const { count, tags: list, embedded } = await tags.lookupTags('coll_123', { tagIds: ['NFC-001', 'NFC-002', 'NFC-003'], embed: 'product,proof', }) ```
|
|
6574
6592
|
|
|
6575
|
-
**
|
|
6576
|
-
|
|
6577
|
-
|
|
6593
|
+
**lookupTagsQuery**(collectionId: string,
|
|
6594
|
+
params: LookupTagsQueryRequest) → `Promise<TagLookupResponse>`
|
|
6595
|
+
Batch tag lookup via GET (public). `GET /public/collection/:collectionId/tags/lookup?tagIds=NFC-001,NFC-002&embed=product`
|
|
6578
6596
|
|
|
6579
|
-
**
|
|
6580
|
-
|
|
6597
|
+
**publicByRef**(collectionId: string,
|
|
6598
|
+
params: ReverseTagLookupParams) → `Promise<ByRefResponse>`
|
|
6599
|
+
Reverse lookup by ref via GET (public). `GET /public/collection/:collectionId/tags/by-ref?refType=container&refId=<uuid>&embed=ref` ```typescript const { tags: linked, embedded } = await tags.publicByRef('coll_123', { refType: 'container', refId: 'container-uuid', embed: 'container', }) const container = embedded.containers?.[containerId] ```
|
|
6581
6600
|
|
|
6582
|
-
**
|
|
6583
|
-
|
|
6584
|
-
|
|
6601
|
+
**publicByRefPost**(collectionId: string,
|
|
6602
|
+
data: ByRefRequest) → `Promise<ByRefResponse>`
|
|
6603
|
+
Reverse lookup by ref via POST (public). `POST /public/collection/:collectionId/tags/by-ref`
|
|
6585
6604
|
|
|
6586
6605
|
### template
|
|
6587
6606
|
|