@proveanything/smartlinks 1.0.30 → 1.0.32
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 +97 -0
- package/README.md +13109 -430
- package/dist/api/appRecord.d.ts +6 -0
- package/dist/api/appRecord.js +29 -0
- package/dist/api/auth.d.ts +10 -0
- package/dist/api/auth.js +18 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/package.json +1 -1
package/API_SUMMARY.md
CHANGED
|
@@ -7,6 +7,7 @@ This is a concise summary of all available API functions and types.
|
|
|
7
7
|
The Smartlinks SDK is organized into the following namespaces:
|
|
8
8
|
|
|
9
9
|
- **appConfiguration** - Application configuration and settings management
|
|
10
|
+
- **appRecord** - Functions for appRecord operations
|
|
10
11
|
- **asset** - File upload and asset management for collections, products, and proofs
|
|
11
12
|
- **attestation** - Digital attestations and verification for products
|
|
12
13
|
- **auth** - Authentication, login, and user account management
|
|
@@ -229,6 +230,72 @@ interface ProofResponse {
|
|
|
229
230
|
|
|
230
231
|
**VariantUpdateRequest** = `any`
|
|
231
232
|
|
|
233
|
+
**AppConfigOptions** = `{
|
|
234
|
+
appId: string
|
|
235
|
+
collectionId?: string
|
|
236
|
+
productId?: string
|
|
237
|
+
variantId?: string
|
|
238
|
+
batchId?: string
|
|
239
|
+
itemId?: string
|
|
240
|
+
user?: boolean
|
|
241
|
+
userData?: boolean
|
|
242
|
+
admin?: boolean
|
|
243
|
+
config?: any
|
|
244
|
+
data?: any
|
|
245
|
+
}`
|
|
246
|
+
|
|
247
|
+
### auth
|
|
248
|
+
|
|
249
|
+
**LoginResponse** = `{
|
|
250
|
+
id: string
|
|
251
|
+
name: string
|
|
252
|
+
email: string
|
|
253
|
+
bearerToken: string
|
|
254
|
+
account: Record<string, any>
|
|
255
|
+
}`
|
|
256
|
+
|
|
257
|
+
**VerifyTokenResponse** = `{
|
|
258
|
+
valid: boolean
|
|
259
|
+
id?: string
|
|
260
|
+
name?: string
|
|
261
|
+
email?: string
|
|
262
|
+
account?: Record<string, any>
|
|
263
|
+
}`
|
|
264
|
+
|
|
265
|
+
**AccountInfoResponse** = `{
|
|
266
|
+
accessType: string;
|
|
267
|
+
analyticsCode: string;
|
|
268
|
+
analyticsId: string;
|
|
269
|
+
auth_time: number;
|
|
270
|
+
baseCollectionId: string;
|
|
271
|
+
clientType: string;
|
|
272
|
+
email: string;
|
|
273
|
+
email_verified: boolean;
|
|
274
|
+
features: {
|
|
275
|
+
actionLogger: boolean;
|
|
276
|
+
adminCollections: boolean;
|
|
277
|
+
adminApps: boolean;
|
|
278
|
+
apiKeys: boolean;
|
|
279
|
+
adminUsers: boolean;
|
|
280
|
+
[key: string]: boolean;
|
|
281
|
+
};
|
|
282
|
+
iat: number;
|
|
283
|
+
id: string;
|
|
284
|
+
iss: string;
|
|
285
|
+
location: string | null;
|
|
286
|
+
name: string;
|
|
287
|
+
picture: string;
|
|
288
|
+
sites: {
|
|
289
|
+
[siteName: string]: boolean;
|
|
290
|
+
};
|
|
291
|
+
sub: string;
|
|
292
|
+
uid: string;
|
|
293
|
+
user_id: string;
|
|
294
|
+
whitelabel: {
|
|
295
|
+
[key: string]: any;
|
|
296
|
+
}
|
|
297
|
+
}`
|
|
298
|
+
|
|
232
299
|
## API Functions
|
|
233
300
|
|
|
234
301
|
### appConfiguration
|
|
@@ -261,6 +328,24 @@ interface ProofResponse {
|
|
|
261
328
|
|
|
262
329
|
**deleteDataItem**(opts: AppConfigOptions) → `Promise<void>`
|
|
263
330
|
|
|
331
|
+
### appRecord
|
|
332
|
+
|
|
333
|
+
**get**(collectionId: string, appId: string) → `Promise<any>`
|
|
334
|
+
|
|
335
|
+
**create**(collectionId: string, appId: string, data: any) → `Promise<any>`
|
|
336
|
+
|
|
337
|
+
**update**(collectionId: string, appId: string, data: any) → `Promise<any>`
|
|
338
|
+
|
|
339
|
+
**remove**(collectionId: string, appId: string) → `Promise<void>`
|
|
340
|
+
|
|
341
|
+
**get**(collectionId: string, appId: string) → `Promise<any>`
|
|
342
|
+
|
|
343
|
+
**create**(collectionId: string, appId: string, data: any) → `Promise<any>`
|
|
344
|
+
|
|
345
|
+
**update**(collectionId: string, appId: string, data: any) → `Promise<any>`
|
|
346
|
+
|
|
347
|
+
**remove**(collectionId: string, appId: string) → `Promise<void>`
|
|
348
|
+
|
|
264
349
|
### asset
|
|
265
350
|
|
|
266
351
|
**getForCollection**(collectionId: string,
|
|
@@ -396,6 +481,12 @@ Logout (clears bearerToken for future API calls).
|
|
|
396
481
|
**verifyToken**(token?: string) → `Promise<VerifyTokenResponse>`
|
|
397
482
|
Verifies the current bearerToken (or a provided token). Returns user/account info if valid.
|
|
398
483
|
|
|
484
|
+
**requestAdminJWT**(collectionId: string) → `Promise<string>`
|
|
485
|
+
Requests an admin JWT for the current user and a specific collection Returns JWT if valid.
|
|
486
|
+
|
|
487
|
+
**requestPublicJWT**(collectionId: string, productId: string, proofId: string) → `Promise<string>`
|
|
488
|
+
Requests a JWT for the current user and a specific collection/product/proof Validates if the user has access to the resource, and returns a JWT
|
|
489
|
+
|
|
399
490
|
**getAccount**() → `Promise<AccountInfoResponse>`
|
|
400
491
|
Gets current account information for the logged in user. Returns user, owner, account, and location objects.
|
|
401
492
|
|
|
@@ -408,6 +499,12 @@ Logout (clears bearerToken for future API calls).
|
|
|
408
499
|
**verifyToken**(token?: string) → `Promise<VerifyTokenResponse>`
|
|
409
500
|
Verifies the current bearerToken (or a provided token). Returns user/account info if valid.
|
|
410
501
|
|
|
502
|
+
**requestAdminJWT**(collectionId: string) → `Promise<string>`
|
|
503
|
+
Requests an admin JWT for the current user and a specific collection Returns JWT if valid.
|
|
504
|
+
|
|
505
|
+
**requestPublicJWT**(collectionId: string, productId: string, proofId: string) → `Promise<string>`
|
|
506
|
+
Requests a JWT for the current user and a specific collection/product/proof Validates if the user has access to the resource, and returns a JWT
|
|
507
|
+
|
|
411
508
|
**getAccount**() → `Promise<AccountInfoResponse>`
|
|
412
509
|
Gets current account information for the logged in user. Returns user, owner, account, and location objects.
|
|
413
510
|
|