@proveanything/smartlinks 1.0.28 → 1.0.30
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/API_SUMMARY.md +672 -213
- package/README.md +430 -0
- package/dist/api/collection.js +1 -1
- package/dist/http.d.ts +5 -3
- package/dist/http.js +5 -3
- package/package.json +19 -3
- package/build-docs.ts +0 -69
- package/debug.log +0 -6
- package/examples/browser-demo.html +0 -43
- package/examples/node-demo.ts +0 -50
- package/examples/react-demo.tsx +0 -58
- package/generate-api-summary.js +0 -279
- package/generate-api-summary.ts +0 -83
- package/openapi.yaml +0 -130
- package/scripts/copy-docs.js +0 -11
- package/src/api/appConfiguration.ts +0 -104
- package/src/api/asset.ts +0 -133
- package/src/api/attestation.ts +0 -69
- package/src/api/auth.ts +0 -103
- package/src/api/batch.ts +0 -173
- package/src/api/claimSet.ts +0 -131
- package/src/api/collection.ts +0 -117
- package/src/api/crate.ts +0 -43
- package/src/api/form.ts +0 -57
- package/src/api/index.ts +0 -14
- package/src/api/product.ts +0 -128
- package/src/api/proof.ts +0 -32
- package/src/api/serialNumber.ts +0 -0
- package/src/api/variant.ts +0 -173
- package/src/http.ts +0 -363
- package/src/index.ts +0 -29
- package/src/types/appConfiguration.ts +0 -12
- package/src/types/asset.ts +0 -9
- package/src/types/attestation.ts +0 -19
- package/src/types/batch.ts +0 -15
- package/src/types/collection.ts +0 -68
- package/src/types/error.ts +0 -10
- package/src/types/index.ts +0 -11
- package/src/types/product.ts +0 -33
- package/src/types/proof.ts +0 -20
- package/src/types/serialNumber.ts +0 -0
- package/src/types/variant.ts +0 -15
- package/tsconfig.json +0 -15
- package/typedoc.json +0 -18
package/API_SUMMARY.md
CHANGED
|
@@ -2,6 +2,66 @@
|
|
|
2
2
|
|
|
3
3
|
This is a concise summary of all available API functions and types.
|
|
4
4
|
|
|
5
|
+
## API Namespaces
|
|
6
|
+
|
|
7
|
+
The Smartlinks SDK is organized into the following namespaces:
|
|
8
|
+
|
|
9
|
+
- **appConfiguration** - Application configuration and settings management
|
|
10
|
+
- **asset** - File upload and asset management for collections, products, and proofs
|
|
11
|
+
- **attestation** - Digital attestations and verification for products
|
|
12
|
+
- **auth** - Authentication, login, and user account management
|
|
13
|
+
- **batch** - Product batch management and tracking
|
|
14
|
+
- **claimSet** - Claim creation, management, and verification
|
|
15
|
+
- **collection** - Collection CRUD operations and management
|
|
16
|
+
- **crate** - Container/crate management for organizing products
|
|
17
|
+
- **form** - Dynamic form creation and submission
|
|
18
|
+
- **product** - Product CRUD operations and management within collections
|
|
19
|
+
- **proof** - Product proof retrieval and validation
|
|
20
|
+
- **serialNumber** - Functions for serialNumber operations
|
|
21
|
+
- **variant** - Product variant management and tracking
|
|
22
|
+
|
|
23
|
+
## HTTP Utilities
|
|
24
|
+
|
|
25
|
+
Core HTTP functions for API configuration and communication:
|
|
26
|
+
|
|
27
|
+
**initializeApi**(options: {
|
|
28
|
+
baseURL: string
|
|
29
|
+
apiKey?: string
|
|
30
|
+
bearerToken?: string
|
|
31
|
+
proxyMode?: boolean
|
|
32
|
+
}) → `void`
|
|
33
|
+
Call this once (e.g. at app startup) to configure baseURL/auth.
|
|
34
|
+
|
|
35
|
+
**setBearerToken**(token: string | undefined) → `void`
|
|
36
|
+
Allows setting the bearerToken at runtime (e.g. after login/logout).
|
|
37
|
+
|
|
38
|
+
**request**(path: string) → `Promise<T>`
|
|
39
|
+
Internal helper that performs a GET request to \`\${baseURL}\${path}\`, injecting headers for apiKey or bearerToken if present. Returns the parsed JSON as T, or throws an Error.
|
|
40
|
+
|
|
41
|
+
**post**(path: string,
|
|
42
|
+
body: any,
|
|
43
|
+
extraHeaders?: Record<string, string>) → `Promise<T>`
|
|
44
|
+
Internal helper that performs a POST request to `${baseURL}${path}`, injecting headers for apiKey or bearerToken if present. If body is FormData, Content-Type is not set. Returns the parsed JSON as T, or throws an Error.
|
|
45
|
+
|
|
46
|
+
**put**(path: string,
|
|
47
|
+
body: any,
|
|
48
|
+
extraHeaders?: Record<string, string>) → `Promise<T>`
|
|
49
|
+
Internal helper that performs a PUT request to `${baseURL}${path}`, injecting headers for apiKey or bearerToken if present. If body is FormData, Content-Type is not set. Returns the parsed JSON as T, or throws an Error.
|
|
50
|
+
|
|
51
|
+
**requestWithOptions**(path: string,
|
|
52
|
+
options: RequestInit) → `Promise<T>`
|
|
53
|
+
Internal helper that performs a request to `${baseURL}${path}` with custom options, injecting headers for apiKey or bearerToken if present. Returns the parsed JSON as T, or throws an Error.
|
|
54
|
+
|
|
55
|
+
**del**(path: string,
|
|
56
|
+
extraHeaders?: Record<string, string>) → `Promise<T>`
|
|
57
|
+
Internal helper that performs a DELETE request to `${baseURL}${path}`, injecting headers for apiKey or bearerToken if present. Returns the parsed JSON as T, or throws an Error.
|
|
58
|
+
|
|
59
|
+
**getApiHeaders**() → `Record<string, string>`
|
|
60
|
+
Returns the common headers used for API requests, including apiKey and bearerToken if set.
|
|
61
|
+
|
|
62
|
+
**sendCustomProxyMessage**(request: string, params: any) → `Promise<T>`
|
|
63
|
+
Sends a custom proxy message to the parent Smartlinks application when running in an iframe. This function is used to communicate with the parent window when the SDK is embedded in an iframe and proxyMode is enabled. It sends a message to the parent and waits for a response.
|
|
64
|
+
|
|
5
65
|
## Types
|
|
6
66
|
|
|
7
67
|
### appConfiguration
|
|
@@ -9,9 +69,9 @@ This is a concise summary of all available API functions and types.
|
|
|
9
69
|
**AppConfigurationResponse** (interface)
|
|
10
70
|
```typescript
|
|
11
71
|
interface AppConfigurationResponse {
|
|
12
|
-
id: string
|
|
13
|
-
name: string
|
|
14
|
-
settings?: Record<string, any
|
|
72
|
+
id: string
|
|
73
|
+
name: string
|
|
74
|
+
settings?: Record<string, any>
|
|
15
75
|
}
|
|
16
76
|
```
|
|
17
77
|
|
|
@@ -20,9 +80,9 @@ interface AppConfigurationResponse {
|
|
|
20
80
|
**AssetResponse** (interface)
|
|
21
81
|
```typescript
|
|
22
82
|
interface AssetResponse {
|
|
23
|
-
id: string
|
|
24
|
-
name: string
|
|
25
|
-
url: string
|
|
83
|
+
id: string
|
|
84
|
+
name: string
|
|
85
|
+
url: string
|
|
26
86
|
}
|
|
27
87
|
```
|
|
28
88
|
|
|
@@ -31,29 +91,29 @@ interface AssetResponse {
|
|
|
31
91
|
**AttestationResponse** (interface)
|
|
32
92
|
```typescript
|
|
33
93
|
interface AttestationResponse {
|
|
34
|
-
id: string
|
|
35
|
-
createdAt: string
|
|
36
|
-
updatedAt: string
|
|
37
|
-
public: Record<string, any
|
|
38
|
-
private: Record<string, any
|
|
39
|
-
proof: Record<string, any
|
|
94
|
+
id: string
|
|
95
|
+
createdAt: string
|
|
96
|
+
updatedAt: string
|
|
97
|
+
public: Record<string, any>
|
|
98
|
+
private: Record<string, any>
|
|
99
|
+
proof: Record<string, any>
|
|
40
100
|
}
|
|
41
101
|
```
|
|
42
102
|
|
|
43
103
|
**AttestationCreateRequest** (interface)
|
|
44
104
|
```typescript
|
|
45
105
|
interface AttestationCreateRequest {
|
|
46
|
-
public: Record<string, any
|
|
47
|
-
private: Record<string, any
|
|
48
|
-
proof: Record<string, any
|
|
106
|
+
public: Record<string, any>
|
|
107
|
+
private: Record<string, any>
|
|
108
|
+
proof: Record<string, any>
|
|
49
109
|
}
|
|
50
110
|
```
|
|
51
111
|
|
|
52
112
|
**AttestationUpdateRequest** (interface)
|
|
53
113
|
```typescript
|
|
54
114
|
interface AttestationUpdateRequest {
|
|
55
|
-
type?: string
|
|
56
|
-
data?: Record<string, any
|
|
115
|
+
type?: string
|
|
116
|
+
data?: Record<string, any>
|
|
57
117
|
}
|
|
58
118
|
```
|
|
59
119
|
|
|
@@ -70,42 +130,43 @@ interface AttestationUpdateRequest {
|
|
|
70
130
|
**CollectionResponse** (interface)
|
|
71
131
|
```typescript
|
|
72
132
|
interface CollectionResponse {
|
|
73
|
-
id: string
|
|
74
|
-
title: string
|
|
75
|
-
description: string
|
|
133
|
+
id: string
|
|
134
|
+
title: string
|
|
135
|
+
description: string
|
|
76
136
|
headerImage?: {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
137
|
+
url: string
|
|
138
|
+
thumbnails: {
|
|
139
|
+
x100: string
|
|
140
|
+
x200: string
|
|
141
|
+
x512: string
|
|
142
|
+
}
|
|
143
|
+
}
|
|
84
144
|
logoImage?: {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
145
|
+
url: string
|
|
146
|
+
thumbnails: {
|
|
147
|
+
x100: string
|
|
148
|
+
x200: string
|
|
149
|
+
x512: string
|
|
150
|
+
}
|
|
151
|
+
}
|
|
92
152
|
loaderImage?: {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
153
|
+
overwriteName: string
|
|
154
|
+
name: string
|
|
155
|
+
type: string
|
|
156
|
+
url: string
|
|
157
|
+
}
|
|
98
158
|
languages?: {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
159
|
+
code: string
|
|
160
|
+
lang: string
|
|
161
|
+
supported: boolean
|
|
162
|
+
}[],
|
|
103
163
|
roles: {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
164
|
+
[userId: string]: string
|
|
165
|
+
}
|
|
166
|
+
groupTags?: string[]
|
|
167
|
+
redirectUrl?: string
|
|
168
|
+
shortId: string,
|
|
169
|
+
dark?: boolean
|
|
109
170
|
}
|
|
110
171
|
```
|
|
111
172
|
|
|
@@ -114,8 +175,8 @@ interface CollectionResponse {
|
|
|
114
175
|
**ErrorResponse** (interface)
|
|
115
176
|
```typescript
|
|
116
177
|
interface ErrorResponse {
|
|
117
|
-
code: number
|
|
118
|
-
message: string
|
|
178
|
+
code: number
|
|
179
|
+
message: string
|
|
119
180
|
}
|
|
120
181
|
```
|
|
121
182
|
|
|
@@ -124,22 +185,24 @@ interface ErrorResponse {
|
|
|
124
185
|
**ProductResponse** (interface)
|
|
125
186
|
```typescript
|
|
126
187
|
interface ProductResponse {
|
|
127
|
-
id: string
|
|
128
|
-
name: string
|
|
129
|
-
collectionId: string
|
|
130
|
-
description: string
|
|
188
|
+
id: string
|
|
189
|
+
name: string
|
|
190
|
+
collectionId: string
|
|
191
|
+
description: string
|
|
131
192
|
heroImage: {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
193
|
+
url: string
|
|
194
|
+
thumbnails: {
|
|
195
|
+
x100: string
|
|
196
|
+
x200: string
|
|
197
|
+
x512: string
|
|
198
|
+
}
|
|
199
|
+
}
|
|
139
200
|
groupTags: {
|
|
140
|
-
|
|
201
|
+
[tagName: string]: boolean
|
|
202
|
+
}
|
|
141
203
|
data: {
|
|
142
|
-
|
|
204
|
+
[key: string]: any
|
|
205
|
+
}
|
|
143
206
|
}
|
|
144
207
|
```
|
|
145
208
|
|
|
@@ -148,13 +211,13 @@ interface ProductResponse {
|
|
|
148
211
|
**ProofResponse** (interface)
|
|
149
212
|
```typescript
|
|
150
213
|
interface ProofResponse {
|
|
151
|
-
collectionId: string
|
|
152
|
-
createdAt: string
|
|
153
|
-
id: string
|
|
154
|
-
productId: string
|
|
155
|
-
tokenId: string
|
|
156
|
-
userId: string
|
|
157
|
-
values: Record<string, any
|
|
214
|
+
collectionId: string
|
|
215
|
+
createdAt: string
|
|
216
|
+
id: string
|
|
217
|
+
productId: string
|
|
218
|
+
tokenId: string
|
|
219
|
+
userId: string
|
|
220
|
+
values: Record<string, any>
|
|
158
221
|
}
|
|
159
222
|
```
|
|
160
223
|
|
|
@@ -170,243 +233,639 @@ interface ProofResponse {
|
|
|
170
233
|
|
|
171
234
|
### appConfiguration
|
|
172
235
|
|
|
173
|
-
**getConfig**(opts: AppConfigOptions) → `any
|
|
236
|
+
**getConfig**(opts: AppConfigOptions) → `Promise<any>`
|
|
237
|
+
|
|
238
|
+
**setConfig**(opts: AppConfigOptions) → `Promise<any>`
|
|
239
|
+
|
|
240
|
+
**deleteConfig**(opts: AppConfigOptions) → `Promise<void>`
|
|
241
|
+
|
|
242
|
+
**getData**(opts: AppConfigOptions) → `Promise<any[]>`
|
|
243
|
+
|
|
244
|
+
**getDataItem**(opts: AppConfigOptions) → `Promise<any>`
|
|
245
|
+
|
|
246
|
+
**setDataItem**(opts: AppConfigOptions) → `Promise<any>`
|
|
247
|
+
|
|
248
|
+
**deleteDataItem**(opts: AppConfigOptions) → `Promise<void>`
|
|
174
249
|
|
|
175
|
-
**
|
|
250
|
+
**getConfig**(opts: AppConfigOptions) → `Promise<any>`
|
|
176
251
|
|
|
177
|
-
**
|
|
252
|
+
**setConfig**(opts: AppConfigOptions) → `Promise<any>`
|
|
178
253
|
|
|
179
|
-
**
|
|
254
|
+
**deleteConfig**(opts: AppConfigOptions) → `Promise<void>`
|
|
180
255
|
|
|
181
|
-
**
|
|
256
|
+
**getData**(opts: AppConfigOptions) → `Promise<any[]>`
|
|
182
257
|
|
|
183
|
-
**
|
|
258
|
+
**getDataItem**(opts: AppConfigOptions) → `Promise<any>`
|
|
184
259
|
|
|
185
|
-
**
|
|
260
|
+
**setDataItem**(opts: AppConfigOptions) → `Promise<any>`
|
|
261
|
+
|
|
262
|
+
**deleteDataItem**(opts: AppConfigOptions) → `Promise<void>`
|
|
186
263
|
|
|
187
264
|
### asset
|
|
188
265
|
|
|
189
|
-
**getForCollection**(collectionId: string,
|
|
266
|
+
**getForCollection**(collectionId: string,
|
|
267
|
+
assetId: string) → `Promise<AssetResponse>`
|
|
190
268
|
|
|
191
|
-
**listForCollection**(collectionId: string) → `AssetResponse[]
|
|
269
|
+
**listForCollection**(collectionId: string) → `Promise<AssetResponse[]>`
|
|
192
270
|
|
|
193
|
-
**getForProduct**(collectionId: string,
|
|
271
|
+
**getForProduct**(collectionId: string,
|
|
272
|
+
productId: string,
|
|
273
|
+
assetId: string) → `Promise<AssetResponse>`
|
|
194
274
|
|
|
195
|
-
**listForProduct**(collectionId: string,
|
|
275
|
+
**listForProduct**(collectionId: string,
|
|
276
|
+
productId: string) → `Promise<AssetResponse[]>`
|
|
196
277
|
|
|
197
|
-
**getForProof**(collectionId: string,
|
|
278
|
+
**getForProof**(collectionId: string,
|
|
279
|
+
productId: string,
|
|
280
|
+
proofId: string,
|
|
281
|
+
assetId: string) → `Promise<AssetResponse>`
|
|
198
282
|
|
|
199
|
-
**listForProof**(collectionId: string,
|
|
283
|
+
**listForProof**(collectionId: string,
|
|
284
|
+
productId: string,
|
|
285
|
+
proofId: string,
|
|
286
|
+
appId?: string) → `Promise<AssetResponse[]>`
|
|
200
287
|
|
|
201
|
-
**uploadAsset**(collectionId: string,
|
|
202
|
-
|
|
288
|
+
**uploadAsset**(collectionId: string,
|
|
289
|
+
productId: string,
|
|
290
|
+
proofId: string,
|
|
291
|
+
file: File,
|
|
292
|
+
extraData?: Record<string, any>,
|
|
293
|
+
onProgress?: (percent: number) → `void`
|
|
294
|
+
Uploads an asset file to a proof, with optional extraData as JSON. Supports progress reporting via onProgress callback (browser only).
|
|
203
295
|
|
|
204
|
-
|
|
296
|
+
**getForCollection**(collectionId: string,
|
|
297
|
+
assetId: string) → `Promise<AssetResponse>`
|
|
205
298
|
|
|
206
|
-
**
|
|
207
|
-
List all attestations for a proof.
|
|
299
|
+
**listForCollection**(collectionId: string) → `Promise<AssetResponse[]>`
|
|
208
300
|
|
|
209
|
-
**
|
|
210
|
-
|
|
301
|
+
**getForProduct**(collectionId: string,
|
|
302
|
+
productId: string,
|
|
303
|
+
assetId: string) → `Promise<AssetResponse>`
|
|
211
304
|
|
|
212
|
-
**
|
|
213
|
-
|
|
305
|
+
**listForProduct**(collectionId: string,
|
|
306
|
+
productId: string) → `Promise<AssetResponse[]>`
|
|
307
|
+
|
|
308
|
+
**getForProof**(collectionId: string,
|
|
309
|
+
productId: string,
|
|
310
|
+
proofId: string,
|
|
311
|
+
assetId: string) → `Promise<AssetResponse>`
|
|
312
|
+
|
|
313
|
+
**listForProof**(collectionId: string,
|
|
314
|
+
productId: string,
|
|
315
|
+
proofId: string,
|
|
316
|
+
appId?: string) → `Promise<AssetResponse[]>`
|
|
214
317
|
|
|
215
|
-
**
|
|
318
|
+
**uploadAsset**(collectionId: string,
|
|
319
|
+
productId: string,
|
|
320
|
+
proofId: string,
|
|
321
|
+
file: File,
|
|
322
|
+
extraData?: Record<string, any>,
|
|
323
|
+
onProgress?: (percent: number) → `void`
|
|
324
|
+
Uploads an asset file to a proof, with optional extraData as JSON. Supports progress reporting via onProgress callback (browser only).
|
|
325
|
+
|
|
326
|
+
### attestation
|
|
327
|
+
|
|
328
|
+
**list**(collectionId: string,
|
|
329
|
+
productId: string,
|
|
330
|
+
proofId: string) → `Promise<AttestationResponse[]>`
|
|
216
331
|
List all attestations for a proof.
|
|
217
332
|
|
|
218
|
-
**
|
|
333
|
+
**get**(collectionId: string,
|
|
334
|
+
productId: string,
|
|
335
|
+
proofId: string,
|
|
336
|
+
attestationId: string) → `Promise<AttestationResponse>`
|
|
337
|
+
Get a single attestation by ID.
|
|
338
|
+
|
|
339
|
+
**create**(collectionId: string,
|
|
340
|
+
productId: string,
|
|
341
|
+
proofId: string,
|
|
342
|
+
data: AttestationCreateRequest) → `Promise<AttestationResponse>`
|
|
343
|
+
Create a new attestation for a proof.
|
|
344
|
+
|
|
345
|
+
**update**(collectionId: string,
|
|
346
|
+
productId: string,
|
|
347
|
+
proofId: string,
|
|
348
|
+
attestationId: string,
|
|
349
|
+
data: AttestationUpdateRequest) → `Promise<AttestationResponse>`
|
|
350
|
+
Update an attestation.
|
|
351
|
+
|
|
352
|
+
**remove**(collectionId: string,
|
|
353
|
+
productId: string,
|
|
354
|
+
proofId: string,
|
|
355
|
+
attestationId: string) → `Promise<void>`
|
|
356
|
+
Delete an attestation.
|
|
357
|
+
|
|
358
|
+
**list**(collectionId: string,
|
|
359
|
+
productId: string,
|
|
360
|
+
proofId: string) → `Promise<AttestationResponse[]>`
|
|
219
361
|
List all attestations for a proof.
|
|
220
362
|
|
|
363
|
+
**get**(collectionId: string,
|
|
364
|
+
productId: string,
|
|
365
|
+
proofId: string,
|
|
366
|
+
attestationId: string) → `Promise<AttestationResponse>`
|
|
367
|
+
Get a single attestation by ID.
|
|
368
|
+
|
|
369
|
+
**create**(collectionId: string,
|
|
370
|
+
productId: string,
|
|
371
|
+
proofId: string,
|
|
372
|
+
data: AttestationCreateRequest) → `Promise<AttestationResponse>`
|
|
373
|
+
Create a new attestation for a proof.
|
|
374
|
+
|
|
375
|
+
**update**(collectionId: string,
|
|
376
|
+
productId: string,
|
|
377
|
+
proofId: string,
|
|
378
|
+
attestationId: string,
|
|
379
|
+
data: AttestationUpdateRequest) → `Promise<AttestationResponse>`
|
|
380
|
+
Update an attestation.
|
|
381
|
+
|
|
382
|
+
**remove**(collectionId: string,
|
|
383
|
+
productId: string,
|
|
384
|
+
proofId: string,
|
|
385
|
+
attestationId: string) → `Promise<void>`
|
|
386
|
+
Delete an attestation.
|
|
387
|
+
|
|
221
388
|
### auth
|
|
222
389
|
|
|
223
|
-
**login**(email: string, password: string) → `LoginResponse
|
|
390
|
+
**login**(email: string, password: string) → `Promise<LoginResponse>`
|
|
224
391
|
Login with email and password. Sets the bearerToken for subsequent API calls.
|
|
225
392
|
|
|
226
|
-
**
|
|
227
|
-
|
|
393
|
+
**logout**() → `void`
|
|
394
|
+
Logout (clears bearerToken for future API calls).
|
|
395
|
+
|
|
396
|
+
**verifyToken**(token?: string) → `Promise<VerifyTokenResponse>`
|
|
397
|
+
Verifies the current bearerToken (or a provided token). Returns user/account info if valid.
|
|
398
|
+
|
|
399
|
+
**getAccount**() → `Promise<AccountInfoResponse>`
|
|
400
|
+
Gets current account information for the logged in user. Returns user, owner, account, and location objects.
|
|
228
401
|
|
|
229
|
-
**
|
|
402
|
+
**login**(email: string, password: string) → `Promise<LoginResponse>`
|
|
230
403
|
Login with email and password. Sets the bearerToken for subsequent API calls.
|
|
231
404
|
|
|
405
|
+
**logout**() → `void`
|
|
406
|
+
Logout (clears bearerToken for future API calls).
|
|
407
|
+
|
|
408
|
+
**verifyToken**(token?: string) → `Promise<VerifyTokenResponse>`
|
|
409
|
+
Verifies the current bearerToken (or a provided token). Returns user/account info if valid.
|
|
410
|
+
|
|
411
|
+
**getAccount**() → `Promise<AccountInfoResponse>`
|
|
412
|
+
Gets current account information for the logged in user. Returns user, owner, account, and location objects.
|
|
413
|
+
|
|
232
414
|
### batch
|
|
233
415
|
|
|
234
|
-
**get**(collectionId: string,
|
|
235
|
-
|
|
416
|
+
**get**(collectionId: string,
|
|
417
|
+
productId: string,
|
|
418
|
+
batchId: string) → `Promise<BatchResponse>`
|
|
419
|
+
Get a single batch by ID for a collection and product (admin only).
|
|
420
|
+
|
|
421
|
+
**list**(collectionId: string,
|
|
422
|
+
productId: string) → `Promise<BatchResponse[]>`
|
|
423
|
+
List all batches for a collection and product (admin only).
|
|
424
|
+
|
|
425
|
+
**create**(collectionId: string,
|
|
426
|
+
productId: string,
|
|
427
|
+
data: BatchCreateRequest) → `Promise<BatchResponse>`
|
|
428
|
+
Create a new batch for a collection and product (admin only).
|
|
429
|
+
|
|
430
|
+
**update**(collectionId: string,
|
|
431
|
+
productId: string,
|
|
432
|
+
batchId: string,
|
|
433
|
+
data: BatchUpdateRequest) → `Promise<BatchResponse>`
|
|
434
|
+
Update a batch for a collection and product (admin only).
|
|
435
|
+
|
|
436
|
+
**remove**(collectionId: string,
|
|
437
|
+
productId: string,
|
|
438
|
+
batchId: string) → `Promise<void>`
|
|
439
|
+
Delete a batch for a collection and product (admin only).
|
|
440
|
+
|
|
441
|
+
**getPublic**(collectionId: string,
|
|
442
|
+
productId: string,
|
|
443
|
+
batchId: string) → `Promise<BatchResponse>`
|
|
444
|
+
Get a single batch by ID for a collection and product (public endpoint).
|
|
445
|
+
|
|
446
|
+
**getSN**(collectionId: string,
|
|
447
|
+
productId: string,
|
|
448
|
+
batchId: string,
|
|
449
|
+
startIndex: number = 0,
|
|
450
|
+
count: number = 10) → `Promise<any>`
|
|
451
|
+
Get serial numbers for a batch (admin only).
|
|
452
|
+
|
|
453
|
+
**lookupSN**(collectionId: string,
|
|
454
|
+
productId: string,
|
|
455
|
+
batchId: string,
|
|
456
|
+
codeId: string) → `Promise<any>`
|
|
457
|
+
Look up a serial number by code for a batch (admin only).
|
|
458
|
+
|
|
459
|
+
**get**(collectionId: string,
|
|
460
|
+
productId: string,
|
|
461
|
+
batchId: string) → `Promise<BatchResponse>`
|
|
462
|
+
Get a single batch by ID for a collection and product (admin only).
|
|
463
|
+
|
|
464
|
+
**list**(collectionId: string,
|
|
465
|
+
productId: string) → `Promise<BatchResponse[]>`
|
|
466
|
+
List all batches for a collection and product (admin only).
|
|
467
|
+
|
|
468
|
+
**create**(collectionId: string,
|
|
469
|
+
productId: string,
|
|
470
|
+
data: BatchCreateRequest) → `Promise<BatchResponse>`
|
|
471
|
+
Create a new batch for a collection and product (admin only).
|
|
472
|
+
|
|
473
|
+
**update**(collectionId: string,
|
|
474
|
+
productId: string,
|
|
475
|
+
batchId: string,
|
|
476
|
+
data: BatchUpdateRequest) → `Promise<BatchResponse>`
|
|
477
|
+
Update a batch for a collection and product (admin only).
|
|
478
|
+
|
|
479
|
+
**remove**(collectionId: string,
|
|
480
|
+
productId: string,
|
|
481
|
+
batchId: string) → `Promise<void>`
|
|
482
|
+
Delete a batch for a collection and product (admin only).
|
|
483
|
+
|
|
484
|
+
**getPublic**(collectionId: string,
|
|
485
|
+
productId: string,
|
|
486
|
+
batchId: string) → `Promise<BatchResponse>`
|
|
487
|
+
Get a single batch by ID for a collection and product (public endpoint).
|
|
488
|
+
|
|
489
|
+
**getSN**(collectionId: string,
|
|
490
|
+
productId: string,
|
|
491
|
+
batchId: string,
|
|
492
|
+
startIndex: number = 0,
|
|
493
|
+
count: number = 10) → `Promise<any>`
|
|
494
|
+
Get serial numbers for a batch (admin only).
|
|
495
|
+
|
|
496
|
+
**lookupSN**(collectionId: string,
|
|
497
|
+
productId: string,
|
|
498
|
+
batchId: string,
|
|
499
|
+
codeId: string) → `Promise<any>`
|
|
500
|
+
Look up a serial number by code for a batch (admin only).
|
|
236
501
|
|
|
237
|
-
|
|
238
|
-
Get a single batch by ID for a collection and product (admin only). @param collectionId - Identifier of the parent collection @param productId - Identifier of the parent product @param batchId - Identifier of the batch @returns Promise resolving to a BatchResponse object @throws ErrorResponse if the request fails
|
|
502
|
+
### claimSet
|
|
239
503
|
|
|
240
|
-
**
|
|
241
|
-
Get
|
|
504
|
+
**getAllForCollection**(collectionId: string) → `Promise<any[]>`
|
|
505
|
+
Get all claim sets for a collection.
|
|
242
506
|
|
|
243
|
-
**
|
|
244
|
-
Get a
|
|
507
|
+
**getForCollection**(collectionId: string, claimSetId: string) → `Promise<any>`
|
|
508
|
+
Get a specific claim set for a collection.
|
|
245
509
|
|
|
246
|
-
**
|
|
247
|
-
Get
|
|
510
|
+
**getAllTags**(collectionId: string, claimSetId: string) → `Promise<any[]>`
|
|
511
|
+
Get all tags for a claim set.
|
|
248
512
|
|
|
249
|
-
**
|
|
250
|
-
Get a
|
|
513
|
+
**getReport**(collectionId: string, claimSetId: string) → `Promise<any>`
|
|
514
|
+
Get a report for a claim set.
|
|
251
515
|
|
|
252
|
-
**
|
|
253
|
-
Get
|
|
516
|
+
**getAssignedTags**(collectionId: string, claimSetId: string) → `Promise<any>`
|
|
517
|
+
Get assigned tags for a claim set.
|
|
254
518
|
|
|
255
|
-
**
|
|
256
|
-
Get
|
|
519
|
+
**getTagSummary**(collectionId: string) → `Promise<any>`
|
|
520
|
+
Get tag summary for a collection.
|
|
257
521
|
|
|
258
|
-
|
|
522
|
+
**tagQuery**(collectionId: string, data: any) → `Promise<any>`
|
|
523
|
+
Perform a tag query for a collection.
|
|
524
|
+
|
|
525
|
+
**createForCollection**(collectionId: string, params: any) → `Promise<any>`
|
|
526
|
+
Create a new claim set for a collection.
|
|
259
527
|
|
|
260
|
-
**
|
|
261
|
-
|
|
528
|
+
**updateForCollection**(collectionId: string, params: any) → `Promise<any>`
|
|
529
|
+
Update a claim set for a collection.
|
|
262
530
|
|
|
263
|
-
**
|
|
264
|
-
|
|
531
|
+
**makeClaim**(collectionId: string, params: any) → `Promise<any>`
|
|
532
|
+
Make a claim for a claim set.
|
|
265
533
|
|
|
266
|
-
**
|
|
267
|
-
|
|
534
|
+
**assignClaims**(collectionId: string, data: any) → `Promise<any>`
|
|
535
|
+
Assign claims to a claim set.
|
|
268
536
|
|
|
269
|
-
**
|
|
270
|
-
|
|
537
|
+
**updateClaimData**(collectionId: string, data: any) → `Promise<any>`
|
|
538
|
+
Update claim data for a collection.
|
|
271
539
|
|
|
272
|
-
**
|
|
273
|
-
Get all claim sets for a collection.
|
|
540
|
+
**getAllForCollection**(collectionId: string) → `Promise<any[]>`
|
|
541
|
+
Get all claim sets for a collection.
|
|
274
542
|
|
|
275
|
-
**
|
|
276
|
-
Get
|
|
543
|
+
**getForCollection**(collectionId: string, claimSetId: string) → `Promise<any>`
|
|
544
|
+
Get a specific claim set for a collection.
|
|
277
545
|
|
|
278
|
-
**
|
|
279
|
-
Get all
|
|
546
|
+
**getAllTags**(collectionId: string, claimSetId: string) → `Promise<any[]>`
|
|
547
|
+
Get all tags for a claim set.
|
|
280
548
|
|
|
281
|
-
**
|
|
282
|
-
Get
|
|
549
|
+
**getReport**(collectionId: string, claimSetId: string) → `Promise<any>`
|
|
550
|
+
Get a report for a claim set.
|
|
283
551
|
|
|
284
|
-
**
|
|
285
|
-
Get
|
|
552
|
+
**getAssignedTags**(collectionId: string, claimSetId: string) → `Promise<any>`
|
|
553
|
+
Get assigned tags for a claim set.
|
|
286
554
|
|
|
287
|
-
**
|
|
288
|
-
Get
|
|
555
|
+
**getTagSummary**(collectionId: string) → `Promise<any>`
|
|
556
|
+
Get tag summary for a collection.
|
|
289
557
|
|
|
290
|
-
**
|
|
291
|
-
|
|
558
|
+
**tagQuery**(collectionId: string, data: any) → `Promise<any>`
|
|
559
|
+
Perform a tag query for a collection.
|
|
292
560
|
|
|
293
|
-
**
|
|
294
|
-
|
|
561
|
+
**createForCollection**(collectionId: string, params: any) → `Promise<any>`
|
|
562
|
+
Create a new claim set for a collection.
|
|
563
|
+
|
|
564
|
+
**updateForCollection**(collectionId: string, params: any) → `Promise<any>`
|
|
565
|
+
Update a claim set for a collection.
|
|
566
|
+
|
|
567
|
+
**makeClaim**(collectionId: string, params: any) → `Promise<any>`
|
|
568
|
+
Make a claim for a claim set.
|
|
569
|
+
|
|
570
|
+
**assignClaims**(collectionId: string, data: any) → `Promise<any>`
|
|
571
|
+
Assign claims to a claim set.
|
|
572
|
+
|
|
573
|
+
**updateClaimData**(collectionId: string, data: any) → `Promise<any>`
|
|
574
|
+
Update claim data for a collection.
|
|
295
575
|
|
|
296
576
|
### collection
|
|
297
577
|
|
|
298
|
-
**get**(collectionId: string, admin?: boolean) → `CollectionResponse
|
|
299
|
-
Retrieves a single Collection by its ID.
|
|
578
|
+
**get**(collectionId: string, admin?: boolean) → `Promise<CollectionResponse>`
|
|
579
|
+
Retrieves a single Collection by its ID.
|
|
300
580
|
|
|
301
|
-
**list**(admin?: boolean) → `CollectionResponse[]
|
|
302
|
-
Retrieves
|
|
581
|
+
**list**(admin?: boolean) → `Promise<CollectionResponse[]>`
|
|
582
|
+
Retrieves all Collections.
|
|
303
583
|
|
|
304
|
-
**create**(data: any) → `CollectionResponse
|
|
305
|
-
|
|
584
|
+
**create**(data: any) → `Promise<CollectionResponse>`
|
|
585
|
+
Create a new collection (admin only).
|
|
306
586
|
|
|
307
|
-
**update**(collectionId: string, data: any) → `CollectionResponse
|
|
308
|
-
|
|
587
|
+
**update**(collectionId: string, data: any) → `Promise<CollectionResponse>`
|
|
588
|
+
Update a collection (admin only).
|
|
309
589
|
|
|
310
|
-
**remove**(collectionId: string) → `void
|
|
311
|
-
|
|
590
|
+
**remove**(collectionId: string) → `Promise<void>`
|
|
591
|
+
Delete a collection (admin only).
|
|
312
592
|
|
|
313
|
-
**getSN**(collectionId: string,
|
|
314
|
-
|
|
593
|
+
**getSN**(collectionId: string,
|
|
594
|
+
startIndex: number = 0,
|
|
595
|
+
count: number = 10) → `Promise<any>`
|
|
596
|
+
Get serial numbers for a collection (admin only).
|
|
315
597
|
|
|
316
|
-
**lookupSN**(collectionId: string,
|
|
317
|
-
|
|
598
|
+
**lookupSN**(collectionId: string,
|
|
599
|
+
codeId: string) → `Promise<any>`
|
|
600
|
+
Look up a serial number by code for a collection (admin only).
|
|
318
601
|
|
|
319
|
-
**assignSN**(collectionId: string,
|
|
320
|
-
|
|
602
|
+
**assignSN**(collectionId: string,
|
|
603
|
+
codeId: string,
|
|
604
|
+
value: any) → `Promise<any>`
|
|
605
|
+
Assign a value to a serial number for a collection (admin only).
|
|
321
606
|
|
|
322
|
-
|
|
607
|
+
**get**(collectionId: string, admin?: boolean) → `Promise<CollectionResponse>`
|
|
608
|
+
Retrieves a single Collection by its ID.
|
|
323
609
|
|
|
324
|
-
**
|
|
325
|
-
|
|
610
|
+
**list**(admin?: boolean) → `Promise<CollectionResponse[]>`
|
|
611
|
+
Retrieves all Collections.
|
|
326
612
|
|
|
327
|
-
**
|
|
328
|
-
|
|
613
|
+
**create**(data: any) → `Promise<CollectionResponse>`
|
|
614
|
+
Create a new collection (admin only).
|
|
329
615
|
|
|
330
|
-
**
|
|
331
|
-
|
|
616
|
+
**update**(collectionId: string, data: any) → `Promise<CollectionResponse>`
|
|
617
|
+
Update a collection (admin only).
|
|
332
618
|
|
|
333
|
-
**
|
|
334
|
-
|
|
619
|
+
**remove**(collectionId: string) → `Promise<void>`
|
|
620
|
+
Delete a collection (admin only).
|
|
621
|
+
|
|
622
|
+
**getSN**(collectionId: string,
|
|
623
|
+
startIndex: number = 0,
|
|
624
|
+
count: number = 10) → `Promise<any>`
|
|
625
|
+
Get serial numbers for a collection (admin only).
|
|
626
|
+
|
|
627
|
+
**lookupSN**(collectionId: string,
|
|
628
|
+
codeId: string) → `Promise<any>`
|
|
629
|
+
Look up a serial number by code for a collection (admin only).
|
|
630
|
+
|
|
631
|
+
**assignSN**(collectionId: string,
|
|
632
|
+
codeId: string,
|
|
633
|
+
value: any) → `Promise<any>`
|
|
634
|
+
Assign a value to a serial number for a collection (admin only).
|
|
635
|
+
|
|
636
|
+
### crate
|
|
335
637
|
|
|
336
|
-
**
|
|
638
|
+
**get**(collectionId: string, crateId: string) → `Promise<any>`
|
|
337
639
|
Get a single crate by ID for a collection (admin only).
|
|
338
640
|
|
|
339
|
-
|
|
641
|
+
**list**(collectionId: string) → `Promise<any[]>`
|
|
642
|
+
List all crates for a collection (admin only).
|
|
340
643
|
|
|
341
|
-
**
|
|
342
|
-
|
|
644
|
+
**create**(collectionId: string, data: any) → `Promise<any>`
|
|
645
|
+
Create a new crate for a collection (admin only).
|
|
343
646
|
|
|
344
|
-
**
|
|
345
|
-
|
|
647
|
+
**update**(collectionId: string, crateId: string, data: any) → `Promise<any>`
|
|
648
|
+
Update a crate for a collection (admin only).
|
|
346
649
|
|
|
347
|
-
**
|
|
348
|
-
|
|
650
|
+
**remove**(collectionId: string, crateId: string) → `Promise<void>`
|
|
651
|
+
Delete a crate for a collection (admin only).
|
|
349
652
|
|
|
350
|
-
**
|
|
351
|
-
Get a single
|
|
653
|
+
**get**(collectionId: string, crateId: string) → `Promise<any>`
|
|
654
|
+
Get a single crate by ID for a collection (admin only).
|
|
352
655
|
|
|
353
|
-
**
|
|
354
|
-
|
|
656
|
+
**list**(collectionId: string) → `Promise<any[]>`
|
|
657
|
+
List all crates for a collection (admin only).
|
|
355
658
|
|
|
356
|
-
|
|
659
|
+
**create**(collectionId: string, data: any) → `Promise<any>`
|
|
660
|
+
Create a new crate for a collection (admin only).
|
|
357
661
|
|
|
358
|
-
**
|
|
359
|
-
|
|
662
|
+
**update**(collectionId: string, crateId: string, data: any) → `Promise<any>`
|
|
663
|
+
Update a crate for a collection (admin only).
|
|
360
664
|
|
|
361
|
-
**
|
|
362
|
-
|
|
665
|
+
**remove**(collectionId: string, crateId: string) → `Promise<void>`
|
|
666
|
+
Delete a crate for a collection (admin only).
|
|
363
667
|
|
|
364
|
-
|
|
365
|
-
Retrieves a single Product Item by Collection ID and Product ID. @param collectionId – Identifier of the parent collection @param productId – Identifier of the product item @param admin – If true, use admin endpoint; otherwise, use public @returns Promise resolving to a ProductResponse object @throws ErrorResponse if the request fails
|
|
668
|
+
### form
|
|
366
669
|
|
|
367
|
-
**
|
|
368
|
-
|
|
670
|
+
**get**(collectionId: string, formId: string, admin?: boolean) → `Promise<any>`
|
|
671
|
+
Get a single form by ID for a collection.
|
|
369
672
|
|
|
370
|
-
**
|
|
371
|
-
|
|
673
|
+
**list**(collectionId: string, admin?: boolean) → `Promise<any[]>`
|
|
674
|
+
List all forms for a collection.
|
|
372
675
|
|
|
373
|
-
**
|
|
374
|
-
|
|
676
|
+
**create**(collectionId: string, data: any) → `Promise<any>`
|
|
677
|
+
Create a new form for a collection (admin only).
|
|
375
678
|
|
|
376
|
-
**
|
|
377
|
-
|
|
679
|
+
**update**(collectionId: string, formId: string, data: any) → `Promise<any>`
|
|
680
|
+
Update a form for a collection (admin only).
|
|
378
681
|
|
|
379
|
-
|
|
682
|
+
**remove**(collectionId: string, formId: string) → `Promise<void>`
|
|
683
|
+
Delete a form for a collection (admin only).
|
|
380
684
|
|
|
381
|
-
**get**(collectionId: string,
|
|
382
|
-
|
|
685
|
+
**get**(collectionId: string, formId: string, admin?: boolean) → `Promise<any>`
|
|
686
|
+
Get a single form by ID for a collection.
|
|
383
687
|
|
|
384
|
-
**list**(collectionId: string) → `
|
|
385
|
-
|
|
688
|
+
**list**(collectionId: string, admin?: boolean) → `Promise<any[]>`
|
|
689
|
+
List all forms for a collection.
|
|
386
690
|
|
|
387
|
-
|
|
691
|
+
**create**(collectionId: string, data: any) → `Promise<any>`
|
|
692
|
+
Create a new form for a collection (admin only).
|
|
388
693
|
|
|
389
|
-
**
|
|
390
|
-
|
|
694
|
+
**update**(collectionId: string, formId: string, data: any) → `Promise<any>`
|
|
695
|
+
Update a form for a collection (admin only).
|
|
391
696
|
|
|
392
|
-
**
|
|
393
|
-
|
|
697
|
+
**remove**(collectionId: string, formId: string) → `Promise<void>`
|
|
698
|
+
Delete a form for a collection (admin only).
|
|
394
699
|
|
|
395
|
-
|
|
396
|
-
|
|
700
|
+
### product
|
|
701
|
+
|
|
702
|
+
**get**(collectionId: string,
|
|
703
|
+
productId: string,
|
|
704
|
+
admin?: boolean) → `Promise<ProductResponse>`
|
|
705
|
+
Retrieves a single Product Item by Collection ID and Product ID.
|
|
706
|
+
|
|
707
|
+
**list**(collectionId: string,
|
|
708
|
+
admin?: boolean) → `Promise<ProductResponse[]>`
|
|
709
|
+
List all Product Items for a Collection.
|
|
710
|
+
|
|
711
|
+
**create**(collectionId: string,
|
|
712
|
+
data: any) → `Promise<ProductResponse>`
|
|
713
|
+
Create a new product for a collection (admin only).
|
|
714
|
+
|
|
715
|
+
**update**(collectionId: string,
|
|
716
|
+
productId: string,
|
|
717
|
+
data: any) → `Promise<ProductResponse>`
|
|
718
|
+
Update a product for a collection (admin only).
|
|
719
|
+
|
|
720
|
+
**remove**(collectionId: string,
|
|
721
|
+
productId: string) → `Promise<void>`
|
|
722
|
+
Delete a product for a collection (admin only).
|
|
723
|
+
|
|
724
|
+
**getSN**(collectionId: string,
|
|
725
|
+
productId: string,
|
|
726
|
+
startIndex: number = 0,
|
|
727
|
+
count: number = 10) → `Promise<any>`
|
|
728
|
+
Get serial numbers for a product (admin only).
|
|
729
|
+
|
|
730
|
+
**lookupSN**(collectionId: string,
|
|
731
|
+
productId: string,
|
|
732
|
+
codeId: string) → `Promise<any>`
|
|
733
|
+
Look up a serial number by code for a product (admin only).
|
|
734
|
+
|
|
735
|
+
**get**(collectionId: string,
|
|
736
|
+
productId: string,
|
|
737
|
+
admin?: boolean) → `Promise<ProductResponse>`
|
|
738
|
+
Retrieves a single Product Item by Collection ID and Product ID.
|
|
739
|
+
|
|
740
|
+
**list**(collectionId: string,
|
|
741
|
+
admin?: boolean) → `Promise<ProductResponse[]>`
|
|
742
|
+
List all Product Items for a Collection.
|
|
743
|
+
|
|
744
|
+
**create**(collectionId: string,
|
|
745
|
+
data: any) → `Promise<ProductResponse>`
|
|
746
|
+
Create a new product for a collection (admin only).
|
|
747
|
+
|
|
748
|
+
**update**(collectionId: string,
|
|
749
|
+
productId: string,
|
|
750
|
+
data: any) → `Promise<ProductResponse>`
|
|
751
|
+
Update a product for a collection (admin only).
|
|
752
|
+
|
|
753
|
+
**remove**(collectionId: string,
|
|
754
|
+
productId: string) → `Promise<void>`
|
|
755
|
+
Delete a product for a collection (admin only).
|
|
756
|
+
|
|
757
|
+
**getSN**(collectionId: string,
|
|
758
|
+
productId: string,
|
|
759
|
+
startIndex: number = 0,
|
|
760
|
+
count: number = 10) → `Promise<any>`
|
|
761
|
+
Get serial numbers for a product (admin only).
|
|
762
|
+
|
|
763
|
+
**lookupSN**(collectionId: string,
|
|
764
|
+
productId: string,
|
|
765
|
+
codeId: string) → `Promise<any>`
|
|
766
|
+
Look up a serial number by code for a product (admin only).
|
|
767
|
+
|
|
768
|
+
### proof
|
|
769
|
+
|
|
770
|
+
**get**(collectionId: string,
|
|
771
|
+
proofId: string) → `Promise<ProofResponse>`
|
|
772
|
+
Retrieves a single Proof by Collection ID and Proof ID.
|
|
397
773
|
|
|
398
|
-
**
|
|
399
|
-
|
|
774
|
+
**list**(collectionId: string) → `Promise<ProofResponse[]>`
|
|
775
|
+
List all Proofs for a Collection.
|
|
400
776
|
|
|
401
|
-
**
|
|
402
|
-
|
|
777
|
+
**get**(collectionId: string,
|
|
778
|
+
proofId: string) → `Promise<ProofResponse>`
|
|
779
|
+
Retrieves a single Proof by Collection ID and Proof ID.
|
|
403
780
|
|
|
404
|
-
**
|
|
405
|
-
|
|
781
|
+
**list**(collectionId: string) → `Promise<ProofResponse[]>`
|
|
782
|
+
List all Proofs for a Collection.
|
|
406
783
|
|
|
407
|
-
|
|
408
|
-
Get a single variant by ID for a collection and product (admin only). @param collectionId - Identifier of the parent collection @param productId - Identifier of the parent product @param variantId - Identifier of the variant @returns Promise resolving to a VariantResponse object @throws ErrorResponse if the request fails
|
|
784
|
+
### variant
|
|
409
785
|
|
|
410
|
-
**
|
|
411
|
-
|
|
786
|
+
**get**(collectionId: string,
|
|
787
|
+
productId: string,
|
|
788
|
+
variantId: string) → `Promise<VariantResponse>`
|
|
789
|
+
Get a single variant by ID for a collection and product (admin only).
|
|
790
|
+
|
|
791
|
+
**list**(collectionId: string,
|
|
792
|
+
productId: string) → `Promise<VariantResponse[]>`
|
|
793
|
+
List all variants for a collection and product (admin only).
|
|
794
|
+
|
|
795
|
+
**create**(collectionId: string,
|
|
796
|
+
productId: string,
|
|
797
|
+
data: VariantCreateRequest) → `Promise<VariantResponse>`
|
|
798
|
+
Create a new variant for a collection and product (admin only).
|
|
799
|
+
|
|
800
|
+
**update**(collectionId: string,
|
|
801
|
+
productId: string,
|
|
802
|
+
variantId: string,
|
|
803
|
+
data: VariantUpdateRequest) → `Promise<VariantResponse>`
|
|
804
|
+
Update a variant for a collection and product (admin only).
|
|
805
|
+
|
|
806
|
+
**remove**(collectionId: string,
|
|
807
|
+
productId: string,
|
|
808
|
+
variantId: string) → `Promise<void>`
|
|
809
|
+
Delete a variant for a collection and product (admin only).
|
|
810
|
+
|
|
811
|
+
**getPublic**(collectionId: string,
|
|
812
|
+
productId: string,
|
|
813
|
+
variantId: string) → `Promise<VariantResponse>`
|
|
814
|
+
Get a single variant by ID for a collection and product (public endpoint).
|
|
815
|
+
|
|
816
|
+
**getSN**(collectionId: string,
|
|
817
|
+
productId: string,
|
|
818
|
+
variantId: string,
|
|
819
|
+
startIndex: number = 0,
|
|
820
|
+
count: number = 10) → `Promise<any>`
|
|
821
|
+
Get serial numbers for a variant (admin only).
|
|
822
|
+
|
|
823
|
+
**lookupSN**(collectionId: string,
|
|
824
|
+
productId: string,
|
|
825
|
+
variantId: string,
|
|
826
|
+
codeId: string) → `Promise<any>`
|
|
827
|
+
Look up a serial number by code for a variant (admin only).
|
|
828
|
+
|
|
829
|
+
**get**(collectionId: string,
|
|
830
|
+
productId: string,
|
|
831
|
+
variantId: string) → `Promise<VariantResponse>`
|
|
832
|
+
Get a single variant by ID for a collection and product (admin only).
|
|
833
|
+
|
|
834
|
+
**list**(collectionId: string,
|
|
835
|
+
productId: string) → `Promise<VariantResponse[]>`
|
|
836
|
+
List all variants for a collection and product (admin only).
|
|
837
|
+
|
|
838
|
+
**create**(collectionId: string,
|
|
839
|
+
productId: string,
|
|
840
|
+
data: VariantCreateRequest) → `Promise<VariantResponse>`
|
|
841
|
+
Create a new variant for a collection and product (admin only).
|
|
842
|
+
|
|
843
|
+
**update**(collectionId: string,
|
|
844
|
+
productId: string,
|
|
845
|
+
variantId: string,
|
|
846
|
+
data: VariantUpdateRequest) → `Promise<VariantResponse>`
|
|
847
|
+
Update a variant for a collection and product (admin only).
|
|
848
|
+
|
|
849
|
+
**remove**(collectionId: string,
|
|
850
|
+
productId: string,
|
|
851
|
+
variantId: string) → `Promise<void>`
|
|
852
|
+
Delete a variant for a collection and product (admin only).
|
|
853
|
+
|
|
854
|
+
**getPublic**(collectionId: string,
|
|
855
|
+
productId: string,
|
|
856
|
+
variantId: string) → `Promise<VariantResponse>`
|
|
857
|
+
Get a single variant by ID for a collection and product (public endpoint).
|
|
858
|
+
|
|
859
|
+
**getSN**(collectionId: string,
|
|
860
|
+
productId: string,
|
|
861
|
+
variantId: string,
|
|
862
|
+
startIndex: number = 0,
|
|
863
|
+
count: number = 10) → `Promise<any>`
|
|
864
|
+
Get serial numbers for a variant (admin only).
|
|
865
|
+
|
|
866
|
+
**lookupSN**(collectionId: string,
|
|
867
|
+
productId: string,
|
|
868
|
+
variantId: string,
|
|
869
|
+
codeId: string) → `Promise<any>`
|
|
870
|
+
Look up a serial number by code for a variant (admin only).
|
|
412
871
|
|