@proveanything/smartlinks 1.0.30 → 1.0.31
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 +99 -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 +12 -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,74 @@ 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
|
+
jwtToken: string;
|
|
267
|
+
jwtExpiry: number;
|
|
268
|
+
accessType: string;
|
|
269
|
+
analyticsCode: string;
|
|
270
|
+
analyticsId: string;
|
|
271
|
+
auth_time: number;
|
|
272
|
+
baseCollectionId: string;
|
|
273
|
+
clientType: string;
|
|
274
|
+
email: string;
|
|
275
|
+
email_verified: boolean;
|
|
276
|
+
features: {
|
|
277
|
+
actionLogger: boolean;
|
|
278
|
+
adminCollections: boolean;
|
|
279
|
+
adminApps: boolean;
|
|
280
|
+
apiKeys: boolean;
|
|
281
|
+
adminUsers: boolean;
|
|
282
|
+
[key: string]: boolean;
|
|
283
|
+
};
|
|
284
|
+
iat: number;
|
|
285
|
+
id: string;
|
|
286
|
+
iss: string;
|
|
287
|
+
location: string | null;
|
|
288
|
+
name: string;
|
|
289
|
+
picture: string;
|
|
290
|
+
sites: {
|
|
291
|
+
[siteName: string]: boolean;
|
|
292
|
+
};
|
|
293
|
+
sub: string;
|
|
294
|
+
uid: string;
|
|
295
|
+
user_id: string;
|
|
296
|
+
whitelabel: {
|
|
297
|
+
[key: string]: any;
|
|
298
|
+
}
|
|
299
|
+
}`
|
|
300
|
+
|
|
232
301
|
## API Functions
|
|
233
302
|
|
|
234
303
|
### appConfiguration
|
|
@@ -261,6 +330,24 @@ interface ProofResponse {
|
|
|
261
330
|
|
|
262
331
|
**deleteDataItem**(opts: AppConfigOptions) → `Promise<void>`
|
|
263
332
|
|
|
333
|
+
### appRecord
|
|
334
|
+
|
|
335
|
+
**get**(collectionId: string, appId: string) → `Promise<any>`
|
|
336
|
+
|
|
337
|
+
**create**(collectionId: string, appId: string, data: any) → `Promise<any>`
|
|
338
|
+
|
|
339
|
+
**update**(collectionId: string, appId: string, data: any) → `Promise<any>`
|
|
340
|
+
|
|
341
|
+
**remove**(collectionId: string, appId: string) → `Promise<void>`
|
|
342
|
+
|
|
343
|
+
**get**(collectionId: string, appId: string) → `Promise<any>`
|
|
344
|
+
|
|
345
|
+
**create**(collectionId: string, appId: string, data: any) → `Promise<any>`
|
|
346
|
+
|
|
347
|
+
**update**(collectionId: string, appId: string, data: any) → `Promise<any>`
|
|
348
|
+
|
|
349
|
+
**remove**(collectionId: string, appId: string) → `Promise<void>`
|
|
350
|
+
|
|
264
351
|
### asset
|
|
265
352
|
|
|
266
353
|
**getForCollection**(collectionId: string,
|
|
@@ -396,6 +483,12 @@ Logout (clears bearerToken for future API calls).
|
|
|
396
483
|
**verifyToken**(token?: string) → `Promise<VerifyTokenResponse>`
|
|
397
484
|
Verifies the current bearerToken (or a provided token). Returns user/account info if valid.
|
|
398
485
|
|
|
486
|
+
**requestAdminJWT**(collectionId: string) → `Promise<VerifyTokenResponse>`
|
|
487
|
+
Requests an admin JWT for the current user and a specific collection Returns JWT if valid.
|
|
488
|
+
|
|
489
|
+
**requestPublicJWT**(collectionId: string, productId: string, proofId: string) → `Promise<VerifyTokenResponse>`
|
|
490
|
+
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
|
|
491
|
+
|
|
399
492
|
**getAccount**() → `Promise<AccountInfoResponse>`
|
|
400
493
|
Gets current account information for the logged in user. Returns user, owner, account, and location objects.
|
|
401
494
|
|
|
@@ -408,6 +501,12 @@ Logout (clears bearerToken for future API calls).
|
|
|
408
501
|
**verifyToken**(token?: string) → `Promise<VerifyTokenResponse>`
|
|
409
502
|
Verifies the current bearerToken (or a provided token). Returns user/account info if valid.
|
|
410
503
|
|
|
504
|
+
**requestAdminJWT**(collectionId: string) → `Promise<VerifyTokenResponse>`
|
|
505
|
+
Requests an admin JWT for the current user and a specific collection Returns JWT if valid.
|
|
506
|
+
|
|
507
|
+
**requestPublicJWT**(collectionId: string, productId: string, proofId: string) → `Promise<VerifyTokenResponse>`
|
|
508
|
+
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
|
|
509
|
+
|
|
411
510
|
**getAccount**() → `Promise<AccountInfoResponse>`
|
|
412
511
|
Gets current account information for the logged in user. Returns user, owner, account, and location objects.
|
|
413
512
|
|