@plyaz/api 1.7.3 → 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.
- package/dist/api/cache/strategies.d.ts.map +1 -1
- package/dist/api/client/createApiClient.d.ts.map +1 -1
- package/dist/api/client/helpers/interceptors.d.ts +2 -2
- package/dist/api/client/helpers/interceptors.d.ts.map +1 -1
- package/dist/api/endpoints/index.d.ts +9 -0
- package/dist/api/endpoints/index.d.ts.map +1 -1
- package/dist/api/endpoints/notification.d.ts +72 -0
- package/dist/api/endpoints/notification.d.ts.map +1 -0
- package/dist/api/services/index.d.ts +1 -0
- package/dist/api/services/index.d.ts.map +1 -1
- package/dist/api/services/notification/DELETE/deleteNotification.d.ts +25 -0
- package/dist/api/services/notification/DELETE/deleteNotification.d.ts.map +1 -0
- package/dist/api/services/notification/DELETE/index.d.ts +12 -0
- package/dist/api/services/notification/DELETE/index.d.ts.map +1 -0
- package/dist/api/services/notification/DELETE/useDeleteNotification.d.ts +34 -0
- package/dist/api/services/notification/DELETE/useDeleteNotification.d.ts.map +1 -0
- package/dist/api/services/notification/GET/fetchNotifications.d.ts +26 -0
- package/dist/api/services/notification/GET/fetchNotifications.d.ts.map +1 -0
- package/dist/api/services/notification/GET/index.d.ts +12 -0
- package/dist/api/services/notification/GET/index.d.ts.map +1 -0
- package/dist/api/services/notification/GET/useNotifications.d.ts +32 -0
- package/dist/api/services/notification/GET/useNotifications.d.ts.map +1 -0
- package/dist/api/services/notification/index.d.ts +14 -0
- package/dist/api/services/notification/index.d.ts.map +1 -0
- package/dist/api/strategies/unified.d.ts.map +1 -1
- package/dist/entry-frontend.cjs +196 -23
- package/dist/entry-frontend.cjs.map +1 -1
- package/dist/entry-frontend.mjs +192 -24
- package/dist/entry-frontend.mjs.map +1 -1
- package/dist/index.cjs +196 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +192 -24
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strategies.d.ts","sourceRoot":"","sources":["../../../src/api/cache/strategies.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAoB,MAAM,kBAAkB,CAAC;AAGjG;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,
|
|
1
|
+
{"version":3,"file":"strategies.d.ts","sourceRoot":"","sources":["../../../src/api/cache/strategies.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAoB,MAAM,kBAAkB,CAAC;AAGjG;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAyE3E,CAAC;AAEX;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG,mBAAmB,CAMpF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,GAAG,mBAAmB,CAiC7E;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,OAAO,EAAE,CAAC,mBAAmB,GAAG,SAAS,CAAC,EAAE,GAC9C,mBAAmB,CAiBrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createApiClient.d.ts","sourceRoot":"","sources":["../../../src/api/client/createApiClient.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAEV,gBAAgB,EAOhB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"createApiClient.d.ts","sourceRoot":"","sources":["../../../src/api/client/createApiClient.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAEV,gBAAgB,EAOhB,mBAAmB,EASpB,MAAM,kBAAkB,CAAC;AAgC1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAo1B/D,wBAAsB,eAAe,CACnC,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,aAAa,CAAC,CAAC,CAkIjE"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Handles request/response interceptor chains and transformations
|
|
4
4
|
*/
|
|
5
5
|
import type { RequestConfig } from 'fetchff';
|
|
6
|
-
import type {
|
|
6
|
+
import type { ResponseInterceptor, ErrorInterceptor, RetryInterceptor, ApiClientOptions, SetupUnifiedHandlersParams, OnRequestHandlerOptions } from '@plyaz/types/api';
|
|
7
7
|
/**
|
|
8
8
|
* Create unified onRetry handler that triggers ApiConfig.onRetry[] and emits events
|
|
9
9
|
*/
|
|
@@ -11,7 +11,7 @@ export declare function createOnRetryHandler(handlers: RetryInterceptor[] | unde
|
|
|
11
11
|
/**
|
|
12
12
|
* Create unified onRequest handler that triggers ApiConfig.onRequest[] and emits events
|
|
13
13
|
*/
|
|
14
|
-
export declare function createOnRequestHandler(
|
|
14
|
+
export declare function createOnRequestHandler(options: OnRequestHandlerOptions): RequestConfig<unknown, unknown, unknown, unknown>['onRequest'];
|
|
15
15
|
/**
|
|
16
16
|
* Create unified onResponse handler that triggers ApiConfig.onResponse[] and emits events
|
|
17
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interceptors.d.ts","sourceRoot":"","sources":["../../../../src/api/client/helpers/interceptors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAgC,MAAM,SAAS,CAAC;AAM3E,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"interceptors.d.ts","sourceRoot":"","sources":["../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,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC;IAC1E,UAAU,EAAE,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC;IAC5E,OAAO,EAAE,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC;IACtE,OAAO,EAAE,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC;CACvE,CAsEA"}
|
|
@@ -7,6 +7,14 @@
|
|
|
7
7
|
* This is passed to createApiClient to generate endpoint methods
|
|
8
8
|
*/
|
|
9
9
|
export declare const endpoints: {
|
|
10
|
+
readonly listNotifications: {
|
|
11
|
+
readonly url: "/notifications";
|
|
12
|
+
readonly method: "GET";
|
|
13
|
+
};
|
|
14
|
+
readonly deleteNotification: {
|
|
15
|
+
readonly url: "/notifications/:id";
|
|
16
|
+
readonly method: "DELETE";
|
|
17
|
+
};
|
|
10
18
|
readonly fastlyPurgeUrl: {
|
|
11
19
|
readonly url: "/service/:serviceId/purge/:url";
|
|
12
20
|
readonly method: "POST";
|
|
@@ -256,4 +264,5 @@ export { cdnEndpoints, cloudflareEndpoints, cloudFrontEndpoints, fastlyEndpoints
|
|
|
256
264
|
*/
|
|
257
265
|
export { getEndpointUrl, getAllEndpointUrls, hasEndpoint, getEndpointConfig, buildEndpointUrl, getEndpointParams, hasPathParams, getEndpointMetadata, buildUrl, extractUrlParams, } from './utils';
|
|
258
266
|
export { endpointCacheKey, endpointCachePattern, findEndpointsByPattern, getEndpointsByMethod, endpointCachePatterns, buildFullUrl, validatePathParams, } from './builders';
|
|
267
|
+
export { notificationEndpoints } from './notification';
|
|
259
268
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/endpoints/index.ts"],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B,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ============================================================================
|
|
3
|
+
* ENDPOINT DEFINITIONS - Notification
|
|
4
|
+
* ============================================================================
|
|
5
|
+
*
|
|
6
|
+
* Location: @plyaz/api/src/api/endpoints/notification.ts
|
|
7
|
+
*
|
|
8
|
+
* ============================================================================
|
|
9
|
+
* TODO: INTEGRATION STEPS (REQUIRED)
|
|
10
|
+
* ============================================================================
|
|
11
|
+
*
|
|
12
|
+
* 1. UPDATE @plyaz/api/src/api/endpoints/index.ts:
|
|
13
|
+
*
|
|
14
|
+
* // Add import at top:
|
|
15
|
+
* import { notificationEndpoints } from './notification';
|
|
16
|
+
*
|
|
17
|
+
* // Add to endpoints object:
|
|
18
|
+
* export const endpoints = {
|
|
19
|
+
* ...notificationEndpoints,
|
|
20
|
+
* // ... other endpoints
|
|
21
|
+
* } as const;
|
|
22
|
+
*
|
|
23
|
+
* // Add export for selective imports:
|
|
24
|
+
* export { notificationEndpoints } from './notification';
|
|
25
|
+
*
|
|
26
|
+
* 2. UPDATE @plyaz/types/src/api/endpoints/types.ts:
|
|
27
|
+
*
|
|
28
|
+
* // Add import:
|
|
29
|
+
* import type { NotificationEndpointTypes } from './notification';
|
|
30
|
+
*
|
|
31
|
+
* // Extend EndpointTypes interface:
|
|
32
|
+
* export interface EndpointTypes
|
|
33
|
+
* extends CampaignEndpointTypes,
|
|
34
|
+
* // ... other types
|
|
35
|
+
* NotificationEndpointTypes { // <-- ADD THIS
|
|
36
|
+
* }
|
|
37
|
+
*
|
|
38
|
+
* ============================================================================
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* Notification API Endpoints
|
|
42
|
+
*
|
|
43
|
+
* Available endpoints:
|
|
44
|
+
* - [x] GET /notifications - listNotifications
|
|
45
|
+
* - [x] DELETE /notifications/:id - deleteNotification
|
|
46
|
+
*
|
|
47
|
+
* Note: Notifications are created via @plyaz/notifications package,
|
|
48
|
+
* not directly via API. No POST/PUT/PATCH/GET-by-ID endpoints.
|
|
49
|
+
*/
|
|
50
|
+
export declare const notificationEndpoints: {
|
|
51
|
+
/**
|
|
52
|
+
* GET /notifications
|
|
53
|
+
* List all notifications with optional filters
|
|
54
|
+
*/
|
|
55
|
+
readonly listNotifications: {
|
|
56
|
+
readonly url: "/notifications";
|
|
57
|
+
readonly method: "GET";
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* DELETE /notifications/:id
|
|
61
|
+
* Delete a notification
|
|
62
|
+
*/
|
|
63
|
+
readonly deleteNotification: {
|
|
64
|
+
readonly url: "/notifications/:id";
|
|
65
|
+
readonly method: "DELETE";
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Type for Notification endpoint keys
|
|
70
|
+
*/
|
|
71
|
+
export type NotificationEndpointKey = keyof typeof notificationEndpoints;
|
|
72
|
+
//# sourceMappingURL=notification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../../src/api/endpoints/notification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB;IAKhC;;;OAGG;;;;;IAUH;;;OAGG;;;;;CAKK,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,OAAO,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/services/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGrE,cAAc,aAAa,CAAC;AAG5B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,WAAW,CAAC;AAG1B,cAAc,cAAc,CAAC;AAG7B,cAAc,OAAO,CAAC;AAGtB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/services/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGrE,cAAc,aAAa,CAAC;AAG5B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,WAAW,CAAC;AAG1B,cAAc,cAAc,CAAC;AAG7B,cAAc,OAAO,CAAC;AAGtB,cAAc,SAAS,CAAC;AAGxB,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delete Notification Service
|
|
3
|
+
* Deletes a notification by ID
|
|
4
|
+
*/
|
|
5
|
+
import type { ServiceOptions } from '@plyaz/types/api';
|
|
6
|
+
import type { EndpointsList } from '@/api/endpoints';
|
|
7
|
+
import type { FetchResponse } from 'fetchff';
|
|
8
|
+
/**
|
|
9
|
+
* Delete a notification
|
|
10
|
+
*
|
|
11
|
+
* @param id - Notification ID to delete
|
|
12
|
+
* @param options - Service options (apiClient, apiConfig)
|
|
13
|
+
* @returns Promise resolving to deletion confirmation
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const response = await deleteNotification(
|
|
18
|
+
* '123',
|
|
19
|
+
* { apiClient: myClient }
|
|
20
|
+
* );
|
|
21
|
+
* console.log(response.success);
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function deleteNotification<TEndpoints = EndpointsList>(id: string, options?: ServiceOptions<TEndpoints>): Promise<FetchResponse>;
|
|
25
|
+
//# sourceMappingURL=deleteNotification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteNotification.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/notification/DELETE/deleteNotification.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,kBAAkB,CAAC,UAAU,GAAG,aAAa,EACjE,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,GACnC,OAAO,CAAC,aAAa,CAAC,CA0BxB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ============================================================================
|
|
3
|
+
* DELETE operations for Notification
|
|
4
|
+
* ============================================================================
|
|
5
|
+
*
|
|
6
|
+
* Location: @plyaz/api/src/api/services/notification/DELETE/index.ts
|
|
7
|
+
*
|
|
8
|
+
* ============================================================================
|
|
9
|
+
*/
|
|
10
|
+
export { deleteNotification } from './deleteNotification';
|
|
11
|
+
export { useDeleteNotification } from './useDeleteNotification';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/notification/DELETE/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Query Mutation Hook for Deleting Notifications
|
|
3
|
+
* Provides mutation state and cache invalidation
|
|
4
|
+
*/
|
|
5
|
+
import { createApiMutation } from '../../../hooks/factories';
|
|
6
|
+
import type { ServiceOptions } from '@plyaz/types/api';
|
|
7
|
+
import type { ErrorResponse } from '@plyaz/types/errors';
|
|
8
|
+
import type { EndpointsList } from '@/api/endpoints';
|
|
9
|
+
import type { DeleteNotificationResponse } from '@plyaz/types/api';
|
|
10
|
+
/**
|
|
11
|
+
* Hook for deleting notifications
|
|
12
|
+
*
|
|
13
|
+
* @param serviceOptions - Service options (apiClient, apiConfig, updateConfigOptions)
|
|
14
|
+
* @param mutationOptions - React Query mutation options
|
|
15
|
+
* @returns React Query mutation result
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const { mutate, isPending } = useDeleteNotification();
|
|
20
|
+
*
|
|
21
|
+
* const handleDelete = (notificationId: string) => {
|
|
22
|
+
* mutate(notificationId, {
|
|
23
|
+
* onSuccess: () => {
|
|
24
|
+
* toast.success('Notification deleted');
|
|
25
|
+
* },
|
|
26
|
+
* onError: (error) => {
|
|
27
|
+
* toast.error(`Failed to delete: ${error.message}`);
|
|
28
|
+
* }
|
|
29
|
+
* });
|
|
30
|
+
* };
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function useDeleteNotification<TEndpoints = EndpointsList>(serviceOptions?: ServiceOptions<TEndpoints>, mutationOptions?: Parameters<ReturnType<typeof createApiMutation<DeleteNotificationResponse, ErrorResponse, string, unknown, TEndpoints>>>[1]): ReturnType<ReturnType<typeof createApiMutation<DeleteNotificationResponse, ErrorResponse, string, unknown, TEndpoints>>>;
|
|
34
|
+
//# sourceMappingURL=useDeleteNotification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDeleteNotification.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/notification/DELETE/useDeleteNotification.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,GAAG,aAAa,EAC9D,cAAc,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,EAC3C,eAAe,CAAC,EAAE,UAAU,CAC1B,UAAU,CACR,OAAO,iBAAiB,CACtB,0BAA0B,EAC1B,aAAa,EACb,MAAM,EACN,OAAO,EACP,UAAU,CACX,CACF,CACF,CAAC,CAAC,CAAC,GACH,UAAU,CACX,UAAU,CACR,OAAO,iBAAiB,CAAC,0BAA0B,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,CACjG,CACF,CAoBA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetch Notifications Service
|
|
3
|
+
* Lists notifications with optional filters
|
|
4
|
+
*/
|
|
5
|
+
import type { ServiceOptions } from '@plyaz/types/api';
|
|
6
|
+
import type { EndpointsList } from '@/api/endpoints';
|
|
7
|
+
import type { FetchResponse } from 'fetchff';
|
|
8
|
+
import type { ListNotificationFilters } from '@plyaz/types/api';
|
|
9
|
+
/**
|
|
10
|
+
* Fetch list of notifications with optional filters
|
|
11
|
+
*
|
|
12
|
+
* @param filters - Optional query filters (page, limit, status, etc.)
|
|
13
|
+
* @param options - Service options (apiClient, apiConfig)
|
|
14
|
+
* @returns Promise resolving to paginated list of notifications
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const response = await fetchNotifications(
|
|
19
|
+
* { page: 1, limit: 20, status: 'sent' },
|
|
20
|
+
* { apiClient: myClient }
|
|
21
|
+
* );
|
|
22
|
+
* console.log(response.data, response.pagination);
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function fetchNotifications<TEndpoints = EndpointsList>(filters?: ListNotificationFilters, options?: ServiceOptions<TEndpoints>): Promise<FetchResponse>;
|
|
26
|
+
//# sourceMappingURL=fetchNotifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchNotifications.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/notification/GET/fetchNotifications.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEhE;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,kBAAkB,CAAC,UAAU,GAAG,aAAa,EACjE,OAAO,CAAC,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,GACnC,OAAO,CAAC,aAAa,CAAC,CAkBxB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ============================================================================
|
|
3
|
+
* GET operations for Notification
|
|
4
|
+
* ============================================================================
|
|
5
|
+
*
|
|
6
|
+
* Location: @plyaz/api/src/api/services/notification/GET/index.ts
|
|
7
|
+
*
|
|
8
|
+
* ============================================================================
|
|
9
|
+
*/
|
|
10
|
+
export { fetchNotifications } from './fetchNotifications';
|
|
11
|
+
export { useNotifications } from './useNotifications';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/notification/GET/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Query Hook for Listing Notifications
|
|
3
|
+
* Provides query state and caching
|
|
4
|
+
*/
|
|
5
|
+
import type { ServiceOptions, QueryKey, UseQueryResult, ApiQueryOptions } from '@plyaz/types/api';
|
|
6
|
+
import type { ListNotificationFilters, ListNotificationResponse } from '@plyaz/types/api';
|
|
7
|
+
import type { ErrorResponse } from '@plyaz/types/errors';
|
|
8
|
+
import type { EndpointsList } from '@/api/endpoints';
|
|
9
|
+
/**
|
|
10
|
+
* Hook for fetching list of notifications
|
|
11
|
+
*
|
|
12
|
+
* @param queryKey - React Query cache key
|
|
13
|
+
* @param filters - Optional query filters (page, limit, status, etc.)
|
|
14
|
+
* @param serviceOptions - Service options (apiClient, apiConfig, updateConfigOptions)
|
|
15
|
+
* @param queryOptions - React Query options
|
|
16
|
+
* @returns React Query result
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const { data, isLoading } = useNotifications(
|
|
21
|
+
* ['notifications', { page: 1 }],
|
|
22
|
+
* { page: 1, limit: 20, status: 'sent' },
|
|
23
|
+
* undefined,
|
|
24
|
+
* { enabled: true }
|
|
25
|
+
* );
|
|
26
|
+
*
|
|
27
|
+
* if (isLoading) return <Spinner />;
|
|
28
|
+
* return <div>{data?.data.length} notifications</div>;
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare function useNotifications<TEndpoints = EndpointsList>(queryKey: QueryKey, filters?: ListNotificationFilters, serviceOptions?: ServiceOptions<TEndpoints>, queryOptions?: Omit<ApiQueryOptions<ListNotificationResponse, ErrorResponse>, 'apiClient' | 'apiConfig'>): UseQueryResult<ListNotificationResponse, ErrorResponse>;
|
|
32
|
+
//# sourceMappingURL=useNotifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNotifications.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/notification/GET/useNotifications.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAClG,OAAO,KAAK,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC1F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,GAAG,aAAa,EACzD,QAAQ,EAAE,QAAQ,EAClB,OAAO,CAAC,EAAE,uBAAuB,EACjC,cAAc,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,EAC3C,YAAY,CAAC,EAAE,IAAI,CACjB,eAAe,CAAC,wBAAwB,EAAE,aAAa,CAAC,EACxD,WAAW,GAAG,WAAW,CAC1B,GACA,cAAc,CAAC,wBAAwB,EAAE,aAAa,CAAC,CAczD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ============================================================================
|
|
3
|
+
* SERVICE INDEX - Notification
|
|
4
|
+
* ============================================================================
|
|
5
|
+
*
|
|
6
|
+
* Location: @plyaz/api/src/api/services/notification/index.ts
|
|
7
|
+
*
|
|
8
|
+
* Aggregates all notification operations
|
|
9
|
+
*
|
|
10
|
+
* ============================================================================
|
|
11
|
+
*/
|
|
12
|
+
export * from './GET';
|
|
13
|
+
export * from './DELETE';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/services/notification/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unified.d.ts","sourceRoot":"","sources":["../../../src/api/strategies/unified.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAEV,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAK1B,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEpG;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,mBAAmB,EAAE,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"unified.d.ts","sourceRoot":"","sources":["../../../src/api/strategies/unified.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAEV,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAK1B,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEpG;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,mBAAmB,EAAE,eAAe,CAAC,CAuF3E,CAAC;AAEX;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,mBAAmB,GAAG,qBAAqB,CAS7F;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,mBAAmB,GAAG,eAAe,CAyB7E;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,mBAAmB,EACjC,SAAS,GAAE,OAAO,CAAC,eAAe,CAAM,GACvC,eAAe,CAOjB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,mBAAmB,CAElF;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,mBAAmB,E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