@model-match/api 3.78.0 → 3.79.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.
@@ -1,4 +1,4 @@
1
- import { n as createClient, w as client } from "../src-Ccn-ewCn.mjs";
1
+ import { n as createClient, w as client } from "../src-bW2n1ku2.mjs";
2
2
  //#region src/slim/sdk.gen.ts
3
3
  /**
4
4
  * Search agents with filters
@@ -6603,9 +6603,25 @@ const refreshStudioModel = (options) => (options.client ?? client).post({
6603
6603
  }
6604
6604
  });
6605
6605
  /**
6606
+ * The result of a question that ran in the background
6607
+ *
6608
+ * What became of a question `runStudioQuery` answered `202` for. `running`: wait `pollAfterSeconds` and fetch again — after a few tries, tell the user it is still running and can be checked later. `succeeded`: the same answer a quick question gets (`columns`, `rows`, `rowCount`, `truncated`, `elapsedMs`), kept for an hour. `failed`: `error` and `code`, as the question itself would have been refused or stopped. `expired`: the answer is no longer kept. Fetching is free. A question that succeeded in the background costs 5 credits once, whether or not its result is fetched: `credits.pending` on the result says what your organization is charged for it. Only the organization that asked can fetch a result.
6609
+ */
6610
+ const getStudioQueryResult = (options) => (options.client ?? client).get({
6611
+ security: [{
6612
+ name: "x-api-key",
6613
+ type: "apiKey"
6614
+ }, {
6615
+ scheme: "bearer",
6616
+ type: "http"
6617
+ }],
6618
+ url: "/v1/studio/queries/{queryId}",
6619
+ ...options
6620
+ });
6621
+ /**
6606
6622
  * Answer one question with SQL
6607
6623
  *
6608
- * Run one read-only SQL SELECT over the tables in the catalog and get the rows back. Use it for questions the list and analytics routes cannot answer in one call: a ranking across every company or agent in a market, a join between loans and sales, a custom roll-up. The data is stored by state: filter by `state` (and a date range) whenever the question allows, and aggregate in SQL instead of fetching rows. `rows` carries up to `limit` rows (default 200, at most 1000); `rowCount` is always the full count and `truncated` says when there are more. A question that runs too long is stopped with `timeout`: narrow it, or save it as a job. Only tables in the catalog can be read; nothing can be written. 5 credits per answered question; a refused or failed question is free. `credits` in the answer says what this question was charged and how many credits are left.
6624
+ * Run one read-only SQL SELECT over the tables in the catalog and get the rows back. Use it for questions the list and analytics routes cannot answer in one call: a ranking across every company or agent in a market, a join between loans and sales, a custom roll-up. The data is stored by state: filter by `state` (and a date range) whenever the question allows, and aggregate in SQL instead of fetching rows. `rows` carries up to `limit` rows (default 200, at most 1000); `rowCount` is always the full count and `truncated` says when there are more. A quick question is answered here (`200`). One that is still running after about twelve seconds is NOT stopped: this call answers `202` with `status: "running"` and a `queryId`, the question carries on in the background for up to five minutes, and `getStudioQueryResult` returns its answer. A `202` is not a failure — do not ask the question again (that starts a second run) and do not rewrite it; wait `pollAfterSeconds` and fetch the result. One question per organization runs in the background at a time. Only tables in the catalog can be read; nothing can be written. 5 credits per answered question, charged once whether it was answered here or in the background; a refused or failed question is free. `credits` in the answer says what this question was charged and how many credits are left; on `202`, `credits.pending` is what will be charged if the question succeeds.
6609
6625
  */
6610
6626
  const runStudioQuery = (options) => (options.client ?? client).post({
6611
6627
  security: [{
@@ -6691,4 +6707,4 @@ const completeStudioUpload = (options) => (options.client ?? client).post({
6691
6707
  ...options
6692
6708
  });
6693
6709
  //#endregion
6694
- export { client as _heyApiClient, actionCrmCallerId, addCrmContactMethod, addCrmListMember, addCrmListMembersBulk, addCrmNote, addCrmRecord, addCrmRecordsBulk, addWatchedAgent, addWatchedArea, addWatchedDocument, agentAnalyticsChart, agentAnalyticsSummary, agentAnalyticsTimeSeries, agentBuilders, agentCities, agentCompanies, agentCounties, agentLenders, agentLoanMix, agentMarkets, agentMortgagedTimeSeries, agentOffices, agentOriginators, agentProperties, agentRelated, agentSales, agentStates, agentTitleCompanies, agentTitleCompaniesTimeSeries, agentZipCodes, analyzeCrmCall, applyCrmEnrichment, applyCrmListMiUpdates, applyCrmListTemplate, applyCrmMiUpdates, branchAnalyticsChart, branchAnalyticsSummary, branchAnalyticsTimeSeries, branchCities, branchCommunityLendingMap, branchCounties, branchLenders, branchLoans, branchOriginators, branchRoster, branchStates, branchStats, branchTitleCompanies, cancelAgentsBulkDeliveryJob, cancelBranchesBulkDeliveryJob, cancelCompaniesBulkDeliveryJob, cancelEnrichBulkJob, cancelLoansBulkDeliveryJob, cancelOriginatorsBulkDeliveryJob, cancelPropertiesBulkDeliveryJob, checkCrmImport, companyAgents, companyAnalyticsChart, companyAnalyticsSummary, companyAnalyticsTimeSeries, companyBranches, companyBrokers, companyCities, companyCommunityLendingBenchmark, companyCommunityLendingMap, companyCounties, companyDepartureStatus, companyEarlyExits, companyEmployeeStats, companyEmployment, companyHeadcount, companyLenders, companyMarkets, companyMoverProduction, companyOffices, companyOriginators, companyRelated, companyRetention, companyRetentionActiveListings, companyRetentionCaptured, companyRetentionLikelyToSell, companySponsoredIndividuals, companySponsorshipMovement, companyStates, companyTalentFlow, companyTitleCompanies, companyZipCodes, completeStudioUpload, countAgents, countBranches, countCompanies, countLenders, countLoans, countOffices, countOriginators, countProperties, countSales, createAgentContactSubmission, createAlertSubscription, createClient, createCrmList, createCrmListField, createCrmManualRecord, createCrmMeeting, createCrmObjectField, createCrmRecord, createCrmTask, createCrmTemplate, createMyAlertRecipe, createOriginatorContactSubmission, createPropertyTransactionFlag, createSavedFilter, createStudioJob, createStudioModel, createStudioUpload, crmLenderChannels, crmLoLoanMix, crmLoMomentum, crmLoSponsorLocation, crmSimilarOriginators, declineCrmMiUpdate, deleteAlertSubscription, deleteCrmCallerId, deleteCrmList, deleteCrmListField, deleteCrmMeeting, deleteCrmNote, deleteCrmObjectField, deleteCrmRecord, deleteCrmRecords, deleteCrmTask, deleteCrmTemplate, deleteMyAlertRecipe, deleteSavedFilter, deleteStudioJob, deleteStudioModel, deleteStudioUpload, describeCrmRecordsOnAdd, dismissCrmListMiUpdates, dismissCrmMiUpdates, editCrmLoggedActivity, editCrmNote, enrichPropertiesBatch, enrichPropertiesBulk, enrichProperty, filterCrmListMembers, findCrmRecordByNmls, generateCrmRecordDescription, getAgent, getAgentsBulkDeliveryJob, getAlertConditions, getAlertEmailTokens, getAlertUnreadCount, getBranch, getBranchesBulkDeliveryJob, getCompaniesBulkDeliveryJob, getCompany, getCrmActiveCall, getCrmActivityReport, getCrmCall, getCrmCallTranscript, getCrmCustomValues, getCrmImport, getCrmImportJob, getCrmList, getCrmListMemberIds, getCrmListMiUpdates, getCrmListShares, getCrmMiUpdates, getCrmOutcomesReport, getCrmOverrides, getCrmProductionEnrichJob, getCrmRecordAccess, getCrmRecordAccessRequest, getCrmRecordConnections, getCrmRecordMemberIds, getCrmRecordProfile, getCrmTemplate, getCrmTemplateShares, getEnrichBulkJob, getHubspotPushStatus, getLender, getLoan, getLoansBulkDeliveryJob, getMe, getMeCredits, getMePlan, getOffice, getOriginator, getOriginatorAgentPulseSignals, getOriginatorClientRetentionSignals, getOriginatorLoMoveSignal, getOriginatorsBulkDeliveryJob, getPropertiesBulkDeliveryJob, getProperty, getRealtimeConfig, getSale, getSavedFilter, getSavedFilterShares, getSearchToken, getStudioCatalog, getStudioJob, getStudioModel, getStudioModelOptions, grantCrmListAccess, grantCrmRecordAccess, grantCrmRecordAccessRequest, grantSavedFilterAccess, hangupCrmCall, importCrmRecords, instantSearch, lenderCities, lenderCompanies, lenderCounties, lenderOriginators, lenderStates, linkCrmRecord, listAgentOfficeGroups, listAgents, listAlertDigests, listAlertLog, listAlertRecipes, listAlertSubscriptions, listBranches, listCompanies, listCrmActivity, listCrmCallerIds, listCrmContactMethods, listCrmCustomFields, listCrmImportRows, listCrmImports, listCrmListAssignees, listCrmListFields, listCrmListMemberships, listCrmListShareableMembers, listCrmLists, listCrmMeetings, listCrmMembers, listCrmOrgMembers, listCrmRecordShareableMembers, listCrmRecordShares, listCrmReferencedActivity, listCrmTasks, listCrmTemplates, listCrmWorkspaceMeetings, listCrmWorkspaceTasks, listEnrichments, listLenders, listLoMoveSignals, listLoans, listMyAlertRecipes, listOffices, listOriginators, listProperties, listSales, listSavedFilterShareableMembers, listSavedFilters, listStudioJobs, listStudioModels, listStudioUploads, listWatchedAgents, listWatchedAreas, listWatchedDocuments, loanRelated, loansAnalyticsChart, loansAnalyticsSummary, loansAnalyticsTimeSeries, logCrmActivity, lookupCompanies, mapSales, markAlertDigestRead, markAlertRead, markAllAlertsRead, marketAnalyticsChart, marketAnalyticsSummary, marketAnalyticsTimeSeries, marketCommunityLending, marketMovementActivity, marketMovementByState, marketMovementCohortPayoff, marketMovementMostGained, marketMovementMostLost, marketMovementMovers, marketMovementRankings, marketMovementStats, marketMovementTransitions, marketSignals, officeAgents, officeBuilders, officeLenders, officeLoanTypes, officeOriginators, originatorAgents, originatorAnalyticsChart, originatorAnalyticsSummary, originatorAnalyticsTimeSeries, originatorBranches, originatorBrokers, originatorBuilders, originatorCitiesBreakdown, originatorCommunityLendingBenchmark, originatorCommunityLendingMap, originatorCompanies, originatorCountiesBreakdown, originatorLenders, originatorLoans, originatorMarkets, originatorOffices, originatorProperties, originatorRelated, originatorRetention, originatorRetentionCaptured, originatorStatesBreakdown, originatorTitleCompanies, originatorZipCodes, placeCrmCall, previewAlertEmailTemplate, previewAlertRecipe, previewAlerts, previewMyAlertRecipe, propertiesAnalyticsChart, propertiesAnalyticsSummary, propertyRelated, pushToHubspot, reconcileCrmMeetings, refreshCrmRecordMirror, refreshStudioModel, removeCrmContactMethod, removeCrmListMember, removeWatchedAgent, removeWatchedArea, removeWatchedDocument, requestCrmAccess, requestCrmRecordAccess, resolveProperties, retrieveLocation, revokeCrmListAccess, revokeCrmRecordAccess, revokeSavedFilterAccess, runStudioJob, runStudioQuery, saleRelated, salesAnalyticsChart, salesAnalyticsSummary, salesAnalyticsTimeSeries, salesMarketStats, searchCrmEmailRecipients, searchCrmMatchCandidates, searchCrmMentionRecords, searchCrmRecords, searchProperties, sendCrmEmail, setCrmCallAnalysis, setCrmCustomValue, setCrmOverride, setCrmRecordOwner, setDefaultCrmCallerId, shareCrmTemplate, submitAgentsBulkDelivery, submitBranchesBulkDelivery, submitCompaniesBulkDelivery, submitLoansBulkDelivery, submitOriginatorsBulkDelivery, submitPropertiesBulkDelivery, subscribeAlertRecipe, suggestLocations, suggestOfficeNames, transcribeCrmCall, transferCrmListOwnership, undoCrmImport, unshareCrmTemplate, unsubscribeAlertRecipe, updateAlertConditions, updateCrmContactMethod, updateCrmList, updateCrmListField, updateCrmMeeting, updateCrmObjectField, updateCrmTask, updateCrmTemplate, updateMe, updateMyAlertRecipe, updateSavedFilter };
6710
+ export { client as _heyApiClient, actionCrmCallerId, addCrmContactMethod, addCrmListMember, addCrmListMembersBulk, addCrmNote, addCrmRecord, addCrmRecordsBulk, addWatchedAgent, addWatchedArea, addWatchedDocument, agentAnalyticsChart, agentAnalyticsSummary, agentAnalyticsTimeSeries, agentBuilders, agentCities, agentCompanies, agentCounties, agentLenders, agentLoanMix, agentMarkets, agentMortgagedTimeSeries, agentOffices, agentOriginators, agentProperties, agentRelated, agentSales, agentStates, agentTitleCompanies, agentTitleCompaniesTimeSeries, agentZipCodes, analyzeCrmCall, applyCrmEnrichment, applyCrmListMiUpdates, applyCrmListTemplate, applyCrmMiUpdates, branchAnalyticsChart, branchAnalyticsSummary, branchAnalyticsTimeSeries, branchCities, branchCommunityLendingMap, branchCounties, branchLenders, branchLoans, branchOriginators, branchRoster, branchStates, branchStats, branchTitleCompanies, cancelAgentsBulkDeliveryJob, cancelBranchesBulkDeliveryJob, cancelCompaniesBulkDeliveryJob, cancelEnrichBulkJob, cancelLoansBulkDeliveryJob, cancelOriginatorsBulkDeliveryJob, cancelPropertiesBulkDeliveryJob, checkCrmImport, companyAgents, companyAnalyticsChart, companyAnalyticsSummary, companyAnalyticsTimeSeries, companyBranches, companyBrokers, companyCities, companyCommunityLendingBenchmark, companyCommunityLendingMap, companyCounties, companyDepartureStatus, companyEarlyExits, companyEmployeeStats, companyEmployment, companyHeadcount, companyLenders, companyMarkets, companyMoverProduction, companyOffices, companyOriginators, companyRelated, companyRetention, companyRetentionActiveListings, companyRetentionCaptured, companyRetentionLikelyToSell, companySponsoredIndividuals, companySponsorshipMovement, companyStates, companyTalentFlow, companyTitleCompanies, companyZipCodes, completeStudioUpload, countAgents, countBranches, countCompanies, countLenders, countLoans, countOffices, countOriginators, countProperties, countSales, createAgentContactSubmission, createAlertSubscription, createClient, createCrmList, createCrmListField, createCrmManualRecord, createCrmMeeting, createCrmObjectField, createCrmRecord, createCrmTask, createCrmTemplate, createMyAlertRecipe, createOriginatorContactSubmission, createPropertyTransactionFlag, createSavedFilter, createStudioJob, createStudioModel, createStudioUpload, crmLenderChannels, crmLoLoanMix, crmLoMomentum, crmLoSponsorLocation, crmSimilarOriginators, declineCrmMiUpdate, deleteAlertSubscription, deleteCrmCallerId, deleteCrmList, deleteCrmListField, deleteCrmMeeting, deleteCrmNote, deleteCrmObjectField, deleteCrmRecord, deleteCrmRecords, deleteCrmTask, deleteCrmTemplate, deleteMyAlertRecipe, deleteSavedFilter, deleteStudioJob, deleteStudioModel, deleteStudioUpload, describeCrmRecordsOnAdd, dismissCrmListMiUpdates, dismissCrmMiUpdates, editCrmLoggedActivity, editCrmNote, enrichPropertiesBatch, enrichPropertiesBulk, enrichProperty, filterCrmListMembers, findCrmRecordByNmls, generateCrmRecordDescription, getAgent, getAgentsBulkDeliveryJob, getAlertConditions, getAlertEmailTokens, getAlertUnreadCount, getBranch, getBranchesBulkDeliveryJob, getCompaniesBulkDeliveryJob, getCompany, getCrmActiveCall, getCrmActivityReport, getCrmCall, getCrmCallTranscript, getCrmCustomValues, getCrmImport, getCrmImportJob, getCrmList, getCrmListMemberIds, getCrmListMiUpdates, getCrmListShares, getCrmMiUpdates, getCrmOutcomesReport, getCrmOverrides, getCrmProductionEnrichJob, getCrmRecordAccess, getCrmRecordAccessRequest, getCrmRecordConnections, getCrmRecordMemberIds, getCrmRecordProfile, getCrmTemplate, getCrmTemplateShares, getEnrichBulkJob, getHubspotPushStatus, getLender, getLoan, getLoansBulkDeliveryJob, getMe, getMeCredits, getMePlan, getOffice, getOriginator, getOriginatorAgentPulseSignals, getOriginatorClientRetentionSignals, getOriginatorLoMoveSignal, getOriginatorsBulkDeliveryJob, getPropertiesBulkDeliveryJob, getProperty, getRealtimeConfig, getSale, getSavedFilter, getSavedFilterShares, getSearchToken, getStudioCatalog, getStudioJob, getStudioModel, getStudioModelOptions, getStudioQueryResult, grantCrmListAccess, grantCrmRecordAccess, grantCrmRecordAccessRequest, grantSavedFilterAccess, hangupCrmCall, importCrmRecords, instantSearch, lenderCities, lenderCompanies, lenderCounties, lenderOriginators, lenderStates, linkCrmRecord, listAgentOfficeGroups, listAgents, listAlertDigests, listAlertLog, listAlertRecipes, listAlertSubscriptions, listBranches, listCompanies, listCrmActivity, listCrmCallerIds, listCrmContactMethods, listCrmCustomFields, listCrmImportRows, listCrmImports, listCrmListAssignees, listCrmListFields, listCrmListMemberships, listCrmListShareableMembers, listCrmLists, listCrmMeetings, listCrmMembers, listCrmOrgMembers, listCrmRecordShareableMembers, listCrmRecordShares, listCrmReferencedActivity, listCrmTasks, listCrmTemplates, listCrmWorkspaceMeetings, listCrmWorkspaceTasks, listEnrichments, listLenders, listLoMoveSignals, listLoans, listMyAlertRecipes, listOffices, listOriginators, listProperties, listSales, listSavedFilterShareableMembers, listSavedFilters, listStudioJobs, listStudioModels, listStudioUploads, listWatchedAgents, listWatchedAreas, listWatchedDocuments, loanRelated, loansAnalyticsChart, loansAnalyticsSummary, loansAnalyticsTimeSeries, logCrmActivity, lookupCompanies, mapSales, markAlertDigestRead, markAlertRead, markAllAlertsRead, marketAnalyticsChart, marketAnalyticsSummary, marketAnalyticsTimeSeries, marketCommunityLending, marketMovementActivity, marketMovementByState, marketMovementCohortPayoff, marketMovementMostGained, marketMovementMostLost, marketMovementMovers, marketMovementRankings, marketMovementStats, marketMovementTransitions, marketSignals, officeAgents, officeBuilders, officeLenders, officeLoanTypes, officeOriginators, originatorAgents, originatorAnalyticsChart, originatorAnalyticsSummary, originatorAnalyticsTimeSeries, originatorBranches, originatorBrokers, originatorBuilders, originatorCitiesBreakdown, originatorCommunityLendingBenchmark, originatorCommunityLendingMap, originatorCompanies, originatorCountiesBreakdown, originatorLenders, originatorLoans, originatorMarkets, originatorOffices, originatorProperties, originatorRelated, originatorRetention, originatorRetentionCaptured, originatorStatesBreakdown, originatorTitleCompanies, originatorZipCodes, placeCrmCall, previewAlertEmailTemplate, previewAlertRecipe, previewAlerts, previewMyAlertRecipe, propertiesAnalyticsChart, propertiesAnalyticsSummary, propertyRelated, pushToHubspot, reconcileCrmMeetings, refreshCrmRecordMirror, refreshStudioModel, removeCrmContactMethod, removeCrmListMember, removeWatchedAgent, removeWatchedArea, removeWatchedDocument, requestCrmAccess, requestCrmRecordAccess, resolveProperties, retrieveLocation, revokeCrmListAccess, revokeCrmRecordAccess, revokeSavedFilterAccess, runStudioJob, runStudioQuery, saleRelated, salesAnalyticsChart, salesAnalyticsSummary, salesAnalyticsTimeSeries, salesMarketStats, searchCrmEmailRecipients, searchCrmMatchCandidates, searchCrmMentionRecords, searchCrmRecords, searchProperties, sendCrmEmail, setCrmCallAnalysis, setCrmCustomValue, setCrmOverride, setCrmRecordOwner, setDefaultCrmCallerId, shareCrmTemplate, submitAgentsBulkDelivery, submitBranchesBulkDelivery, submitCompaniesBulkDelivery, submitLoansBulkDelivery, submitOriginatorsBulkDelivery, submitPropertiesBulkDelivery, subscribeAlertRecipe, suggestLocations, suggestOfficeNames, transcribeCrmCall, transferCrmListOwnership, undoCrmImport, unshareCrmTemplate, unsubscribeAlertRecipe, updateAlertConditions, updateCrmContactMethod, updateCrmList, updateCrmListField, updateCrmMeeting, updateCrmObjectField, updateCrmTask, updateCrmTemplate, updateMe, updateMyAlertRecipe, updateSavedFilter };
@@ -8016,9 +8016,27 @@ var Studio = class {
8016
8016
  });
8017
8017
  }
8018
8018
  /**
8019
+ * The result of a question that ran in the background
8020
+ *
8021
+ * What became of a question `runStudioQuery` answered `202` for. `running`: wait `pollAfterSeconds` and fetch again — after a few tries, tell the user it is still running and can be checked later. `succeeded`: the same answer a quick question gets (`columns`, `rows`, `rowCount`, `truncated`, `elapsedMs`), kept for an hour. `failed`: `error` and `code`, as the question itself would have been refused or stopped. `expired`: the answer is no longer kept. Fetching is free. A question that succeeded in the background costs 5 credits once, whether or not its result is fetched: `credits.pending` on the result says what your organization is charged for it. Only the organization that asked can fetch a result.
8022
+ */
8023
+ static getStudioQueryResult(options) {
8024
+ return (options.client ?? client).get({
8025
+ security: [{
8026
+ name: "x-api-key",
8027
+ type: "apiKey"
8028
+ }, {
8029
+ scheme: "bearer",
8030
+ type: "http"
8031
+ }],
8032
+ url: "/v1/studio/queries/{queryId}",
8033
+ ...options
8034
+ });
8035
+ }
8036
+ /**
8019
8037
  * Answer one question with SQL
8020
8038
  *
8021
- * Run one read-only SQL SELECT over the tables in the catalog and get the rows back. Use it for questions the list and analytics routes cannot answer in one call: a ranking across every company or agent in a market, a join between loans and sales, a custom roll-up. The data is stored by state: filter by `state` (and a date range) whenever the question allows, and aggregate in SQL instead of fetching rows. `rows` carries up to `limit` rows (default 200, at most 1000); `rowCount` is always the full count and `truncated` says when there are more. A question that runs too long is stopped with `timeout`: narrow it, or save it as a job. Only tables in the catalog can be read; nothing can be written. 5 credits per answered question; a refused or failed question is free. `credits` in the answer says what this question was charged and how many credits are left.
8039
+ * Run one read-only SQL SELECT over the tables in the catalog and get the rows back. Use it for questions the list and analytics routes cannot answer in one call: a ranking across every company or agent in a market, a join between loans and sales, a custom roll-up. The data is stored by state: filter by `state` (and a date range) whenever the question allows, and aggregate in SQL instead of fetching rows. `rows` carries up to `limit` rows (default 200, at most 1000); `rowCount` is always the full count and `truncated` says when there are more. A quick question is answered here (`200`). One that is still running after about twelve seconds is NOT stopped: this call answers `202` with `status: "running"` and a `queryId`, the question carries on in the background for up to five minutes, and `getStudioQueryResult` returns its answer. A `202` is not a failure — do not ask the question again (that starts a second run) and do not rewrite it; wait `pollAfterSeconds` and fetch the result. One question per organization runs in the background at a time. Only tables in the catalog can be read; nothing can be written. 5 credits per answered question, charged once whether it was answered here or in the background; a refused or failed question is free. `credits` in the answer says what this question was charged and how many credits are left; on `202`, `credits.pending` is what will be charged if the question succeeds.
8022
8040
  */
8023
8041
  static runStudioQuery(options) {
8024
8042
  return (options.client ?? client).post({
package/openapi.json CHANGED
@@ -49133,6 +49133,10 @@
49133
49133
  "StudioQueryRequest": {
49134
49134
  "additionalProperties": false,
49135
49135
  "properties": {
49136
+ "background": {
49137
+ "description": "`true`: do not wait for the answer. The question starts in the background and this call answers `202` with a `queryId` at once. For a question known to be heavy (a whole state with a window function, several joins). Without it a question is answered here when it is quick, and carries on in the background by itself when it is not.",
49138
+ "type": "boolean"
49139
+ },
49136
49140
  "limit": {
49137
49141
  "description": "Rows to return (1–1000, default 200). `rowCount` is always the full count.",
49138
49142
  "maximum": 1000,
@@ -49223,6 +49227,158 @@
49223
49227
  ],
49224
49228
  "type": "object"
49225
49229
  },
49230
+ "StudioQueryResultState": {
49231
+ "properties": {
49232
+ "code": {
49233
+ "description": "On `failed`: the stable code (`timeout`, `query_failed`, …).",
49234
+ "type": "string"
49235
+ },
49236
+ "columns": {
49237
+ "items": {
49238
+ "properties": {
49239
+ "name": {
49240
+ "type": "string"
49241
+ },
49242
+ "type": {
49243
+ "type": "string"
49244
+ }
49245
+ },
49246
+ "required": [
49247
+ "name",
49248
+ "type"
49249
+ ],
49250
+ "type": "object"
49251
+ },
49252
+ "type": "array"
49253
+ },
49254
+ "credits": {
49255
+ "description": "What this question costs.",
49256
+ "properties": {
49257
+ "charged": {
49258
+ "description": "Always `0` here: a question in the background is not charged by this request.",
49259
+ "example": 0,
49260
+ "type": "number"
49261
+ },
49262
+ "pending": {
49263
+ "description": "Credits your organization is charged, once, for this question if it succeeds (while `running`) or because it succeeded (on `succeeded`) — whether or not its result is fetched. Absent when nothing will be charged: a question asked from the web app, or an account that is not metered.",
49264
+ "example": 5,
49265
+ "type": "number"
49266
+ }
49267
+ },
49268
+ "required": [
49269
+ "charged"
49270
+ ],
49271
+ "type": "object"
49272
+ },
49273
+ "details": {
49274
+ "additionalProperties": {
49275
+ "nullable": true
49276
+ },
49277
+ "type": "object"
49278
+ },
49279
+ "elapsedMs": {
49280
+ "type": "number"
49281
+ },
49282
+ "error": {
49283
+ "description": "On `failed`: what went wrong, written for the caller.",
49284
+ "type": "string"
49285
+ },
49286
+ "expiresAt": {
49287
+ "description": "When the answer stops being kept (an hour after it finished).",
49288
+ "type": "string"
49289
+ },
49290
+ "pollAfterSeconds": {
49291
+ "description": "Seconds to wait before fetching the result (again).",
49292
+ "example": 5,
49293
+ "type": "number"
49294
+ },
49295
+ "queryId": {
49296
+ "description": "Identifies the question. Fetch its result with `getStudioQueryResult`.",
49297
+ "example": "q_3f9a1c0b7d2e4a6f8b1c0d2e",
49298
+ "type": "string"
49299
+ },
49300
+ "rowCount": {
49301
+ "description": "Rows the question produced in total.",
49302
+ "type": "number"
49303
+ },
49304
+ "rows": {
49305
+ "description": "One object per row, keyed by column name.",
49306
+ "items": {
49307
+ "additionalProperties": {
49308
+ "nullable": true
49309
+ },
49310
+ "type": "object"
49311
+ },
49312
+ "type": "array"
49313
+ },
49314
+ "status": {
49315
+ "description": "`running` — still going: wait `pollAfterSeconds` and fetch again. `succeeded` — the answer is here (`columns`, `rows`, `rowCount`, `truncated`, `elapsedMs`), kept until `expiresAt`. `failed` — it did not produce an answer: `error` and `code` say why, as the question itself would have. `expired` — it finished, and its answer is no longer kept: ask the question again.",
49316
+ "enum": [
49317
+ "running",
49318
+ "succeeded",
49319
+ "failed",
49320
+ "expired"
49321
+ ],
49322
+ "type": "string"
49323
+ },
49324
+ "truncated": {
49325
+ "description": "True when `rows` holds fewer than `rowCount`.",
49326
+ "type": "boolean"
49327
+ }
49328
+ },
49329
+ "required": [
49330
+ "status",
49331
+ "queryId"
49332
+ ],
49333
+ "type": "object"
49334
+ },
49335
+ "StudioQueryRunning": {
49336
+ "properties": {
49337
+ "credits": {
49338
+ "description": "What this question costs.",
49339
+ "properties": {
49340
+ "charged": {
49341
+ "description": "Always `0` here: a question in the background is not charged by this request.",
49342
+ "example": 0,
49343
+ "type": "number"
49344
+ },
49345
+ "pending": {
49346
+ "description": "Credits your organization is charged, once, for this question if it succeeds (while `running`) or because it succeeded (on `succeeded`) — whether or not its result is fetched. Absent when nothing will be charged: a question asked from the web app, or an account that is not metered.",
49347
+ "example": 5,
49348
+ "type": "number"
49349
+ }
49350
+ },
49351
+ "required": [
49352
+ "charged"
49353
+ ],
49354
+ "type": "object"
49355
+ },
49356
+ "pollAfterSeconds": {
49357
+ "description": "Seconds to wait before fetching the result (again).",
49358
+ "example": 5,
49359
+ "type": "number"
49360
+ },
49361
+ "queryId": {
49362
+ "description": "Identifies the question. Fetch its result with `getStudioQueryResult`.",
49363
+ "example": "q_3f9a1c0b7d2e4a6f8b1c0d2e",
49364
+ "type": "string"
49365
+ },
49366
+ "status": {
49367
+ "description": "The question is still running in the background. It has NOT failed: fetch its result with `queryId`. Do not ask it again — that starts a second run.",
49368
+ "enum": [
49369
+ "running"
49370
+ ],
49371
+ "type": "string"
49372
+ }
49373
+ },
49374
+ "required": [
49375
+ "status",
49376
+ "queryId",
49377
+ "pollAfterSeconds",
49378
+ "credits"
49379
+ ],
49380
+ "type": "object"
49381
+ },
49226
49382
  "StudioUpload": {
49227
49383
  "properties": {
49228
49384
  "bytes": {
@@ -50330,7 +50486,7 @@
50330
50486
  "info": {
50331
50487
  "description": "ModelMatch API — mortgage and real-estate market data.\n\n## Bulk delivery limits\n\nThe `POST /{entity}/bulk-delivery` endpoints export a full result set to\nS3 as NDJSON, JSON, CSV, or Parquet.\n\n- **Up to 5,000 rows per delivery: no entitlement required.** Available to\n every authenticated caller.\n- **Above 5,000 rows: requires the entity's `bulk-delivery.{entity}`\n entitlement** (e.g. `bulk-delivery.loans`). The grant's scope sets your\n row ceiling and may also restrict which rows and fields you receive.\n\nA delivery that would exceed the limit available to you is rejected with\n`403 entitlement_missing`, reporting the matched row count and the ceiling\nthat applied. To stay under the limit, pass `limit` — the job then delivers\n(and bills for) only the first `limit` rows of a broader query.\n\n**Need a higher limit?** Email support@modelmatch.com to request the\nentitlement. Limits are raised per organization and per entity.\n\nBulk delivery is billed at 1 credit per delivered row whether or not\nan entitlement is held.\n\nInstead of a download, a delivery can be sent to a push target configured\non your workspace: pass `destination: { type: \"push-target\", targetId }`.\nThe same limits and billing apply.",
50332
50488
  "title": "ModelMatch API",
50333
- "version": "3.160.0"
50489
+ "version": "3.161.0"
50334
50490
  },
50335
50491
  "openapi": "3.1.0",
50336
50492
  "paths": {
@@ -89253,7 +89409,7 @@
89253
89409
  }
89254
89410
  }
89255
89411
  },
89256
- "description": "`job_not_found` — your organization has no job of that name."
89412
+ "description": "`job_not_found` — your organization has no job of that name. `query_not_found` — your organization has no background question of that id."
89257
89413
  },
89258
89414
  "409": {
89259
89415
  "content": {
@@ -89273,7 +89429,7 @@
89273
89429
  }
89274
89430
  }
89275
89431
  },
89276
- "description": "The SQL is valid but asks for more than one answer may cost: `timeout` (it ran too long — narrow it by state or date, or save it as a job), `result_too_large`, `resource_limit`. For a job run, `job_failed`."
89432
+ "description": "The SQL is valid but asks for more than one answer may cost: `timeout` (it ran for its whole time, in the background included, and was stopped — narrow it by state or date; or it could not carry on in the background because another question of your organization already is), `result_too_large`, `resource_limit`. For a job run, `job_failed`."
89277
89433
  },
89278
89434
  "429": {
89279
89435
  "content": {
@@ -89355,7 +89511,7 @@
89355
89511
  }
89356
89512
  }
89357
89513
  },
89358
- "description": "`job_not_found` — your organization has no job of that name."
89514
+ "description": "`job_not_found` — your organization has no job of that name. `query_not_found` — your organization has no background question of that id."
89359
89515
  },
89360
89516
  "409": {
89361
89517
  "content": {
@@ -89375,7 +89531,7 @@
89375
89531
  }
89376
89532
  }
89377
89533
  },
89378
- "description": "The SQL is valid but asks for more than one answer may cost: `timeout` (it ran too long — narrow it by state or date, or save it as a job), `result_too_large`, `resource_limit`. For a job run, `job_failed`."
89534
+ "description": "The SQL is valid but asks for more than one answer may cost: `timeout` (it ran for its whole time, in the background included, and was stopped — narrow it by state or date; or it could not carry on in the background because another question of your organization already is), `result_too_large`, `resource_limit`. For a job run, `job_failed`."
89379
89535
  },
89380
89536
  "429": {
89381
89537
  "content": {
@@ -89465,7 +89621,7 @@
89465
89621
  }
89466
89622
  }
89467
89623
  },
89468
- "description": "`job_not_found` — your organization has no job of that name."
89624
+ "description": "`job_not_found` — your organization has no job of that name. `query_not_found` — your organization has no background question of that id."
89469
89625
  },
89470
89626
  "409": {
89471
89627
  "content": {
@@ -89485,7 +89641,7 @@
89485
89641
  }
89486
89642
  }
89487
89643
  },
89488
- "description": "The SQL is valid but asks for more than one answer may cost: `timeout` (it ran too long — narrow it by state or date, or save it as a job), `result_too_large`, `resource_limit`. For a job run, `job_failed`."
89644
+ "description": "The SQL is valid but asks for more than one answer may cost: `timeout` (it ran for its whole time, in the background included, and was stopped — narrow it by state or date; or it could not carry on in the background because another question of your organization already is), `result_too_large`, `resource_limit`. For a job run, `job_failed`."
89489
89645
  },
89490
89646
  "429": {
89491
89647
  "content": {
@@ -89581,7 +89737,7 @@
89581
89737
  }
89582
89738
  }
89583
89739
  },
89584
- "description": "`job_not_found` — your organization has no job of that name."
89740
+ "description": "`job_not_found` — your organization has no job of that name. `query_not_found` — your organization has no background question of that id."
89585
89741
  },
89586
89742
  "409": {
89587
89743
  "content": {
@@ -89601,7 +89757,7 @@
89601
89757
  }
89602
89758
  }
89603
89759
  },
89604
- "description": "The SQL is valid but asks for more than one answer may cost: `timeout` (it ran too long — narrow it by state or date, or save it as a job), `result_too_large`, `resource_limit`. For a job run, `job_failed`."
89760
+ "description": "The SQL is valid but asks for more than one answer may cost: `timeout` (it ran for its whole time, in the background included, and was stopped — narrow it by state or date; or it could not carry on in the background because another question of your organization already is), `result_too_large`, `resource_limit`. For a job run, `job_failed`."
89605
89761
  },
89606
89762
  "429": {
89607
89763
  "content": {
@@ -89695,7 +89851,7 @@
89695
89851
  }
89696
89852
  }
89697
89853
  },
89698
- "description": "`job_not_found` — your organization has no job of that name."
89854
+ "description": "`job_not_found` — your organization has no job of that name. `query_not_found` — your organization has no background question of that id."
89699
89855
  },
89700
89856
  "409": {
89701
89857
  "content": {
@@ -89715,7 +89871,7 @@
89715
89871
  }
89716
89872
  }
89717
89873
  },
89718
- "description": "The SQL is valid but asks for more than one answer may cost: `timeout` (it ran too long — narrow it by state or date, or save it as a job), `result_too_large`, `resource_limit`. For a job run, `job_failed`."
89874
+ "description": "The SQL is valid but asks for more than one answer may cost: `timeout` (it ran for its whole time, in the background included, and was stopped — narrow it by state or date; or it could not carry on in the background because another question of your organization already is), `result_too_large`, `resource_limit`. For a job run, `job_failed`."
89719
89875
  },
89720
89876
  "429": {
89721
89877
  "content": {
@@ -89821,7 +89977,7 @@
89821
89977
  }
89822
89978
  }
89823
89979
  },
89824
- "description": "`job_not_found` — your organization has no job of that name."
89980
+ "description": "`job_not_found` — your organization has no job of that name. `query_not_found` — your organization has no background question of that id."
89825
89981
  },
89826
89982
  "409": {
89827
89983
  "content": {
@@ -90560,9 +90716,125 @@
90560
90716
  ]
90561
90717
  }
90562
90718
  },
90719
+ "/v1/studio/queries/{queryId}": {
90720
+ "get": {
90721
+ "description": "What became of a question `runStudioQuery` answered `202` for. `running`: wait `pollAfterSeconds` and fetch again — after a few tries, tell the user it is still running and can be checked later. `succeeded`: the same answer a quick question gets (`columns`, `rows`, `rowCount`, `truncated`, `elapsedMs`), kept for an hour. `failed`: `error` and `code`, as the question itself would have been refused or stopped. `expired`: the answer is no longer kept. Fetching is free. A question that succeeded in the background costs 5 credits once, whether or not its result is fetched: `credits.pending` on the result says what your organization is charged for it. Only the organization that asked can fetch a result.",
90722
+ "operationId": "getStudioQueryResult",
90723
+ "parameters": [
90724
+ {
90725
+ "description": "The `queryId` a `202` from `runStudioQuery` returned.",
90726
+ "in": "path",
90727
+ "name": "queryId",
90728
+ "required": true,
90729
+ "schema": {
90730
+ "description": "The `queryId` a `202` from `runStudioQuery` returned.",
90731
+ "example": "q_3f9a1c0b7d2e4a6f8b1c0d2e",
90732
+ "pattern": "^q_[0-9a-f]{24}$",
90733
+ "type": "string"
90734
+ }
90735
+ }
90736
+ ],
90737
+ "responses": {
90738
+ "200": {
90739
+ "content": {
90740
+ "application/json": {
90741
+ "schema": {
90742
+ "$ref": "#/components/schemas/StudioQueryResultState"
90743
+ }
90744
+ }
90745
+ },
90746
+ "description": "The question's state, and its answer once it has one"
90747
+ },
90748
+ "400": {
90749
+ "content": {
90750
+ "application/json": {
90751
+ "schema": {
90752
+ "$ref": "#/components/schemas/StudioError"
90753
+ }
90754
+ }
90755
+ },
90756
+ "description": "The request was refused, and `error` says why: SQL that is not a single read-only SELECT, an unknown table (`details.table`, `details.availableTables`), an unknown column (`details.column`, `details.suggestions`), a function that is not available (`details.function`), or a job that could not run as written (`invalid_job`)."
90757
+ },
90758
+ "401": {
90759
+ "content": {
90760
+ "application/json": {
90761
+ "schema": {
90762
+ "$ref": "#/components/schemas/StudioError"
90763
+ }
90764
+ }
90765
+ },
90766
+ "description": "Authentication required."
90767
+ },
90768
+ "403": {
90769
+ "content": {
90770
+ "application/json": {
90771
+ "schema": {
90772
+ "$ref": "#/components/schemas/StudioError"
90773
+ }
90774
+ }
90775
+ },
90776
+ "description": "`no_organization` — Studio works inside an organization: select one and retry. `studio_not_enabled` — Studio is in a limited preview and is not enabled for this account."
90777
+ },
90778
+ "404": {
90779
+ "content": {
90780
+ "application/json": {
90781
+ "schema": {
90782
+ "$ref": "#/components/schemas/StudioError"
90783
+ }
90784
+ }
90785
+ },
90786
+ "description": "`job_not_found` — your organization has no job of that name. `query_not_found` — your organization has no background question of that id."
90787
+ },
90788
+ "409": {
90789
+ "content": {
90790
+ "application/json": {
90791
+ "schema": {
90792
+ "$ref": "#/components/schemas/StudioError"
90793
+ }
90794
+ }
90795
+ },
90796
+ "description": "`job_exists` — the name is taken; `job_limit_reached` — your organization is at its limit of saved jobs (`details.limit`); `job_running` — another job is running for your organization, retry when it has finished."
90797
+ },
90798
+ "422": {
90799
+ "content": {
90800
+ "application/json": {
90801
+ "schema": {
90802
+ "$ref": "#/components/schemas/StudioError"
90803
+ }
90804
+ }
90805
+ },
90806
+ "description": "The SQL is valid but asks for more than one answer may cost: `timeout` (it ran for its whole time, in the background included, and was stopped — narrow it by state or date; or it could not carry on in the background because another question of your organization already is), `result_too_large`, `resource_limit`. For a job run, `job_failed`."
90807
+ },
90808
+ "429": {
90809
+ "content": {
90810
+ "application/json": {
90811
+ "schema": {
90812
+ "$ref": "#/components/schemas/StudioError"
90813
+ }
90814
+ }
90815
+ },
90816
+ "description": "`rate_limited` — too many requests from your organization in the last minute; or `busy` — every slot is taken right now. Wait `details.retryAfterSeconds` (also sent as `Retry-After`)."
90817
+ },
90818
+ "503": {
90819
+ "content": {
90820
+ "application/json": {
90821
+ "schema": {
90822
+ "$ref": "#/components/schemas/StudioError"
90823
+ }
90824
+ }
90825
+ },
90826
+ "description": "`studio_unavailable` — Studio is not available right now."
90827
+ }
90828
+ },
90829
+ "summary": "The result of a question that ran in the background",
90830
+ "tags": [
90831
+ "Studio"
90832
+ ]
90833
+ }
90834
+ },
90563
90835
  "/v1/studio/query": {
90564
90836
  "post": {
90565
- "description": "Run one read-only SQL SELECT over the tables in the catalog and get the rows back. Use it for questions the list and analytics routes cannot answer in one call: a ranking across every company or agent in a market, a join between loans and sales, a custom roll-up. The data is stored by state: filter by `state` (and a date range) whenever the question allows, and aggregate in SQL instead of fetching rows. `rows` carries up to `limit` rows (default 200, at most 1000); `rowCount` is always the full count and `truncated` says when there are more. A question that runs too long is stopped with `timeout`: narrow it, or save it as a job. Only tables in the catalog can be read; nothing can be written. 5 credits per answered question; a refused or failed question is free. `credits` in the answer says what this question was charged and how many credits are left.",
90837
+ "description": "Run one read-only SQL SELECT over the tables in the catalog and get the rows back. Use it for questions the list and analytics routes cannot answer in one call: a ranking across every company or agent in a market, a join between loans and sales, a custom roll-up. The data is stored by state: filter by `state` (and a date range) whenever the question allows, and aggregate in SQL instead of fetching rows. `rows` carries up to `limit` rows (default 200, at most 1000); `rowCount` is always the full count and `truncated` says when there are more. A quick question is answered here (`200`). One that is still running after about twelve seconds is NOT stopped: this call answers `202` with `status: \"running\"` and a `queryId`, the question carries on in the background for up to five minutes, and `getStudioQueryResult` returns its answer. A `202` is not a failure — do not ask the question again (that starts a second run) and do not rewrite it; wait `pollAfterSeconds` and fetch the result. One question per organization runs in the background at a time. Only tables in the catalog can be read; nothing can be written. 5 credits per answered question, charged once whether it was answered here or in the background; a refused or failed question is free. `credits` in the answer says what this question was charged and how many credits are left; on `202`, `credits.pending` is what will be charged if the question succeeds.",
90566
90838
  "operationId": "runStudioQuery",
90567
90839
  "requestBody": {
90568
90840
  "content": {
@@ -90585,6 +90857,16 @@
90585
90857
  },
90586
90858
  "description": "The answer"
90587
90859
  },
90860
+ "202": {
90861
+ "content": {
90862
+ "application/json": {
90863
+ "schema": {
90864
+ "$ref": "#/components/schemas/StudioQueryRunning"
90865
+ }
90866
+ }
90867
+ },
90868
+ "description": "Still running in the background: fetch the result with `getStudioQueryResult`"
90869
+ },
90588
90870
  "400": {
90589
90871
  "content": {
90590
90872
  "application/json": {
@@ -90623,7 +90905,7 @@
90623
90905
  }
90624
90906
  }
90625
90907
  },
90626
- "description": "`job_not_found` — your organization has no job of that name."
90908
+ "description": "`job_not_found` — your organization has no job of that name. `query_not_found` — your organization has no background question of that id."
90627
90909
  },
90628
90910
  "409": {
90629
90911
  "content": {
@@ -90643,7 +90925,7 @@
90643
90925
  }
90644
90926
  }
90645
90927
  },
90646
- "description": "The SQL is valid but asks for more than one answer may cost: `timeout` (it ran too long — narrow it by state or date, or save it as a job), `result_too_large`, `resource_limit`. For a job run, `job_failed`."
90928
+ "description": "The SQL is valid but asks for more than one answer may cost: `timeout` (it ran for its whole time, in the background included, and was stopped — narrow it by state or date; or it could not carry on in the background because another question of your organization already is), `result_too_large`, `resource_limit`. For a job run, `job_failed`."
90647
90929
  },
90648
90930
  "429": {
90649
90931
  "content": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@model-match/api",
3
- "version": "3.78.0",
3
+ "version": "3.79.0",
4
4
  "description": "TypeScript client for the ModelMatch API",
5
5
  "license": "MIT",
6
6
  "files": [