@codingfactory/socialkit-vue 0.7.23 → 0.7.24
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/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/services/circles.d.ts +7 -0
- package/dist/services/circles.d.ts.map +1 -1
- package/dist/services/circles.js +34 -5
- package/dist/services/circles.js.map +1 -1
- package/dist/stores/__tests__/discussion.spec.d.ts +2 -0
- package/dist/stores/__tests__/discussion.spec.d.ts.map +1 -0
- package/dist/stores/__tests__/discussion.spec.js +768 -0
- package/dist/stores/__tests__/discussion.spec.js.map +1 -0
- package/dist/stores/circles.d.ts +144 -0
- package/dist/stores/circles.d.ts.map +1 -1
- package/dist/stores/circles.js +7 -1
- package/dist/stores/circles.js.map +1 -1
- package/dist/stores/content.d.ts.map +1 -1
- package/dist/stores/content.js +6 -3
- package/dist/stores/content.js.map +1 -1
- package/dist/stores/discussion.d.ts +714 -15
- package/dist/stores/discussion.d.ts.map +1 -1
- package/dist/stores/discussion.js +272 -65
- package/dist/stores/discussion.js.map +1 -1
- package/dist/types/content.d.ts +3 -2
- package/dist/types/content.d.ts.map +1 -1
- package/dist/types/content.js +2 -1
- package/dist/types/content.js.map +1 -1
- package/dist/types/discussion.d.ts +38 -0
- package/dist/types/discussion.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +4 -0
- package/src/services/circles.ts +45 -5
- package/src/stores/__tests__/discussion.spec.ts +945 -0
- package/src/stores/circles.ts +7 -1
- package/src/stores/content.ts +6 -3
- package/src/stores/discussion.ts +333 -76
- package/src/types/content.ts +3 -2
- package/src/types/discussion.ts +43 -0
package/src/services/circles.ts
CHANGED
|
@@ -131,6 +131,10 @@ export interface Circle {
|
|
|
131
131
|
meta: Record<string, unknown>
|
|
132
132
|
cover_photo_url?: string | null
|
|
133
133
|
cover_photo_media_id?: string | null
|
|
134
|
+
discussion_space_id?: string | null
|
|
135
|
+
discussion_space_slug?: string | null
|
|
136
|
+
discussion_space_name?: string | null
|
|
137
|
+
discussion_thread_count?: number
|
|
134
138
|
created_at: string
|
|
135
139
|
updated_at: string
|
|
136
140
|
is_member?: boolean
|
|
@@ -277,11 +281,14 @@ export interface CircleOwnershipTransferResult {
|
|
|
277
281
|
export interface CircleModerationReport {
|
|
278
282
|
id: string
|
|
279
283
|
reporter_id: string | null
|
|
284
|
+
reporter_name?: string | null
|
|
285
|
+
reporter_handle?: string | null
|
|
280
286
|
source: CircleModerationReportSource
|
|
281
287
|
subject_user_id: string | null
|
|
282
288
|
subject_type: CircleModerationReportSubjectType | null
|
|
283
289
|
subject_id: string | null
|
|
284
290
|
subject_author_id: string | null
|
|
291
|
+
subject_title?: string | null
|
|
285
292
|
category: string
|
|
286
293
|
notes?: string | null
|
|
287
294
|
status: CircleReportStatus
|
|
@@ -1048,6 +1055,26 @@ function normalizeCircle(value: unknown): Circle | null {
|
|
|
1048
1055
|
canonical_path: readNullableString(value.canonical_path),
|
|
1049
1056
|
}
|
|
1050
1057
|
|
|
1058
|
+
const discussionSpaceId = readNullableString(value.discussion_space_id)
|
|
1059
|
+
if (discussionSpaceId !== null || value.discussion_space_id === null) {
|
|
1060
|
+
circle.discussion_space_id = discussionSpaceId
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
const discussionSpaceSlug = readNullableString(value.discussion_space_slug)
|
|
1064
|
+
if (discussionSpaceSlug !== null || value.discussion_space_slug === null) {
|
|
1065
|
+
circle.discussion_space_slug = discussionSpaceSlug
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
const discussionSpaceName = readNullableString(value.discussion_space_name)
|
|
1069
|
+
if (discussionSpaceName !== null || value.discussion_space_name === null) {
|
|
1070
|
+
circle.discussion_space_name = discussionSpaceName
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
const discussionThreadCount = readNumber(value.discussion_thread_count)
|
|
1074
|
+
if (discussionThreadCount !== null) {
|
|
1075
|
+
circle.discussion_thread_count = discussionThreadCount
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1051
1078
|
const isMember = readBoolean(value.is_member)
|
|
1052
1079
|
if (isMember !== null) {
|
|
1053
1080
|
circle.is_member = isMember
|
|
@@ -1449,11 +1476,14 @@ function normalizeModerationReport(value: unknown): CircleModerationReport | nul
|
|
|
1449
1476
|
return {
|
|
1450
1477
|
id,
|
|
1451
1478
|
reporter_id: reporterId,
|
|
1479
|
+
reporter_name: readNullableString(value.reporter_name),
|
|
1480
|
+
reporter_handle: readNullableString(value.reporter_handle),
|
|
1452
1481
|
source,
|
|
1453
1482
|
subject_user_id: subjectUserId,
|
|
1454
1483
|
subject_type: subjectType,
|
|
1455
1484
|
subject_id: subjectId,
|
|
1456
1485
|
subject_author_id: subjectAuthorId,
|
|
1486
|
+
subject_title: readNullableString(value.subject_title),
|
|
1457
1487
|
category,
|
|
1458
1488
|
notes: readNullableString(value.notes),
|
|
1459
1489
|
status,
|
|
@@ -3114,13 +3144,23 @@ class CirclesService {
|
|
|
3114
3144
|
? data.suggestion
|
|
3115
3145
|
: undefined
|
|
3116
3146
|
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
if (this.isHttpStatus(error, 404)) {
|
|
3120
|
-
return { available: true }
|
|
3147
|
+
if (suggestion) {
|
|
3148
|
+
return { available, suggestion }
|
|
3121
3149
|
}
|
|
3122
3150
|
|
|
3123
|
-
return
|
|
3151
|
+
return { available }
|
|
3152
|
+
} catch (error: unknown) {
|
|
3153
|
+
// Slug availability checks are a soft UX convenience — the server
|
|
3154
|
+
// validates the slug again on actual creation. Failing with an
|
|
3155
|
+
// error toast for a background check confuses users (see
|
|
3156
|
+
// BUG-015-QBSTU-002-C). Return an optimistic default so the form
|
|
3157
|
+
// stays usable and let server-side validation catch real conflicts.
|
|
3158
|
+
this.reportError({
|
|
3159
|
+
error,
|
|
3160
|
+
timestamp: new Date().toISOString(),
|
|
3161
|
+
logLevel: 'warn',
|
|
3162
|
+
})
|
|
3163
|
+
return { available: true }
|
|
3124
3164
|
}
|
|
3125
3165
|
}
|
|
3126
3166
|
|