@proveanything/smartlinks 1.6.7 → 1.7.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.
@@ -12,10 +12,18 @@ export interface Tag {
12
12
  orgId: string;
13
13
  tagId: string;
14
14
  collectionId: string;
15
- productId: string;
15
+ productId?: string;
16
16
  variantId?: string | null;
17
17
  batchId?: string | null;
18
- proofId: string;
18
+ proofId?: string;
19
+ /**
20
+ * Polymorphic reference type linking the tag to any app object, e.g.
21
+ * `'app_record'`, `'app_case'`, `'container'`, etc.
22
+ * Must always be paired with `refId`.
23
+ */
24
+ refType?: string;
25
+ /** UUID of the referenced object. Must always be paired with `refType`. */
26
+ refId?: string;
19
27
  metadata: Record<string, any>;
20
28
  createdAt: string;
21
29
  updatedAt: string;
@@ -26,11 +34,18 @@ export interface Tag {
26
34
  */
27
35
  export interface CreateTagRequest {
28
36
  tagId: string;
29
- productId: string;
37
+ productId?: string;
30
38
  variantId?: string;
31
39
  batchId?: string;
32
40
  proofId?: string;
33
41
  useSerialNumber?: boolean;
42
+ /**
43
+ * Polymorphic ref type linking this tag to any app object (e.g. `'app_record'`, `'container'`).
44
+ * Must be paired with `refId`. A tag can simultaneously have a product/proof AND a ref.
45
+ */
46
+ refType?: string;
47
+ /** UUID of the referenced object. Must be paired with `refType`. */
48
+ refId?: string;
34
49
  metadata?: Record<string, any>;
35
50
  force?: boolean;
36
51
  }
@@ -91,6 +106,13 @@ export interface UpdateTagRequest {
91
106
  variantId?: string | null;
92
107
  batchId?: string | null;
93
108
  proofId?: string;
109
+ /**
110
+ * Polymorphic ref type. Must be paired with `refId`.
111
+ * Set both to `null` / omit to leave unchanged.
112
+ */
113
+ refType?: string;
114
+ /** UUID of the referenced object. Must be paired with `refType`. */
115
+ refId?: string;
94
116
  metadata?: Record<string, any>;
95
117
  }
96
118
  /**
@@ -118,6 +140,10 @@ export interface ListTagsRequest {
118
140
  productId?: string;
119
141
  variantId?: string;
120
142
  batchId?: string;
143
+ /** Optional: Filter by polymorphic ref type (e.g. `'container'`, `'app_record'`) */
144
+ refType?: string;
145
+ /** Optional: Filter by polymorphic ref UUID */
146
+ refId?: string;
121
147
  }
122
148
  /**
123
149
  * Response from listing tags.
@@ -170,3 +196,21 @@ export interface PublicBatchLookupQueryRequest {
170
196
  */
171
197
  export interface PublicBatchLookupQueryResponse extends PublicBatchLookupResponse {
172
198
  }
199
+ /**
200
+ * Query parameters for the reverse-lookup endpoint.
201
+ * Finds all tags linked to a given app object across any collection.
202
+ */
203
+ export interface ReverseTagLookupParams {
204
+ /** Required — polymorphic ref type, e.g. `'app_record'`, `'container'` */
205
+ refType: string;
206
+ /** Required — UUID of the referenced object */
207
+ refId: string;
208
+ }
209
+ /**
210
+ * Response from the reverse-lookup endpoint.
211
+ * Uses a global cross-shard index so it is safe to call without knowing
212
+ * which collection the object belongs to.
213
+ */
214
+ export interface ReverseTagLookupResponse {
215
+ tags: Tag[];
216
+ }