@learnorama/mozaik-sdk 0.14.0-staging.50.1 → 0.14.2-staging.52.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/CUSTOMER-ADMIN.md +101 -0
- package/CVS-PLAYBACK.md +135 -0
- package/PRESS.md +208 -0
- package/README.md +36 -4
- package/TV-LOGIN.md +137 -0
- package/dist/api/account.d.ts +1 -1
- package/dist/api/account.js.map +1 -1
- package/dist/api/admin-catalogue.d.ts +88 -1
- package/dist/api/admin-catalogue.js +301 -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 +1 -1
- package/dist/api/admin-contracts.js.map +1 -1
- package/dist/api/admin-customer.d.ts +79 -0
- package/dist/api/admin-customer.js +213 -0
- package/dist/api/admin-customer.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 +1 -1
- package/dist/api/admin-partner-selections.js.map +1 -1
- 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.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-device.d.ts +1 -1
- package/dist/api/auth-device.js.map +1 -1
- package/dist/api/auth.d.ts +1 -1
- package/dist/api/auth.js.map +1 -1
- package/dist/api/biblio-billing-webhooks.d.ts +1 -1
- package/dist/api/biblio-billing-webhooks.js.map +1 -1
- package/dist/api/biblio-billing.d.ts +1 -1
- package/dist/api/biblio-billing.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-learning-author-profiles.d.ts +1 -1
- package/dist/api/biblio-learning-author-profiles.js.map +1 -1
- package/dist/api/biblio-learning-authoring.d.ts +1 -1
- package/dist/api/biblio-learning-authoring.js.map +1 -1
- package/dist/api/biblio-learning-editorial.d.ts +1 -1
- package/dist/api/biblio-learning-editorial.js.map +1 -1
- package/dist/api/biblio-learning-feedback.d.ts +1 -1
- package/dist/api/biblio-learning-feedback.js.map +1 -1
- package/dist/api/biblio-learning-finance.d.ts +1 -1
- package/dist/api/biblio-learning-finance.js.map +1 -1
- package/dist/api/biblio-learning-integrations.d.ts +1 -1
- package/dist/api/biblio-learning-integrations.js.map +1 -1
- package/dist/api/biblio-learning-membership.d.ts +1 -1
- package/dist/api/biblio-learning-membership.js.map +1 -1
- package/dist/api/biblio-learning.d.ts +1 -1
- package/dist/api/biblio-learning.js.map +1 -1
- package/dist/api/biblio-library.d.ts +13 -1
- package/dist/api/biblio-library.js +25 -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 +107 -1
- package/dist/api/biblio-press.js +246 -1
- package/dist/api/biblio-press.js.map +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 +4 -4
- package/dist/api/consumption.js +3 -3
- 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 +33 -1
- package/dist/api/cvs-documents.js +81 -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.d.ts +11 -0
- package/dist/api/cvs-streaming.js +19 -1
- package/dist/api/cvs-streaming.js.map +1 -1
- package/dist/api/index.d.ts +7 -6
- package/dist/api/index.js +7 -6
- package/dist/api/partner-catalogue.d.ts +1 -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/auth.d.ts +1 -1
- package/dist/chunks/client2.d.ts +1 -1
- package/dist/chunks/connection.d.ts +1 -1
- package/dist/chunks/index.d.ts +2091 -593
- 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 +230 -2
- package/dist/models.js.map +1 -1
- package/dist/react/account.d.ts +1 -1
- package/dist/react/account.js +1 -1
- package/dist/react/account.js.map +1 -1
- package/dist/react/admin-catalogue.d.ts +365 -1
- package/dist/react/admin-catalogue.js +652 -2
- 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 +1 -1
- package/dist/react/admin-contracts.js +1 -1
- package/dist/react/admin-contracts.js.map +1 -1
- package/dist/react/admin-customer.d.ts +347 -0
- package/dist/react/admin-customer.js +545 -0
- package/dist/react/admin-customer.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 +1 -1
- package/dist/react/admin-partner-selections.js +1 -1
- package/dist/react/admin-partner-selections.js.map +1 -1
- 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-device.d.ts +1 -1
- package/dist/react/auth-device.js +1 -1
- package/dist/react/auth-device.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-billing-webhooks.d.ts +1 -1
- package/dist/react/biblio-billing-webhooks.js +1 -1
- package/dist/react/biblio-billing-webhooks.js.map +1 -1
- package/dist/react/biblio-billing.d.ts +1 -1
- package/dist/react/biblio-billing.js +1 -1
- package/dist/react/biblio-billing.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-learning-author-profiles.d.ts +1 -1
- package/dist/react/biblio-learning-author-profiles.js +1 -1
- package/dist/react/biblio-learning-author-profiles.js.map +1 -1
- package/dist/react/biblio-learning-authoring.d.ts +1 -1
- package/dist/react/biblio-learning-authoring.js +1 -1
- package/dist/react/biblio-learning-authoring.js.map +1 -1
- package/dist/react/biblio-learning-editorial.d.ts +1 -1
- package/dist/react/biblio-learning-editorial.js +1 -1
- package/dist/react/biblio-learning-editorial.js.map +1 -1
- package/dist/react/biblio-learning-feedback.d.ts +1 -1
- package/dist/react/biblio-learning-feedback.js +1 -1
- package/dist/react/biblio-learning-feedback.js.map +1 -1
- package/dist/react/biblio-learning-finance.d.ts +1 -1
- package/dist/react/biblio-learning-finance.js +1 -1
- package/dist/react/biblio-learning-finance.js.map +1 -1
- package/dist/react/biblio-learning-integrations.d.ts +1 -1
- package/dist/react/biblio-learning-integrations.js +1 -1
- package/dist/react/biblio-learning-integrations.js.map +1 -1
- package/dist/react/biblio-learning-membership.d.ts +1 -1
- package/dist/react/biblio-learning-membership.js +1 -1
- package/dist/react/biblio-learning-membership.js.map +1 -1
- package/dist/react/biblio-learning.d.ts +1 -1
- package/dist/react/biblio-learning.js +1 -1
- package/dist/react/biblio-learning.js.map +1 -1
- package/dist/react/biblio-library.d.ts +30 -1
- package/dist/react/biblio-library.js +54 -2
- 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 +427 -1
- package/dist/react/biblio-press.js +609 -2
- 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 +4 -4
- package/dist/react/consumption.js +4 -4
- 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 +141 -1
- package/dist/react/cvs-documents.js +179 -2
- 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 +39 -1
- package/dist/react/cvs-streaming.js +45 -2
- package/dist/react/cvs-streaming.js.map +1 -1
- package/dist/react/index.d.ts +7 -6
- package/dist/react/index.js +7 -6
- package/dist/react/partner-catalogue.d.ts +1 -1
- package/dist/react/partner-catalogue.js +1 -1
- 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 +12 -8
|
@@ -7,7 +7,7 @@ import { useMutation, useQuery } from "@tanstack/react-query";
|
|
|
7
7
|
* Do not edit manually.
|
|
8
8
|
* Mozaik backend
|
|
9
9
|
* 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.
|
|
10
|
-
* OpenAPI spec version: 0.14.
|
|
10
|
+
* OpenAPI spec version: 0.14.2
|
|
11
11
|
*/
|
|
12
12
|
const withQueryKey = (query, queryKey) => {
|
|
13
13
|
const result = { queryKey };
|
|
@@ -21,6 +21,254 @@ const withQueryKey = (query, queryKey) => {
|
|
|
21
21
|
}
|
|
22
22
|
return result;
|
|
23
23
|
};
|
|
24
|
+
const getUnfollowPressTopicUrl = (topicId) => {
|
|
25
|
+
return `/biblio/me/press-topics/${topicId}`;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Remove this profile's follow even if the subject is no longer accessible.
|
|
29
|
+
* @summary Unfollow Press Topic
|
|
30
|
+
*/
|
|
31
|
+
const unfollowPressTopic = async (topicId, options) => {
|
|
32
|
+
return request(getUnfollowPressTopicUrl(topicId), {
|
|
33
|
+
...options,
|
|
34
|
+
method: "DELETE"
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
const getUnfollowPressTopicMutationKey = () => ["unfollowPressTopic"];
|
|
38
|
+
const getUnfollowPressTopicMutationOptions = (options) => {
|
|
39
|
+
const mutationKey = getUnfollowPressTopicMutationKey();
|
|
40
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
41
|
+
...options,
|
|
42
|
+
mutation: {
|
|
43
|
+
...options.mutation,
|
|
44
|
+
mutationKey
|
|
45
|
+
}
|
|
46
|
+
} : {
|
|
47
|
+
mutation: { mutationKey },
|
|
48
|
+
request: void 0
|
|
49
|
+
};
|
|
50
|
+
const mutationFn = (props) => {
|
|
51
|
+
const { topicId } = props ?? {};
|
|
52
|
+
return unfollowPressTopic(topicId, requestOptions);
|
|
53
|
+
};
|
|
54
|
+
return {
|
|
55
|
+
mutationFn,
|
|
56
|
+
...mutationOptions
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* @summary Unfollow Press Topic
|
|
61
|
+
*/
|
|
62
|
+
const useUnfollowPressTopic = (options, queryClient) => {
|
|
63
|
+
return useMutation(getUnfollowPressTopicMutationOptions(options), queryClient);
|
|
64
|
+
};
|
|
65
|
+
const getFollowPressTopicUrl = (topicId) => {
|
|
66
|
+
return `/biblio/me/press-topics/${topicId}`;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Follow an accessible subject for this profile; idempotent.
|
|
70
|
+
* @summary Follow Press Topic
|
|
71
|
+
*/
|
|
72
|
+
const followPressTopic = async (topicId, options) => {
|
|
73
|
+
return request(getFollowPressTopicUrl(topicId), {
|
|
74
|
+
...options,
|
|
75
|
+
method: "PUT"
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
const getFollowPressTopicMutationKey = () => ["followPressTopic"];
|
|
79
|
+
const getFollowPressTopicMutationOptions = (options) => {
|
|
80
|
+
const mutationKey = getFollowPressTopicMutationKey();
|
|
81
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
82
|
+
...options,
|
|
83
|
+
mutation: {
|
|
84
|
+
...options.mutation,
|
|
85
|
+
mutationKey
|
|
86
|
+
}
|
|
87
|
+
} : {
|
|
88
|
+
mutation: { mutationKey },
|
|
89
|
+
request: void 0
|
|
90
|
+
};
|
|
91
|
+
const mutationFn = (props) => {
|
|
92
|
+
const { topicId } = props ?? {};
|
|
93
|
+
return followPressTopic(topicId, requestOptions);
|
|
94
|
+
};
|
|
95
|
+
return {
|
|
96
|
+
mutationFn,
|
|
97
|
+
...mutationOptions
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* @summary Follow Press Topic
|
|
102
|
+
*/
|
|
103
|
+
const useFollowPressTopic = (options, queryClient) => {
|
|
104
|
+
return useMutation(getFollowPressTopicMutationOptions(options), queryClient);
|
|
105
|
+
};
|
|
106
|
+
const getListPressArticlesUrl = (params) => {
|
|
107
|
+
const normalizedParams = new URLSearchParams();
|
|
108
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
109
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
110
|
+
});
|
|
111
|
+
const stringifiedParams = normalizedParams.toString();
|
|
112
|
+
return stringifiedParams.length > 0 ? `/biblio/press-articles?${stringifiedParams}` : `/biblio/press-articles`;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Local article metadata, filtered by current publication rights before counts and paging.
|
|
116
|
+
*
|
|
117
|
+
* Publication variants in different bouquets remain one article. Results use
|
|
118
|
+
* issueDate descending, then articleId descending; full text stays in the
|
|
119
|
+
* licensed reader. This request performs no provider call or allocation.
|
|
120
|
+
* @summary List Press Articles
|
|
121
|
+
*/
|
|
122
|
+
const listPressArticles = async (params, options) => {
|
|
123
|
+
return request(getListPressArticlesUrl(params), {
|
|
124
|
+
...options,
|
|
125
|
+
method: "GET"
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
const getListPressArticlesQueryKey = (params) => {
|
|
129
|
+
return [`/biblio/press-articles`, ...params ? [params] : []];
|
|
130
|
+
};
|
|
131
|
+
const getListPressArticlesQueryOptions = (params, options) => {
|
|
132
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
133
|
+
const queryKey = queryOptions?.queryKey ?? getListPressArticlesQueryKey(params);
|
|
134
|
+
const queryFn = ({ signal }) => listPressArticles(params, {
|
|
135
|
+
signal,
|
|
136
|
+
...requestOptions
|
|
137
|
+
});
|
|
138
|
+
return {
|
|
139
|
+
queryKey,
|
|
140
|
+
queryFn,
|
|
141
|
+
...queryOptions
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* @summary List Press Articles
|
|
146
|
+
*/
|
|
147
|
+
function useListPressArticles(params, options, queryClient) {
|
|
148
|
+
const queryOptions = getListPressArticlesQueryOptions(params, options);
|
|
149
|
+
const query = useQuery(queryOptions, queryClient);
|
|
150
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
151
|
+
}
|
|
152
|
+
const getReadPressArticleUrl = (articleId) => {
|
|
153
|
+
return `/biblio/press-articles/${articleId}`;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* One entitled article's headline/summary metadata; unknown and forbidden return 404.
|
|
157
|
+
* @summary Read Press Article
|
|
158
|
+
*/
|
|
159
|
+
const readPressArticle = async (articleId, options) => {
|
|
160
|
+
return request(getReadPressArticleUrl(articleId), {
|
|
161
|
+
...options,
|
|
162
|
+
method: "GET"
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
const getReadPressArticleQueryKey = (articleId) => {
|
|
166
|
+
return [`/biblio/press-articles/${articleId}`];
|
|
167
|
+
};
|
|
168
|
+
const getReadPressArticleQueryOptions = (articleId, options) => {
|
|
169
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
170
|
+
const queryKey = queryOptions?.queryKey ?? getReadPressArticleQueryKey(articleId);
|
|
171
|
+
const queryFn = ({ signal }) => readPressArticle(articleId, {
|
|
172
|
+
signal,
|
|
173
|
+
...requestOptions
|
|
174
|
+
});
|
|
175
|
+
return {
|
|
176
|
+
queryKey,
|
|
177
|
+
queryFn,
|
|
178
|
+
enabled: articleId !== null && articleId !== void 0,
|
|
179
|
+
...queryOptions
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* @summary Read Press Article
|
|
184
|
+
*/
|
|
185
|
+
function useReadPressArticle(articleId, options, queryClient) {
|
|
186
|
+
const queryOptions = getReadPressArticleQueryOptions(articleId, options);
|
|
187
|
+
const query = useQuery(queryOptions, queryClient);
|
|
188
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
189
|
+
}
|
|
190
|
+
const getOpenPressArticleReaderUrl = (articleId) => {
|
|
191
|
+
return `/biblio/press-articles/${articleId}/reader-access`;
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* Open exactly this stored article, resolving provider IDs and issue date server-side.
|
|
195
|
+
*
|
|
196
|
+
* Creates licensed reader access only on this explicit action. Keep the returned
|
|
197
|
+
* central consumption lease alive with PUT /consumption/{eventId}, then close it.
|
|
198
|
+
* An idempotency key cannot be reused for another article or an issue-level read.
|
|
199
|
+
* @summary Open Press Article Reader
|
|
200
|
+
*/
|
|
201
|
+
const openPressArticleReader = async (articleId, options) => {
|
|
202
|
+
return request(getOpenPressArticleReaderUrl(articleId), {
|
|
203
|
+
...options,
|
|
204
|
+
method: "POST"
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
const getOpenPressArticleReaderMutationKey = () => ["openPressArticleReader"];
|
|
208
|
+
const getOpenPressArticleReaderMutationOptions = (options) => {
|
|
209
|
+
const mutationKey = getOpenPressArticleReaderMutationKey();
|
|
210
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
211
|
+
...options,
|
|
212
|
+
mutation: {
|
|
213
|
+
...options.mutation,
|
|
214
|
+
mutationKey
|
|
215
|
+
}
|
|
216
|
+
} : {
|
|
217
|
+
mutation: { mutationKey },
|
|
218
|
+
request: void 0
|
|
219
|
+
};
|
|
220
|
+
const mutationFn = (props) => {
|
|
221
|
+
const { articleId } = props ?? {};
|
|
222
|
+
return openPressArticleReader(articleId, requestOptions);
|
|
223
|
+
};
|
|
224
|
+
return {
|
|
225
|
+
mutationFn,
|
|
226
|
+
...mutationOptions
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
/**
|
|
230
|
+
* @summary Open Press Article Reader
|
|
231
|
+
*/
|
|
232
|
+
const useOpenPressArticleReader = (options, queryClient) => {
|
|
233
|
+
return useMutation(getOpenPressArticleReaderMutationOptions(options), queryClient);
|
|
234
|
+
};
|
|
235
|
+
const getReadPressFacetsUrl = () => {
|
|
236
|
+
return `/biblio/press-facets`;
|
|
237
|
+
};
|
|
238
|
+
/**
|
|
239
|
+
* Languages and explicitly mapped regions with accessible publication counts.
|
|
240
|
+
* @summary Read Press Facets
|
|
241
|
+
*/
|
|
242
|
+
const readPressFacets = async (options) => {
|
|
243
|
+
return request(getReadPressFacetsUrl(), {
|
|
244
|
+
...options,
|
|
245
|
+
method: "GET"
|
|
246
|
+
});
|
|
247
|
+
};
|
|
248
|
+
const getReadPressFacetsQueryKey = () => {
|
|
249
|
+
return [`/biblio/press-facets`];
|
|
250
|
+
};
|
|
251
|
+
const getReadPressFacetsQueryOptions = (options) => {
|
|
252
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
253
|
+
const queryKey = queryOptions?.queryKey ?? getReadPressFacetsQueryKey();
|
|
254
|
+
const queryFn = ({ signal }) => readPressFacets({
|
|
255
|
+
signal,
|
|
256
|
+
...requestOptions
|
|
257
|
+
});
|
|
258
|
+
return {
|
|
259
|
+
queryKey,
|
|
260
|
+
queryFn,
|
|
261
|
+
...queryOptions
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
/**
|
|
265
|
+
* @summary Read Press Facets
|
|
266
|
+
*/
|
|
267
|
+
function useReadPressFacets(options, queryClient) {
|
|
268
|
+
const queryOptions = getReadPressFacetsQueryOptions(options);
|
|
269
|
+
const query = useQuery(queryOptions, queryClient);
|
|
270
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
271
|
+
}
|
|
24
272
|
const getReadPressFeedUrl = (params) => {
|
|
25
273
|
const normalizedParams = new URLSearchParams();
|
|
26
274
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
@@ -66,6 +314,230 @@ function useReadPressFeed(params, options, queryClient) {
|
|
|
66
314
|
const query = useQuery(queryOptions, queryClient);
|
|
67
315
|
return withQueryKey(query, queryOptions.queryKey);
|
|
68
316
|
}
|
|
317
|
+
const getListPressPartnerAccessUrl = () => {
|
|
318
|
+
return `/biblio/press-partners`;
|
|
319
|
+
};
|
|
320
|
+
/**
|
|
321
|
+
* Eligible Le Monde/L’Équipe/Le Figaro offers and current allocation status.
|
|
322
|
+
*
|
|
323
|
+
* No code is allocated, revealed, redeemed or sent to a publisher by this read.
|
|
324
|
+
* Allocation and publisher-confirmed activation are separate dates.
|
|
325
|
+
* @summary List Press Partner Access
|
|
326
|
+
*/
|
|
327
|
+
const listPressPartnerAccess = async (options) => {
|
|
328
|
+
return request(getListPressPartnerAccessUrl(), {
|
|
329
|
+
...options,
|
|
330
|
+
method: "GET"
|
|
331
|
+
});
|
|
332
|
+
};
|
|
333
|
+
const getListPressPartnerAccessQueryKey = () => {
|
|
334
|
+
return [`/biblio/press-partners`];
|
|
335
|
+
};
|
|
336
|
+
const getListPressPartnerAccessQueryOptions = (options) => {
|
|
337
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
338
|
+
const queryKey = queryOptions?.queryKey ?? getListPressPartnerAccessQueryKey();
|
|
339
|
+
const queryFn = ({ signal }) => listPressPartnerAccess({
|
|
340
|
+
signal,
|
|
341
|
+
...requestOptions
|
|
342
|
+
});
|
|
343
|
+
return {
|
|
344
|
+
queryKey,
|
|
345
|
+
queryFn,
|
|
346
|
+
...queryOptions
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
/**
|
|
350
|
+
* @summary List Press Partner Access
|
|
351
|
+
*/
|
|
352
|
+
function useListPressPartnerAccess(options, queryClient) {
|
|
353
|
+
const queryOptions = getListPressPartnerAccessQueryOptions(options);
|
|
354
|
+
const query = useQuery(queryOptions, queryClient);
|
|
355
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
356
|
+
}
|
|
357
|
+
const getReadPressPartnerAccessUrl = (provider) => {
|
|
358
|
+
return `/biblio/press-partners/${provider}`;
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* Read this household's allocation/renewal state without exposing the code.
|
|
362
|
+
* @summary Read Press Partner Access
|
|
363
|
+
*/
|
|
364
|
+
const readPressPartnerAccess = async (provider, options) => {
|
|
365
|
+
return request(getReadPressPartnerAccessUrl(provider), {
|
|
366
|
+
...options,
|
|
367
|
+
method: "GET"
|
|
368
|
+
});
|
|
369
|
+
};
|
|
370
|
+
const getReadPressPartnerAccessQueryKey = (provider) => {
|
|
371
|
+
return [`/biblio/press-partners/${provider}`];
|
|
372
|
+
};
|
|
373
|
+
const getReadPressPartnerAccessQueryOptions = (provider, options) => {
|
|
374
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
375
|
+
const queryKey = queryOptions?.queryKey ?? getReadPressPartnerAccessQueryKey(provider);
|
|
376
|
+
const queryFn = ({ signal }) => readPressPartnerAccess(provider, {
|
|
377
|
+
signal,
|
|
378
|
+
...requestOptions
|
|
379
|
+
});
|
|
380
|
+
return {
|
|
381
|
+
queryKey,
|
|
382
|
+
queryFn,
|
|
383
|
+
enabled: provider !== null && provider !== void 0,
|
|
384
|
+
...queryOptions
|
|
385
|
+
};
|
|
386
|
+
};
|
|
387
|
+
/**
|
|
388
|
+
* @summary Read Press Partner Access
|
|
389
|
+
*/
|
|
390
|
+
function useReadPressPartnerAccess(provider, options, queryClient) {
|
|
391
|
+
const queryOptions = getReadPressPartnerAccessQueryOptions(provider, options);
|
|
392
|
+
const query = useQuery(queryOptions, queryClient);
|
|
393
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
394
|
+
}
|
|
395
|
+
const getClaimPressPartnerCodeUrl = (provider) => {
|
|
396
|
+
return `/biblio/press-partners/${provider}/code`;
|
|
397
|
+
};
|
|
398
|
+
/**
|
|
399
|
+
* Return the household's reusable code or allocate exactly one from eligible stock.
|
|
400
|
+
*
|
|
401
|
+
* This is the explicit code-opening action; never prefetch it. Concurrent
|
|
402
|
+
* members of the same household receive the same code. Renewal is based on
|
|
403
|
+
* the publisher-confirmed activation, not an assumed allocation date. The
|
|
404
|
+
* response contains private credentials and must not be logged or cached.
|
|
405
|
+
* This records an allocation audit, not an invented newspaper-reading session.
|
|
406
|
+
* @summary Claim Press Partner Code
|
|
407
|
+
*/
|
|
408
|
+
const claimPressPartnerCode = async (provider, options) => {
|
|
409
|
+
return request(getClaimPressPartnerCodeUrl(provider), {
|
|
410
|
+
...options,
|
|
411
|
+
method: "POST"
|
|
412
|
+
});
|
|
413
|
+
};
|
|
414
|
+
const getClaimPressPartnerCodeMutationKey = () => ["claimPressPartnerCode"];
|
|
415
|
+
const getClaimPressPartnerCodeMutationOptions = (options) => {
|
|
416
|
+
const mutationKey = getClaimPressPartnerCodeMutationKey();
|
|
417
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
418
|
+
...options,
|
|
419
|
+
mutation: {
|
|
420
|
+
...options.mutation,
|
|
421
|
+
mutationKey
|
|
422
|
+
}
|
|
423
|
+
} : {
|
|
424
|
+
mutation: { mutationKey },
|
|
425
|
+
request: void 0
|
|
426
|
+
};
|
|
427
|
+
const mutationFn = (props) => {
|
|
428
|
+
const { provider } = props ?? {};
|
|
429
|
+
return claimPressPartnerCode(provider, requestOptions);
|
|
430
|
+
};
|
|
431
|
+
return {
|
|
432
|
+
mutationFn,
|
|
433
|
+
...mutationOptions
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
/**
|
|
437
|
+
* @summary Claim Press Partner Code
|
|
438
|
+
*/
|
|
439
|
+
const useClaimPressPartnerCode = (options, queryClient) => {
|
|
440
|
+
return useMutation(getClaimPressPartnerCodeMutationOptions(options), queryClient);
|
|
441
|
+
};
|
|
442
|
+
const getReadPressReviewUrl = (params) => {
|
|
443
|
+
const normalizedParams = new URLSearchParams();
|
|
444
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
445
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
446
|
+
});
|
|
447
|
+
const stringifiedParams = normalizedParams.toString();
|
|
448
|
+
return stringifiedParams.length > 0 ? `/biblio/press-review?${stringifiedParams}` : `/biblio/press-review`;
|
|
449
|
+
};
|
|
450
|
+
/**
|
|
451
|
+
* Article headlines, favorite publications and related themes with stable page links.
|
|
452
|
+
*
|
|
453
|
+
* This is the article-level review. /press-feed continues to return publication
|
|
454
|
+
* cards. Quality/selection rules and per-publication caps run before pagination.
|
|
455
|
+
* @summary Read Press Review
|
|
456
|
+
*/
|
|
457
|
+
const readPressReview = async (params, options) => {
|
|
458
|
+
return request(getReadPressReviewUrl(params), {
|
|
459
|
+
...options,
|
|
460
|
+
method: "GET"
|
|
461
|
+
});
|
|
462
|
+
};
|
|
463
|
+
const getReadPressReviewQueryKey = (params) => {
|
|
464
|
+
return [`/biblio/press-review`, ...params ? [params] : []];
|
|
465
|
+
};
|
|
466
|
+
const getReadPressReviewQueryOptions = (params, options) => {
|
|
467
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
468
|
+
const queryKey = queryOptions?.queryKey ?? getReadPressReviewQueryKey(params);
|
|
469
|
+
const queryFn = ({ signal }) => readPressReview(params, {
|
|
470
|
+
signal,
|
|
471
|
+
...requestOptions
|
|
472
|
+
});
|
|
473
|
+
return {
|
|
474
|
+
queryKey,
|
|
475
|
+
queryFn,
|
|
476
|
+
...queryOptions
|
|
477
|
+
};
|
|
478
|
+
};
|
|
479
|
+
/**
|
|
480
|
+
* @summary Read Press Review
|
|
481
|
+
*/
|
|
482
|
+
function useReadPressReview(params, options, queryClient) {
|
|
483
|
+
const queryOptions = getReadPressReviewQueryOptions(params, options);
|
|
484
|
+
const query = useQuery(queryOptions, queryClient);
|
|
485
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
486
|
+
}
|
|
487
|
+
const getAcknowledgePressReviewUrl = () => {
|
|
488
|
+
return `/biblio/press-review/visits`;
|
|
489
|
+
};
|
|
490
|
+
/**
|
|
491
|
+
* Acknowledge the displayed review's generatedAt. GET/prefetch never advances it.
|
|
492
|
+
* @summary Acknowledge Press Review
|
|
493
|
+
*/
|
|
494
|
+
const acknowledgePressReview = async (pressVisitWrite, options) => {
|
|
495
|
+
const getHeaders = (h) => {
|
|
496
|
+
if (!h) return {};
|
|
497
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
498
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
499
|
+
const headers = {};
|
|
500
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
501
|
+
return headers;
|
|
502
|
+
};
|
|
503
|
+
return request(getAcknowledgePressReviewUrl(), {
|
|
504
|
+
...options,
|
|
505
|
+
method: "POST",
|
|
506
|
+
headers: {
|
|
507
|
+
"Content-Type": "application/json",
|
|
508
|
+
...getHeaders(options?.headers)
|
|
509
|
+
},
|
|
510
|
+
body: JSON.stringify(pressVisitWrite)
|
|
511
|
+
});
|
|
512
|
+
};
|
|
513
|
+
const getAcknowledgePressReviewMutationKey = () => ["acknowledgePressReview"];
|
|
514
|
+
const getAcknowledgePressReviewMutationOptions = (options) => {
|
|
515
|
+
const mutationKey = getAcknowledgePressReviewMutationKey();
|
|
516
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
517
|
+
...options,
|
|
518
|
+
mutation: {
|
|
519
|
+
...options.mutation,
|
|
520
|
+
mutationKey
|
|
521
|
+
}
|
|
522
|
+
} : {
|
|
523
|
+
mutation: { mutationKey },
|
|
524
|
+
request: void 0
|
|
525
|
+
};
|
|
526
|
+
const mutationFn = (props) => {
|
|
527
|
+
const { data } = props ?? {};
|
|
528
|
+
return acknowledgePressReview(data, requestOptions);
|
|
529
|
+
};
|
|
530
|
+
return {
|
|
531
|
+
mutationFn,
|
|
532
|
+
...mutationOptions
|
|
533
|
+
};
|
|
534
|
+
};
|
|
535
|
+
/**
|
|
536
|
+
* @summary Acknowledge Press Review
|
|
537
|
+
*/
|
|
538
|
+
const useAcknowledgePressReview = (options, queryClient) => {
|
|
539
|
+
return useMutation(getAcknowledgePressReviewMutationOptions(options), queryClient);
|
|
540
|
+
};
|
|
69
541
|
const getListPressTitlesUrl = (params) => {
|
|
70
542
|
const normalizedParams = new URLSearchParams();
|
|
71
543
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
@@ -251,7 +723,142 @@ const getOpenReaderMutationOptions = (options) => {
|
|
|
251
723
|
const useOpenReader = (options, queryClient) => {
|
|
252
724
|
return useMutation(getOpenReaderMutationOptions(options), queryClient);
|
|
253
725
|
};
|
|
726
|
+
const getListPressTopicsUrl = (params) => {
|
|
727
|
+
const normalizedParams = new URLSearchParams();
|
|
728
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
729
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
730
|
+
});
|
|
731
|
+
const stringifiedParams = normalizedParams.toString();
|
|
732
|
+
return stringifiedParams.length > 0 ? `/biblio/press-topics?${stringifiedParams}` : `/biblio/press-topics`;
|
|
733
|
+
};
|
|
734
|
+
/**
|
|
735
|
+
* Supplied article subjects and entitled counts since an inclusive issue day.
|
|
736
|
+
*
|
|
737
|
+
* These are provider named entities, distinct from publication catalogue
|
|
738
|
+
* themes. No classification or translation is invented from a headline.
|
|
739
|
+
* @summary List Press Topics
|
|
740
|
+
*/
|
|
741
|
+
const listPressTopics = async (params, options) => {
|
|
742
|
+
return request(getListPressTopicsUrl(params), {
|
|
743
|
+
...options,
|
|
744
|
+
method: "GET"
|
|
745
|
+
});
|
|
746
|
+
};
|
|
747
|
+
const getListPressTopicsQueryKey = (params) => {
|
|
748
|
+
return [`/biblio/press-topics`, ...params ? [params] : []];
|
|
749
|
+
};
|
|
750
|
+
const getListPressTopicsQueryOptions = (params, options) => {
|
|
751
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
752
|
+
const queryKey = queryOptions?.queryKey ?? getListPressTopicsQueryKey(params);
|
|
753
|
+
const queryFn = ({ signal }) => listPressTopics(params, {
|
|
754
|
+
signal,
|
|
755
|
+
...requestOptions
|
|
756
|
+
});
|
|
757
|
+
return {
|
|
758
|
+
queryKey,
|
|
759
|
+
queryFn,
|
|
760
|
+
...queryOptions
|
|
761
|
+
};
|
|
762
|
+
};
|
|
763
|
+
/**
|
|
764
|
+
* @summary List Press Topics
|
|
765
|
+
*/
|
|
766
|
+
function useListPressTopics(params, options, queryClient) {
|
|
767
|
+
const queryOptions = getListPressTopicsQueryOptions(params, options);
|
|
768
|
+
const query = useQuery(queryOptions, queryClient);
|
|
769
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
770
|
+
}
|
|
771
|
+
const getReadReadingPreferencesUrl = () => {
|
|
772
|
+
return `/me/reading-preferences`;
|
|
773
|
+
};
|
|
774
|
+
/**
|
|
775
|
+
* Profile-selected language/press region; no location inferred from IP.
|
|
776
|
+
* @summary Read Reading Preferences
|
|
777
|
+
*/
|
|
778
|
+
const readReadingPreferences = async (options) => {
|
|
779
|
+
return request(getReadReadingPreferencesUrl(), {
|
|
780
|
+
...options,
|
|
781
|
+
method: "GET"
|
|
782
|
+
});
|
|
783
|
+
};
|
|
784
|
+
const getReadReadingPreferencesQueryKey = () => {
|
|
785
|
+
return [`/me/reading-preferences`];
|
|
786
|
+
};
|
|
787
|
+
const getReadReadingPreferencesQueryOptions = (options) => {
|
|
788
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
789
|
+
const queryKey = queryOptions?.queryKey ?? getReadReadingPreferencesQueryKey();
|
|
790
|
+
const queryFn = ({ signal }) => readReadingPreferences({
|
|
791
|
+
signal,
|
|
792
|
+
...requestOptions
|
|
793
|
+
});
|
|
794
|
+
return {
|
|
795
|
+
queryKey,
|
|
796
|
+
queryFn,
|
|
797
|
+
...queryOptions
|
|
798
|
+
};
|
|
799
|
+
};
|
|
800
|
+
/**
|
|
801
|
+
* @summary Read Reading Preferences
|
|
802
|
+
*/
|
|
803
|
+
function useReadReadingPreferences(options, queryClient) {
|
|
804
|
+
const queryOptions = getReadReadingPreferencesQueryOptions(options);
|
|
805
|
+
const query = useQuery(queryOptions, queryClient);
|
|
806
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
807
|
+
}
|
|
808
|
+
const getUpdateReadingPreferencesUrl = () => {
|
|
809
|
+
return `/me/reading-preferences`;
|
|
810
|
+
};
|
|
811
|
+
/**
|
|
812
|
+
* @summary Update Reading Preferences
|
|
813
|
+
*/
|
|
814
|
+
const updateReadingPreferences = async (readerPreferencesWrite, options) => {
|
|
815
|
+
const getHeaders = (h) => {
|
|
816
|
+
if (!h) return {};
|
|
817
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
818
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
819
|
+
const headers = {};
|
|
820
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
821
|
+
return headers;
|
|
822
|
+
};
|
|
823
|
+
return request(getUpdateReadingPreferencesUrl(), {
|
|
824
|
+
...options,
|
|
825
|
+
method: "PATCH",
|
|
826
|
+
headers: {
|
|
827
|
+
"Content-Type": "application/json",
|
|
828
|
+
...getHeaders(options?.headers)
|
|
829
|
+
},
|
|
830
|
+
body: JSON.stringify(readerPreferencesWrite)
|
|
831
|
+
});
|
|
832
|
+
};
|
|
833
|
+
const getUpdateReadingPreferencesMutationKey = () => ["updateReadingPreferences"];
|
|
834
|
+
const getUpdateReadingPreferencesMutationOptions = (options) => {
|
|
835
|
+
const mutationKey = getUpdateReadingPreferencesMutationKey();
|
|
836
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
837
|
+
...options,
|
|
838
|
+
mutation: {
|
|
839
|
+
...options.mutation,
|
|
840
|
+
mutationKey
|
|
841
|
+
}
|
|
842
|
+
} : {
|
|
843
|
+
mutation: { mutationKey },
|
|
844
|
+
request: void 0
|
|
845
|
+
};
|
|
846
|
+
const mutationFn = (props) => {
|
|
847
|
+
const { data } = props ?? {};
|
|
848
|
+
return updateReadingPreferences(data, requestOptions);
|
|
849
|
+
};
|
|
850
|
+
return {
|
|
851
|
+
mutationFn,
|
|
852
|
+
...mutationOptions
|
|
853
|
+
};
|
|
854
|
+
};
|
|
855
|
+
/**
|
|
856
|
+
* @summary Update Reading Preferences
|
|
857
|
+
*/
|
|
858
|
+
const useUpdateReadingPreferences = (options, queryClient) => {
|
|
859
|
+
return useMutation(getUpdateReadingPreferencesMutationOptions(options), queryClient);
|
|
860
|
+
};
|
|
254
861
|
//#endregion
|
|
255
|
-
export { getListPressTitlesQueryKey, getListPressTitlesQueryOptions, getListPressTitlesUrl, getOpenReaderMutationKey, getOpenReaderMutationOptions, getOpenReaderUrl, getReadIssuesQueryKey, getReadIssuesQueryOptions, getReadIssuesUrl, getReadPressFeedQueryKey, getReadPressFeedQueryOptions, getReadPressFeedUrl, getReadPressTitleQueryKey, getReadPressTitleQueryOptions, getReadPressTitleUrl, listPressTitles, openReader, readIssues, readPressFeed, readPressTitle, useListPressTitles, useOpenReader, useReadIssues, useReadPressFeed, useReadPressTitle };
|
|
862
|
+
export { acknowledgePressReview, claimPressPartnerCode, followPressTopic, getAcknowledgePressReviewMutationKey, getAcknowledgePressReviewMutationOptions, getAcknowledgePressReviewUrl, getClaimPressPartnerCodeMutationKey, getClaimPressPartnerCodeMutationOptions, getClaimPressPartnerCodeUrl, getFollowPressTopicMutationKey, getFollowPressTopicMutationOptions, getFollowPressTopicUrl, getListPressArticlesQueryKey, getListPressArticlesQueryOptions, getListPressArticlesUrl, getListPressPartnerAccessQueryKey, getListPressPartnerAccessQueryOptions, getListPressPartnerAccessUrl, getListPressTitlesQueryKey, getListPressTitlesQueryOptions, getListPressTitlesUrl, getListPressTopicsQueryKey, getListPressTopicsQueryOptions, getListPressTopicsUrl, getOpenPressArticleReaderMutationKey, getOpenPressArticleReaderMutationOptions, getOpenPressArticleReaderUrl, getOpenReaderMutationKey, getOpenReaderMutationOptions, getOpenReaderUrl, getReadIssuesQueryKey, getReadIssuesQueryOptions, getReadIssuesUrl, getReadPressArticleQueryKey, getReadPressArticleQueryOptions, getReadPressArticleUrl, getReadPressFacetsQueryKey, getReadPressFacetsQueryOptions, getReadPressFacetsUrl, getReadPressFeedQueryKey, getReadPressFeedQueryOptions, getReadPressFeedUrl, getReadPressPartnerAccessQueryKey, getReadPressPartnerAccessQueryOptions, getReadPressPartnerAccessUrl, getReadPressReviewQueryKey, getReadPressReviewQueryOptions, getReadPressReviewUrl, getReadPressTitleQueryKey, getReadPressTitleQueryOptions, getReadPressTitleUrl, getReadReadingPreferencesQueryKey, getReadReadingPreferencesQueryOptions, getReadReadingPreferencesUrl, getUnfollowPressTopicMutationKey, getUnfollowPressTopicMutationOptions, getUnfollowPressTopicUrl, getUpdateReadingPreferencesMutationKey, getUpdateReadingPreferencesMutationOptions, getUpdateReadingPreferencesUrl, listPressArticles, listPressPartnerAccess, listPressTitles, listPressTopics, openPressArticleReader, openReader, readIssues, readPressArticle, readPressFacets, readPressFeed, readPressPartnerAccess, readPressReview, readPressTitle, readReadingPreferences, unfollowPressTopic, updateReadingPreferences, useAcknowledgePressReview, useClaimPressPartnerCode, useFollowPressTopic, useListPressArticles, useListPressPartnerAccess, useListPressTitles, useListPressTopics, useOpenPressArticleReader, useOpenReader, useReadIssues, useReadPressArticle, useReadPressFacets, useReadPressFeed, useReadPressPartnerAccess, useReadPressReview, useReadPressTitle, useReadReadingPreferences, useUnfollowPressTopic, useUpdateReadingPreferences };
|
|
256
863
|
|
|
257
864
|
//# sourceMappingURL=biblio-press.js.map
|