@23blocks/block-conversations 2.0.0 → 3.0.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.
- package/dist/index.esm.js +400 -4
- package/dist/src/index.d.ts +4 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/lib/conversations.block.d.ts +8 -1
- package/dist/src/lib/conversations.block.d.ts.map +1 -1
- package/dist/src/lib/mappers/context.mapper.d.ts +4 -0
- package/dist/src/lib/mappers/context.mapper.d.ts.map +1 -0
- package/dist/src/lib/mappers/index.d.ts +4 -0
- package/dist/src/lib/mappers/index.d.ts.map +1 -1
- package/dist/src/lib/mappers/message-file.mapper.d.ts +4 -0
- package/dist/src/lib/mappers/message-file.mapper.d.ts.map +1 -0
- package/dist/src/lib/mappers/source.mapper.d.ts +4 -0
- package/dist/src/lib/mappers/source.mapper.d.ts.map +1 -0
- package/dist/src/lib/mappers/user.mapper.d.ts +4 -0
- package/dist/src/lib/mappers/user.mapper.d.ts.map +1 -0
- package/dist/src/lib/services/availabilities.service.d.ts +11 -0
- package/dist/src/lib/services/availabilities.service.d.ts.map +1 -0
- package/dist/src/lib/services/contexts.service.d.ts +14 -0
- package/dist/src/lib/services/contexts.service.d.ts.map +1 -0
- package/dist/src/lib/services/index.d.ts +7 -0
- package/dist/src/lib/services/index.d.ts.map +1 -1
- package/dist/src/lib/services/message-files.service.d.ts +12 -0
- package/dist/src/lib/services/message-files.service.d.ts.map +1 -0
- package/dist/src/lib/services/notification-settings.service.d.ts +10 -0
- package/dist/src/lib/services/notification-settings.service.d.ts.map +1 -0
- package/dist/src/lib/services/sources.service.d.ts +9 -0
- package/dist/src/lib/services/sources.service.d.ts.map +1 -0
- package/dist/src/lib/services/users.service.d.ts +24 -0
- package/dist/src/lib/services/users.service.d.ts.map +1 -0
- package/dist/src/lib/services/websocket-tokens.service.d.ts +9 -0
- package/dist/src/lib/services/websocket-tokens.service.d.ts.map +1 -0
- package/dist/src/lib/types/availability.d.ts +13 -0
- package/dist/src/lib/types/availability.d.ts.map +1 -0
- package/dist/src/lib/types/context.d.ts +36 -0
- package/dist/src/lib/types/context.d.ts.map +1 -0
- package/dist/src/lib/types/index.d.ts +7 -0
- package/dist/src/lib/types/index.d.ts.map +1 -1
- package/dist/src/lib/types/message-file.d.ts +42 -0
- package/dist/src/lib/types/message-file.d.ts.map +1 -0
- package/dist/src/lib/types/notification-settings.d.ts +24 -0
- package/dist/src/lib/types/notification-settings.d.ts.map +1 -0
- package/dist/src/lib/types/source.d.ts +12 -0
- package/dist/src/lib/types/source.d.ts.map +1 -0
- package/dist/src/lib/types/user.d.ts +35 -0
- package/dist/src/lib/types/user.d.ts.map +1 -0
- package/dist/src/lib/types/websocket-token.d.ts +17 -0
- package/dist/src/lib/types/websocket-token.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -643,26 +643,422 @@ function createConversationsService(transport, _config) {
|
|
|
643
643
|
};
|
|
644
644
|
}
|
|
645
645
|
|
|
646
|
+
function createWebSocketTokensService(transport, _config) {
|
|
647
|
+
return {
|
|
648
|
+
async create (data) {
|
|
649
|
+
const response = await transport.post('/api/websocket_tokens', {
|
|
650
|
+
websocket_token: {
|
|
651
|
+
channel: data == null ? void 0 : data.channel,
|
|
652
|
+
user_id: data == null ? void 0 : data.userId
|
|
653
|
+
}
|
|
654
|
+
});
|
|
655
|
+
const result = response.data;
|
|
656
|
+
return {
|
|
657
|
+
token: result.token,
|
|
658
|
+
expiresAt: result.expiresAt ? new Date(result.expiresAt) : undefined,
|
|
659
|
+
channel: result.channel,
|
|
660
|
+
url: result.url
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
const contextMapper = {
|
|
667
|
+
type: 'Context',
|
|
668
|
+
map: (resource)=>({
|
|
669
|
+
id: resource.id,
|
|
670
|
+
uniqueId: parseString(resource.attributes['unique_id']) || resource.id,
|
|
671
|
+
createdAt: parseDate(resource.attributes['created_at']) || new Date(),
|
|
672
|
+
updatedAt: parseDate(resource.attributes['updated_at']) || new Date(),
|
|
673
|
+
name: parseString(resource.attributes['name']),
|
|
674
|
+
description: parseString(resource.attributes['description']),
|
|
675
|
+
contextType: parseString(resource.attributes['context_type']),
|
|
676
|
+
status: parseString(resource.attributes['status']),
|
|
677
|
+
metadata: resource.attributes['metadata'],
|
|
678
|
+
payload: resource.attributes['payload']
|
|
679
|
+
})
|
|
680
|
+
};
|
|
681
|
+
|
|
682
|
+
function createContextsService(transport, _config) {
|
|
683
|
+
return {
|
|
684
|
+
async list (params) {
|
|
685
|
+
const queryParams = {};
|
|
686
|
+
if (params == null ? void 0 : params.page) queryParams['page'] = String(params.page);
|
|
687
|
+
if (params == null ? void 0 : params.perPage) queryParams['records'] = String(params.perPage);
|
|
688
|
+
if (params == null ? void 0 : params.status) queryParams['status'] = params.status;
|
|
689
|
+
if (params == null ? void 0 : params.contextType) queryParams['context_type'] = params.contextType;
|
|
690
|
+
if (params == null ? void 0 : params.search) queryParams['search'] = params.search;
|
|
691
|
+
if (params == null ? void 0 : params.sortBy) queryParams['sort'] = params.sortOrder === 'desc' ? `-${params.sortBy}` : params.sortBy;
|
|
692
|
+
const response = await transport.get('/contexts', {
|
|
693
|
+
params: queryParams
|
|
694
|
+
});
|
|
695
|
+
return decodePageResult(response, contextMapper);
|
|
696
|
+
},
|
|
697
|
+
async get (uniqueId) {
|
|
698
|
+
const response = await transport.get(`/contexts/${uniqueId}`);
|
|
699
|
+
return decodeOne(response, contextMapper);
|
|
700
|
+
},
|
|
701
|
+
async create (data) {
|
|
702
|
+
const response = await transport.post('/contexts', {
|
|
703
|
+
context: {
|
|
704
|
+
name: data.name,
|
|
705
|
+
description: data.description,
|
|
706
|
+
context_type: data.contextType,
|
|
707
|
+
metadata: data.metadata,
|
|
708
|
+
payload: data.payload
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
return decodeOne(response, contextMapper);
|
|
712
|
+
},
|
|
713
|
+
async update (uniqueId, data) {
|
|
714
|
+
const response = await transport.put(`/contexts/${uniqueId}`, {
|
|
715
|
+
context: {
|
|
716
|
+
name: data.name,
|
|
717
|
+
description: data.description,
|
|
718
|
+
context_type: data.contextType,
|
|
719
|
+
status: data.status,
|
|
720
|
+
metadata: data.metadata,
|
|
721
|
+
payload: data.payload
|
|
722
|
+
}
|
|
723
|
+
});
|
|
724
|
+
return decodeOne(response, contextMapper);
|
|
725
|
+
},
|
|
726
|
+
async listGroups (contextUniqueId) {
|
|
727
|
+
const response = await transport.get(`/context/${contextUniqueId}/groups`);
|
|
728
|
+
return decodePageResult(response, groupMapper);
|
|
729
|
+
}
|
|
730
|
+
};
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
function createNotificationSettingsService(transport, _config) {
|
|
734
|
+
return {
|
|
735
|
+
async get (userUniqueId) {
|
|
736
|
+
var _response_data;
|
|
737
|
+
const response = await transport.get(`/users/${userUniqueId}/notifications/settings`);
|
|
738
|
+
const attrs = ((_response_data = response.data) == null ? void 0 : _response_data.attributes) || response.data || {};
|
|
739
|
+
return {
|
|
740
|
+
userUniqueId,
|
|
741
|
+
emailEnabled: attrs.email_enabled,
|
|
742
|
+
pushEnabled: attrs.push_enabled,
|
|
743
|
+
smsEnabled: attrs.sms_enabled,
|
|
744
|
+
inAppEnabled: attrs.in_app_enabled,
|
|
745
|
+
quietHoursStart: attrs.quiet_hours_start,
|
|
746
|
+
quietHoursEnd: attrs.quiet_hours_end,
|
|
747
|
+
timezone: attrs.timezone,
|
|
748
|
+
preferences: attrs.preferences,
|
|
749
|
+
payload: attrs.payload
|
|
750
|
+
};
|
|
751
|
+
},
|
|
752
|
+
async update (userUniqueId, data) {
|
|
753
|
+
var _response_data;
|
|
754
|
+
const response = await transport.put(`/users/${userUniqueId}/notifications/settings`, {
|
|
755
|
+
notification_settings: {
|
|
756
|
+
email_enabled: data.emailEnabled,
|
|
757
|
+
push_enabled: data.pushEnabled,
|
|
758
|
+
sms_enabled: data.smsEnabled,
|
|
759
|
+
in_app_enabled: data.inAppEnabled,
|
|
760
|
+
quiet_hours_start: data.quietHoursStart,
|
|
761
|
+
quiet_hours_end: data.quietHoursEnd,
|
|
762
|
+
timezone: data.timezone,
|
|
763
|
+
preferences: data.preferences,
|
|
764
|
+
payload: data.payload
|
|
765
|
+
}
|
|
766
|
+
});
|
|
767
|
+
const attrs = ((_response_data = response.data) == null ? void 0 : _response_data.attributes) || response.data || {};
|
|
768
|
+
return {
|
|
769
|
+
userUniqueId,
|
|
770
|
+
emailEnabled: attrs.email_enabled,
|
|
771
|
+
pushEnabled: attrs.push_enabled,
|
|
772
|
+
smsEnabled: attrs.sms_enabled,
|
|
773
|
+
inAppEnabled: attrs.in_app_enabled,
|
|
774
|
+
quietHoursStart: attrs.quiet_hours_start,
|
|
775
|
+
quietHoursEnd: attrs.quiet_hours_end,
|
|
776
|
+
timezone: attrs.timezone,
|
|
777
|
+
preferences: attrs.preferences,
|
|
778
|
+
payload: attrs.payload
|
|
779
|
+
};
|
|
780
|
+
}
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
function createAvailabilitiesService(transport, _config) {
|
|
785
|
+
return {
|
|
786
|
+
async get (userUniqueId) {
|
|
787
|
+
var _response_data;
|
|
788
|
+
const response = await transport.get(`/users/${userUniqueId}/status`);
|
|
789
|
+
const attrs = ((_response_data = response.data) == null ? void 0 : _response_data.attributes) || response.data || {};
|
|
790
|
+
return {
|
|
791
|
+
userUniqueId,
|
|
792
|
+
status: attrs.status || 'offline',
|
|
793
|
+
lastSeenAt: attrs.last_seen_at ? new Date(attrs.last_seen_at) : undefined,
|
|
794
|
+
customStatus: attrs.custom_status,
|
|
795
|
+
payload: attrs.payload
|
|
796
|
+
};
|
|
797
|
+
},
|
|
798
|
+
async goOnline (data) {
|
|
799
|
+
var _response_data;
|
|
800
|
+
const response = await transport.post('/users/status', {
|
|
801
|
+
availability: {
|
|
802
|
+
status: (data == null ? void 0 : data.status) || 'online',
|
|
803
|
+
custom_status: data == null ? void 0 : data.customStatus,
|
|
804
|
+
payload: data == null ? void 0 : data.payload
|
|
805
|
+
}
|
|
806
|
+
});
|
|
807
|
+
const attrs = ((_response_data = response.data) == null ? void 0 : _response_data.attributes) || response.data || {};
|
|
808
|
+
return {
|
|
809
|
+
userUniqueId: attrs.user_unique_id,
|
|
810
|
+
status: attrs.status || 'online',
|
|
811
|
+
lastSeenAt: attrs.last_seen_at ? new Date(attrs.last_seen_at) : undefined,
|
|
812
|
+
customStatus: attrs.custom_status,
|
|
813
|
+
payload: attrs.payload
|
|
814
|
+
};
|
|
815
|
+
},
|
|
816
|
+
async goOffline () {
|
|
817
|
+
await transport.delete('/users/status');
|
|
818
|
+
}
|
|
819
|
+
};
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
const messageFileMapper = {
|
|
823
|
+
type: 'MessageFile',
|
|
824
|
+
map: (resource)=>({
|
|
825
|
+
id: resource.id,
|
|
826
|
+
uniqueId: parseString(resource.attributes['unique_id']) || resource.id,
|
|
827
|
+
createdAt: parseDate(resource.attributes['created_at']) || new Date(),
|
|
828
|
+
updatedAt: parseDate(resource.attributes['updated_at']) || new Date(),
|
|
829
|
+
conversationUniqueId: parseString(resource.attributes['conversation_unique_id']),
|
|
830
|
+
messageUniqueId: parseString(resource.attributes['message_unique_id']),
|
|
831
|
+
name: parseString(resource.attributes['name']) || '',
|
|
832
|
+
originalName: parseString(resource.attributes['original_name']),
|
|
833
|
+
contentType: parseString(resource.attributes['content_type']),
|
|
834
|
+
size: parseOptionalNumber(resource.attributes['size']),
|
|
835
|
+
url: parseString(resource.attributes['url']),
|
|
836
|
+
thumbnailUrl: parseString(resource.attributes['thumbnail_url']),
|
|
837
|
+
status: parseString(resource.attributes['status']),
|
|
838
|
+
payload: resource.attributes['payload']
|
|
839
|
+
})
|
|
840
|
+
};
|
|
841
|
+
|
|
842
|
+
function createMessageFilesService(transport, _config) {
|
|
843
|
+
return {
|
|
844
|
+
async get (conversationUniqueId, fileUniqueId) {
|
|
845
|
+
const response = await transport.get(`/conversations/${conversationUniqueId}/files/${fileUniqueId}`);
|
|
846
|
+
return decodeOne(response, messageFileMapper);
|
|
847
|
+
},
|
|
848
|
+
async create (conversationUniqueId, data) {
|
|
849
|
+
const response = await transport.post(`/conversations/${conversationUniqueId}/files`, {
|
|
850
|
+
message_file: {
|
|
851
|
+
name: data.name,
|
|
852
|
+
content_type: data.contentType,
|
|
853
|
+
size: data.size,
|
|
854
|
+
url: data.url,
|
|
855
|
+
message_unique_id: data.messageUniqueId,
|
|
856
|
+
payload: data.payload
|
|
857
|
+
}
|
|
858
|
+
});
|
|
859
|
+
return decodeOne(response, messageFileMapper);
|
|
860
|
+
},
|
|
861
|
+
async delete (conversationUniqueId, fileUniqueId) {
|
|
862
|
+
await transport.delete(`/conversations/${conversationUniqueId}/files/${fileUniqueId}`);
|
|
863
|
+
},
|
|
864
|
+
async presign (conversationUniqueId, data) {
|
|
865
|
+
const response = await transport.put(`/conversations/${conversationUniqueId}/presign`, {
|
|
866
|
+
file: {
|
|
867
|
+
filename: data.filename,
|
|
868
|
+
content_type: data.contentType,
|
|
869
|
+
size: data.size
|
|
870
|
+
}
|
|
871
|
+
});
|
|
872
|
+
const result = response.data || response;
|
|
873
|
+
return {
|
|
874
|
+
uploadUrl: result.upload_url || result.uploadUrl,
|
|
875
|
+
fileUrl: result.file_url || result.fileUrl,
|
|
876
|
+
fields: result.fields,
|
|
877
|
+
expiresAt: result.expires_at ? new Date(result.expires_at) : undefined
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
};
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
const sourceMapper = {
|
|
884
|
+
type: 'Source',
|
|
885
|
+
map: (resource)=>({
|
|
886
|
+
id: resource.id,
|
|
887
|
+
uniqueId: parseString(resource.attributes['unique_id']) || resource.id,
|
|
888
|
+
createdAt: parseDate(resource.attributes['created_at']) || new Date(),
|
|
889
|
+
updatedAt: parseDate(resource.attributes['updated_at']) || new Date(),
|
|
890
|
+
name: parseString(resource.attributes['name']),
|
|
891
|
+
sourceType: parseString(resource.attributes['source_type']),
|
|
892
|
+
externalId: parseString(resource.attributes['external_id']),
|
|
893
|
+
status: parseString(resource.attributes['status']),
|
|
894
|
+
metadata: resource.attributes['metadata'],
|
|
895
|
+
payload: resource.attributes['payload']
|
|
896
|
+
})
|
|
897
|
+
};
|
|
898
|
+
|
|
899
|
+
function createSourcesService(transport, _config) {
|
|
900
|
+
return {
|
|
901
|
+
async get (uniqueId) {
|
|
902
|
+
const response = await transport.get(`/sources/${uniqueId}`);
|
|
903
|
+
return decodeOne(response, sourceMapper);
|
|
904
|
+
}
|
|
905
|
+
};
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
const conversationsUserMapper = {
|
|
909
|
+
type: 'User',
|
|
910
|
+
map: (resource)=>({
|
|
911
|
+
id: resource.id,
|
|
912
|
+
uniqueId: parseString(resource.attributes['unique_id']) || resource.id,
|
|
913
|
+
createdAt: parseDate(resource.attributes['created_at']) || new Date(),
|
|
914
|
+
updatedAt: parseDate(resource.attributes['updated_at']) || new Date(),
|
|
915
|
+
email: parseString(resource.attributes['email']),
|
|
916
|
+
name: parseString(resource.attributes['name']),
|
|
917
|
+
username: parseString(resource.attributes['username']),
|
|
918
|
+
avatarUrl: parseString(resource.attributes['avatar_url']),
|
|
919
|
+
status: parseString(resource.attributes['status']),
|
|
920
|
+
lastSeenAt: parseDate(resource.attributes['last_seen_at']),
|
|
921
|
+
payload: resource.attributes['payload']
|
|
922
|
+
})
|
|
923
|
+
};
|
|
924
|
+
|
|
925
|
+
function createUsersService(transport, _config) {
|
|
926
|
+
return {
|
|
927
|
+
async list (params) {
|
|
928
|
+
const queryParams = {};
|
|
929
|
+
if (params == null ? void 0 : params.page) queryParams['page'] = String(params.page);
|
|
930
|
+
if (params == null ? void 0 : params.perPage) queryParams['records'] = String(params.perPage);
|
|
931
|
+
if (params == null ? void 0 : params.status) queryParams['status'] = params.status;
|
|
932
|
+
if (params == null ? void 0 : params.search) queryParams['search'] = params.search;
|
|
933
|
+
if (params == null ? void 0 : params.sortBy) queryParams['sort'] = params.sortOrder === 'desc' ? `-${params.sortBy}` : params.sortBy;
|
|
934
|
+
const response = await transport.get('/users', {
|
|
935
|
+
params: queryParams
|
|
936
|
+
});
|
|
937
|
+
return decodePageResult(response, conversationsUserMapper);
|
|
938
|
+
},
|
|
939
|
+
async get (uniqueId) {
|
|
940
|
+
const response = await transport.get(`/users/${uniqueId}`);
|
|
941
|
+
return decodeOne(response, conversationsUserMapper);
|
|
942
|
+
},
|
|
943
|
+
async register (uniqueId, data) {
|
|
944
|
+
const response = await transport.post(`/users/${uniqueId}/register`, {
|
|
945
|
+
user: {
|
|
946
|
+
email: data == null ? void 0 : data.email,
|
|
947
|
+
name: data == null ? void 0 : data.name,
|
|
948
|
+
username: data == null ? void 0 : data.username,
|
|
949
|
+
avatar_url: data == null ? void 0 : data.avatarUrl,
|
|
950
|
+
payload: data == null ? void 0 : data.payload
|
|
951
|
+
}
|
|
952
|
+
});
|
|
953
|
+
return decodeOne(response, conversationsUserMapper);
|
|
954
|
+
},
|
|
955
|
+
async update (uniqueId, data) {
|
|
956
|
+
const response = await transport.put(`/users/${uniqueId}`, {
|
|
957
|
+
user: {
|
|
958
|
+
name: data.name,
|
|
959
|
+
username: data.username,
|
|
960
|
+
avatar_url: data.avatarUrl,
|
|
961
|
+
status: data.status,
|
|
962
|
+
payload: data.payload
|
|
963
|
+
}
|
|
964
|
+
});
|
|
965
|
+
return decodeOne(response, conversationsUserMapper);
|
|
966
|
+
},
|
|
967
|
+
async listGroups (uniqueId) {
|
|
968
|
+
const response = await transport.get(`/users/${uniqueId}/groups`);
|
|
969
|
+
return decodePageResult(response, groupMapper);
|
|
970
|
+
},
|
|
971
|
+
async listConversations (uniqueId, params) {
|
|
972
|
+
var _rawResponse_meta, _rawResponse_meta1, _rawResponse_meta2, _rawResponse_meta3;
|
|
973
|
+
const queryParams = {};
|
|
974
|
+
if (params == null ? void 0 : params.page) queryParams['page'] = String(params.page);
|
|
975
|
+
if (params == null ? void 0 : params.perPage) queryParams['records'] = String(params.perPage);
|
|
976
|
+
const response = await transport.get(`/users/${uniqueId}/conversations`, {
|
|
977
|
+
params: queryParams
|
|
978
|
+
});
|
|
979
|
+
// Return conversations with their messages
|
|
980
|
+
const rawResponse = response;
|
|
981
|
+
const data = rawResponse.data || [];
|
|
982
|
+
return {
|
|
983
|
+
data: data.map((conv)=>({
|
|
984
|
+
id: conv.id || conv.unique_id,
|
|
985
|
+
context: conv.context || conv.unique_id,
|
|
986
|
+
messages: [],
|
|
987
|
+
files: [],
|
|
988
|
+
meta: conv.meta || {}
|
|
989
|
+
})),
|
|
990
|
+
meta: {
|
|
991
|
+
totalCount: ((_rawResponse_meta = rawResponse.meta) == null ? void 0 : _rawResponse_meta.total_count) || data.length,
|
|
992
|
+
page: ((_rawResponse_meta1 = rawResponse.meta) == null ? void 0 : _rawResponse_meta1.page) || 1,
|
|
993
|
+
perPage: ((_rawResponse_meta2 = rawResponse.meta) == null ? void 0 : _rawResponse_meta2.per_page) || data.length,
|
|
994
|
+
totalPages: ((_rawResponse_meta3 = rawResponse.meta) == null ? void 0 : _rawResponse_meta3.total_pages) || 1
|
|
995
|
+
}
|
|
996
|
+
};
|
|
997
|
+
},
|
|
998
|
+
async listGroupConversations (uniqueId, params) {
|
|
999
|
+
var _rawResponse_meta, _rawResponse_meta1, _rawResponse_meta2, _rawResponse_meta3;
|
|
1000
|
+
const queryParams = {};
|
|
1001
|
+
if (params == null ? void 0 : params.page) queryParams['page'] = String(params.page);
|
|
1002
|
+
if (params == null ? void 0 : params.perPage) queryParams['records'] = String(params.perPage);
|
|
1003
|
+
const response = await transport.get(`/users/${uniqueId}/mygroups/conversations`, {
|
|
1004
|
+
params: queryParams
|
|
1005
|
+
});
|
|
1006
|
+
const rawResponse = response;
|
|
1007
|
+
const data = rawResponse.data || [];
|
|
1008
|
+
return {
|
|
1009
|
+
data: data.map((conv)=>({
|
|
1010
|
+
id: conv.id || conv.unique_id,
|
|
1011
|
+
context: conv.context || conv.unique_id,
|
|
1012
|
+
messages: [],
|
|
1013
|
+
files: [],
|
|
1014
|
+
meta: conv.meta || {}
|
|
1015
|
+
})),
|
|
1016
|
+
meta: {
|
|
1017
|
+
totalCount: ((_rawResponse_meta = rawResponse.meta) == null ? void 0 : _rawResponse_meta.total_count) || data.length,
|
|
1018
|
+
page: ((_rawResponse_meta1 = rawResponse.meta) == null ? void 0 : _rawResponse_meta1.page) || 1,
|
|
1019
|
+
perPage: ((_rawResponse_meta2 = rawResponse.meta) == null ? void 0 : _rawResponse_meta2.per_page) || data.length,
|
|
1020
|
+
totalPages: ((_rawResponse_meta3 = rawResponse.meta) == null ? void 0 : _rawResponse_meta3.total_pages) || 1
|
|
1021
|
+
}
|
|
1022
|
+
};
|
|
1023
|
+
},
|
|
1024
|
+
async listContextGroups (uniqueId, contextUniqueId) {
|
|
1025
|
+
const response = await transport.get(`/users/${uniqueId}/context/${contextUniqueId}/groups`);
|
|
1026
|
+
return decodePageResult(response, groupMapper);
|
|
1027
|
+
}
|
|
1028
|
+
};
|
|
1029
|
+
}
|
|
1030
|
+
|
|
646
1031
|
function createConversationsBlock(transport, config) {
|
|
647
1032
|
return {
|
|
648
1033
|
messages: createMessagesService(transport),
|
|
649
1034
|
draftMessages: createDraftMessagesService(transport),
|
|
650
1035
|
groups: createGroupsService(transport),
|
|
651
1036
|
notifications: createNotificationsService(transport),
|
|
652
|
-
conversations: createConversationsService(transport)
|
|
1037
|
+
conversations: createConversationsService(transport),
|
|
1038
|
+
websocketTokens: createWebSocketTokensService(transport),
|
|
1039
|
+
contexts: createContextsService(transport),
|
|
1040
|
+
notificationSettings: createNotificationSettingsService(transport),
|
|
1041
|
+
availabilities: createAvailabilitiesService(transport),
|
|
1042
|
+
messageFiles: createMessageFilesService(transport),
|
|
1043
|
+
sources: createSourcesService(transport),
|
|
1044
|
+
users: createUsersService(transport)
|
|
653
1045
|
};
|
|
654
1046
|
}
|
|
655
1047
|
const conversationsBlockMetadata = {
|
|
656
1048
|
name: 'conversations',
|
|
657
1049
|
version: '0.1.0',
|
|
658
|
-
description: 'Messaging, conversations, groups, and
|
|
1050
|
+
description: 'Messaging, conversations, groups, notifications, and real-time communication management',
|
|
659
1051
|
resourceTypes: [
|
|
660
1052
|
'Message',
|
|
661
1053
|
'DraftMessage',
|
|
662
1054
|
'Group',
|
|
663
1055
|
'Notification',
|
|
664
|
-
'Conversation'
|
|
1056
|
+
'Conversation',
|
|
1057
|
+
'Context',
|
|
1058
|
+
'MessageFile',
|
|
1059
|
+
'Source',
|
|
1060
|
+
'User'
|
|
665
1061
|
]
|
|
666
1062
|
};
|
|
667
1063
|
|
|
668
|
-
export { conversationsBlockMetadata, createConversationsBlock, createConversationsService, createDraftMessagesService, createGroupsService, createMessagesService, createNotificationsService, draftMessageMapper, groupMapper, messageMapper, notificationMapper };
|
|
1064
|
+
export { contextMapper, conversationsBlockMetadata, conversationsUserMapper, createAvailabilitiesService, createContextsService, createConversationsBlock, createConversationsService, createDraftMessagesService, createGroupsService, createMessageFilesService, createMessagesService, createNotificationSettingsService, createNotificationsService, createSourcesService, createUsersService, createWebSocketTokensService, draftMessageMapper, groupMapper, messageFileMapper, messageMapper, notificationMapper, sourceMapper };
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { createConversationsBlock, conversationsBlockMetadata } from './lib/conversations.block';
|
|
2
2
|
export type { ConversationsBlock, ConversationsBlockConfig } from './lib/conversations.block';
|
|
3
|
-
export type { Message, CreateMessageRequest, UpdateMessageRequest, ListMessagesParams, DraftMessage, CreateDraftMessageRequest, UpdateDraftMessageRequest, ListDraftMessagesParams, Group, CreateGroupRequest, UpdateGroupRequest, ListGroupsParams, Notification, CreateNotificationRequest, UpdateNotificationRequest, ListNotificationsParams, Conversation, ConversationFile, ConversationMeta, GetConversationParams, } from './lib/types';
|
|
4
|
-
export type { MessagesService, DraftMessagesService, GroupsService, NotificationsService, ConversationsService, } from './lib/services';
|
|
5
|
-
export { createMessagesService, createDraftMessagesService, createGroupsService, createNotificationsService, createConversationsService, } from './lib/services';
|
|
6
|
-
export { messageMapper, draftMessageMapper, groupMapper, notificationMapper, } from './lib/mappers';
|
|
3
|
+
export type { Message, CreateMessageRequest, UpdateMessageRequest, ListMessagesParams, DraftMessage, CreateDraftMessageRequest, UpdateDraftMessageRequest, ListDraftMessagesParams, Group, CreateGroupRequest, UpdateGroupRequest, ListGroupsParams, Notification, CreateNotificationRequest, UpdateNotificationRequest, ListNotificationsParams, Conversation, ConversationFile, ConversationMeta, GetConversationParams, WebSocketToken, Context, CreateContextRequest, UpdateContextRequest, ListContextsParams, NotificationSettings, UpdateNotificationSettingsRequest, Availability, UpdateAvailabilityRequest, MessageFile, UploadMessageFileRequest, ListMessageFilesParams, Source, CreateSourceRequest, UpdateSourceRequest, ListSourcesParams, ConversationsUser, RegisterUserRequest, UpdateUserRequest, ListUsersParams, } from './lib/types';
|
|
4
|
+
export type { MessagesService, DraftMessagesService, GroupsService, NotificationsService, ConversationsService, WebSocketTokensService, ContextsService, NotificationSettingsService, AvailabilitiesService, MessageFilesService, SourcesService, UsersService, } from './lib/services';
|
|
5
|
+
export { createMessagesService, createDraftMessagesService, createGroupsService, createNotificationsService, createConversationsService, createWebSocketTokensService, createContextsService, createNotificationSettingsService, createAvailabilitiesService, createMessageFilesService, createSourcesService, createUsersService, } from './lib/services';
|
|
6
|
+
export { messageMapper, draftMessageMapper, groupMapper, notificationMapper, contextMapper, messageFileMapper, sourceMapper, conversationsUserMapper, } from './lib/mappers';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACjG,YAAY,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAG9F,YAAY,EAEV,OAAO,EACP,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAElB,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EAEvB,KAAK,EACL,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAEhB,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EAEvB,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACjG,YAAY,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAG9F,YAAY,EAEV,OAAO,EACP,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAElB,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EAEvB,KAAK,EACL,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAEhB,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EAEvB,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EAErB,cAAc,EAEd,OAAO,EACP,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAElB,oBAAoB,EACpB,iCAAiC,EAEjC,YAAY,EACZ,yBAAyB,EAEzB,WAAW,EACX,wBAAwB,EACxB,sBAAsB,EAEtB,MAAM,EACN,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EAEjB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,GAChB,MAAM,aAAa,CAAC;AAGrB,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,2BAA2B,EAC3B,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,YAAY,GACb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,0BAA0B,EAC1B,0BAA0B,EAC1B,4BAA4B,EAC5B,qBAAqB,EACrB,iCAAiC,EACjC,2BAA2B,EAC3B,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,uBAAuB,GACxB,MAAM,eAAe,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Transport, BlockConfig, BlockMetadata } from '@23blocks/contracts';
|
|
2
|
-
import { type MessagesService, type DraftMessagesService, type GroupsService, type NotificationsService, type ConversationsService } from './services';
|
|
2
|
+
import { type MessagesService, type DraftMessagesService, type GroupsService, type NotificationsService, type ConversationsService, type WebSocketTokensService, type ContextsService, type NotificationSettingsService, type AvailabilitiesService, type MessageFilesService, type SourcesService, type UsersService } from './services';
|
|
3
3
|
export interface ConversationsBlockConfig extends BlockConfig {
|
|
4
4
|
appId: string;
|
|
5
5
|
tenantId?: string;
|
|
@@ -10,6 +10,13 @@ export interface ConversationsBlock {
|
|
|
10
10
|
groups: GroupsService;
|
|
11
11
|
notifications: NotificationsService;
|
|
12
12
|
conversations: ConversationsService;
|
|
13
|
+
websocketTokens: WebSocketTokensService;
|
|
14
|
+
contexts: ContextsService;
|
|
15
|
+
notificationSettings: NotificationSettingsService;
|
|
16
|
+
availabilities: AvailabilitiesService;
|
|
17
|
+
messageFiles: MessageFilesService;
|
|
18
|
+
sources: SourcesService;
|
|
19
|
+
users: UsersService;
|
|
13
20
|
}
|
|
14
21
|
export declare function createConversationsBlock(transport: Transport, config: ConversationsBlockConfig): ConversationsBlock;
|
|
15
22
|
export declare const conversationsBlockMetadata: BlockMetadata;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversations.block.d.ts","sourceRoot":"","sources":["../../../src/lib/conversations.block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,
|
|
1
|
+
{"version":3,"file":"conversations.block.d.ts","sourceRoot":"","sources":["../../../src/lib/conversations.block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAaL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,wBAAyB,SAAQ,WAAW;IAC3D,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,eAAe,CAAC;IAC1B,aAAa,EAAE,oBAAoB,CAAC;IACpC,MAAM,EAAE,aAAa,CAAC;IACtB,aAAa,EAAE,oBAAoB,CAAC;IACpC,aAAa,EAAE,oBAAoB,CAAC;IACpC,eAAe,EAAE,sBAAsB,CAAC;IACxC,QAAQ,EAAE,eAAe,CAAC;IAC1B,oBAAoB,EAAE,2BAA2B,CAAC;IAClD,cAAc,EAAE,qBAAqB,CAAC;IACtC,YAAY,EAAE,mBAAmB,CAAC;IAClC,OAAO,EAAE,cAAc,CAAC;IACxB,KAAK,EAAE,YAAY,CAAC;CACrB;AAED,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,wBAAwB,GAC/B,kBAAkB,CAepB;AAED,eAAO,MAAM,0BAA0B,EAAE,aAexC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.mapper.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/context.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAGhD,eAAO,MAAM,aAAa,EAAE,cAAc,CAAC,OAAO,CAcjD,CAAC"}
|
|
@@ -2,5 +2,9 @@ export * from './message.mapper';
|
|
|
2
2
|
export * from './draft-message.mapper';
|
|
3
3
|
export * from './group.mapper';
|
|
4
4
|
export * from './notification.mapper';
|
|
5
|
+
export * from './context.mapper';
|
|
6
|
+
export * from './message-file.mapper';
|
|
7
|
+
export * from './source.mapper';
|
|
8
|
+
export * from './user.mapper';
|
|
5
9
|
export * from './utils';
|
|
6
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-file.mapper.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/message-file.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,CAkBzD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.mapper.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/source.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAG9C,eAAO,MAAM,YAAY,EAAE,cAAc,CAAC,MAAM,CAc/C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
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,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGvD,eAAO,MAAM,uBAAuB,EAAE,cAAc,CAAC,iBAAiB,CAerE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Transport } from '@23blocks/contracts';
|
|
2
|
+
import type { UserAvailability, SetAvailabilityRequest } from '../types/availability';
|
|
3
|
+
export interface AvailabilitiesService {
|
|
4
|
+
get(userUniqueId: string): Promise<UserAvailability>;
|
|
5
|
+
goOnline(data?: SetAvailabilityRequest): Promise<UserAvailability>;
|
|
6
|
+
goOffline(): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare function createAvailabilitiesService(transport: Transport, _config: {
|
|
9
|
+
appId: string;
|
|
10
|
+
}): AvailabilitiesService;
|
|
11
|
+
//# sourceMappingURL=availabilities.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"availabilities.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/availabilities.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EACV,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,qBAAqB;IACpC,GAAG,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACrD,QAAQ,CAAC,IAAI,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACnE,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B;AAED,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,qBAAqB,CAuCnH"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Transport, PageResult } from '@23blocks/contracts';
|
|
2
|
+
import type { Context, CreateContextRequest, UpdateContextRequest, ListContextsParams } from '../types/context';
|
|
3
|
+
import type { Group } from '../types/group';
|
|
4
|
+
export interface ContextsService {
|
|
5
|
+
list(params?: ListContextsParams): Promise<PageResult<Context>>;
|
|
6
|
+
get(uniqueId: string): Promise<Context>;
|
|
7
|
+
create(data: CreateContextRequest): Promise<Context>;
|
|
8
|
+
update(uniqueId: string, data: UpdateContextRequest): Promise<Context>;
|
|
9
|
+
listGroups(contextUniqueId: string): Promise<PageResult<Group>>;
|
|
10
|
+
}
|
|
11
|
+
export declare function createContextsService(transport: Transport, _config: {
|
|
12
|
+
appId: string;
|
|
13
|
+
}): ContextsService;
|
|
14
|
+
//# sourceMappingURL=contexts.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contexts.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/contexts.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;AAC1B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAI5C,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;IAChE,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACrD,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvE,UAAU,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;CACjE;AAED,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,eAAe,CAoDvG"}
|
|
@@ -3,4 +3,11 @@ export * from './draft-messages.service';
|
|
|
3
3
|
export * from './groups.service';
|
|
4
4
|
export * from './notifications.service';
|
|
5
5
|
export * from './conversations.service';
|
|
6
|
+
export * from './websocket-tokens.service';
|
|
7
|
+
export * from './contexts.service';
|
|
8
|
+
export * from './notification-settings.service';
|
|
9
|
+
export * from './availabilities.service';
|
|
10
|
+
export * from './message-files.service';
|
|
11
|
+
export * from './sources.service';
|
|
12
|
+
export * from './users.service';
|
|
6
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Transport } from '@23blocks/contracts';
|
|
2
|
+
import type { MessageFile, CreateMessageFileRequest, PresignMessageFileRequest, PresignMessageFileResponse } from '../types/message-file';
|
|
3
|
+
export interface MessageFilesService {
|
|
4
|
+
get(conversationUniqueId: string, fileUniqueId: string): Promise<MessageFile>;
|
|
5
|
+
create(conversationUniqueId: string, data: CreateMessageFileRequest): Promise<MessageFile>;
|
|
6
|
+
delete(conversationUniqueId: string, fileUniqueId: string): Promise<void>;
|
|
7
|
+
presign(conversationUniqueId: string, data: PresignMessageFileRequest): Promise<PresignMessageFileResponse>;
|
|
8
|
+
}
|
|
9
|
+
export declare function createMessageFilesService(transport: Transport, _config: {
|
|
10
|
+
appId: string;
|
|
11
|
+
}): MessageFilesService;
|
|
12
|
+
//# sourceMappingURL=message-files.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-files.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/message-files.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EACV,WAAW,EACX,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,uBAAuB,CAAC;AAG/B,MAAM,WAAW,mBAAmB;IAClC,GAAG,CAAC,oBAAoB,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAC9E,MAAM,CAAC,oBAAoB,EAAE,MAAM,EAAE,IAAI,EAAE,wBAAwB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAC3F,MAAM,CAAC,oBAAoB,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1E,OAAO,CAAC,oBAAoB,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;CAC7G;AAED,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,mBAAmB,CA2C/G"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Transport } from '@23blocks/contracts';
|
|
2
|
+
import type { NotificationSettings, UpdateNotificationSettingsRequest } from '../types/notification-settings';
|
|
3
|
+
export interface NotificationSettingsService {
|
|
4
|
+
get(userUniqueId: string): Promise<NotificationSettings>;
|
|
5
|
+
update(userUniqueId: string, data: UpdateNotificationSettingsRequest): Promise<NotificationSettings>;
|
|
6
|
+
}
|
|
7
|
+
export declare function createNotificationSettingsService(transport: Transport, _config: {
|
|
8
|
+
appId: string;
|
|
9
|
+
}): NotificationSettingsService;
|
|
10
|
+
//# sourceMappingURL=notification-settings.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-settings.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/notification-settings.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EACV,oBAAoB,EACpB,iCAAiC,EAClC,MAAM,gCAAgC,CAAC;AAExC,MAAM,WAAW,2BAA2B;IAC1C,GAAG,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACzD,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,iCAAiC,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACtG;AAED,wBAAgB,iCAAiC,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,2BAA2B,CAmD/H"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Transport } from '@23blocks/contracts';
|
|
2
|
+
import type { Source } from '../types/source';
|
|
3
|
+
export interface SourcesService {
|
|
4
|
+
get(uniqueId: string): Promise<Source>;
|
|
5
|
+
}
|
|
6
|
+
export declare function createSourcesService(transport: Transport, _config: {
|
|
7
|
+
appId: string;
|
|
8
|
+
}): SourcesService;
|
|
9
|
+
//# sourceMappingURL=sources.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sources.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/sources.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAG9C,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACxC;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,cAAc,CAOrG"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Transport, PageResult } from '@23blocks/contracts';
|
|
2
|
+
import type { ConversationsUser, RegisterUserRequest, UpdateUserRequest, ListUsersParams } from '../types/user';
|
|
3
|
+
import type { Group } from '../types/group';
|
|
4
|
+
import type { Conversation } from '../types/conversation';
|
|
5
|
+
export interface UsersService {
|
|
6
|
+
list(params?: ListUsersParams): Promise<PageResult<ConversationsUser>>;
|
|
7
|
+
get(uniqueId: string): Promise<ConversationsUser>;
|
|
8
|
+
register(uniqueId: string, data?: RegisterUserRequest): Promise<ConversationsUser>;
|
|
9
|
+
update(uniqueId: string, data: UpdateUserRequest): Promise<ConversationsUser>;
|
|
10
|
+
listGroups(uniqueId: string): Promise<PageResult<Group>>;
|
|
11
|
+
listConversations(uniqueId: string, params?: {
|
|
12
|
+
page?: number;
|
|
13
|
+
perPage?: number;
|
|
14
|
+
}): Promise<PageResult<Conversation>>;
|
|
15
|
+
listGroupConversations(uniqueId: string, params?: {
|
|
16
|
+
page?: number;
|
|
17
|
+
perPage?: number;
|
|
18
|
+
}): Promise<PageResult<Conversation>>;
|
|
19
|
+
listContextGroups(uniqueId: string, contextUniqueId: string): Promise<PageResult<Group>>;
|
|
20
|
+
}
|
|
21
|
+
export declare function createUsersService(transport: Transport, _config: {
|
|
22
|
+
appId: string;
|
|
23
|
+
}): UsersService;
|
|
24
|
+
//# sourceMappingURL=users.service.d.ts.map
|
|
@@ -0,0 +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,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EAChB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAK1D,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACvE,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAClD,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACnF,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC9E,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IACzD,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;IACrH,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;IAC1H,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;CAC1F;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,YAAY,CA8GjG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Transport } from '@23blocks/contracts';
|
|
2
|
+
import type { CreateWebSocketTokenRequest, CreateWebSocketTokenResponse } from '../types/websocket-token';
|
|
3
|
+
export interface WebSocketTokensService {
|
|
4
|
+
create(data?: CreateWebSocketTokenRequest): Promise<CreateWebSocketTokenResponse>;
|
|
5
|
+
}
|
|
6
|
+
export declare function createWebSocketTokensService(transport: Transport, _config: {
|
|
7
|
+
appId: string;
|
|
8
|
+
}): WebSocketTokensService;
|
|
9
|
+
//# sourceMappingURL=websocket-tokens.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"websocket-tokens.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/websocket-tokens.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EACV,2BAA2B,EAC3B,4BAA4B,EAC7B,MAAM,0BAA0B,CAAC;AAElC,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,IAAI,CAAC,EAAE,2BAA2B,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;CACnF;AAED,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,sBAAsB,CAmBrH"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface UserAvailability {
|
|
2
|
+
userUniqueId: string;
|
|
3
|
+
status: 'online' | 'offline' | 'away' | 'busy' | 'dnd';
|
|
4
|
+
lastSeenAt?: Date;
|
|
5
|
+
customStatus?: string;
|
|
6
|
+
payload?: Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
export interface SetAvailabilityRequest {
|
|
9
|
+
status?: 'online' | 'away' | 'busy' | 'dnd';
|
|
10
|
+
customStatus?: string;
|
|
11
|
+
payload?: Record<string, unknown>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=availability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"availability.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/availability.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;IACvD,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;IAC5C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { IdentityCore } from '@23blocks/contracts';
|
|
2
|
+
export interface Context extends IdentityCore {
|
|
3
|
+
name?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
contextType?: string;
|
|
6
|
+
status?: string;
|
|
7
|
+
metadata?: Record<string, unknown>;
|
|
8
|
+
payload?: Record<string, unknown>;
|
|
9
|
+
createdAt?: Date;
|
|
10
|
+
updatedAt?: Date;
|
|
11
|
+
}
|
|
12
|
+
export interface CreateContextRequest {
|
|
13
|
+
name?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
contextType?: string;
|
|
16
|
+
metadata?: Record<string, unknown>;
|
|
17
|
+
payload?: Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
export interface UpdateContextRequest {
|
|
20
|
+
name?: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
contextType?: string;
|
|
23
|
+
status?: string;
|
|
24
|
+
metadata?: Record<string, unknown>;
|
|
25
|
+
payload?: Record<string, unknown>;
|
|
26
|
+
}
|
|
27
|
+
export interface ListContextsParams {
|
|
28
|
+
page?: number;
|
|
29
|
+
perPage?: number;
|
|
30
|
+
status?: string;
|
|
31
|
+
contextType?: string;
|
|
32
|
+
search?: string;
|
|
33
|
+
sortBy?: string;
|
|
34
|
+
sortOrder?: 'asc' | 'desc';
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,WAAW,OAAQ,SAAQ,YAAY;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,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,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CAC5B"}
|
|
@@ -3,4 +3,11 @@ export * from './draft-message';
|
|
|
3
3
|
export * from './group';
|
|
4
4
|
export * from './notification';
|
|
5
5
|
export * from './conversation';
|
|
6
|
+
export * from './websocket-token';
|
|
7
|
+
export * from './context';
|
|
8
|
+
export * from './notification-settings';
|
|
9
|
+
export * from './availability';
|
|
10
|
+
export * from './message-file';
|
|
11
|
+
export * from './source';
|
|
12
|
+
export * from './user';
|
|
6
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { IdentityCore } from '@23blocks/contracts';
|
|
2
|
+
export interface MessageFile extends IdentityCore {
|
|
3
|
+
conversationUniqueId?: string;
|
|
4
|
+
messageUniqueId?: string;
|
|
5
|
+
name: string;
|
|
6
|
+
originalName?: string;
|
|
7
|
+
contentType?: string;
|
|
8
|
+
size?: number;
|
|
9
|
+
url?: string;
|
|
10
|
+
thumbnailUrl?: string;
|
|
11
|
+
status?: string;
|
|
12
|
+
payload?: Record<string, unknown>;
|
|
13
|
+
createdAt?: Date;
|
|
14
|
+
updatedAt?: Date;
|
|
15
|
+
}
|
|
16
|
+
export interface CreateMessageFileRequest {
|
|
17
|
+
name: string;
|
|
18
|
+
contentType?: string;
|
|
19
|
+
size?: number;
|
|
20
|
+
url?: string;
|
|
21
|
+
messageUniqueId?: string;
|
|
22
|
+
payload?: Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
export interface PresignMessageFileRequest {
|
|
25
|
+
filename: string;
|
|
26
|
+
contentType: string;
|
|
27
|
+
size?: number;
|
|
28
|
+
}
|
|
29
|
+
export interface PresignMessageFileResponse {
|
|
30
|
+
uploadUrl: string;
|
|
31
|
+
fileUrl: string;
|
|
32
|
+
fields?: Record<string, string>;
|
|
33
|
+
expiresAt?: Date;
|
|
34
|
+
}
|
|
35
|
+
export interface ListMessageFilesParams {
|
|
36
|
+
page?: number;
|
|
37
|
+
perPage?: number;
|
|
38
|
+
contentType?: string;
|
|
39
|
+
sortBy?: string;
|
|
40
|
+
sortOrder?: 'asc' | 'desc';
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=message-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-file.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/message-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC/C,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,0BAA0B;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CAC5B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface NotificationSettings {
|
|
2
|
+
userUniqueId: string;
|
|
3
|
+
emailEnabled?: boolean;
|
|
4
|
+
pushEnabled?: boolean;
|
|
5
|
+
smsEnabled?: boolean;
|
|
6
|
+
inAppEnabled?: boolean;
|
|
7
|
+
quietHoursStart?: string;
|
|
8
|
+
quietHoursEnd?: string;
|
|
9
|
+
timezone?: string;
|
|
10
|
+
preferences?: Record<string, boolean>;
|
|
11
|
+
payload?: Record<string, unknown>;
|
|
12
|
+
}
|
|
13
|
+
export interface UpdateNotificationSettingsRequest {
|
|
14
|
+
emailEnabled?: boolean;
|
|
15
|
+
pushEnabled?: boolean;
|
|
16
|
+
smsEnabled?: boolean;
|
|
17
|
+
inAppEnabled?: boolean;
|
|
18
|
+
quietHoursStart?: string;
|
|
19
|
+
quietHoursEnd?: string;
|
|
20
|
+
timezone?: string;
|
|
21
|
+
preferences?: Record<string, boolean>;
|
|
22
|
+
payload?: Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=notification-settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-settings.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/notification-settings.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,iCAAiC;IAChD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IdentityCore } from '@23blocks/contracts';
|
|
2
|
+
export interface Source extends IdentityCore {
|
|
3
|
+
name?: string;
|
|
4
|
+
sourceType?: string;
|
|
5
|
+
externalId?: string;
|
|
6
|
+
status?: string;
|
|
7
|
+
metadata?: Record<string, unknown>;
|
|
8
|
+
payload?: Record<string, unknown>;
|
|
9
|
+
createdAt?: Date;
|
|
10
|
+
updatedAt?: Date;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,WAAW,MAAO,SAAQ,YAAY;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { IdentityCore } from '@23blocks/contracts';
|
|
2
|
+
export interface ConversationsUser extends IdentityCore {
|
|
3
|
+
email?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
username?: string;
|
|
6
|
+
avatarUrl?: string;
|
|
7
|
+
status?: string;
|
|
8
|
+
lastSeenAt?: Date;
|
|
9
|
+
payload?: Record<string, unknown>;
|
|
10
|
+
createdAt?: Date;
|
|
11
|
+
updatedAt?: Date;
|
|
12
|
+
}
|
|
13
|
+
export interface RegisterUserRequest {
|
|
14
|
+
email?: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
username?: string;
|
|
17
|
+
avatarUrl?: string;
|
|
18
|
+
payload?: Record<string, unknown>;
|
|
19
|
+
}
|
|
20
|
+
export interface UpdateUserRequest {
|
|
21
|
+
name?: string;
|
|
22
|
+
username?: string;
|
|
23
|
+
avatarUrl?: string;
|
|
24
|
+
status?: string;
|
|
25
|
+
payload?: Record<string, unknown>;
|
|
26
|
+
}
|
|
27
|
+
export interface ListUsersParams {
|
|
28
|
+
page?: number;
|
|
29
|
+
perPage?: number;
|
|
30
|
+
status?: string;
|
|
31
|
+
search?: string;
|
|
32
|
+
sortBy?: string;
|
|
33
|
+
sortOrder?: 'asc' | 'desc';
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,qBAAqB,CAAC;AAIpE,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CAC5B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IdentityCore } from '@23blocks/contracts';
|
|
2
|
+
export interface WebSocketToken extends IdentityCore {
|
|
3
|
+
token: string;
|
|
4
|
+
expiresAt?: Date;
|
|
5
|
+
channel?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CreateWebSocketTokenRequest {
|
|
8
|
+
channel?: string;
|
|
9
|
+
userId?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface CreateWebSocketTokenResponse {
|
|
12
|
+
token: string;
|
|
13
|
+
expiresAt?: Date;
|
|
14
|
+
channel?: string;
|
|
15
|
+
url?: string;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=websocket-token.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"websocket-token.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/websocket-token.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,WAAW,cAAe,SAAQ,YAAY;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,2BAA2B;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,4BAA4B;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@23blocks/block-conversations",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Conversations block for 23blocks SDK - messaging, groups, notifications, and conversations management",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "23blocks <hello@23blocks.com>",
|