@23blocks/angular 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/lib/assets/assets.service.js +43 -30
  2. package/dist/lib/assets/assets.service.js.map +1 -1
  3. package/dist/lib/authentication/authentication.service.js +49 -32
  4. package/dist/lib/authentication/authentication.service.js.map +1 -1
  5. package/dist/lib/campaigns/campaigns.service.js +51 -38
  6. package/dist/lib/campaigns/campaigns.service.js.map +1 -1
  7. package/dist/lib/company/company.service.js +50 -37
  8. package/dist/lib/company/company.service.js.map +1 -1
  9. package/dist/lib/content/content.service.js +52 -39
  10. package/dist/lib/content/content.service.js.map +1 -1
  11. package/dist/lib/conversations/conversations.service.js +59 -46
  12. package/dist/lib/conversations/conversations.service.js.map +1 -1
  13. package/dist/lib/crm/crm.service.js +69 -56
  14. package/dist/lib/crm/crm.service.js.map +1 -1
  15. package/dist/lib/files/files.service.js +42 -29
  16. package/dist/lib/files/files.service.js.map +1 -1
  17. package/dist/lib/forms/forms.service.js +45 -32
  18. package/dist/lib/forms/forms.service.js.map +1 -1
  19. package/dist/lib/geolocation/geolocation.service.js +78 -65
  20. package/dist/lib/geolocation/geolocation.service.js.map +1 -1
  21. package/dist/lib/index.js +4 -1
  22. package/dist/lib/index.js.map +1 -1
  23. package/dist/lib/jarvis/jarvis.service.js +54 -41
  24. package/dist/lib/jarvis/jarvis.service.js.map +1 -1
  25. package/dist/lib/onboarding/onboarding.service.js +45 -32
  26. package/dist/lib/onboarding/onboarding.service.js.map +1 -1
  27. package/dist/lib/products/products.service.js +80 -67
  28. package/dist/lib/products/products.service.js.map +1 -1
  29. package/dist/lib/rewards/rewards.service.js +47 -34
  30. package/dist/lib/rewards/rewards.service.js.map +1 -1
  31. package/dist/lib/sales/sales.service.js +47 -34
  32. package/dist/lib/sales/sales.service.js.map +1 -1
  33. package/dist/lib/search/search.service.js +31 -18
  34. package/dist/lib/search/search.service.js.map +1 -1
  35. package/dist/lib/simple-providers.js +109 -12
  36. package/dist/lib/simple-providers.js.map +1 -1
  37. package/dist/lib/tokens.js +26 -1
  38. package/dist/lib/tokens.js.map +1 -1
  39. package/dist/lib/university/university.service.js +58 -45
  40. package/dist/lib/university/university.service.js.map +1 -1
  41. package/dist/lib/wallet/wallet.service.js +39 -26
  42. package/dist/lib/wallet/wallet.service.js.map +1 -1
  43. package/package.json +1 -1
@@ -1,172 +1,180 @@
1
1
  import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
2
2
  import { _ as _ts_metadata } from "@swc/helpers/_/_ts_metadata";
3
3
  import { _ as _ts_param } from "@swc/helpers/_/_ts_param";
4
- import { Injectable, Inject } from '@angular/core';
4
+ import { Injectable, Inject, Optional } from '@angular/core';
5
5
  import { from } from 'rxjs';
6
6
  import { createCrmBlock } from '@23blocks/block-crm';
7
- import { TRANSPORT, CRM_CONFIG } from '../tokens.js';
7
+ import { TRANSPORT, CRM_TRANSPORT, CRM_CONFIG } from '../tokens.js';
8
8
  export class CrmService {
9
+ /**
10
+ * Ensure the service is configured, throw helpful error if not
11
+ */ ensureConfigured() {
12
+ if (!this.block) {
13
+ throw new Error('[23blocks] CrmService is not configured. ' + "Add 'urls.crm' to your provideBlocks23() configuration.");
14
+ }
15
+ return this.block;
16
+ }
9
17
  // ─────────────────────────────────────────────────────────────────────────────
10
18
  // Accounts Service
11
19
  // ─────────────────────────────────────────────────────────────────────────────
12
20
  listAccounts(params) {
13
- return from(this.block.accounts.list(params));
21
+ return from(this.ensureConfigured().accounts.list(params));
14
22
  }
15
23
  getAccount(uniqueId) {
16
- return from(this.block.accounts.get(uniqueId));
24
+ return from(this.ensureConfigured().accounts.get(uniqueId));
17
25
  }
18
26
  createAccount(data) {
19
- return from(this.block.accounts.create(data));
27
+ return from(this.ensureConfigured().accounts.create(data));
20
28
  }
21
29
  updateAccount(uniqueId, data) {
22
- return from(this.block.accounts.update(uniqueId, data));
30
+ return from(this.ensureConfigured().accounts.update(uniqueId, data));
23
31
  }
24
32
  deleteAccount(uniqueId) {
25
- return from(this.block.accounts.delete(uniqueId));
33
+ return from(this.ensureConfigured().accounts.delete(uniqueId));
26
34
  }
27
35
  recoverAccount(uniqueId) {
28
- return from(this.block.accounts.recover(uniqueId));
36
+ return from(this.ensureConfigured().accounts.recover(uniqueId));
29
37
  }
30
38
  searchAccounts(query, params) {
31
- return from(this.block.accounts.search(query, params));
39
+ return from(this.ensureConfigured().accounts.search(query, params));
32
40
  }
33
41
  listDeletedAccounts(params) {
34
- return from(this.block.accounts.listDeleted(params));
42
+ return from(this.ensureConfigured().accounts.listDeleted(params));
35
43
  }
36
44
  // ─────────────────────────────────────────────────────────────────────────────
37
45
  // Contacts Service
38
46
  // ─────────────────────────────────────────────────────────────────────────────
39
47
  listContacts(params) {
40
- return from(this.block.contacts.list(params));
48
+ return from(this.ensureConfigured().contacts.list(params));
41
49
  }
42
50
  getContact(uniqueId) {
43
- return from(this.block.contacts.get(uniqueId));
51
+ return from(this.ensureConfigured().contacts.get(uniqueId));
44
52
  }
45
53
  createContact(data) {
46
- return from(this.block.contacts.create(data));
54
+ return from(this.ensureConfigured().contacts.create(data));
47
55
  }
48
56
  updateContact(uniqueId, data) {
49
- return from(this.block.contacts.update(uniqueId, data));
57
+ return from(this.ensureConfigured().contacts.update(uniqueId, data));
50
58
  }
51
59
  deleteContact(uniqueId) {
52
- return from(this.block.contacts.delete(uniqueId));
60
+ return from(this.ensureConfigured().contacts.delete(uniqueId));
53
61
  }
54
62
  recoverContact(uniqueId) {
55
- return from(this.block.contacts.recover(uniqueId));
63
+ return from(this.ensureConfigured().contacts.recover(uniqueId));
56
64
  }
57
65
  searchContacts(query, params) {
58
- return from(this.block.contacts.search(query, params));
66
+ return from(this.ensureConfigured().contacts.search(query, params));
59
67
  }
60
68
  listDeletedContacts(params) {
61
- return from(this.block.contacts.listDeleted(params));
69
+ return from(this.ensureConfigured().contacts.listDeleted(params));
62
70
  }
63
71
  // ─────────────────────────────────────────────────────────────────────────────
64
72
  // Leads Service
65
73
  // ─────────────────────────────────────────────────────────────────────────────
66
74
  listLeads(params) {
67
- return from(this.block.leads.list(params));
75
+ return from(this.ensureConfigured().leads.list(params));
68
76
  }
69
77
  getLead(uniqueId) {
70
- return from(this.block.leads.get(uniqueId));
78
+ return from(this.ensureConfigured().leads.get(uniqueId));
71
79
  }
72
80
  createLead(data) {
73
- return from(this.block.leads.create(data));
81
+ return from(this.ensureConfigured().leads.create(data));
74
82
  }
75
83
  updateLead(uniqueId, data) {
76
- return from(this.block.leads.update(uniqueId, data));
84
+ return from(this.ensureConfigured().leads.update(uniqueId, data));
77
85
  }
78
86
  deleteLead(uniqueId) {
79
- return from(this.block.leads.delete(uniqueId));
87
+ return from(this.ensureConfigured().leads.delete(uniqueId));
80
88
  }
81
89
  recoverLead(uniqueId) {
82
- return from(this.block.leads.recover(uniqueId));
90
+ return from(this.ensureConfigured().leads.recover(uniqueId));
83
91
  }
84
92
  searchLeads(query, params) {
85
- return from(this.block.leads.search(query, params));
93
+ return from(this.ensureConfigured().leads.search(query, params));
86
94
  }
87
95
  listDeletedLeads(params) {
88
- return from(this.block.leads.listDeleted(params));
96
+ return from(this.ensureConfigured().leads.listDeleted(params));
89
97
  }
90
98
  // ─────────────────────────────────────────────────────────────────────────────
91
99
  // Opportunities Service
92
100
  // ─────────────────────────────────────────────────────────────────────────────
93
101
  listOpportunities(params) {
94
- return from(this.block.opportunities.list(params));
102
+ return from(this.ensureConfigured().opportunities.list(params));
95
103
  }
96
104
  getOpportunity(uniqueId) {
97
- return from(this.block.opportunities.get(uniqueId));
105
+ return from(this.ensureConfigured().opportunities.get(uniqueId));
98
106
  }
99
107
  createOpportunity(data) {
100
- return from(this.block.opportunities.create(data));
108
+ return from(this.ensureConfigured().opportunities.create(data));
101
109
  }
102
110
  updateOpportunity(uniqueId, data) {
103
- return from(this.block.opportunities.update(uniqueId, data));
111
+ return from(this.ensureConfigured().opportunities.update(uniqueId, data));
104
112
  }
105
113
  deleteOpportunity(uniqueId) {
106
- return from(this.block.opportunities.delete(uniqueId));
114
+ return from(this.ensureConfigured().opportunities.delete(uniqueId));
107
115
  }
108
116
  recoverOpportunity(uniqueId) {
109
- return from(this.block.opportunities.recover(uniqueId));
117
+ return from(this.ensureConfigured().opportunities.recover(uniqueId));
110
118
  }
111
119
  searchOpportunities(query, params) {
112
- return from(this.block.opportunities.search(query, params));
120
+ return from(this.ensureConfigured().opportunities.search(query, params));
113
121
  }
114
122
  listDeletedOpportunities(params) {
115
- return from(this.block.opportunities.listDeleted(params));
123
+ return from(this.ensureConfigured().opportunities.listDeleted(params));
116
124
  }
117
125
  // ─────────────────────────────────────────────────────────────────────────────
118
126
  // Meetings Service
119
127
  // ─────────────────────────────────────────────────────────────────────────────
120
128
  listMeetings(params) {
121
- return from(this.block.meetings.list(params));
129
+ return from(this.ensureConfigured().meetings.list(params));
122
130
  }
123
131
  getMeeting(uniqueId) {
124
- return from(this.block.meetings.get(uniqueId));
132
+ return from(this.ensureConfigured().meetings.get(uniqueId));
125
133
  }
126
134
  createMeeting(data) {
127
- return from(this.block.meetings.create(data));
135
+ return from(this.ensureConfigured().meetings.create(data));
128
136
  }
129
137
  updateMeeting(uniqueId, data) {
130
- return from(this.block.meetings.update(uniqueId, data));
138
+ return from(this.ensureConfigured().meetings.update(uniqueId, data));
131
139
  }
132
140
  deleteMeeting(uniqueId) {
133
- return from(this.block.meetings.delete(uniqueId));
141
+ return from(this.ensureConfigured().meetings.delete(uniqueId));
134
142
  }
135
143
  recoverMeeting(uniqueId) {
136
- return from(this.block.meetings.recover(uniqueId));
144
+ return from(this.ensureConfigured().meetings.recover(uniqueId));
137
145
  }
138
146
  searchMeetings(query, params) {
139
- return from(this.block.meetings.search(query, params));
147
+ return from(this.ensureConfigured().meetings.search(query, params));
140
148
  }
141
149
  listDeletedMeetings(params) {
142
- return from(this.block.meetings.listDeleted(params));
150
+ return from(this.ensureConfigured().meetings.listDeleted(params));
143
151
  }
144
152
  // ─────────────────────────────────────────────────────────────────────────────
145
153
  // Quotes Service
146
154
  // ─────────────────────────────────────────────────────────────────────────────
147
155
  listQuotes(params) {
148
- return from(this.block.quotes.list(params));
156
+ return from(this.ensureConfigured().quotes.list(params));
149
157
  }
150
158
  getQuote(uniqueId) {
151
- return from(this.block.quotes.get(uniqueId));
159
+ return from(this.ensureConfigured().quotes.get(uniqueId));
152
160
  }
153
161
  createQuote(data) {
154
- return from(this.block.quotes.create(data));
162
+ return from(this.ensureConfigured().quotes.create(data));
155
163
  }
156
164
  updateQuote(uniqueId, data) {
157
- return from(this.block.quotes.update(uniqueId, data));
165
+ return from(this.ensureConfigured().quotes.update(uniqueId, data));
158
166
  }
159
167
  deleteQuote(uniqueId) {
160
- return from(this.block.quotes.delete(uniqueId));
168
+ return from(this.ensureConfigured().quotes.delete(uniqueId));
161
169
  }
162
170
  recoverQuote(uniqueId) {
163
- return from(this.block.quotes.recover(uniqueId));
171
+ return from(this.ensureConfigured().quotes.recover(uniqueId));
164
172
  }
165
173
  searchQuotes(query, params) {
166
- return from(this.block.quotes.search(query, params));
174
+ return from(this.ensureConfigured().quotes.search(query, params));
167
175
  }
168
176
  listDeletedQuotes(params) {
169
- return from(this.block.quotes.listDeleted(params));
177
+ return from(this.ensureConfigured().quotes.listDeleted(params));
170
178
  }
171
179
  // ─────────────────────────────────────────────────────────────────────────────
172
180
  // Direct Block Access (for advanced usage)
@@ -175,21 +183,26 @@ export class CrmService {
175
183
  * Access the underlying block for advanced operations
176
184
  * Use this when you need access to services not wrapped by this Angular service
177
185
  */ get rawBlock() {
178
- return this.block;
186
+ return this.ensureConfigured();
179
187
  }
180
- constructor(transport, config){
181
- this.block = createCrmBlock(transport, config);
188
+ constructor(serviceTransport, legacyTransport, config){
189
+ const transport = serviceTransport != null ? serviceTransport : legacyTransport;
190
+ this.block = transport ? createCrmBlock(transport, config) : null;
182
191
  }
183
192
  }
184
193
  CrmService = _ts_decorate([
185
194
  Injectable({
186
195
  providedIn: 'root'
187
196
  }),
188
- _ts_param(0, Inject(TRANSPORT)),
189
- _ts_param(1, Inject(CRM_CONFIG)),
197
+ _ts_param(0, Optional()),
198
+ _ts_param(0, Inject(CRM_TRANSPORT)),
199
+ _ts_param(1, Optional()),
200
+ _ts_param(1, Inject(TRANSPORT)),
201
+ _ts_param(2, Inject(CRM_CONFIG)),
190
202
  _ts_metadata("design:type", Function),
191
203
  _ts_metadata("design:paramtypes", [
192
- typeof Transport === "undefined" ? Object : Transport,
204
+ Object,
205
+ Object,
193
206
  typeof CrmBlockConfig === "undefined" ? Object : CrmBlockConfig
194
207
  ])
195
208
  ], CrmService);
@@ -1 +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,SA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AE8E,YAAY;IAAO;IAK5B7E,aAAAA,OAAOG;IACPH,aAAAA,OAAOI;;;eADsB,qCAAA;eACF,0CAAA;;GALnBC"}
1
+ {"version":3,"sources":["../../../src/lib/crm/crm.service.ts"],"sourcesContent":["import { Injectable, Inject, Optional } 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_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 | null;\n\n constructor(\n @Optional() @Inject(CRM_TRANSPORT) serviceTransport: Transport | null,\n @Optional() @Inject(TRANSPORT) legacyTransport: Transport | null,\n @Inject(CRM_CONFIG) config: CrmBlockConfig\n ) {\n const transport = serviceTransport ?? legacyTransport;\n this.block = transport ? createCrmBlock(transport, config) : null;\n }\n\n /**\n * Ensure the service is configured, throw helpful error if not\n */\n private ensureConfigured(): CrmBlock {\n if (!this.block) {\n throw new Error(\n '[23blocks] CrmService is not configured. ' +\n \"Add 'urls.crm' to your provideBlocks23() configuration.\"\n );\n }\n return this.block;\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Accounts Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listAccounts(params?: ListAccountsParams): Observable<PageResult<Account>> {\n return from(this.ensureConfigured().accounts.list(params));\n }\n\n getAccount(uniqueId: string): Observable<Account> {\n return from(this.ensureConfigured().accounts.get(uniqueId));\n }\n\n createAccount(data: CreateAccountRequest): Observable<Account> {\n return from(this.ensureConfigured().accounts.create(data));\n }\n\n updateAccount(uniqueId: string, data: UpdateAccountRequest): Observable<Account> {\n return from(this.ensureConfigured().accounts.update(uniqueId, data));\n }\n\n deleteAccount(uniqueId: string): Observable<void> {\n return from(this.ensureConfigured().accounts.delete(uniqueId));\n }\n\n recoverAccount(uniqueId: string): Observable<Account> {\n return from(this.ensureConfigured().accounts.recover(uniqueId));\n }\n\n searchAccounts(query: string, params?: ListAccountsParams): Observable<PageResult<Account>> {\n return from(this.ensureConfigured().accounts.search(query, params));\n }\n\n listDeletedAccounts(params?: ListAccountsParams): Observable<PageResult<Account>> {\n return from(this.ensureConfigured().accounts.listDeleted(params));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Contacts Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listContacts(params?: ListContactsParams): Observable<PageResult<Contact>> {\n return from(this.ensureConfigured().contacts.list(params));\n }\n\n getContact(uniqueId: string): Observable<Contact> {\n return from(this.ensureConfigured().contacts.get(uniqueId));\n }\n\n createContact(data: CreateContactRequest): Observable<Contact> {\n return from(this.ensureConfigured().contacts.create(data));\n }\n\n updateContact(uniqueId: string, data: UpdateContactRequest): Observable<Contact> {\n return from(this.ensureConfigured().contacts.update(uniqueId, data));\n }\n\n deleteContact(uniqueId: string): Observable<void> {\n return from(this.ensureConfigured().contacts.delete(uniqueId));\n }\n\n recoverContact(uniqueId: string): Observable<Contact> {\n return from(this.ensureConfigured().contacts.recover(uniqueId));\n }\n\n searchContacts(query: string, params?: ListContactsParams): Observable<PageResult<Contact>> {\n return from(this.ensureConfigured().contacts.search(query, params));\n }\n\n listDeletedContacts(params?: ListContactsParams): Observable<PageResult<Contact>> {\n return from(this.ensureConfigured().contacts.listDeleted(params));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Leads Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listLeads(params?: ListLeadsParams): Observable<PageResult<Lead>> {\n return from(this.ensureConfigured().leads.list(params));\n }\n\n getLead(uniqueId: string): Observable<Lead> {\n return from(this.ensureConfigured().leads.get(uniqueId));\n }\n\n createLead(data: CreateLeadRequest): Observable<Lead> {\n return from(this.ensureConfigured().leads.create(data));\n }\n\n updateLead(uniqueId: string, data: UpdateLeadRequest): Observable<Lead> {\n return from(this.ensureConfigured().leads.update(uniqueId, data));\n }\n\n deleteLead(uniqueId: string): Observable<void> {\n return from(this.ensureConfigured().leads.delete(uniqueId));\n }\n\n recoverLead(uniqueId: string): Observable<Lead> {\n return from(this.ensureConfigured().leads.recover(uniqueId));\n }\n\n searchLeads(query: string, params?: ListLeadsParams): Observable<PageResult<Lead>> {\n return from(this.ensureConfigured().leads.search(query, params));\n }\n\n listDeletedLeads(params?: ListLeadsParams): Observable<PageResult<Lead>> {\n return from(this.ensureConfigured().leads.listDeleted(params));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Opportunities Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listOpportunities(params?: ListOpportunitiesParams): Observable<PageResult<Opportunity>> {\n return from(this.ensureConfigured().opportunities.list(params));\n }\n\n getOpportunity(uniqueId: string): Observable<Opportunity> {\n return from(this.ensureConfigured().opportunities.get(uniqueId));\n }\n\n createOpportunity(data: CreateOpportunityRequest): Observable<Opportunity> {\n return from(this.ensureConfigured().opportunities.create(data));\n }\n\n updateOpportunity(uniqueId: string, data: UpdateOpportunityRequest): Observable<Opportunity> {\n return from(this.ensureConfigured().opportunities.update(uniqueId, data));\n }\n\n deleteOpportunity(uniqueId: string): Observable<void> {\n return from(this.ensureConfigured().opportunities.delete(uniqueId));\n }\n\n recoverOpportunity(uniqueId: string): Observable<Opportunity> {\n return from(this.ensureConfigured().opportunities.recover(uniqueId));\n }\n\n searchOpportunities(query: string, params?: ListOpportunitiesParams): Observable<PageResult<Opportunity>> {\n return from(this.ensureConfigured().opportunities.search(query, params));\n }\n\n listDeletedOpportunities(params?: ListOpportunitiesParams): Observable<PageResult<Opportunity>> {\n return from(this.ensureConfigured().opportunities.listDeleted(params));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Meetings Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listMeetings(params?: ListMeetingsParams): Observable<PageResult<Meeting>> {\n return from(this.ensureConfigured().meetings.list(params));\n }\n\n getMeeting(uniqueId: string): Observable<Meeting> {\n return from(this.ensureConfigured().meetings.get(uniqueId));\n }\n\n createMeeting(data: CreateMeetingRequest): Observable<Meeting> {\n return from(this.ensureConfigured().meetings.create(data));\n }\n\n updateMeeting(uniqueId: string, data: UpdateMeetingRequest): Observable<Meeting> {\n return from(this.ensureConfigured().meetings.update(uniqueId, data));\n }\n\n deleteMeeting(uniqueId: string): Observable<void> {\n return from(this.ensureConfigured().meetings.delete(uniqueId));\n }\n\n recoverMeeting(uniqueId: string): Observable<Meeting> {\n return from(this.ensureConfigured().meetings.recover(uniqueId));\n }\n\n searchMeetings(query: string, params?: ListMeetingsParams): Observable<PageResult<Meeting>> {\n return from(this.ensureConfigured().meetings.search(query, params));\n }\n\n listDeletedMeetings(params?: ListMeetingsParams): Observable<PageResult<Meeting>> {\n return from(this.ensureConfigured().meetings.listDeleted(params));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Quotes Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listQuotes(params?: ListQuotesParams): Observable<PageResult<Quote>> {\n return from(this.ensureConfigured().quotes.list(params));\n }\n\n getQuote(uniqueId: string): Observable<Quote> {\n return from(this.ensureConfigured().quotes.get(uniqueId));\n }\n\n createQuote(data: CreateQuoteRequest): Observable<Quote> {\n return from(this.ensureConfigured().quotes.create(data));\n }\n\n updateQuote(uniqueId: string, data: UpdateQuoteRequest): Observable<Quote> {\n return from(this.ensureConfigured().quotes.update(uniqueId, data));\n }\n\n deleteQuote(uniqueId: string): Observable<void> {\n return from(this.ensureConfigured().quotes.delete(uniqueId));\n }\n\n recoverQuote(uniqueId: string): Observable<Quote> {\n return from(this.ensureConfigured().quotes.recover(uniqueId));\n }\n\n searchQuotes(query: string, params?: ListQuotesParams): Observable<PageResult<Quote>> {\n return from(this.ensureConfigured().quotes.search(query, params));\n }\n\n listDeletedQuotes(params?: ListQuotesParams): Observable<PageResult<Quote>> {\n return from(this.ensureConfigured().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.ensureConfigured();\n }\n}\n"],"names":["Injectable","Inject","Optional","from","createCrmBlock","TRANSPORT","CRM_TRANSPORT","CRM_CONFIG","CrmService","ensureConfigured","block","Error","listAccounts","params","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","serviceTransport","legacyTransport","config","transport","providedIn"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;AAAA,SAASA,UAAU,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,gBAAgB;AAC7D,SAAqBC,IAAI,QAAQ,OAAO;AAExC,SACEC,cAAc,QA6BT,sBAAsB;AAC7B,SAASC,SAAS,EAAEC,aAAa,EAAEC,UAAU,QAAQ,eAAe;AAsBpE,OAAO,MAAMC;IAYX;;GAEC,GACD,AAAQC,mBAA6B;QACnC,IAAI,CAAC,IAAI,CAACC,KAAK,EAAE;YACf,MAAM,IAAIC,MACR,8CACA;QAEJ;QACA,OAAO,IAAI,CAACD,KAAK;IACnB;IAEA,gFAAgF;IAChF,mBAAmB;IACnB,gFAAgF;IAEhFE,aAAaC,MAA2B,EAAmC;QACzE,OAAOV,KAAK,IAAI,CAACM,gBAAgB,GAAGK,QAAQ,CAACC,IAAI,CAACF;IACpD;IAEAG,WAAWC,QAAgB,EAAuB;QAChD,OAAOd,KAAK,IAAI,CAACM,gBAAgB,GAAGK,QAAQ,CAACI,GAAG,CAACD;IACnD;IAEAE,cAAcC,IAA0B,EAAuB;QAC7D,OAAOjB,KAAK,IAAI,CAACM,gBAAgB,GAAGK,QAAQ,CAACO,MAAM,CAACD;IACtD;IAEAE,cAAcL,QAAgB,EAAEG,IAA0B,EAAuB;QAC/E,OAAOjB,KAAK,IAAI,CAACM,gBAAgB,GAAGK,QAAQ,CAACS,MAAM,CAACN,UAAUG;IAChE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AM,CAACN,UAAUG;IAC9D;IAEAsD,YAAYzD,QAAgB,EAAoB;QAC9C,OAAOd,KAAK,IAAI,CAACM,gBAAgB,GAAG6D,MAAM,CAAC7C,MAAM,CAACR;IACpD;IAEA0D,aAAa1D,QAAgB,EAAqB;QAChD,OAAOd,KAAK,IAAI,CAACM,gBAAgB,GAAG6D,MAAM,CAAC3C,OAAO,CAACV;IACrD;IAEA2D,aAAa/C,KAAa,EAAEhB,MAAyB,EAAiC;QACpF,OAAOV,KAAK,IAAI,CAACM,gBAAgB,GAAG6D,MAAM,CAACxC,MAAM,CAACD,OAAOhB;IAC3D;IAEAgE,kBAAkBhE,MAAyB,EAAiC;QAC1E,OAAOV,KAAK,IAAI,CAACM,gBAAgB,GAAG6D,MAAM,CAACtC,WAAW,CAACnB;IACzD;IAEA,gFAAgF;IAChF,2CAA2C;IAC3C,gFAAgF;IAEhF;;;GAGC,GACD,IAAIiE,WAAqB;QACvB,OAAO,IAAI,CAACrE,gBAAgB;IAC9B;IAxPAsE,YACE,AAAmCC,gBAAkC,EACrE,AAA+BC,eAAiC,EAChE,AAAoBC,MAAsB,CAC1C;QACA,MAAMC,YAAYH,2BAAAA,mBAAoBC;QACtC,IAAI,CAACvE,KAAK,GAAGyE,YAAY/E,eAAe+E,WAAWD,UAAU;IAC/D;AAkPF;AA5Pa1E;IADZR,WAAW;QAAEoF,YAAY;IAAO;IAK5BlF,aAAAA;IAAYD,aAAAA,OAAOK;IACnBJ,aAAAA;IAAYD,aAAAA,OAAOI;IACnBJ,aAAAA,OAAOM;;;;;eAAoB,0CAAA;;GANnBC"}
@@ -1,82 +1,90 @@
1
1
  import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
2
2
  import { _ as _ts_metadata } from "@swc/helpers/_/_ts_metadata";
3
3
  import { _ as _ts_param } from "@swc/helpers/_/_ts_param";
4
- import { Injectable, Inject } from '@angular/core';
4
+ import { Injectable, Inject, Optional } from '@angular/core';
5
5
  import { from } from 'rxjs';
6
6
  import { createFilesBlock } from '@23blocks/block-files';
7
- import { TRANSPORT, FILES_CONFIG } from '../tokens.js';
7
+ import { TRANSPORT, FILES_TRANSPORT, FILES_CONFIG } from '../tokens.js';
8
8
  export class FilesService {
9
+ /**
10
+ * Ensure the service is configured, throw helpful error if not
11
+ */ ensureConfigured() {
12
+ if (!this.block) {
13
+ throw new Error('[23blocks] FilesService is not configured. ' + "Add 'urls.files' to your provideBlocks23() configuration.");
14
+ }
15
+ return this.block;
16
+ }
9
17
  // ─────────────────────────────────────────────────────────────────────────────
10
18
  // Storage Files Service
11
19
  // ─────────────────────────────────────────────────────────────────────────────
12
20
  listStorageFiles(params) {
13
- return from(this.block.storageFiles.list(params));
21
+ return from(this.ensureConfigured().storageFiles.list(params));
14
22
  }
15
23
  getStorageFile(uniqueId) {
16
- return from(this.block.storageFiles.get(uniqueId));
24
+ return from(this.ensureConfigured().storageFiles.get(uniqueId));
17
25
  }
18
26
  uploadStorageFile(data) {
19
- return from(this.block.storageFiles.upload(data));
27
+ return from(this.ensureConfigured().storageFiles.upload(data));
20
28
  }
21
29
  createStorageFile(data) {
22
- return from(this.block.storageFiles.create(data));
30
+ return from(this.ensureConfigured().storageFiles.create(data));
23
31
  }
24
32
  updateStorageFile(uniqueId, data) {
25
- return from(this.block.storageFiles.update(uniqueId, data));
33
+ return from(this.ensureConfigured().storageFiles.update(uniqueId, data));
26
34
  }
27
35
  deleteStorageFile(uniqueId) {
28
- return from(this.block.storageFiles.delete(uniqueId));
36
+ return from(this.ensureConfigured().storageFiles.delete(uniqueId));
29
37
  }
30
38
  downloadStorageFile(uniqueId) {
31
- return from(this.block.storageFiles.download(uniqueId));
39
+ return from(this.ensureConfigured().storageFiles.download(uniqueId));
32
40
  }
33
41
  listStorageFilesByOwner(ownerUniqueId, ownerType, params) {
34
- return from(this.block.storageFiles.listByOwner(ownerUniqueId, ownerType, params));
42
+ return from(this.ensureConfigured().storageFiles.listByOwner(ownerUniqueId, ownerType, params));
35
43
  }
36
44
  // ─────────────────────────────────────────────────────────────────────────────
37
45
  // Entity Files Service
38
46
  // ─────────────────────────────────────────────────────────────────────────────
39
47
  listEntityFiles(params) {
40
- return from(this.block.entityFiles.list(params));
48
+ return from(this.ensureConfigured().entityFiles.list(params));
41
49
  }
42
50
  getEntityFile(uniqueId) {
43
- return from(this.block.entityFiles.get(uniqueId));
51
+ return from(this.ensureConfigured().entityFiles.get(uniqueId));
44
52
  }
45
53
  attachFile(data) {
46
- return from(this.block.entityFiles.attach(data));
54
+ return from(this.ensureConfigured().entityFiles.attach(data));
47
55
  }
48
56
  detachFile(uniqueId) {
49
- return from(this.block.entityFiles.detach(uniqueId));
57
+ return from(this.ensureConfigured().entityFiles.detach(uniqueId));
50
58
  }
51
59
  updateEntityFile(uniqueId, data) {
52
- return from(this.block.entityFiles.update(uniqueId, data));
60
+ return from(this.ensureConfigured().entityFiles.update(uniqueId, data));
53
61
  }
54
62
  reorderEntityFiles(entityUniqueId, entityType, data) {
55
- return from(this.block.entityFiles.reorder(entityUniqueId, entityType, data));
63
+ return from(this.ensureConfigured().entityFiles.reorder(entityUniqueId, entityType, data));
56
64
  }
57
65
  listEntityFilesByEntity(entityUniqueId, entityType, params) {
58
- return from(this.block.entityFiles.listByEntity(entityUniqueId, entityType, params));
66
+ return from(this.ensureConfigured().entityFiles.listByEntity(entityUniqueId, entityType, params));
59
67
  }
60
68
  // ─────────────────────────────────────────────────────────────────────────────
61
69
  // File Schemas Service
62
70
  // ─────────────────────────────────────────────────────────────────────────────
63
71
  listFileSchemas(params) {
64
- return from(this.block.fileSchemas.list(params));
72
+ return from(this.ensureConfigured().fileSchemas.list(params));
65
73
  }
66
74
  getFileSchema(uniqueId) {
67
- return from(this.block.fileSchemas.get(uniqueId));
75
+ return from(this.ensureConfigured().fileSchemas.get(uniqueId));
68
76
  }
69
77
  getFileSchemaByCode(code) {
70
- return from(this.block.fileSchemas.getByCode(code));
78
+ return from(this.ensureConfigured().fileSchemas.getByCode(code));
71
79
  }
72
80
  createFileSchema(data) {
73
- return from(this.block.fileSchemas.create(data));
81
+ return from(this.ensureConfigured().fileSchemas.create(data));
74
82
  }
75
83
  updateFileSchema(uniqueId, data) {
76
- return from(this.block.fileSchemas.update(uniqueId, data));
84
+ return from(this.ensureConfigured().fileSchemas.update(uniqueId, data));
77
85
  }
78
86
  deleteFileSchema(uniqueId) {
79
- return from(this.block.fileSchemas.delete(uniqueId));
87
+ return from(this.ensureConfigured().fileSchemas.delete(uniqueId));
80
88
  }
81
89
  // ─────────────────────────────────────────────────────────────────────────────
82
90
  // Direct Block Access (for advanced usage)
@@ -85,21 +93,26 @@ export class FilesService {
85
93
  * Access the underlying block for advanced operations
86
94
  * Use this when you need access to services not wrapped by this Angular service
87
95
  */ get rawBlock() {
88
- return this.block;
96
+ return this.ensureConfigured();
89
97
  }
90
- constructor(transport, config){
91
- this.block = createFilesBlock(transport, config);
98
+ constructor(serviceTransport, legacyTransport, config){
99
+ const transport = serviceTransport != null ? serviceTransport : legacyTransport;
100
+ this.block = transport ? createFilesBlock(transport, config) : null;
92
101
  }
93
102
  }
94
103
  FilesService = _ts_decorate([
95
104
  Injectable({
96
105
  providedIn: 'root'
97
106
  }),
98
- _ts_param(0, Inject(TRANSPORT)),
99
- _ts_param(1, Inject(FILES_CONFIG)),
107
+ _ts_param(0, Optional()),
108
+ _ts_param(0, Inject(FILES_TRANSPORT)),
109
+ _ts_param(1, Optional()),
110
+ _ts_param(1, Inject(TRANSPORT)),
111
+ _ts_param(2, Inject(FILES_CONFIG)),
100
112
  _ts_metadata("design:type", Function),
101
113
  _ts_metadata("design:paramtypes", [
102
- typeof Transport === "undefined" ? Object : Transport,
114
+ Object,
115
+ Object,
103
116
  typeof FilesBlockConfig === "undefined" ? Object : FilesBlockConfig
104
117
  ])
105
118
  ], FilesService);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/files/files.service.ts"],"sourcesContent":["import { Injectable, Inject } from '@angular/core';\nimport { Observable, from } from 'rxjs';\nimport type { Transport, PageResult } from '@23blocks/contracts';\nimport {\n createFilesBlock,\n type FilesBlock,\n type FilesBlockConfig,\n type StorageFile,\n type CreateStorageFileRequest,\n type UpdateStorageFileRequest,\n type ListStorageFilesParams,\n type UploadFileRequest,\n type EntityFile,\n type AttachFileRequest,\n type UpdateEntityFileRequest,\n type ListEntityFilesParams,\n type ReorderFilesRequest,\n type FileSchema,\n type CreateFileSchemaRequest,\n type UpdateFileSchemaRequest,\n type ListFileSchemasParams,\n} from '@23blocks/block-files';\nimport { TRANSPORT, FILES_CONFIG } from '../tokens.js';\n\n/**\n * Angular service wrapping the Files block.\n * Converts Promise-based APIs to RxJS Observables.\n *\n * @example\n * ```typescript\n * @Component({...})\n * export class FileUploadComponent {\n * constructor(private files: FilesService) {}\n *\n * uploadFile(file: File) {\n * this.files.uploadStorageFile({\n * file,\n * fileName: file.name,\n * ownerUniqueId: 'user-123',\n * ownerType: 'User',\n * }).subscribe({\n * next: (storageFile) => console.log('Uploaded:', storageFile),\n * error: (err) => console.error('Failed:', err),\n * });\n * }\n * }\n * ```\n */\n@Injectable({ providedIn: 'root' })\nexport class FilesService {\n private readonly block: FilesBlock;\n\n constructor(\n @Inject(TRANSPORT) transport: Transport,\n @Inject(FILES_CONFIG) config: FilesBlockConfig\n ) {\n this.block = createFilesBlock(transport, config);\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Storage Files Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listStorageFiles(params?: ListStorageFilesParams): Observable<PageResult<StorageFile>> {\n return from(this.block.storageFiles.list(params));\n }\n\n getStorageFile(uniqueId: string): Observable<StorageFile> {\n return from(this.block.storageFiles.get(uniqueId));\n }\n\n uploadStorageFile(data: UploadFileRequest): Observable<StorageFile> {\n return from(this.block.storageFiles.upload(data));\n }\n\n createStorageFile(data: CreateStorageFileRequest): Observable<StorageFile> {\n return from(this.block.storageFiles.create(data));\n }\n\n updateStorageFile(uniqueId: string, data: UpdateStorageFileRequest): Observable<StorageFile> {\n return from(this.block.storageFiles.update(uniqueId, data));\n }\n\n deleteStorageFile(uniqueId: string): Observable<void> {\n return from(this.block.storageFiles.delete(uniqueId));\n }\n\n downloadStorageFile(uniqueId: string): Observable<Blob> {\n return from(this.block.storageFiles.download(uniqueId));\n }\n\n listStorageFilesByOwner(\n ownerUniqueId: string,\n ownerType: string,\n params?: ListStorageFilesParams\n ): Observable<PageResult<StorageFile>> {\n return from(this.block.storageFiles.listByOwner(ownerUniqueId, ownerType, params));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Entity Files Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listEntityFiles(params?: ListEntityFilesParams): Observable<PageResult<EntityFile>> {\n return from(this.block.entityFiles.list(params));\n }\n\n getEntityFile(uniqueId: string): Observable<EntityFile> {\n return from(this.block.entityFiles.get(uniqueId));\n }\n\n attachFile(data: AttachFileRequest): Observable<EntityFile> {\n return from(this.block.entityFiles.attach(data));\n }\n\n detachFile(uniqueId: string): Observable<void> {\n return from(this.block.entityFiles.detach(uniqueId));\n }\n\n updateEntityFile(uniqueId: string, data: UpdateEntityFileRequest): Observable<EntityFile> {\n return from(this.block.entityFiles.update(uniqueId, data));\n }\n\n reorderEntityFiles(\n entityUniqueId: string,\n entityType: string,\n data: ReorderFilesRequest\n ): Observable<EntityFile[]> {\n return from(this.block.entityFiles.reorder(entityUniqueId, entityType, data));\n }\n\n listEntityFilesByEntity(\n entityUniqueId: string,\n entityType: string,\n params?: ListEntityFilesParams\n ): Observable<PageResult<EntityFile>> {\n return from(this.block.entityFiles.listByEntity(entityUniqueId, entityType, params));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // File Schemas Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listFileSchemas(params?: ListFileSchemasParams): Observable<PageResult<FileSchema>> {\n return from(this.block.fileSchemas.list(params));\n }\n\n getFileSchema(uniqueId: string): Observable<FileSchema> {\n return from(this.block.fileSchemas.get(uniqueId));\n }\n\n getFileSchemaByCode(code: string): Observable<FileSchema> {\n return from(this.block.fileSchemas.getByCode(code));\n }\n\n createFileSchema(data: CreateFileSchemaRequest): Observable<FileSchema> {\n return from(this.block.fileSchemas.create(data));\n }\n\n updateFileSchema(uniqueId: string, data: UpdateFileSchemaRequest): Observable<FileSchema> {\n return from(this.block.fileSchemas.update(uniqueId, data));\n }\n\n deleteFileSchema(uniqueId: string): Observable<void> {\n return from(this.block.fileSchemas.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(): FilesBlock {\n return this.block;\n }\n}\n"],"names":["Injectable","Inject","from","createFilesBlock","TRANSPORT","FILES_CONFIG","FilesService","listStorageFiles","params","block","storageFiles","list","getStorageFile","uniqueId","get","uploadStorageFile","data","upload","createStorageFile","create","updateStorageFile","update","deleteStorageFile","delete","downloadStorageFile","download","listStorageFilesByOwner","ownerUniqueId","ownerType","listByOwner","listEntityFiles","entityFiles","getEntityFile","attachFile","attach","detachFile","detach","updateEntityFile","reorderEntityFiles","entityUniqueId","entityType","reorder","listEntityFilesByEntity","listByEntity","listFileSchemas","fileSchemas","getFileSchema","getFileSchemaByCode","code","getByCode","createFileSchema","updateFileSchema","deleteFileSchema","rawBlock","constructor","transport","config","providedIn"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;AAAA,SAASA,UAAU,EAAEC,MAAM,QAAQ,gBAAgB;AACnD,SAAqBC,IAAI,QAAQ,OAAO;AAExC,SACEC,gBAAgB,QAiBX,wBAAwB;AAC/B,SAASC,SAAS,EAAEC,YAAY,QAAQ,eAAe;AA2BvD,OAAO,MAAMC;IAUX,gFAAgF;IAChF,wBAAwB;IACxB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QAAgB,EAAoB;QACnD,OAAOX,KAAK,IAAI,CAACO,KAAK,CAACoC,WAAW,CAACtB,MAAM,CAACV;IAC5C;IAEA,gFAAgF;IAChF,2CAA2C;IAC3C,gFAAgF;IAEhF;;;GAGC,GACD,IAAIwC,WAAuB;QACzB,OAAO,IAAI,CAAC5C,KAAK;IACnB;IA7HA6C,YACE,AAAmBC,SAAoB,EACvC,AAAsBC,MAAwB,CAC9C;QACA,IAAI,CAAC/C,KAAK,GAAGN,iBAAiBoD,WAAWC;IAC3C;AAyHF;AAjIalD;IADZN,WAAW;QAAEyD,YAAY;IAAO;IAK5BxD,aAAAA,OAAOG;IACPH,aAAAA,OAAOI;;;eADsB,qCAAA;eACA,4CAAA;;GALrBC"}
1
+ {"version":3,"sources":["../../../src/lib/files/files.service.ts"],"sourcesContent":["import { Injectable, Inject, Optional } from '@angular/core';\nimport { Observable, from } from 'rxjs';\nimport type { Transport, PageResult } from '@23blocks/contracts';\nimport {\n createFilesBlock,\n type FilesBlock,\n type FilesBlockConfig,\n type StorageFile,\n type CreateStorageFileRequest,\n type UpdateStorageFileRequest,\n type ListStorageFilesParams,\n type UploadFileRequest,\n type EntityFile,\n type AttachFileRequest,\n type UpdateEntityFileRequest,\n type ListEntityFilesParams,\n type ReorderFilesRequest,\n type FileSchema,\n type CreateFileSchemaRequest,\n type UpdateFileSchemaRequest,\n type ListFileSchemasParams,\n} from '@23blocks/block-files';\nimport { TRANSPORT, FILES_TRANSPORT, FILES_CONFIG } from '../tokens.js';\n\n/**\n * Angular service wrapping the Files block.\n * Converts Promise-based APIs to RxJS Observables.\n *\n * @example\n * ```typescript\n * @Component({...})\n * export class FileUploadComponent {\n * constructor(private files: FilesService) {}\n *\n * uploadFile(file: File) {\n * this.files.uploadStorageFile({\n * file,\n * fileName: file.name,\n * ownerUniqueId: 'user-123',\n * ownerType: 'User',\n * }).subscribe({\n * next: (storageFile) => console.log('Uploaded:', storageFile),\n * error: (err) => console.error('Failed:', err),\n * });\n * }\n * }\n * ```\n */\n@Injectable({ providedIn: 'root' })\nexport class FilesService {\n private readonly block: FilesBlock | null;\n\n constructor(\n @Optional() @Inject(FILES_TRANSPORT) serviceTransport: Transport | null,\n @Optional() @Inject(TRANSPORT) legacyTransport: Transport | null,\n @Inject(FILES_CONFIG) config: FilesBlockConfig\n ) {\n const transport = serviceTransport ?? legacyTransport;\n this.block = transport ? createFilesBlock(transport, config) : null;\n }\n\n /**\n * Ensure the service is configured, throw helpful error if not\n */\n private ensureConfigured(): FilesBlock {\n if (!this.block) {\n throw new Error(\n '[23blocks] FilesService is not configured. ' +\n \"Add 'urls.files' to your provideBlocks23() configuration.\"\n );\n }\n return this.block;\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Storage Files Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listStorageFiles(params?: ListStorageFilesParams): Observable<PageResult<StorageFile>> {\n return from(this.ensureConfigured().storageFiles.list(params));\n }\n\n getStorageFile(uniqueId: string): Observable<StorageFile> {\n return from(this.ensureConfigured().storageFiles.get(uniqueId));\n }\n\n uploadStorageFile(data: UploadFileRequest): Observable<StorageFile> {\n return from(this.ensureConfigured().storageFiles.upload(data));\n }\n\n createStorageFile(data: CreateStorageFileRequest): Observable<StorageFile> {\n return from(this.ensureConfigured().storageFiles.create(data));\n }\n\n updateStorageFile(uniqueId: string, data: UpdateStorageFileRequest): Observable<StorageFile> {\n return from(this.ensureConfigured().storageFiles.update(uniqueId, data));\n }\n\n deleteStorageFile(uniqueId: string): Observable<void> {\n return from(this.ensureConfigured().storageFiles.delete(uniqueId));\n }\n\n downloadStorageFile(uniqueId: string): Observable<Blob> {\n return from(this.ensureConfigured().storageFiles.download(uniqueId));\n }\n\n listStorageFilesByOwner(\n ownerUniqueId: string,\n ownerType: string,\n params?: ListStorageFilesParams\n ): Observable<PageResult<StorageFile>> {\n return from(this.ensureConfigured().storageFiles.listByOwner(ownerUniqueId, ownerType, params));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Entity Files Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listEntityFiles(params?: ListEntityFilesParams): Observable<PageResult<EntityFile>> {\n return from(this.ensureConfigured().entityFiles.list(params));\n }\n\n getEntityFile(uniqueId: string): Observable<EntityFile> {\n return from(this.ensureConfigured().entityFiles.get(uniqueId));\n }\n\n attachFile(data: AttachFileRequest): Observable<EntityFile> {\n return from(this.ensureConfigured().entityFiles.attach(data));\n }\n\n detachFile(uniqueId: string): Observable<void> {\n return from(this.ensureConfigured().entityFiles.detach(uniqueId));\n }\n\n updateEntityFile(uniqueId: string, data: UpdateEntityFileRequest): Observable<EntityFile> {\n return from(this.ensureConfigured().entityFiles.update(uniqueId, data));\n }\n\n reorderEntityFiles(\n entityUniqueId: string,\n entityType: string,\n data: ReorderFilesRequest\n ): Observable<EntityFile[]> {\n return from(this.ensureConfigured().entityFiles.reorder(entityUniqueId, entityType, data));\n }\n\n listEntityFilesByEntity(\n entityUniqueId: string,\n entityType: string,\n params?: ListEntityFilesParams\n ): Observable<PageResult<EntityFile>> {\n return from(this.ensureConfigured().entityFiles.listByEntity(entityUniqueId, entityType, params));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // File Schemas Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listFileSchemas(params?: ListFileSchemasParams): Observable<PageResult<FileSchema>> {\n return from(this.ensureConfigured().fileSchemas.list(params));\n }\n\n getFileSchema(uniqueId: string): Observable<FileSchema> {\n return from(this.ensureConfigured().fileSchemas.get(uniqueId));\n }\n\n getFileSchemaByCode(code: string): Observable<FileSchema> {\n return from(this.ensureConfigured().fileSchemas.getByCode(code));\n }\n\n createFileSchema(data: CreateFileSchemaRequest): Observable<FileSchema> {\n return from(this.ensureConfigured().fileSchemas.create(data));\n }\n\n updateFileSchema(uniqueId: string, data: UpdateFileSchemaRequest): Observable<FileSchema> {\n return from(this.ensureConfigured().fileSchemas.update(uniqueId, data));\n }\n\n deleteFileSchema(uniqueId: string): Observable<void> {\n return from(this.ensureConfigured().fileSchemas.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(): FilesBlock {\n return this.ensureConfigured();\n }\n}\n"],"names":["Injectable","Inject","Optional","from","createFilesBlock","TRANSPORT","FILES_TRANSPORT","FILES_CONFIG","FilesService","ensureConfigured","block","Error","listStorageFiles","params","storageFiles","list","getStorageFile","uniqueId","get","uploadStorageFile","data","upload","createStorageFile","create","updateStorageFile","update","deleteStorageFile","delete","downloadStorageFile","download","listStorageFilesByOwner","ownerUniqueId","ownerType","listByOwner","listEntityFiles","entityFiles","getEntityFile","attachFile","attach","detachFile","detach","updateEntityFile","reorderEntityFiles","entityUniqueId","entityType","reorder","listEntityFilesByEntity","listByEntity","listFileSchemas","fileSchemas","getFileSchema","getFileSchemaByCode","code","getByCode","createFileSchema","updateFileSchema","deleteFileSchema","rawBlock","constructor","serviceTransport","legacyTransport","config","transport","providedIn"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;AAAA,SAASA,UAAU,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,gBAAgB;AAC7D,SAAqBC,IAAI,QAAQ,OAAO;AAExC,SACEC,gBAAgB,QAiBX,wBAAwB;AAC/B,SAASC,SAAS,EAAEC,eAAe,EAAEC,YAAY,QAAQ,eAAe;AA2BxE,OAAO,MAAMC;IAYX;;GAEC,GACD,AAAQC,mBAA+B;QACrC,IAAI,CAAC,IAAI,CAACC,KAAK,EAAE;YACf,MAAM,IAAIC,MACR,gDACA;QAEJ;QACA,OAAO,IAAI,CAACD,KAAK;IACnB;IAEA,gFAAgF;IAChF,wBAAwB;I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