@omelhorsite/sdk 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +112 -130
- package/dist/index.js +4800 -610
- package/dist/types/client.d.ts +60 -3
- package/dist/types/http.d.ts +444 -19
- package/dist/types/index.d.ts +5 -1
- package/dist/types/internal/attachments.d.ts +17 -0
- package/dist/types/internal/helpers.d.ts +9 -0
- package/dist/types/listing.d.ts +90 -0
- package/dist/types/resources/account.d.ts +71 -5
- package/dist/types/resources/admin/authorizedApplications.d.ts +133 -0
- package/dist/types/resources/admin/chests.d.ts +51 -0
- package/dist/types/resources/admin/eventAlerts.d.ts +60 -0
- package/dist/types/resources/admin/identities.d.ts +99 -0
- package/dist/types/resources/admin/index.d.ts +77 -0
- package/dist/types/resources/admin/jobs.d.ts +97 -0
- package/dist/types/resources/admin/myOauthApplications.d.ts +282 -0
- package/dist/types/resources/admin/notepads.d.ts +49 -0
- package/dist/types/resources/admin/oauthApplications.d.ts +309 -0
- package/dist/types/resources/admin/quotas.d.ts +114 -0
- package/dist/types/resources/admin/shortLinks.d.ts +201 -0
- package/dist/types/resources/admin/types.d.ts +222 -0
- package/dist/types/resources/admin/vocalSeparations.d.ts +98 -0
- package/dist/types/resources/admin.d.ts +1841 -0
- package/dist/types/resources/auth/index.d.ts +39 -0
- package/dist/types/resources/auth/passkeys.d.ts +652 -0
- package/dist/types/resources/auth/sessions.d.ts +844 -0
- package/dist/types/resources/chests.d.ts +54 -3
- package/dist/types/resources/content/analysis.d.ts +62 -0
- package/dist/types/resources/content/blogs.d.ts +471 -0
- package/dist/types/resources/content/feedbacks.d.ts +263 -0
- package/dist/types/resources/content/index.d.ts +52 -0
- package/dist/types/resources/content/intel/articles.d.ts +230 -0
- package/dist/types/resources/content/intel/config.d.ts +135 -0
- package/dist/types/resources/content/intel/index.d.ts +53 -0
- package/dist/types/resources/content/intel/items.d.ts +91 -0
- package/dist/types/resources/content/intel/reports.d.ts +108 -0
- package/dist/types/resources/content/intel/scripts.d.ts +152 -0
- package/dist/types/resources/content/intel/sources.d.ts +236 -0
- package/dist/types/resources/content/intel/stats.d.ts +105 -0
- package/dist/types/resources/content/intel/types.d.ts +86 -0
- package/dist/types/resources/content/jokes.d.ts +93 -0
- package/dist/types/resources/content/notifications.d.ts +147 -0
- package/dist/types/resources/content/serviceUsages.d.ts +73 -0
- package/dist/types/resources/content/servicesStatus.d.ts +194 -0
- package/dist/types/resources/content/siteConfig.d.ts +43 -0
- package/dist/types/resources/content/spaceInvaders.d.ts +154 -0
- package/dist/types/resources/content.d.ts +2775 -0
- package/dist/types/resources/dynamicQrs.d.ts +39 -3
- package/dist/types/resources/forms.d.ts +176 -35
- package/dist/types/resources/index.d.ts +19 -8
- package/dist/types/resources/ipLookup.d.ts +20 -4
- package/dist/types/resources/jobs.d.ts +69 -25
- package/dist/types/resources/library/annotations.d.ts +162 -0
- package/dist/types/resources/library/books.d.ts +534 -0
- package/dist/types/resources/library/chat.d.ts +259 -0
- package/dist/types/resources/library/index.d.ts +39 -0
- package/dist/types/resources/library/shelves.d.ts +237 -0
- package/dist/types/resources/library/types.d.ts +120 -0
- package/dist/types/resources/library.d.ts +1433 -0
- package/dist/types/resources/linkTrees.d.ts +142 -30
- package/dist/types/resources/media.d.ts +351 -0
- package/dist/types/resources/movies/addons.d.ts +388 -0
- package/dist/types/resources/movies/collections.d.ts +352 -0
- package/dist/types/resources/movies/index.d.ts +29 -0
- package/dist/types/resources/movies/types.d.ts +50 -0
- package/dist/types/resources/movies/watchProgress.d.ts +277 -0
- package/dist/types/resources/movies.d.ts +1160 -0
- package/dist/types/resources/music/artists.d.ts +1068 -0
- package/dist/types/resources/music/imports.d.ts +941 -0
- package/dist/types/resources/music/index.d.ts +61 -0
- package/dist/types/resources/music/playlists.d.ts +1027 -0
- package/dist/types/resources/music/social.d.ts +1132 -0
- package/dist/types/resources/music/songs.d.ts +1167 -0
- package/dist/types/resources/notepads.d.ts +4 -1
- package/dist/types/resources/quotas.d.ts +7 -1
- package/dist/types/resources/realtime.d.ts +855 -0
- package/dist/types/resources/shortLinks.d.ts +49 -5
- package/dist/types/resources/social/groupChats.d.ts +458 -0
- package/dist/types/resources/social/index.d.ts +19 -0
- package/dist/types/resources/social/messages.d.ts +424 -0
- package/dist/types/resources/social/relationships.d.ts +322 -0
- package/dist/types/resources/social/types.d.ts +37 -0
- package/dist/types/resources/social.d.ts +1348 -0
- package/dist/types/resources/storage/upload.d.ts +158 -11
- package/dist/types/resources/storage.d.ts +111 -27
- package/dist/types/resources/tickets.d.ts +101 -13
- package/dist/types/resources/tools/backgroundRemoval.d.ts +18 -3
- package/dist/types/resources/tools/captions.d.ts +448 -21
- package/dist/types/resources/tools/downloader.d.ts +21 -0
- package/dist/types/resources/tools/index.d.ts +57 -15
- package/dist/types/resources/tools/jumpstyle.d.ts +50 -17
- package/dist/types/resources/tools/transcription.d.ts +35 -13
- package/dist/types/resources/tools/upscale.d.ts +23 -3
- package/dist/types/resources/tools/vocalSeparation.d.ts +30 -13
- package/dist/types/types.d.ts +249 -17
- package/package.json +2 -1
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
/** The `movies.addons` area: installed Stremio addons, the groups that file them and the grants that share them. */
|
|
2
|
+
import type { ApiClient } from "../../http";
|
|
3
|
+
import { Resource } from "../../http";
|
|
4
|
+
import type { ListParams } from "../../listing";
|
|
5
|
+
import type { BaseRecord, Id, Paginated, RequestOptions } from "../../types";
|
|
6
|
+
import type { User } from "../account";
|
|
7
|
+
import type { StremioManifest } from "./types";
|
|
8
|
+
/**
|
|
9
|
+
* An installed addon: a manifest URL plus the manifest fetched from it.
|
|
10
|
+
*
|
|
11
|
+
* Rows reach a caller two ways, and {@link MovieAddon.shared} is how you tell
|
|
12
|
+
* them apart: the ones the caller installed, and the ones somebody granted
|
|
13
|
+
* them (directly, or through a group). A shared addon is read-only in
|
|
14
|
+
* practice - every write against one is a `401`.
|
|
15
|
+
*/
|
|
16
|
+
export interface MovieAddon extends BaseRecord {
|
|
17
|
+
/** Owner. Compare against your own id, or just read {@link shared}. */
|
|
18
|
+
readonly user_id: Id;
|
|
19
|
+
/** Group the owner filed it under, or `null` when it is ungrouped. */
|
|
20
|
+
readonly movie_addon_group_id: Id | null;
|
|
21
|
+
/** Where the manifest was fetched from. Unique per owner. */
|
|
22
|
+
readonly manifest_url: string;
|
|
23
|
+
/** The manifest itself, stored verbatim. */
|
|
24
|
+
readonly manifest_json: StremioManifest;
|
|
25
|
+
/**
|
|
26
|
+
* `true` when this row belongs to somebody else and reached you through a
|
|
27
|
+
* grant. Computed against the CALLER, so the same row is `false` for its
|
|
28
|
+
* owner and `true` for everyone it is shared with - never cache it across
|
|
29
|
+
* identities.
|
|
30
|
+
*/
|
|
31
|
+
readonly shared: boolean;
|
|
32
|
+
}
|
|
33
|
+
/** Arguments for {@link MovieAddonsNamespace.create}. */
|
|
34
|
+
export interface CreateMovieAddonInput {
|
|
35
|
+
/**
|
|
36
|
+
* Absolute `http`/`https` URL of the manifest. Anything else is
|
|
37
|
+
* `400 "Manifest url must be a valid URL"`.
|
|
38
|
+
*/
|
|
39
|
+
readonly manifest_url: string;
|
|
40
|
+
/**
|
|
41
|
+
* The fetched manifest. Required: both a missing value and `{}` are
|
|
42
|
+
* rejected, so an addon whose manifest failed to download cannot be stored
|
|
43
|
+
* as a placeholder.
|
|
44
|
+
*/
|
|
45
|
+
readonly manifest_json: StremioManifest;
|
|
46
|
+
/**
|
|
47
|
+
* Group to file it under. The group must belong to the SAME user, or the
|
|
48
|
+
* save fails with `400 "Movie addon group must belong to addon owner"`.
|
|
49
|
+
*/
|
|
50
|
+
readonly movie_addon_group_id?: Id | null;
|
|
51
|
+
}
|
|
52
|
+
/** Arguments for {@link MovieAddonsNamespace.update}. Every field is optional; omitted ones are left alone. */
|
|
53
|
+
export interface UpdateMovieAddonInput {
|
|
54
|
+
/** A replacement manifest. Must be a non-empty object. */
|
|
55
|
+
readonly manifest_json?: StremioManifest;
|
|
56
|
+
/** `null` un-groups the addon. Omitting the key leaves the group alone. */
|
|
57
|
+
readonly movie_addon_group_id?: Id | null;
|
|
58
|
+
/**
|
|
59
|
+
* Only if you really are re-pointing the addon. Changing it can collide with
|
|
60
|
+
* the `(user_id, manifest_url)` unique index, which surfaces as
|
|
61
|
+
* `400 "Manifest url has already been taken"`.
|
|
62
|
+
*/
|
|
63
|
+
readonly manifest_url?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Filters for {@link MovieAddonsNamespace.list}.
|
|
67
|
+
*
|
|
68
|
+
* The server's allowlist for this index is exactly `user_id`, `id`,
|
|
69
|
+
* `created_at` and `updated_at`. Any other filter key is
|
|
70
|
+
* `400 "Unknown search filter: ..."` - filters fail closed rather than widening
|
|
71
|
+
* the query - so there is deliberately no way to list by
|
|
72
|
+
* `movie_addon_group_id`. Group client-side off the field on each row.
|
|
73
|
+
*/
|
|
74
|
+
export interface ListMovieAddonsParams extends ListParams<(typeof MOVIE_ADDON_FILTER_COLUMNS)[number]> {
|
|
75
|
+
/** Exact match. Use it to split your own addons from the shared ones. */
|
|
76
|
+
readonly userId?: Id;
|
|
77
|
+
/** Exact match on the primary key. */
|
|
78
|
+
readonly id?: Id;
|
|
79
|
+
}
|
|
80
|
+
/** Filter columns of `GET /movie_addons`, on top of {@link BASE_FILTER_COLUMNS}. */
|
|
81
|
+
export declare const MOVIE_ADDON_FILTER_COLUMNS: readonly ["user_id"];
|
|
82
|
+
/** Arguments for {@link MovieAddonGroupsNamespace.create}. */
|
|
83
|
+
export interface CreateMovieAddonGroupInput {
|
|
84
|
+
/** Required, at most {@link MOVIE_ADDON_GROUP_NAME_MAX_LENGTH} characters. */
|
|
85
|
+
readonly name: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* A named folder for addons, owned by one user.
|
|
89
|
+
*
|
|
90
|
+
* A group is also a sharing unit: granting a group shares every addon inside
|
|
91
|
+
* it, including ones added later, which is the whole reason groups exist.
|
|
92
|
+
*/
|
|
93
|
+
export interface MovieAddonGroup extends BaseRecord {
|
|
94
|
+
readonly user_id: Id;
|
|
95
|
+
readonly name: string;
|
|
96
|
+
}
|
|
97
|
+
/** Filters for {@link MovieAddonGroupsNamespace.list}. */
|
|
98
|
+
export interface ListMovieAddonGroupsParams extends ListParams<never> {
|
|
99
|
+
/** Exact match on the primary key. The only filter this index allows. */
|
|
100
|
+
readonly id?: Id;
|
|
101
|
+
}
|
|
102
|
+
/** `GET /movie_addon_groups` filters on {@link BASE_FILTER_COLUMNS} only. */
|
|
103
|
+
export declare const MOVIE_ADDON_GROUP_FILTER_COLUMNS: readonly [];
|
|
104
|
+
/**
|
|
105
|
+
* A share: one addon, or one whole group, handed to one other user.
|
|
106
|
+
*
|
|
107
|
+
* Exactly one of `movie_addon_id` and `movie_addon_group_id` is set; the other
|
|
108
|
+
* is `null`. A database check constraint enforces it as well as the model, so
|
|
109
|
+
* there is no path to a row with both or neither.
|
|
110
|
+
*/
|
|
111
|
+
export interface MovieAddonGrant extends BaseRecord {
|
|
112
|
+
/** Set when this grant targets a single addon. */
|
|
113
|
+
readonly movie_addon_id: Id | null;
|
|
114
|
+
/** Set when this grant targets a whole group. */
|
|
115
|
+
readonly movie_addon_group_id: Id | null;
|
|
116
|
+
/** Who shared. Always the caller for a grant you created. */
|
|
117
|
+
readonly grantor_id: Id;
|
|
118
|
+
/** Who received. */
|
|
119
|
+
readonly grantee_id: Id;
|
|
120
|
+
/**
|
|
121
|
+
* The grantee, rendered as a full user.
|
|
122
|
+
*
|
|
123
|
+
* It is a full {@link User} as the account endpoints render one for the
|
|
124
|
+
* caller - so `bio`, `country_code`, the `library_*` fields and the
|
|
125
|
+
* visibility flags all come along, and `email` / `gender` / `group` appear
|
|
126
|
+
* or not depending on who is asking.
|
|
127
|
+
*
|
|
128
|
+
* There is no matching `grantor` field: you only ever see grants you made or
|
|
129
|
+
* received, so the other side is either you or the grantee.
|
|
130
|
+
*/
|
|
131
|
+
readonly grantee: User;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Arguments for {@link MovieAddonGrantsNamespace.create}.
|
|
135
|
+
*
|
|
136
|
+
* Pass exactly one target. Both or neither is
|
|
137
|
+
* `400 "Grant must target one addon or one group"`.
|
|
138
|
+
*/
|
|
139
|
+
export interface CreateMovieAddonGrantInput {
|
|
140
|
+
/** Share one addon. Mutually exclusive with {@link movie_addon_group_id}. */
|
|
141
|
+
readonly movie_addon_id?: Id | null;
|
|
142
|
+
/** Share a whole group, present and future contents. */
|
|
143
|
+
readonly movie_addon_group_id?: Id | null;
|
|
144
|
+
/** Who to share with. Must not be yourself. */
|
|
145
|
+
readonly grantee_id: Id;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Filters for {@link MovieAddonGrantsNamespace.list}.
|
|
149
|
+
*
|
|
150
|
+
* The allowlist here is only the default: `id`, `created_at`, `updated_at`.
|
|
151
|
+
* You CANNOT ask the server for "grants I made" versus "grants I received",
|
|
152
|
+
* nor for the grants on one addon - those are `400`s. Filter on `grantor_id`
|
|
153
|
+
* / `grantee_id` / `movie_addon_id` client-side after listing.
|
|
154
|
+
*/
|
|
155
|
+
export interface ListMovieAddonGrantsParams extends ListParams<never> {
|
|
156
|
+
/** Exact match on the primary key. */
|
|
157
|
+
readonly id?: Id;
|
|
158
|
+
}
|
|
159
|
+
/** `GET /movie_addon_grants` filters on {@link BASE_FILTER_COLUMNS} only. */
|
|
160
|
+
export declare const MOVIE_ADDON_GRANT_FILTER_COLUMNS: readonly [];
|
|
161
|
+
/** Longest name `MovieAddonGroup` accepts. Over it is a `400`. */
|
|
162
|
+
export declare const MOVIE_ADDON_GROUP_NAME_MAX_LENGTH = 80;
|
|
163
|
+
/**
|
|
164
|
+
* The `movies.addons.groups` namespace: named folders of addons, which double
|
|
165
|
+
* as sharing units.
|
|
166
|
+
*
|
|
167
|
+
* There is no `show` route. Read one out of {@link list}.
|
|
168
|
+
*/
|
|
169
|
+
export declare class MovieAddonGroupsNamespace extends Resource {
|
|
170
|
+
/**
|
|
171
|
+
* `GET /movie_addon_groups` - the caller's own groups.
|
|
172
|
+
*
|
|
173
|
+
* A group somebody shared with you never appears here even though its
|
|
174
|
+
* addons do. The shared addons arrive from {@link MovieAddonsNamespace.list}
|
|
175
|
+
* carrying a `movie_addon_group_id` you cannot resolve; render them under a
|
|
176
|
+
* single "shared with me" heading rather than trying to look the group up.
|
|
177
|
+
*
|
|
178
|
+
* The relation has NO order of its own, so pass `order` (typically
|
|
179
|
+
* `"name:asc"` or `"created_at:desc"`) - paging an unordered relation can
|
|
180
|
+
* repeat and drop rows.
|
|
181
|
+
*
|
|
182
|
+
* @throws {OmsApiError} 401 for an anonymous caller, 403 for an OAuth token.
|
|
183
|
+
* @throws {OmsApiError} 400 `"Unknown search filter: ..."` for any filter
|
|
184
|
+
* beyond `id`, `created_at` and `updated_at`.
|
|
185
|
+
*/
|
|
186
|
+
list(params?: ListMovieAddonGroupsParams, options?: RequestOptions): Promise<Paginated<MovieAddonGroup>>;
|
|
187
|
+
/**
|
|
188
|
+
* `POST /movie_addon_groups` - creates a group owned by the caller. `201`.
|
|
189
|
+
*
|
|
190
|
+
* `name` is the only writable field; the owner is always the caller, so
|
|
191
|
+
* there is no way to create one for somebody else.
|
|
192
|
+
*
|
|
193
|
+
* Names are NOT unique: two groups called "Filmes" are allowed and will look
|
|
194
|
+
* identical in a picker. De-duplicate client-side if that matters.
|
|
195
|
+
*
|
|
196
|
+
* @throws {OmsApiError} 400 `"Name can't be blank"` or
|
|
197
|
+
* `"Name is too long (maximum is 80 characters)"`.
|
|
198
|
+
*/
|
|
199
|
+
create(input: CreateMovieAddonGroupInput | string, options?: RequestOptions): Promise<MovieAddonGroup>;
|
|
200
|
+
/**
|
|
201
|
+
* `PATCH /movie_addon_groups/:id` - renames a group. `200`.
|
|
202
|
+
*
|
|
203
|
+
* Unlike its sibling {@link MovieAddonsNamespace.update}, this one is a real
|
|
204
|
+
* partial update: `name` is the only key accepted and nothing is assigned
|
|
205
|
+
* behind your back.
|
|
206
|
+
*
|
|
207
|
+
* @throws {OmsApiError} 404 `"Resource not found"` for an id that is not
|
|
208
|
+
* yours - ownership is applied by the lookup scope, so somebody else's
|
|
209
|
+
* group is indistinguishable from a group that does not exist.
|
|
210
|
+
*/
|
|
211
|
+
update(id: Id, name: string, options?: RequestOptions): Promise<MovieAddonGroup>;
|
|
212
|
+
/**
|
|
213
|
+
* `DELETE /movie_addon_groups/:id` - `204`, empty body.
|
|
214
|
+
*
|
|
215
|
+
* Two different cascades, and only one of them destroys anything:
|
|
216
|
+
*
|
|
217
|
+
* - the addons inside SURVIVE and become ungrouped;
|
|
218
|
+
* - every share made through this group is revoked. People who could see
|
|
219
|
+
* those addons stop seeing them, with no notification. Direct grants on
|
|
220
|
+
* the individual addons are untouched.
|
|
221
|
+
*
|
|
222
|
+
* @throws {OmsApiError} 404 for an id that is not yours.
|
|
223
|
+
*/
|
|
224
|
+
delete(id: Id, options?: RequestOptions): Promise<void>;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* The `movies.addons.grants` namespace: sharing an addon, or a whole group,
|
|
228
|
+
* with one other user.
|
|
229
|
+
*
|
|
230
|
+
* Grants are create-and-delete only; there is no update route and no `show`.
|
|
231
|
+
* To change who can see what, delete the grant and make a new one.
|
|
232
|
+
*/
|
|
233
|
+
export declare class MovieAddonGrantsNamespace extends Resource {
|
|
234
|
+
/**
|
|
235
|
+
* `GET /movie_addon_grants` - every grant the caller made OR received.
|
|
236
|
+
*
|
|
237
|
+
* Both directions come back in one undifferentiated list and the index
|
|
238
|
+
* accepts no filter to separate them, so split on `grantor_id === myUserId`
|
|
239
|
+
* yourself.
|
|
240
|
+
*
|
|
241
|
+
* The relation has no order of its own; pass `order: "created_at:desc"`.
|
|
242
|
+
*
|
|
243
|
+
* @throws {OmsApiError} 400 `"Unknown search filter: ..."` for anything
|
|
244
|
+
* beyond `id`, `created_at` and `updated_at`. See
|
|
245
|
+
* {@link ListMovieAddonGrantsParams}.
|
|
246
|
+
*/
|
|
247
|
+
list(params?: ListMovieAddonGrantsParams, options?: RequestOptions): Promise<Paginated<MovieAddonGrant>>;
|
|
248
|
+
/**
|
|
249
|
+
* `POST /movie_addon_grants` - shares one addon, or one group, with one user.
|
|
250
|
+
* `201`.
|
|
251
|
+
*
|
|
252
|
+
* The grantor is always the caller, so there is no way to make a grant in
|
|
253
|
+
* somebody else's name.
|
|
254
|
+
*
|
|
255
|
+
* ## Failure modes, and which status each one is
|
|
256
|
+
*
|
|
257
|
+
* - **both targets, or neither** - `400 "Grant must target one addon or one
|
|
258
|
+
* group"`. Caught here before the request goes out.
|
|
259
|
+
* - **a target you do not own, or granting to YOURSELF** - `401 "You are not
|
|
260
|
+
* authorized to create this resource"`. Not a `400` and not a `403`: the
|
|
261
|
+
* ownership check runs as an authorisation step, so a business-rule
|
|
262
|
+
* violation comes back wearing an authentication status. A generic error
|
|
263
|
+
* handler that logs the user out on `401` will do exactly that here.
|
|
264
|
+
* - **granting the same target to the same person twice** - this is the one
|
|
265
|
+
* to be careful with. There is a partial unique index on
|
|
266
|
+
* `(movie_addon_id, grantee_id)` and another on
|
|
267
|
+
* `(movie_addon_group_id, grantee_id)`, and nothing checks them before the
|
|
268
|
+
* write, so the duplicate is not a tidy `400`: it answers **500**. List
|
|
269
|
+
* the existing grants and check before you create, and do not put this call
|
|
270
|
+
* behind a blind retry.
|
|
271
|
+
*
|
|
272
|
+
* Retries are off by default for a POST anyway (the transport only replays
|
|
273
|
+
* safe methods unless you opt in); do not opt in here.
|
|
274
|
+
*
|
|
275
|
+
* @throws {OmsError} `invalid_request` when the target count is not exactly
|
|
276
|
+
* one, or `grantee_id` is blank.
|
|
277
|
+
*/
|
|
278
|
+
create(input: CreateMovieAddonGrantInput, options?: RequestOptions): Promise<MovieAddonGrant>;
|
|
279
|
+
/**
|
|
280
|
+
* `DELETE /movie_addon_grants/:id` - revokes a share. `204`, empty body.
|
|
281
|
+
*
|
|
282
|
+
* Only the GRANTOR may revoke. The grantee can see the grant in
|
|
283
|
+
* {@link list} but deleting it is
|
|
284
|
+
* `401 "You are not authorized to destroy this resource"` - there is no
|
|
285
|
+
* "leave this share" for the receiving side.
|
|
286
|
+
*
|
|
287
|
+
* @throws {OmsApiError} 404 for a grant that is neither yours nor shared
|
|
288
|
+
* with you, 401 when you are the grantee rather than the grantor.
|
|
289
|
+
*/
|
|
290
|
+
delete(id: Id, options?: RequestOptions): Promise<void>;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* The `movies.addons` namespace: installed Stremio addons, plus the groups and
|
|
294
|
+
* grants that share them.
|
|
295
|
+
*
|
|
296
|
+
* There is no `show` route on `/movie_addons`; {@link list} is how you read
|
|
297
|
+
* one.
|
|
298
|
+
*/
|
|
299
|
+
export declare class MovieAddonsNamespace extends Resource {
|
|
300
|
+
/** Named folders of addons, which are also the unit of sharing. */
|
|
301
|
+
readonly groups: MovieAddonGroupsNamespace;
|
|
302
|
+
/** Shares of an addon or a group with another user. */
|
|
303
|
+
readonly grants: MovieAddonGrantsNamespace;
|
|
304
|
+
constructor(http: ApiClient);
|
|
305
|
+
/**
|
|
306
|
+
* `GET /movie_addons` - the caller's addons AND every addon shared with them.
|
|
307
|
+
*
|
|
308
|
+
* The result is a three-way `OR`: rows you own, rows granted to you
|
|
309
|
+
* directly, and rows whose group was granted to you. That last arm is why a
|
|
310
|
+
* grant on a group covers addons added to it later. An addon shared both
|
|
311
|
+
* ways still appears once.
|
|
312
|
+
*
|
|
313
|
+
* Read {@link MovieAddon.shared} to tell the two kinds apart. Everything is
|
|
314
|
+
* read-only for a shared row.
|
|
315
|
+
*
|
|
316
|
+
* The relation has NO default order. Always pass `order` - `"created_at:desc"`
|
|
317
|
+
* gives "most recently installed first" - because paging an unordered
|
|
318
|
+
* Postgres relation can repeat and drop rows between pages.
|
|
319
|
+
*
|
|
320
|
+
* **Array filters are silently ignored on this index.** `id` given as an
|
|
321
|
+
* array is dropped without a `400` and you get the UNFILTERED list back. The
|
|
322
|
+
* SDK only accepts a scalar for that reason. Unknown filter KEYS do fail
|
|
323
|
+
* closed with a `400`.
|
|
324
|
+
*
|
|
325
|
+
* This index emits an `ETag` and can answer `304`. Do not hand-write an
|
|
326
|
+
* `If-None-Match` header: the transport treats a bare `304` as a failure.
|
|
327
|
+
*
|
|
328
|
+
* @throws {OmsApiError} 401 for an anonymous caller, 403 for an OAuth token.
|
|
329
|
+
*/
|
|
330
|
+
list(params?: ListMovieAddonsParams, options?: RequestOptions): Promise<Paginated<MovieAddon>>;
|
|
331
|
+
/**
|
|
332
|
+
* `POST /movie_addons` - installs an addon, or re-installs one you already
|
|
333
|
+
* have. **`201` either way.**
|
|
334
|
+
*
|
|
335
|
+
* Posting a manifest URL you already installed UPDATES that row - refreshing
|
|
336
|
+
* `manifest_json` and reassigning `movie_addon_group_id` - instead of
|
|
337
|
+
* colliding with the `(user_id, manifest_url)` unique index. The status
|
|
338
|
+
* stays `201` and the `id` comes back unchanged, so `201` here does not mean
|
|
339
|
+
* "new row"; compare `created_at` if you need to know.
|
|
340
|
+
*
|
|
341
|
+
* The practical consequence is the good one: reinstalling is idempotent and
|
|
342
|
+
* the app can re-post its whole addon list on boot. The trap is the other
|
|
343
|
+
* side of it - re-posting with `movie_addon_group_id` omitted leaves the
|
|
344
|
+
* group as it was (the key is only assigned when present), while re-posting
|
|
345
|
+
* it as `null` clears the group.
|
|
346
|
+
*
|
|
347
|
+
* `manifest_json` is stored as sent: no key is validated, no key is
|
|
348
|
+
* stripped, and whatever you send is what everyone the addon is shared with
|
|
349
|
+
* will later render. Fetch the manifest yourself and do not forward one a
|
|
350
|
+
* third party handed you unchecked.
|
|
351
|
+
*
|
|
352
|
+
* @throws {OmsApiError} 400 `"Manifest url must be a valid URL"`,
|
|
353
|
+
* `"Manifest json can't be blank"` (an empty object counts as blank), or
|
|
354
|
+
* `"Movie addon group must belong to addon owner"`.
|
|
355
|
+
*/
|
|
356
|
+
create(input: CreateMovieAddonInput, options?: RequestOptions): Promise<MovieAddon>;
|
|
357
|
+
/**
|
|
358
|
+
* `PATCH /movie_addons/:id` - `200`. A partial update: omitted fields are
|
|
359
|
+
* left alone. Only the owner may update; a shared row is `401`.
|
|
360
|
+
*
|
|
361
|
+
* @throws {OmsError} `invalid_request` when `manifest_json` is given but empty.
|
|
362
|
+
* @throws {OmsApiError} 404 for an id you cannot see, 401 for one you can see
|
|
363
|
+
* but do not own.
|
|
364
|
+
*/
|
|
365
|
+
update(id: Id, input: UpdateMovieAddonInput, options?: RequestOptions): Promise<MovieAddon>;
|
|
366
|
+
/**
|
|
367
|
+
* Files an addon under a group, or un-groups it with `null`.
|
|
368
|
+
*
|
|
369
|
+
* Refuses a shared addon before the round trip: the server would answer
|
|
370
|
+
* `401`, and the message here says why.
|
|
371
|
+
*
|
|
372
|
+
* @throws {OmsError} `invalid_request` for an addon whose `shared` flag is set.
|
|
373
|
+
*/
|
|
374
|
+
moveToGroup(addon: MovieAddon, groupId: Id | null, options?: RequestOptions): Promise<MovieAddon>;
|
|
375
|
+
/**
|
|
376
|
+
* `DELETE /movie_addons/:id` - uninstalls. `204`, empty body.
|
|
377
|
+
*
|
|
378
|
+
* Owner only; uninstalling an addon somebody shared with you is `401`, and
|
|
379
|
+
* the way to lose one of those is for the grantor to revoke the grant.
|
|
380
|
+
*
|
|
381
|
+
* Deleting it revokes every grant ON this addon along with it. Grants that
|
|
382
|
+
* reached people through its GROUP are untouched - they belong to the group,
|
|
383
|
+
* which still exists.
|
|
384
|
+
*
|
|
385
|
+
* @throws {OmsApiError} 404 for an id you cannot see, 401 for a shared one.
|
|
386
|
+
*/
|
|
387
|
+
delete(id: Id, options?: RequestOptions): Promise<void>;
|
|
388
|
+
}
|