@omelhorsite/sdk 0.3.0 → 0.4.1

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.
Files changed (92) hide show
  1. package/README.md +113 -131
  2. package/dist/index.js +1049 -1246
  3. package/dist/types/auth/device.d.ts +1 -1
  4. package/dist/types/auth/index.d.ts +2 -2
  5. package/dist/types/auth/tokens.d.ts +15 -15
  6. package/dist/types/client.d.ts +10 -10
  7. package/dist/types/errors.d.ts +12 -15
  8. package/dist/types/http.d.ts +74 -118
  9. package/dist/types/index.d.ts +2 -2
  10. package/dist/types/internal/attachments.d.ts +17 -0
  11. package/dist/types/internal/helpers.d.ts +9 -0
  12. package/dist/types/listing.d.ts +90 -0
  13. package/dist/types/local/qr.d.ts +1 -1
  14. package/dist/types/local/wordlist.d.ts +2 -3
  15. package/dist/types/resources/account.d.ts +19 -19
  16. package/dist/types/resources/admin/authorizedApplications.d.ts +133 -0
  17. package/dist/types/resources/admin/chests.d.ts +51 -0
  18. package/dist/types/resources/admin/eventAlerts.d.ts +60 -0
  19. package/dist/types/resources/admin/identities.d.ts +99 -0
  20. package/dist/types/resources/admin/index.d.ts +77 -0
  21. package/dist/types/resources/admin/jobs.d.ts +97 -0
  22. package/dist/types/resources/admin/myOauthApplications.d.ts +282 -0
  23. package/dist/types/resources/admin/notepads.d.ts +49 -0
  24. package/dist/types/resources/admin/oauthApplications.d.ts +309 -0
  25. package/dist/types/resources/admin/quotas.d.ts +114 -0
  26. package/dist/types/resources/admin/shortLinks.d.ts +201 -0
  27. package/dist/types/resources/admin/types.d.ts +222 -0
  28. package/dist/types/resources/admin/vocalSeparations.d.ts +98 -0
  29. package/dist/types/resources/admin.d.ts +17 -13
  30. package/dist/types/resources/auth/index.d.ts +1 -1
  31. package/dist/types/resources/auth/passkeys.d.ts +127 -163
  32. package/dist/types/resources/auth/sessions.d.ts +116 -161
  33. package/dist/types/resources/chests.d.ts +27 -31
  34. package/dist/types/resources/content/analysis.d.ts +62 -0
  35. package/dist/types/resources/content/blogs.d.ts +471 -0
  36. package/dist/types/resources/content/feedbacks.d.ts +263 -0
  37. package/dist/types/resources/content/index.d.ts +52 -0
  38. package/dist/types/resources/content/intel/articles.d.ts +230 -0
  39. package/dist/types/resources/content/intel/config.d.ts +135 -0
  40. package/dist/types/resources/content/intel/index.d.ts +53 -0
  41. package/dist/types/resources/content/intel/items.d.ts +91 -0
  42. package/dist/types/resources/content/intel/reports.d.ts +108 -0
  43. package/dist/types/resources/content/intel/scripts.d.ts +152 -0
  44. package/dist/types/resources/content/intel/sources.d.ts +236 -0
  45. package/dist/types/resources/content/intel/stats.d.ts +105 -0
  46. package/dist/types/resources/content/intel/types.d.ts +86 -0
  47. package/dist/types/resources/content/jokes.d.ts +93 -0
  48. package/dist/types/resources/content/notifications.d.ts +147 -0
  49. package/dist/types/resources/content/serviceUsages.d.ts +73 -0
  50. package/dist/types/resources/content/servicesStatus.d.ts +194 -0
  51. package/dist/types/resources/content/siteConfig.d.ts +43 -0
  52. package/dist/types/resources/content/spaceInvaders.d.ts +154 -0
  53. package/dist/types/resources/content.d.ts +41 -236
  54. package/dist/types/resources/dynamicQrs.d.ts +29 -45
  55. package/dist/types/resources/forms.d.ts +37 -58
  56. package/dist/types/resources/jobs.d.ts +35 -44
  57. package/dist/types/resources/library/annotations.d.ts +162 -0
  58. package/dist/types/resources/library/books.d.ts +534 -0
  59. package/dist/types/resources/library/chat.d.ts +259 -0
  60. package/dist/types/resources/library/index.d.ts +39 -0
  61. package/dist/types/resources/library/shelves.d.ts +237 -0
  62. package/dist/types/resources/library/types.d.ts +120 -0
  63. package/dist/types/resources/library.d.ts +20 -22
  64. package/dist/types/resources/media.d.ts +48 -61
  65. package/dist/types/resources/movies/addons.d.ts +388 -0
  66. package/dist/types/resources/movies/collections.d.ts +352 -0
  67. package/dist/types/resources/movies/index.d.ts +29 -0
  68. package/dist/types/resources/movies/types.d.ts +50 -0
  69. package/dist/types/resources/movies/watchProgress.d.ts +277 -0
  70. package/dist/types/resources/movies.d.ts +27 -53
  71. package/dist/types/resources/music/artists.d.ts +182 -246
  72. package/dist/types/resources/music/imports.d.ts +190 -218
  73. package/dist/types/resources/music/index.d.ts +8 -7
  74. package/dist/types/resources/music/playlists.d.ts +85 -117
  75. package/dist/types/resources/music/social.d.ts +153 -228
  76. package/dist/types/resources/music/songs.d.ts +165 -227
  77. package/dist/types/resources/realtime.d.ts +75 -88
  78. package/dist/types/resources/shortLinks.d.ts +38 -47
  79. package/dist/types/resources/social/groupChats.d.ts +458 -0
  80. package/dist/types/resources/social/index.d.ts +19 -0
  81. package/dist/types/resources/social/messages.d.ts +424 -0
  82. package/dist/types/resources/social/relationships.d.ts +322 -0
  83. package/dist/types/resources/social/types.d.ts +37 -0
  84. package/dist/types/resources/social.d.ts +21 -3
  85. package/dist/types/resources/storage/upload.d.ts +42 -56
  86. package/dist/types/resources/storage.d.ts +94 -109
  87. package/dist/types/resources/tickets.d.ts +19 -10
  88. package/dist/types/resources/tools/backgroundRemoval.d.ts +11 -13
  89. package/dist/types/resources/tools/captions.d.ts +107 -135
  90. package/dist/types/resources/tools/upscale.d.ts +12 -16
  91. package/dist/types/types.d.ts +29 -38
  92. package/package.json +1 -1
@@ -47,14 +47,7 @@
47
47
  * per IP, after a bot pushed roughly 200 notification emails through it in
48
48
  * one burst, plus a three-minute de-duplication window inside the
49
49
  * controller. See {@link FeedbacksNamespace.create}.
50
- * 9. **"Intel" is two unrelated things sharing a prefix.** `GET /intel/*path`
51
- * is a generic forwarder to a sidecar whose routes are not in the backend
52
- * repository, so it stays untyped on purpose ({@link IntelProxyNamespace}).
53
- * The `/intel_articles`, `/intel_reports`, `/intel_sources`,
54
- * `/intel_scripts`, `/intel_items`, `/intel_config` and `/intel_stats`
55
- * routes are ordinary Rails controllers with blueprints, and they are fully
56
- * typed ({@link IntelNamespace}). Reach for the second set.
57
- * 10. **Two blog routes are private by accident.** `allow_unauthenticated_access`
50
+ * 9. **Two blog routes are private by accident.** `allow_unauthenticated_access`
58
51
  * lists `index` and `show` on both blog controllers and nothing else, so the
59
52
  * public PERMALINK (`GET /blogs/:blog/posts/:slug`) rejects anonymous
60
53
  * readers while `GET /blog_posts/:id` serves them the same post, and the
@@ -84,35 +77,25 @@
84
77
  * rather than a throttle. See {@link ServicesStatusNamespace.uptime}.
85
78
  */
86
79
  import { ApiClient, Resource } from "../http";
87
- import type { FileOutput, Id, Json, PageParams, Paginated, QueryParams, QueryValue, RequestOptions, Timestamp } from "../types";
80
+ import type { ListParams } from "../listing";
81
+ import type { FileOutput, Id, Json, Paginated, RequestOptions, Timestamp } from "../types";
88
82
  import type { FsNode } from "./storage";
89
- /**
90
- * Filters accepted by the four listings in this file that really are the list
91
- * DSL. Mirrors the shape the other namespaces use.
92
- *
93
- * `search` is a partial, accent-insensitive match; `exact_search` is equality,
94
- * with an array meaning `IN` and `null` meaning `IS NULL`. Both fail CLOSED:
95
- * a key the controller did not declare is `400 "Unknown search filter: x"`,
96
- * never a silently wider result. The declared keys differ per endpoint and are
97
- * documented on each `list()`; they are much narrower here than you would
98
- * guess, because most of these controllers declare no `search_params` at all
99
- * and inherit only `id`, `created_at` and `updated_at`.
100
- */
101
- export interface ContentListParams extends PageParams {
102
- /** Partial, accent-insensitive match. Only the columns the endpoint declares. */
103
- readonly search?: Record<string, QueryValue>;
104
- /** Exact match. Array means `IN`, `null` means `IS NULL`. */
105
- readonly exactSearch?: Record<string, QueryValue>;
106
- /**
107
- * Ask for rows in random order. Mutually useful with a small `pageSize`.
108
- *
109
- * Two side effects worth knowing: `QueryModifier` applies `RANDOM()` with
110
- * `reorder`, so it REPLACES any `order` the controller set for itself, and
111
- * `CrudActions#resources_stale?` short-circuits for a random listing, so the
112
- * response carries no `ETag` and can never answer `304`.
113
- */
114
- readonly random?: boolean;
115
- }
83
+ /** Filter columns of `GET /notifications`, on top of {@link BASE_FILTER_COLUMNS}. `read` and `kind` are not filterable. */
84
+ export declare const NOTIFICATION_FILTER_COLUMNS: readonly ["user_id"];
85
+ /** Filters for {@link NotificationsNamespace.list}. */
86
+ export type ListNotificationsParams = ListParams<(typeof NOTIFICATION_FILTER_COLUMNS)[number]>;
87
+ /** Filter columns of `GET /feedbacks`, on top of {@link BASE_FILTER_COLUMNS}. */
88
+ export declare const FEEDBACK_FILTER_COLUMNS: readonly ["status", "user_id"];
89
+ /** Filters for {@link FeedbacksNamespace.list}. */
90
+ export type ListFeedbacksParams = ListParams<(typeof FEEDBACK_FILTER_COLUMNS)[number]>;
91
+ /** `GET /jokes` filters on {@link BASE_FILTER_COLUMNS} only. */
92
+ export declare const JOKE_FILTER_COLUMNS: readonly [];
93
+ /** Filters for {@link JokesNamespace.list}. */
94
+ export type ListJokesParams = ListParams<(typeof JOKE_FILTER_COLUMNS)[number]>;
95
+ /** `GET /space_invaders_games` filters on {@link BASE_FILTER_COLUMNS} only; there is no player filter. */
96
+ export declare const SPACE_INVADERS_GAME_FILTER_COLUMNS: readonly [];
97
+ /** Filters for {@link SpaceInvadersNamespace.list}. */
98
+ export type ListSpaceInvadersGamesParams = ListParams<(typeof SPACE_INVADERS_GAME_FILTER_COLUMNS)[number]>;
116
99
  /** Primary key of a blog. An INTEGER: `blogs` kept its auto-increment id. */
117
100
  export type BlogId = number;
118
101
  /** Primary key of a blog post. An integer, like the blog it hangs off. */
@@ -693,7 +676,7 @@ export declare class NotificationsNamespace extends Resource {
693
676
  * Sends an `ETag`, so an unchanged page answers `304` and costs nothing -
694
677
  * except with `random: true`, which disables the check.
695
678
  */
696
- list(params?: ContentListParams, options?: RequestOptions): Promise<Paginated<Notification>>;
679
+ list(params?: ListNotificationsParams, options?: RequestOptions): Promise<Paginated<Notification>>;
697
680
  /**
698
681
  * `GET /notifications/unread_count` - how many unread notifications the
699
682
  * caller has. Unwraps the `{"count": n}` the server sends.
@@ -939,10 +922,10 @@ export declare class FeedbacksNamespace extends Resource {
939
922
  * `created_at`, `updated_at`). Any other key is `400`.
940
923
  *
941
924
  * The scope is ordered `created_at DESC` before the DSL runs, and
942
- * `modifiers[order]` uses `reorder`, so passing {@link ContentListParams.order}
925
+ * `modifiers[order]` uses `reorder`, so passing {@link ListParams.order}
943
926
  * REPLACES that default rather than refining it.
944
927
  */
945
- list(params?: ContentListParams, options?: RequestOptions): Promise<Paginated<Feedback>>;
928
+ list(params?: ListFeedbacksParams, options?: RequestOptions): Promise<Paginated<Feedback>>;
946
929
  /**
947
930
  * `GET /feedbacks/:id` - one report in full. **Admin only**; anybody else
948
931
  * gets `401` with a `null` body.
@@ -1047,7 +1030,7 @@ export declare class JokesNamespace extends Resource {
1047
1030
  * ordering (`"lang:asc:pt,en"` puts those languages first), which the rest
1048
1031
  * of the SDK does not advertise because almost nothing needs it.
1049
1032
  */
1050
- list(params?: ContentListParams, options?: RequestOptions): Promise<Paginated<Joke>>;
1033
+ list(params?: ListJokesParams, options?: RequestOptions): Promise<Paginated<Joke>>;
1051
1034
  /**
1052
1035
  * `POST /jokes` - adds a joke. `201`. **Admin only.**
1053
1036
  *
@@ -1558,7 +1541,7 @@ export declare class SpaceInvadersNamespace extends Resource {
1558
1541
  *
1559
1542
  * No default ordering, so pass one. Sends an `ETag`.
1560
1543
  */
1561
- list(params?: ContentListParams, options?: RequestOptions): Promise<Paginated<SpaceInvadersGame>>;
1544
+ list(params?: ListSpaceInvadersGamesParams, options?: RequestOptions): Promise<Paginated<SpaceInvadersGame>>;
1562
1545
  /**
1563
1546
  * `POST /space_invaders_games` - records a finished run. `201`.
1564
1547
  *
@@ -1593,156 +1576,6 @@ export declare class SpaceInvadersNamespace extends Resource {
1593
1576
  destroy(id: SpaceInvadersGameId, options?: RequestOptions): Promise<void>;
1594
1577
  }
1595
1578
  /**
1596
- * The two path prefixes the proxy will forward. Mirrors
1597
- * `IntelController::ALLOWED_PREFIXES`.
1598
- *
1599
- * `api` is the sidecar's JSON surface; `img` is its image surface. Anything
1600
- * else - and any path containing `..` - is `400 "Invalid intel path."` before
1601
- * a byte leaves the backend.
1602
- */
1603
- export declare const INTEL_ALLOWED_PREFIXES: readonly ["api", "img"];
1604
- /** Connect timeout the backend applies to the sidecar, in milliseconds. */
1605
- export declare const INTEL_UPSTREAM_OPEN_TIMEOUT_MS = 5000;
1606
- /** Read timeout the backend applies to the sidecar, in milliseconds. */
1607
- export declare const INTEL_UPSTREAM_READ_TIMEOUT_MS = 60000;
1608
- /**
1609
- * The `intel` proxy: a read-only passthrough to an internal service.
1610
- *
1611
- * ## Why this namespace has no types
1612
- *
1613
- * `GET /intel/*path` is not an API. It is a generic forwarder:
1614
- * `IntelController#proxy` checks who is asking, refuses anything outside
1615
- * {@link INTEL_ALLOWED_PREFIXES}, joins the rest of the path onto the
1616
- * sidecar's base URL, replays the query string VERBATIM, injects an
1617
- * `X-API-Key` that never reaches the browser, and hands back whatever comes
1618
- * out - the upstream body, the upstream `Content-Type`, the upstream
1619
- * `Cache-Control` and the upstream STATUS CODE, unexamined.
1620
- *
1621
- * The SDK cannot see that service, its routes are not in this repository, and
1622
- * nothing in the backend validates or reshapes its answers. Publishing typed
1623
- * `getStories()` / `getReport()` methods here would be inventing a contract
1624
- * nobody can hold up, and it would rot the first time the sidecar changed. So
1625
- * this namespace offers exactly what the endpoint offers: a path, a query bag,
1626
- * and a caller-supplied result type it is the CALLER's job to justify.
1627
- *
1628
- * If you want typed intel data, use the native Rails endpoints instead -
1629
- * they are real controllers with real blueprints, the web frontend moved onto
1630
- * them and left this proxy behind, and they ARE wrapped, one family per
1631
- * sub-namespace under {@link IntelNamespace}. This class is only for the
1632
- * embedded hub the old page still renders and for its image bytes.
1633
- *
1634
- * ## Access
1635
- *
1636
- * Effectively a single-user endpoint. `Intel::Access.allowed?` is an admin
1637
- * check OR a hard-coded handle allowlist, so every other authenticated caller
1638
- * gets `403 "Intel access is restricted."` and an anonymous one gets the
1639
- * ordinary `401` first. Do not build a shared feature on this.
1640
- *
1641
- * ## Errors are not the API's errors
1642
- *
1643
- * The upstream status is forwarded as-is, so a 4xx or 5xx here carries the
1644
- * SIDECAR's body - which may be JSON, may be HTML, may be empty, and is
1645
- * certainly not this API's usual bare JSON string. Read
1646
- * {@link OmsApiError.body} defensively.
1647
- *
1648
- * When the sidecar cannot be reached at all - refused connection, DNS
1649
- * failure, or a timeout past
1650
- * {@link INTEL_UPSTREAM_OPEN_TIMEOUT_MS} / {@link INTEL_UPSTREAM_READ_TIMEOUT_MS} -
1651
- * the backend answers `502 "Intel service unreachable."`, which is a normal
1652
- * bare-string error.
1653
- *
1654
- * Only `GET` is routed. There is no way to write anything through this proxy.
1655
- *
1656
- * @deprecated Intel now lives ENTIRELY inside Rails. The analysis pipeline
1657
- * moved into Ruby and Solid Queue, and sources became per-user records with
1658
- * sandboxed TS scripts, so the `omelhorsite-intel-analise` sidecar this
1659
- * forwards to is on its way out. The route still answers today, which is why
1660
- * this class is still here rather than deleted, but nothing new should be
1661
- * built on it: when the sidecar goes, every call through here becomes a
1662
- * `502 "Intel service unreachable."` with no deprecation window, because the
1663
- * backend cannot tell a retired sidecar from a broken one.
1664
- *
1665
- * Use the typed families under {@link IntelNamespace} instead: `articles`,
1666
- * `reports`, `sources`, `scripts`, `items`, `config` and `stats` are real
1667
- * controllers with real blueprints over the API's own tables.
1668
- */
1669
- export declare class IntelProxyNamespace extends Resource {
1670
- /**
1671
- * `GET /intel/<path>` - forwards a read and parses the answer as JSON.
1672
- *
1673
- * The type parameter is a PROMISE YOU are making, not one the SDK or the
1674
- * backend can check. Default it to `unknown` and narrow at the call site
1675
- * unless you own the sidecar's route.
1676
- *
1677
- * `path` is relative and must start with `api/` or `img/`
1678
- * (see {@link INTEL_ALLOWED_PREFIXES}). A leading slash is stripped, and
1679
- * each segment is percent-encoded while the separators are kept, so
1680
- * `"api/articles/abc def"` reaches the sidecar as `api/articles/abc%20def`.
1681
- * Pass an unencoded path; passing a pre-encoded one double-encodes it.
1682
- *
1683
- * `query` is encoded by the SDK's normal rules and then replayed to the
1684
- * sidecar untouched, `null` sentinel and all - which is worth knowing,
1685
- * because the sentinel is a Rails convention the sidecar has never heard of.
1686
- * Prefer plain values here.
1687
- *
1688
- * The route is declared `format: false`, so a trailing `.json` stays part of
1689
- * the path instead of being read as a Rails format.
1690
- *
1691
- * If the answer is not JSON it comes back as the raw text (the transport
1692
- * falls back to a string rather than throwing), so a `T` of `unknown`
1693
- * genuinely can be a `string`.
1694
- *
1695
- * Cost: the backend buffers the entire upstream body in memory before
1696
- * sending it on - there is no streaming - and holds a Puma thread for up to
1697
- * {@link INTEL_UPSTREAM_READ_TIMEOUT_MS} while it waits.
1698
- *
1699
- * @throws {OmsApiError} 400 `"Invalid intel path."` for a path outside the
1700
- * allowed prefixes or containing `..`; 403 `"Intel access is restricted."`;
1701
- * 502 `"Intel service unreachable."`; or anything at all, forwarded from
1702
- * the sidecar.
1703
- */
1704
- get<T = unknown>(path: string, query?: QueryParams, options?: RequestOptions): Promise<T>;
1705
- /**
1706
- * `GET /intel/<path>` - forwards a read and keeps the bytes.
1707
- *
1708
- * For the `img/` prefix, and for any `api/` route that answers with
1709
- * something other than JSON. Buffers the whole body, so do not point it at
1710
- * anything large.
1711
- *
1712
- * {@link FileOutput.filename} will be `undefined`: the backend sends
1713
- * `Content-Disposition: inline` with no filename. `contentType` is whatever
1714
- * the sidecar declared.
1715
- */
1716
- fetch(path: string, query?: QueryParams, options?: RequestOptions): Promise<FileOutput>;
1717
- /**
1718
- * The absolute URL of a proxied path, for an `<img src>` or an `<a href>`.
1719
- *
1720
- * Builds the string and makes no request. Useful only for a cookie-session
1721
- * browser client on the API's origin: the proxy requires an authenticated,
1722
- * allowlisted caller, so a bare URL opened without a credential is a `401`.
1723
- */
1724
- url(path: string, query?: QueryParams): string;
1725
- }
1726
- /**
1727
- * ## Why these ARE typed, when the proxy above is not
1728
- *
1729
- * The two halves of "intel" look alike and are nothing alike.
1730
- * {@link IntelProxyNamespace} forwards `GET /intel/*path` to a service whose
1731
- * routes are not in the backend repository, so its answers are genuinely
1732
- * unknowable. Everything below is the opposite: seven ordinary Rails
1733
- * controllers over eight of the backend's own tables, each with a Blueprinter
1734
- * blueprint that names every key it emits. `IntelArticleBlueprint`,
1735
- * `IntelReportBlueprint`, `IntelSourceBlueprint`, `IntelScriptBlueprint`,
1736
- * `IntelItemBlueprint` and `IntelConfigBlueprint` are the contract, and
1737
- * `IntelStatsController#show` hand-writes its hash literally. Nothing here is
1738
- * forwarded, nothing here is opaque, and the SDK types it the way it types any
1739
- * other resource.
1740
- *
1741
- * Where the two meet: the sidecar behind the proxy is the OLD, separate intel
1742
- * product embedded in the web app's `/intel` page. The routes below are the one
1743
- * that replaced it. Reach for these first; the proxy is for the embedded hub
1744
- * and for image bytes.
1745
- *
1746
1579
  * ## Access: this is effectively a one-user feature
1747
1580
  *
1748
1581
  * `IntelAccess` runs `before_action :require_intel_access` on all seven
@@ -2221,8 +2054,10 @@ export interface IntelStats {
2221
2054
  /** Stories touched in the last 24 hours. */
2222
2055
  readonly last24h: number;
2223
2056
  }
2057
+ /** Filter columns of `GET /intel_articles`, on top of {@link BASE_FILTER_COLUMNS}. */
2058
+ export declare const INTEL_ARTICLE_FILTER_COLUMNS: readonly ["title", "summary", "category", "importance", "enriched"];
2224
2059
  /** Filters for {@link IntelArticlesNamespace.list}. */
2225
- export interface ListIntelArticlesParams extends ContentListParams {
2060
+ export interface ListIntelArticlesParams extends ListParams<(typeof INTEL_ARTICLE_FILTER_COLUMNS)[number]> {
2226
2061
  /**
2227
2062
  * Free-text search over `title`, `summary` AND `details`.
2228
2063
  *
@@ -2231,7 +2066,7 @@ export interface ListIntelArticlesParams extends ContentListParams {
2231
2066
  * not in `search_params` at all) and why an unknown-filter 400 cannot
2232
2067
  * happen for it.
2233
2068
  *
2234
- * Three ways it differs from {@link ContentListParams.search}:
2069
+ * Three ways it differs from {@link ListParams.search}:
2235
2070
  *
2236
2071
  * - it is **accent-SENSITIVE**. The controller does `LOWER(col) LIKE
2237
2072
  * LOWER(term)`, with no unaccenting, while the list DSL's `search` strips
@@ -2266,20 +2101,24 @@ export interface ListIntelArticlesParams extends ContentListParams {
2266
2101
  */
2267
2102
  readonly sort?: "recent" | "importance";
2268
2103
  }
2104
+ /** Filter columns of `GET /intel_reports`, on top of {@link BASE_FILTER_COLUMNS}. */
2105
+ export declare const INTEL_REPORT_FILTER_COLUMNS: readonly ["kind"];
2269
2106
  /** Filters for {@link IntelReportsNamespace.list}. */
2270
- export interface ListIntelReportsParams extends ContentListParams {
2107
+ export interface ListIntelReportsParams extends ListParams<(typeof INTEL_REPORT_FILTER_COLUMNS)[number]> {
2271
2108
  /**
2272
2109
  * Narrow to one window, e.g. `"day"`. Sent as `exact_search[kind]`, so it is
2273
2110
  * equality rather than a prefix match - `"6h"` will not also match `"6hx"`.
2274
2111
  *
2275
- * Passing it through {@link ContentListParams.search} instead would be a
2112
+ * Passing it through {@link ListParams.search} instead would be a
2276
2113
  * partial match and would work too; `kind` is on this controller's
2277
2114
  * `search_params` allowlist. Equality is what you want.
2278
2115
  */
2279
2116
  readonly kind?: IntelReportKind;
2280
2117
  }
2118
+ /** Filter columns of `GET /intel_sources`, on top of {@link BASE_FILTER_COLUMNS}. */
2119
+ export declare const INTEL_SOURCE_FILTER_COLUMNS: readonly ["name", "health", "enabled", "intel_script_id"];
2281
2120
  /** Filters for {@link IntelSourcesNamespace.list}. */
2282
- export interface ListIntelSourcesParams extends ContentListParams {
2121
+ export interface ListIntelSourcesParams extends ListParams<(typeof INTEL_SOURCE_FILTER_COLUMNS)[number]> {
2283
2122
  /** Only healthy / only broken feeds. Sent as `exact_search[health]`. */
2284
2123
  readonly health?: IntelSourceHealth;
2285
2124
  /** Only enabled, or only the ones that switched themselves off. */
@@ -2287,8 +2126,10 @@ export interface ListIntelSourcesParams extends ContentListParams {
2287
2126
  /** Every source driven by one script. */
2288
2127
  readonly scriptId?: Id;
2289
2128
  }
2129
+ /** Filter columns of `GET /intel_scripts`, on top of {@link BASE_FILTER_COLUMNS}. */
2130
+ export declare const INTEL_SCRIPT_FILTER_COLUMNS: readonly ["name", "builtin", "slug"];
2290
2131
  /** Filters for {@link IntelScriptsNamespace.list}. */
2291
- export interface ListIntelScriptsParams extends ContentListParams {
2132
+ export interface ListIntelScriptsParams extends ListParams<(typeof INTEL_SCRIPT_FILTER_COLUMNS)[number]> {
2292
2133
  /**
2293
2134
  * `true` for the platform scripts, `false` for yours. Omit for both - the
2294
2135
  * listing scope is `builtin OR mine`, so both populations are mixed by
@@ -2296,8 +2137,10 @@ export interface ListIntelScriptsParams extends ContentListParams {
2296
2137
  */
2297
2138
  readonly builtin?: boolean;
2298
2139
  }
2140
+ /** Filter columns of `GET /intel_items`, on top of {@link BASE_FILTER_COLUMNS}. */
2141
+ export declare const INTEL_ITEM_FILTER_COLUMNS: readonly ["intel_source_id", "external_id", "title", "content", "url"];
2299
2142
  /** Filters for {@link IntelItemsNamespace.list}. */
2300
- export interface ListIntelItemsParams extends ContentListParams {
2143
+ export interface ListIntelItemsParams extends ListParams<(typeof INTEL_ITEM_FILTER_COLUMNS)[number]> {
2301
2144
  /** Only items produced by one source. Sent as `exact_search[intel_source_id]`. */
2302
2145
  readonly sourceId?: Id;
2303
2146
  }
@@ -2864,13 +2707,6 @@ export declare function intelArticleImageUrl(imageUrl: string | null | undefined
2864
2707
  /**
2865
2708
  * The `intel` namespace, reachable as `oms.content.intel`.
2866
2709
  *
2867
- * Seven typed families over the backend's own tables, plus {@link proxy} for
2868
- * the untyped passthrough to the old sidecar. The three proxy methods are also
2869
- * mirrored on this class so that code written against 0.3.0's
2870
- * `oms.content.intel.get(path)` keeps working; new code should say
2871
- * `oms.content.intel.proxy.get(path)`, which cannot be confused with
2872
- * {@link IntelArticlesNamespace.get}.
2873
- *
2874
2710
  * A tour of the data model, because the names do not give it away:
2875
2711
  *
2876
2712
  * 1. a {@link IntelScript} knows HOW to fetch one kind of feed;
@@ -2902,38 +2738,7 @@ export declare class IntelNamespace extends Resource {
2902
2738
  readonly config: IntelConfigNamespace;
2903
2739
  /** Dashboard counters, in one expensive call. */
2904
2740
  readonly stats: IntelStatsNamespace;
2905
- /**
2906
- * The untyped passthrough to the old intel sidecar.
2907
- *
2908
- * @deprecated See {@link IntelProxyNamespace}. Kept only because the route
2909
- * still answers; the typed families above are the intel API now.
2910
- */
2911
- readonly proxy: IntelProxyNamespace;
2912
2741
  constructor(http: ApiClient);
2913
- /**
2914
- * Alias for {@link IntelProxyNamespace.get}. Kept so 0.3.0 call sites still
2915
- * compile; prefer `oms.content.intel.proxy.get(path)`.
2916
- *
2917
- * @deprecated The intel sidecar is being retired: intel now lives entirely
2918
- * inside Rails. See {@link IntelProxyNamespace}.
2919
- */
2920
- get<T = unknown>(path: string, query?: QueryParams, options?: RequestOptions): Promise<T>;
2921
- /**
2922
- * Alias for {@link IntelProxyNamespace.fetch}. Kept so 0.3.0 call sites still
2923
- * compile; prefer `oms.content.intel.proxy.fetch(path)`.
2924
- *
2925
- * @deprecated The intel sidecar is being retired: intel now lives entirely
2926
- * inside Rails. See {@link IntelProxyNamespace}.
2927
- */
2928
- fetch(path: string, query?: QueryParams, options?: RequestOptions): Promise<FileOutput>;
2929
- /**
2930
- * Alias for {@link IntelProxyNamespace.url}. Kept so 0.3.0 call sites still
2931
- * compile; prefer `oms.content.intel.proxy.url(path)`.
2932
- *
2933
- * @deprecated The intel sidecar is being retired: intel now lives entirely
2934
- * inside Rails. See {@link IntelProxyNamespace}.
2935
- */
2936
- url(path: string, query?: QueryParams): string;
2937
2742
  }
2938
2743
  /**
2939
2744
  * The `content` namespace, reachable as `oms.content`.
@@ -2,9 +2,9 @@
2
2
  * The `dynamicQrs` namespace: QR codes whose destination can be changed after
3
3
  * the code has been printed.
4
4
  *
5
- * Under the hood each one is a `ShortLink` in the reserved `"qr"` namespace
6
- * with a server-minted UUID endpoint, plus the styling the renderer needs. It
7
- * is a separate resource because the endpoint is not user-chosen, the payload
5
+ * Each one is a short link in the reserved `"qr"` namespace with a
6
+ * server-minted UUID endpoint, plus the styling a renderer needs. It is a
7
+ * separate resource because the endpoint is not user-chosen, the payload
8
8
  * carries `settings`, and the plain short-link listing filters system
9
9
  * namespaces out - a dynamic QR will never appear in `oms.shortLinks.list()`.
10
10
  *
@@ -20,30 +20,28 @@ import { type ShortLinkId, type ShortLinkStats } from "./shortLinks";
20
20
  /**
21
21
  * The reserved short-link namespace every dynamic QR lives in.
22
22
  *
23
- * `ShortLink::DYNAMIC_QR_NAMESPACE`. It is not a user choice and it never
24
- * changes on a record, which is why {@link DynamicQr.namespace} is typed as
25
- * this literal rather than as a string.
23
+ * It is not a user choice and it never changes on a record, which is why
24
+ * {@link DynamicQr.namespace} is typed as this literal rather than as a string.
26
25
  */
27
26
  export declare const DYNAMIC_QR_NAMESPACE = "qr";
28
27
  /** Public prefix a dynamic QR resolves under. */
29
28
  export declare const DYNAMIC_QR_BASE_URL = "https://omelhor.site/qr";
30
- /** Module shapes `DynamicQrs::SettingsSanitizer` accepts. Anything else is dropped. */
29
+ /** Module shapes the server accepts. Anything else is dropped. */
31
30
  export type DynamicQrStyle = "classic" | "rounded" | "dots" | "extraRounded" | "classy" | "classyRounded";
32
31
  /**
33
32
  * Styling of a dynamic QR.
34
33
  *
35
- * The backend runs this bag through `DynamicQrs::SettingsSanitizer`, which
36
- * **silently drops** every key it does not recognise and every value that fails
37
- * its check - a bad `style`, a colour that is not `#rrggbb`. An unknown or
38
- * malformed key is therefore a no-op, not an error, and the only way to know
39
- * what stuck is to read `settings` back off the response.
34
+ * The server **silently drops** every key it does not recognise and every
35
+ * value that fails its check - a bad `style`, a colour that is not `#rrggbb`.
36
+ * An unknown or malformed key is therefore a no-op, not an error, and the only
37
+ * way to know what stuck is to read `settings` back off the response.
40
38
  *
41
39
  * The two exceptions that DO fail loudly are `logo` and `bg_image`: a value
42
40
  * that is neither `null`/`""` nor a `data:image/...` URI under the size cap is
43
41
  * a 400.
44
42
  *
45
- * The SDK does not render any of this; it is what the web tool's renderer
46
- * consumes. `oms.local.qr` draws a plain symbol from the matrix instead.
43
+ * The SDK does not render any of this. `oms.local.qr` draws a plain symbol
44
+ * from the matrix instead.
47
45
  */
48
46
  export interface DynamicQrSettings {
49
47
  /** Module shape. Values outside {@link DynamicQrStyle} are dropped. */
@@ -75,51 +73,38 @@ export interface DynamicQrSettings {
75
73
  /** How the background image sits against `bg_color`. Anything but `"replace"` reads as `"behind"`. */
76
74
  readonly bg_image_mode?: "replace" | "behind";
77
75
  /**
78
- * The stored bag is free-form JSON, so a code saved by an older version of
79
- * the web tool can carry keys this interface does not name.
76
+ * The stored bag is free-form JSON, so a code saved by an older client can
77
+ * carry keys this interface does not name.
80
78
  */
81
79
  readonly [key: string]: unknown;
82
80
  }
83
81
  /**
84
82
  * A dynamic QR code.
85
83
  *
86
- * `DynamicQrBlueprint` renders `ApplicationBlueprint`'s three automatic keys
87
- * (`id`, `created_at`, `updated_at`) plus exactly five more, and that is the
88
- * whole record. Two keys a client migrating off the old web service will
89
- * expect are NOT here and never were on this endpoint: `website_id` and
90
- * `website_managed`. They are residue of the websites feature, which was
91
- * extracted out of this backend entirely - there is no such column on
92
- * `short_links` and no such field on any blueprint, so anything declaring them
93
- * has been reading `undefined`.
94
- *
95
- * The blueprint is also never resolved automatically. A dynamic QR IS a
96
- * `ShortLink`, and `ShortLinkBlueprint` already owns that name with a
97
- * different shape (associations, no `settings`), so every call site passes
98
- * this blueprint explicitly. That is why the two records disagree about which
99
- * fields exist even though they are rows in one table.
84
+ * Eight keys, and that is the whole record. There is no `website_id` and no
85
+ * `website_managed`. A dynamic QR is a short link, but the two records carry
86
+ * different fields: this one has `settings` and no associations.
100
87
  */
101
88
  export interface DynamicQr extends Omit<BaseRecord, "id"> {
102
- /** Integer primary key: a dynamic QR is a `short_links` row. See {@link ShortLinkId}. */
89
+ /** Integer primary key: a dynamic QR is a short link. See {@link ShortLinkId}. */
103
90
  readonly id: number;
104
91
  /** Current destination. Changing it re-points every printed copy at once. */
105
92
  readonly url: string;
106
93
  /** Server-assigned UUID the QR image encodes. Not choosable, not renameable. */
107
94
  readonly endpoint: string;
108
95
  /**
109
- * Always {@link DYNAMIC_QR_NAMESPACE}. The controller writes it on create
110
- * and nothing can change it afterwards, and the listing scope filters on it,
111
- * so a record that reached you through this namespace cannot hold anything
112
- * else.
96
+ * Always {@link DYNAMIC_QR_NAMESPACE}. Set on create, never changeable, and
97
+ * the listing filters on it, so a record that reached you through this
98
+ * namespace cannot hold anything else.
113
99
  */
114
100
  readonly namespace: typeof DYNAMIC_QR_NAMESPACE;
115
101
  /**
116
- * Owner. The column is nullable because anonymous short links exist, but
117
- * every route on this resource requires a credential and the controller
118
- * always sets the owner, so in practice this is never `null` for a dynamic
119
- * QR.
102
+ * Owner. Nullable because anonymous short links exist, but every route on
103
+ * this resource requires a credential and always sets the owner, so in
104
+ * practice this is never `null` for a dynamic QR.
120
105
  */
121
106
  readonly user_id: Id | null;
122
- /** Never `null`: the blueprint substitutes `{}` for an unset bag. */
107
+ /** Never `null`: `{}` for an unset bag. */
123
108
  readonly settings: DynamicQrSettings & JsonObject;
124
109
  }
125
110
  /** Arguments for creating a dynamic QR. */
@@ -132,7 +117,7 @@ export interface CreateDynamicQrInput {
132
117
  /**
133
118
  * Fields that can change afterwards.
134
119
  *
135
- * `settings` is **merged** into the stored bag by the backend, not replaced, so
120
+ * `settings` is **merged** into the stored bag server-side, not replaced, so
136
121
  * an update can never unset a key by omitting it. To clear one, send it
137
122
  * explicitly with the value that means empty (`null` for `logo`/`bg_image`).
138
123
  */
@@ -146,10 +131,9 @@ export declare class DynamicQrsNamespace extends Resource {
146
131
  * `GET /dynamic_qrs` - every code you own, newest first.
147
132
  *
148
133
  * Returns a plain array rather than a page object, and that is not an
149
- * oversight: this controller does not use `CrudActions` and ignores
150
- * `modifiers[page]` entirely, so it always answers with the complete set. A
151
- * `Paginated` here would be a fiction with a `next()` that refetched
152
- * everything.
134
+ * oversight: the endpoint ignores `modifiers[page]` entirely and always
135
+ * answers with the complete set. A `Paginated` here would be a fiction with
136
+ * a `next()` that refetched everything.
153
137
  *
154
138
  * @throws {OmsAuthError} 401 when anonymous.
155
139
  */