@model-match/api 3.96.0 → 3.98.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.
@@ -5384,6 +5384,240 @@ var Crm = class {
5384
5384
  });
5385
5385
  }
5386
5386
  };
5387
+ var Files = class {
5388
+ /**
5389
+ * Your files
5390
+ *
5391
+ * Files you own and files shared with you, newest first. Filter by origin, kind, class, status, what a file is linked to (`linkedTo`), or only files others shared with you (`sharedWithMe=true`). Pass `facets=true` for counts per origin and kind. Page with `cursor` (from `nextCursor`). Organization admins can pass `scope=org` to list every file in the organization. Free.
5392
+ */
5393
+ static list(options) {
5394
+ return (options?.client ?? client).get({
5395
+ security: [{
5396
+ name: "x-api-key",
5397
+ type: "apiKey"
5398
+ }, {
5399
+ scheme: "bearer",
5400
+ type: "http"
5401
+ }],
5402
+ url: "/v1/files",
5403
+ ...options
5404
+ });
5405
+ }
5406
+ /**
5407
+ * Start an upload
5408
+ *
5409
+ * 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.
5410
+ */
5411
+ static create(options) {
5412
+ return (options.client ?? client).post({
5413
+ security: [{
5414
+ name: "x-api-key",
5415
+ type: "apiKey"
5416
+ }, {
5417
+ scheme: "bearer",
5418
+ type: "http"
5419
+ }],
5420
+ url: "/v1/files",
5421
+ ...options,
5422
+ headers: {
5423
+ "Content-Type": "application/json",
5424
+ ...options.headers
5425
+ }
5426
+ });
5427
+ }
5428
+ /**
5429
+ * Search your files by name
5430
+ *
5431
+ * Files you can see whose name contains `q`, names that start with it first. Free.
5432
+ */
5433
+ static search(options) {
5434
+ return (options.client ?? client).get({
5435
+ security: [{
5436
+ name: "x-api-key",
5437
+ type: "apiKey"
5438
+ }, {
5439
+ scheme: "bearer",
5440
+ type: "http"
5441
+ }],
5442
+ url: "/v1/files/search",
5443
+ ...options
5444
+ });
5445
+ }
5446
+ /**
5447
+ * Delete a file
5448
+ *
5449
+ * The owner or an organization admin can delete a file. Its contents are removed; a record that it existed is kept. Refused while a retention date or a legal hold applies. Data already loaded from the file elsewhere (a Studio table) is not deleted. Free.
5450
+ */
5451
+ static delete(options) {
5452
+ return (options.client ?? client).delete({
5453
+ security: [{
5454
+ name: "x-api-key",
5455
+ type: "apiKey"
5456
+ }, {
5457
+ scheme: "bearer",
5458
+ type: "http"
5459
+ }],
5460
+ url: "/v1/files/{id}",
5461
+ ...options
5462
+ });
5463
+ }
5464
+ /**
5465
+ * One file: its details, shares and links
5466
+ *
5467
+ * A file you can see, with who it is shared with and what it is attached to. A file you cannot see answers 404, the same as one that does not exist. Free.
5468
+ */
5469
+ static get(options) {
5470
+ return (options.client ?? client).get({
5471
+ security: [{
5472
+ name: "x-api-key",
5473
+ type: "apiKey"
5474
+ }, {
5475
+ scheme: "bearer",
5476
+ type: "http"
5477
+ }],
5478
+ url: "/v1/files/{id}",
5479
+ ...options
5480
+ });
5481
+ }
5482
+ /**
5483
+ * Rename a file or edit its metadata
5484
+ *
5485
+ * The owner and editors can rename a file or replace its `metadata`. Free.
5486
+ */
5487
+ static update(options) {
5488
+ return (options.client ?? client).patch({
5489
+ security: [{
5490
+ name: "x-api-key",
5491
+ type: "apiKey"
5492
+ }, {
5493
+ scheme: "bearer",
5494
+ type: "http"
5495
+ }],
5496
+ url: "/v1/files/{id}",
5497
+ ...options,
5498
+ headers: {
5499
+ "Content-Type": "application/json",
5500
+ ...options.headers
5501
+ }
5502
+ });
5503
+ }
5504
+ /**
5505
+ * Finish an upload
5506
+ *
5507
+ * 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.
5508
+ */
5509
+ static complete(options) {
5510
+ return (options.client ?? client).post({
5511
+ security: [{
5512
+ name: "x-api-key",
5513
+ type: "apiKey"
5514
+ }, {
5515
+ scheme: "bearer",
5516
+ type: "http"
5517
+ }],
5518
+ url: "/v1/files/{id}/complete",
5519
+ ...options
5520
+ });
5521
+ }
5522
+ /**
5523
+ * Open a file
5524
+ *
5525
+ * Redirects to a short-lived download link for a ready file. This path is the file's permanent link: it never expires, because each open is checked again. Pass `redirect=false` to get the link as JSON instead. Free.
5526
+ */
5527
+ static getFileContent(options) {
5528
+ return (options.client ?? client).get({
5529
+ security: [{
5530
+ name: "x-api-key",
5531
+ type: "apiKey"
5532
+ }, {
5533
+ scheme: "bearer",
5534
+ type: "http"
5535
+ }],
5536
+ url: "/v1/files/{id}/content",
5537
+ ...options
5538
+ });
5539
+ }
5540
+ /**
5541
+ * Detach a file
5542
+ *
5543
+ * The owner or an editor removes a link. Free.
5544
+ */
5545
+ static unlink(options) {
5546
+ return (options.client ?? client).delete({
5547
+ security: [{
5548
+ name: "x-api-key",
5549
+ type: "apiKey"
5550
+ }, {
5551
+ scheme: "bearer",
5552
+ type: "http"
5553
+ }],
5554
+ url: "/v1/files/{id}/links",
5555
+ ...options
5556
+ });
5557
+ }
5558
+ /**
5559
+ * Attach a file to something
5560
+ *
5561
+ * The owner or an editor attaches a file to a Studio table, a chat, a project or an export. A link does not share the file with anyone. Free.
5562
+ */
5563
+ static link(options) {
5564
+ return (options.client ?? client).post({
5565
+ security: [{
5566
+ name: "x-api-key",
5567
+ type: "apiKey"
5568
+ }, {
5569
+ scheme: "bearer",
5570
+ type: "http"
5571
+ }],
5572
+ url: "/v1/files/{id}/links",
5573
+ ...options,
5574
+ headers: {
5575
+ "Content-Type": "application/json",
5576
+ ...options.headers
5577
+ }
5578
+ });
5579
+ }
5580
+ /**
5581
+ * Stop sharing a file
5582
+ *
5583
+ * The owner removes a share. Anyone can remove a share to themselves (`user:<their id>`) to leave a file shared with them. Free.
5584
+ */
5585
+ static unshare(options) {
5586
+ return (options.client ?? client).delete({
5587
+ security: [{
5588
+ name: "x-api-key",
5589
+ type: "apiKey"
5590
+ }, {
5591
+ scheme: "bearer",
5592
+ type: "http"
5593
+ }],
5594
+ url: "/v1/files/{id}/shares",
5595
+ ...options
5596
+ });
5597
+ }
5598
+ /**
5599
+ * Share a file
5600
+ *
5601
+ * The owner shares a file with a person (`user:<id>`), a team (`team:<id>`) or the whole organization (`org`), as `viewer` (default) or `editor`. Sharing again changes the role. Free.
5602
+ */
5603
+ static share(options) {
5604
+ return (options.client ?? client).post({
5605
+ security: [{
5606
+ name: "x-api-key",
5607
+ type: "apiKey"
5608
+ }, {
5609
+ scheme: "bearer",
5610
+ type: "http"
5611
+ }],
5612
+ url: "/v1/files/{id}/shares",
5613
+ ...options,
5614
+ headers: {
5615
+ "Content-Type": "application/json",
5616
+ ...options.headers
5617
+ }
5618
+ });
5619
+ }
5620
+ };
5387
5621
  var Graph = class {
5388
5622
  /**
5389
5623
  * One entity's relationship network
@@ -6259,6 +6493,238 @@ var Monitors = class {
6259
6493
  ...options
6260
6494
  });
6261
6495
  }
6496
+ /**
6497
+ * Create a monitor
6498
+ *
6499
+ * Set up a monitor. From a ModelMatch template: send `watch: { template, inputs, options }` (see `GET /v1/monitors/templates`); it checks once right away, so updates from the last 90 days arrive with its first run, then weekly. From your own query: send `watch: { sql, keys, schedule }`, a `name` and at least one rule. Results land in a table in your organization's workspace. Free to set up; each weekly run of a template monitor costs credits.
6500
+ */
6501
+ static create(options) {
6502
+ return (options.client ?? client).post({
6503
+ security: [{
6504
+ name: "x-api-key",
6505
+ type: "apiKey"
6506
+ }, {
6507
+ scheme: "bearer",
6508
+ type: "http"
6509
+ }],
6510
+ url: "/v1/monitors",
6511
+ ...options,
6512
+ headers: {
6513
+ "Content-Type": "application/json",
6514
+ ...options.headers
6515
+ }
6516
+ });
6517
+ }
6518
+ /**
6519
+ * Get a monitor check
6520
+ *
6521
+ * Where a check you started stands. Free.
6522
+ */
6523
+ static getMonitorCheck(options) {
6524
+ return (options.client ?? client).get({
6525
+ security: [{
6526
+ name: "x-api-key",
6527
+ type: "apiKey"
6528
+ }, {
6529
+ scheme: "bearer",
6530
+ type: "http"
6531
+ }],
6532
+ url: "/v1/monitors/checks/{checkId}",
6533
+ ...options
6534
+ });
6535
+ }
6536
+ /**
6537
+ * Preview a monitor email
6538
+ *
6539
+ * Validates an email and returns what a run would send with it, filled with sample updates of the given kinds: your recent ones when you have any, else samples. Pass `template` or `monitorId` to preview under that template's copy and kinds. Writes nothing. Free.
6540
+ */
6541
+ static previewMonitorEmail(options) {
6542
+ return (options.client ?? client).post({
6543
+ security: [{
6544
+ name: "x-api-key",
6545
+ type: "apiKey"
6546
+ }, {
6547
+ scheme: "bearer",
6548
+ type: "http"
6549
+ }],
6550
+ url: "/v1/monitors/email-preview",
6551
+ ...options,
6552
+ headers: {
6553
+ "Content-Type": "application/json",
6554
+ ...options.headers
6555
+ }
6556
+ });
6557
+ }
6558
+ /**
6559
+ * List the monitor email tokens
6560
+ *
6561
+ * The tokens a monitor's email can use: tokens usable anywhere, and the item tokens each kind of update offers (inside an `items` block), each with a label and a formatted example. Free.
6562
+ */
6563
+ static getMonitorEmailTokens(options) {
6564
+ return (options?.client ?? client).get({
6565
+ security: [{
6566
+ name: "x-api-key",
6567
+ type: "apiKey"
6568
+ }, {
6569
+ scheme: "bearer",
6570
+ type: "http"
6571
+ }],
6572
+ url: "/v1/monitors/email-tokens",
6573
+ ...options
6574
+ });
6575
+ }
6576
+ /**
6577
+ * Preview a monitor
6578
+ *
6579
+ * What a monitor from a template would hold right now, with a sample of its rows, without saving anything or sending anything. Answers within about 12 seconds, else `running` with a `checkId`: poll `GET /v1/monitors/checks/{checkId}` until it has `succeeded`, then read `preview`. One at a time, shared with checks. Free.
6580
+ */
6581
+ static preview(options) {
6582
+ return (options.client ?? client).post({
6583
+ security: [{
6584
+ name: "x-api-key",
6585
+ type: "apiKey"
6586
+ }, {
6587
+ scheme: "bearer",
6588
+ type: "http"
6589
+ }],
6590
+ url: "/v1/monitors/preview",
6591
+ ...options,
6592
+ headers: {
6593
+ "Content-Type": "application/json",
6594
+ ...options.headers
6595
+ }
6596
+ });
6597
+ }
6598
+ /**
6599
+ * List monitor templates
6600
+ *
6601
+ * The ModelMatch templates you can set up a monitor from: what each watches, the kinds of update it sends and the inputs it asks for. Free.
6602
+ */
6603
+ static listMonitorTemplates(options) {
6604
+ return (options?.client ?? client).get({
6605
+ security: [{
6606
+ name: "x-api-key",
6607
+ type: "apiKey"
6608
+ }, {
6609
+ scheme: "bearer",
6610
+ type: "http"
6611
+ }],
6612
+ url: "/v1/monitors/templates",
6613
+ ...options
6614
+ });
6615
+ }
6616
+ /**
6617
+ * List your monitor updates
6618
+ *
6619
+ * What your monitors found, newest first: each run that fired, with the rows it matched. Free.
6620
+ */
6621
+ static listMonitorUpdates(options) {
6622
+ return (options?.client ?? client).get({
6623
+ security: [{
6624
+ name: "x-api-key",
6625
+ type: "apiKey"
6626
+ }, {
6627
+ scheme: "bearer",
6628
+ type: "http"
6629
+ }],
6630
+ url: "/v1/monitors/updates",
6631
+ ...options
6632
+ });
6633
+ }
6634
+ /**
6635
+ * Delete a monitor
6636
+ *
6637
+ * Stop a monitor and delete its table. Free.
6638
+ */
6639
+ static delete(options) {
6640
+ return (options.client ?? client).delete({
6641
+ security: [{
6642
+ name: "x-api-key",
6643
+ type: "apiKey"
6644
+ }, {
6645
+ scheme: "bearer",
6646
+ type: "http"
6647
+ }],
6648
+ url: "/v1/monitors/{id}",
6649
+ ...options
6650
+ });
6651
+ }
6652
+ /**
6653
+ * Get a monitor
6654
+ *
6655
+ * One of your monitors: what it watches, its rules, where its updates go and its status. Free.
6656
+ */
6657
+ static get(options) {
6658
+ return (options.client ?? client).get({
6659
+ security: [{
6660
+ name: "x-api-key",
6661
+ type: "apiKey"
6662
+ }, {
6663
+ scheme: "bearer",
6664
+ type: "http"
6665
+ }],
6666
+ url: "/v1/monitors/{id}",
6667
+ ...options
6668
+ });
6669
+ }
6670
+ /**
6671
+ * Change a monitor
6672
+ *
6673
+ * Change what a template monitor watches (`inputs`), its switches (`options`), rules, delivery (`notify`), email or `status` (`paused` stops its updates). New inputs are checked right away. Send the `version` you read to avoid overwriting another change. A SQL monitor takes only `notify` here; change its query by saving the job again. Free.
6674
+ */
6675
+ static update(options) {
6676
+ return (options.client ?? client).patch({
6677
+ security: [{
6678
+ name: "x-api-key",
6679
+ type: "apiKey"
6680
+ }, {
6681
+ scheme: "bearer",
6682
+ type: "http"
6683
+ }],
6684
+ url: "/v1/monitors/{id}",
6685
+ ...options,
6686
+ headers: {
6687
+ "Content-Type": "application/json",
6688
+ ...options.headers
6689
+ }
6690
+ });
6691
+ }
6692
+ /**
6693
+ * Check a monitor now
6694
+ *
6695
+ * Run a monitor from a template now instead of waiting for its weekly run. Answers within about 12 seconds, else `running` with a `checkId` to poll. A few checks a day; free.
6696
+ */
6697
+ static check(options) {
6698
+ return (options.client ?? client).post({
6699
+ security: [{
6700
+ name: "x-api-key",
6701
+ type: "apiKey"
6702
+ }, {
6703
+ scheme: "bearer",
6704
+ type: "http"
6705
+ }],
6706
+ url: "/v1/monitors/{id}/check",
6707
+ ...options
6708
+ });
6709
+ }
6710
+ /**
6711
+ * List a monitor's runs
6712
+ *
6713
+ * Every kept run of one monitor, newest first, with what fired on each. `runId` narrows it to one run (the `runId` a `monitors.fired` webhook or a notification names). Free.
6714
+ */
6715
+ static listMonitorRunUpdates(options) {
6716
+ return (options.client ?? client).get({
6717
+ security: [{
6718
+ name: "x-api-key",
6719
+ type: "apiKey"
6720
+ }, {
6721
+ scheme: "bearer",
6722
+ type: "http"
6723
+ }],
6724
+ url: "/v1/monitors/{id}/updates",
6725
+ ...options
6726
+ });
6727
+ }
6262
6728
  };
6263
6729
  var Offices = class {
6264
6730
  /**
@@ -8342,6 +8808,7 @@ function createClient(config = {}) {
8342
8808
  alerts: Alerts,
8343
8809
  branches: Branches,
8344
8810
  companies: Companies,
8811
+ files: Files,
8345
8812
  lenders: Lenders,
8346
8813
  loans: Loans,
8347
8814
  locations: Locations,
@@ -8355,4 +8822,4 @@ function createClient(config = {}) {
8355
8822
  };
8356
8823
  }
8357
8824
  //#endregion
8358
- export { Search as C, client as E, SavedFilters as S, Studio as T, Originators as _, Branches as a, Related as b, Graph as c, Loans as d, Locations as f, Offices as g, Monitors as h, Alerts as i, Integrations as l, Me as m, createClient as n, Companies as o, Market as p, Agents as r, Crm as s, createApiClient as t, Lenders as u, Properties as v, Signals as w, Sales as x, Realtime as y };
8825
+ export { SavedFilters as C, client as D, Studio as E, Sales as S, Signals as T, Offices as _, Branches as a, Realtime as b, Files as c, Lenders as d, Loans as f, Monitors as g, Me as h, Alerts as i, Graph as l, Market as m, createClient as n, Companies as o, Locations as p, Agents as r, Crm as s, createApiClient as t, Integrations as u, Originators as v, Search as w, Related as x, Properties as y };