@model-match/api 3.103.1 → 3.105.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 +9 -0
- package/dist/{index-CHjiTYlP.d.mts → index-DZEhRXIv.d.mts} +78 -4
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/slim/index.d.mts +2 -2
- package/dist/slim/index.mjs +2 -2
- package/dist/{src-Bv7R5w1N.mjs → src-D4jlOQcB.mjs} +1 -1
- package/openapi.json +128 -5
- package/package.json +1 -1
package/RELEASE_NOTES.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
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.105.0
|
|
6
|
+
|
|
7
|
+
- **Heavy Studio jobs get capacity of their own.** A job saved with `size: "heavy"` now runs with much more memory and up to several hours per run. Runs take minutes rather than seconds, so `runStudioJob` answers `status: running`; read the job for how it ended. Each job now has `limits` (`timeoutSeconds`, `maxRows`, `runsOn`), and each run says the limits it had.
|
|
8
|
+
- **`perState` on heavy jobs.** `createStudioJob` and `updateStudioJob` accept `perState: true` to run the SQL once per state and combine the results. Use it only when every row depends on a single state's data, such as a list of homes. It is wrong for national rankings or totals, and SQL ending in `LIMIT` is refused. A per-state run lists how each state went in `states`.
|
|
9
|
+
|
|
10
|
+
## 3.104.0
|
|
11
|
+
|
|
12
|
+
- **`sha256Pending` on every file.** When you leave `sha256` out of `createFile` or `createFileRevision`, `completeFile` now returns at once and the SHA-256 is computed in the background. Until it is known, `sha256Pending` is `true` and `sha256` is empty. The file opens and downloads as usual in the meantime. A `sha256` you declare is still checked when you upload, as before.
|
|
13
|
+
|
|
5
14
|
## 3.103.1
|
|
6
15
|
|
|
7
16
|
- Regenerated from the latest API spec. No changes to the client itself.
|
|
@@ -8067,9 +8067,13 @@ type File = {
|
|
|
8067
8067
|
*/
|
|
8068
8068
|
role: 'owner' | 'editor' | 'viewer';
|
|
8069
8069
|
/**
|
|
8070
|
-
* Hex SHA-256 of the bytes. Empty while
|
|
8070
|
+
* Hex SHA-256 of the bytes. Empty while `sha256Pending` is true.
|
|
8071
8071
|
*/
|
|
8072
8072
|
sha256: string;
|
|
8073
|
+
/**
|
|
8074
|
+
* True while the SHA-256 is not known yet: the upload (or the latest replacement) declared none, so it is computed in the background after `complete`, usually within a minute or two for large files. The file opens and downloads as usual meanwhile; `sha256` is empty until it is set.
|
|
8075
|
+
*/
|
|
8076
|
+
sha256Pending: boolean;
|
|
8073
8077
|
sizeBytes: number;
|
|
8074
8078
|
/**
|
|
8075
8079
|
* `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).
|
|
@@ -8141,7 +8145,7 @@ type FileCreate = {
|
|
|
8141
8145
|
[key: string]: string;
|
|
8142
8146
|
};
|
|
8143
8147
|
/**
|
|
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
|
|
8148
|
+
* 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 in the background after the upload completes (`sha256Pending` is true until then).
|
|
8145
8149
|
*/
|
|
8146
8150
|
sha256?: string;
|
|
8147
8151
|
/**
|
|
@@ -8189,7 +8193,7 @@ type FileRevisionCreate = {
|
|
|
8189
8193
|
*/
|
|
8190
8194
|
mediaType?: string;
|
|
8191
8195
|
/**
|
|
8192
|
-
* Hex SHA-256 of the new bytes, if you have it. Leave it out and it is computed
|
|
8196
|
+
* Hex SHA-256 of the new bytes, if you have it. Leave it out and it is computed in the background after complete (`sha256Pending` is true until then).
|
|
8193
8197
|
*/
|
|
8194
8198
|
sha256?: string;
|
|
8195
8199
|
/**
|
|
@@ -15176,6 +15180,23 @@ type StudioJob = {
|
|
|
15176
15180
|
description?: string;
|
|
15177
15181
|
keys: Array<string>;
|
|
15178
15182
|
lastRun: StudioJobRun;
|
|
15183
|
+
/**
|
|
15184
|
+
* What one run of this job may use, as things stand now.
|
|
15185
|
+
*/
|
|
15186
|
+
limits?: {
|
|
15187
|
+
/**
|
|
15188
|
+
* Most rows one run's result may hold.
|
|
15189
|
+
*/
|
|
15190
|
+
maxRows: number;
|
|
15191
|
+
/**
|
|
15192
|
+
* `dedicated`: each run gets capacity of its own, with more memory (a `heavy` job, when available). `shared`: runs on the shared capacity.
|
|
15193
|
+
*/
|
|
15194
|
+
runsOn: 'dedicated' | 'shared';
|
|
15195
|
+
/**
|
|
15196
|
+
* How long one run may take before it is stopped.
|
|
15197
|
+
*/
|
|
15198
|
+
timeoutSeconds: number;
|
|
15199
|
+
};
|
|
15179
15200
|
name: string;
|
|
15180
15201
|
/**
|
|
15181
15202
|
* When it next runs on its schedule. Null for `manual`.
|
|
@@ -15184,6 +15205,10 @@ type StudioJob = {
|
|
|
15184
15205
|
notify?: {
|
|
15185
15206
|
email: boolean;
|
|
15186
15207
|
};
|
|
15208
|
+
/**
|
|
15209
|
+
* Heavy only: per state, joined. Not for national totals.
|
|
15210
|
+
*/
|
|
15211
|
+
perState?: boolean;
|
|
15187
15212
|
schedule: 'manual' | 'daily' | 'weekly';
|
|
15188
15213
|
/**
|
|
15189
15214
|
* `heavy`: catalog `limits.heavyJobs` apply.
|
|
@@ -15373,6 +15398,10 @@ type StudioJobRequest = {
|
|
|
15373
15398
|
notify?: {
|
|
15374
15399
|
email: boolean;
|
|
15375
15400
|
};
|
|
15401
|
+
/**
|
|
15402
|
+
* Heavy only: per state, joined. Not for national totals.
|
|
15403
|
+
*/
|
|
15404
|
+
perState?: boolean;
|
|
15376
15405
|
/**
|
|
15377
15406
|
* `manual` — runs only when asked. `daily` — about every 24 hours. `weekly` — every 7 days. Counted from when the job is saved.
|
|
15378
15407
|
*/
|
|
@@ -15483,13 +15512,54 @@ type StudioJobRun = {
|
|
|
15483
15512
|
message: string;
|
|
15484
15513
|
};
|
|
15485
15514
|
finishedAt?: string;
|
|
15515
|
+
/**
|
|
15516
|
+
* The limits this run had.
|
|
15517
|
+
*/
|
|
15518
|
+
limits?: {
|
|
15519
|
+
/**
|
|
15520
|
+
* Most rows one run's result may hold.
|
|
15521
|
+
*/
|
|
15522
|
+
maxRows: number;
|
|
15523
|
+
/**
|
|
15524
|
+
* How long one run may take before it is stopped.
|
|
15525
|
+
*/
|
|
15526
|
+
timeoutSeconds: number;
|
|
15527
|
+
};
|
|
15528
|
+
/**
|
|
15529
|
+
* True: the SQL ran once for each state (`perState`).
|
|
15530
|
+
*/
|
|
15531
|
+
perState?: boolean;
|
|
15486
15532
|
rowCount?: number;
|
|
15487
15533
|
runId: string;
|
|
15534
|
+
/**
|
|
15535
|
+
* `dedicated`: ran on capacity of its own, with more memory than an ordinary run. Absent: the shared capacity.
|
|
15536
|
+
*/
|
|
15537
|
+
runsOn?: 'dedicated';
|
|
15488
15538
|
/**
|
|
15489
15539
|
* `heavy`: ran with a heavy job's limits and price.
|
|
15490
15540
|
*/
|
|
15491
15541
|
size?: 'heavy';
|
|
15492
15542
|
startedAt: string;
|
|
15543
|
+
/**
|
|
15544
|
+
* A per-state run: how each state went.
|
|
15545
|
+
*/
|
|
15546
|
+
states?: Array<{
|
|
15547
|
+
/**
|
|
15548
|
+
* 2 when the first try failed and it was tried again.
|
|
15549
|
+
*/
|
|
15550
|
+
attempts: number;
|
|
15551
|
+
elapsedMs?: number;
|
|
15552
|
+
error?: {
|
|
15553
|
+
code: string;
|
|
15554
|
+
message: string;
|
|
15555
|
+
};
|
|
15556
|
+
rowCount?: number;
|
|
15557
|
+
/**
|
|
15558
|
+
* Two-letter state code; `other` for records whose state is not known.
|
|
15559
|
+
*/
|
|
15560
|
+
state: string;
|
|
15561
|
+
status: 'succeeded' | 'failed';
|
|
15562
|
+
}>;
|
|
15493
15563
|
status: 'running' | 'succeeded' | 'failed';
|
|
15494
15564
|
trigger: 'manual' | 'schedule';
|
|
15495
15565
|
};
|
|
@@ -15523,6 +15593,10 @@ type StudioJobUpdate = {
|
|
|
15523
15593
|
notify?: {
|
|
15524
15594
|
email: boolean;
|
|
15525
15595
|
};
|
|
15596
|
+
/**
|
|
15597
|
+
* Heavy only: per state, joined. Not for national totals.
|
|
15598
|
+
*/
|
|
15599
|
+
perState?: boolean;
|
|
15526
15600
|
/**
|
|
15527
15601
|
* `heavy`: more time and rows per run (catalog `limits.heavyJobs`), if enabled for the organization.
|
|
15528
15602
|
*/
|
|
@@ -39801,7 +39875,7 @@ declare class Studio {
|
|
|
39801
39875
|
/**
|
|
39802
39876
|
* Save a question as a job
|
|
39803
39877
|
*
|
|
39804
|
-
* Save a SQL question to run again: on a schedule (`daily`, `weekly`) or only when asked (`manual`). Each run stores its result as a table named after the job, which later questions — and later jobs — can query like any other table. Name the `keys` (the columns that identify one row) to get 'what changed since the last run', and add `alerts` to flag new rows, removed rows or a number crossing a threshold. When an alert matches on a scheduled run, the job's creator is emailed (once per hourly tick, every job of theirs in one email, also in their notifications); `notify: { email: false }` saves the job without those emails, and `updateStudioJob` changes it later. Webhooks are not available yet. The SQL is checked when the job is saved: an unknown table or column, or a key that is not in the result, is refused here rather than at the first run. Saving does not run the job. To start from an existing job, give `copyFrom` (one of your jobs) or `copyFromPublished` (the `mm_*` table of a job ModelMatch publishes) instead of `sql`: its SQL, keys, alerts and description are copied into an editable job of your own — anything the request gives overrides them — checked like any other, starting `manual`; the job keeps `copiedFrom`. A published table built by a program, or a published model (copy that with createStudioModel and `basedOnPublished`), cannot be copied as a job. Saving is free; each run that succeeds costs 10 credits, including the runs a `daily` or `weekly` schedule starts. `size: heavy`: more time and rows per run (the catalog's `limits.heavyJobs`), 100 credits a run, for organizations with heavy runs enabled (`403 entitlement_missing` otherwise); the SQL rules are the same.
|
|
39878
|
+
* Save a SQL question to run again: on a schedule (`daily`, `weekly`) or only when asked (`manual`). Each run stores its result as a table named after the job, which later questions — and later jobs — can query like any other table. Name the `keys` (the columns that identify one row) to get 'what changed since the last run', and add `alerts` to flag new rows, removed rows or a number crossing a threshold. When an alert matches on a scheduled run, the job's creator is emailed (once per hourly tick, every job of theirs in one email, also in their notifications); `notify: { email: false }` saves the job without those emails, and `updateStudioJob` changes it later. Webhooks are not available yet. The SQL is checked when the job is saved: an unknown table or column, or a key that is not in the result, is refused here rather than at the first run. Saving does not run the job. To start from an existing job, give `copyFrom` (one of your jobs) or `copyFromPublished` (the `mm_*` table of a job ModelMatch publishes) instead of `sql`: its SQL, keys, alerts and description are copied into an editable job of your own — anything the request gives overrides them — checked like any other, starting `manual`; the job keeps `copiedFrom`. A published table built by a program, or a published model (copy that with createStudioModel and `basedOnPublished`), cannot be copied as a job. Saving is free; each run that succeeds costs 10 credits, including the runs a `daily` or `weekly` schedule starts. `size: heavy`: more time and rows per run (the catalog's `limits.heavyJobs`), 100 credits a run, for organizations with heavy runs enabled (`403 entitlement_missing` otherwise); the SQL rules are the same. A heavy run gets capacity of its own with more memory and takes minutes rather than seconds; the job's `limits` say how long a run may take. `perState: true` (heavy jobs only; off unless set) runs the SQL once for each state and puts the results together. It is correct ONLY when every row of the result depends on one state's data — a list of homes, a join per property. It is wrong for national rankings, totals or averages: a top 10 would become a top 10 in every state. SQL ending in `LIMIT` is refused for it. A state that fails is tried once more, and the run lists how each state went (`states`).
|
|
39805
39879
|
*/
|
|
39806
39880
|
static createStudioJob<ThrowOnError extends boolean = false>(options: Options<CreateStudioJobData, ThrowOnError>): RequestResult<CreateStudioJobResponses, CreateStudioJobErrors, ThrowOnError>;
|
|
39807
39881
|
/**
|