@model-match/api 3.102.0 → 3.103.1

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,17 @@
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.1
6
+
7
+ - Regenerated from the latest API spec. No changes to the client itself.
8
+
9
+ ## 3.103.0
10
+
11
+ - **`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.
12
+ - **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.
13
+ - **`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`.
14
+ - **New kind `data`** for JSON and NDJSON files and exports.
15
+
5
16
  ## 3.102.0
6
17
 
7
18
  - **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.
@@ -8018,7 +8018,7 @@ type FieldCondition = {
8018
8018
  };
8019
8019
  type File = {
8020
8020
  /**
8021
- * `standard` (the default) or `protected`. A protected file is shared with named people only, opens through a one-time link, records every access in its access log, and an agent can open it only after the person approves it in that conversation. Not every organization can create protected files yet (`protected_not_enabled`).
8021
+ * `standard` (the default) or `protected`. A protected file is shared with named people only, opens through a one-time link, records every access in its access log, and an agent can open it only after the person approves it in that conversation.
8022
8022
  */
8023
8023
  class: 'standard' | 'protected';
8024
8024
  /**
@@ -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 = {
@@ -8106,7 +8113,7 @@ type FileAgentApprovalCreate = {
8106
8113
  };
8107
8114
  type FileCreate = {
8108
8115
  /**
8109
- * `standard` (the default) or `protected`. A protected file is shared with named people only, opens through a one-time link, records every access in its access log, and an agent can open it only after the person approves it in that conversation. Not every organization can create protected files yet (`protected_not_enabled`).
8116
+ * `standard` (the default) or `protected`. A protected file is shared with named people only, opens through a one-time link, records every access in its access log, and an agent can open it only after the person approves it in that conversation.
8110
8117
  */
8111
8118
  class?: 'standard' | 'protected';
8112
8119
  /**
@@ -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_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
  /**
@@ -8160,7 +8167,7 @@ type FileLinkCreate = {
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
  */
@@ -28989,11 +28996,11 @@ type ListFilesData = {
28989
28996
  */
28990
28997
  kind?: string;
28991
28998
  /**
28992
- * `standard` (the default) or `protected`. A protected file is shared with named people only, opens through a one-time link, records every access in its access log, and an agent can open it only after the person approves it in that conversation. Not every organization can create protected files yet (`protected_not_enabled`).
28999
+ * `standard` (the default) or `protected`. A protected file is shared with named people only, opens through a one-time link, records every access in its access log, and an agent can open it only after the person approves it in that conversation.
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
  /**
@@ -38890,7 +38897,7 @@ declare class Files {
38890
38897
  /**
38891
38898
  * Start an upload
38892
38899
  *
38893
- * 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.
38894
38901
  */
38895
38902
  static create<ThrowOnError extends boolean = false>(options: Options<CreateFileData, ThrowOnError>): RequestResult<CreateFileResponses, CreateFileErrors, ThrowOnError>;
38896
38903
  /**
@@ -38944,7 +38951,7 @@ declare class Files {
38944
38951
  /**
38945
38952
  * Finish an upload
38946
38953
  *
38947
- * 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.
38948
38955
  */
38949
38956
  static complete<ThrowOnError extends boolean = false>(options: Options<CompleteFileData, ThrowOnError>): RequestResult<CompleteFileResponses, CompleteFileErrors, ThrowOnError>;
38950
38957
  /**
@@ -38968,7 +38975,7 @@ declare class Files {
38968
38975
  /**
38969
38976
  * Replace a file's contents
38970
38977
  *
38971
- * 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.
38972
38979
  */
38973
38980
  static createFileRevision<ThrowOnError extends boolean = false>(options: Options<CreateFileRevisionData, ThrowOnError>): RequestResult<CreateFileRevisionResponses, CreateFileRevisionErrors, ThrowOnError>;
38974
38981
  /**