@model-match/api 3.101.0 → 3.103.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/RELEASE_NOTES.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  Changes to `@model-match/api` that affect how you use it. Each version is generated from the ModelMatch API's OpenAPI spec, so new endpoints and fields appear in the [API reference](https://docs.modelmatch.com/developers) as they ship.
4
4
 
5
+ ## 3.103.0
6
+
7
+ - **`sha256` is optional on `createFile` and `createFileRevision`.** Leave it out and it is computed when the upload completes. Until then, the file's `sha256` is empty.
8
+ - **Raising a file to protected finishes in the background.** After `updateFile` with `class: "protected"`, the file is `reencrypting` for a short time, usually under a minute. It still lists, but opening, replacing, sharing, linking or deleting it answers `409 file_busy` until it is `ready` again. If `statusReason` is `reencrypt_failed`, raise it again to retry.
9
+ - **`statusReason` on every file.** It says why a file was rejected: `malware`; `unscannable`, meaning it could not be checked for malware (for example, it is password-protected), so upload a version that can be checked; or `size_mismatch` / `checksum_mismatch`. `unscannable` replaces `scan_failed`.
10
+ - **New kind `data`** for JSON and NDJSON files and exports.
11
+
12
+ ## 3.102.0
13
+
14
+ - **CRM documents.** `createFile` (`links`) and `linkFile` accept `crm_record:<id>` for a CRM record you can see. Anyone who can see the record can view the standard files linked to it. Protected files stay shared person by person.
15
+ - **A record's documents.** `listFiles` with `linkedTo=crm_record:<id>` returns the record's documents and a new `hiddenProtectedCount`, the number of protected files linked to the record that you cannot open. You get `404` for a record you cannot see.
16
+
5
17
  ## 3.101.0
6
18
 
7
19
  - **Protected files.** Create a file with `class: "protected"`, or have its owner raise an existing file with `updateFile`. A protected file can be shared with named people only. Every access is recorded, and the file opens through a link that works once and lasts 5 minutes (`getFileContent` returns `oneTime: true`). An agent needs the person's approval in that conversation (`approveFileForAgent`). Owners and organization admins can read `getFileAccessLog`, and admins can read `getFilesAccessReport`, as JSON or CSV. This is available to selected organizations first.
@@ -8066,12 +8066,19 @@ type File = {
8066
8066
  * Your role on the file; `null` when you see it as an organization admin.
8067
8067
  */
8068
8068
  role: 'owner' | 'editor' | 'viewer';
8069
+ /**
8070
+ * Hex SHA-256 of the bytes. Empty while an upload that declared none is in progress; set when it completes.
8071
+ */
8069
8072
  sha256: string;
8070
8073
  sizeBytes: number;
8071
8074
  /**
8072
- * `uploading`, `scanning`, `ready` or `rejected`.
8075
+ * `uploading` (waiting for the bytes), `scanning` (being checked for malware), `ready`, `rejected` (see `statusReason`; the bytes were removed), or `reencrypting` (just made protected and being encrypted again; it lists, but cannot be opened, replaced, shared, linked or deleted until it is `ready`, usually within a minute).
8073
8076
  */
8074
8077
  status: string;
8078
+ /**
8079
+ * Why the file is in its status, or `null`. For `rejected`: `malware` (it did not pass the malware check); `unscannable` (it could not be checked for malware, for example because it is password-protected or encrypted; upload a version that can be checked); `size_mismatch` or `checksum_mismatch` (the bytes were not what was declared; start a new upload). For `reencrypting`: `reencrypt_failed` (encrypting it did not finish; it stays closed, and making it protected again retries).
8080
+ */
8081
+ statusReason: string;
8075
8082
  updatedAt: string;
8076
8083
  };
8077
8084
  type FileAccessLogEntry = {
@@ -8134,9 +8141,9 @@ type FileCreate = {
8134
8141
  [key: string]: string;
8135
8142
  };
8136
8143
  /**
8137
- * Hex SHA-256 of the bytes. The upload is refused if the bytes differ.
8144
+ * Hex SHA-256 of the bytes, if you have it: the upload is then refused when the bytes differ. Leave it out and it is computed when the upload completes.
8138
8145
  */
8139
- sha256: string;
8146
+ sha256?: string;
8140
8147
  /**
8141
8148
  * Exact size in bytes (up to 5 GB).
8142
8149
  */
@@ -8144,7 +8151,7 @@ type FileCreate = {
8144
8151
  };
8145
8152
  type FileError = {
8146
8153
  /**
8147
- * Stable code: `not_found`, `forbidden`, `no_organization`, `unauthenticated`, `invalid_request`, `invalid_cursor`, `invalid_principal`, `principal_not_in_organization`, `invalid_link_target`, `link_target_not_supported`, `link_not_found`, `share_not_found`, `upload_missing`, `upload_rejected`, `size_mismatch`, `checksum_mismatch`, `not_ready`, `legal_hold`, `retention`, `protected_not_enabled`, `protected_share_scope`, `agent_not_approved`, `human_required`, `not_protected`, `invalid_derived_from`, `malware`, `scan_failed`, `access_log_unavailable`, `scan_pending`, `revision_pending`, `storage_unavailable`, `membership_unavailable`.
8154
+ * Stable code: `not_found`, `forbidden`, `no_organization`, `unauthenticated`, `invalid_request`, `invalid_cursor`, `invalid_principal`, `principal_not_in_organization`, `invalid_link_target`, `link_target_not_supported`, `link_not_found`, `share_not_found`, `upload_missing`, `upload_rejected`, `size_mismatch`, `checksum_mismatch`, `not_ready`, `legal_hold`, `retention`, `protected_not_enabled`, `protected_share_scope`, `agent_not_approved`, `human_required`, `not_protected`, `invalid_derived_from`, `malware`, `unscannable`, `file_busy`, `access_log_unavailable`, `scan_pending`, `revision_pending`, `storage_unavailable`, `membership_unavailable`.
8148
8155
  */
8149
8156
  code: string;
8150
8157
  /**
@@ -8154,13 +8161,13 @@ type FileError = {
8154
8161
  };
8155
8162
  type FileLinkCreate = {
8156
8163
  /**
8157
- * What the file belongs to, as `<type>:<id>`: `studio_table`, `ask_chat`, `ask_project` or `export_job`.
8164
+ * What the file belongs to, as `<type>:<id>`: `crm_record` (a CRM person or company, by its record id, e.g. `crm_record:lo:123`), `studio_table`, `ask_chat`, `ask_project` or `export_job`. You must be able to see a CRM record to link a file to it, and anyone who can see the record can view the standard files linked to it.
8158
8165
  */
8159
8166
  target: string;
8160
8167
  };
8161
8168
  type FilePatch = {
8162
8169
  /**
8163
- * Raise the class to protected (the owner only). It can never be lowered. Team and organization shares are removed.
8170
+ * Raise the class to protected (the owner only, a ready file). It can never be lowered. Team and organization shares are removed, and the file is `reencrypting` until it is encrypted again (usually within a minute). Sending it again for a file still `reencrypting` retries.
8164
8171
  */
8165
8172
  class?: 'protected';
8166
8173
  /**
@@ -8182,9 +8189,9 @@ type FileRevisionCreate = {
8182
8189
  */
8183
8190
  mediaType?: string;
8184
8191
  /**
8185
- * Hex SHA-256 of the new bytes.
8192
+ * Hex SHA-256 of the new bytes, if you have it. Leave it out and it is computed on complete.
8186
8193
  */
8187
- sha256: string;
8194
+ sha256?: string;
8188
8195
  /**
8189
8196
  * Exact size of the new bytes.
8190
8197
  */
@@ -28993,11 +29000,11 @@ type ListFilesData = {
28993
29000
  */
28994
29001
  class?: 'standard' | 'protected';
28995
29002
  /**
28996
- * Comma-separated statuses (default `ready`).
29003
+ * Comma-separated statuses (default `ready` and `reencrypting`).
28997
29004
  */
28998
29005
  status?: string;
28999
29006
  /**
29000
- * What the file belongs to, as `<type>:<id>`: `studio_table`, `ask_chat`, `ask_project` or `export_job`.
29007
+ * What the file belongs to, as `<type>:<id>`: `crm_record` (a CRM person or company, by its record id, e.g. `crm_record:lo:123`), `studio_table`, `ask_chat`, `ask_project` or `export_job`. You must be able to see a CRM record to link a file to it, and anyone who can see the record can view the standard files linked to it.
29001
29008
  */
29002
29009
  linkedTo?: string;
29003
29010
  /**
@@ -29066,6 +29073,10 @@ type ListFilesResponses = {
29066
29073
  value: string;
29067
29074
  }>;
29068
29075
  };
29076
+ /**
29077
+ * Only when `linkedTo` is a CRM record: how many protected files are linked to it that you cannot open. Protected files are shared person by person; seeing the record does not open them.
29078
+ */
29079
+ hiddenProtectedCount?: number;
29069
29080
  nextCursor: string;
29070
29081
  };
29071
29082
  };
@@ -29712,7 +29723,7 @@ type UnlinkFileData = {
29712
29723
  };
29713
29724
  query: {
29714
29725
  /**
29715
- * What the file belongs to, as `<type>:<id>`: `studio_table`, `ask_chat`, `ask_project` or `export_job`.
29726
+ * What the file belongs to, as `<type>:<id>`: `crm_record` (a CRM person or company, by its record id, e.g. `crm_record:lo:123`), `studio_table`, `ask_chat`, `ask_project` or `export_job`. You must be able to see a CRM record to link a file to it, and anyone who can see the record can view the standard files linked to it.
29716
29727
  */
29717
29728
  target: string;
29718
29729
  };
@@ -38880,13 +38891,13 @@ declare class Files {
38880
38891
  /**
38881
38892
  * Your files
38882
38893
  *
38883
- * Files you own and files shared with you, newest first. Filter by origin, kind, class, status, what a file is linked to (`linkedTo`), or only files others shared with you (`sharedWithMe=true`). Pass `facets=true` for counts per origin and kind. Page with `cursor` (from `nextCursor`). Organization admins can pass `scope=org` to list every file in the organization. Free.
38894
+ * Files you own and files shared with you, newest first. Filter by origin, kind, class, status, what a file is linked to (`linkedTo`), or only files others shared with you (`sharedWithMe=true`). Pass `facets=true` for counts per origin and kind. Page with `cursor` (from `nextCursor`). Organization admins can pass `scope=org` to list every file in the organization. With `linkedTo=crm_record:<id>` you must be able to see that CRM record (otherwise 404); you then get every standard file linked to it, the protected files linked to it that you can open, and `hiddenProtectedCount` for the protected ones you cannot. Free.
38884
38895
  */
38885
38896
  static list<ThrowOnError extends boolean = false>(options?: Options<ListFilesData, ThrowOnError>): RequestResult<ListFilesResponses, ListFilesErrors, ThrowOnError>;
38886
38897
  /**
38887
38898
  * Start an upload
38888
38899
  *
38889
- * Step one of two: declare the file (name, type, exact size and SHA-256) and get `upload`, a URL to PUT the bytes to with the headers given. Step two: call complete. A new file is visible only to you until you share it. Free.
38900
+ * Step one of two: declare the file (name, type, exact size and, optionally, its SHA-256) and get `upload`, a URL to PUT the bytes to with the headers given. Step two: call complete. A new file is visible only to you until you share it. Free.
38890
38901
  */
38891
38902
  static create<ThrowOnError extends boolean = false>(options: Options<CreateFileData, ThrowOnError>): RequestResult<CreateFileResponses, CreateFileErrors, ThrowOnError>;
38892
38903
  /**
@@ -38940,7 +38951,7 @@ declare class Files {
38940
38951
  /**
38941
38952
  * Finish an upload
38942
38953
  *
38943
- * Call after the bytes were PUT to the upload URL. The size and SHA-256 are checked; a match makes the file ready (`200`), or `scanning` while it is checked for malware (`202`, call again shortly). A mismatch answers `422` and the upload must be started again. Calling it again is safe. Free.
38954
+ * Call after the bytes were PUT to the upload URL. The size and SHA-256 are checked (when no SHA-256 was declared it is computed now); a match makes the file ready (`200`), or `scanning` while it is checked for malware (`202`, call again shortly). A mismatch answers `422` and the upload must be started again. Calling it again is safe. Free.
38944
38955
  */
38945
38956
  static complete<ThrowOnError extends boolean = false>(options: Options<CompleteFileData, ThrowOnError>): RequestResult<CompleteFileResponses, CompleteFileErrors, ThrowOnError>;
38946
38957
  /**
@@ -38952,19 +38963,19 @@ declare class Files {
38952
38963
  /**
38953
38964
  * Detach a file
38954
38965
  *
38955
- * The owner or an editor removes a link. Free.
38966
+ * The owner or an editor removes a link. Removing a CRM record link also needs you to be able to see the record. Free.
38956
38967
  */
38957
38968
  static unlink<ThrowOnError extends boolean = false>(options: Options<UnlinkFileData, ThrowOnError>): RequestResult<UnlinkFileResponses, UnlinkFileErrors, ThrowOnError>;
38958
38969
  /**
38959
38970
  * Attach a file to something
38960
38971
  *
38961
- * The owner or an editor attaches a file to a Studio table, a chat, a project or an export. A link does not share the file with anyone. Free.
38972
+ * The owner or an editor attaches a file to a CRM record, a Studio table, a chat, a project or an export. Linking to a CRM record needs you to be able to see the record, and lets anyone who can see the record view the file if it is standard (a protected file stays shared person by person). Other links share the file with no one. Free.
38962
38973
  */
38963
38974
  static link<ThrowOnError extends boolean = false>(options: Options<LinkFileData, ThrowOnError>): RequestResult<LinkFileResponses, LinkFileErrors, ThrowOnError>;
38964
38975
  /**
38965
38976
  * Replace a file's contents
38966
38977
  *
38967
- * The owner or an editor replaces a ready file's bytes and keeps its id, shares and links. Declare the new size and SHA-256, PUT the bytes to `upload` with the headers given, then call complete. Until complete succeeds the file keeps its current contents; a mismatch leaves it unchanged. Free.
38978
+ * The owner or an editor replaces a ready file's bytes and keeps its id, shares and links. Declare the new size (and, optionally, SHA-256), PUT the bytes to `upload` with the headers given, then call complete. Until complete succeeds the file keeps its current contents; a mismatch leaves it unchanged. Free.
38968
38979
  */
38969
38980
  static createFileRevision<ThrowOnError extends boolean = false>(options: Options<CreateFileRevisionData, ThrowOnError>): RequestResult<CreateFileRevisionResponses, CreateFileRevisionErrors, ThrowOnError>;
38970
38981
  /**