@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.
@@ -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;