@szymonpiatek/nextwordpress 0.0.11 → 0.0.12
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/client/index.cjs +73 -0
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +2 -2
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +71 -1
- package/dist/client/index.js.map +1 -1
- package/dist/hooks/index.cjs +73 -0
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.cts +11 -2
- package/dist/hooks/index.d.ts +11 -2
- package/dist/hooks/index.js +71 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.cjs +34 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -3
- package/dist/index.d.ts +14 -3
- package/dist/index.js +33 -1
- package/dist/index.js.map +1 -1
- package/dist/server/index.cjs +34 -0
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +2 -2
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +33 -1
- package/dist/server/index.js.map +1 -1
- package/dist/{types-Dxb6tuW_.d.cts → types-WcyioRuq.d.cts} +33 -1
- package/dist/{types-Dxb6tuW_.d.ts → types-WcyioRuq.d.ts} +33 -1
- package/package.json +1 -1
package/dist/server/index.cjs
CHANGED
|
@@ -2101,6 +2101,38 @@ function createWooCommerceClient(config) {
|
|
|
2101
2101
|
};
|
|
2102
2102
|
}
|
|
2103
2103
|
|
|
2104
|
+
// src/integrations/restApi/wpulike/queries.ts
|
|
2105
|
+
function createWPULikeQueries(fetcher) {
|
|
2106
|
+
const { wpFetch, wpMutate } = fetcher;
|
|
2107
|
+
async function getLikeStats(params, tags) {
|
|
2108
|
+
return wpFetch(
|
|
2109
|
+
"/wp-json/wp-ulike/v1/stats",
|
|
2110
|
+
params,
|
|
2111
|
+
tags ?? ["wpulike", `wpulike-${params.id}`]
|
|
2112
|
+
);
|
|
2113
|
+
}
|
|
2114
|
+
async function checkLikeStatus(params, tags) {
|
|
2115
|
+
return wpFetch(
|
|
2116
|
+
"/wp-json/wp-ulike/v1/check",
|
|
2117
|
+
params,
|
|
2118
|
+
tags ?? ["wpulike", `wpulike-${params.id}`]
|
|
2119
|
+
);
|
|
2120
|
+
}
|
|
2121
|
+
async function vote(params, authToken) {
|
|
2122
|
+
return wpMutate(
|
|
2123
|
+
"/wp-json/wp-ulike/v1/vote",
|
|
2124
|
+
params,
|
|
2125
|
+
"POST",
|
|
2126
|
+
authToken
|
|
2127
|
+
);
|
|
2128
|
+
}
|
|
2129
|
+
return { getLikeStats, checkLikeStatus, vote };
|
|
2130
|
+
}
|
|
2131
|
+
function createWPULikeClient(config) {
|
|
2132
|
+
const fetcher = createFetcher(config);
|
|
2133
|
+
return createWPULikeQueries(fetcher);
|
|
2134
|
+
}
|
|
2135
|
+
|
|
2104
2136
|
// src/integrations/wpGraphQL/client/types.ts
|
|
2105
2137
|
var WPGraphQLError = class extends Error {
|
|
2106
2138
|
constructor(code, status, endpoint, message, gqlErrors) {
|
|
@@ -4257,6 +4289,8 @@ exports.createWPGraphQLCoreClient = createWPGraphQLCoreClient;
|
|
|
4257
4289
|
exports.createWPGraphQLFetcher = createWPGraphQLFetcher;
|
|
4258
4290
|
exports.createWPGraphQLMutationsClient = createWPGraphQLMutationsClient;
|
|
4259
4291
|
exports.createWPGraphQLWooCommerceClient = createWPGraphQLWooCommerceClient;
|
|
4292
|
+
exports.createWPULikeClient = createWPULikeClient;
|
|
4293
|
+
exports.createWPULikeQueries = createWPULikeQueries;
|
|
4260
4294
|
exports.createWooCommerceClient = createWooCommerceClient;
|
|
4261
4295
|
exports.createWooCommerceFetcher = createWooCommerceFetcher;
|
|
4262
4296
|
exports.createWordPressClient = createWordPressClient;
|