@plyaz/types 1.42.1 → 1.42.3

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.
@@ -1,41 +1,11 @@
1
1
  import type { Endpoint, Req } from 'fetchff';
2
- export interface Campaign {
3
- id: string;
4
- name: string;
5
- description: string;
6
- status: 'draft' | 'active' | 'paused' | 'completed';
7
- startDate: string;
8
- endDate: string;
9
- athleteIds: string[];
10
- createdAt: string;
11
- updatedAt: string;
12
- }
2
+ import type { CampaignEntity, CreateCampaignDTO, PatchCampaignDTO, QueryCampaignDTO } from '../../../campaign';
13
3
  export interface CampaignStats {
14
4
  totalParticipants: number;
15
5
  totalViews: number;
16
6
  engagement: number;
17
7
  performance: Record<string, unknown>;
18
8
  }
19
- export interface CampaignFilters {
20
- limit?: number;
21
- offset?: number;
22
- status?: Campaign['status'];
23
- athleteId?: string;
24
- }
25
- export interface CreateCampaignDto {
26
- name: string;
27
- description: string;
28
- startDate: string;
29
- endDate: string;
30
- athleteIds?: string[];
31
- }
32
- export interface UpdateCampaignDto {
33
- name?: string;
34
- description?: string;
35
- status?: Campaign['status'];
36
- startDate?: string;
37
- endDate?: string;
38
- }
39
9
  export interface CampaignPathParams {
40
10
  id: string;
41
11
  }
@@ -74,17 +44,17 @@ export interface UseCampaignParticipantsParams {
74
44
  */
75
45
  export interface UpdateCampaignParams {
76
46
  campaignId: string;
77
- data: UpdateCampaignDto;
47
+ data: PatchCampaignDTO;
78
48
  }
79
49
  /**
80
50
  * Campaign endpoint types for TypeScript
81
51
  * Using fetchff's Req type to properly define endpoints
82
52
  */
83
53
  export interface CampaignEndpointTypes {
84
- getCampaign: Endpoint<Req<Campaign, never, never, CampaignPathParams>>;
85
- listCampaigns: Endpoint<Req<Campaign[], never, CampaignFilters>>;
86
- createCampaign: Endpoint<Req<Campaign, CreateCampaignDto>>;
87
- updateCampaign: Endpoint<Req<Campaign, UpdateCampaignDto, never, CampaignPathParams>>;
54
+ getCampaign: Endpoint<Req<CampaignEntity, never, never, CampaignPathParams>>;
55
+ listCampaigns: Endpoint<Req<CampaignEntity[], never, QueryCampaignDTO>>;
56
+ createCampaign: Endpoint<Req<CampaignEntity, CreateCampaignDTO>>;
57
+ updateCampaign: Endpoint<Req<CampaignEntity, PatchCampaignDTO, never, CampaignPathParams>>;
88
58
  deleteCampaign: Endpoint<Req<{
89
59
  success: boolean;
90
60
  }, never, never, CampaignPathParams>>;
@@ -46,8 +46,8 @@ export declare const CreateCampaignSchema: z.ZodObject<{
46
46
  category: z.ZodOptional<z.ZodString>;
47
47
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
48
48
  status: z.ZodOptional<z.ZodEnum<{
49
- ACTIVE: "ACTIVE";
50
49
  DRAFT: "DRAFT";
50
+ ACTIVE: "ACTIVE";
51
51
  }>>;
52
52
  }, z.core.$strip>;
53
53
  /**
@@ -69,8 +69,8 @@ export declare const UpdateCampaignSchema: z.ZodObject<{
69
69
  category: z.ZodOptional<z.ZodString>;
70
70
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
71
71
  status: z.ZodOptional<z.ZodEnum<{
72
- ACTIVE: "ACTIVE";
73
72
  DRAFT: "DRAFT";
73
+ ACTIVE: "ACTIVE";
74
74
  }>>;
75
75
  id: z.ZodString;
76
76
  }, z.core.$strip>;
@@ -93,8 +93,8 @@ export declare const PatchCampaignSchema: z.ZodObject<{
93
93
  category: z.ZodOptional<z.ZodOptional<z.ZodString>>;
94
94
  tags: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
95
95
  status: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
96
- ACTIVE: "ACTIVE";
97
96
  DRAFT: "DRAFT";
97
+ ACTIVE: "ACTIVE";
98
98
  }>>>;
99
99
  id: z.ZodOptional<z.ZodString>;
100
100
  }, z.core.$strip>;
@@ -112,10 +112,10 @@ export declare const QueryCampaignSchema: z.ZodObject<{
112
112
  page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
113
113
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
114
114
  sort_by: z.ZodDefault<z.ZodEnum<{
115
- created_at: "created_at";
116
- updated_at: "updated_at";
117
115
  title: "title";
118
116
  funding_target: "funding_target";
117
+ created_at: "created_at";
118
+ updated_at: "updated_at";
119
119
  }>>;
120
120
  sort_order: z.ZodDefault<z.ZodEnum<{
121
121
  asc: "asc";
@@ -34,6 +34,13 @@ export type QueryCampaignDTO = z.infer<typeof QueryCampaignSchema>;
34
34
  * Delete options DTO (DELETE)
35
35
  */
36
36
  export type DeleteCampaignDTO = z.infer<typeof DeleteCampaignSchema>;
37
+ /**
38
+ * Update campaign params interface for API operations
39
+ */
40
+ export interface UpdateCampaignParams {
41
+ id: string;
42
+ data: PatchCampaignDTO;
43
+ }
37
44
  /**
38
45
  * Single entity response DTO
39
46
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plyaz/types",
3
- "version": "1.42.1",
3
+ "version": "1.42.3",
4
4
  "author": "Redeemer Pace",
5
5
  "license": "ISC",
6
6
  "description": "Provides shared TypeScript types and schema utilities for validation and parsing in the @playz ecosystem.",