@learnorama/mozaik-sdk 0.10.0-staging.41.1 → 0.12.0-staging.43.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.
- package/dist/api/account.d.ts +7 -1
- package/dist/api/account.js +6 -0
- package/dist/api/account.js.map +1 -1
- package/dist/api/admin-catalogue.d.ts +1 -1
- package/dist/api/admin-catalogue.js.map +1 -1
- package/dist/api/admin-consumption.d.ts +1 -1
- package/dist/api/admin-consumption.js.map +1 -1
- package/dist/api/admin-contracts.d.ts +46 -0
- package/dist/api/admin-contracts.js +121 -0
- package/dist/api/admin-contracts.js.map +1 -0
- package/dist/api/admin-desk.d.ts +1 -1
- package/dist/api/admin-desk.js.map +1 -1
- package/dist/api/admin-licenses.d.ts +1 -1
- package/dist/api/admin-licenses.js.map +1 -1
- package/dist/api/admin-partner-selections.d.ts +137 -0
- package/dist/api/admin-partner-selections.js +279 -0
- package/dist/api/admin-partner-selections.js.map +1 -0
- package/dist/api/admin-patrons.d.ts +1 -1
- package/dist/api/admin-patrons.js.map +1 -1
- package/dist/api/admin-reviews.d.ts +1 -1
- package/dist/api/admin-reviews.js.map +1 -1
- package/dist/api/admin-roles.d.ts +1 -1
- package/dist/api/admin-roles.js.map +1 -1
- package/dist/api/admin-support.d.ts +1 -1
- package/dist/api/admin-support.js.map +1 -1
- package/dist/api/admin-tenants.d.ts +1 -1
- package/dist/api/admin-tenants.js.map +1 -1
- package/dist/api/admin-tutoring.d.ts +1 -1
- package/dist/api/admin-tutoring.js.map +1 -1
- package/dist/api/auth.d.ts +1 -1
- package/dist/api/auth.js.map +1 -1
- package/dist/api/biblio-catalogue.d.ts +1 -1
- package/dist/api/biblio-catalogue.js.map +1 -1
- package/dist/api/biblio-home.d.ts +1 -1
- package/dist/api/biblio-home.js.map +1 -1
- package/dist/api/biblio-library.d.ts +1 -1
- package/dist/api/biblio-library.js.map +1 -1
- package/dist/api/biblio-nextory.d.ts +1 -1
- package/dist/api/biblio-nextory.js.map +1 -1
- package/dist/api/biblio-press.d.ts +1 -1
- package/dist/api/biblio-press.js.map +1 -1
- package/dist/api/biblio-search.d.ts +1 -1
- package/dist/api/biblio-search.js.map +1 -1
- package/dist/api/biblio-telemetry.d.ts +1 -1
- package/dist/api/biblio-telemetry.js.map +1 -1
- package/dist/api/consumption.d.ts +1 -1
- package/dist/api/consumption.js.map +1 -1
- package/dist/api/cvs-app.d.ts +1 -1
- package/dist/api/cvs-app.js.map +1 -1
- package/dist/api/cvs-documents.d.ts +1 -1
- package/dist/api/cvs-documents.js.map +1 -1
- package/dist/api/cvs-favorites.d.ts +1 -1
- package/dist/api/cvs-favorites.js.map +1 -1
- package/dist/api/cvs-ils.d.ts +1 -1
- package/dist/api/cvs-ils.js.map +1 -1
- package/dist/api/cvs-loans.d.ts +1 -1
- package/dist/api/cvs-loans.js.map +1 -1
- package/dist/api/cvs-payments.d.ts +1 -1
- package/dist/api/cvs-payments.js.map +1 -1
- package/dist/api/cvs-streaming.js.map +1 -1
- package/dist/api/index.d.ts +4 -2
- package/dist/api/index.js +4 -2
- package/dist/api/partner-catalogue.d.ts +43 -1
- package/dist/api/partner-catalogue.js +67 -1
- package/dist/api/partner-catalogue.js.map +1 -1
- package/dist/api/partner-reader.d.ts +1 -1
- package/dist/api/partner-reader.js.map +1 -1
- package/dist/api/profiles.d.ts +1 -1
- package/dist/api/profiles.js.map +1 -1
- package/dist/api/search.d.ts +1 -1
- package/dist/api/search.js.map +1 -1
- package/dist/api/tutoring-catalogue.d.ts +1 -1
- package/dist/api/tutoring-catalogue.js.map +1 -1
- package/dist/api/tutoring-chat.d.ts +1 -1
- package/dist/api/tutoring-chat.js.map +1 -1
- package/dist/api/tutoring-dispatch.d.ts +1 -1
- package/dist/api/tutoring-dispatch.js.map +1 -1
- package/dist/api/tutoring-practitioner.js.map +1 -1
- package/dist/api/tutoring-requests.d.ts +1 -1
- package/dist/api/tutoring-requests.js.map +1 -1
- package/dist/chunks/client2.d.ts +1 -1
- package/dist/chunks/connection.d.ts +1 -1
- package/dist/chunks/index.d.ts +625 -309
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +2 -2
- package/dist/models.js +4 -1
- package/dist/models.js.map +1 -1
- package/dist/react/account.d.ts +7 -1
- package/dist/react/account.js +7 -1
- package/dist/react/account.js.map +1 -1
- package/dist/react/admin-catalogue.d.ts +1 -1
- package/dist/react/admin-catalogue.js +1 -1
- package/dist/react/admin-catalogue.js.map +1 -1
- package/dist/react/admin-consumption.d.ts +1 -1
- package/dist/react/admin-consumption.js +1 -1
- package/dist/react/admin-consumption.js.map +1 -1
- package/dist/react/admin-contracts.d.ts +142 -0
- package/dist/react/admin-contracts.js +269 -0
- package/dist/react/admin-contracts.js.map +1 -0
- package/dist/react/admin-desk.d.ts +1 -1
- package/dist/react/admin-desk.js +1 -1
- package/dist/react/admin-desk.js.map +1 -1
- package/dist/react/admin-licenses.d.ts +1 -1
- package/dist/react/admin-licenses.js +1 -1
- package/dist/react/admin-licenses.js.map +1 -1
- package/dist/react/admin-partner-selections.d.ts +393 -0
- package/dist/react/admin-partner-selections.js +626 -0
- package/dist/react/admin-partner-selections.js.map +1 -0
- package/dist/react/admin-patrons.d.ts +1 -1
- package/dist/react/admin-patrons.js +1 -1
- package/dist/react/admin-patrons.js.map +1 -1
- package/dist/react/admin-reviews.d.ts +1 -1
- package/dist/react/admin-reviews.js +1 -1
- package/dist/react/admin-reviews.js.map +1 -1
- package/dist/react/admin-roles.d.ts +1 -1
- package/dist/react/admin-roles.js +1 -1
- package/dist/react/admin-roles.js.map +1 -1
- package/dist/react/admin-support.d.ts +1 -1
- package/dist/react/admin-support.js +1 -1
- package/dist/react/admin-support.js.map +1 -1
- package/dist/react/admin-tenants.d.ts +1 -1
- package/dist/react/admin-tenants.js +1 -1
- package/dist/react/admin-tenants.js.map +1 -1
- package/dist/react/admin-tutoring.d.ts +1 -1
- package/dist/react/admin-tutoring.js +1 -1
- package/dist/react/admin-tutoring.js.map +1 -1
- package/dist/react/auth.d.ts +1 -1
- package/dist/react/auth.js +1 -1
- package/dist/react/auth.js.map +1 -1
- package/dist/react/biblio-catalogue.d.ts +1 -1
- package/dist/react/biblio-catalogue.js +1 -1
- package/dist/react/biblio-catalogue.js.map +1 -1
- package/dist/react/biblio-home.d.ts +1 -1
- package/dist/react/biblio-home.js +1 -1
- package/dist/react/biblio-home.js.map +1 -1
- package/dist/react/biblio-library.d.ts +1 -1
- package/dist/react/biblio-library.js +1 -1
- package/dist/react/biblio-library.js.map +1 -1
- package/dist/react/biblio-nextory.d.ts +1 -1
- package/dist/react/biblio-nextory.js +1 -1
- package/dist/react/biblio-nextory.js.map +1 -1
- package/dist/react/biblio-press.d.ts +1 -1
- package/dist/react/biblio-press.js +1 -1
- package/dist/react/biblio-press.js.map +1 -1
- package/dist/react/biblio-search.d.ts +1 -1
- package/dist/react/biblio-search.js +1 -1
- package/dist/react/biblio-search.js.map +1 -1
- package/dist/react/biblio-telemetry.d.ts +1 -1
- package/dist/react/biblio-telemetry.js +1 -1
- package/dist/react/biblio-telemetry.js.map +1 -1
- package/dist/react/chat.d.ts +1 -1
- package/dist/react/consumption.d.ts +1 -1
- package/dist/react/consumption.js +1 -1
- package/dist/react/consumption.js.map +1 -1
- package/dist/react/cvs-app.d.ts +1 -1
- package/dist/react/cvs-app.js +1 -1
- package/dist/react/cvs-app.js.map +1 -1
- package/dist/react/cvs-documents.d.ts +1 -1
- package/dist/react/cvs-documents.js +1 -1
- package/dist/react/cvs-documents.js.map +1 -1
- package/dist/react/cvs-favorites.d.ts +1 -1
- package/dist/react/cvs-favorites.js +1 -1
- package/dist/react/cvs-favorites.js.map +1 -1
- package/dist/react/cvs-ils.d.ts +1 -1
- package/dist/react/cvs-ils.js +1 -1
- package/dist/react/cvs-ils.js.map +1 -1
- package/dist/react/cvs-loans.d.ts +1 -1
- package/dist/react/cvs-loans.js +1 -1
- package/dist/react/cvs-loans.js.map +1 -1
- package/dist/react/cvs-payments.d.ts +1 -1
- package/dist/react/cvs-payments.js +1 -1
- package/dist/react/cvs-payments.js.map +1 -1
- package/dist/react/cvs-streaming.d.ts +1 -1
- package/dist/react/cvs-streaming.js +1 -1
- package/dist/react/cvs-streaming.js.map +1 -1
- package/dist/react/index.d.ts +4 -2
- package/dist/react/index.js +4 -2
- package/dist/react/partner-catalogue.d.ts +97 -1
- package/dist/react/partner-catalogue.js +118 -2
- package/dist/react/partner-catalogue.js.map +1 -1
- package/dist/react/partner-reader.d.ts +1 -1
- package/dist/react/partner-reader.js +1 -1
- package/dist/react/partner-reader.js.map +1 -1
- package/dist/react/profiles.d.ts +1 -1
- package/dist/react/profiles.js +1 -1
- package/dist/react/profiles.js.map +1 -1
- package/dist/react/search.d.ts +1 -1
- package/dist/react/search.js +1 -1
- package/dist/react/search.js.map +1 -1
- package/dist/react/tutoring-catalogue.d.ts +1 -1
- package/dist/react/tutoring-catalogue.js +1 -1
- package/dist/react/tutoring-catalogue.js.map +1 -1
- package/dist/react/tutoring-chat.d.ts +1 -1
- package/dist/react/tutoring-chat.js +1 -1
- package/dist/react/tutoring-chat.js.map +1 -1
- package/dist/react/tutoring-dispatch.d.ts +1 -1
- package/dist/react/tutoring-dispatch.js +1 -1
- package/dist/react/tutoring-dispatch.js.map +1 -1
- package/dist/react/tutoring-practitioner.d.ts +1 -1
- package/dist/react/tutoring-practitioner.js +1 -1
- package/dist/react/tutoring-practitioner.js.map +1 -1
- package/dist/react/tutoring-requests.d.ts +1 -1
- package/dist/react/tutoring-requests.js +1 -1
- package/dist/react/tutoring-requests.js.map +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
|
|
2
|
+
import { $ as SelectionMediaOrderWrite, Q as SelectionOrderWrite, _l as AdminPartnerSelectionListRead, fl as AdminPartnerSelectionWrite, fo as PartnerProvider, pl as AdminPartnerSelectionMediaPage, rr as ListStaffSelectionMediaParams, vl as AdminPartnerSelectionRead, yl as AdminPartnerSelectionAmendWrite } from "../chunks/index.js";
|
|
3
|
+
import { c as request } from "../chunks/client.js";
|
|
4
|
+
//#region src/api/admin-partner-selections/admin-partner-selections.d.ts
|
|
5
|
+
export declare const getListStaffSelectionsUrl: (provider: PartnerProvider) => string;
|
|
6
|
+
/**
|
|
7
|
+
* Every band of this catalogue, drafts included.
|
|
8
|
+
*
|
|
9
|
+
* Unlike the reader's listing this applies no shelf or publication filter:
|
|
10
|
+
* seeing what exists is the whole point of the screen, and a draft nobody can
|
|
11
|
+
* find is a draft nobody can publish.
|
|
12
|
+
* @summary List Staff Selections
|
|
13
|
+
*/
|
|
14
|
+
export declare const listStaffSelections: (provider: PartnerProvider, options?: Parameters<typeof request>[1]) => Promise<AdminPartnerSelectionListRead>;
|
|
15
|
+
export declare const getCreateStaffSelectionUrl: (provider: PartnerProvider) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Add a band. It is a draft and stands on both shelves unless told otherwise.
|
|
18
|
+
*
|
|
19
|
+
* A draft by default because publishing is a decision somebody makes; both
|
|
20
|
+
* shelves by default because an audience nobody narrowed must not narrow
|
|
21
|
+
* itself.
|
|
22
|
+
* @summary Create Staff Selection
|
|
23
|
+
*/
|
|
24
|
+
export declare const createStaffSelection: (provider: PartnerProvider, adminPartnerSelectionWrite: AdminPartnerSelectionWrite, options?: Parameters<typeof request>[1]) => Promise<AdminPartnerSelectionRead>;
|
|
25
|
+
export declare const getReorderPageSelectionsUrl: (provider: PartnerProvider, page: string) => string;
|
|
26
|
+
/**
|
|
27
|
+
* Set the order of the bands on one page, whole, in one transaction.
|
|
28
|
+
*
|
|
29
|
+
* Per page rather than per band: a band appears on several and need not hold
|
|
30
|
+
* the same rank on each, which is why the rank lives on the placement.
|
|
31
|
+
* @summary Reorder Page Selections
|
|
32
|
+
*/
|
|
33
|
+
export declare const reorderPageSelections: (provider: PartnerProvider, page: string, selectionOrderWrite: SelectionOrderWrite, options?: Parameters<typeof request>[1]) => Promise<void>;
|
|
34
|
+
export declare const getDeleteStaffSelectionUrl: (provider: PartnerProvider, selectionId: number) => string;
|
|
35
|
+
/**
|
|
36
|
+
* Remove a band, its placements and its memberships.
|
|
37
|
+
*
|
|
38
|
+
* No ``409`` on a band that still holds titles: a membership is an editorial
|
|
39
|
+
* arrangement, not a reference anything else depends on, and the cascade takes
|
|
40
|
+
* it. The titles themselves belong to the catalogue and are untouched.
|
|
41
|
+
* @summary Delete Staff Selection
|
|
42
|
+
*/
|
|
43
|
+
export declare const deleteStaffSelection: (provider: PartnerProvider, selectionId: number, options?: Parameters<typeof request>[1]) => Promise<void>;
|
|
44
|
+
export declare const getReadStaffSelectionUrl: (provider: PartnerProvider, selectionId: number) => string;
|
|
45
|
+
/**
|
|
46
|
+
* @summary Read Staff Selection
|
|
47
|
+
*/
|
|
48
|
+
export declare const readStaffSelection: (provider: PartnerProvider, selectionId: number, options?: Parameters<typeof request>[1]) => Promise<AdminPartnerSelectionRead>;
|
|
49
|
+
export declare const getAmendStaffSelectionUrl: (provider: PartnerProvider, selectionId: number) => string;
|
|
50
|
+
/**
|
|
51
|
+
* Rename a band, publish it, or move it between shelves.
|
|
52
|
+
*
|
|
53
|
+
* The legacy has one route per field — ``rename`` and ``activate`` — which is
|
|
54
|
+
* two requests for what a screen submits as one form, and two chances to apply
|
|
55
|
+
* half of it. Omitted fields are left alone.
|
|
56
|
+
*
|
|
57
|
+
* The audience arrives whole or not at all, so unsetting one shelf cannot be
|
|
58
|
+
* confused with saying nothing about the other.
|
|
59
|
+
* @summary Amend Staff Selection
|
|
60
|
+
*/
|
|
61
|
+
export declare const amendStaffSelection: (provider: PartnerProvider, selectionId: number, adminPartnerSelectionAmendWrite: AdminPartnerSelectionAmendWrite, options?: Parameters<typeof request>[1]) => Promise<AdminPartnerSelectionRead>;
|
|
62
|
+
export declare const getListStaffSelectionMediaUrl: (provider: PartnerProvider, selectionId: number, params?: ListStaffSelectionMediaParams) => string;
|
|
63
|
+
/**
|
|
64
|
+
* What a band holds, in the editor's order — drafts and hidden titles too.
|
|
65
|
+
*
|
|
66
|
+
* The screen that arranges a band has to be able to reopen it, and until this
|
|
67
|
+
* existed it could not: the staff reads answer ``mediaCount`` and the reader's
|
|
68
|
+
* ``/selections/{id}/media`` refuses a draft, so a band being edited had no
|
|
69
|
+
* endpoint that would say what was in it.
|
|
70
|
+
*
|
|
71
|
+
* In the legacy this was never a route. ``SelectionController::index`` renders
|
|
72
|
+
* the whole screen server-side, and ``getAllForAdmin`` attaches the contents
|
|
73
|
+
* with ``attachMedias($selections, false)`` — ``false`` being "not for a
|
|
74
|
+
* reader", so no shelf, publication or adult gate. The template then loops
|
|
75
|
+
* over them. Nothing crossed a wire, so nothing had to be ported; a JSON back
|
|
76
|
+
* office is what makes the gap appear.
|
|
77
|
+
*
|
|
78
|
+
* **Two filters are deliberately absent**, and they are the two the reader's
|
|
79
|
+
* endpoint applies. The band is fetched by id and provider alone, so a draft
|
|
80
|
+
* answers. Its titles skip ``visible_media``, so one that is withdrawn, on the
|
|
81
|
+
* other shelf or adult-only is still listed — with the flags saying so. An
|
|
82
|
+
* editor who cannot see the title they curated cannot tell a band of twelve
|
|
83
|
+
* from a band of twelve that nobody is shown.
|
|
84
|
+
*
|
|
85
|
+
* It stays a staff route: the router requires ADMIN or SUPPORT, and support
|
|
86
|
+
* may look at what editorial built without being able to change it.
|
|
87
|
+
* @summary List Staff Selection Media
|
|
88
|
+
*/
|
|
89
|
+
export declare const listStaffSelectionMedia: (provider: PartnerProvider, selectionId: number, params?: ListStaffSelectionMediaParams, options?: Parameters<typeof request>[1]) => Promise<AdminPartnerSelectionMediaPage>;
|
|
90
|
+
export declare const getReorderSelectionMediaUrl: (provider: PartnerProvider, selectionId: number) => string;
|
|
91
|
+
/**
|
|
92
|
+
* Set the order of a band's titles, whole, in one transaction.
|
|
93
|
+
*
|
|
94
|
+
* A title named but absent from the band is ``404`` and nothing is written: a
|
|
95
|
+
* half-applied order is the failure this endpoint exists to prevent. Titles
|
|
96
|
+
* not named keep their relative order after the ones that are, so a client may
|
|
97
|
+
* send only what moved.
|
|
98
|
+
* @summary Reorder Selection Media
|
|
99
|
+
*/
|
|
100
|
+
export declare const reorderSelectionMedia: (provider: PartnerProvider, selectionId: number, selectionMediaOrderWrite: SelectionMediaOrderWrite, options?: Parameters<typeof request>[1]) => Promise<void>;
|
|
101
|
+
export declare const getRemoveSelectionMediaUrl: (provider: PartnerProvider, selectionId: number, mediaId: number) => string;
|
|
102
|
+
/**
|
|
103
|
+
* Take a title out of a band. Idempotent, for the same reason.
|
|
104
|
+
* @summary Remove Selection Media
|
|
105
|
+
*/
|
|
106
|
+
export declare const removeSelectionMedia: (provider: PartnerProvider, selectionId: number, mediaId: number, options?: Parameters<typeof request>[1]) => Promise<void>;
|
|
107
|
+
export declare const getAddSelectionMediaUrl: (provider: PartnerProvider, selectionId: number, mediaId: number) => string;
|
|
108
|
+
/**
|
|
109
|
+
* Put a title in a band, at the end. Idempotent.
|
|
110
|
+
*
|
|
111
|
+
* ``PUT`` rather than the legacy's ``medias/add``: adding a title that is
|
|
112
|
+
* already there is not an error and must not add it twice — the primary key
|
|
113
|
+
* says so, and a double click should not need a different answer.
|
|
114
|
+
*
|
|
115
|
+
* The title must belong to this provider's catalogue. Naming a YouScribe id
|
|
116
|
+
* under the Nextory path is a ``404``, not a band that renders a gap.
|
|
117
|
+
* @summary Add Selection Media
|
|
118
|
+
*/
|
|
119
|
+
export declare const addSelectionMedia: (provider: PartnerProvider, selectionId: number, mediaId: number, options?: Parameters<typeof request>[1]) => Promise<void>;
|
|
120
|
+
export declare const getRemoveSelectionFromPageUrl: (provider: PartnerProvider, selectionId: number, page: string) => string;
|
|
121
|
+
/**
|
|
122
|
+
* Take a band off a page. The band itself survives, with its titles.
|
|
123
|
+
* @summary Remove Selection From Page
|
|
124
|
+
*/
|
|
125
|
+
export declare const removeSelectionFromPage: (provider: PartnerProvider, selectionId: number, page: string, options?: Parameters<typeof request>[1]) => Promise<void>;
|
|
126
|
+
export declare const getPlaceSelectionOnPageUrl: (provider: PartnerProvider, selectionId: number, page: string) => string;
|
|
127
|
+
/**
|
|
128
|
+
* Place a band on a page, at the end of it. Idempotent.
|
|
129
|
+
*
|
|
130
|
+
* The page is free text — ``home`` or a shelf slug — because a band is curated
|
|
131
|
+
* against the shelves that exist, and a new shelf should not need a release
|
|
132
|
+
* before it can be filled. A page nobody curated simply has no bands.
|
|
133
|
+
* @summary Place Selection On Page
|
|
134
|
+
*/
|
|
135
|
+
export declare const placeSelectionOnPage: (provider: PartnerProvider, selectionId: number, page: string, options?: Parameters<typeof request>[1]) => Promise<void>;
|
|
136
|
+
//#endregion
|
|
137
|
+
//# sourceMappingURL=admin-partner-selections.d.ts.map
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
|
|
2
|
+
import { r as request } from "../chunks/client.js";
|
|
3
|
+
//#region src/api/admin-partner-selections/admin-partner-selections.ts
|
|
4
|
+
const getListStaffSelectionsUrl = (provider) => {
|
|
5
|
+
return `/admin/partners/${provider}/selections`;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Every band of this catalogue, drafts included.
|
|
9
|
+
*
|
|
10
|
+
* Unlike the reader's listing this applies no shelf or publication filter:
|
|
11
|
+
* seeing what exists is the whole point of the screen, and a draft nobody can
|
|
12
|
+
* find is a draft nobody can publish.
|
|
13
|
+
* @summary List Staff Selections
|
|
14
|
+
*/
|
|
15
|
+
const listStaffSelections = async (provider, options) => {
|
|
16
|
+
return request(getListStaffSelectionsUrl(provider), {
|
|
17
|
+
...options,
|
|
18
|
+
method: "GET"
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
const getCreateStaffSelectionUrl = (provider) => {
|
|
22
|
+
return `/admin/partners/${provider}/selections`;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Add a band. It is a draft and stands on both shelves unless told otherwise.
|
|
26
|
+
*
|
|
27
|
+
* A draft by default because publishing is a decision somebody makes; both
|
|
28
|
+
* shelves by default because an audience nobody narrowed must not narrow
|
|
29
|
+
* itself.
|
|
30
|
+
* @summary Create Staff Selection
|
|
31
|
+
*/
|
|
32
|
+
const createStaffSelection = async (provider, adminPartnerSelectionWrite, options) => {
|
|
33
|
+
const getHeaders = (h) => {
|
|
34
|
+
if (!h) return {};
|
|
35
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
36
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
37
|
+
const headers = {};
|
|
38
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
39
|
+
return headers;
|
|
40
|
+
};
|
|
41
|
+
return request(getCreateStaffSelectionUrl(provider), {
|
|
42
|
+
...options,
|
|
43
|
+
method: "POST",
|
|
44
|
+
headers: {
|
|
45
|
+
"Content-Type": "application/json",
|
|
46
|
+
...getHeaders(options?.headers)
|
|
47
|
+
},
|
|
48
|
+
body: JSON.stringify(adminPartnerSelectionWrite)
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
const getReorderPageSelectionsUrl = (provider, page) => {
|
|
52
|
+
return `/admin/partners/${provider}/selections/pages/${page}/order`;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Set the order of the bands on one page, whole, in one transaction.
|
|
56
|
+
*
|
|
57
|
+
* Per page rather than per band: a band appears on several and need not hold
|
|
58
|
+
* the same rank on each, which is why the rank lives on the placement.
|
|
59
|
+
* @summary Reorder Page Selections
|
|
60
|
+
*/
|
|
61
|
+
const reorderPageSelections = async (provider, page, selectionOrderWrite, options) => {
|
|
62
|
+
const getHeaders = (h) => {
|
|
63
|
+
if (!h) return {};
|
|
64
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
65
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
66
|
+
const headers = {};
|
|
67
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
68
|
+
return headers;
|
|
69
|
+
};
|
|
70
|
+
return request(getReorderPageSelectionsUrl(provider, page), {
|
|
71
|
+
...options,
|
|
72
|
+
method: "PUT",
|
|
73
|
+
headers: {
|
|
74
|
+
"Content-Type": "application/json",
|
|
75
|
+
...getHeaders(options?.headers)
|
|
76
|
+
},
|
|
77
|
+
body: JSON.stringify(selectionOrderWrite)
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
const getDeleteStaffSelectionUrl = (provider, selectionId) => {
|
|
81
|
+
return `/admin/partners/${provider}/selections/${selectionId}`;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Remove a band, its placements and its memberships.
|
|
85
|
+
*
|
|
86
|
+
* No ``409`` on a band that still holds titles: a membership is an editorial
|
|
87
|
+
* arrangement, not a reference anything else depends on, and the cascade takes
|
|
88
|
+
* it. The titles themselves belong to the catalogue and are untouched.
|
|
89
|
+
* @summary Delete Staff Selection
|
|
90
|
+
*/
|
|
91
|
+
const deleteStaffSelection = async (provider, selectionId, options) => {
|
|
92
|
+
return request(getDeleteStaffSelectionUrl(provider, selectionId), {
|
|
93
|
+
...options,
|
|
94
|
+
method: "DELETE"
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
const getReadStaffSelectionUrl = (provider, selectionId) => {
|
|
98
|
+
return `/admin/partners/${provider}/selections/${selectionId}`;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* @summary Read Staff Selection
|
|
102
|
+
*/
|
|
103
|
+
const readStaffSelection = async (provider, selectionId, options) => {
|
|
104
|
+
return request(getReadStaffSelectionUrl(provider, selectionId), {
|
|
105
|
+
...options,
|
|
106
|
+
method: "GET"
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
const getAmendStaffSelectionUrl = (provider, selectionId) => {
|
|
110
|
+
return `/admin/partners/${provider}/selections/${selectionId}`;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Rename a band, publish it, or move it between shelves.
|
|
114
|
+
*
|
|
115
|
+
* The legacy has one route per field — ``rename`` and ``activate`` — which is
|
|
116
|
+
* two requests for what a screen submits as one form, and two chances to apply
|
|
117
|
+
* half of it. Omitted fields are left alone.
|
|
118
|
+
*
|
|
119
|
+
* The audience arrives whole or not at all, so unsetting one shelf cannot be
|
|
120
|
+
* confused with saying nothing about the other.
|
|
121
|
+
* @summary Amend Staff Selection
|
|
122
|
+
*/
|
|
123
|
+
const amendStaffSelection = async (provider, selectionId, adminPartnerSelectionAmendWrite, options) => {
|
|
124
|
+
const getHeaders = (h) => {
|
|
125
|
+
if (!h) return {};
|
|
126
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
127
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
128
|
+
const headers = {};
|
|
129
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
130
|
+
return headers;
|
|
131
|
+
};
|
|
132
|
+
return request(getAmendStaffSelectionUrl(provider, selectionId), {
|
|
133
|
+
...options,
|
|
134
|
+
method: "PATCH",
|
|
135
|
+
headers: {
|
|
136
|
+
"Content-Type": "application/json",
|
|
137
|
+
...getHeaders(options?.headers)
|
|
138
|
+
},
|
|
139
|
+
body: JSON.stringify(adminPartnerSelectionAmendWrite)
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
const getListStaffSelectionMediaUrl = (provider, selectionId, params) => {
|
|
143
|
+
const normalizedParams = new URLSearchParams();
|
|
144
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
145
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
146
|
+
});
|
|
147
|
+
const stringifiedParams = normalizedParams.toString();
|
|
148
|
+
return stringifiedParams.length > 0 ? `/admin/partners/${provider}/selections/${selectionId}/media?${stringifiedParams}` : `/admin/partners/${provider}/selections/${selectionId}/media`;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* What a band holds, in the editor's order — drafts and hidden titles too.
|
|
152
|
+
*
|
|
153
|
+
* The screen that arranges a band has to be able to reopen it, and until this
|
|
154
|
+
* existed it could not: the staff reads answer ``mediaCount`` and the reader's
|
|
155
|
+
* ``/selections/{id}/media`` refuses a draft, so a band being edited had no
|
|
156
|
+
* endpoint that would say what was in it.
|
|
157
|
+
*
|
|
158
|
+
* In the legacy this was never a route. ``SelectionController::index`` renders
|
|
159
|
+
* the whole screen server-side, and ``getAllForAdmin`` attaches the contents
|
|
160
|
+
* with ``attachMedias($selections, false)`` — ``false`` being "not for a
|
|
161
|
+
* reader", so no shelf, publication or adult gate. The template then loops
|
|
162
|
+
* over them. Nothing crossed a wire, so nothing had to be ported; a JSON back
|
|
163
|
+
* office is what makes the gap appear.
|
|
164
|
+
*
|
|
165
|
+
* **Two filters are deliberately absent**, and they are the two the reader's
|
|
166
|
+
* endpoint applies. The band is fetched by id and provider alone, so a draft
|
|
167
|
+
* answers. Its titles skip ``visible_media``, so one that is withdrawn, on the
|
|
168
|
+
* other shelf or adult-only is still listed — with the flags saying so. An
|
|
169
|
+
* editor who cannot see the title they curated cannot tell a band of twelve
|
|
170
|
+
* from a band of twelve that nobody is shown.
|
|
171
|
+
*
|
|
172
|
+
* It stays a staff route: the router requires ADMIN or SUPPORT, and support
|
|
173
|
+
* may look at what editorial built without being able to change it.
|
|
174
|
+
* @summary List Staff Selection Media
|
|
175
|
+
*/
|
|
176
|
+
const listStaffSelectionMedia = async (provider, selectionId, params, options) => {
|
|
177
|
+
return request(getListStaffSelectionMediaUrl(provider, selectionId, params), {
|
|
178
|
+
...options,
|
|
179
|
+
method: "GET"
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
const getReorderSelectionMediaUrl = (provider, selectionId) => {
|
|
183
|
+
return `/admin/partners/${provider}/selections/${selectionId}/media/order`;
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* Set the order of a band's titles, whole, in one transaction.
|
|
187
|
+
*
|
|
188
|
+
* A title named but absent from the band is ``404`` and nothing is written: a
|
|
189
|
+
* half-applied order is the failure this endpoint exists to prevent. Titles
|
|
190
|
+
* not named keep their relative order after the ones that are, so a client may
|
|
191
|
+
* send only what moved.
|
|
192
|
+
* @summary Reorder Selection Media
|
|
193
|
+
*/
|
|
194
|
+
const reorderSelectionMedia = async (provider, selectionId, selectionMediaOrderWrite, options) => {
|
|
195
|
+
const getHeaders = (h) => {
|
|
196
|
+
if (!h) return {};
|
|
197
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
198
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
199
|
+
const headers = {};
|
|
200
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
201
|
+
return headers;
|
|
202
|
+
};
|
|
203
|
+
return request(getReorderSelectionMediaUrl(provider, selectionId), {
|
|
204
|
+
...options,
|
|
205
|
+
method: "PUT",
|
|
206
|
+
headers: {
|
|
207
|
+
"Content-Type": "application/json",
|
|
208
|
+
...getHeaders(options?.headers)
|
|
209
|
+
},
|
|
210
|
+
body: JSON.stringify(selectionMediaOrderWrite)
|
|
211
|
+
});
|
|
212
|
+
};
|
|
213
|
+
const getRemoveSelectionMediaUrl = (provider, selectionId, mediaId) => {
|
|
214
|
+
return `/admin/partners/${provider}/selections/${selectionId}/media/${mediaId}`;
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* Take a title out of a band. Idempotent, for the same reason.
|
|
218
|
+
* @summary Remove Selection Media
|
|
219
|
+
*/
|
|
220
|
+
const removeSelectionMedia = async (provider, selectionId, mediaId, options) => {
|
|
221
|
+
return request(getRemoveSelectionMediaUrl(provider, selectionId, mediaId), {
|
|
222
|
+
...options,
|
|
223
|
+
method: "DELETE"
|
|
224
|
+
});
|
|
225
|
+
};
|
|
226
|
+
const getAddSelectionMediaUrl = (provider, selectionId, mediaId) => {
|
|
227
|
+
return `/admin/partners/${provider}/selections/${selectionId}/media/${mediaId}`;
|
|
228
|
+
};
|
|
229
|
+
/**
|
|
230
|
+
* Put a title in a band, at the end. Idempotent.
|
|
231
|
+
*
|
|
232
|
+
* ``PUT`` rather than the legacy's ``medias/add``: adding a title that is
|
|
233
|
+
* already there is not an error and must not add it twice — the primary key
|
|
234
|
+
* says so, and a double click should not need a different answer.
|
|
235
|
+
*
|
|
236
|
+
* The title must belong to this provider's catalogue. Naming a YouScribe id
|
|
237
|
+
* under the Nextory path is a ``404``, not a band that renders a gap.
|
|
238
|
+
* @summary Add Selection Media
|
|
239
|
+
*/
|
|
240
|
+
const addSelectionMedia = async (provider, selectionId, mediaId, options) => {
|
|
241
|
+
return request(getAddSelectionMediaUrl(provider, selectionId, mediaId), {
|
|
242
|
+
...options,
|
|
243
|
+
method: "PUT"
|
|
244
|
+
});
|
|
245
|
+
};
|
|
246
|
+
const getRemoveSelectionFromPageUrl = (provider, selectionId, page) => {
|
|
247
|
+
return `/admin/partners/${provider}/selections/${selectionId}/pages/${page}`;
|
|
248
|
+
};
|
|
249
|
+
/**
|
|
250
|
+
* Take a band off a page. The band itself survives, with its titles.
|
|
251
|
+
* @summary Remove Selection From Page
|
|
252
|
+
*/
|
|
253
|
+
const removeSelectionFromPage = async (provider, selectionId, page, options) => {
|
|
254
|
+
return request(getRemoveSelectionFromPageUrl(provider, selectionId, page), {
|
|
255
|
+
...options,
|
|
256
|
+
method: "DELETE"
|
|
257
|
+
});
|
|
258
|
+
};
|
|
259
|
+
const getPlaceSelectionOnPageUrl = (provider, selectionId, page) => {
|
|
260
|
+
return `/admin/partners/${provider}/selections/${selectionId}/pages/${page}`;
|
|
261
|
+
};
|
|
262
|
+
/**
|
|
263
|
+
* Place a band on a page, at the end of it. Idempotent.
|
|
264
|
+
*
|
|
265
|
+
* The page is free text — ``home`` or a shelf slug — because a band is curated
|
|
266
|
+
* against the shelves that exist, and a new shelf should not need a release
|
|
267
|
+
* before it can be filled. A page nobody curated simply has no bands.
|
|
268
|
+
* @summary Place Selection On Page
|
|
269
|
+
*/
|
|
270
|
+
const placeSelectionOnPage = async (provider, selectionId, page, options) => {
|
|
271
|
+
return request(getPlaceSelectionOnPageUrl(provider, selectionId, page), {
|
|
272
|
+
...options,
|
|
273
|
+
method: "PUT"
|
|
274
|
+
});
|
|
275
|
+
};
|
|
276
|
+
//#endregion
|
|
277
|
+
export { addSelectionMedia, amendStaffSelection, createStaffSelection, deleteStaffSelection, getAddSelectionMediaUrl, getAmendStaffSelectionUrl, getCreateStaffSelectionUrl, getDeleteStaffSelectionUrl, getListStaffSelectionMediaUrl, getListStaffSelectionsUrl, getPlaceSelectionOnPageUrl, getReadStaffSelectionUrl, getRemoveSelectionFromPageUrl, getRemoveSelectionMediaUrl, getReorderPageSelectionsUrl, getReorderSelectionMediaUrl, listStaffSelectionMedia, listStaffSelections, placeSelectionOnPage, readStaffSelection, removeSelectionFromPage, removeSelectionMedia, reorderPageSelections, reorderSelectionMedia };
|
|
278
|
+
|
|
279
|
+
//# sourceMappingURL=admin-partner-selections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-partner-selections.js","names":[],"sources":["../../src/api/admin-partner-selections/admin-partner-selections.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.12.0\n */\nimport type {\n AdminPartnerSelectionAmendWrite,\n AdminPartnerSelectionListRead,\n AdminPartnerSelectionMediaPage,\n AdminPartnerSelectionRead,\n AdminPartnerSelectionWrite,\n ListStaffSelectionMediaParams,\n PartnerProvider,\n SelectionMediaOrderWrite,\n SelectionOrderWrite\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getListStaffSelectionsUrl = (provider: PartnerProvider,) => {\n\n\n\n\n return `/admin/partners/${provider}/selections`\n}\n\n/**\n * Every band of this catalogue, drafts included.\n *\n * Unlike the reader's listing this applies no shelf or publication filter:\n * seeing what exists is the whole point of the screen, and a draft nobody can\n * find is a draft nobody can publish.\n * @summary List Staff Selections\n */\nexport const listStaffSelections = async (provider: PartnerProvider, options?: Parameters<typeof request>[1]): Promise<AdminPartnerSelectionListRead> => {\n\n return request<AdminPartnerSelectionListRead>(getListStaffSelectionsUrl(provider),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getCreateStaffSelectionUrl = (provider: PartnerProvider,) => {\n\n\n\n\n return `/admin/partners/${provider}/selections`\n}\n\n/**\n * Add a band. It is a draft and stands on both shelves unless told otherwise.\n *\n * A draft by default because publishing is a decision somebody makes; both\n * shelves by default because an audience nobody narrowed must not narrow\n * itself.\n * @summary Create Staff Selection\n */\nexport const createStaffSelection = async (provider: PartnerProvider,\n adminPartnerSelectionWrite: AdminPartnerSelectionWrite, options?: Parameters<typeof request>[1]): Promise<AdminPartnerSelectionRead> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<AdminPartnerSelectionRead>(getCreateStaffSelectionUrl(provider),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(adminPartnerSelectionWrite)\n }\n);}\n\n\nexport const getReorderPageSelectionsUrl = (provider: PartnerProvider,\n page: string,) => {\n\n\n\n\n return `/admin/partners/${provider}/selections/pages/${page}/order`\n}\n\n/**\n * Set the order of the bands on one page, whole, in one transaction.\n *\n * Per page rather than per band: a band appears on several and need not hold\n * the same rank on each, which is why the rank lives on the placement.\n * @summary Reorder Page Selections\n */\nexport const reorderPageSelections = async (provider: PartnerProvider,\n page: string,\n selectionOrderWrite: SelectionOrderWrite, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<void>(getReorderPageSelectionsUrl(provider,page),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(selectionOrderWrite)\n }\n);}\n\n\nexport const getDeleteStaffSelectionUrl = (provider: PartnerProvider,\n selectionId: number,) => {\n\n\n\n\n return `/admin/partners/${provider}/selections/${selectionId}`\n}\n\n/**\n * Remove a band, its placements and its memberships.\n *\n * No ``409`` on a band that still holds titles: a membership is an editorial\n * arrangement, not a reference anything else depends on, and the cascade takes\n * it. The titles themselves belong to the catalogue and are untouched.\n * @summary Delete Staff Selection\n */\nexport const deleteStaffSelection = async (provider: PartnerProvider,\n selectionId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getDeleteStaffSelectionUrl(provider,selectionId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\nexport const getReadStaffSelectionUrl = (provider: PartnerProvider,\n selectionId: number,) => {\n\n\n\n\n return `/admin/partners/${provider}/selections/${selectionId}`\n}\n\n/**\n * @summary Read Staff Selection\n */\nexport const readStaffSelection = async (provider: PartnerProvider,\n selectionId: number, options?: Parameters<typeof request>[1]): Promise<AdminPartnerSelectionRead> => {\n\n return request<AdminPartnerSelectionRead>(getReadStaffSelectionUrl(provider,selectionId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getAmendStaffSelectionUrl = (provider: PartnerProvider,\n selectionId: number,) => {\n\n\n\n\n return `/admin/partners/${provider}/selections/${selectionId}`\n}\n\n/**\n * Rename a band, publish it, or move it between shelves.\n *\n * The legacy has one route per field — ``rename`` and ``activate`` — which is\n * two requests for what a screen submits as one form, and two chances to apply\n * half of it. Omitted fields are left alone.\n *\n * The audience arrives whole or not at all, so unsetting one shelf cannot be\n * confused with saying nothing about the other.\n * @summary Amend Staff Selection\n */\nexport const amendStaffSelection = async (provider: PartnerProvider,\n selectionId: number,\n adminPartnerSelectionAmendWrite: AdminPartnerSelectionAmendWrite, options?: Parameters<typeof request>[1]): Promise<AdminPartnerSelectionRead> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<AdminPartnerSelectionRead>(getAmendStaffSelectionUrl(provider,selectionId),\n {\n ...options,\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(adminPartnerSelectionAmendWrite)\n }\n);}\n\n\nexport const getListStaffSelectionMediaUrl = (provider: PartnerProvider,\n selectionId: number,\n params?: ListStaffSelectionMediaParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : String(value))\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/admin/partners/${provider}/selections/${selectionId}/media?${stringifiedParams}` : `/admin/partners/${provider}/selections/${selectionId}/media`\n}\n\n/**\n * What a band holds, in the editor's order — drafts and hidden titles too.\n *\n * The screen that arranges a band has to be able to reopen it, and until this\n * existed it could not: the staff reads answer ``mediaCount`` and the reader's\n * ``/selections/{id}/media`` refuses a draft, so a band being edited had no\n * endpoint that would say what was in it.\n *\n * In the legacy this was never a route. ``SelectionController::index`` renders\n * the whole screen server-side, and ``getAllForAdmin`` attaches the contents\n * with ``attachMedias($selections, false)`` — ``false`` being \"not for a\n * reader\", so no shelf, publication or adult gate. The template then loops\n * over them. Nothing crossed a wire, so nothing had to be ported; a JSON back\n * office is what makes the gap appear.\n *\n * **Two filters are deliberately absent**, and they are the two the reader's\n * endpoint applies. The band is fetched by id and provider alone, so a draft\n * answers. Its titles skip ``visible_media``, so one that is withdrawn, on the\n * other shelf or adult-only is still listed — with the flags saying so. An\n * editor who cannot see the title they curated cannot tell a band of twelve\n * from a band of twelve that nobody is shown.\n *\n * It stays a staff route: the router requires ADMIN or SUPPORT, and support\n * may look at what editorial built without being able to change it.\n * @summary List Staff Selection Media\n */\nexport const listStaffSelectionMedia = async (provider: PartnerProvider,\n selectionId: number,\n params?: ListStaffSelectionMediaParams, options?: Parameters<typeof request>[1]): Promise<AdminPartnerSelectionMediaPage> => {\n\n return request<AdminPartnerSelectionMediaPage>(getListStaffSelectionMediaUrl(provider,selectionId,params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReorderSelectionMediaUrl = (provider: PartnerProvider,\n selectionId: number,) => {\n\n\n\n\n return `/admin/partners/${provider}/selections/${selectionId}/media/order`\n}\n\n/**\n * Set the order of a band's titles, whole, in one transaction.\n *\n * A title named but absent from the band is ``404`` and nothing is written: a\n * half-applied order is the failure this endpoint exists to prevent. Titles\n * not named keep their relative order after the ones that are, so a client may\n * send only what moved.\n * @summary Reorder Selection Media\n */\nexport const reorderSelectionMedia = async (provider: PartnerProvider,\n selectionId: number,\n selectionMediaOrderWrite: SelectionMediaOrderWrite, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<void>(getReorderSelectionMediaUrl(provider,selectionId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(selectionMediaOrderWrite)\n }\n);}\n\n\nexport const getRemoveSelectionMediaUrl = (provider: PartnerProvider,\n selectionId: number,\n mediaId: number,) => {\n\n\n\n\n return `/admin/partners/${provider}/selections/${selectionId}/media/${mediaId}`\n}\n\n/**\n * Take a title out of a band. Idempotent, for the same reason.\n * @summary Remove Selection Media\n */\nexport const removeSelectionMedia = async (provider: PartnerProvider,\n selectionId: number,\n mediaId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getRemoveSelectionMediaUrl(provider,selectionId,mediaId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\nexport const getAddSelectionMediaUrl = (provider: PartnerProvider,\n selectionId: number,\n mediaId: number,) => {\n\n\n\n\n return `/admin/partners/${provider}/selections/${selectionId}/media/${mediaId}`\n}\n\n/**\n * Put a title in a band, at the end. Idempotent.\n *\n * ``PUT`` rather than the legacy's ``medias/add``: adding a title that is\n * already there is not an error and must not add it twice — the primary key\n * says so, and a double click should not need a different answer.\n *\n * The title must belong to this provider's catalogue. Naming a YouScribe id\n * under the Nextory path is a ``404``, not a band that renders a gap.\n * @summary Add Selection Media\n */\nexport const addSelectionMedia = async (provider: PartnerProvider,\n selectionId: number,\n mediaId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getAddSelectionMediaUrl(provider,selectionId,mediaId),\n {\n ...options,\n method: 'PUT'\n\n\n }\n);}\n\n\nexport const getRemoveSelectionFromPageUrl = (provider: PartnerProvider,\n selectionId: number,\n page: string,) => {\n\n\n\n\n return `/admin/partners/${provider}/selections/${selectionId}/pages/${page}`\n}\n\n/**\n * Take a band off a page. The band itself survives, with its titles.\n * @summary Remove Selection From Page\n */\nexport const removeSelectionFromPage = async (provider: PartnerProvider,\n selectionId: number,\n page: string, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getRemoveSelectionFromPageUrl(provider,selectionId,page),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\nexport const getPlaceSelectionOnPageUrl = (provider: PartnerProvider,\n selectionId: number,\n page: string,) => {\n\n\n\n\n return `/admin/partners/${provider}/selections/${selectionId}/pages/${page}`\n}\n\n/**\n * Place a band on a page, at the end of it. Idempotent.\n *\n * The page is free text — ``home`` or a shelf slug — because a band is curated\n * against the shelves that exist, and a new shelf should not need a release\n * before it can be filled. A page nobody curated simply has no bands.\n * @summary Place Selection On Page\n */\nexport const placeSelectionOnPage = async (provider: PartnerProvider,\n selectionId: number,\n page: string, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getPlaceSelectionOnPageUrl(provider,selectionId,page),\n {\n ...options,\n method: 'PUT'\n\n\n }\n);}\n\n\n"],"mappings":";;;AAqBA,MAAa,6BAA6B,aAA+B;CAKvE,OAAO,mBAAmB,SAAS;AACrC;;;;;;;;;AAUA,MAAa,sBAAsB,OAAO,UAA2B,YAAoF;CAEvJ,OAAO,QAAuC,0BAA0B,QAAQ,GAChF;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,8BAA8B,aAA+B;CAKxE,OAAO,mBAAmB,SAAS;AACrC;;;;;;;;;AAUA,MAAa,uBAAuB,OAAO,UACvC,4BAAwD,YAAgF;CAExI,MAAM,cAAc,MAA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c,YAAY,SAAS;AACxE;;;;;AAMA,MAAa,uBAAuB,OAAO,UACvC,aACA,SAAiB,YAA2D;CAE9E,OAAO,QAAc,2BAA2B,UAAS,aAAY,OAAO,GAC5E;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,2BAA2B,UACpC,aACA,YAAqB;CAKvB,OAAO,mBAAmB,SAAS,cAAc,YAAY,SAAS;AACxE;;;;;;;;;;;;AAaA,MAAa,oBAAoB,OAAO,UACpC,aACA,SAAiB,YAA2D;CAE9E,OAAO,QAAc,wBAAwB,UAAS,aAAY,OAAO,GACzE;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,iCAAiC,UAC1C,aACA,SAAkB;CAKpB,OAAO,mBAAmB,SAAS,cAAc,YAAY,SAAS;AACxE;;;;;AAMA,MAAa,0BAA0B,OAAO,UAC1C,aACA,MAAc,YAA2D;CAE3E,OAAO,QAAc,8BAA8B,UAAS,aAAY,IAAI,GAC5E;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,8BAA8B,UACvC,aACA,SAAkB;CAKpB,OAAO,mBAAmB,SAAS,cAAc,YAAY,SAAS;AACxE;;;;;;;;;AAUA,MAAa,uBAAuB,OAAO,UACvC,aACA,MAAc,YAA2D;CAE3E,OAAO,QAAc,2BAA2B,UAAS,aAAY,IAAI,GACzE;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { _n as PatronDetailRead, cr as ListPatronsParams, mn as PatronPage, pn as PatronUpdateWrite } from "../chunks/index.js";
|
|
3
3
|
import { c as request } from "../chunks/client.js";
|
|
4
4
|
//#region src/api/admin-patrons/admin-patrons.d.ts
|
|
5
5
|
export declare const getListPatronsUrl: (params?: ListPatronsParams) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-patrons.js","names":[],"sources":["../../src/api/admin-patrons/admin-patrons.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.
|
|
1
|
+
{"version":3,"file":"admin-patrons.js","names":[],"sources":["../../src/api/admin-patrons/admin-patrons.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.12.0\n */\nimport type {\n ListPatronsParams,\n PatronDetailRead,\n PatronPage,\n PatronUpdateWrite\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getListPatronsUrl = (params?: ListPatronsParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : String(value))\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/admin/patrons?${stringifiedParams}` : `/admin/patrons`\n}\n\n/**\n * Patrons in scope, matched by Elasticsearch and ordered by name.\n * @summary List Patrons\n */\nexport const listPatrons = async (params?: ListPatronsParams, options?: Parameters<typeof request>[1]): Promise<PatronPage> => {\n\n return request<PatronPage>(getListPatronsUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReadPatronUrl = (patronId: number,) => {\n\n\n\n\n return `/admin/patrons/${patronId}`\n}\n\n/**\n * One patron, including the email the listing withholds.\n * @summary Read Patron\n */\nexport const readPatron = async (patronId: number, options?: Parameters<typeof request>[1]): Promise<PatronDetailRead> => {\n\n return request<PatronDetailRead>(getReadPatronUrl(patronId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getUpdatePatronUrl = (patronId: number,) => {\n\n\n\n\n return `/admin/patrons/${patronId}`\n}\n\n/**\n * Change what staff may change about a patron.\n *\n * Audited, because these are the changes somebody may have to account for:\n * suspending an account, raising an access level, extending a subscription past\n * what was paid for. The legacy records none of them.\n *\n * Nothing here can move a patron between tenants — see\n * :class:`~app.datamodels.admin.patrons.PatronUpdateWrite`.\n * @summary Update Patron\n */\nexport const updatePatron = async (patronId: number,\n patronUpdateWrite: PatronUpdateWrite, options?: Parameters<typeof request>[1]): Promise<PatronDetailRead> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<PatronDetailRead>(getUpdatePatronUrl(patronId),\n {\n ...options,\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(patronUpdateWrite)\n }\n);}\n\n\n"],"mappings":";;;AAgBA,MAAa,qBAAqB,WAAgC;CAChE,MAAM,mBAAmB,IAAI,gBAAgB;CAE7C,OAAO,QAAQ,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,WAAW;EAErD,IAAI,UAAU,KAAA,GACZ,iBAAiB,OAAO,KAAK,UAAU,OAAO,SAAS,OAAO,KAAK,CAAC;CAExE,CAAC;CAED,MAAM,oBAAoB,iBAAiB,SAAS;CAEpD,OAAO,kBAAkB,SAAS,IAAI,kBAAkB,sBAAsB;AAChF;;;;;AAMA,MAAa,cAAc,OAAO,QAA4B,YAAiE;CAE7H,OAAO,QAAoB,kBAAkB,MAAM,GACnD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,oBAAoB,aAAsB;CAKrD,OAAO,kBAAkB;AAC3B;;;;;AAMA,MAAa,aAAa,OAAO,UAAkB,YAAuE;CAExH,OAAO,QAA0B,iBAAiB,QAAQ,GAC1D;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,sBAAsB,aAAsB;CAKvD,OAAO,kBAAkB;AAC3B;;;;;;;;;;;;AAaA,MAAa,eAAe,OAAO,UAC/B,mBAAsC,YAAuE;CAE7G,MAAM,cAAc,MAAwF;EAC5G,IAAI,CAAC,GAAG,OAAO,CAAC;EAChB,IAAI,aAAa,SAAS,OAAO,OAAO,YAAY,EAAE,QAAQ,CAAC;EAC/D,IAAI,OAAO,YAAY,GACrB,OAAO,OAAO,YACZ,MAAM,KAAK,IAAkC,UAAU,MAAM,KAAK,KAAK,CAAqB,CAC9F;EAEF,MAAM,UAAsD,CAAC;EAC7D,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAgD,CAAC,GAClF,IAAI,UAAU,KAAA,GAAW,QAAQ,QAAQ;EAE3C,OAAO;CACT;CACF,OAAO,QAA0B,mBAAmB,QAAQ,GAC1D;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,iBAAiB;CACxC,CACF;AAAE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { Wn as ModerationWrite, ct as ReviewModerationRead, ir as ListReviewsParams, st as ReviewPage } from "../chunks/index.js";
|
|
3
3
|
import { c as request } from "../chunks/client.js";
|
|
4
4
|
//#region src/api/admin-reviews/admin-reviews.d.ts
|
|
5
5
|
export declare const getListReviewsUrl: (params?: ListReviewsParams) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-reviews.js","names":[],"sources":["../../src/api/admin-reviews/admin-reviews.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.
|
|
1
|
+
{"version":3,"file":"admin-reviews.js","names":[],"sources":["../../src/api/admin-reviews/admin-reviews.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.12.0\n */\nimport type {\n ListReviewsParams,\n ModerationWrite,\n ReviewModerationRead,\n ReviewPage\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getListReviewsUrl = (params?: ListReviewsParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : String(value))\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/admin/reviews?${stringifiedParams}` : `/admin/reviews`\n}\n\n/**\n * Reviews awaiting a decision, oldest first.\n *\n * Oldest first on purpose: a moderation queue sorted newest-first starves its\n * tail, and the review that has waited longest is the one whose author is\n * wondering what happened.\n * @summary List Reviews\n */\nexport const listReviews = async (params?: ListReviewsParams, options?: Parameters<typeof request>[1]): Promise<ReviewPage> => {\n\n return request<ReviewPage>(getListReviewsUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getModerateReviewUrl = (reviewId: number,) => {\n\n\n\n\n return `/admin/reviews/${reviewId}/moderation`\n}\n\n/**\n * Publish or reject one review.\n *\n * ``PUT`` on a moderation sub-resource rather than ``POST /approve`` and\n * ``POST /reject``: the outcome is a state the review is *in*, not two different\n * events, and a repeated decision must be harmless.\n *\n * Rejecting requires a reason. The author is owed one, and the moderator is the\n * only person who has it — the audit row is where it survives after the queue\n * has moved on.\n * @summary Moderate Review\n */\nexport const moderateReview = async (reviewId: number,\n moderationWrite: ModerationWrite, options?: Parameters<typeof request>[1]): Promise<ReviewModerationRead> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<ReviewModerationRead>(getModerateReviewUrl(reviewId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(moderationWrite)\n }\n);}\n\n\n"],"mappings":";;;AAgBA,MAAa,qBAAqB,WAAgC;CAChE,MAAM,mBAAmB,IAAI,gBAAgB;CAE7C,OAAO,QAAQ,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,WAAW;EAErD,IAAI,UAAU,KAAA,GACZ,iBAAiB,OAAO,KAAK,UAAU,OAAO,SAAS,OAAO,KAAK,CAAC;CAExE,CAAC;CAED,MAAM,oBAAoB,iBAAiB,SAAS;CAEpD,OAAO,kBAAkB,SAAS,IAAI,kBAAkB,sBAAsB;AAChF;;;;;;;;;AAUA,MAAa,cAAc,OAAO,QAA4B,YAAiE;CAE7H,OAAO,QAAoB,kBAAkB,MAAM,GACnD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,wBAAwB,aAAsB;CAKzD,OAAO,kBAAkB,SAAS;AACpC;;;;;;;;;;;;;AAcA,MAAa,iBAAiB,OAAO,UACjC,iBAAkC,YAA2E;CAE7G,MAAM,cAAc,MAAwF;EAC5G,IAAI,CAAC,GAAG,OAAO,CAAC;EAChB,IAAI,aAAa,SAAS,OAAO,OAAO,YAAY,EAAE,QAAQ,CAAC;EAC/D,IAAI,OAAO,YAAY,GACrB,OAAO,OAAO,YACZ,MAAM,KAAK,IAAkC,UAAU,MAAM,KAAK,KAAK,CAAqB,CAC9F;EAEF,MAAM,UAAsD,CAAC;EAC7D,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAgD,CAAC,GAClF,IAAI,UAAU,KAAA,GAAW,QAAQ,QAAQ;EAE3C,OAAO;CACT;CACF,OAAO,QAA8B,qBAAqB,QAAQ,GAChE;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,eAAe;CACtC,CACF;AAAE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { Ht as ProductGrantWrite, Ut as ProductGrantListRead } from "../chunks/index.js";
|
|
3
3
|
import { c as request } from "../chunks/client.js";
|
|
4
4
|
//#region src/api/admin-roles/admin-roles.d.ts
|
|
5
5
|
export declare const getListGrantsUrl: (userId: number) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-roles.js","names":[],"sources":["../../src/api/admin-roles/admin-roles.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.
|
|
1
|
+
{"version":3,"file":"admin-roles.js","names":[],"sources":["../../src/api/admin-roles/admin-roles.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.12.0\n */\nimport type {\n ProductGrantListRead,\n ProductGrantWrite\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getListGrantsUrl = (userId: number,) => {\n\n\n\n\n return `/admin/users/${userId}/product-roles`\n}\n\n/**\n * This account's grants within the caller's organisation scope.\n *\n * Readable by SUPPORT as well as ADMIN: knowing what somebody is, is part of\n * helping them. Changing it is not.\n * @summary List Grants\n */\nexport const listGrants = async (userId: number, options?: Parameters<typeof request>[1]): Promise<ProductGrantListRead> => {\n\n return request<ProductGrantListRead>(getListGrantsUrl(userId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReplaceGrantsUrl = (userId: number,) => {\n\n\n\n\n return `/admin/users/${userId}/product-roles`\n}\n\n/**\n * Replace this account's roles for one product at one organisation.\n *\n * ``PUT`` because it is idempotent and the body is the whole desired state for\n * that ``(tenant, product)`` slice — sending it twice leaves the same grants.\n *\n * Two scope checks, and both are needed. The *subject* must be an account the\n * operator reaches, and the ``tenantId`` being granted at must be one they\n * reach too: without the second, an operator could grant a remit at an\n * organisation they have no authority over, which is how a scoped\n * administrator becomes an unscoped one.\n *\n * ``422`` for a role the product does not recognise —\n * :data:`~app.models.enums.PRODUCT_ROLES` decides, so ``student`` for biblio is\n * refused rather than stored and puzzled over later.\n * @summary Replace Grants\n */\nexport const replaceGrants = async (userId: number,\n productGrantWrite: ProductGrantWrite, options?: Parameters<typeof request>[1]): Promise<ProductGrantListRead> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<ProductGrantListRead>(getReplaceGrantsUrl(userId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(productGrantWrite)\n }\n);}\n\n\n"],"mappings":";;;AAcA,MAAa,oBAAoB,WAAoB;CAKnD,OAAO,gBAAgB,OAAO;AAChC;;;;;;;;AASA,MAAa,aAAa,OAAO,QAAgB,YAA2E;CAE1H,OAAO,QAA8B,iBAAiB,MAAM,GAC5D;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,uBAAuB,WAAoB;CAKtD,OAAO,gBAAgB,OAAO;AAChC;;;;;;;;;;;;;;;;;;AAmBA,MAAa,gBAAgB,OAAO,QAChC,mBAAsC,YAA2E;CAEjH,MAAM,cAAc,MAAwF;EAC5G,IAAI,CAAC,GAAG,OAAO,CAAC;EAChB,IAAI,aAAa,SAAS,OAAO,OAAO,YAAY,EAAE,QAAQ,CAAC;EAC/D,IAAI,OAAO,YAAY,GACrB,OAAO,OAAO,YACZ,MAAM,KAAK,IAAkC,UAAU,MAAM,KAAK,KAAK,CAAqB,CAC9F;EAEF,MAAM,UAAsD,CAAC;EAC7D,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAgD,CAAC,GAClF,IAAI,UAAU,KAAA,GAAW,QAAQ,QAAQ;EAE3C,OAAO;CACT;CACF,OAAO,QAA8B,oBAAoB,MAAM,GAC7D;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,iBAAiB;CACxC,CACF;AAAE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { Ur as ImpersonationWrite, V as SupportSessionRead, vc as DemoUserWrite, yc as DemoUserRead } from "../chunks/index.js";
|
|
3
3
|
import { c as request } from "../chunks/client.js";
|
|
4
4
|
//#region src/api/admin-support/admin-support.d.ts
|
|
5
5
|
export declare const getCreateDemoUserUrl: () => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-support.js","names":[],"sources":["../../src/api/admin-support/admin-support.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.
|
|
1
|
+
{"version":3,"file":"admin-support.js","names":[],"sources":["../../src/api/admin-support/admin-support.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.12.0\n */\nimport type {\n DemoUserRead,\n DemoUserWrite,\n ImpersonationWrite,\n SupportSessionRead\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getCreateDemoUserUrl = () => {\n\n\n\n\n return `/admin/demo-users`\n}\n\n/**\n * Create, or return, a demonstration account for an establishment (E57).\n *\n * ``RequireAdmin`` rather than ``RequireStaff``: this creates an account inside\n * a customer's tenant, which is a change to what the customer has, not an\n * assistance to one of their members.\n *\n * **The account has no password and cannot be signed into directly.** The\n * legacy derived one from the establishment id alone — ``Etab{id padded}$``,\n * at ``etab_{id}@ta.com`` — and then redirected into the impersonation route\n * (defect D15). Anyone who noticed the pattern held a working credential for\n * every establishment. Here the row is created without a credential and is\n * reached through E56, which is audited.\n *\n * ``201`` when created, ``200`` when it already existed. Idempotent, because a\n * salesperson clicking twice should not end up with two demo accounts.\n * @summary Create Demo User\n */\nexport const createDemoUser = async (demoUserWrite: DemoUserWrite, options?: Parameters<typeof request>[1]): Promise<DemoUserRead> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<DemoUserRead>(getCreateDemoUserUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(demoUserWrite)\n }\n);}\n\n\nexport const getOpenSupportSessionUrl = () => {\n\n\n\n\n return `/admin/impersonations`\n}\n\n/**\n * Open a support session acting as another account (E56).\n *\n * ``reason`` is mandatory and exists to be logged. A support action with no\n * stated reason cannot be told apart from an abuse of the same endpoint.\n *\n * **This returns no tokens.** It used to: a Keycloak token-exchange session for\n * the subject, on the reasoning that the platform should mint no credentials and\n * that the subject's own assurance level would keep privileged operations out of\n * reach. Both halves turned out to be wrong. The exchanged token carried no\n * actor claim, so it was indistinguishable from the patron's own and the trail\n * stopped at this row; and it carried no ``assurance`` claim either, which\n * ``clamp_assurance`` reads as *unconstrained* — so the operator resolved to\n * ``HIGH`` and could close the account, the single thing the design promised to\n * prevent. Keycloak 26 also rejects the grant outright.\n *\n * So the operator keeps their own token and sends ``X-Acting-As`` with the id\n * returned here. Nothing is minted, the authenticated identity stays the\n * operator, and the session is clamped to the lowest assurance by\n * :func:`app.core.security.acting_as` — which makes E14 and E17 unreachable\n * through the guard that already exists rather than through a special case.\n *\n * Ending it early is ``DELETE /admin/impersonations/{id}``, which must be sent\n * *without* the header: a support session holds no staff roles.\n * @summary Open Support Session\n */\nexport const openSupportSession = async (impersonationWrite: ImpersonationWrite, options?: Parameters<typeof request>[1]): Promise<SupportSessionRead> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<SupportSessionRead>(getOpenSupportSessionUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(impersonationWrite)\n }\n);}\n\n\nexport const getCloseSupportSessionUrl = (supportSessionId: number,) => {\n\n\n\n\n return `/admin/impersonations/${supportSessionId}`\n}\n\n/**\n * End a support session early. Idempotent.\n *\n * Must be called *without* ``X-Acting-As``: a session in progress carries no\n * staff roles, so a request made through one cannot reach this endpoint. That\n * is deliberate — the operator steps out before they can close it, and simply\n * dropping the header ends the session's effect immediately either way.\n *\n * ``204`` whether or not the row was still open, and whether or not it was\n * theirs. A support session id is a bare integer and must not be an oracle.\n * @summary Close Support Session\n */\nexport const closeSupportSession = async (supportSessionId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getCloseSupportSessionUrl(supportSessionId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\n"],"mappings":";;;AAgBA,MAAa,6BAA6B;CAKxC,OAAO;AACT;;;;;;;;;;;;;;;;;;;AAoBA,MAAa,iBAAiB,OAAO,eAA8B,YAAmE;CAElI,MAAM,cAAc,MAAwF;EAC5G,IAAI,CAAC,GAAG,OAAO,CAAC;EAChB,IAAI,aAAa,SAAS,OAAO,OAAO,YAAY,EAAE,QAAQ,CAAC;EAC/D,IAAI,OAAO,YAAY,GACrB,OAAO,OAAO,YACZ,MAAM,KAAK,IAAkC,UAAU,MA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
1
|
|
|
2
|
-
import { B as TenantDirectoryParams, I as TenantSearchPage, M as TenantSettingsUpdateWrite, P as TenantSettingsRead,
|
|
2
|
+
import { B as TenantDirectoryParams, I as TenantSearchPage, M as TenantSettingsUpdateWrite, P as TenantSettingsRead, et as SearchTenantsParams } from "../chunks/index.js";
|
|
3
3
|
import { c as request } from "../chunks/client.js";
|
|
4
4
|
//#region src/api/admin-tenants/admin-tenants.d.ts
|
|
5
5
|
export declare const getListTenantsUrl: () => string;
|