@23blocks/angular 0.1.0 → 0.2.1
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/lib/assets/assets.service.js +110 -0
- package/dist/lib/assets/assets.service.js.map +1 -0
- package/dist/lib/assets/index.js +3 -0
- package/dist/lib/assets/index.js.map +1 -0
- package/dist/lib/campaigns/campaigns.service.js +137 -0
- package/dist/lib/campaigns/campaigns.service.js.map +1 -0
- package/dist/lib/campaigns/index.js +3 -0
- package/dist/lib/campaigns/index.js.map +1 -0
- package/dist/lib/company/company.service.js +137 -0
- package/dist/lib/company/company.service.js.map +1 -0
- package/dist/lib/company/index.js +3 -0
- package/dist/lib/company/index.js.map +1 -0
- package/dist/lib/content/content.service.js +140 -0
- package/dist/lib/content/content.service.js.map +1 -0
- package/dist/lib/content/index.js +3 -0
- package/dist/lib/content/index.js.map +1 -0
- package/dist/lib/conversations/conversations.service.js +164 -0
- package/dist/lib/conversations/conversations.service.js.map +1 -0
- package/dist/lib/conversations/index.js +3 -0
- package/dist/lib/conversations/index.js.map +1 -0
- package/dist/lib/crm/crm.service.js +197 -0
- package/dist/lib/crm/crm.service.js.map +1 -0
- package/dist/lib/crm/index.js +3 -0
- package/dist/lib/crm/index.js.map +1 -0
- package/dist/lib/files/files.service.js +107 -0
- package/dist/lib/files/files.service.js.map +1 -0
- package/dist/lib/files/index.js +3 -0
- package/dist/lib/files/index.js.map +1 -0
- package/dist/lib/forms/forms.service.js +119 -0
- package/dist/lib/forms/forms.service.js.map +1 -0
- package/dist/lib/forms/index.js +3 -0
- package/dist/lib/forms/index.js.map +1 -0
- package/dist/lib/geolocation/geolocation.service.js +227 -0
- package/dist/lib/geolocation/geolocation.service.js.map +1 -0
- package/dist/lib/geolocation/index.js +3 -0
- package/dist/lib/geolocation/index.js.map +1 -0
- package/dist/lib/index.js +17 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/jarvis/index.js +3 -0
- package/dist/lib/jarvis/index.js.map +1 -0
- package/dist/lib/jarvis/jarvis.service.js +149 -0
- package/dist/lib/jarvis/jarvis.service.js.map +1 -0
- package/dist/lib/onboarding/index.js +3 -0
- package/dist/lib/onboarding/index.js.map +1 -0
- package/dist/lib/onboarding/onboarding.service.js +119 -0
- package/dist/lib/onboarding/onboarding.service.js.map +1 -0
- package/dist/lib/products/index.js +3 -0
- package/dist/lib/products/index.js.map +1 -0
- package/dist/lib/products/products.service.js +242 -0
- package/dist/lib/products/products.service.js.map +1 -0
- package/dist/lib/providers.js +195 -1
- package/dist/lib/providers.js.map +1 -1
- package/dist/lib/rewards/index.js +3 -0
- package/dist/lib/rewards/index.js.map +1 -0
- package/dist/lib/rewards/rewards.service.js +125 -0
- package/dist/lib/rewards/rewards.service.js.map +1 -0
- package/dist/lib/sales/index.js +3 -0
- package/dist/lib/sales/index.js.map +1 -0
- package/dist/lib/sales/sales.service.js +125 -0
- package/dist/lib/sales/sales.service.js.map +1 -0
- package/dist/lib/tokens.js +48 -0
- package/dist/lib/tokens.js.map +1 -1
- package/dist/lib/university/index.js +3 -0
- package/dist/lib/university/index.js.map +1 -0
- package/dist/lib/university/university.service.js +161 -0
- package/dist/lib/university/university.service.js.map +1 -0
- package/dist/lib/wallet/index.js +3 -0
- package/dist/lib/wallet/index.js.map +1 -0
- package/dist/lib/wallet/wallet.service.js +98 -0
- package/dist/lib/wallet/wallet.service.js.map +1 -0
- package/package.json +19 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/content/content.service.ts"],"sourcesContent":["import { Injectable, Inject } from '@angular/core';\nimport { Observable, from } from 'rxjs';\nimport type { Transport, PageResult } from '@23blocks/contracts';\nimport {\n createContentBlock,\n type ContentBlock,\n type ContentBlockConfig,\n type Post,\n type CreatePostRequest,\n type UpdatePostRequest,\n type ListPostsParams,\n type Comment,\n type CreateCommentRequest,\n type UpdateCommentRequest,\n type ListCommentsParams,\n type Category,\n type CreateCategoryRequest,\n type UpdateCategoryRequest,\n type ListCategoriesParams,\n type Tag,\n type CreateTagRequest,\n type UpdateTagRequest,\n type ListTagsParams,\n} from '@23blocks/block-content';\nimport { TRANSPORT, CONTENT_CONFIG } from '../tokens.js';\n\n/**\n * Angular service wrapping the Content block.\n * Converts Promise-based APIs to RxJS Observables.\n *\n * @example\n * ```typescript\n * @Component({...})\n * export class BlogComponent {\n * constructor(private content: ContentService) {}\n *\n * loadPosts() {\n * this.content.listPosts({ page: 1, perPage: 10 }).subscribe({\n * next: (result) => console.log('Posts:', result.data),\n * error: (err) => console.error('Failed:', err),\n * });\n * }\n * }\n * ```\n */\n@Injectable({ providedIn: 'root' })\nexport class ContentService {\n private readonly block: ContentBlock;\n\n constructor(\n @Inject(TRANSPORT) transport: Transport,\n @Inject(CONTENT_CONFIG) config: ContentBlockConfig\n ) {\n this.block = createContentBlock(transport, config);\n }\n\n // ───────────────────────────────────────────────────────────────────────────\n // Posts Service\n // ───────────────────────────────────────────────────────────────────────────\n\n listPosts(params?: ListPostsParams): Observable<PageResult<Post>> {\n return from(this.block.posts.list(params));\n }\n\n getPost(uniqueId: string): Observable<Post> {\n return from(this.block.posts.get(uniqueId));\n }\n\n createPost(data: CreatePostRequest): Observable<Post> {\n return from(this.block.posts.create(data));\n }\n\n updatePost(uniqueId: string, data: UpdatePostRequest): Observable<Post> {\n return from(this.block.posts.update(uniqueId, data));\n }\n\n deletePost(uniqueId: string): Observable<void> {\n return from(this.block.posts.delete(uniqueId));\n }\n\n recoverPost(uniqueId: string): Observable<Post> {\n return from(this.block.posts.recover(uniqueId));\n }\n\n searchPosts(query: string, params?: ListPostsParams): Observable<PageResult<Post>> {\n return from(this.block.posts.search(query, params));\n }\n\n listDeletedPosts(params?: ListPostsParams): Observable<PageResult<Post>> {\n return from(this.block.posts.listDeleted(params));\n }\n\n likePost(uniqueId: string): Observable<Post> {\n return from(this.block.posts.like(uniqueId));\n }\n\n dislikePost(uniqueId: string): Observable<Post> {\n return from(this.block.posts.dislike(uniqueId));\n }\n\n savePost(uniqueId: string): Observable<Post> {\n return from(this.block.posts.save(uniqueId));\n }\n\n followPost(uniqueId: string): Observable<Post> {\n return from(this.block.posts.follow(uniqueId));\n }\n\n // ───────────────────────────────────────────────────────────────────────────\n // Comments Service\n // ───────────────────────────────────────────────────────────────────────────\n\n listComments(params?: ListCommentsParams): Observable<PageResult<Comment>> {\n return from(this.block.comments.list(params));\n }\n\n getComment(uniqueId: string): Observable<Comment> {\n return from(this.block.comments.get(uniqueId));\n }\n\n createComment(data: CreateCommentRequest): Observable<Comment> {\n return from(this.block.comments.create(data));\n }\n\n updateComment(uniqueId: string, data: UpdateCommentRequest): Observable<Comment> {\n return from(this.block.comments.update(uniqueId, data));\n }\n\n deleteComment(uniqueId: string): Observable<void> {\n return from(this.block.comments.delete(uniqueId));\n }\n\n likeComment(uniqueId: string): Observable<Comment> {\n return from(this.block.comments.like(uniqueId));\n }\n\n dislikeComment(uniqueId: string): Observable<Comment> {\n return from(this.block.comments.dislike(uniqueId));\n }\n\n // ───────────────────────────────────────────────────────────────────────────\n // Categories Service\n // ───────────────────────────────────────────────────────────────────────────\n\n listCategories(params?: ListCategoriesParams): Observable<PageResult<Category>> {\n return from(this.block.categories.list(params));\n }\n\n getCategory(uniqueId: string): Observable<Category> {\n return from(this.block.categories.get(uniqueId));\n }\n\n createCategory(data: CreateCategoryRequest): Observable<Category> {\n return from(this.block.categories.create(data));\n }\n\n updateCategory(uniqueId: string, data: UpdateCategoryRequest): Observable<Category> {\n return from(this.block.categories.update(uniqueId, data));\n }\n\n deleteCategory(uniqueId: string): Observable<void> {\n return from(this.block.categories.delete(uniqueId));\n }\n\n recoverCategory(uniqueId: string): Observable<Category> {\n return from(this.block.categories.recover(uniqueId));\n }\n\n getCategoryChildren(uniqueId: string): Observable<Category[]> {\n return from(this.block.categories.getChildren(uniqueId));\n }\n\n // ───────────────────────────────────────────────────────────────────────────\n // Tags Service\n // ───────────────────────────────────────────────────────────────────────────\n\n listTags(params?: ListTagsParams): Observable<PageResult<Tag>> {\n return from(this.block.tags.list(params));\n }\n\n getTag(uniqueId: string): Observable<Tag> {\n return from(this.block.tags.get(uniqueId));\n }\n\n createTag(data: CreateTagRequest): Observable<Tag> {\n return from(this.block.tags.create(data));\n }\n\n updateTag(uniqueId: string, data: UpdateTagRequest): Observable<Tag> {\n return from(this.block.tags.update(uniqueId, data));\n }\n\n deleteTag(uniqueId: string): Observable<void> {\n return from(this.block.tags.delete(uniqueId));\n }\n\n // ───────────────────────────────────────────────────────────────────────────\n // Direct Block Access (for advanced usage)\n // ───────────────────────────────────────────────────────────────────────────\n\n /**\n * Access the underlying block for advanced operations\n * Use this when you need access to services not wrapped by this Angular service\n */\n get rawBlock(): ContentBlock {\n return this.block;\n }\n}\n"],"names":["Injectable","Inject","from","createContentBlock","TRANSPORT","CONTENT_CONFIG","ContentService","listPosts","params","block","posts","list","getPost","uniqueId","get","createPost","data","create","updatePost","update","deletePost","delete","recoverPost","recover","searchPosts","query","search","listDeletedPosts","listDeleted","likePost","like","dislikePost","dislike","savePost","save","followPost","follow","listComments","comments","getComment","createComment","updateComment","deleteComment","likeComment","dislikeComment","listCategories","categories","getCategory","createCategory","updateCategory","deleteCategory","recoverCategory","getCategoryChildren","getChildren","listTags","tags","getTag","createTag","updateTag","deleteTag","rawBlock","constructor","transport","config","providedIn"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;AAAA,SAASA,UAAU,EAAEC,MAAM,QAAQ,gBAAgB;AACnD,SAAqBC,IAAI,QAAQ,OAAO;AAExC,SACEC,kBAAkB,QAmBb,0BAA0B;AACjC,SAASC,SAAS,EAAEC,cAAc,QAAQ,eAAe;AAsBzD,OAAO,MAAMC;IAUX,8EAA8E;IAC9E,gBAAgB;IAChB,8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K;IACnB;IA7JAoD,YACE,AAAmBC,SAAoB,EACvC,AAAwBC,MAA0B,CAClD;QACA,IAAI,CAACtD,KAAK,GAAGN,mBAAmB2D,WAAWC;IAC7C;AAyJF;AAjKazD;IADZN,WAAW;QAAEgE,YAAY;IAAO;IAK5B/D,aAAAA,OAAOG;IACPH,aAAAA,OAAOI;;;eADsB,qCAAA;eACE,8CAAA;;GALvBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/content/index.ts"],"sourcesContent":["export { ContentService } from './content.service';\n"],"names":["ContentService"],"rangeMappings":"","mappings":"AAAA,SAASA,cAAc,QAAQ,oBAAoB"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
|
|
2
|
+
import { _ as _ts_metadata } from "@swc/helpers/_/_ts_metadata";
|
|
3
|
+
import { _ as _ts_param } from "@swc/helpers/_/_ts_param";
|
|
4
|
+
import { Injectable, Inject } from '@angular/core';
|
|
5
|
+
import { from } from 'rxjs';
|
|
6
|
+
import { createConversationsBlock } from '@23blocks/block-conversations';
|
|
7
|
+
import { TRANSPORT, CONVERSATIONS_CONFIG } from '../tokens.js';
|
|
8
|
+
export class ConversationsService {
|
|
9
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
10
|
+
// Messages Service
|
|
11
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
12
|
+
listMessages(params) {
|
|
13
|
+
return from(this.block.messages.list(params));
|
|
14
|
+
}
|
|
15
|
+
getMessage(uniqueId) {
|
|
16
|
+
return from(this.block.messages.get(uniqueId));
|
|
17
|
+
}
|
|
18
|
+
createMessage(data) {
|
|
19
|
+
return from(this.block.messages.create(data));
|
|
20
|
+
}
|
|
21
|
+
updateMessage(uniqueId, data) {
|
|
22
|
+
return from(this.block.messages.update(uniqueId, data));
|
|
23
|
+
}
|
|
24
|
+
deleteMessage(uniqueId) {
|
|
25
|
+
return from(this.block.messages.delete(uniqueId));
|
|
26
|
+
}
|
|
27
|
+
recoverMessage(uniqueId) {
|
|
28
|
+
return from(this.block.messages.recover(uniqueId));
|
|
29
|
+
}
|
|
30
|
+
listMessagesByContext(contextId, params) {
|
|
31
|
+
return from(this.block.messages.listByContext(contextId, params));
|
|
32
|
+
}
|
|
33
|
+
listMessagesByParent(parentId, params) {
|
|
34
|
+
return from(this.block.messages.listByParent(parentId, params));
|
|
35
|
+
}
|
|
36
|
+
listDeletedMessages(params) {
|
|
37
|
+
return from(this.block.messages.listDeleted(params));
|
|
38
|
+
}
|
|
39
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
40
|
+
// Draft Messages Service
|
|
41
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
42
|
+
listDraftMessages(params) {
|
|
43
|
+
return from(this.block.draftMessages.list(params));
|
|
44
|
+
}
|
|
45
|
+
getDraftMessage(uniqueId) {
|
|
46
|
+
return from(this.block.draftMessages.get(uniqueId));
|
|
47
|
+
}
|
|
48
|
+
createDraftMessage(data) {
|
|
49
|
+
return from(this.block.draftMessages.create(data));
|
|
50
|
+
}
|
|
51
|
+
updateDraftMessage(uniqueId, data) {
|
|
52
|
+
return from(this.block.draftMessages.update(uniqueId, data));
|
|
53
|
+
}
|
|
54
|
+
deleteDraftMessage(uniqueId) {
|
|
55
|
+
return from(this.block.draftMessages.delete(uniqueId));
|
|
56
|
+
}
|
|
57
|
+
listDraftMessagesByContext(contextId, params) {
|
|
58
|
+
return from(this.block.draftMessages.listByContext(contextId, params));
|
|
59
|
+
}
|
|
60
|
+
publishDraftMessage(uniqueId) {
|
|
61
|
+
return from(this.block.draftMessages.publish(uniqueId));
|
|
62
|
+
}
|
|
63
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
64
|
+
// Groups Service
|
|
65
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
66
|
+
listGroups(params) {
|
|
67
|
+
return from(this.block.groups.list(params));
|
|
68
|
+
}
|
|
69
|
+
getGroup(uniqueId) {
|
|
70
|
+
return from(this.block.groups.get(uniqueId));
|
|
71
|
+
}
|
|
72
|
+
createGroup(data) {
|
|
73
|
+
return from(this.block.groups.create(data));
|
|
74
|
+
}
|
|
75
|
+
updateGroup(uniqueId, data) {
|
|
76
|
+
return from(this.block.groups.update(uniqueId, data));
|
|
77
|
+
}
|
|
78
|
+
deleteGroup(uniqueId) {
|
|
79
|
+
return from(this.block.groups.delete(uniqueId));
|
|
80
|
+
}
|
|
81
|
+
recoverGroup(uniqueId) {
|
|
82
|
+
return from(this.block.groups.recover(uniqueId));
|
|
83
|
+
}
|
|
84
|
+
searchGroups(query, params) {
|
|
85
|
+
return from(this.block.groups.search(query, params));
|
|
86
|
+
}
|
|
87
|
+
listDeletedGroups(params) {
|
|
88
|
+
return from(this.block.groups.listDeleted(params));
|
|
89
|
+
}
|
|
90
|
+
addGroupMember(uniqueId, memberId) {
|
|
91
|
+
return from(this.block.groups.addMember(uniqueId, memberId));
|
|
92
|
+
}
|
|
93
|
+
removeGroupMember(uniqueId, memberId) {
|
|
94
|
+
return from(this.block.groups.removeMember(uniqueId, memberId));
|
|
95
|
+
}
|
|
96
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
97
|
+
// Notifications Service
|
|
98
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
99
|
+
listNotifications(params) {
|
|
100
|
+
return from(this.block.notifications.list(params));
|
|
101
|
+
}
|
|
102
|
+
getNotification(uniqueId) {
|
|
103
|
+
return from(this.block.notifications.get(uniqueId));
|
|
104
|
+
}
|
|
105
|
+
createNotification(data) {
|
|
106
|
+
return from(this.block.notifications.create(data));
|
|
107
|
+
}
|
|
108
|
+
updateNotification(uniqueId, data) {
|
|
109
|
+
return from(this.block.notifications.update(uniqueId, data));
|
|
110
|
+
}
|
|
111
|
+
deleteNotification(uniqueId) {
|
|
112
|
+
return from(this.block.notifications.delete(uniqueId));
|
|
113
|
+
}
|
|
114
|
+
markNotificationAsRead(uniqueId) {
|
|
115
|
+
return from(this.block.notifications.markAsRead(uniqueId));
|
|
116
|
+
}
|
|
117
|
+
markNotificationAsUnread(uniqueId) {
|
|
118
|
+
return from(this.block.notifications.markAsUnread(uniqueId));
|
|
119
|
+
}
|
|
120
|
+
listNotificationsByTarget(targetId, params) {
|
|
121
|
+
return from(this.block.notifications.listByTarget(targetId, params));
|
|
122
|
+
}
|
|
123
|
+
listUnreadNotifications(params) {
|
|
124
|
+
return from(this.block.notifications.listUnread(params));
|
|
125
|
+
}
|
|
126
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
127
|
+
// Conversations Service
|
|
128
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
129
|
+
getConversation(params) {
|
|
130
|
+
return from(this.block.conversations.get(params));
|
|
131
|
+
}
|
|
132
|
+
listContexts() {
|
|
133
|
+
return from(this.block.conversations.listContexts());
|
|
134
|
+
}
|
|
135
|
+
deleteContext(context) {
|
|
136
|
+
return from(this.block.conversations.deleteContext(context));
|
|
137
|
+
}
|
|
138
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
139
|
+
// Direct Block Access (for advanced usage)
|
|
140
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
141
|
+
/**
|
|
142
|
+
* Access the underlying block for advanced operations
|
|
143
|
+
* Use this when you need access to services not wrapped by this Angular service
|
|
144
|
+
*/ get rawBlock() {
|
|
145
|
+
return this.block;
|
|
146
|
+
}
|
|
147
|
+
constructor(transport, config){
|
|
148
|
+
this.block = createConversationsBlock(transport, config);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
ConversationsService = _ts_decorate([
|
|
152
|
+
Injectable({
|
|
153
|
+
providedIn: 'root'
|
|
154
|
+
}),
|
|
155
|
+
_ts_param(0, Inject(TRANSPORT)),
|
|
156
|
+
_ts_param(1, Inject(CONVERSATIONS_CONFIG)),
|
|
157
|
+
_ts_metadata("design:type", Function),
|
|
158
|
+
_ts_metadata("design:paramtypes", [
|
|
159
|
+
typeof Transport === "undefined" ? Object : Transport,
|
|
160
|
+
typeof ConversationsBlockConfig === "undefined" ? Object : ConversationsBlockConfig
|
|
161
|
+
])
|
|
162
|
+
], ConversationsService);
|
|
163
|
+
|
|
164
|
+
//# sourceMappingURL=conversations.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/conversations/conversations.service.ts"],"sourcesContent":["import { Injectable, Inject } from '@angular/core';\nimport { Observable, from } from 'rxjs';\nimport type { Transport, PageResult } from '@23blocks/contracts';\nimport {\n createConversationsBlock,\n type ConversationsBlock,\n type ConversationsBlockConfig,\n type Message,\n type CreateMessageRequest,\n type UpdateMessageRequest,\n type ListMessagesParams,\n type DraftMessage,\n type CreateDraftMessageRequest,\n type UpdateDraftMessageRequest,\n type ListDraftMessagesParams,\n type Group,\n type CreateGroupRequest,\n type UpdateGroupRequest,\n type ListGroupsParams,\n type Notification,\n type CreateNotificationRequest,\n type UpdateNotificationRequest,\n type ListNotificationsParams,\n type Conversation,\n type GetConversationParams,\n} from '@23blocks/block-conversations';\nimport { TRANSPORT, CONVERSATIONS_CONFIG } from '../tokens.js';\n\n/**\n * Angular service wrapping the Conversations block.\n * Converts Promise-based APIs to RxJS Observables.\n *\n * @example\n * ```typescript\n * @Component({...})\n * export class ChatComponent {\n * constructor(private conversations: ConversationsService) {}\n *\n * sendMessage(contextId: string, content: string) {\n * this.conversations.createMessage({ contextId, content }).subscribe({\n * next: (message) => console.log('Message sent:', message),\n * error: (err) => console.error('Failed:', err),\n * });\n * }\n * }\n * ```\n */\n@Injectable({ providedIn: 'root' })\nexport class ConversationsService {\n private readonly block: ConversationsBlock;\n\n constructor(\n @Inject(TRANSPORT) transport: Transport,\n @Inject(CONVERSATIONS_CONFIG) config: ConversationsBlockConfig\n ) {\n this.block = createConversationsBlock(transport, config);\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Messages Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listMessages(params?: ListMessagesParams): Observable<PageResult<Message>> {\n return from(this.block.messages.list(params));\n }\n\n getMessage(uniqueId: string): Observable<Message> {\n return from(this.block.messages.get(uniqueId));\n }\n\n createMessage(data: CreateMessageRequest): Observable<Message> {\n return from(this.block.messages.create(data));\n }\n\n updateMessage(uniqueId: string, data: UpdateMessageRequest): Observable<Message> {\n return from(this.block.messages.update(uniqueId, data));\n }\n\n deleteMessage(uniqueId: string): Observable<void> {\n return from(this.block.messages.delete(uniqueId));\n }\n\n recoverMessage(uniqueId: string): Observable<Message> {\n return from(this.block.messages.recover(uniqueId));\n }\n\n listMessagesByContext(contextId: string, params?: ListMessagesParams): Observable<PageResult<Message>> {\n return from(this.block.messages.listByContext(contextId, params));\n }\n\n listMessagesByParent(parentId: string, params?: ListMessagesParams): Observable<PageResult<Message>> {\n return from(this.block.messages.listByParent(parentId, params));\n }\n\n listDeletedMessages(params?: ListMessagesParams): Observable<PageResult<Message>> {\n return from(this.block.messages.listDeleted(params));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Draft Messages Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listDraftMessages(params?: ListDraftMessagesParams): Observable<PageResult<DraftMessage>> {\n return from(this.block.draftMessages.list(params));\n }\n\n getDraftMessage(uniqueId: string): Observable<DraftMessage> {\n return from(this.block.draftMessages.get(uniqueId));\n }\n\n createDraftMessage(data: CreateDraftMessageRequest): Observable<DraftMessage> {\n return from(this.block.draftMessages.create(data));\n }\n\n updateDraftMessage(uniqueId: string, data: UpdateDraftMessageRequest): Observable<DraftMessage> {\n return from(this.block.draftMessages.update(uniqueId, data));\n }\n\n deleteDraftMessage(uniqueId: string): Observable<void> {\n return from(this.block.draftMessages.delete(uniqueId));\n }\n\n listDraftMessagesByContext(contextId: string, params?: ListDraftMessagesParams): Observable<PageResult<DraftMessage>> {\n return from(this.block.draftMessages.listByContext(contextId, params));\n }\n\n publishDraftMessage(uniqueId: string): Observable<DraftMessage> {\n return from(this.block.draftMessages.publish(uniqueId));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Groups Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listGroups(params?: ListGroupsParams): Observable<PageResult<Group>> {\n return from(this.block.groups.list(params));\n }\n\n getGroup(uniqueId: string): Observable<Group> {\n return from(this.block.groups.get(uniqueId));\n }\n\n createGroup(data: CreateGroupRequest): Observable<Group> {\n return from(this.block.groups.create(data));\n }\n\n updateGroup(uniqueId: string, data: UpdateGroupRequest): Observable<Group> {\n return from(this.block.groups.update(uniqueId, data));\n }\n\n deleteGroup(uniqueId: string): Observable<void> {\n return from(this.block.groups.delete(uniqueId));\n }\n\n recoverGroup(uniqueId: string): Observable<Group> {\n return from(this.block.groups.recover(uniqueId));\n }\n\n searchGroups(query: string, params?: ListGroupsParams): Observable<PageResult<Group>> {\n return from(this.block.groups.search(query, params));\n }\n\n listDeletedGroups(params?: ListGroupsParams): Observable<PageResult<Group>> {\n return from(this.block.groups.listDeleted(params));\n }\n\n addGroupMember(uniqueId: string, memberId: string): Observable<Group> {\n return from(this.block.groups.addMember(uniqueId, memberId));\n }\n\n removeGroupMember(uniqueId: string, memberId: string): Observable<Group> {\n return from(this.block.groups.removeMember(uniqueId, memberId));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Notifications Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listNotifications(params?: ListNotificationsParams): Observable<PageResult<Notification>> {\n return from(this.block.notifications.list(params));\n }\n\n getNotification(uniqueId: string): Observable<Notification> {\n return from(this.block.notifications.get(uniqueId));\n }\n\n createNotification(data: CreateNotificationRequest): Observable<Notification> {\n return from(this.block.notifications.create(data));\n }\n\n updateNotification(uniqueId: string, data: UpdateNotificationRequest): Observable<Notification> {\n return from(this.block.notifications.update(uniqueId, data));\n }\n\n deleteNotification(uniqueId: string): Observable<void> {\n return from(this.block.notifications.delete(uniqueId));\n }\n\n markNotificationAsRead(uniqueId: string): Observable<Notification> {\n return from(this.block.notifications.markAsRead(uniqueId));\n }\n\n markNotificationAsUnread(uniqueId: string): Observable<Notification> {\n return from(this.block.notifications.markAsUnread(uniqueId));\n }\n\n listNotificationsByTarget(targetId: string, params?: ListNotificationsParams): Observable<PageResult<Notification>> {\n return from(this.block.notifications.listByTarget(targetId, params));\n }\n\n listUnreadNotifications(params?: ListNotificationsParams): Observable<PageResult<Notification>> {\n return from(this.block.notifications.listUnread(params));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Conversations Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n getConversation(params: GetConversationParams): Observable<Conversation> {\n return from(this.block.conversations.get(params));\n }\n\n listContexts(): Observable<string[]> {\n return from(this.block.conversations.listContexts());\n }\n\n deleteContext(context: string): Observable<void> {\n return from(this.block.conversations.deleteContext(context));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Direct Block Access (for advanced usage)\n // ─────────────────────────────────────────────────────────────────────────────\n\n /**\n * Access the underlying block for advanced operations\n * Use this when you need access to services not wrapped by this Angular service\n */\n get rawBlock(): ConversationsBlock {\n return this.block;\n }\n}\n"],"names":["Injectable","Inject","from","createConversationsBlock","TRANSPORT","CONVERSATIONS_CONFIG","ConversationsService","listMessages","params","block","messages","list","getMessage","uniqueId","get","createMessage","data","create","updateMessage","update","deleteMessage","delete","recoverMessage","recover","listMessagesByContext","contextId","listByContext","listMessagesByParent","parentId","listByParent","listDeletedMessages","listDeleted","listDraftMessages","draftMessages","getDraftMessage","createDraftMessage","updateDraftMessage","deleteDraftMessage","listDraftMessagesByContext","publishDraftMessage","publish","listGroups","groups","getGroup","createGroup","updateGroup","deleteGroup","recoverGroup","searchGroups","query","search","listDeletedGroups","addGroupMember","memberId","addMember","removeGroupMember","removeMember","listNotifications","notifications","getNotification","createNotification","updateNotification","deleteNotification","markNotificationAsRead","markAsRead","markNotificationAsUnread","markAsUnread","listNotificationsByTarget","targetId","listByTarget","listUnreadNotifications","listUnread","getConversation","conversations","listContexts","deleteContext","context","rawBlock","constructor","transport","config","providedIn"],"rangeMappings":";;;;;;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a,CAACE,aAAa,CAACC;IACrD;IAEA,gFAAgF;IAChF,2CAA2C;IAC3C,gFAAgF;IAEhF;;;GAGC,GACD,IAAIC,WAA+B;QACjC,OAAO,IAAI,CAACpE,KAAK;IACnB;IA7LAqE,YACE,AAAmBC,SAAoB,EACvC,AAA8BC,MAAgC,CAC9D;QACA,IAAI,CAACvE,KAAK,GAAGN,yBAAyB4E,WAAWC;IACnD;AAyLF;AAjMa1E;IADZN,WAAW;QAAEiF,YAAY;IAAO;IAK5BhF,aAAAA,OAAOG;IACPH,aAAAA,OAAOI;;;eADsB,qCAAA;eACQ,oDAAA;;GAL7BC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/conversations/index.ts"],"sourcesContent":["export * from './conversations.service';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,0BAA0B"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
|
|
2
|
+
import { _ as _ts_metadata } from "@swc/helpers/_/_ts_metadata";
|
|
3
|
+
import { _ as _ts_param } from "@swc/helpers/_/_ts_param";
|
|
4
|
+
import { Injectable, Inject } from '@angular/core';
|
|
5
|
+
import { from } from 'rxjs';
|
|
6
|
+
import { createCrmBlock } from '@23blocks/block-crm';
|
|
7
|
+
import { TRANSPORT, CRM_CONFIG } from '../tokens.js';
|
|
8
|
+
export class CrmService {
|
|
9
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
10
|
+
// Accounts Service
|
|
11
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
12
|
+
listAccounts(params) {
|
|
13
|
+
return from(this.block.accounts.list(params));
|
|
14
|
+
}
|
|
15
|
+
getAccount(uniqueId) {
|
|
16
|
+
return from(this.block.accounts.get(uniqueId));
|
|
17
|
+
}
|
|
18
|
+
createAccount(data) {
|
|
19
|
+
return from(this.block.accounts.create(data));
|
|
20
|
+
}
|
|
21
|
+
updateAccount(uniqueId, data) {
|
|
22
|
+
return from(this.block.accounts.update(uniqueId, data));
|
|
23
|
+
}
|
|
24
|
+
deleteAccount(uniqueId) {
|
|
25
|
+
return from(this.block.accounts.delete(uniqueId));
|
|
26
|
+
}
|
|
27
|
+
recoverAccount(uniqueId) {
|
|
28
|
+
return from(this.block.accounts.recover(uniqueId));
|
|
29
|
+
}
|
|
30
|
+
searchAccounts(query, params) {
|
|
31
|
+
return from(this.block.accounts.search(query, params));
|
|
32
|
+
}
|
|
33
|
+
listDeletedAccounts(params) {
|
|
34
|
+
return from(this.block.accounts.listDeleted(params));
|
|
35
|
+
}
|
|
36
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
37
|
+
// Contacts Service
|
|
38
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
39
|
+
listContacts(params) {
|
|
40
|
+
return from(this.block.contacts.list(params));
|
|
41
|
+
}
|
|
42
|
+
getContact(uniqueId) {
|
|
43
|
+
return from(this.block.contacts.get(uniqueId));
|
|
44
|
+
}
|
|
45
|
+
createContact(data) {
|
|
46
|
+
return from(this.block.contacts.create(data));
|
|
47
|
+
}
|
|
48
|
+
updateContact(uniqueId, data) {
|
|
49
|
+
return from(this.block.contacts.update(uniqueId, data));
|
|
50
|
+
}
|
|
51
|
+
deleteContact(uniqueId) {
|
|
52
|
+
return from(this.block.contacts.delete(uniqueId));
|
|
53
|
+
}
|
|
54
|
+
recoverContact(uniqueId) {
|
|
55
|
+
return from(this.block.contacts.recover(uniqueId));
|
|
56
|
+
}
|
|
57
|
+
searchContacts(query, params) {
|
|
58
|
+
return from(this.block.contacts.search(query, params));
|
|
59
|
+
}
|
|
60
|
+
listDeletedContacts(params) {
|
|
61
|
+
return from(this.block.contacts.listDeleted(params));
|
|
62
|
+
}
|
|
63
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
64
|
+
// Leads Service
|
|
65
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
66
|
+
listLeads(params) {
|
|
67
|
+
return from(this.block.leads.list(params));
|
|
68
|
+
}
|
|
69
|
+
getLead(uniqueId) {
|
|
70
|
+
return from(this.block.leads.get(uniqueId));
|
|
71
|
+
}
|
|
72
|
+
createLead(data) {
|
|
73
|
+
return from(this.block.leads.create(data));
|
|
74
|
+
}
|
|
75
|
+
updateLead(uniqueId, data) {
|
|
76
|
+
return from(this.block.leads.update(uniqueId, data));
|
|
77
|
+
}
|
|
78
|
+
deleteLead(uniqueId) {
|
|
79
|
+
return from(this.block.leads.delete(uniqueId));
|
|
80
|
+
}
|
|
81
|
+
recoverLead(uniqueId) {
|
|
82
|
+
return from(this.block.leads.recover(uniqueId));
|
|
83
|
+
}
|
|
84
|
+
searchLeads(query, params) {
|
|
85
|
+
return from(this.block.leads.search(query, params));
|
|
86
|
+
}
|
|
87
|
+
listDeletedLeads(params) {
|
|
88
|
+
return from(this.block.leads.listDeleted(params));
|
|
89
|
+
}
|
|
90
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
91
|
+
// Opportunities Service
|
|
92
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
93
|
+
listOpportunities(params) {
|
|
94
|
+
return from(this.block.opportunities.list(params));
|
|
95
|
+
}
|
|
96
|
+
getOpportunity(uniqueId) {
|
|
97
|
+
return from(this.block.opportunities.get(uniqueId));
|
|
98
|
+
}
|
|
99
|
+
createOpportunity(data) {
|
|
100
|
+
return from(this.block.opportunities.create(data));
|
|
101
|
+
}
|
|
102
|
+
updateOpportunity(uniqueId, data) {
|
|
103
|
+
return from(this.block.opportunities.update(uniqueId, data));
|
|
104
|
+
}
|
|
105
|
+
deleteOpportunity(uniqueId) {
|
|
106
|
+
return from(this.block.opportunities.delete(uniqueId));
|
|
107
|
+
}
|
|
108
|
+
recoverOpportunity(uniqueId) {
|
|
109
|
+
return from(this.block.opportunities.recover(uniqueId));
|
|
110
|
+
}
|
|
111
|
+
searchOpportunities(query, params) {
|
|
112
|
+
return from(this.block.opportunities.search(query, params));
|
|
113
|
+
}
|
|
114
|
+
listDeletedOpportunities(params) {
|
|
115
|
+
return from(this.block.opportunities.listDeleted(params));
|
|
116
|
+
}
|
|
117
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
118
|
+
// Meetings Service
|
|
119
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
120
|
+
listMeetings(params) {
|
|
121
|
+
return from(this.block.meetings.list(params));
|
|
122
|
+
}
|
|
123
|
+
getMeeting(uniqueId) {
|
|
124
|
+
return from(this.block.meetings.get(uniqueId));
|
|
125
|
+
}
|
|
126
|
+
createMeeting(data) {
|
|
127
|
+
return from(this.block.meetings.create(data));
|
|
128
|
+
}
|
|
129
|
+
updateMeeting(uniqueId, data) {
|
|
130
|
+
return from(this.block.meetings.update(uniqueId, data));
|
|
131
|
+
}
|
|
132
|
+
deleteMeeting(uniqueId) {
|
|
133
|
+
return from(this.block.meetings.delete(uniqueId));
|
|
134
|
+
}
|
|
135
|
+
recoverMeeting(uniqueId) {
|
|
136
|
+
return from(this.block.meetings.recover(uniqueId));
|
|
137
|
+
}
|
|
138
|
+
searchMeetings(query, params) {
|
|
139
|
+
return from(this.block.meetings.search(query, params));
|
|
140
|
+
}
|
|
141
|
+
listDeletedMeetings(params) {
|
|
142
|
+
return from(this.block.meetings.listDeleted(params));
|
|
143
|
+
}
|
|
144
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
145
|
+
// Quotes Service
|
|
146
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
147
|
+
listQuotes(params) {
|
|
148
|
+
return from(this.block.quotes.list(params));
|
|
149
|
+
}
|
|
150
|
+
getQuote(uniqueId) {
|
|
151
|
+
return from(this.block.quotes.get(uniqueId));
|
|
152
|
+
}
|
|
153
|
+
createQuote(data) {
|
|
154
|
+
return from(this.block.quotes.create(data));
|
|
155
|
+
}
|
|
156
|
+
updateQuote(uniqueId, data) {
|
|
157
|
+
return from(this.block.quotes.update(uniqueId, data));
|
|
158
|
+
}
|
|
159
|
+
deleteQuote(uniqueId) {
|
|
160
|
+
return from(this.block.quotes.delete(uniqueId));
|
|
161
|
+
}
|
|
162
|
+
recoverQuote(uniqueId) {
|
|
163
|
+
return from(this.block.quotes.recover(uniqueId));
|
|
164
|
+
}
|
|
165
|
+
searchQuotes(query, params) {
|
|
166
|
+
return from(this.block.quotes.search(query, params));
|
|
167
|
+
}
|
|
168
|
+
listDeletedQuotes(params) {
|
|
169
|
+
return from(this.block.quotes.listDeleted(params));
|
|
170
|
+
}
|
|
171
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
172
|
+
// Direct Block Access (for advanced usage)
|
|
173
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
174
|
+
/**
|
|
175
|
+
* Access the underlying block for advanced operations
|
|
176
|
+
* Use this when you need access to services not wrapped by this Angular service
|
|
177
|
+
*/ get rawBlock() {
|
|
178
|
+
return this.block;
|
|
179
|
+
}
|
|
180
|
+
constructor(transport, config){
|
|
181
|
+
this.block = createCrmBlock(transport, config);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
CrmService = _ts_decorate([
|
|
185
|
+
Injectable({
|
|
186
|
+
providedIn: 'root'
|
|
187
|
+
}),
|
|
188
|
+
_ts_param(0, Inject(TRANSPORT)),
|
|
189
|
+
_ts_param(1, Inject(CRM_CONFIG)),
|
|
190
|
+
_ts_metadata("design:type", Function),
|
|
191
|
+
_ts_metadata("design:paramtypes", [
|
|
192
|
+
typeof Transport === "undefined" ? Object : Transport,
|
|
193
|
+
typeof CrmBlockConfig === "undefined" ? Object : CrmBlockConfig
|
|
194
|
+
])
|
|
195
|
+
], CrmService);
|
|
196
|
+
|
|
197
|
+
//# sourceMappingURL=crm.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/crm/crm.service.ts"],"sourcesContent":["import { Injectable, Inject } from '@angular/core';\nimport { Observable, from } from 'rxjs';\nimport type { Transport, PageResult } from '@23blocks/contracts';\nimport {\n createCrmBlock,\n type CrmBlock,\n type CrmBlockConfig,\n type Account,\n type AccountDetail,\n type CreateAccountRequest,\n type UpdateAccountRequest,\n type ListAccountsParams,\n type Contact,\n type ContactProfile,\n type CreateContactRequest,\n type UpdateContactRequest,\n type ListContactsParams,\n type Lead,\n type CreateLeadRequest,\n type UpdateLeadRequest,\n type ListLeadsParams,\n type Opportunity,\n type CreateOpportunityRequest,\n type UpdateOpportunityRequest,\n type ListOpportunitiesParams,\n type Meeting,\n type CreateMeetingRequest,\n type UpdateMeetingRequest,\n type ListMeetingsParams,\n type Quote,\n type CreateQuoteRequest,\n type UpdateQuoteRequest,\n type ListQuotesParams,\n} from '@23blocks/block-crm';\nimport { TRANSPORT, CRM_CONFIG } from '../tokens.js';\n\n/**\n * Angular service wrapping the CRM block.\n * Converts Promise-based APIs to RxJS Observables.\n *\n * @example\n * ```typescript\n * @Component({...})\n * export class AccountsComponent {\n * constructor(private crm: CrmService) {}\n *\n * loadAccounts() {\n * this.crm.listAccounts({ page: 1, perPage: 20 }).subscribe({\n * next: (result) => console.log('Accounts:', result.data),\n * error: (err) => console.error('Failed:', err),\n * });\n * }\n * }\n * ```\n */\n@Injectable({ providedIn: 'root' })\nexport class CrmService {\n private readonly block: CrmBlock;\n\n constructor(\n @Inject(TRANSPORT) transport: Transport,\n @Inject(CRM_CONFIG) config: CrmBlockConfig\n ) {\n this.block = createCrmBlock(transport, config);\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Accounts Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listAccounts(params?: ListAccountsParams): Observable<PageResult<Account>> {\n return from(this.block.accounts.list(params));\n }\n\n getAccount(uniqueId: string): Observable<Account> {\n return from(this.block.accounts.get(uniqueId));\n }\n\n createAccount(data: CreateAccountRequest): Observable<Account> {\n return from(this.block.accounts.create(data));\n }\n\n updateAccount(uniqueId: string, data: UpdateAccountRequest): Observable<Account> {\n return from(this.block.accounts.update(uniqueId, data));\n }\n\n deleteAccount(uniqueId: string): Observable<void> {\n return from(this.block.accounts.delete(uniqueId));\n }\n\n recoverAccount(uniqueId: string): Observable<Account> {\n return from(this.block.accounts.recover(uniqueId));\n }\n\n searchAccounts(query: string, params?: ListAccountsParams): Observable<PageResult<Account>> {\n return from(this.block.accounts.search(query, params));\n }\n\n listDeletedAccounts(params?: ListAccountsParams): Observable<PageResult<Account>> {\n return from(this.block.accounts.listDeleted(params));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Contacts Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listContacts(params?: ListContactsParams): Observable<PageResult<Contact>> {\n return from(this.block.contacts.list(params));\n }\n\n getContact(uniqueId: string): Observable<Contact> {\n return from(this.block.contacts.get(uniqueId));\n }\n\n createContact(data: CreateContactRequest): Observable<Contact> {\n return from(this.block.contacts.create(data));\n }\n\n updateContact(uniqueId: string, data: UpdateContactRequest): Observable<Contact> {\n return from(this.block.contacts.update(uniqueId, data));\n }\n\n deleteContact(uniqueId: string): Observable<void> {\n return from(this.block.contacts.delete(uniqueId));\n }\n\n recoverContact(uniqueId: string): Observable<Contact> {\n return from(this.block.contacts.recover(uniqueId));\n }\n\n searchContacts(query: string, params?: ListContactsParams): Observable<PageResult<Contact>> {\n return from(this.block.contacts.search(query, params));\n }\n\n listDeletedContacts(params?: ListContactsParams): Observable<PageResult<Contact>> {\n return from(this.block.contacts.listDeleted(params));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Leads Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listLeads(params?: ListLeadsParams): Observable<PageResult<Lead>> {\n return from(this.block.leads.list(params));\n }\n\n getLead(uniqueId: string): Observable<Lead> {\n return from(this.block.leads.get(uniqueId));\n }\n\n createLead(data: CreateLeadRequest): Observable<Lead> {\n return from(this.block.leads.create(data));\n }\n\n updateLead(uniqueId: string, data: UpdateLeadRequest): Observable<Lead> {\n return from(this.block.leads.update(uniqueId, data));\n }\n\n deleteLead(uniqueId: string): Observable<void> {\n return from(this.block.leads.delete(uniqueId));\n }\n\n recoverLead(uniqueId: string): Observable<Lead> {\n return from(this.block.leads.recover(uniqueId));\n }\n\n searchLeads(query: string, params?: ListLeadsParams): Observable<PageResult<Lead>> {\n return from(this.block.leads.search(query, params));\n }\n\n listDeletedLeads(params?: ListLeadsParams): Observable<PageResult<Lead>> {\n return from(this.block.leads.listDeleted(params));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Opportunities Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listOpportunities(params?: ListOpportunitiesParams): Observable<PageResult<Opportunity>> {\n return from(this.block.opportunities.list(params));\n }\n\n getOpportunity(uniqueId: string): Observable<Opportunity> {\n return from(this.block.opportunities.get(uniqueId));\n }\n\n createOpportunity(data: CreateOpportunityRequest): Observable<Opportunity> {\n return from(this.block.opportunities.create(data));\n }\n\n updateOpportunity(uniqueId: string, data: UpdateOpportunityRequest): Observable<Opportunity> {\n return from(this.block.opportunities.update(uniqueId, data));\n }\n\n deleteOpportunity(uniqueId: string): Observable<void> {\n return from(this.block.opportunities.delete(uniqueId));\n }\n\n recoverOpportunity(uniqueId: string): Observable<Opportunity> {\n return from(this.block.opportunities.recover(uniqueId));\n }\n\n searchOpportunities(query: string, params?: ListOpportunitiesParams): Observable<PageResult<Opportunity>> {\n return from(this.block.opportunities.search(query, params));\n }\n\n listDeletedOpportunities(params?: ListOpportunitiesParams): Observable<PageResult<Opportunity>> {\n return from(this.block.opportunities.listDeleted(params));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Meetings Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listMeetings(params?: ListMeetingsParams): Observable<PageResult<Meeting>> {\n return from(this.block.meetings.list(params));\n }\n\n getMeeting(uniqueId: string): Observable<Meeting> {\n return from(this.block.meetings.get(uniqueId));\n }\n\n createMeeting(data: CreateMeetingRequest): Observable<Meeting> {\n return from(this.block.meetings.create(data));\n }\n\n updateMeeting(uniqueId: string, data: UpdateMeetingRequest): Observable<Meeting> {\n return from(this.block.meetings.update(uniqueId, data));\n }\n\n deleteMeeting(uniqueId: string): Observable<void> {\n return from(this.block.meetings.delete(uniqueId));\n }\n\n recoverMeeting(uniqueId: string): Observable<Meeting> {\n return from(this.block.meetings.recover(uniqueId));\n }\n\n searchMeetings(query: string, params?: ListMeetingsParams): Observable<PageResult<Meeting>> {\n return from(this.block.meetings.search(query, params));\n }\n\n listDeletedMeetings(params?: ListMeetingsParams): Observable<PageResult<Meeting>> {\n return from(this.block.meetings.listDeleted(params));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Quotes Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listQuotes(params?: ListQuotesParams): Observable<PageResult<Quote>> {\n return from(this.block.quotes.list(params));\n }\n\n getQuote(uniqueId: string): Observable<Quote> {\n return from(this.block.quotes.get(uniqueId));\n }\n\n createQuote(data: CreateQuoteRequest): Observable<Quote> {\n return from(this.block.quotes.create(data));\n }\n\n updateQuote(uniqueId: string, data: UpdateQuoteRequest): Observable<Quote> {\n return from(this.block.quotes.update(uniqueId, data));\n }\n\n deleteQuote(uniqueId: string): Observable<void> {\n return from(this.block.quotes.delete(uniqueId));\n }\n\n recoverQuote(uniqueId: string): Observable<Quote> {\n return from(this.block.quotes.recover(uniqueId));\n }\n\n searchQuotes(query: string, params?: ListQuotesParams): Observable<PageResult<Quote>> {\n return from(this.block.quotes.search(query, params));\n }\n\n listDeletedQuotes(params?: ListQuotesParams): Observable<PageResult<Quote>> {\n return from(this.block.quotes.listDeleted(params));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Direct Block Access (for advanced usage)\n // ─────────────────────────────────────────────────────────────────────────────\n\n /**\n * Access the underlying block for advanced operations\n * Use this when you need access to services not wrapped by this Angular service\n */\n get rawBlock(): CrmBlock {\n return this.block;\n }\n}\n"],"names":["Injectable","Inject","from","createCrmBlock","TRANSPORT","CRM_CONFIG","CrmService","listAccounts","params","block","accounts","list","getAccount","uniqueId","get","createAccount","data","create","updateAccount","update","deleteAccount","delete","recoverAccount","recover","searchAccounts","query","search","listDeletedAccounts","listDeleted","listContacts","contacts","getContact","createContact","updateContact","deleteContact","recoverContact","searchContacts","listDeletedContacts","listLeads","leads","getLead","createLead","updateLead","deleteLead","recoverLead","searchLeads","listDeletedLeads","listOpportunities","opportunities","getOpportunity","createOpportunity","updateOpportunity","deleteOpportunity","recoverOpportunity","searchOpportunities","listDeletedOpportunities","listMeetings","meetings","getMeeting","createMeeting","updateMeeting","deleteMeeting","recoverMeeting","searchMeetings","listDeletedMeetings","listQuotes","quotes","getQuote","createQuote","updateQuote","deleteQuote","recoverQuote","searchQuotes","listDeletedQuotes","rawBlock","constructor","transport","config","providedIn"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;AAAA,SAASA,UAAU,EAAEC,MAAM,QAAQ,gBAAgB;AACnD,SAAqBC,IAAI,QAAQ,OAAO;AAExC,SACEC,cAAc,QA6BT,sBAAsB;AAC7B,SAASC,SAAS,EAAEC,UAAU,QAAQ,eAAe;AAsBrD,OAAO,MAAMC;IAUX,gFAAgF;IAChF,mBAAmB;IACnB,gFAAgF;IAEhFC,aAAaC,MAA2B,EAAmC;QACzE,OAAON,KAAK,IAAI,CAACO,KAAK,CAACC,QAAQ,CAACC,IAAI,CAACH;IACvC;IAEAI,WAAWC,QAAgB,EAAuB;QAChD,OAAOX,KAAK,IAAI,CAACO,KAAK,CAACC,QAAQ,CAACI,GAAG,CAACD;IACtC;IAEAE,cAAcC,IAA0B,EAAuB;QAC7D,OAAOd,KAAK,IAAI,CAACO,KAAK,CAACC,QAAQ,CAACO,MAAM,CAACD;IACzC;IAEAE,cAAcL,QAAgB,EAAEG,IAA0B,EAAuB;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AACO,KAAK,CAACyD,MAAM,CAAC7C,MAAM,CAACR;IACvC;IAEA0D,aAAa1D,QAAgB,EAAqB;QAChD,OAAOX,KAAK,IAAI,CAACO,KAAK,CAACyD,MAAM,CAAC3C,OAAO,CAACV;IACxC;IAEA2D,aAAa/C,KAAa,EAAEjB,MAAyB,EAAiC;QACpF,OAAON,KAAK,IAAI,CAACO,KAAK,CAACyD,MAAM,CAACxC,MAAM,CAACD,OAAOjB;IAC9C;IAEAiE,kBAAkBjE,MAAyB,EAAiC;QAC1E,OAAON,KAAK,IAAI,CAACO,KAAK,CAACyD,MAAM,CAACtC,WAAW,CAACpB;IAC5C;IAEA,gFAAgF;IAChF,2CAA2C;IAC3C,gFAAgF;IAEhF;;;GAGC,GACD,IAAIkE,WAAqB;QACvB,OAAO,IAAI,CAACjE,KAAK;IACnB;IAzOAkE,YACE,AAAmBC,SAAoB,EACvC,AAAoBC,MAAsB,CAC1C;QACA,IAAI,CAACpE,KAAK,GAAGN,eAAeyE,WAAWC;IACzC;AAqOF;AA7OavE;IADZN,WAAW;QAAE8E,YAAY;IAAO;IAK5B7E,aAAAA,OAAOG;IACPH,aAAAA,OAAOI;;;eADsB,qCAAA;eACF,0CAAA;;GALnBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/crm/index.ts"],"sourcesContent":["export { CrmService } from './crm.service';\n"],"names":["CrmService"],"rangeMappings":"","mappings":"AAAA,SAASA,UAAU,QAAQ,gBAAgB"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
|
|
2
|
+
import { _ as _ts_metadata } from "@swc/helpers/_/_ts_metadata";
|
|
3
|
+
import { _ as _ts_param } from "@swc/helpers/_/_ts_param";
|
|
4
|
+
import { Injectable, Inject } from '@angular/core';
|
|
5
|
+
import { from } from 'rxjs';
|
|
6
|
+
import { createFilesBlock } from '@23blocks/block-files';
|
|
7
|
+
import { TRANSPORT, FILES_CONFIG } from '../tokens.js';
|
|
8
|
+
export class FilesService {
|
|
9
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
10
|
+
// Storage Files Service
|
|
11
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
12
|
+
listStorageFiles(params) {
|
|
13
|
+
return from(this.block.storageFiles.list(params));
|
|
14
|
+
}
|
|
15
|
+
getStorageFile(uniqueId) {
|
|
16
|
+
return from(this.block.storageFiles.get(uniqueId));
|
|
17
|
+
}
|
|
18
|
+
uploadStorageFile(data) {
|
|
19
|
+
return from(this.block.storageFiles.upload(data));
|
|
20
|
+
}
|
|
21
|
+
createStorageFile(data) {
|
|
22
|
+
return from(this.block.storageFiles.create(data));
|
|
23
|
+
}
|
|
24
|
+
updateStorageFile(uniqueId, data) {
|
|
25
|
+
return from(this.block.storageFiles.update(uniqueId, data));
|
|
26
|
+
}
|
|
27
|
+
deleteStorageFile(uniqueId) {
|
|
28
|
+
return from(this.block.storageFiles.delete(uniqueId));
|
|
29
|
+
}
|
|
30
|
+
downloadStorageFile(uniqueId) {
|
|
31
|
+
return from(this.block.storageFiles.download(uniqueId));
|
|
32
|
+
}
|
|
33
|
+
listStorageFilesByOwner(ownerUniqueId, ownerType, params) {
|
|
34
|
+
return from(this.block.storageFiles.listByOwner(ownerUniqueId, ownerType, params));
|
|
35
|
+
}
|
|
36
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
37
|
+
// Entity Files Service
|
|
38
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
39
|
+
listEntityFiles(params) {
|
|
40
|
+
return from(this.block.entityFiles.list(params));
|
|
41
|
+
}
|
|
42
|
+
getEntityFile(uniqueId) {
|
|
43
|
+
return from(this.block.entityFiles.get(uniqueId));
|
|
44
|
+
}
|
|
45
|
+
attachFile(data) {
|
|
46
|
+
return from(this.block.entityFiles.attach(data));
|
|
47
|
+
}
|
|
48
|
+
detachFile(uniqueId) {
|
|
49
|
+
return from(this.block.entityFiles.detach(uniqueId));
|
|
50
|
+
}
|
|
51
|
+
updateEntityFile(uniqueId, data) {
|
|
52
|
+
return from(this.block.entityFiles.update(uniqueId, data));
|
|
53
|
+
}
|
|
54
|
+
reorderEntityFiles(entityUniqueId, entityType, data) {
|
|
55
|
+
return from(this.block.entityFiles.reorder(entityUniqueId, entityType, data));
|
|
56
|
+
}
|
|
57
|
+
listEntityFilesByEntity(entityUniqueId, entityType, params) {
|
|
58
|
+
return from(this.block.entityFiles.listByEntity(entityUniqueId, entityType, params));
|
|
59
|
+
}
|
|
60
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
61
|
+
// File Schemas Service
|
|
62
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
63
|
+
listFileSchemas(params) {
|
|
64
|
+
return from(this.block.fileSchemas.list(params));
|
|
65
|
+
}
|
|
66
|
+
getFileSchema(uniqueId) {
|
|
67
|
+
return from(this.block.fileSchemas.get(uniqueId));
|
|
68
|
+
}
|
|
69
|
+
getFileSchemaByCode(code) {
|
|
70
|
+
return from(this.block.fileSchemas.getByCode(code));
|
|
71
|
+
}
|
|
72
|
+
createFileSchema(data) {
|
|
73
|
+
return from(this.block.fileSchemas.create(data));
|
|
74
|
+
}
|
|
75
|
+
updateFileSchema(uniqueId, data) {
|
|
76
|
+
return from(this.block.fileSchemas.update(uniqueId, data));
|
|
77
|
+
}
|
|
78
|
+
deleteFileSchema(uniqueId) {
|
|
79
|
+
return from(this.block.fileSchemas.delete(uniqueId));
|
|
80
|
+
}
|
|
81
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
82
|
+
// Direct Block Access (for advanced usage)
|
|
83
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
84
|
+
/**
|
|
85
|
+
* Access the underlying block for advanced operations
|
|
86
|
+
* Use this when you need access to services not wrapped by this Angular service
|
|
87
|
+
*/ get rawBlock() {
|
|
88
|
+
return this.block;
|
|
89
|
+
}
|
|
90
|
+
constructor(transport, config){
|
|
91
|
+
this.block = createFilesBlock(transport, config);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
FilesService = _ts_decorate([
|
|
95
|
+
Injectable({
|
|
96
|
+
providedIn: 'root'
|
|
97
|
+
}),
|
|
98
|
+
_ts_param(0, Inject(TRANSPORT)),
|
|
99
|
+
_ts_param(1, Inject(FILES_CONFIG)),
|
|
100
|
+
_ts_metadata("design:type", Function),
|
|
101
|
+
_ts_metadata("design:paramtypes", [
|
|
102
|
+
typeof Transport === "undefined" ? Object : Transport,
|
|
103
|
+
typeof FilesBlockConfig === "undefined" ? Object : FilesBlockConfig
|
|
104
|
+
])
|
|
105
|
+
], FilesService);
|
|
106
|
+
|
|
107
|
+
//# sourceMappingURL=files.service.js.map
|