@codingfactory/socialkit-vue 0.5.3 → 0.7.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 (49) hide show
  1. package/dist/index.d.ts +13 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +5 -0
  4. package/dist/index.js.map +1 -1
  5. package/dist/services/gamification.d.ts +87 -0
  6. package/dist/services/gamification.d.ts.map +1 -0
  7. package/dist/services/gamification.js +263 -0
  8. package/dist/services/gamification.js.map +1 -0
  9. package/dist/stores/content.d.ts +1418 -0
  10. package/dist/stores/content.d.ts.map +1 -0
  11. package/dist/stores/content.js +1195 -0
  12. package/dist/stores/content.js.map +1 -0
  13. package/dist/stores/gamification.d.ts +2875 -0
  14. package/dist/stores/gamification.d.ts.map +1 -0
  15. package/dist/stores/gamification.js +1136 -0
  16. package/dist/stores/gamification.js.map +1 -0
  17. package/dist/types/api.d.ts +1 -0
  18. package/dist/types/api.d.ts.map +1 -1
  19. package/dist/types/content-api.d.ts +23 -0
  20. package/dist/types/content-api.d.ts.map +1 -0
  21. package/dist/types/content-api.js +5 -0
  22. package/dist/types/content-api.js.map +1 -0
  23. package/dist/types/content.d.ts +309 -0
  24. package/dist/types/content.d.ts.map +1 -0
  25. package/dist/types/content.js +36 -0
  26. package/dist/types/content.js.map +1 -0
  27. package/dist/types/gamification.d.ts +267 -0
  28. package/dist/types/gamification.d.ts.map +1 -0
  29. package/dist/types/gamification.js +5 -0
  30. package/dist/types/gamification.js.map +1 -0
  31. package/dist/types/media.d.ts +63 -0
  32. package/dist/types/media.d.ts.map +1 -0
  33. package/dist/types/media.js +13 -0
  34. package/dist/types/media.js.map +1 -0
  35. package/dist/types/reputation.d.ts +55 -0
  36. package/dist/types/reputation.d.ts.map +1 -0
  37. package/dist/types/reputation.js +5 -0
  38. package/dist/types/reputation.js.map +1 -0
  39. package/package.json +1 -1
  40. package/src/index.ts +143 -0
  41. package/src/services/gamification.ts +432 -0
  42. package/src/stores/content.ts +1477 -0
  43. package/src/stores/gamification.ts +1565 -0
  44. package/src/types/api.ts +1 -0
  45. package/src/types/content-api.ts +24 -0
  46. package/src/types/content.ts +381 -0
  47. package/src/types/gamification.ts +286 -0
  48. package/src/types/media.ts +81 -0
  49. package/src/types/reputation.ts +78 -0
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Core type definitions for media.
3
+ */
4
+
5
+ export interface MediaItem {
6
+ id: string
7
+ type: 'image' | 'video' | 'document'
8
+ url: string
9
+ thumbnail_url?: string
10
+ alt_text?: string
11
+ width?: number
12
+ height?: number
13
+ size?: number
14
+ mime_type?: string
15
+ created_at?: string
16
+ updated_at?: string
17
+ }
18
+
19
+ export function isMediaItem(obj: unknown): obj is MediaItem {
20
+ return (
21
+ obj !== null
22
+ && typeof obj === 'object'
23
+ && 'id' in obj
24
+ && 'type' in obj
25
+ && 'url' in obj
26
+ && typeof (obj as MediaItem).type === 'string'
27
+ && ['image', 'video', 'document'].includes((obj as MediaItem).type)
28
+ )
29
+ }
30
+
31
+ export interface UploadedMedia {
32
+ id: string
33
+ url: string
34
+ thumb_url?: string | null
35
+ preview_url?: string | null
36
+ mime_type: string
37
+ size: number
38
+ urls?: {
39
+ original?: string
40
+ thumbnail?: string
41
+ preview?: string
42
+ }
43
+ original_url?: string
44
+ }
45
+
46
+ export interface LocalMediaItem {
47
+ id?: string
48
+ previewUrl: string
49
+ file?: File
50
+ mimeType: string
51
+ name: string
52
+ size: number
53
+ status: 'pending' | 'uploading' | 'uploaded' | 'failed'
54
+ error?: string
55
+ }
56
+
57
+ export interface FilterConfig {
58
+ name: string
59
+ type: string
60
+ value: number | string
61
+ timestamp?: number
62
+ }
63
+
64
+ export type ImageEditorContext = 'profile' | 'editor' | 'gallery'
65
+ export type ImageFormat = 'jpeg' | 'png' | 'webp'
66
+
67
+ export interface ImageEditorSaveData {
68
+ imageData: Blob
69
+ filters: FilterConfig[]
70
+ metadata: ImageEditorMetadata
71
+ }
72
+
73
+ export interface ImageEditorMetadata {
74
+ originalUrl: string
75
+ context: string
76
+ appliedFilters: FilterConfig[]
77
+ processingTime: number
78
+ }
79
+
80
+ export type MediaType = MediaItem['type']
81
+ export type MediaUpdate = Partial<Omit<MediaItem, 'id' | 'created_at'>>
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Generic reputation-adjacent types shared across SocialKit frontends.
3
+ */
4
+
5
+ import type {
6
+ LeaderboardEntry,
7
+ PointTransaction,
8
+ ReputationLevel,
9
+ UserReputation,
10
+ UserStats,
11
+ UserPrivilege,
12
+ } from './gamification.js'
13
+
14
+ export type Timestamp = string
15
+
16
+ export type {
17
+ LeaderboardEntry,
18
+ PointTransaction,
19
+ ReputationLevel,
20
+ UserPrivilege,
21
+ UserReputation,
22
+ UserStats,
23
+ }
24
+
25
+ export interface ReputationPrivilege {
26
+ id: string
27
+ name: string
28
+ slug: string
29
+ category: string
30
+ required_points: number
31
+ required_level: number | null
32
+ description: string
33
+ is_active: boolean
34
+ }
35
+
36
+ export interface DailyLimitStatus {
37
+ points_awarded: number
38
+ max_points: number
39
+ points_remaining: number
40
+ is_reached: boolean
41
+ resets_at: string
42
+ }
43
+
44
+ export interface StreakMilestone {
45
+ days: number
46
+ days_remaining: number
47
+ bonus_points: number
48
+ }
49
+
50
+ export interface UserStreakStatus {
51
+ days: number
52
+ is_active_today: boolean
53
+ freeze_available: number
54
+ next_milestone: StreakMilestone | null
55
+ }
56
+
57
+ export interface PointsAwardedEvent {
58
+ transaction_id?: string
59
+ action_type: string
60
+ points: number
61
+ reason?: string
62
+ source_type?: string
63
+ source_id?: string
64
+ metadata?: Record<string, unknown>
65
+ level_progress?: number
66
+ lifetime_points?: number
67
+ }
68
+
69
+ export interface LevelUpEvent {
70
+ new_level: number
71
+ level_details: ReputationLevel
72
+ next_level_details: ReputationLevel | null
73
+ }
74
+
75
+ export interface ReputationSnapshot {
76
+ snapshot_date: Timestamp
77
+ total_points: number
78
+ }