@proveanything/smartlinks 1.0.16 → 1.0.18

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.
Files changed (121) hide show
  1. package/README.md +7795 -93
  2. package/build-docs.ts +41 -0
  3. package/dist/api/claimSet.d.ts +14 -0
  4. package/dist/api/claimSet.js +24 -0
  5. package/dist/api/collection.d.ts +9 -1
  6. package/dist/api/collection.js +16 -2
  7. package/dist/api/crate.d.ts +22 -0
  8. package/dist/api/crate.js +44 -0
  9. package/dist/api/form.d.ts +34 -0
  10. package/dist/api/form.js +58 -0
  11. package/dist/api/index.d.ts +3 -0
  12. package/dist/api/index.js +3 -0
  13. package/dist/build-docs.js +35 -0
  14. package/dist/http.d.ts +7 -0
  15. package/dist/http.js +24 -0
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.js +1 -1
  18. package/docs/README.md +7898 -89
  19. package/docs/assets/highlight.css +12 -33
  20. package/docs/assets/navigation.js +1 -1
  21. package/docs/assets/search.js +1 -1
  22. package/docs/documentation.json +2626 -1178
  23. package/docs/functions/appConfiguration.deleteConfig.html +1 -1
  24. package/docs/functions/appConfiguration.deleteDataItem.html +1 -1
  25. package/docs/functions/appConfiguration.getConfig.html +1 -1
  26. package/docs/functions/appConfiguration.getData.html +1 -1
  27. package/docs/functions/appConfiguration.getDataItem.html +1 -1
  28. package/docs/functions/appConfiguration.setConfig.html +1 -1
  29. package/docs/functions/appConfiguration.setDataItem.html +1 -1
  30. package/docs/functions/asset.getForCollection.html +1 -1
  31. package/docs/functions/asset.getForProduct.html +1 -1
  32. package/docs/functions/asset.getForProof.html +1 -1
  33. package/docs/functions/asset.listForCollection.html +1 -1
  34. package/docs/functions/asset.listForProduct.html +1 -1
  35. package/docs/functions/asset.listForProof.html +1 -1
  36. package/docs/functions/asset.uploadAsset.html +1 -1
  37. package/docs/functions/attestation.create.html +1 -1
  38. package/docs/functions/attestation.get.html +1 -1
  39. package/docs/functions/attestation.list.html +1 -1
  40. package/docs/functions/attestation.remove.html +1 -1
  41. package/docs/functions/attestation.update.html +1 -1
  42. package/docs/functions/auth.getAccount.html +1 -1
  43. package/docs/functions/auth.login.html +1 -1
  44. package/docs/functions/auth.logout.html +1 -1
  45. package/docs/functions/auth.verifyToken.html +1 -1
  46. package/docs/functions/claimSet.assignClaims.html +4 -0
  47. package/docs/functions/claimSet.updateClaimData.html +4 -0
  48. package/docs/functions/collection.get.html +3 -2
  49. package/docs/functions/collection.list.html +5 -0
  50. package/docs/functions/crate.create.html +2 -0
  51. package/docs/functions/crate.get.html +2 -0
  52. package/docs/functions/crate.list.html +2 -0
  53. package/docs/functions/crate.remove.html +2 -0
  54. package/docs/functions/crate.update.html +2 -0
  55. package/docs/functions/form.create.html +4 -0
  56. package/docs/functions/form.get.html +5 -0
  57. package/docs/functions/form.list.html +4 -0
  58. package/docs/functions/form.remove.html +4 -0
  59. package/docs/functions/form.update.html +5 -0
  60. package/docs/functions/initializeApi.html +1 -1
  61. package/docs/functions/product.get.html +1 -1
  62. package/docs/functions/product.list.html +1 -1
  63. package/docs/functions/proof.get.html +1 -1
  64. package/docs/functions/proof.list.html +1 -1
  65. package/docs/functions/request.html +1 -1
  66. package/docs/functions/sendCustomProxyMessage.html +5 -0
  67. package/docs/index.html +4 -112
  68. package/docs/interfaces/AppConfigurationResponse.html +4 -4
  69. package/docs/interfaces/AssetResponse.html +2 -2
  70. package/docs/interfaces/AttestationCreateRequest.html +2 -2
  71. package/docs/interfaces/AttestationResponse.html +2 -2
  72. package/docs/interfaces/AttestationUpdateRequest.html +2 -2
  73. package/docs/interfaces/CollectionResponse.html +5 -5
  74. package/docs/interfaces/ErrorResponse.html +3 -3
  75. package/docs/interfaces/ProductResponse.html +5 -5
  76. package/docs/interfaces/ProofResponse.html +8 -8
  77. package/docs/modules/appConfiguration.html +1 -1
  78. package/docs/modules/asset.html +1 -1
  79. package/docs/modules/attestation.html +1 -1
  80. package/docs/modules/auth.html +1 -1
  81. package/docs/modules/claimSet.html +3 -0
  82. package/docs/modules/collection.html +2 -1
  83. package/docs/modules/crate.html +6 -0
  84. package/docs/modules/form.html +6 -0
  85. package/docs/modules/product.html +1 -1
  86. package/docs/modules/proof.html +1 -1
  87. package/docs/modules.html +4 -0
  88. package/docs/types/AccountInfoResponse.html +1 -1
  89. package/docs/types/AppConfigOptions.html +1 -1
  90. package/docs/types/LoginResponse.html +1 -1
  91. package/docs/types/VerifyTokenResponse.html +1 -1
  92. package/package.json +3 -2
  93. package/scripts/copy-docs.js +11 -0
  94. package/src/api/claimSet.ts +23 -0
  95. package/src/api/collection.ts +17 -3
  96. package/src/api/crate.ts +43 -0
  97. package/src/api/form.ts +57 -0
  98. package/src/api/index.ts +3 -0
  99. package/src/http.ts +25 -0
  100. package/src/index.ts +1 -1
  101. package/temp-docs/README.md +7867 -93
  102. package/temp-docs/interfaces/AppConfigurationResponse.md +3 -3
  103. package/temp-docs/interfaces/AssetResponse.md +3 -3
  104. package/temp-docs/interfaces/AttestationCreateRequest.md +3 -3
  105. package/temp-docs/interfaces/AttestationResponse.md +6 -6
  106. package/temp-docs/interfaces/AttestationUpdateRequest.md +2 -2
  107. package/temp-docs/interfaces/CollectionResponse.md +4 -4
  108. package/temp-docs/interfaces/ErrorResponse.md +2 -2
  109. package/temp-docs/interfaces/ProductResponse.md +4 -4
  110. package/temp-docs/interfaces/ProofResponse.md +7 -7
  111. package/temp-docs/modules/appConfiguration.md +7 -7
  112. package/temp-docs/modules/asset.md +7 -7
  113. package/temp-docs/modules/attestation.md +5 -5
  114. package/temp-docs/modules/auth.md +4 -4
  115. package/temp-docs/modules/claimSet.md +52 -0
  116. package/temp-docs/modules/collection.md +32 -2
  117. package/temp-docs/modules/crate.md +124 -0
  118. package/temp-docs/modules/form.md +126 -0
  119. package/temp-docs/modules/product.md +2 -2
  120. package/temp-docs/modules/proof.md +2 -2
  121. package/temp-docs/modules.md +41 -6
package/src/http.ts CHANGED
@@ -336,3 +336,28 @@ export function getApiHeaders(): Record<string, string> {
336
336
  if (bearerToken) headers["AUTHORIZATION"] = `Bearer ${bearerToken}`
337
337
  return headers
338
338
  }
339
+
340
+ /**
341
+ * Sends a custom proxy message in proxyMode and waits for a matching reply.
342
+ * @param request - The request type string
343
+ * @param params - The parameters object
344
+ * @returns The data from the proxy response
345
+ */
346
+ export async function sendCustomProxyMessage<T = any>(request: string, params: any): Promise<T> {
347
+ if (!proxyMode) {
348
+ throw new Error("sendCustomProxyMessage can only be used in proxyMode");
349
+ }
350
+ ensureProxyListener();
351
+ const id = generateProxyId();
352
+ const msg = {
353
+ _smartlinksCustomProxyRequest: true,
354
+ id,
355
+ request,
356
+ params,
357
+ };
358
+ return new Promise<T>((resolve, reject) => {
359
+ proxyPending[id] = { resolve, reject };
360
+ window.parent.postMessage(msg, "*");
361
+ // Optionally: add a timeout here to reject if no response
362
+ });
363
+ }
package/src/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // src/index.ts
2
2
  // Top-level entrypoint of the npm package. Re-export initializeApi + all namespaces.
3
3
 
4
- export { initializeApi, request } from "./http"
4
+ export { initializeApi, request, sendCustomProxyMessage } from "./http"
5
5
  export * from "./api"
6
6
  export * from "./types"
7
7