@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.
- package/README.md +7795 -93
- package/build-docs.ts +41 -0
- package/dist/api/claimSet.d.ts +14 -0
- package/dist/api/claimSet.js +24 -0
- package/dist/api/collection.d.ts +9 -1
- package/dist/api/collection.js +16 -2
- package/dist/api/crate.d.ts +22 -0
- package/dist/api/crate.js +44 -0
- package/dist/api/form.d.ts +34 -0
- package/dist/api/form.js +58 -0
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.js +3 -0
- package/dist/build-docs.js +35 -0
- package/dist/http.d.ts +7 -0
- package/dist/http.js +24 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/docs/README.md +7898 -89
- package/docs/assets/highlight.css +12 -33
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/documentation.json +2626 -1178
- package/docs/functions/appConfiguration.deleteConfig.html +1 -1
- package/docs/functions/appConfiguration.deleteDataItem.html +1 -1
- package/docs/functions/appConfiguration.getConfig.html +1 -1
- package/docs/functions/appConfiguration.getData.html +1 -1
- package/docs/functions/appConfiguration.getDataItem.html +1 -1
- package/docs/functions/appConfiguration.setConfig.html +1 -1
- package/docs/functions/appConfiguration.setDataItem.html +1 -1
- package/docs/functions/asset.getForCollection.html +1 -1
- package/docs/functions/asset.getForProduct.html +1 -1
- package/docs/functions/asset.getForProof.html +1 -1
- package/docs/functions/asset.listForCollection.html +1 -1
- package/docs/functions/asset.listForProduct.html +1 -1
- package/docs/functions/asset.listForProof.html +1 -1
- package/docs/functions/asset.uploadAsset.html +1 -1
- package/docs/functions/attestation.create.html +1 -1
- package/docs/functions/attestation.get.html +1 -1
- package/docs/functions/attestation.list.html +1 -1
- package/docs/functions/attestation.remove.html +1 -1
- package/docs/functions/attestation.update.html +1 -1
- package/docs/functions/auth.getAccount.html +1 -1
- package/docs/functions/auth.login.html +1 -1
- package/docs/functions/auth.logout.html +1 -1
- package/docs/functions/auth.verifyToken.html +1 -1
- package/docs/functions/claimSet.assignClaims.html +4 -0
- package/docs/functions/claimSet.updateClaimData.html +4 -0
- package/docs/functions/collection.get.html +3 -2
- package/docs/functions/collection.list.html +5 -0
- package/docs/functions/crate.create.html +2 -0
- package/docs/functions/crate.get.html +2 -0
- package/docs/functions/crate.list.html +2 -0
- package/docs/functions/crate.remove.html +2 -0
- package/docs/functions/crate.update.html +2 -0
- package/docs/functions/form.create.html +4 -0
- package/docs/functions/form.get.html +5 -0
- package/docs/functions/form.list.html +4 -0
- package/docs/functions/form.remove.html +4 -0
- package/docs/functions/form.update.html +5 -0
- package/docs/functions/initializeApi.html +1 -1
- package/docs/functions/product.get.html +1 -1
- package/docs/functions/product.list.html +1 -1
- package/docs/functions/proof.get.html +1 -1
- package/docs/functions/proof.list.html +1 -1
- package/docs/functions/request.html +1 -1
- package/docs/functions/sendCustomProxyMessage.html +5 -0
- package/docs/index.html +4 -112
- package/docs/interfaces/AppConfigurationResponse.html +4 -4
- package/docs/interfaces/AssetResponse.html +2 -2
- package/docs/interfaces/AttestationCreateRequest.html +2 -2
- package/docs/interfaces/AttestationResponse.html +2 -2
- package/docs/interfaces/AttestationUpdateRequest.html +2 -2
- package/docs/interfaces/CollectionResponse.html +5 -5
- package/docs/interfaces/ErrorResponse.html +3 -3
- package/docs/interfaces/ProductResponse.html +5 -5
- package/docs/interfaces/ProofResponse.html +8 -8
- package/docs/modules/appConfiguration.html +1 -1
- package/docs/modules/asset.html +1 -1
- package/docs/modules/attestation.html +1 -1
- package/docs/modules/auth.html +1 -1
- package/docs/modules/claimSet.html +3 -0
- package/docs/modules/collection.html +2 -1
- package/docs/modules/crate.html +6 -0
- package/docs/modules/form.html +6 -0
- package/docs/modules/product.html +1 -1
- package/docs/modules/proof.html +1 -1
- package/docs/modules.html +4 -0
- package/docs/types/AccountInfoResponse.html +1 -1
- package/docs/types/AppConfigOptions.html +1 -1
- package/docs/types/LoginResponse.html +1 -1
- package/docs/types/VerifyTokenResponse.html +1 -1
- package/package.json +3 -2
- package/scripts/copy-docs.js +11 -0
- package/src/api/claimSet.ts +23 -0
- package/src/api/collection.ts +17 -3
- package/src/api/crate.ts +43 -0
- package/src/api/form.ts +57 -0
- package/src/api/index.ts +3 -0
- package/src/http.ts +25 -0
- package/src/index.ts +1 -1
- package/temp-docs/README.md +7867 -93
- package/temp-docs/interfaces/AppConfigurationResponse.md +3 -3
- package/temp-docs/interfaces/AssetResponse.md +3 -3
- package/temp-docs/interfaces/AttestationCreateRequest.md +3 -3
- package/temp-docs/interfaces/AttestationResponse.md +6 -6
- package/temp-docs/interfaces/AttestationUpdateRequest.md +2 -2
- package/temp-docs/interfaces/CollectionResponse.md +4 -4
- package/temp-docs/interfaces/ErrorResponse.md +2 -2
- package/temp-docs/interfaces/ProductResponse.md +4 -4
- package/temp-docs/interfaces/ProofResponse.md +7 -7
- package/temp-docs/modules/appConfiguration.md +7 -7
- package/temp-docs/modules/asset.md +7 -7
- package/temp-docs/modules/attestation.md +5 -5
- package/temp-docs/modules/auth.md +4 -4
- package/temp-docs/modules/claimSet.md +52 -0
- package/temp-docs/modules/collection.md +32 -2
- package/temp-docs/modules/crate.md +124 -0
- package/temp-docs/modules/form.md +126 -0
- package/temp-docs/modules/product.md +2 -2
- package/temp-docs/modules/proof.md +2 -2
- 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
|
|