@oblax/comments 0.0.0-stage → 2.1.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.
@@ -0,0 +1,131 @@
1
+ import { buildQuery as query, pathSegment as seg } from '@oblax/core';
2
+ /**
3
+ * Manages threads: the discussion attached to a subject (a product, an
4
+ * article, a document) for one comment type.
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * const thread = await oblax.comments.threads.create({
9
+ * type: 'product-reviews',
10
+ * subjectType: 'product',
11
+ * subjectId: 'sku-123',
12
+ * title: 'Blue mug',
13
+ * url: '/products/blue-mug',
14
+ * })
15
+ *
16
+ * // Comment counts for a product grid
17
+ * const { data } = await oblax.comments.threads.stats({
18
+ * type: 'product-reviews',
19
+ * subjectType: 'product',
20
+ * subjectIds: ['sku-123', 'sku-456'],
21
+ * })
22
+ *
23
+ * await oblax.comments.threads.subscribe({ id: thread.id, mode: 'follow' })
24
+ * ```
25
+ */
26
+ export class ThreadsSubmodule {
27
+ constructor(ctx) {
28
+ this.ctx = ctx;
29
+ }
30
+ /** Returns the subject's threads, of every comment type, that the user can read. */
31
+ async listBySubject(params) {
32
+ const qs = query({ subject_type: params.subjectType, subject_id: params.subjectId });
33
+ return this.ctx.http.get(`/comments/threads${qs}`);
34
+ }
35
+ async get(params) {
36
+ return this.ctx.http.get(`/comments/threads/${seg(params.id)}`);
37
+ }
38
+ /**
39
+ * Makes the subject's thread, or returns the existing one. App admins
40
+ * create (or update) a thread of any type; other users create one of a
41
+ * `client` type and become its subject owner.
42
+ */
43
+ async create(params) {
44
+ return this.ctx.http.post('/comments/threads', {
45
+ type: params.type,
46
+ subject_type: params.subjectType,
47
+ subject_id: params.subjectId,
48
+ title: params.title,
49
+ url: params.url,
50
+ owner_id: params.ownerId,
51
+ extra: params.extra,
52
+ audience: params.audience,
53
+ audience_roles: params.audienceRoles,
54
+ });
55
+ }
56
+ /** Returns the counters of one type's threads on up to 100 subjects. */
57
+ async stats(params) {
58
+ return this.ctx.http.post('/comments/threads:stats', {
59
+ type: params.type,
60
+ subject_type: params.subjectType,
61
+ subject_ids: params.subjectIds,
62
+ });
63
+ }
64
+ /** Replaces the thread's subject snapshot (title, url, owner, extra). App admins only. */
65
+ async updateSubject(params) {
66
+ return this.ctx.http.put(`/comments/threads/${seg(params.id)}/subject`, {
67
+ title: params.title,
68
+ url: params.url,
69
+ owner_id: params.ownerId,
70
+ extra: params.extra,
71
+ });
72
+ }
73
+ /** Opens, locks, archives or hides a thread. Moderators only. */
74
+ async setState(params) {
75
+ return this.ctx.http.patch(`/comments/threads/${seg(params.id)}/state`, {
76
+ state: params.state,
77
+ reason: params.reason,
78
+ });
79
+ }
80
+ /** Marks an annotations thread resolved. Moderators and the subject owner. */
81
+ async resolve(params) {
82
+ return this.ctx.http.post(`/comments/threads/${seg(params.id)}:resolve`, {
83
+ reason: params.reason,
84
+ });
85
+ }
86
+ /** Marks a resolved annotations thread not resolved any more. */
87
+ async unresolve(params) {
88
+ return this.ctx.http.post(`/comments/threads/${seg(params.id)}:unresolve`, {
89
+ reason: params.reason,
90
+ });
91
+ }
92
+ /** Follows or mutes the thread for the signed-in user. */
93
+ async subscribe(params) {
94
+ return this.ctx.http.put(`/comments/threads/${seg(params.id)}/subscription`, {
95
+ mode: params.mode,
96
+ });
97
+ }
98
+ /** Takes the user's follow or mute off the thread. */
99
+ async unsubscribe(params) {
100
+ return this.ctx.http.delete(`/comments/threads/${seg(params.id)}/subscription`);
101
+ }
102
+ /** Moves the user's read marker to a comment, or to the thread's last comment. */
103
+ async markRead(params) {
104
+ return this.ctx.http.post(`/comments/threads/${seg(params.id)}:read`, {
105
+ comment_id: params.commentId,
106
+ });
107
+ }
108
+ /** Lists the thread's members. App admins only. */
109
+ async listMembers(params) {
110
+ const qs = query({ after: params.after, limit: params.limit });
111
+ return this.ctx.http.get(`/comments/threads/${seg(params.id)}/members${qs}`);
112
+ }
113
+ /** Puts a user on the thread's member list, or updates them. App admins only. */
114
+ async setMember(params) {
115
+ return this.ctx.http.put(`/comments/threads/${seg(params.id)}/members/${seg(params.userId)}`, { verified: params.verified, scopes: params.scopes });
116
+ }
117
+ /** Takes a user off the thread's member list. App admins only. */
118
+ async removeMember(params) {
119
+ return this.ctx.http.delete(`/comments/threads/${seg(params.id)}/members/${seg(params.userId)}`);
120
+ }
121
+ /** Posts an activity entry (kind `system`, no author) on the thread. App admins only. */
122
+ async postActivity(params) {
123
+ return this.ctx.http.post(`/comments/threads/${seg(params.id)}/activity`, {
124
+ body: params.body,
125
+ attributes: params.attributes,
126
+ visibility: params.visibility,
127
+ language: params.language,
128
+ });
129
+ }
130
+ }
131
+ //# sourceMappingURL=threads.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"threads.js","sourceRoot":"","sources":["../src/threads.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,WAAW,IAAI,GAAG,EAAE,MAAM,aAAa,CAAA;AAuBrE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,OAAO,gBAAgB;IAC3B,YAA6B,GAAiB;QAAjB,QAAG,GAAH,GAAG,CAAc;IAAG,CAAC;IAElD,oFAAoF;IACpF,KAAK,CAAC,aAAa,CAAC,MAAyB;QAC3C,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,YAAY,EAAE,MAAM,CAAC,WAAW,EAAE,UAAU,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAA;QACpF,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAuB,oBAAoB,EAAE,EAAE,CAAC,CAAA;IAC1E,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,MAAgB;QACxB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAS,qBAAqB,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAA;IACzE,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,CAAC,MAA0B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
1
+ import type { FilterOp, ListFilter, ListQuery } from '@oblax/core';
2
+ export type { FilterOp, ListFilter, ListQuery };
3
+ export interface CommentsConfig {
4
+ }
5
+ /** Fields every stored record carries. Timestamps are RFC 3339 strings. */
6
+ export interface CommentsRecord {
7
+ id: string;
8
+ _created?: string;
9
+ _modified?: string;
10
+ }
11
+ /** A list response: the items and how many there are (in total, for paged lists). */
12
+ export interface CommentsList<T> {
13
+ data: T[];
14
+ count: number;
15
+ }
16
+ /** Free-form JSON document. */
17
+ export type JsonObject = Record<string, unknown>;
18
+ /** A custom-attribute rule on a comment type (e.g. a review's pros and cons). */
19
+ export interface AttributeRule {
20
+ path: string;
21
+ type: 'string' | 'text' | 'int' | 'number' | 'bool' | 'date' | 'datetime' | 'duration' | 'list' | 'map' | 'object' | 'ref';
22
+ required?: boolean;
23
+ nullable?: boolean;
24
+ /** Validator tags, e.g. `min=1,max=50`. */
25
+ rules?: string;
26
+ target?: string;
27
+ }
28
+ export interface IdParams {
29
+ id: string;
30
+ }
31
+ /** An optional reason, recorded in the moderation log. */
32
+ export interface ReasonParams {
33
+ id: string;
34
+ reason?: string;
35
+ }
36
+ export type CommentMode = 'discussion' | 'reviews' | 'qa' | 'annotations';
37
+ export type CommentSort = 'new' | 'old' | 'top' | 'best' | 'hot' | 'controversial';
38
+ /**
39
+ * App roles allowed each action. For `read`, `post`, `vote`, `react` and
40
+ * `report` an empty list adds no role limit: whoever the thread's audience lets
41
+ * in may do it. For `moderate` an empty list means no role moderates.
42
+ */
43
+ export interface CommentPermissions {
44
+ read: string[];
45
+ post: string[];
46
+ vote: string[];
47
+ react: string[];
48
+ report: string[];
49
+ moderate: string[];
50
+ /** What a thread's subject owner may do: `moderate`, `pin`, `accept`, `resolve`. */
51
+ subject_owner: string[];
52
+ }
53
+ export interface AttachmentLimits {
54
+ max_count: number;
55
+ max_bytes: number;
56
+ mime_types: string[];
57
+ }
58
+ export interface CommentType extends CommentsRecord {
59
+ code: string;
60
+ name: string;
61
+ description: string;
62
+ mode: CommentMode;
63
+ /** `system`: only admins create threads; `client`: users may, and own the subject. */
64
+ threads: 'system' | 'client';
65
+ nesting: 'flat' | 'single' | 'threaded';
66
+ max_depth: number;
67
+ default_sort: CommentSort;
68
+ voting: 'none' | 'up' | 'updown';
69
+ score_hidden_minutes: number;
70
+ self_vote: boolean;
71
+ /** Allowed reaction emoji. */
72
+ reactions: string[];
73
+ anonymity: 'off' | 'optional' | 'forced';
74
+ anonymity_reveal: 'moderators' | 'none';
75
+ guests: boolean;
76
+ body_format: 'plain' | 'markdown' | 'rich';
77
+ body_min: number;
78
+ body_max: number;
79
+ max_links: number;
80
+ attributes: AttributeRule[];
81
+ edit_window_minutes: number;
82
+ keep_revisions: boolean;
83
+ delete_mode: 'tombstone' | 'hide_branch';
84
+ initial_status: 'published' | 'pending';
85
+ moderators_skip_review: boolean;
86
+ new_user_queue: boolean;
87
+ auto_hide_reports: number;
88
+ report_reasons: string[];
89
+ word_filters: string[];
90
+ rate_limit_per_minute: number;
91
+ auto_lock_days: number;
92
+ attachments: AttachmentLimits;
93
+ permissions: CommentPermissions;
94
+ }
95
+ /** Settings of a comment type, in the API's own shape. Left out, they keep their values (or the defaults on create). */
96
+ export type CommentTypeSettings = Partial<Omit<CommentType, keyof CommentsRecord | 'code'>>;
97
+ export interface CreateCommentTypeParams extends CommentTypeSettings {
98
+ /** How flux scripts and the CLI name the type. Can't change once created. */
99
+ code: string;
100
+ name: string;
101
+ }
102
+ export interface UpdateCommentTypeParams extends CommentTypeSettings {
103
+ id: string;
104
+ }
105
+ export type ThreadState = 'open' | 'locked' | 'archived' | 'hidden';
106
+ export type ThreadAudience = 'public' | 'members' | 'roles' | 'participants' | 'subject';
107
+ export interface Thread extends CommentsRecord {
108
+ type_id: string;
109
+ subject_type: string;
110
+ subject_id: string;
111
+ subject_title: string;
112
+ subject_url: string;
113
+ subject_owner_id: string;
114
+ subject_extra: JsonObject | null;
115
+ audience: ThreadAudience;
116
+ audience_roles: string[];
117
+ state: ThreadState;
118
+ /** For annotations threads. */
119
+ resolved: boolean;
120
+ overrides: JsonObject | null;
121
+ pinned_comment_id: string;
122
+ accepted_comment_id: string;
123
+ comment_count: number;
124
+ root_count: number;
125
+ participant_count: number;
126
+ rating_count: number;
127
+ rating_sum: number;
128
+ /** Ratings by star: `{ "5": 12, "4": 3 }`. */
129
+ rating_dist: Record<string, number> | null;
130
+ last_activity_at: string | null;
131
+ last_comment_id: string;
132
+ last_author: JsonObject | null;
133
+ /** The signed-in user's: `follow` or `mute`. */
134
+ subscription?: 'follow' | 'mute' | 'none';
135
+ last_read_at?: string;
136
+ last_read_comment_id?: string;
137
+ /** Comments the signed-in user hasn't read. */
138
+ new_count: number;
139
+ }
140
+ export interface ListThreadsParams {
141
+ subjectType: string;
142
+ subjectId: string;
143
+ }
144
+ /**
145
+ * Makes a subject's thread. App admins create (or update) a thread of any
146
+ * type; other users create one of a `client` type and own its subject.
147
+ */
148
+ export interface CreateThreadParams {
149
+ /** The comment type's code. */
150
+ type: string;
151
+ subjectType: string;
152
+ subjectId: string;
153
+ title?: string;
154
+ url?: string;
155
+ ownerId?: string;
156
+ extra?: JsonObject;
157
+ /**
158
+ * Who sees the thread. A user's new `client` thread defaults to `public`.
159
+ * An app admin's create has no default: give it for a new thread (the API
160
+ * refuses one without it); left out on an existing thread, its audience
161
+ * stays as it is.
162
+ */
163
+ audience?: ThreadAudience;
164
+ audienceRoles?: string[];
165
+ }
166
+ /** Replaces the thread's subject snapshot. App admins only. */
167
+ export interface UpdateThreadSubjectParams {
168
+ id: string;
169
+ title?: string;
170
+ url?: string;
171
+ ownerId?: string;
172
+ extra?: JsonObject;
173
+ }
174
+ export interface ThreadStatsParams {
175
+ /** The comment type's code. */
176
+ type: string;
177
+ subjectType: string;
178
+ /** Up to 100. */
179
+ subjectIds: string[];
180
+ }
181
+ /** A thread's counters. Subjects without a thread aren't listed. */
182
+ export interface ThreadStats {
183
+ subject_id: string;
184
+ thread_id: string;
185
+ state: ThreadState;
186
+ comment_count: number;
187
+ root_count: number;
188
+ participant_count: number;
189
+ rating_count: number;
190
+ rating_sum: number;
191
+ last_activity_at: string | null;
192
+ new_count: number;
193
+ subscription?: 'follow' | 'mute' | 'none';
194
+ }
195
+ export interface SetThreadStateParams {
196
+ id: string;
197
+ state: ThreadState;
198
+ reason?: string;
199
+ }
200
+ export interface SubscribeParams {
201
+ id: string;
202
+ mode: 'follow' | 'mute';
203
+ }
204
+ export interface MarkReadParams {
205
+ id: string;
206
+ /** Defaults to the thread's last comment. */
207
+ commentId?: string;
208
+ }
209
+ export interface ThreadMember extends CommentsRecord {
210
+ thread_id: string;
211
+ user_id: string;
212
+ verified: boolean;
213
+ scopes: JsonObject | null;
214
+ }
215
+ export interface ListMembersParams {
216
+ id: string;
217
+ /** `next` from the previous page. */
218
+ after?: string;
219
+ /** At most 1000. */
220
+ limit?: number;
221
+ }
222
+ /** A page of a list read by cursor; `next` is empty on the last page. */
223
+ export interface MemberPage {
224
+ data: ThreadMember[];
225
+ next: string;
226
+ }
227
+ export interface SetMemberParams {
228
+ id: string;
229
+ userId: string;
230
+ verified?: boolean;
231
+ scopes?: JsonObject;
232
+ }
233
+ export interface RemoveMemberParams {
234
+ id: string;
235
+ userId: string;
236
+ }
237
+ /** An activity entry posted by an app admin (kind `system`, no author). */
238
+ export interface PostActivityParams {
239
+ id: string;
240
+ body: string;
241
+ attributes?: JsonObject;
242
+ visibility?: CommentVisibility;
243
+ language?: string;
244
+ }
245
+ export type CommentStatus = 'pending' | 'published' | 'hidden' | 'removed' | 'spam' | 'deleted';
246
+ export type CommentVisibility = 'public' | 'members' | 'staff' | 'owner';
247
+ export interface CommentAttachment {
248
+ id: string;
249
+ name: string;
250
+ type: string;
251
+ size: number;
252
+ }
253
+ export interface Mention {
254
+ id: string;
255
+ name: string;
256
+ version?: string;
257
+ }
258
+ export interface Comment extends CommentsRecord {
259
+ thread_id: string;
260
+ type_id: string;
261
+ parent_id: string;
262
+ root_id: string;
263
+ depth: number;
264
+ path: string;
265
+ kind: 'user' | 'system';
266
+ author_id: string;
267
+ author_hash: string;
268
+ author_name: string;
269
+ author_avatar: string;
270
+ /** `owner` or `moderator`, when the author is one. */
271
+ author_badge: string;
272
+ author_version: string | null;
273
+ anonymous: boolean;
274
+ pseudonym: string;
275
+ guest_name: string;
276
+ guest_email_hash: string;
277
+ body: string;
278
+ body_format: string;
279
+ visibility: CommentVisibility;
280
+ /** Where an annotation points. */
281
+ anchor: JsonObject | null;
282
+ attributes: JsonObject | null;
283
+ mentions: Mention[] | null;
284
+ language: string;
285
+ status: CommentStatus;
286
+ status_reason: string;
287
+ edited_at: string | null;
288
+ edit_count: number;
289
+ pinned: boolean;
290
+ locked: boolean;
291
+ /** The accepted answer of a Q&A thread. */
292
+ accepted: boolean;
293
+ ups: number;
294
+ downs: number;
295
+ score: number;
296
+ rank_best: number;
297
+ rank_hot: number;
298
+ rank_controversial: number;
299
+ reply_count: number;
300
+ descendant_count: number;
301
+ /** Reaction counts by emoji. */
302
+ reactions: Record<string, number> | null;
303
+ open_reports: number;
304
+ /** A review's stars. */
305
+ rating: number;
306
+ verified: boolean;
307
+ attachments: CommentAttachment[] | null;
308
+ /** The signed-in user's vote: 1, -1 or 0. */
309
+ my_vote: number;
310
+ my_reactions: string[];
311
+ score_hidden: boolean;
312
+ }
313
+ /** A page of comments. Pass `next_cursor` as `cursor` for the next page; it's empty on the last page. */
314
+ export interface CommentPage {
315
+ data: Comment[];
316
+ count: number;
317
+ next_cursor: string;
318
+ }
319
+ export interface ListCommentsParams {
320
+ /** The thread's id. */
321
+ threadId: string;
322
+ /** The type's default sort when left out. */
323
+ sort?: CommentSort;
324
+ cursor?: string;
325
+ /** Left out or 0, the default page size. */
326
+ limit?: number;
327
+ }
328
+ export interface ListRepliesParams {
329
+ /** The parent comment's id. */
330
+ id: string;
331
+ sort?: CommentSort;
332
+ cursor?: string;
333
+ limit?: number;
334
+ }
335
+ export interface CreateCommentParams {
336
+ threadId: string;
337
+ body: string;
338
+ /** Reply to this comment. */
339
+ parentId?: string;
340
+ visibility?: CommentVisibility;
341
+ anonymous?: boolean;
342
+ attributes?: JsonObject;
343
+ language?: string;
344
+ /** A review's stars; required on reviews, not allowed elsewhere. */
345
+ rating?: number;
346
+ /** Where an annotation points; required on annotations, not allowed elsewhere. */
347
+ anchor?: JsonObject;
348
+ /** Ids of files uploaded to the file manager first. */
349
+ attachments?: string[];
350
+ /** Required from guests on types that take them. */
351
+ guestName?: string;
352
+ /** Required from guests on types that take them; only a hash is kept. */
353
+ guestEmail?: string;
354
+ }
355
+ /** Edits the user's own comment. */
356
+ export interface UpdateCommentParams {
357
+ id: string;
358
+ body: string;
359
+ attributes?: JsonObject;
360
+ language?: string;
361
+ /** Left out, it stays. */
362
+ rating?: number;
363
+ /** Left out, it stays. */
364
+ anchor?: JsonObject;
365
+ /** Replaces the files when given (`[]` removes them); left out, they stay. */
366
+ attachments?: string[];
367
+ }
368
+ export interface VoteParams {
369
+ id: string;
370
+ value: 1 | -1;
371
+ }
372
+ export interface ReactParams {
373
+ id: string;
374
+ emoji: string;
375
+ }
376
+ export interface AttachmentParams {
377
+ /** The comment's id. */
378
+ id: string;
379
+ fileId: string;
380
+ }
381
+ /** A short-lived download link. */
382
+ export interface AttachmentLink {
383
+ url: string;
384
+ /** Unix timestamp (seconds). */
385
+ expiration_time: number;
386
+ }
387
+ export interface Report extends CommentsRecord {
388
+ comment_id: string;
389
+ thread_id: string;
390
+ type_id: string;
391
+ reporter_id: string;
392
+ reason: string;
393
+ note: string;
394
+ status: string;
395
+ resolved_by: string;
396
+ }
397
+ export interface ReportCommentParams {
398
+ id: string;
399
+ /** One of the type's `report_reasons`. */
400
+ reason: string;
401
+ note?: string;
402
+ }
403
+ export interface ModlogEntry extends CommentsRecord {
404
+ actor_kind: 'user' | 'system';
405
+ /** A user id, or the system caller's name. */
406
+ actor_id: string;
407
+ action: string;
408
+ target_kind: string;
409
+ target_id: string;
410
+ /** Empty for project-wide bans. */
411
+ type_id: string;
412
+ thread_id: string;
413
+ reason: string;
414
+ data: JsonObject | null;
415
+ }
416
+ export interface Ban extends CommentsRecord {
417
+ user_id: string;
418
+ /** Empty for a project-wide ban. */
419
+ type_id: string;
420
+ reason: string;
421
+ expires_at: string | null;
422
+ /** Made from an anonymous comment: moderators see `comment_id`, not the user. */
423
+ anonymous: boolean;
424
+ comment_id: string;
425
+ created_by: string;
426
+ }
427
+ /** Bans a user, or a comment's author (`commentId`), on a comment type or project-wide. */
428
+ export interface CreateBanParams {
429
+ userId?: string;
430
+ commentId?: string;
431
+ /** The comment type's code; left out for a project-wide ban. */
432
+ type?: string;
433
+ reason?: string;
434
+ /** Left out, the ban doesn't expire. */
435
+ expiresAt?: string;
436
+ /** Also remove their comments, in the background. */
437
+ removeComments?: boolean;
438
+ }
439
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAElE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,CAAA;AAQ/C,MAAM,WAAW,cAAc;CAE9B;AAID,2EAA2E;AAC3E,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,qFAAqF;AACrF,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,IAAI,EAAE,CAAC,EAAE,CAAA;IACT,KAAK,EAAE,MAAM,CAAA;CACd;AAED,+BAA+B;AAC/B,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAEhD,iFAAiF;AACjF,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EACA,QAAQ,GAAG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AS,EAAE,MAAM,CAAA;IACjB,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,UAAU,GAAG,IAAI,CAAA;CACxB;AAID,MAAM,WAAW,GAAI,SAAQ,cAAc;IACzC,OAAO,EAAE,MAAM,CAAA;IACf,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,iFAAiF;IACjF,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,2FAA2F;AAC3F,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,qDAAqD;IACrD,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,51 @@
1
1
  {
2
2
  "name": "@oblax/comments",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "2.1.0",
4
+ "description": "Oblax SDK — comments module (comment types, threads, comments, moderation, bans)",
5
+ "license": "MIT",
6
+ "author": {
7
+ "name": "Oblax SDK for JavaScript Team",
8
+ "url": "https://docs.oblax.io/docs/getting-started/your-first-sdk-call"
9
+ },
10
+ "homepage": "https://github.com/oblaxio/oblax-sdk-js#readme",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/oblaxio/oblax-sdk-js.git",
14
+ "directory": "packages/comments"
15
+ },
16
+ "bugs": {
17
+ "url": "https://github.com/oblaxio/oblax-sdk-js/issues"
18
+ },
19
+ "keywords": [
20
+ "oblax",
21
+ "sdk",
22
+ "comments"
23
+ ],
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "type": "module",
28
+ "main": "./dist/index.js",
29
+ "types": "./dist/index.d.ts",
30
+ "exports": {
31
+ ".": {
32
+ "import": "./dist/index.js",
33
+ "types": "./dist/index.d.ts"
34
+ }
35
+ },
36
+ "files": [
37
+ "dist"
38
+ ],
39
+ "peerDependencies": {
40
+ "@oblax/core": "^2.1.0"
41
+ },
42
+ "devDependencies": {
43
+ "typescript": "^5.5.0",
44
+ "@oblax/core": "2.1.0"
45
+ },
46
+ "scripts": {
47
+ "build": "tsc --build tsconfig.json",
48
+ "typecheck": "tsc --build tsconfig.json --dry",
49
+ "clean": "rm -rf dist tsconfig.tsbuildinfo"
50
+ }
6
51
  }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.