@model-match/api 3.93.0 → 3.95.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,16 @@
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.95.0
6
+
7
+ - **Studio models can rank mortgage companies.** `createStudioModel` takes `subject: "company"` to score companies on losing or hiring a large part of their loan officers, or entering a state. Pick the share with `outcomeOptions.threshold` (for example `{ threshold: 0.15 }`). Uploaded outcomes are matched by company NMLS id (`company_nmls_id`).
8
+ - **Each outcome can have its own default data points.** `getStudioModelOptions` lists them as `outcomes[].dataPoints`; a model created without `features` uses that list. Existing outcomes' defaults are unchanged.
9
+ - **Two new home data points:** `months_since_last_listing` and `area_listing_rate_12m`. They are part of `home_listed`'s default list and can be picked for any home outcome.
10
+
11
+ ## 3.94.0
12
+
13
+ - **`createClient()` adds `monitors`.** `client.monitors` groups the monitor methods (`Monitors`), starting with `client.monitors.list()` for everything that watches data for you. Nothing else changes.
14
+
5
15
  ## 3.93.0
6
16
 
7
17
  - **Studio models can rank agents.** `createStudioModel` takes `subject: "agent"` to score agents on who is likely to stop selling, or to lose or gain share of their state's sales. `population: { kind: "agents_of_company", companyNmlsId }` scores the agents whose clients took a mortgage from one company's loan officers. Uploaded outcomes are matched by agent id (`agent_id`).
@@ -9719,27 +9719,31 @@ type Monitor = {
9719
9719
  };
9720
9720
  description?: string;
9721
9721
  /**
9722
- * How to change it: the recipe routes with `recipeId`, or the Studio job routes with `jobName`.
9722
+ * How to change it: the recipe routes with `recipeId`; the Studio job routes with `jobName`; or, for `monitor`, `PATCH /v1/monitors/{id}` with `id` (`jobName` is then the job that holds its table and runs).
9723
9723
  */
9724
9724
  edit: {
9725
9725
  kind: 'recipe';
9726
9726
  recipeId: string;
9727
9727
  } | {
9728
+ /**
9729
+ * `monitor` only: the monitor's id.
9730
+ */
9731
+ id?: string;
9728
9732
  jobName: string;
9729
- kind: 'job';
9733
+ kind: 'job' | 'monitor';
9730
9734
  };
9731
9735
  /**
9732
- * Recipe monitors only: the kind of alert it sends.
9736
+ * Recipe and template monitors only: the kind of alert it sends.
9733
9737
  */
9734
9738
  family?: 'past-clients' | 'agent-partners' | 'farm-area' | 'watch-record';
9735
9739
  /**
9736
- * `recipe:<recipeId>` or `job:<jobName>`.
9740
+ * `recipe:<recipeId>`, `job:<jobName>`, or `mon_…` for a monitor from a ModelMatch template.
9737
9741
  */
9738
9742
  id: string;
9739
9743
  /**
9740
- * `recipe`: an alert recipe you subscribed to. `job`: a Studio job of yours with alert rules.
9744
+ * `recipe`: an alert recipe you subscribed to. `job`: a Studio job of yours with alert rules. `template`: a monitor you set up from a ModelMatch template.
9741
9745
  */
9742
- kind: 'recipe' | 'job';
9746
+ kind: 'recipe' | 'job' | 'template';
9743
9747
  /**
9744
9748
  * When it last sent an alert (ISO 8601). For recipes, within the last 30 days; null if none.
9745
9749
  */
@@ -9768,7 +9772,7 @@ type Monitor = {
9768
9772
  };
9769
9773
  type MonitorList = {
9770
9774
  /**
9771
- * Recipe monitors first (in the recipe catalog's order, then your own recipes), then job monitors (oldest first).
9775
+ * Recipe monitors first (in the recipe catalog's order, then your own recipes), then monitors from templates (oldest first), then job monitors (oldest first).
9772
9776
  */
9773
9777
  data: Array<Monitor>;
9774
9778
  /**
@@ -14940,7 +14944,7 @@ type StudioModel = {
14940
14944
  */
14941
14945
  status: 'training' | 'ready' | 'refused' | 'failed';
14942
14946
  /**
14943
- * Who or what the model scores: `home`, `loan_officer`, `agent` or `agent_lo_pair` (a `subjects[].id` from getStudioModelOptions).
14947
+ * Who or what the model scores: `home`, `loan_officer`, `agent`, `agent_lo_pair` or `company` (a `subjects[].id` from getStudioModelOptions).
14944
14948
  */
14945
14949
  subject?: string;
14946
14950
  /**
@@ -14984,7 +14988,7 @@ type StudioModelCreate = {
14984
14988
  */
14985
14989
  description?: string;
14986
14990
  /**
14987
- * The data points the model may use: the ones the person believes matter. The model is trained on exactly these, and its report card says how much each one mattered and how the picks compare with using everything. Leave it out to use every market data point.
14991
+ * The data points the model may use: the ones the person believes matter. The model is trained on exactly these, and its report card says how much each one mattered and how the picks compare with using everything. Leave it out to use the outcome's default list (`outcomes[].dataPoints` in getStudioModelOptions; else every market data point).
14988
14992
  */
14989
14993
  features?: Array<StudioModelDataPoint>;
14990
14994
  /**
@@ -15045,7 +15049,7 @@ type StudioModelCreate = {
15045
15049
  zipCodes?: Array<string>;
15046
15050
  };
15047
15051
  /**
15048
- * Who or what the model scores: `home` (default), `loan_officer`, `agent` or `agent_lo_pair` (an agent and a loan officer together), a `subjects[].id` from getStudioModelOptions (which lists only the subjects available). Each subject has its own outcomes, populations, data points and upload keys.
15052
+ * Who or what the model scores: `home` (default), `loan_officer`, `agent`, `agent_lo_pair` (an agent and a loan officer together) or `company`, a `subjects[].id` from getStudioModelOptions (which lists only the subjects available). Each subject has its own outcomes, populations, data points and upload keys.
15049
15053
  */
15050
15054
  subject?: string;
15051
15055
  };
@@ -15135,7 +15139,7 @@ type StudioModelError = {
15135
15139
  type StudioModelKey = {
15136
15140
  columns: Array<string>;
15137
15141
  /**
15138
- * Homes: `property_address` (`address_key`, ZIP), `property_id` or `loan_id`. Loan officers: `nmls_id` (the NMLS id column). Agents: `agent_id` (the agent id column). Agent and loan officer pairs: `agent_lo_pair` (two columns: the agent id, then the NMLS id). `subjects[].keyKinds` in getStudioModelOptions lists each subject's.
15142
+ * Homes: `property_address` (`address_key`, ZIP), `property_id` or `loan_id`. Loan officers: `nmls_id` (the NMLS id column). Agents: `agent_id` (the agent id column). Agent and loan officer pairs: `agent_lo_pair` (two columns: the agent id, then the NMLS id). Companies: `company_nmls_id`. `subjects[].keyKinds` in getStudioModelOptions lists each subject's.
15139
15143
  */
15140
15144
  kind: string;
15141
15145
  };
@@ -15159,6 +15163,10 @@ type StudioModelOptions = {
15159
15163
  };
15160
15164
  };
15161
15165
  outcomes: Array<{
15166
+ /**
15167
+ * The data points a model of this outcome uses when `features` is left out (the default list). Absent: every data point of its subject. Any other data point of the subject can still be picked by id.
15168
+ */
15169
+ dataPoints?: Array<string>;
15162
15170
  defaultHorizonMonths: number;
15163
15171
  description: string;
15164
15172
  /**
@@ -15212,7 +15220,7 @@ type StudioModelOptions = {
15212
15220
  }>;
15213
15221
  };
15214
15222
  /**
15215
- * What can be scored: `home` (the default; its lists are also the top-level `outcomes`, `populations` and `themes`), `loan_officer`, `agent` and `agent_lo_pair`. Only subjects available to build are listed. Each subject has its own outcomes, populations, data points, upload keys and scope forms; a model uses one subject's.
15223
+ * What can be scored: `home` (the default; its lists are also the top-level `outcomes`, `populations` and `themes`), `loan_officer`, `agent`, `agent_lo_pair` and `company`. Only subjects available to build are listed. Each subject has its own outcomes, populations, data points, upload keys and scope forms; a model uses one subject's.
15216
15224
  */
15217
15225
  subjects?: Array<{
15218
15226
  boostColumns: Array<{
@@ -15227,7 +15235,7 @@ type StudioModelOptions = {
15227
15235
  [key: string]: string;
15228
15236
  };
15229
15237
  /**
15230
- * The `subject` to send: `home`, `loan_officer`, `agent` or `agent_lo_pair`.
15238
+ * The `subject` to send: `home`, `loan_officer`, `agent`, `agent_lo_pair` or `company`.
15231
15239
  */
15232
15240
  id: string;
15233
15241
  keyKinds: Array<{
@@ -15244,6 +15252,10 @@ type StudioModelOptions = {
15244
15252
  singular: string;
15245
15253
  };
15246
15254
  outcomes: Array<{
15255
+ /**
15256
+ * The data points a model of this outcome uses when `features` is left out (the default list). Absent: every data point of its subject. Any other data point of the subject can still be picked by id.
15257
+ */
15258
+ dataPoints?: Array<string>;
15247
15259
  defaultHorizonMonths: number;
15248
15260
  description: string;
15249
15261
  /**
@@ -15341,7 +15353,7 @@ type StudioModelOptions = {
15341
15353
  trainingTime?: {
15342
15354
  basis: string;
15343
15355
  /**
15344
- * Models of people (loan officers, agents, pairs) take about the same time wherever they look: a range for training and for a refresh, by subject.
15356
+ * Models of people and companies (loan officers, agents, pairs, companies) take about the same time wherever they look: a range for training and for a refresh, by subject.
15345
15357
  */
15346
15358
  bySubject?: Array<{
15347
15359
  /**
@@ -15498,9 +15510,9 @@ type StudioModelPopulation = {
15498
15510
  companyNmlsId?: string;
15499
15511
  key?: StudioModelKey;
15500
15512
  /**
15501
- * Who is scored. Homes: `homes` (recent mortgage, in the scope), `company_book` (`companyNmlsId`) or `uploaded_list` (`table`, `key`). Loan officers: `loan_officers` (active in the scope), `company_loan_officers` (`companyNmlsId`) or `uploaded_list` (key `nmls_id`). Agents: `agents` (active in the scope), `agents_of_company` (agents whose clients took a mortgage from one company's loan officers: `companyNmlsId`) or `uploaded_list` (key `agent_id`). Agent and loan officer pairs: `agent_lo_pairs` (pairs with past deals), `company_agent_lo_pairs` (one company's pairs: `companyNmlsId`), `agent_lo_candidates` / `lo_agent_candidates` (`companyNmlsId`: pairs that have not dealt yet) or `uploaded_list` (key `agent_lo_pair`). Some outcomes take only some populations (`outcomes[].populations` in getStudioModelOptions).
15513
+ * Who is scored. Homes: `homes` (recent mortgage, in the scope), `company_book` (`companyNmlsId`) or `uploaded_list` (`table`, `key`). Loan officers: `loan_officers` (active in the scope), `company_loan_officers` (`companyNmlsId`) or `uploaded_list` (key `nmls_id`). Agents: `agents` (active in the scope), `agents_of_company` (agents whose clients took a mortgage from one company's loan officers: `companyNmlsId`) or `uploaded_list` (key `agent_id`). Agent and loan officer pairs: `agent_lo_pairs` (pairs with past deals), `company_agent_lo_pairs` (one company's pairs: `companyNmlsId`), `agent_lo_candidates` / `lo_agent_candidates` (`companyNmlsId`: pairs that have not dealt yet) or `uploaded_list` (key `agent_lo_pair`). Companies: `companies` (with a loan officer active in the scope; scope `national` by default) or `uploaded_list` (key `company_nmls_id`). Some outcomes take only some populations (`outcomes[].populations` in getStudioModelOptions).
15502
15514
  */
15503
- kind: 'homes' | 'company_book' | 'uploaded_list' | 'loan_officers' | 'company_loan_officers' | 'agents' | 'agents_of_company' | 'agent_lo_pairs' | 'company_agent_lo_pairs' | 'agent_lo_candidates' | 'lo_agent_candidates';
15515
+ kind: 'homes' | 'company_book' | 'uploaded_list' | 'loan_officers' | 'company_loan_officers' | 'agents' | 'agents_of_company' | 'agent_lo_pairs' | 'company_agent_lo_pairs' | 'agent_lo_candidates' | 'lo_agent_candidates' | 'companies';
15504
15516
  table?: string;
15505
15517
  };
15506
15518
  type StudioModelRefresh = {
@@ -36163,7 +36175,7 @@ declare class Monitors {
36163
36175
  /**
36164
36176
  * List your monitors
36165
36177
  *
36166
- * Everything that alerts you, in one list: the alert recipes you subscribed to and the Studio jobs you saved with alert rules in your active organization. Each monitor says what it watches, how often it checks, when it last sent an alert and how to change it. Free.
36178
+ * Everything that alerts you, in one list: the alert recipes you subscribed to, the monitors you set up from ModelMatch templates, and the Studio jobs you saved with alert rules in your active organization. Each monitor says what it watches, how often it checks, when it last sent an alert and how to change it. Free.
36167
36179
  */
36168
36180
  static list<ThrowOnError extends boolean = false>(options?: Options<ListMonitorsData, ThrowOnError>): RequestResult<ListMonitorsResponses, ListMonitorsErrors, ThrowOnError>;
36169
36181
  }
@@ -36786,6 +36798,7 @@ type Client = {
36786
36798
  loans: typeof Loans;
36787
36799
  locations: typeof Locations;
36788
36800
  market: typeof Market;
36801
+ monitors: typeof Monitors;
36789
36802
  offices: typeof Offices;
36790
36803
  originators: typeof Originators;
36791
36804
  properties: typeof Properties;