@plyaz/types 1.45.6 → 1.45.8

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.
@@ -161,21 +161,23 @@ export declare const QueryNotificationsSchema: z.ZodObject<{
161
161
  export type QueryNotificationsDTO = z.input<typeof QueryNotificationsSchema>;
162
162
  /**
163
163
  * Create Notifications Schema (for backend)
164
+ * Uses camelCase for input (matching entity format)
165
+ * Mapper converts to snake_case for database
164
166
  */
165
167
  export declare const CreateNotificationsSchema: z.ZodObject<{
166
- user_id: z.ZodString;
168
+ userId: z.ZodString;
167
169
  type: z.ZodEnum<{
168
170
  SYSTEM: "SYSTEM";
169
171
  CAMPAIGN_BACKED: "CAMPAIGN_BACKED";
170
172
  }>;
171
173
  title: z.ZodString;
172
174
  message: z.ZodString;
173
- link_url: z.ZodOptional<z.ZodString>;
174
- reference_id: z.ZodOptional<z.ZodString>;
175
- reference_type: z.ZodOptional<z.ZodString>;
176
- correlation_id: z.ZodOptional<z.ZodString>;
177
- recipient_id: z.ZodString;
178
- template_id: z.ZodOptional<z.ZodString>;
175
+ linkUrl: z.ZodOptional<z.ZodString>;
176
+ referenceId: z.ZodOptional<z.ZodString>;
177
+ referenceType: z.ZodOptional<z.ZodString>;
178
+ correlationId: z.ZodOptional<z.ZodString>;
179
+ recipientId: z.ZodString;
180
+ templateId: z.ZodOptional<z.ZodString>;
179
181
  channel: z.ZodOptional<z.ZodEnum<{
180
182
  IN_APP: "IN_APP";
181
183
  EMAIL: "EMAIL";
@@ -190,6 +192,6 @@ export declare const CreateNotificationsSchema: z.ZodObject<{
190
192
  promotional: "promotional";
191
193
  }>>>;
192
194
  provider: z.ZodOptional<z.ZodString>;
193
- provider_message_id: z.ZodOptional<z.ZodString>;
195
+ providerMessageId: z.ZodOptional<z.ZodString>;
194
196
  }, z.core.$strip>;
195
197
  export type CreateNotificationsDTO = z.infer<typeof CreateNotificationsSchema>;
@@ -2,5 +2,5 @@
2
2
  * Core Frontend Types
3
3
  * Type definitions for @plyaz/core frontend services
4
4
  */
5
- export type { CoreBaseFrontendStore, CoreBaseFrontendServiceConfig, CoreBaseFrontendServiceInterface, CoreStoreHandlers, CoreOptimisticUpdateConfig, OptimisticConflictResolution, CoreFetcherFunction, CoreServiceFetchers, CorePlyazApiConfig, FrontendFeatureFlagProvider, CorePlyazFeatureFlagConfig, CorePlyazStoreConfig, CorePlyazStreamConfig, CorePlyazConfig, CoreFeatureFlagServiceLike, CoreFeatureFlagFetcherOptions, CoreFeatureFlagStoreInitConfig, CoreBaseFrontendServiceConstructorConfig, CoreInitializationErrorProps, CoreInitializationLoadingProps, CorePlyazServices, CorePlyazContextValue, CorePlyazProviderProps, CoreStreamStoreGetter, CoreStreamHandlerIds, CoreStreamHandlerDeclaration, } from './types';
5
+ export type { CoreBaseFrontendStore, CoreBaseFrontendServiceConfig, CoreBaseFrontendServiceInterface, CoreStoreHandlers, CoreOptimisticUpdateConfig, OptimisticConflictResolution, CoreFetcherFunction, CoreServiceFetchers, CorePlyazApiConfig, FrontendFeatureFlagProvider, CorePlyazFeatureFlagConfig, CorePlyazStoreConfig, CorePlyazStreamConfig, CorePlyazConfig, CoreFeatureFlagServiceLike, CoreFeatureFlagFetcherOptions, CoreFeatureFlagStoreInitConfig, CoreBaseFrontendServiceConstructorConfig, CoreInitializationErrorProps, CoreInitializationLoadingProps, CorePlyazServices, CorePlyazContextValue, CorePlyazProviderProps, CoreStreamStoreGetter, CoreStreamHandlerIds, CoreStreamHandlerDeclaration, UseServiceAsyncResult, } from './types';
6
6
  export type { CoreFrontendFeatureFlagEventType, CoreFeatureFlagStore, CoreFeatureFlagServiceConfig, CoreFeatureFlagServiceInitConfig, CoreFeatureFlagServiceInterface, } from './featureFlags';
@@ -1304,6 +1304,30 @@ export type CoreStreamStoreGetter = () => RootStoreSlice | undefined;
1304
1304
  * ```
1305
1305
  */
1306
1306
  export type CoreStreamHandlerIds<TKeys extends string> = Readonly<Record<TKeys, string>>;
1307
+ /**
1308
+ * Result type for async service hooks (useServiceAsync).
1309
+ *
1310
+ * Used by domain service hooks that may have loading state.
1311
+ *
1312
+ * @typeParam TService - The service type
1313
+ *
1314
+ * @example
1315
+ * ```typescript
1316
+ * import type { UseServiceAsyncResult } from '@plyaz/types/core';
1317
+ *
1318
+ * export function useNotificationsService(): UseServiceAsyncResult<FrontendNotificationsDomainService> {
1319
+ * return useServiceAsync<FrontendNotificationsDomainService>(NOTIFICATIONS_SERVICE_KEY);
1320
+ * }
1321
+ * ```
1322
+ */
1323
+ export interface UseServiceAsyncResult<TService> {
1324
+ /** The service instance (null while loading or on error) */
1325
+ service: TService | null;
1326
+ /** Whether the service is still loading */
1327
+ isLoading: boolean;
1328
+ /** Error if service initialization failed */
1329
+ error: Error | null;
1330
+ }
1307
1331
  /**
1308
1332
  * Declarative stream handler configuration.
1309
1333
  *
@@ -651,20 +651,20 @@ var QueryNotificationsSchema = zod.z.object({
651
651
  created_before: zod.z.string().optional()
652
652
  });
653
653
  var CreateNotificationsSchema = zod.z.object({
654
- user_id: zod.z.string().uuid(),
654
+ userId: zod.z.string().uuid(),
655
655
  type: NotificationTypeSchema,
656
656
  title: zod.z.string().max(MAX_TITLE_LENGTH),
657
657
  message: zod.z.string(),
658
- link_url: zod.z.string().optional(),
659
- reference_id: zod.z.string().uuid().optional(),
660
- reference_type: zod.z.string().max(MAX_REFERENCE_TYPE_LENGTH).optional(),
661
- correlation_id: zod.z.string().max(MAX_STRING_LENGTH).optional(),
662
- recipient_id: zod.z.string().max(MAX_STRING_LENGTH),
663
- template_id: zod.z.string().max(MAX_STRING_LENGTH).optional(),
658
+ linkUrl: zod.z.string().optional(),
659
+ referenceId: zod.z.string().uuid().optional(),
660
+ referenceType: zod.z.string().max(MAX_REFERENCE_TYPE_LENGTH).optional(),
661
+ correlationId: zod.z.string().max(MAX_STRING_LENGTH).optional(),
662
+ recipientId: zod.z.string().max(MAX_STRING_LENGTH),
663
+ templateId: zod.z.string().max(MAX_STRING_LENGTH).optional(),
664
664
  channel: NotificationChannelSchema.optional(),
665
665
  category: NotificationCategorySchema.optional(),
666
666
  provider: zod.z.string().max(MAX_PROVIDER_LENGTH).optional(),
667
- provider_message_id: zod.z.string().max(MAX_STRING_LENGTH).optional()
667
+ providerMessageId: zod.z.string().max(MAX_STRING_LENGTH).optional()
668
668
  });
669
669
 
670
670
  // src/core/domain/notifications/streaming.ts