@proveanything/smartlinks 1.0.31 → 1.0.33
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 +70 -10
- package/README.md +2553 -1834
- package/dist/api/auth.d.ts +2 -4
- package/dist/api/proof.d.ts +33 -6
- package/dist/api/proof.js +61 -8
- package/package.json +1 -1
package/API_SUMMARY.md
CHANGED
|
@@ -263,8 +263,6 @@ interface ProofResponse {
|
|
|
263
263
|
}`
|
|
264
264
|
|
|
265
265
|
**AccountInfoResponse** = `{
|
|
266
|
-
jwtToken: string;
|
|
267
|
-
jwtExpiry: number;
|
|
268
266
|
accessType: string;
|
|
269
267
|
analyticsCode: string;
|
|
270
268
|
analyticsId: string;
|
|
@@ -483,10 +481,10 @@ Logout (clears bearerToken for future API calls).
|
|
|
483
481
|
**verifyToken**(token?: string) → `Promise<VerifyTokenResponse>`
|
|
484
482
|
Verifies the current bearerToken (or a provided token). Returns user/account info if valid.
|
|
485
483
|
|
|
486
|
-
**requestAdminJWT**(collectionId: string) → `Promise<
|
|
484
|
+
**requestAdminJWT**(collectionId: string) → `Promise<string>`
|
|
487
485
|
Requests an admin JWT for the current user and a specific collection Returns JWT if valid.
|
|
488
486
|
|
|
489
|
-
**requestPublicJWT**(collectionId: string, productId: string, proofId: string) → `Promise<
|
|
487
|
+
**requestPublicJWT**(collectionId: string, productId: string, proofId: string) → `Promise<string>`
|
|
490
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
|
|
491
489
|
|
|
492
490
|
**getAccount**() → `Promise<AccountInfoResponse>`
|
|
@@ -501,10 +499,10 @@ Logout (clears bearerToken for future API calls).
|
|
|
501
499
|
**verifyToken**(token?: string) → `Promise<VerifyTokenResponse>`
|
|
502
500
|
Verifies the current bearerToken (or a provided token). Returns user/account info if valid.
|
|
503
501
|
|
|
504
|
-
**requestAdminJWT**(collectionId: string) → `Promise<
|
|
502
|
+
**requestAdminJWT**(collectionId: string) → `Promise<string>`
|
|
505
503
|
Requests an admin JWT for the current user and a specific collection Returns JWT if valid.
|
|
506
504
|
|
|
507
|
-
**requestPublicJWT**(collectionId: string, productId: string, proofId: string) → `Promise<
|
|
505
|
+
**requestPublicJWT**(collectionId: string, productId: string, proofId: string) → `Promise<string>`
|
|
508
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
|
|
509
507
|
|
|
510
508
|
**getAccount**() → `Promise<AccountInfoResponse>`
|
|
@@ -867,19 +865,81 @@ Look up a serial number by code for a product (admin only).
|
|
|
867
865
|
### proof
|
|
868
866
|
|
|
869
867
|
**get**(collectionId: string,
|
|
870
|
-
|
|
871
|
-
|
|
868
|
+
productId: string,
|
|
869
|
+
proofId: string,
|
|
870
|
+
admin?: boolean) → `Promise<ProofResponse>`
|
|
871
|
+
Retrieves a single Proof by Collection ID, Product ID, and Proof ID. Both public and admin endpoints now include productId in the path.
|
|
872
872
|
|
|
873
873
|
**list**(collectionId: string) → `Promise<ProofResponse[]>`
|
|
874
874
|
List all Proofs for a Collection.
|
|
875
875
|
|
|
876
|
+
**create**(collectionId: string,
|
|
877
|
+
productId: string,
|
|
878
|
+
values: any) → `Promise<ProofResponse>`
|
|
879
|
+
Create a proof for a product (admin only). POST /admin/collection/:collectionId/product/:productId/proof
|
|
880
|
+
|
|
881
|
+
**update**(collectionId: string,
|
|
882
|
+
productId: string,
|
|
883
|
+
proofId: string,
|
|
884
|
+
values: any) → `Promise<ProofResponse>`
|
|
885
|
+
Update a proof for a product (admin only). PUT /admin/collection/:collectionId/product/:productId/proof/:proofId
|
|
886
|
+
|
|
887
|
+
**getByUser**(collectionId: string,
|
|
888
|
+
userId: string) → `Promise<ProofResponse[]>`
|
|
889
|
+
Get proofs for a user in a collection (admin only). GET /admin/collection/:collectionId/proof/findByUser/:userId
|
|
890
|
+
|
|
891
|
+
**getByProduct**(collectionId: string,
|
|
892
|
+
productId: string) → `Promise<ProofResponse[]>`
|
|
893
|
+
Get proofs for a product (admin only). GET /admin/collection/:collectionId/product/:productId/proof
|
|
894
|
+
|
|
895
|
+
**findByProduct**(collectionId: string,
|
|
896
|
+
productId: string,
|
|
897
|
+
query: any) → `Promise<ProofResponse[]>`
|
|
898
|
+
Find proofs for a product (admin only). POST /admin/collection/:collectionId/product/:productId/proof/find
|
|
899
|
+
|
|
900
|
+
**getByBatch**(collectionId: string,
|
|
901
|
+
productId: string,
|
|
902
|
+
batchId: string) → `Promise<ProofResponse[]>`
|
|
903
|
+
Get proofs for a batch (admin only). GET /admin/collection/:collectionId/product/:productId/batch/:batchId/proof
|
|
904
|
+
|
|
876
905
|
**get**(collectionId: string,
|
|
877
|
-
|
|
878
|
-
|
|
906
|
+
productId: string,
|
|
907
|
+
proofId: string,
|
|
908
|
+
admin?: boolean) → `Promise<ProofResponse>`
|
|
909
|
+
Retrieves a single Proof by Collection ID, Product ID, and Proof ID. Both public and admin endpoints now include productId in the path.
|
|
879
910
|
|
|
880
911
|
**list**(collectionId: string) → `Promise<ProofResponse[]>`
|
|
881
912
|
List all Proofs for a Collection.
|
|
882
913
|
|
|
914
|
+
**create**(collectionId: string,
|
|
915
|
+
productId: string,
|
|
916
|
+
values: any) → `Promise<ProofResponse>`
|
|
917
|
+
Create a proof for a product (admin only). POST /admin/collection/:collectionId/product/:productId/proof
|
|
918
|
+
|
|
919
|
+
**update**(collectionId: string,
|
|
920
|
+
productId: string,
|
|
921
|
+
proofId: string,
|
|
922
|
+
values: any) → `Promise<ProofResponse>`
|
|
923
|
+
Update a proof for a product (admin only). PUT /admin/collection/:collectionId/product/:productId/proof/:proofId
|
|
924
|
+
|
|
925
|
+
**getByUser**(collectionId: string,
|
|
926
|
+
userId: string) → `Promise<ProofResponse[]>`
|
|
927
|
+
Get proofs for a user in a collection (admin only). GET /admin/collection/:collectionId/proof/findByUser/:userId
|
|
928
|
+
|
|
929
|
+
**getByProduct**(collectionId: string,
|
|
930
|
+
productId: string) → `Promise<ProofResponse[]>`
|
|
931
|
+
Get proofs for a product (admin only). GET /admin/collection/:collectionId/product/:productId/proof
|
|
932
|
+
|
|
933
|
+
**findByProduct**(collectionId: string,
|
|
934
|
+
productId: string,
|
|
935
|
+
query: any) → `Promise<ProofResponse[]>`
|
|
936
|
+
Find proofs for a product (admin only). POST /admin/collection/:collectionId/product/:productId/proof/find
|
|
937
|
+
|
|
938
|
+
**getByBatch**(collectionId: string,
|
|
939
|
+
productId: string,
|
|
940
|
+
batchId: string) → `Promise<ProofResponse[]>`
|
|
941
|
+
Get proofs for a batch (admin only). GET /admin/collection/:collectionId/product/:productId/batch/:batchId/proof
|
|
942
|
+
|
|
883
943
|
### variant
|
|
884
944
|
|
|
885
945
|
**get**(collectionId: string,
|