@model-match/api 3.104.0 → 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 +5 -0
- package/dist/{index-BOaR-wUK.d.mts → index-DZEhRXIv.d.mts} +71 -1
- 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 +120 -2
- package/package.json +1 -1
package/RELEASE_NOTES.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
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
|
+
|
|
5
10
|
## 3.104.0
|
|
6
11
|
|
|
7
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.
|
|
@@ -15180,6 +15180,23 @@ type StudioJob = {
|
|
|
15180
15180
|
description?: string;
|
|
15181
15181
|
keys: Array<string>;
|
|
15182
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
|
+
};
|
|
15183
15200
|
name: string;
|
|
15184
15201
|
/**
|
|
15185
15202
|
* When it next runs on its schedule. Null for `manual`.
|
|
@@ -15188,6 +15205,10 @@ type StudioJob = {
|
|
|
15188
15205
|
notify?: {
|
|
15189
15206
|
email: boolean;
|
|
15190
15207
|
};
|
|
15208
|
+
/**
|
|
15209
|
+
* Heavy only: per state, joined. Not for national totals.
|
|
15210
|
+
*/
|
|
15211
|
+
perState?: boolean;
|
|
15191
15212
|
schedule: 'manual' | 'daily' | 'weekly';
|
|
15192
15213
|
/**
|
|
15193
15214
|
* `heavy`: catalog `limits.heavyJobs` apply.
|
|
@@ -15377,6 +15398,10 @@ type StudioJobRequest = {
|
|
|
15377
15398
|
notify?: {
|
|
15378
15399
|
email: boolean;
|
|
15379
15400
|
};
|
|
15401
|
+
/**
|
|
15402
|
+
* Heavy only: per state, joined. Not for national totals.
|
|
15403
|
+
*/
|
|
15404
|
+
perState?: boolean;
|
|
15380
15405
|
/**
|
|
15381
15406
|
* `manual` — runs only when asked. `daily` — about every 24 hours. `weekly` — every 7 days. Counted from when the job is saved.
|
|
15382
15407
|
*/
|
|
@@ -15487,13 +15512,54 @@ type StudioJobRun = {
|
|
|
15487
15512
|
message: string;
|
|
15488
15513
|
};
|
|
15489
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;
|
|
15490
15532
|
rowCount?: number;
|
|
15491
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';
|
|
15492
15538
|
/**
|
|
15493
15539
|
* `heavy`: ran with a heavy job's limits and price.
|
|
15494
15540
|
*/
|
|
15495
15541
|
size?: 'heavy';
|
|
15496
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
|
+
}>;
|
|
15497
15563
|
status: 'running' | 'succeeded' | 'failed';
|
|
15498
15564
|
trigger: 'manual' | 'schedule';
|
|
15499
15565
|
};
|
|
@@ -15527,6 +15593,10 @@ type StudioJobUpdate = {
|
|
|
15527
15593
|
notify?: {
|
|
15528
15594
|
email: boolean;
|
|
15529
15595
|
};
|
|
15596
|
+
/**
|
|
15597
|
+
* Heavy only: per state, joined. Not for national totals.
|
|
15598
|
+
*/
|
|
15599
|
+
perState?: boolean;
|
|
15530
15600
|
/**
|
|
15531
15601
|
* `heavy`: more time and rows per run (catalog `limits.heavyJobs`), if enabled for the organization.
|
|
15532
15602
|
*/
|
|
@@ -39805,7 +39875,7 @@ declare class Studio {
|
|
|
39805
39875
|
/**
|
|
39806
39876
|
* Save a question as a job
|
|
39807
39877
|
*
|
|
39808
|
-
* 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`).
|
|
39809
39879
|
*/
|
|
39810
39880
|
static createStudioJob<ThrowOnError extends boolean = false>(options: Options<CreateStudioJobData, ThrowOnError>): RequestResult<CreateStudioJobResponses, CreateStudioJobErrors, ThrowOnError>;
|
|
39811
39881
|
/**
|