@omelhorsite/sdk 0.2.0 → 0.3.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.
Files changed (44) hide show
  1. package/dist/index.js +4939 -552
  2. package/dist/types/client.d.ts +60 -3
  3. package/dist/types/http.d.ts +444 -19
  4. package/dist/types/index.d.ts +4 -1
  5. package/dist/types/resources/account.d.ts +66 -3
  6. package/dist/types/resources/admin.d.ts +1837 -0
  7. package/dist/types/resources/auth/index.d.ts +39 -0
  8. package/dist/types/resources/auth/passkeys.d.ts +652 -0
  9. package/dist/types/resources/auth/sessions.d.ts +847 -0
  10. package/dist/types/resources/chests.d.ts +54 -3
  11. package/dist/types/resources/content.d.ts +2970 -0
  12. package/dist/types/resources/dynamicQrs.d.ts +39 -3
  13. package/dist/types/resources/forms.d.ts +176 -35
  14. package/dist/types/resources/index.d.ts +19 -8
  15. package/dist/types/resources/ipLookup.d.ts +20 -4
  16. package/dist/types/resources/jobs.d.ts +62 -21
  17. package/dist/types/resources/library.d.ts +1435 -0
  18. package/dist/types/resources/linkTrees.d.ts +142 -30
  19. package/dist/types/resources/media.d.ts +351 -0
  20. package/dist/types/resources/movies.d.ts +1186 -0
  21. package/dist/types/resources/music/artists.d.ts +1066 -0
  22. package/dist/types/resources/music/imports.d.ts +940 -0
  23. package/dist/types/resources/music/index.d.ts +61 -0
  24. package/dist/types/resources/music/playlists.d.ts +1026 -0
  25. package/dist/types/resources/music/social.d.ts +1132 -0
  26. package/dist/types/resources/music/songs.d.ts +1183 -0
  27. package/dist/types/resources/notepads.d.ts +4 -1
  28. package/dist/types/resources/quotas.d.ts +7 -1
  29. package/dist/types/resources/realtime.d.ts +855 -0
  30. package/dist/types/resources/shortLinks.d.ts +45 -4
  31. package/dist/types/resources/social.d.ts +1330 -0
  32. package/dist/types/resources/storage/upload.d.ts +158 -11
  33. package/dist/types/resources/storage.d.ts +88 -22
  34. package/dist/types/resources/tickets.d.ts +82 -3
  35. package/dist/types/resources/tools/backgroundRemoval.d.ts +18 -3
  36. package/dist/types/resources/tools/captions.d.ts +448 -21
  37. package/dist/types/resources/tools/downloader.d.ts +21 -0
  38. package/dist/types/resources/tools/index.d.ts +57 -15
  39. package/dist/types/resources/tools/jumpstyle.d.ts +50 -17
  40. package/dist/types/resources/tools/transcription.d.ts +35 -13
  41. package/dist/types/resources/tools/upscale.d.ts +23 -3
  42. package/dist/types/resources/tools/vocalSeparation.d.ts +30 -13
  43. package/dist/types/types.d.ts +249 -17
  44. package/package.json +2 -1
@@ -9,9 +9,16 @@
9
9
  * Creating a link works anonymously; listing, editing and statistics need a
10
10
  * credential. Creation is the most tightly throttled write in the whole API -
11
11
  * see {@link ShortLinksNamespace.create} before you spend one.
12
+ *
13
+ * There is deliberately no `get(id)` here, and its absence is the API's, not
14
+ * an omission: the route file declares `resources :short_links, only: [:create,
15
+ * :index, :update, :destroy]`, so `GET /short_links/:id` is not routed at all
16
+ * and answers 404 for every id, including your own links. To read one link,
17
+ * find it in {@link ShortLinksNamespace.list} - or by endpoint with
18
+ * {@link ShortLinksNamespace.resolve}, which explains what that costs.
12
19
  */
13
20
  import { Resource } from "../http";
14
- import { type BaseRecord, type Id, type JsonObject, type PageParams, type Paginated, type RequestOptions, type Timestamp } from "../types";
21
+ import { type BaseRecord, type Id, type Json, type PageParams, type Paginated, type RequestOptions, type Timestamp } from "../types";
15
22
  /** Public host that fronts `short_links#follow`. See {@link ShortLinksNamespace.shortUrl}. */
16
23
  export declare const SHORT_LINK_BASE_URL = "https://omelhor.site";
17
24
  /**
@@ -33,11 +40,39 @@ export interface ShortLinkClick {
33
40
  /** Browser or app name parsed from the user agent, or `null`. */
34
41
  readonly device_name: string | null;
35
42
  }
43
+ /**
44
+ * The owner of a link, rendered inline by `UserBlueprint`'s default view.
45
+ *
46
+ * Only the keys that view declares unconditionally are named. `UserBlueprint`
47
+ * also renders `group`, `email`, `gender`, `last_seen_at`, `sessions_count`,
48
+ * `deactivated_at`, `allowed_to_use_spotify` and `share_listening` behind `if:`
49
+ * predicates that test who is ASKING, so whether they appear depends on the
50
+ * caller's own privileges rather than on the record. That is why they are
51
+ * reached through the index signature instead of being declared here as
52
+ * optionals: an optional would suggest the server decides, and it does not.
53
+ */
54
+ export interface ShortLinkOwner {
55
+ readonly id: Id;
56
+ readonly handle: string;
57
+ readonly name: string;
58
+ readonly bio: string | null;
59
+ readonly country_code: string;
60
+ readonly created_at: Timestamp;
61
+ readonly updated_at: Timestamp;
62
+ readonly [key: string]: Json | undefined;
63
+ }
36
64
  /**
37
65
  * A short link.
38
66
  *
39
67
  * `Omit<BaseRecord, "id">` rather than a plain `extends BaseRecord`: see
40
68
  * {@link ShortLinkId} for why the identifier is a number on this one table.
69
+ *
70
+ * Every key below is present on every response this namespace can produce.
71
+ * `ShortLinkBlueprint` does declare a second, narrower `:admin` view - it drops
72
+ * `updated_at`, both associations, and adds `owner`, `click_count` and
73
+ * `last_click_at` - but that view is only ever rendered by the admin
74
+ * shortlinks tool under `/admin/short_links`, which is not this resource. A
75
+ * record that arrived here has the full default shape.
41
76
  */
42
77
  export interface ShortLink extends Omit<BaseRecord, "id"> {
43
78
  /** Integer primary key. See {@link ShortLinkId}. */
@@ -52,6 +87,9 @@ export interface ShortLink extends Omit<BaseRecord, "id"> {
52
87
  * shares), `"qr"` (dynamic QR), `"f"` (forms) and `"t"` (link trees). That
53
88
  * is why {@link ShortLink} and `DynamicQr` are separate resources even
54
89
  * though both are rows in the same table.
90
+ *
91
+ * A link that reached you through {@link ShortLinksNamespace.list} always
92
+ * holds `null` or `""`, because the listing scope is `user_managed`.
55
93
  */
56
94
  readonly namespace: string | null;
57
95
  /** Owner, or `null` for a link created anonymously. */
@@ -61,10 +99,13 @@ export interface ShortLink extends Omit<BaseRecord, "id"> {
61
99
  * page. A link with 50 000 visits sends 50 000 objects here. Use
62
100
  * {@link ShortLinksNamespace.stats} for anything analytical and treat this
63
101
  * field as a payload hazard, not as a feature.
102
+ *
103
+ * Always present, and `[]` rather than `null` for a link nobody has clicked:
104
+ * a Blueprinter association over an empty `has_many` renders an empty array.
64
105
  */
65
- readonly short_link_clicks?: ShortLinkClick[];
66
- /** The owner rendered inline (the same shape `oms.account` returns), or `null`. */
67
- readonly user?: JsonObject | null;
106
+ readonly short_link_clicks: ShortLinkClick[];
107
+ /** The owner rendered inline, or `null` for a link created anonymously. */
108
+ readonly user: ShortLinkOwner | null;
68
109
  }
69
110
  /** One day of the click histogram. */
70
111
  export interface ShortLinkDailyClicks {