@plyaz/api 1.7.4 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/api/endpoints/index.d.ts +9 -0
  2. package/dist/api/endpoints/index.d.ts.map +1 -1
  3. package/dist/api/endpoints/notification.d.ts +72 -0
  4. package/dist/api/endpoints/notification.d.ts.map +1 -0
  5. package/dist/api/services/index.d.ts +1 -0
  6. package/dist/api/services/index.d.ts.map +1 -1
  7. package/dist/api/services/notification/DELETE/deleteNotification.d.ts +25 -0
  8. package/dist/api/services/notification/DELETE/deleteNotification.d.ts.map +1 -0
  9. package/dist/api/services/notification/DELETE/index.d.ts +12 -0
  10. package/dist/api/services/notification/DELETE/index.d.ts.map +1 -0
  11. package/dist/api/services/notification/DELETE/useDeleteNotification.d.ts +34 -0
  12. package/dist/api/services/notification/DELETE/useDeleteNotification.d.ts.map +1 -0
  13. package/dist/api/services/notification/GET/fetchNotifications.d.ts +26 -0
  14. package/dist/api/services/notification/GET/fetchNotifications.d.ts.map +1 -0
  15. package/dist/api/services/notification/GET/index.d.ts +12 -0
  16. package/dist/api/services/notification/GET/index.d.ts.map +1 -0
  17. package/dist/api/services/notification/GET/useNotifications.d.ts +32 -0
  18. package/dist/api/services/notification/GET/useNotifications.d.ts.map +1 -0
  19. package/dist/api/services/notification/index.d.ts +14 -0
  20. package/dist/api/services/notification/index.d.ts.map +1 -0
  21. package/dist/entry-frontend.cjs +99 -1
  22. package/dist/entry-frontend.cjs.map +1 -1
  23. package/dist/entry-frontend.mjs +95 -2
  24. package/dist/entry-frontend.mjs.map +1 -1
  25. package/dist/index.cjs +99 -1
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.mjs +95 -2
  28. package/dist/index.mjs.map +1 -1
  29. package/package.json +2 -2
package/dist/index.cjs CHANGED
@@ -14258,6 +14258,32 @@ var cdnEndpoints = {
14258
14258
  ...fastlyEndpoints
14259
14259
  };
14260
14260
 
14261
+ // src/api/endpoints/notification.ts
14262
+ var notificationEndpoints = {
14263
+ // ==========================================================================
14264
+ // GET ENDPOINTS
14265
+ // ==========================================================================
14266
+ /**
14267
+ * GET /notifications
14268
+ * List all notifications with optional filters
14269
+ */
14270
+ listNotifications: {
14271
+ url: "/notifications",
14272
+ method: "GET"
14273
+ },
14274
+ // ==========================================================================
14275
+ // DELETE ENDPOINTS
14276
+ // ==========================================================================
14277
+ /**
14278
+ * DELETE /notifications/:id
14279
+ * Delete a notification
14280
+ */
14281
+ deleteNotification: {
14282
+ url: "/notifications/:id",
14283
+ method: "DELETE"
14284
+ }
14285
+ };
14286
+
14261
14287
  // src/api/endpoints/utils.ts
14262
14288
  function getEndpointUrl(name) {
14263
14289
  return endpoints[name].url;
@@ -14442,7 +14468,8 @@ var endpoints = {
14442
14468
  // CDN provider endpoints (Cloudflare, CloudFront, Fastly)
14443
14469
  ...cloudflareEndpoints,
14444
14470
  ...cloudFrontEndpoints,
14445
- ...fastlyEndpoints
14471
+ ...fastlyEndpoints,
14472
+ ...notificationEndpoints
14446
14473
  };
14447
14474
  var isSlowConnection = fetchff.isSlowConnection;
14448
14475
  function isNetworkAPISupported() {
@@ -27187,6 +27214,72 @@ function useDeleteFile(serviceOptions, mutationOptions) {
27187
27214
  })(serviceOptions, mutationOptions);
27188
27215
  }
27189
27216
  __name(useDeleteFile, "useDeleteFile");
27217
+
27218
+ // src/api/services/notification/GET/fetchNotifications.ts
27219
+ async function fetchNotifications(filters, options) {
27220
+ const client = options?.apiClient ?? getDefaultApiClient();
27221
+ const serviceDefaults = { unifiedStrategy: "interactive" };
27222
+ const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
27223
+ const updateOptions = {
27224
+ strategy: "temporary",
27225
+ ...options?.updateConfigOptions
27226
+ };
27227
+ if (shouldApplyConfig(mergedConfig, updateOptions)) {
27228
+ client.updateConfig(mergedConfig, updateOptions);
27229
+ }
27230
+ return client.listNotifications({
27231
+ params: filters
27232
+ });
27233
+ }
27234
+ __name(fetchNotifications, "fetchNotifications");
27235
+ function useNotifications(queryKey, filters, serviceOptions, queryOptions) {
27236
+ return createApiQuery(fetchNotifications, {
27237
+ apiConfig: {
27238
+ unifiedStrategy: "interactive"
27239
+ },
27240
+ staleTime: config.TIME_CONSTANTS.TEN_MINUTES
27241
+ })(queryKey, filters, serviceOptions, queryOptions);
27242
+ }
27243
+ __name(useNotifications, "useNotifications");
27244
+
27245
+ // src/api/services/notification/DELETE/deleteNotification.ts
27246
+ async function deleteNotification(id, options) {
27247
+ const client = options?.apiClient ?? getDefaultApiClient();
27248
+ const serviceDefaults = {
27249
+ unifiedStrategy: "mutation"
27250
+ };
27251
+ const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
27252
+ const updateOptions = {
27253
+ strategy: "temporary",
27254
+ ...options?.updateConfigOptions
27255
+ };
27256
+ if (shouldApplyConfig(mergedConfig, updateOptions)) {
27257
+ client.updateConfig(mergedConfig, updateOptions);
27258
+ }
27259
+ const pathParams = { id };
27260
+ return client.deleteNotification({
27261
+ urlPathParams: pathParams
27262
+ });
27263
+ }
27264
+ __name(deleteNotification, "deleteNotification");
27265
+ function useDeleteNotification(serviceOptions, mutationOptions) {
27266
+ const queryClient = reactQuery.useQueryClient();
27267
+ return createApiMutation(
27268
+ deleteNotification,
27269
+ {
27270
+ onSuccess: /* @__PURE__ */ __name((_data, id) => {
27271
+ void queryClient.invalidateQueries({
27272
+ queryKey: ["notifications"]
27273
+ });
27274
+ queryClient.removeQueries({
27275
+ queryKey: ["notification", id]
27276
+ });
27277
+ }, "onSuccess"),
27278
+ ...mutationOptions
27279
+ }
27280
+ )(serviceOptions, mutationOptions);
27281
+ }
27282
+ __name(useDeleteNotification, "useDeleteNotification");
27190
27283
  function getSSRSafeConfig(config) {
27191
27284
  if (!isBrowser()) {
27192
27285
  return {
@@ -27756,6 +27849,7 @@ exports.deleteCache = deleteCache;
27756
27849
  exports.deleteCampaign = deleteCampaign;
27757
27850
  exports.deleteFeatureFlag = deleteFeatureFlag;
27758
27851
  exports.deleteFile = deleteFile;
27852
+ exports.deleteNotification = deleteNotification;
27759
27853
  exports.detectConfigConflicts = detectConfigConflicts;
27760
27854
  exports.detectConflicts = detectConflicts;
27761
27855
  exports.detectPlatform = detectPlatform;
@@ -27790,6 +27884,7 @@ exports.fetchInfobipEmailReports = fetchInfobipEmailReports;
27790
27884
  exports.fetchInfobipScheduledEmailStatuses = fetchInfobipScheduledEmailStatuses;
27791
27885
  exports.fetchInfobipScheduledEmails = fetchInfobipScheduledEmails;
27792
27886
  exports.fetchInfobipValidations = fetchInfobipValidations;
27887
+ exports.fetchNotifications = fetchNotifications;
27793
27888
  exports.filesEndpoints = filesEndpoints;
27794
27889
  exports.filterHistory = filterHistory;
27795
27890
  exports.filterObject = filterObject;
@@ -28046,6 +28141,7 @@ exports.networkDetectionMiddleware = networkDetectionMiddleware;
28046
28141
  exports.networkPresets = networkPresets;
28047
28142
  exports.networkStatus = networkStatus;
28048
28143
  exports.normalizeHeaders = normalizeHeaders2;
28144
+ exports.notificationEndpoints = notificationEndpoints;
28049
28145
  exports.now = now;
28050
28146
  exports.nowInSeconds = nowInSeconds;
28051
28147
  exports.omit = omit;
@@ -28172,6 +28268,7 @@ exports.useDebouncedSubscription = useDebouncedSubscription;
28172
28268
  exports.useDeleteCampaign = useDeleteCampaign;
28173
28269
  exports.useDeleteFeatureFlag = useDeleteFeatureFlag;
28174
28270
  exports.useDeleteFile = useDeleteFile;
28271
+ exports.useDeleteNotification = useDeleteNotification;
28175
28272
  exports.useDownloadFile = useDownloadFile;
28176
28273
  exports.useEvaluateAllFeatureFlags = useEvaluateAllFeatureFlags;
28177
28274
  exports.useGenerateDocument = useGenerateDocument;
@@ -28180,6 +28277,7 @@ exports.useGetSignedUrl = useGetSignedUrl;
28180
28277
  exports.useJoinCampaign = useJoinCampaign;
28181
28278
  exports.useLeaveCampaign = useLeaveCampaign;
28182
28279
  exports.useMultipleSubscriptions = useMultipleSubscriptions;
28280
+ exports.useNotifications = useNotifications;
28183
28281
  exports.useOptimisticUpdate = useOptimisticUpdate;
28184
28282
  exports.useRealTimeData = useRealTimeData;
28185
28283
  exports.useRemoveFeatureFlagOverride = useRemoveFeatureFlagOverride;