@fias/create-fias-plugin 1.5.0 → 1.7.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fias/create-fias-plugin",
3
- "version": "1.5.0",
3
+ "version": "1.7.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -1,3 +1,5 @@
1
+ <!-- fias-sdk-guide-version: 2.14.0 -->
2
+
1
3
  # FIAS Plugin Development Guide
2
4
 
3
5
  This project is a FIAS platform plugin — a React application that runs in a sandboxed iframe within the FIAS marketplace. This file provides the context AI coding assistants need to build, test, and submit plugins effectively.
@@ -744,6 +746,7 @@ if ('canceled' in picked) {
744
746
  const granted = await userDocs.list(); // all granted docs
745
747
  const { document, content } = await userDocs.get(id, { includeContent: true }); // text docs
746
748
  const { url } = await userDocs.getDownloadUrl(id); // binary docs (images, PDFs)
749
+ const { bytes } = await userDocs.getBytes(id); // raw bytes for PROCESSING binary docs
747
750
  ```
748
751
 
749
752
  **The consent model (what to tell your users):**
@@ -752,7 +755,9 @@ const { url } = await userDocs.getDownloadUrl(id); // binary docs (images, PDFs)
752
755
  - After revocation, `get`/`getDownloadUrl` reject with `DOCUMENT_NOT_FOUND` — handle that path gracefully (drop the document from your UI; do not retry in a loop).
753
756
  - `proprietary`-sensitivity documents are never grantable (they don't even appear in the picker).
754
757
  - Every read is audited by the platform; a new document _version_ is a new documentId, so a re-pick is needed after the user replaces a document.
755
- - Not available in the builder preview or the dev harness — `pick()` resolves `{ canceled: true }` there. Test the flow in the published plugin with your own documents.
758
+ - `getDownloadUrl` is for DISPLAY (`<img src>`); your iframe cannot fetch the URL (CSP). To process binary content (parse a PDF, transform an image), use `getBytes(id)` — size-capped at 15 MB (`CONSENTED_DOCUMENT_TOO_LARGE` names the cap; ask the user to open the file manually instead). `getBytes` has a tighter per-minute budget than the rest of the family because it can move megabytes: read sequentially, and surface a rate-limit error rather than retrying in a loop.
759
+ - Revocation behaves differently per method: `getBytes` and `get` re-check the grant on every call, so they start failing immediately. A URL already handed out by `getDownloadUrl` keeps working until it expires (1 hour) — that is the documented contract, not a bug.
760
+ - **Testable in the dev harness (mock mode).** `pick()` grants a small fixture set — a text file, a real PDF, and one deliberately over the 15 MB cap — and `list` / `get` / `getDownloadUrl` / `getBytes` all resolve against it, including the refusals (`BINARY_DOCUMENT` on a text read of a PDF, `CONSENTED_DOCUMENT_TOO_LARGE`, `DOCUMENT_NOT_FOUND`). Run the harness with `FIAS_HARNESS_VAULT_PICK=canceled` to exercise the cancel branch. Not available in the builder preview — `pick()` resolves `{ canceled: true }` there.
756
761
 
757
762
  ### `useFiasAIActions()` — Let the platform's Fias AI assistant operate your plugin
758
763
 
@@ -1,3 +1,5 @@
1
+ <!-- fias-sdk-guide-version: 2.14.0 -->
2
+
1
3
  # FIAS Plugin Development Guide
2
4
 
3
5
  This project is a FIAS platform plugin — a React application that runs in a sandboxed iframe within the FIAS marketplace. This file provides the context AI coding assistants need to build, test, and submit plugins effectively.
@@ -744,6 +746,7 @@ if ('canceled' in picked) {
744
746
  const granted = await userDocs.list(); // all granted docs
745
747
  const { document, content } = await userDocs.get(id, { includeContent: true }); // text docs
746
748
  const { url } = await userDocs.getDownloadUrl(id); // binary docs (images, PDFs)
749
+ const { bytes } = await userDocs.getBytes(id); // raw bytes for PROCESSING binary docs
747
750
  ```
748
751
 
749
752
  **The consent model (what to tell your users):**
@@ -752,7 +755,9 @@ const { url } = await userDocs.getDownloadUrl(id); // binary docs (images, PDFs)
752
755
  - After revocation, `get`/`getDownloadUrl` reject with `DOCUMENT_NOT_FOUND` — handle that path gracefully (drop the document from your UI; do not retry in a loop).
753
756
  - `proprietary`-sensitivity documents are never grantable (they don't even appear in the picker).
754
757
  - Every read is audited by the platform; a new document _version_ is a new documentId, so a re-pick is needed after the user replaces a document.
755
- - Not available in the builder preview or the dev harness — `pick()` resolves `{ canceled: true }` there. Test the flow in the published plugin with your own documents.
758
+ - `getDownloadUrl` is for DISPLAY (`<img src>`); your iframe cannot fetch the URL (CSP). To process binary content (parse a PDF, transform an image), use `getBytes(id)` — size-capped at 15 MB (`CONSENTED_DOCUMENT_TOO_LARGE` names the cap; ask the user to open the file manually instead). `getBytes` has a tighter per-minute budget than the rest of the family because it can move megabytes: read sequentially, and surface a rate-limit error rather than retrying in a loop.
759
+ - Revocation behaves differently per method: `getBytes` and `get` re-check the grant on every call, so they start failing immediately. A URL already handed out by `getDownloadUrl` keeps working until it expires (1 hour) — that is the documented contract, not a bug.
760
+ - **Testable in the dev harness (mock mode).** `pick()` grants a small fixture set — a text file, a real PDF, and one deliberately over the 15 MB cap — and `list` / `get` / `getDownloadUrl` / `getBytes` all resolve against it, including the refusals (`BINARY_DOCUMENT` on a text read of a PDF, `CONSENTED_DOCUMENT_TOO_LARGE`, `DOCUMENT_NOT_FOUND`). Run the harness with `FIAS_HARNESS_VAULT_PICK=canceled` to exercise the cancel branch. Not available in the builder preview — `pick()` resolves `{ canceled: true }` there.
756
761
 
757
762
  ### `useFiasAIActions()` — Let the platform's Fias AI assistant operate your plugin
758
763