@23blocks/block-content 3.3.0 → 3.3.2
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.esm.js +235 -102
- package/dist/src/lib/content.block.d.ts +2 -1
- package/dist/src/lib/content.block.d.ts.map +1 -1
- package/dist/src/lib/mappers/category.mapper.d.ts.map +1 -1
- package/dist/src/lib/mappers/index.d.ts +1 -0
- package/dist/src/lib/mappers/index.d.ts.map +1 -1
- package/dist/src/lib/mappers/post-version.mapper.d.ts +4 -0
- package/dist/src/lib/mappers/post-version.mapper.d.ts.map +1 -0
- package/dist/src/lib/mappers/user.mapper.d.ts +4 -3
- package/dist/src/lib/mappers/user.mapper.d.ts.map +1 -1
- package/dist/src/lib/services/categories.service.d.ts +11 -5
- package/dist/src/lib/services/categories.service.d.ts.map +1 -1
- package/dist/src/lib/services/comments.service.d.ts +30 -12
- package/dist/src/lib/services/comments.service.d.ts.map +1 -1
- package/dist/src/lib/services/index.d.ts +1 -0
- package/dist/src/lib/services/index.d.ts.map +1 -1
- package/dist/src/lib/services/post-versions.service.d.ts +20 -0
- package/dist/src/lib/services/post-versions.service.d.ts.map +1 -0
- package/dist/src/lib/services/users.service.d.ts +3 -3
- package/dist/src/lib/services/users.service.d.ts.map +1 -1
- package/dist/src/lib/types/category.d.ts +11 -16
- package/dist/src/lib/types/category.d.ts.map +1 -1
- package/dist/src/lib/types/comment.d.ts +1 -2
- package/dist/src/lib/types/comment.d.ts.map +1 -1
- package/dist/src/lib/types/index.d.ts +1 -0
- package/dist/src/lib/types/index.d.ts.map +1 -1
- package/dist/src/lib/types/post-version.d.ts +41 -0
- package/dist/src/lib/types/post-version.d.ts.map +1 -0
- package/dist/src/lib/types/user.d.ts +57 -8
- package/dist/src/lib/types/user.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '@swc/helpers/_/_extends';
|
|
1
|
+
import { _ } from '@swc/helpers/_/_extends';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Type guard for single resource document
|
|
@@ -121,7 +121,7 @@ const postMapper = {
|
|
|
121
121
|
type: 'Post',
|
|
122
122
|
map: (resource)=>({
|
|
123
123
|
id: resource.id,
|
|
124
|
-
uniqueId: parseString(resource.attributes['unique_id'])
|
|
124
|
+
uniqueId: parseString(resource.attributes['unique_id']),
|
|
125
125
|
createdAt: parseDate(resource.attributes['created_at']) || new Date(),
|
|
126
126
|
updatedAt: parseDate(resource.attributes['updated_at']) || new Date(),
|
|
127
127
|
postVersionUniqueId: parseString(resource.attributes['post_version_unique_id']),
|
|
@@ -335,11 +335,120 @@ function createPostsService(transport, _config) {
|
|
|
335
335
|
};
|
|
336
336
|
}
|
|
337
337
|
|
|
338
|
+
const postVersionMapper = {
|
|
339
|
+
type: 'PostVersion',
|
|
340
|
+
map: (resource)=>({
|
|
341
|
+
id: resource.id,
|
|
342
|
+
uniqueId: parseString(resource.attributes['unique_id']),
|
|
343
|
+
createdAt: parseDate(resource.attributes['created_at']) || new Date(),
|
|
344
|
+
updatedAt: parseDate(resource.attributes['updated_at']) || new Date(),
|
|
345
|
+
postUniqueId: parseString(resource.attributes['post_unique_id']) || '',
|
|
346
|
+
// Content
|
|
347
|
+
title: parseString(resource.attributes['title']) || '',
|
|
348
|
+
abstract: parseString(resource.attributes['abstract']),
|
|
349
|
+
keywords: parseString(resource.attributes['keywords']),
|
|
350
|
+
content: parseString(resource.attributes['content']),
|
|
351
|
+
// Media
|
|
352
|
+
thumbnailUrl: parseString(resource.attributes['thumbnail_url']),
|
|
353
|
+
imageUrl: parseString(resource.attributes['image_url']),
|
|
354
|
+
mediaUrl: parseString(resource.attributes['media_url']),
|
|
355
|
+
// Metadata
|
|
356
|
+
payload: resource.attributes['payload'],
|
|
357
|
+
status: parseStatus(resource.attributes['status']),
|
|
358
|
+
enabled: parseBoolean(resource.attributes['enabled']),
|
|
359
|
+
// Publishing
|
|
360
|
+
publishAt: parseDate(resource.attributes['publish_at']),
|
|
361
|
+
publishUntil: parseDate(resource.attributes['publish_until']),
|
|
362
|
+
// Author
|
|
363
|
+
userUniqueId: parseString(resource.attributes['user_unique_id']),
|
|
364
|
+
userName: parseString(resource.attributes['user_name']),
|
|
365
|
+
userAlias: parseString(resource.attributes['user_alias']),
|
|
366
|
+
userAvatarUrl: parseString(resource.attributes['user_avatar_url']),
|
|
367
|
+
// Visibility
|
|
368
|
+
isPublic: parseBoolean(resource.attributes['is_public']),
|
|
369
|
+
// Versioning
|
|
370
|
+
version: parseOptionalNumber(resource.attributes['version']),
|
|
371
|
+
revision: parseOptionalNumber(resource.attributes['revision']),
|
|
372
|
+
source: parseString(resource.attributes['source']),
|
|
373
|
+
// AI
|
|
374
|
+
aiGenerated: parseBoolean(resource.attributes['ai_generated']),
|
|
375
|
+
aiModel: parseString(resource.attributes['ai_model']),
|
|
376
|
+
// Moderation
|
|
377
|
+
moderated: parseBoolean(resource.attributes['moderated']),
|
|
378
|
+
moderatedBy: parseString(resource.attributes['moderated_by']),
|
|
379
|
+
moderatedAt: parseDate(resource.attributes['moderated_at']),
|
|
380
|
+
moderationReason: parseString(resource.attributes['moderation_reason']),
|
|
381
|
+
moderationDecision: parseString(resource.attributes['moderation_decision'])
|
|
382
|
+
})
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
function createPostVersionsService(transport, _config) {
|
|
386
|
+
return {
|
|
387
|
+
async list (postUniqueId, params) {
|
|
388
|
+
const queryParams = {};
|
|
389
|
+
if (params == null ? void 0 : params.page) queryParams['page'] = String(params.page);
|
|
390
|
+
if (params == null ? void 0 : params.perPage) queryParams['records'] = String(params.perPage);
|
|
391
|
+
if (params == null ? void 0 : params.status) queryParams['status'] = params.status;
|
|
392
|
+
// Note: The API may not have a dedicated versions list endpoint
|
|
393
|
+
// This uses the post_versions relationship from the post
|
|
394
|
+
const response = await transport.get(`/posts/${postUniqueId}`, {
|
|
395
|
+
params: _({}, queryParams, {
|
|
396
|
+
include: 'post_versions'
|
|
397
|
+
})
|
|
398
|
+
});
|
|
399
|
+
// Extract versions from included relationships
|
|
400
|
+
const data = response;
|
|
401
|
+
if (data.included) {
|
|
402
|
+
const versions = data.included.filter((item)=>{
|
|
403
|
+
const typed = item;
|
|
404
|
+
return typed.type === 'PostVersion' || typed.type === 'post_version';
|
|
405
|
+
});
|
|
406
|
+
return {
|
|
407
|
+
data: versions.map((v)=>postVersionMapper.map(v)),
|
|
408
|
+
meta: {
|
|
409
|
+
total: versions.length,
|
|
410
|
+
page: 1,
|
|
411
|
+
perPage: versions.length
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
return {
|
|
416
|
+
data: [],
|
|
417
|
+
meta: {
|
|
418
|
+
total: 0,
|
|
419
|
+
page: 1,
|
|
420
|
+
perPage: 10
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
},
|
|
424
|
+
async get (postUniqueId, versionUniqueId) {
|
|
425
|
+
// Get post with versions included and find the specific one
|
|
426
|
+
const response = await transport.get(`/posts/${postUniqueId}`, {
|
|
427
|
+
params: {
|
|
428
|
+
include: 'post_versions'
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
const data = response;
|
|
432
|
+
if (data.included) {
|
|
433
|
+
const version = data.included.find((item)=>(item.type === 'PostVersion' || item.type === 'post_version') && (item.attributes['unique_id'] === versionUniqueId || item.id === versionUniqueId));
|
|
434
|
+
if (version) {
|
|
435
|
+
return postVersionMapper.map(version);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
throw new Error(`Version ${versionUniqueId} not found for post ${postUniqueId}`);
|
|
439
|
+
},
|
|
440
|
+
async publish (postUniqueId, versionUniqueId) {
|
|
441
|
+
const response = await transport.post(`/posts/${postUniqueId}/versions/${versionUniqueId}/publish`, {});
|
|
442
|
+
return decodeOne(response, postVersionMapper);
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
|
|
338
447
|
const commentMapper = {
|
|
339
448
|
type: 'Comment',
|
|
340
449
|
map: (resource)=>({
|
|
341
450
|
id: resource.id,
|
|
342
|
-
uniqueId: parseString(resource.attributes['unique_id'])
|
|
451
|
+
uniqueId: parseString(resource.attributes['unique_id']),
|
|
343
452
|
createdAt: parseDate(resource.attributes['created_at']) || new Date(),
|
|
344
453
|
updatedAt: parseDate(resource.attributes['updated_at']) || new Date(),
|
|
345
454
|
postUniqueId: parseString(resource.attributes['post_unique_id']) || '',
|
|
@@ -378,27 +487,25 @@ const commentMapper = {
|
|
|
378
487
|
|
|
379
488
|
function createCommentsService(transport, _config) {
|
|
380
489
|
return {
|
|
381
|
-
async list (params) {
|
|
490
|
+
async list (postUniqueId, params) {
|
|
382
491
|
const queryParams = {};
|
|
383
492
|
if (params == null ? void 0 : params.page) queryParams['page'] = String(params.page);
|
|
384
493
|
if (params == null ? void 0 : params.perPage) queryParams['records'] = String(params.perPage);
|
|
385
|
-
if (params == null ? void 0 : params.postUniqueId) queryParams['post_unique_id'] = params.postUniqueId;
|
|
386
494
|
if (params == null ? void 0 : params.userUniqueId) queryParams['user_unique_id'] = params.userUniqueId;
|
|
387
495
|
if (params == null ? void 0 : params.parentId) queryParams['parent_id'] = params.parentId;
|
|
388
496
|
if (params == null ? void 0 : params.status) queryParams['status'] = params.status;
|
|
389
|
-
const response = await transport.get(
|
|
497
|
+
const response = await transport.get(`/posts/${postUniqueId}/comments`, {
|
|
390
498
|
params: queryParams
|
|
391
499
|
});
|
|
392
500
|
return decodePageResult(response, commentMapper);
|
|
393
501
|
},
|
|
394
|
-
async get (uniqueId) {
|
|
395
|
-
const response = await transport.get(`/comments/${uniqueId}`);
|
|
502
|
+
async get (postUniqueId, uniqueId) {
|
|
503
|
+
const response = await transport.get(`/posts/${postUniqueId}/comments/${uniqueId}`);
|
|
396
504
|
return decodeOne(response, commentMapper);
|
|
397
505
|
},
|
|
398
|
-
async create (data) {
|
|
399
|
-
const response = await transport.post(
|
|
506
|
+
async create (postUniqueId, data) {
|
|
507
|
+
const response = await transport.post(`/posts/${postUniqueId}/comments`, {
|
|
400
508
|
comment: {
|
|
401
|
-
post_unique_id: data.postUniqueId,
|
|
402
509
|
content: data.content,
|
|
403
510
|
thumbnail_url: data.thumbnailUrl,
|
|
404
511
|
image_url: data.imageUrl,
|
|
@@ -410,8 +517,8 @@ function createCommentsService(transport, _config) {
|
|
|
410
517
|
});
|
|
411
518
|
return decodeOne(response, commentMapper);
|
|
412
519
|
},
|
|
413
|
-
async update (uniqueId, data) {
|
|
414
|
-
const response = await transport.put(`/comments/${uniqueId}`, {
|
|
520
|
+
async update (postUniqueId, uniqueId, data) {
|
|
521
|
+
const response = await transport.put(`/posts/${postUniqueId}/comments/${uniqueId}`, {
|
|
415
522
|
comment: {
|
|
416
523
|
content: data.content,
|
|
417
524
|
thumbnail_url: data.thumbnailUrl,
|
|
@@ -425,47 +532,45 @@ function createCommentsService(transport, _config) {
|
|
|
425
532
|
});
|
|
426
533
|
return decodeOne(response, commentMapper);
|
|
427
534
|
},
|
|
428
|
-
async delete (uniqueId) {
|
|
429
|
-
await transport.delete(`/comments/${uniqueId}`);
|
|
535
|
+
async delete (postUniqueId, uniqueId) {
|
|
536
|
+
await transport.delete(`/posts/${postUniqueId}/comments/${uniqueId}`);
|
|
430
537
|
},
|
|
431
|
-
async reply (parentCommentUniqueId, data) {
|
|
432
|
-
const response = await transport.post(
|
|
538
|
+
async reply (postUniqueId, parentCommentUniqueId, data) {
|
|
539
|
+
const response = await transport.post(`/posts/${postUniqueId}/comments/${parentCommentUniqueId}/reply`, {
|
|
433
540
|
comment: {
|
|
434
|
-
post_unique_id: data.postUniqueId,
|
|
435
541
|
content: data.content,
|
|
436
542
|
thumbnail_url: data.thumbnailUrl,
|
|
437
543
|
image_url: data.imageUrl,
|
|
438
544
|
content_url: data.contentUrl,
|
|
439
545
|
media_url: data.mediaUrl,
|
|
440
|
-
parent_id: parentCommentUniqueId,
|
|
441
546
|
payload: data.payload
|
|
442
547
|
}
|
|
443
548
|
});
|
|
444
549
|
return decodeOne(response, commentMapper);
|
|
445
550
|
},
|
|
446
551
|
// Engagement
|
|
447
|
-
async like (uniqueId) {
|
|
448
|
-
const response = await transport.
|
|
552
|
+
async like (postUniqueId, uniqueId) {
|
|
553
|
+
const response = await transport.put(`/posts/${postUniqueId}/comments/${uniqueId}/like`, {});
|
|
449
554
|
return decodeOne(response, commentMapper);
|
|
450
555
|
},
|
|
451
|
-
async dislike (uniqueId) {
|
|
452
|
-
const response = await transport.
|
|
556
|
+
async dislike (postUniqueId, uniqueId) {
|
|
557
|
+
const response = await transport.put(`/posts/${postUniqueId}/comments/${uniqueId}/dislike`, {});
|
|
453
558
|
return decodeOne(response, commentMapper);
|
|
454
559
|
},
|
|
455
|
-
async save (uniqueId) {
|
|
456
|
-
const response = await transport.put(`/comments/${uniqueId}/save`, {});
|
|
560
|
+
async save (postUniqueId, uniqueId) {
|
|
561
|
+
const response = await transport.put(`/posts/${postUniqueId}/comments/${uniqueId}/save`, {});
|
|
457
562
|
return decodeOne(response, commentMapper);
|
|
458
563
|
},
|
|
459
|
-
async unsave (uniqueId) {
|
|
460
|
-
const response = await transport.delete(`/comments/${uniqueId}/unsave`);
|
|
564
|
+
async unsave (postUniqueId, uniqueId) {
|
|
565
|
+
const response = await transport.delete(`/posts/${postUniqueId}/comments/${uniqueId}/unsave`);
|
|
461
566
|
return decodeOne(response, commentMapper);
|
|
462
567
|
},
|
|
463
|
-
async follow (uniqueId) {
|
|
464
|
-
const response = await transport.put(`/comments/${uniqueId}/follow`, {});
|
|
568
|
+
async follow (postUniqueId, uniqueId) {
|
|
569
|
+
const response = await transport.put(`/posts/${postUniqueId}/comments/${uniqueId}/follow`, {});
|
|
465
570
|
return decodeOne(response, commentMapper);
|
|
466
571
|
},
|
|
467
|
-
async unfollow (uniqueId) {
|
|
468
|
-
const response = await transport.delete(`/comments/${uniqueId}/unfollow`);
|
|
572
|
+
async unfollow (postUniqueId, uniqueId) {
|
|
573
|
+
const response = await transport.delete(`/posts/${postUniqueId}/comments/${uniqueId}/unfollow`);
|
|
469
574
|
return decodeOne(response, commentMapper);
|
|
470
575
|
}
|
|
471
576
|
};
|
|
@@ -475,32 +580,22 @@ const categoryMapper = {
|
|
|
475
580
|
type: 'Category',
|
|
476
581
|
map: (resource)=>({
|
|
477
582
|
id: resource.id,
|
|
478
|
-
uniqueId: parseString(resource.attributes['unique_id'])
|
|
583
|
+
uniqueId: parseString(resource.attributes['unique_id']),
|
|
479
584
|
createdAt: parseDate(resource.attributes['created_at']) || new Date(),
|
|
480
585
|
updatedAt: parseDate(resource.attributes['updated_at']) || new Date(),
|
|
481
|
-
|
|
586
|
+
// Core fields from API
|
|
587
|
+
code: parseString(resource.attributes['code']),
|
|
482
588
|
name: parseString(resource.attributes['name']) || '',
|
|
483
589
|
description: parseString(resource.attributes['description']),
|
|
590
|
+
// Hierarchy
|
|
484
591
|
parentId: parseString(resource.attributes['parent_id']),
|
|
485
|
-
parentUniqueId: parseString(resource.attributes['parent_unique_id']),
|
|
486
592
|
// Display
|
|
487
593
|
displayOrder: parseOptionalNumber(resource.attributes['display_order']),
|
|
488
|
-
iconUrl: parseString(resource.attributes['icon_url']),
|
|
489
594
|
imageUrl: parseString(resource.attributes['image_url']),
|
|
490
595
|
contentUrl: parseString(resource.attributes['content_url']),
|
|
491
|
-
slug: parseString(resource.attributes['slug']),
|
|
492
596
|
// Business Logic
|
|
493
597
|
status: parseStatus(resource.attributes['status']),
|
|
494
598
|
enabled: parseBoolean(resource.attributes['enabled']),
|
|
495
|
-
// SEO
|
|
496
|
-
metaTitle: parseString(resource.attributes['meta_title']),
|
|
497
|
-
metaDescription: parseString(resource.attributes['meta_description']),
|
|
498
|
-
metaKeywords: parseString(resource.attributes['meta_keywords']),
|
|
499
|
-
// Source
|
|
500
|
-
source: parseString(resource.attributes['source']),
|
|
501
|
-
sourceAlias: parseString(resource.attributes['source_alias']),
|
|
502
|
-
sourceId: parseString(resource.attributes['source_id']),
|
|
503
|
-
sourceType: parseString(resource.attributes['source_type']),
|
|
504
599
|
// Extra
|
|
505
600
|
payload: resource.attributes['payload'],
|
|
506
601
|
postCount: parseOptionalNumber(resource.attributes['post_count'])
|
|
@@ -513,56 +608,34 @@ function createCategoriesService(transport, _config) {
|
|
|
513
608
|
const queryParams = {};
|
|
514
609
|
if (params == null ? void 0 : params.page) queryParams['page'] = String(params.page);
|
|
515
610
|
if (params == null ? void 0 : params.perPage) queryParams['records'] = String(params.perPage);
|
|
516
|
-
if (params == null ? void 0 : params.
|
|
611
|
+
if (params == null ? void 0 : params.parentId) queryParams['parent_id'] = params.parentId;
|
|
517
612
|
if (params == null ? void 0 : params.withChildren) queryParams['with'] = 'children';
|
|
518
|
-
if (params == null ? void 0 : params.withPosts)
|
|
519
|
-
|
|
613
|
+
if (params == null ? void 0 : params.withPosts) {
|
|
614
|
+
queryParams['with'] = params.withChildren ? 'children,posts' : 'posts';
|
|
615
|
+
}
|
|
616
|
+
const response = await transport.get('/categories', {
|
|
520
617
|
params: queryParams
|
|
521
618
|
});
|
|
522
619
|
return decodePageResult(response, categoryMapper);
|
|
523
620
|
},
|
|
524
621
|
async get (uniqueId) {
|
|
525
|
-
const response = await transport.get(`/
|
|
622
|
+
const response = await transport.get(`/categories/${uniqueId}`);
|
|
526
623
|
return decodeOne(response, categoryMapper);
|
|
527
624
|
},
|
|
528
625
|
async create (data) {
|
|
529
|
-
const response = await transport.post('/
|
|
530
|
-
category: {
|
|
531
|
-
name: data.name,
|
|
532
|
-
description: data.description,
|
|
533
|
-
parent_unique_id: data.parentUniqueId,
|
|
534
|
-
display_order: data.displayOrder,
|
|
535
|
-
image_url: data.imageUrl,
|
|
536
|
-
icon_url: data.iconUrl
|
|
537
|
-
}
|
|
538
|
-
});
|
|
539
|
-
return decodeOne(response, categoryMapper);
|
|
540
|
-
},
|
|
541
|
-
async update (uniqueId, data) {
|
|
542
|
-
const response = await transport.put(`/content/categories/${uniqueId}`, {
|
|
626
|
+
const response = await transport.post('/categories', {
|
|
543
627
|
category: {
|
|
628
|
+
code: data.code,
|
|
544
629
|
name: data.name,
|
|
545
630
|
description: data.description,
|
|
546
|
-
|
|
631
|
+
parent_id: data.parentId,
|
|
547
632
|
display_order: data.displayOrder,
|
|
548
633
|
image_url: data.imageUrl,
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
status: data.status
|
|
634
|
+
content_url: data.contentUrl,
|
|
635
|
+
payload: data.payload
|
|
552
636
|
}
|
|
553
637
|
});
|
|
554
638
|
return decodeOne(response, categoryMapper);
|
|
555
|
-
},
|
|
556
|
-
async delete (uniqueId) {
|
|
557
|
-
await transport.delete(`/content/categories/${uniqueId}`);
|
|
558
|
-
},
|
|
559
|
-
async recover (uniqueId) {
|
|
560
|
-
const response = await transport.put(`/content/categories/${uniqueId}/recover`, {});
|
|
561
|
-
return decodeOne(response, categoryMapper);
|
|
562
|
-
},
|
|
563
|
-
async getChildren (uniqueId) {
|
|
564
|
-
const response = await transport.get(`/content/categories/${uniqueId}/children`);
|
|
565
|
-
return decodeMany(response, categoryMapper);
|
|
566
639
|
}
|
|
567
640
|
};
|
|
568
641
|
}
|
|
@@ -571,7 +644,7 @@ const tagMapper = {
|
|
|
571
644
|
type: 'Tag',
|
|
572
645
|
map: (resource)=>({
|
|
573
646
|
id: resource.id,
|
|
574
|
-
uniqueId: parseString(resource.attributes['unique_id'])
|
|
647
|
+
uniqueId: parseString(resource.attributes['unique_id']),
|
|
575
648
|
createdAt: parseDate(resource.attributes['created_at']) || new Date(),
|
|
576
649
|
updatedAt: parseDate(resource.attributes['updated_at']) || new Date(),
|
|
577
650
|
tag: parseString(resource.attributes['tag']) || '',
|
|
@@ -637,26 +710,69 @@ function createTagsService(transport, _config) {
|
|
|
637
710
|
}
|
|
638
711
|
|
|
639
712
|
const contentUserMapper = {
|
|
640
|
-
type: '
|
|
641
|
-
map: (
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
713
|
+
type: 'UserIdentity',
|
|
714
|
+
map: (resource)=>({
|
|
715
|
+
id: resource.id,
|
|
716
|
+
uniqueId: parseString(resource.attributes['unique_id']),
|
|
717
|
+
createdAt: parseDate(resource.attributes['created_at']) || new Date(),
|
|
718
|
+
updatedAt: parseDate(resource.attributes['updated_at']) || new Date(),
|
|
719
|
+
// Name fields
|
|
720
|
+
firstName: parseString(resource.attributes['first_name']),
|
|
721
|
+
lastName: parseString(resource.attributes['last_name']),
|
|
722
|
+
name: parseString(resource.attributes['user_name']) || parseString(resource.attributes['name']),
|
|
723
|
+
// Contact
|
|
724
|
+
email: parseString(resource.attributes['email']),
|
|
725
|
+
phone: parseString(resource.attributes['phone']),
|
|
726
|
+
// Identity references
|
|
727
|
+
userUniqueId: parseString(resource.attributes['user_unique_id']),
|
|
728
|
+
userName: parseString(resource.attributes['user_name']),
|
|
729
|
+
avatarUrl: parseString(resource.attributes['avatar_url']),
|
|
730
|
+
// Role
|
|
731
|
+
roleName: parseString(resource.attributes['role_name']),
|
|
732
|
+
roleUniqueId: parseString(resource.attributes['role_unique_id']),
|
|
733
|
+
// Preferences
|
|
734
|
+
timeZone: parseString(resource.attributes['time_zone']),
|
|
735
|
+
preferredLanguage: parseString(resource.attributes['preferred_language']),
|
|
736
|
+
// Integrations
|
|
737
|
+
stripeId: parseString(resource.attributes['stripe_id']),
|
|
738
|
+
walletCode: parseString(resource.attributes['wallet_code']),
|
|
739
|
+
// Notification preferences
|
|
740
|
+
emailNotifications: parseBoolean(resource.attributes['email_notifications']),
|
|
741
|
+
smsNotifications: parseBoolean(resource.attributes['sms_notifications']),
|
|
742
|
+
whatsappNotifications: parseBoolean(resource.attributes['whatsapp_notifications']),
|
|
743
|
+
otherNotifications: parseBoolean(resource.attributes['other_notifications']),
|
|
744
|
+
// Business logic
|
|
745
|
+
status: parseStatus(resource.attributes['status']),
|
|
746
|
+
payload: resource.attributes['payload'],
|
|
747
|
+
// Legacy/computed fields
|
|
748
|
+
bio: parseString(resource.attributes['bio']),
|
|
749
|
+
postsCount: parseOptionalNumber(resource.attributes['posts_count']),
|
|
750
|
+
commentsCount: parseOptionalNumber(resource.attributes['comments_count']),
|
|
751
|
+
followersCount: parseOptionalNumber(resource.attributes['followers_count']),
|
|
752
|
+
followingCount: parseOptionalNumber(resource.attributes['following_count'])
|
|
753
|
+
})
|
|
754
|
+
};
|
|
755
|
+
const followingMapper = {
|
|
756
|
+
type: 'Following',
|
|
757
|
+
map: (resource)=>({
|
|
758
|
+
id: resource.id,
|
|
759
|
+
uniqueId: parseString(resource.attributes['unique_id']),
|
|
760
|
+
createdAt: parseDate(resource.attributes['created_at']) || new Date(),
|
|
761
|
+
updatedAt: parseDate(resource.attributes['updated_at']) || new Date(),
|
|
762
|
+
// The user being followed
|
|
763
|
+
userUniqueId: parseString(resource.attributes['user_unique_id']) || '',
|
|
764
|
+
userName: parseString(resource.attributes['user_name']),
|
|
765
|
+
userAlias: parseString(resource.attributes['user_alias']),
|
|
766
|
+
userAvatarUrl: parseString(resource.attributes['user_avatar_url']),
|
|
767
|
+
// The follower
|
|
768
|
+
followerUniqueId: parseString(resource.attributes['follower_unique_id']) || '',
|
|
769
|
+
followerName: parseString(resource.attributes['follower_name']),
|
|
770
|
+
followerAlias: parseString(resource.attributes['follower_alias']),
|
|
771
|
+
followerAvatarUrl: parseString(resource.attributes['follower_avatar_url']),
|
|
772
|
+
// Metadata
|
|
773
|
+
followingSince: parseDate(resource.attributes['following_since']),
|
|
774
|
+
payload: resource.attributes['payload']
|
|
775
|
+
})
|
|
660
776
|
};
|
|
661
777
|
|
|
662
778
|
function createContentUsersService(transport, _config) {
|
|
@@ -681,8 +797,13 @@ function createContentUsersService(transport, _config) {
|
|
|
681
797
|
user: {
|
|
682
798
|
email: data.email,
|
|
683
799
|
name: data.name,
|
|
800
|
+
first_name: data.firstName,
|
|
801
|
+
last_name: data.lastName,
|
|
684
802
|
avatar_url: data.avatarUrl,
|
|
685
803
|
bio: data.bio,
|
|
804
|
+
phone: data.phone,
|
|
805
|
+
time_zone: data.timeZone,
|
|
806
|
+
preferred_language: data.preferredLanguage,
|
|
686
807
|
payload: data.payload
|
|
687
808
|
}
|
|
688
809
|
});
|
|
@@ -692,8 +813,17 @@ function createContentUsersService(transport, _config) {
|
|
|
692
813
|
const response = await transport.put(`/identities/${uniqueId}`, {
|
|
693
814
|
user: {
|
|
694
815
|
name: data.name,
|
|
816
|
+
first_name: data.firstName,
|
|
817
|
+
last_name: data.lastName,
|
|
695
818
|
avatar_url: data.avatarUrl,
|
|
696
819
|
bio: data.bio,
|
|
820
|
+
phone: data.phone,
|
|
821
|
+
time_zone: data.timeZone,
|
|
822
|
+
preferred_language: data.preferredLanguage,
|
|
823
|
+
email_notifications: data.emailNotifications,
|
|
824
|
+
sms_notifications: data.smsNotifications,
|
|
825
|
+
whatsapp_notifications: data.whatsappNotifications,
|
|
826
|
+
other_notifications: data.otherNotifications,
|
|
697
827
|
payload: data.payload
|
|
698
828
|
}
|
|
699
829
|
});
|
|
@@ -739,11 +869,11 @@ function createContentUsersService(transport, _config) {
|
|
|
739
869
|
},
|
|
740
870
|
async getFollowers (uniqueId) {
|
|
741
871
|
const response = await transport.get(`/identities/${uniqueId}/followers`);
|
|
742
|
-
return decodeMany(response,
|
|
872
|
+
return decodeMany(response, followingMapper);
|
|
743
873
|
},
|
|
744
874
|
async getFollowing (uniqueId) {
|
|
745
875
|
const response = await transport.get(`/identities/${uniqueId}/following`);
|
|
746
|
-
return decodeMany(response,
|
|
876
|
+
return decodeMany(response, followingMapper);
|
|
747
877
|
},
|
|
748
878
|
async followUser (uniqueId, targetUserUniqueId) {
|
|
749
879
|
await transport.post(`/identities/${uniqueId}/follows/${targetUserUniqueId}`, {});
|
|
@@ -929,6 +1059,7 @@ const activityMapper = {
|
|
|
929
1059
|
function createContentBlock(transport, config) {
|
|
930
1060
|
return {
|
|
931
1061
|
posts: createPostsService(transport),
|
|
1062
|
+
postVersions: createPostVersionsService(transport),
|
|
932
1063
|
comments: createCommentsService(transport),
|
|
933
1064
|
categories: createCategoriesService(transport),
|
|
934
1065
|
tags: createTagsService(transport),
|
|
@@ -943,13 +1074,15 @@ const contentBlockMetadata = {
|
|
|
943
1074
|
description: 'Content management for posts, comments, categories, tags, and users',
|
|
944
1075
|
resourceTypes: [
|
|
945
1076
|
'Post',
|
|
1077
|
+
'PostVersion',
|
|
946
1078
|
'Comment',
|
|
947
1079
|
'Category',
|
|
948
1080
|
'Tag',
|
|
949
1081
|
'ContentUser',
|
|
1082
|
+
'Following',
|
|
950
1083
|
'ContentFlag',
|
|
951
1084
|
'Activity'
|
|
952
1085
|
]
|
|
953
1086
|
};
|
|
954
1087
|
|
|
955
|
-
export { activityMapper, categoryMapper, commentMapper, contentBlockMetadata, contentFlagMapper, contentUserMapper, createActivityService, createCategoriesService, createCommentsService, createContentBlock, createContentUsersService, createModerationService, createPostsService, createTagsService, postMapper, tagMapper };
|
|
1088
|
+
export { activityMapper, categoryMapper, commentMapper, contentBlockMetadata, contentFlagMapper, contentUserMapper, createActivityService, createCategoriesService, createCommentsService, createContentBlock, createContentUsersService, createModerationService, createPostVersionsService, createPostsService, createTagsService, followingMapper, postMapper, postVersionMapper, tagMapper };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { Transport, BlockConfig, BlockMetadata } from '@23blocks/contracts';
|
|
2
|
-
import { type PostsService, type CommentsService, type CategoriesService, type TagsService, type ContentUsersService, type ModerationService, type ActivityService } from './services';
|
|
2
|
+
import { type PostsService, type PostVersionsService, type CommentsService, type CategoriesService, type TagsService, type ContentUsersService, type ModerationService, type ActivityService } from './services';
|
|
3
3
|
export interface ContentBlockConfig extends BlockConfig {
|
|
4
4
|
appId: string;
|
|
5
5
|
tenantId?: string;
|
|
6
6
|
}
|
|
7
7
|
export interface ContentBlock {
|
|
8
8
|
posts: PostsService;
|
|
9
|
+
postVersions: PostVersionsService;
|
|
9
10
|
comments: CommentsService;
|
|
10
11
|
categories: CategoriesService;
|
|
11
12
|
tags: TagsService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.block.d.ts","sourceRoot":"","sources":["../../../src/lib/content.block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,
|
|
1
|
+
{"version":3,"file":"content.block.d.ts","sourceRoot":"","sources":["../../../src/lib/content.block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EASL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,YAAY,CAAC;IACpB,YAAY,EAAE,mBAAmB,CAAC;IAClC,QAAQ,EAAE,eAAe,CAAC;IAC1B,UAAU,EAAE,iBAAiB,CAAC;IAC9B,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,mBAAmB,CAAC;IAC3B,UAAU,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,EAAE,eAAe,CAAC;CAC3B;AAED,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,kBAAkB,GACzB,YAAY,CAWd;AAED,eAAO,MAAM,oBAAoB,EAAE,aAelC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category.mapper.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/category.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGlD,eAAO,MAAM,cAAc,EAAE,cAAc,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"category.mapper.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/category.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGlD,eAAO,MAAM,cAAc,EAAE,cAAc,CAAC,QAAQ,CA6BnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-version.mapper.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/post-version.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGzD,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC,WAAW,CAuDzD,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ContentUser } from '../types/user';
|
|
3
|
-
export declare const contentUserMapper:
|
|
1
|
+
import type { ResourceMapper } from '@23blocks/jsonapi-codec';
|
|
2
|
+
import type { ContentUser, Following } from '../types/user';
|
|
3
|
+
export declare const contentUserMapper: ResourceMapper<ContentUser>;
|
|
4
|
+
export declare const followingMapper: ResourceMapper<Following>;
|
|
4
5
|
//# sourceMappingURL=user.mapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.mapper.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/user.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"user.mapper.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/user.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG5D,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC,WAAW,CAmDzD,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,SAAS,CAwBrD,CAAC"}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import type { Transport, PageResult } from '@23blocks/contracts';
|
|
2
|
-
import type { Category, CreateCategoryRequest,
|
|
2
|
+
import type { Category, CreateCategoryRequest, ListCategoriesParams } from '../types/category';
|
|
3
3
|
export interface CategoriesService {
|
|
4
|
+
/**
|
|
5
|
+
* List all categories
|
|
6
|
+
*/
|
|
4
7
|
list(params?: ListCategoriesParams): Promise<PageResult<Category>>;
|
|
8
|
+
/**
|
|
9
|
+
* Get a category by unique ID
|
|
10
|
+
*/
|
|
5
11
|
get(uniqueId: string): Promise<Category>;
|
|
12
|
+
/**
|
|
13
|
+
* Create a new category
|
|
14
|
+
* Note: The API does not support update or delete operations for categories
|
|
15
|
+
*/
|
|
6
16
|
create(data: CreateCategoryRequest): Promise<Category>;
|
|
7
|
-
update(uniqueId: string, data: UpdateCategoryRequest): Promise<Category>;
|
|
8
|
-
delete(uniqueId: string): Promise<void>;
|
|
9
|
-
recover(uniqueId: string): Promise<Category>;
|
|
10
|
-
getChildren(uniqueId: string): Promise<Category[]>;
|
|
11
17
|
}
|
|
12
18
|
export declare function createCategoriesService(transport: Transport, _config: {
|
|
13
19
|
appId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"categories.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/categories.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,QAAQ,EACR,qBAAqB,EACrB,
|
|
1
|
+
{"version":3,"file":"categories.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/categories.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,QAAQ,EACR,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAG3B,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEnE;;OAEG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEzC;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACxD;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,iBAAiB,CAqC3G"}
|
|
@@ -1,18 +1,36 @@
|
|
|
1
1
|
import type { Transport, PageResult } from '@23blocks/contracts';
|
|
2
2
|
import type { Comment, CreateCommentRequest, UpdateCommentRequest, ListCommentsParams } from '../types/comment';
|
|
3
3
|
export interface CommentsService {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
/**
|
|
5
|
+
* List comments for a post
|
|
6
|
+
*/
|
|
7
|
+
list(postUniqueId: string, params?: ListCommentsParams): Promise<PageResult<Comment>>;
|
|
8
|
+
/**
|
|
9
|
+
* Get a specific comment
|
|
10
|
+
*/
|
|
11
|
+
get(postUniqueId: string, uniqueId: string): Promise<Comment>;
|
|
12
|
+
/**
|
|
13
|
+
* Create a new comment on a post
|
|
14
|
+
*/
|
|
15
|
+
create(postUniqueId: string, data: CreateCommentRequest): Promise<Comment>;
|
|
16
|
+
/**
|
|
17
|
+
* Update a comment
|
|
18
|
+
*/
|
|
19
|
+
update(postUniqueId: string, uniqueId: string, data: UpdateCommentRequest): Promise<Comment>;
|
|
20
|
+
/**
|
|
21
|
+
* Delete a comment
|
|
22
|
+
*/
|
|
23
|
+
delete(postUniqueId: string, uniqueId: string): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Reply to a comment (creates a nested comment)
|
|
26
|
+
*/
|
|
27
|
+
reply(postUniqueId: string, parentCommentUniqueId: string, data: Omit<CreateCommentRequest, 'parentId'>): Promise<Comment>;
|
|
28
|
+
like(postUniqueId: string, uniqueId: string): Promise<Comment>;
|
|
29
|
+
dislike(postUniqueId: string, uniqueId: string): Promise<Comment>;
|
|
30
|
+
save(postUniqueId: string, uniqueId: string): Promise<Comment>;
|
|
31
|
+
unsave(postUniqueId: string, uniqueId: string): Promise<Comment>;
|
|
32
|
+
follow(postUniqueId: string, uniqueId: string): Promise<Comment>;
|
|
33
|
+
unfollow(postUniqueId: string, uniqueId: string): Promise<Comment>;
|
|
16
34
|
}
|
|
17
35
|
export declare function createCommentsService(transport: Transport, _config: {
|
|
18
36
|
appId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comments.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/comments.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,OAAO,EACP,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,kBAAkB,CAAC;AAG1B,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"comments.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/comments.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,OAAO,EACP,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,kBAAkB,CAAC;AAG1B,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;IAEtF;;OAEG;IACH,GAAG,CAAC,YAAY,EAAE,MAAM,E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AE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,eAAe,CAmGvG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Transport, PageResult } from '@23blocks/contracts';
|
|
2
|
+
import type { PostVersion, ListPostVersionsParams } from '../types/post-version';
|
|
3
|
+
export interface PostVersionsService {
|
|
4
|
+
/**
|
|
5
|
+
* List all versions of a post
|
|
6
|
+
*/
|
|
7
|
+
list(postUniqueId: string, params?: ListPostVersionsParams): Promise<PageResult<PostVersion>>;
|
|
8
|
+
/**
|
|
9
|
+
* Get a specific version of a post
|
|
10
|
+
*/
|
|
11
|
+
get(postUniqueId: string, versionUniqueId: string): Promise<PostVersion>;
|
|
12
|
+
/**
|
|
13
|
+
* Publish a specific version (makes it the current live version)
|
|
14
|
+
*/
|
|
15
|
+
publish(postUniqueId: string, versionUniqueId: string): Promise<PostVersion>;
|
|
16
|
+
}
|
|
17
|
+
export declare function createPostVersionsService(transport: Transport, _config: {
|
|
18
|
+
appId: string;
|
|
19
|
+
}): PostVersionsService;
|
|
20
|
+
//# sourceMappingURL=post-versions.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-versions.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/post-versions.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAGjF,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC;IAE9F;;OAEG;IACH,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEzE;;OAEG;IACH,OAAO,CAAC,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CAC9E;AAED,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,mBAAmB,CAuD/G"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Transport, PageResult } from '@23blocks/contracts';
|
|
2
|
-
import type { ContentUser, RegisterContentUserRequest, UpdateContentUserRequest, ListContentUsersParams, UserActivity } from '../types/user';
|
|
2
|
+
import type { ContentUser, Following, RegisterContentUserRequest, UpdateContentUserRequest, ListContentUsersParams, UserActivity } from '../types/user';
|
|
3
3
|
import type { Post } from '../types/post';
|
|
4
4
|
import type { Comment } from '../types/comment';
|
|
5
5
|
export interface ContentUsersService {
|
|
@@ -13,8 +13,8 @@ export interface ContentUsersService {
|
|
|
13
13
|
getActivities(uniqueId: string): Promise<UserActivity[]>;
|
|
14
14
|
addTag(uniqueId: string, tagUniqueId: string): Promise<ContentUser>;
|
|
15
15
|
removeTag(uniqueId: string, tagUniqueId: string): Promise<void>;
|
|
16
|
-
getFollowers(uniqueId: string): Promise<
|
|
17
|
-
getFollowing(uniqueId: string): Promise<
|
|
16
|
+
getFollowers(uniqueId: string): Promise<Following[]>;
|
|
17
|
+
getFollowing(uniqueId: string): Promise<Following[]>;
|
|
18
18
|
followUser(uniqueId: string, targetUserUniqueId: string): Promise<void>;
|
|
19
19
|
unfollowUser(uniqueId: string, targetUserUniqueId: string): Promise<void>;
|
|
20
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/users.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,WAAW,EACX,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,EACtB,YAAY,EACb,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAKhD,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC;IACxE,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAC5C,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACnF,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,wBAAwB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAG/E,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO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
|
|
4
|
+
code?: string;
|
|
4
5
|
name: string;
|
|
5
6
|
description?: string;
|
|
6
7
|
parentId?: string;
|
|
7
|
-
parentUniqueId?: string;
|
|
8
8
|
displayOrder?: number;
|
|
9
|
-
iconUrl?: string;
|
|
10
9
|
imageUrl?: string;
|
|
11
10
|
contentUrl?: string;
|
|
12
|
-
slug?: string;
|
|
13
11
|
status: EntityStatus;
|
|
14
12
|
enabled: boolean;
|
|
15
|
-
metaTitle?: string;
|
|
16
|
-
metaDescription?: string;
|
|
17
|
-
metaKeywords?: string;
|
|
18
|
-
source?: string;
|
|
19
|
-
sourceAlias?: string;
|
|
20
|
-
sourceId?: string;
|
|
21
|
-
sourceType?: string;
|
|
22
13
|
payload?: Record<string, unknown>;
|
|
23
14
|
children?: Category[];
|
|
24
15
|
postCount?: number;
|
|
25
16
|
}
|
|
26
17
|
export interface CreateCategoryRequest {
|
|
18
|
+
code?: string;
|
|
27
19
|
name: string;
|
|
28
20
|
description?: string;
|
|
29
|
-
|
|
21
|
+
parentId?: string;
|
|
30
22
|
displayOrder?: number;
|
|
31
23
|
imageUrl?: string;
|
|
32
|
-
|
|
24
|
+
contentUrl?: string;
|
|
25
|
+
payload?: Record<string, unknown>;
|
|
33
26
|
}
|
|
34
27
|
export interface UpdateCategoryRequest {
|
|
28
|
+
code?: string;
|
|
35
29
|
name?: string;
|
|
36
30
|
description?: string;
|
|
37
|
-
|
|
31
|
+
parentId?: string;
|
|
38
32
|
displayOrder?: number;
|
|
39
33
|
imageUrl?: string;
|
|
40
|
-
|
|
34
|
+
contentUrl?: string;
|
|
41
35
|
enabled?: boolean;
|
|
42
36
|
status?: EntityStatus;
|
|
37
|
+
payload?: Record<string, unknown>;
|
|
43
38
|
}
|
|
44
39
|
export interface ListCategoriesParams {
|
|
45
40
|
page?: number;
|
|
46
41
|
perPage?: number;
|
|
47
|
-
|
|
42
|
+
parentId?: string;
|
|
48
43
|
withChildren?: boolean;
|
|
49
44
|
withPosts?: boolean;
|
|
50
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/category.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEtE,MAAM,WAAW,QAAS,SAAQ,YAAY;IAC5C,
|
|
1
|
+
{"version":3,"file":"category.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/category.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEtE,MAAM,WAAW,QAAS,SAAQ,YAAY;IAC5C,QAAQ,EAAE,MAAM,CAAC;IAGjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IAGjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAGlC,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAGD,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -27,9 +27,9 @@ export interface Comment extends IdentityCore {
|
|
|
27
27
|
moderatedAt?: Date;
|
|
28
28
|
moderationReason?: string;
|
|
29
29
|
moderationDecision?: string;
|
|
30
|
+
replies?: Comment[];
|
|
30
31
|
}
|
|
31
32
|
export interface CreateCommentRequest {
|
|
32
|
-
postUniqueId: string;
|
|
33
33
|
content: string;
|
|
34
34
|
thumbnailUrl?: string;
|
|
35
35
|
imageUrl?: string;
|
|
@@ -51,7 +51,6 @@ export interface UpdateCommentRequest {
|
|
|
51
51
|
export interface ListCommentsParams {
|
|
52
52
|
page?: number;
|
|
53
53
|
perPage?: number;
|
|
54
|
-
postUniqueId?: string;
|
|
55
54
|
userUniqueId?: string;
|
|
56
55
|
parentId?: string;
|
|
57
56
|
status?: EntityStatus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comment.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/comment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEtE,MAAM,WAAW,OAAQ,SAAQ,YAAY;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IAGjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"comment.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/comment.ts"],"names":[],"mappings":"AAAA,OAAO,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;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { IdentityCore, EntityStatus } from '@23blocks/contracts';
|
|
2
|
+
/**
|
|
3
|
+
* Post version - represents a specific version/revision of a post
|
|
4
|
+
*/
|
|
5
|
+
export interface PostVersion extends IdentityCore {
|
|
6
|
+
uniqueId: string;
|
|
7
|
+
postUniqueId: string;
|
|
8
|
+
title: string;
|
|
9
|
+
abstract?: string;
|
|
10
|
+
keywords?: string;
|
|
11
|
+
content?: string;
|
|
12
|
+
thumbnailUrl?: string;
|
|
13
|
+
imageUrl?: string;
|
|
14
|
+
mediaUrl?: string;
|
|
15
|
+
payload?: Record<string, unknown>;
|
|
16
|
+
status: EntityStatus;
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
publishAt?: Date;
|
|
19
|
+
publishUntil?: Date;
|
|
20
|
+
userUniqueId?: string;
|
|
21
|
+
userName?: string;
|
|
22
|
+
userAlias?: string;
|
|
23
|
+
userAvatarUrl?: string;
|
|
24
|
+
isPublic?: boolean;
|
|
25
|
+
version?: number;
|
|
26
|
+
revision?: number;
|
|
27
|
+
source?: string;
|
|
28
|
+
aiGenerated?: boolean;
|
|
29
|
+
aiModel?: string;
|
|
30
|
+
moderated?: boolean;
|
|
31
|
+
moderatedBy?: string;
|
|
32
|
+
moderatedAt?: Date;
|
|
33
|
+
moderationReason?: string;
|
|
34
|
+
moderationDecision?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface ListPostVersionsParams {
|
|
37
|
+
page?: number;
|
|
38
|
+
perPage?: number;
|
|
39
|
+
status?: EntityStatus;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=post-version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-version.d.ts","sourceRoot":"","sources":["../../../../src/lib/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AM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB"}
|
|
@@ -1,27 +1,76 @@
|
|
|
1
1
|
import type { IdentityCore, EntityStatus } from '@23blocks/contracts';
|
|
2
|
+
/**
|
|
3
|
+
* Content user identity - represents a user in the content system
|
|
4
|
+
*/
|
|
2
5
|
export interface ContentUser extends IdentityCore {
|
|
3
|
-
|
|
4
|
-
|
|
6
|
+
uniqueId: string;
|
|
7
|
+
firstName?: string;
|
|
8
|
+
lastName?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
email?: string;
|
|
11
|
+
phone?: string;
|
|
12
|
+
userUniqueId?: string;
|
|
13
|
+
userName?: string;
|
|
5
14
|
avatarUrl?: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
15
|
+
roleName?: string;
|
|
16
|
+
roleUniqueId?: string;
|
|
17
|
+
timeZone?: string;
|
|
18
|
+
preferredLanguage?: string;
|
|
19
|
+
stripeId?: string;
|
|
20
|
+
walletCode?: string;
|
|
21
|
+
emailNotifications?: boolean;
|
|
22
|
+
smsNotifications?: boolean;
|
|
23
|
+
whatsappNotifications?: boolean;
|
|
24
|
+
otherNotifications?: boolean;
|
|
11
25
|
status: EntityStatus;
|
|
12
26
|
payload?: Record<string, unknown>;
|
|
27
|
+
bio?: string;
|
|
28
|
+
postsCount?: number;
|
|
29
|
+
commentsCount?: number;
|
|
30
|
+
followersCount?: number;
|
|
31
|
+
followingCount?: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Following relationship between users
|
|
35
|
+
*/
|
|
36
|
+
export interface Following extends IdentityCore {
|
|
37
|
+
uniqueId: string;
|
|
38
|
+
userUniqueId: string;
|
|
39
|
+
userName?: string;
|
|
40
|
+
userAlias?: string;
|
|
41
|
+
userAvatarUrl?: string;
|
|
42
|
+
followerUniqueId: string;
|
|
43
|
+
followerName?: string;
|
|
44
|
+
followerAlias?: string;
|
|
45
|
+
followerAvatarUrl?: string;
|
|
46
|
+
followingSince?: Date;
|
|
47
|
+
payload?: Record<string, unknown>;
|
|
13
48
|
}
|
|
14
49
|
export interface RegisterContentUserRequest {
|
|
15
50
|
email: string;
|
|
16
|
-
name
|
|
51
|
+
name?: string;
|
|
52
|
+
firstName?: string;
|
|
53
|
+
lastName?: string;
|
|
17
54
|
avatarUrl?: string;
|
|
18
55
|
bio?: string;
|
|
56
|
+
phone?: string;
|
|
57
|
+
timeZone?: string;
|
|
58
|
+
preferredLanguage?: string;
|
|
19
59
|
payload?: Record<string, unknown>;
|
|
20
60
|
}
|
|
21
61
|
export interface UpdateContentUserRequest {
|
|
22
62
|
name?: string;
|
|
63
|
+
firstName?: string;
|
|
64
|
+
lastName?: string;
|
|
23
65
|
avatarUrl?: string;
|
|
24
66
|
bio?: string;
|
|
67
|
+
phone?: string;
|
|
68
|
+
timeZone?: string;
|
|
69
|
+
preferredLanguage?: string;
|
|
70
|
+
emailNotifications?: boolean;
|
|
71
|
+
smsNotifications?: boolean;
|
|
72
|
+
whatsappNotifications?: boolean;
|
|
73
|
+
otherNotifications?: boolean;
|
|
25
74
|
payload?: Record<string, unknown>;
|
|
26
75
|
}
|
|
27
76
|
export interface ListContentUsersParams {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC/C,QAAQ,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