@23blocks/angular 0.1.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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/authentication/authentication.service.js +89 -10
- package/dist/lib/authentication/authentication.service.js.map +1 -1
- 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 +25 -2
- 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/simple-providers.js +400 -0
- package/dist/lib/simple-providers.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 +20 -3
|
@@ -0,0 +1,119 @@
|
|
|
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 { createOnboardingBlock } from '@23blocks/block-onboarding';
|
|
7
|
+
import { TRANSPORT, ONBOARDING_CONFIG } from '../tokens.js';
|
|
8
|
+
export class OnboardingService {
|
|
9
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
10
|
+
// Onboardings Service
|
|
11
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
12
|
+
listOnboardings(params) {
|
|
13
|
+
return from(this.block.onboardings.list(params));
|
|
14
|
+
}
|
|
15
|
+
getOnboarding(uniqueId) {
|
|
16
|
+
return from(this.block.onboardings.get(uniqueId));
|
|
17
|
+
}
|
|
18
|
+
createOnboarding(request) {
|
|
19
|
+
return from(this.block.onboardings.create(request));
|
|
20
|
+
}
|
|
21
|
+
updateOnboarding(uniqueId, request) {
|
|
22
|
+
return from(this.block.onboardings.update(uniqueId, request));
|
|
23
|
+
}
|
|
24
|
+
deleteOnboarding(uniqueId) {
|
|
25
|
+
return from(this.block.onboardings.delete(uniqueId));
|
|
26
|
+
}
|
|
27
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
28
|
+
// Flows Service
|
|
29
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
30
|
+
listFlows(params) {
|
|
31
|
+
return from(this.block.flows.list(params));
|
|
32
|
+
}
|
|
33
|
+
getFlow(uniqueId) {
|
|
34
|
+
return from(this.block.flows.get(uniqueId));
|
|
35
|
+
}
|
|
36
|
+
createFlow(request) {
|
|
37
|
+
return from(this.block.flows.create(request));
|
|
38
|
+
}
|
|
39
|
+
updateFlow(uniqueId, request) {
|
|
40
|
+
return from(this.block.flows.update(uniqueId, request));
|
|
41
|
+
}
|
|
42
|
+
deleteFlow(uniqueId) {
|
|
43
|
+
return from(this.block.flows.delete(uniqueId));
|
|
44
|
+
}
|
|
45
|
+
listFlowsByOnboarding(onboardingUniqueId) {
|
|
46
|
+
return from(this.block.flows.listByOnboarding(onboardingUniqueId));
|
|
47
|
+
}
|
|
48
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
49
|
+
// User Journeys Service
|
|
50
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
51
|
+
listUserJourneys(params) {
|
|
52
|
+
return from(this.block.userJourneys.list(params));
|
|
53
|
+
}
|
|
54
|
+
getUserJourney(uniqueId) {
|
|
55
|
+
return from(this.block.userJourneys.get(uniqueId));
|
|
56
|
+
}
|
|
57
|
+
startJourney(request) {
|
|
58
|
+
return from(this.block.userJourneys.start(request));
|
|
59
|
+
}
|
|
60
|
+
completeStep(uniqueId, request) {
|
|
61
|
+
return from(this.block.userJourneys.completeStep(uniqueId, request));
|
|
62
|
+
}
|
|
63
|
+
abandonJourney(uniqueId) {
|
|
64
|
+
return from(this.block.userJourneys.abandon(uniqueId));
|
|
65
|
+
}
|
|
66
|
+
getJourneysByUser(userUniqueId) {
|
|
67
|
+
return from(this.block.userJourneys.getByUser(userUniqueId));
|
|
68
|
+
}
|
|
69
|
+
getJourneyProgress(uniqueId) {
|
|
70
|
+
return from(this.block.userJourneys.getProgress(uniqueId));
|
|
71
|
+
}
|
|
72
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
73
|
+
// User Identities Service
|
|
74
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
75
|
+
listUserIdentities(params) {
|
|
76
|
+
return from(this.block.userIdentities.list(params));
|
|
77
|
+
}
|
|
78
|
+
getUserIdentity(uniqueId) {
|
|
79
|
+
return from(this.block.userIdentities.get(uniqueId));
|
|
80
|
+
}
|
|
81
|
+
createUserIdentity(request) {
|
|
82
|
+
return from(this.block.userIdentities.create(request));
|
|
83
|
+
}
|
|
84
|
+
verifyUserIdentity(uniqueId, request) {
|
|
85
|
+
return from(this.block.userIdentities.verify(uniqueId, request));
|
|
86
|
+
}
|
|
87
|
+
deleteUserIdentity(uniqueId) {
|
|
88
|
+
return from(this.block.userIdentities.delete(uniqueId));
|
|
89
|
+
}
|
|
90
|
+
listIdentitiesByUser(userUniqueId) {
|
|
91
|
+
return from(this.block.userIdentities.listByUser(userUniqueId));
|
|
92
|
+
}
|
|
93
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
94
|
+
// Direct Block Access (for advanced usage)
|
|
95
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
96
|
+
/**
|
|
97
|
+
* Access the underlying block for advanced operations
|
|
98
|
+
* Use this when you need access to services not wrapped by this Angular service
|
|
99
|
+
*/ get rawBlock() {
|
|
100
|
+
return this.block;
|
|
101
|
+
}
|
|
102
|
+
constructor(transport, config){
|
|
103
|
+
this.block = createOnboardingBlock(transport, config);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
OnboardingService = _ts_decorate([
|
|
107
|
+
Injectable({
|
|
108
|
+
providedIn: 'root'
|
|
109
|
+
}),
|
|
110
|
+
_ts_param(0, Inject(TRANSPORT)),
|
|
111
|
+
_ts_param(1, Inject(ONBOARDING_CONFIG)),
|
|
112
|
+
_ts_metadata("design:type", Function),
|
|
113
|
+
_ts_metadata("design:paramtypes", [
|
|
114
|
+
typeof Transport === "undefined" ? Object : Transport,
|
|
115
|
+
typeof OnboardingBlockConfig === "undefined" ? Object : OnboardingBlockConfig
|
|
116
|
+
])
|
|
117
|
+
], OnboardingService);
|
|
118
|
+
|
|
119
|
+
//# sourceMappingURL=onboarding.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/onboarding/onboarding.service.ts"],"sourcesContent":["import { Injectable, Inject } from '@angular/core';\nimport { Observable, from } from 'rxjs';\nimport type { Transport, PageResult } from '@23blocks/contracts';\nimport {\n createOnboardingBlock,\n type OnboardingBlock,\n type OnboardingBlockConfig,\n type Onboarding,\n type CreateOnboardingRequest,\n type UpdateOnboardingRequest,\n type ListOnboardingsParams,\n type Flow,\n type CreateFlowRequest,\n type UpdateFlowRequest,\n type ListFlowsParams,\n type UserJourney,\n type StartJourneyRequest,\n type CompleteStepRequest,\n type ListUserJourneysParams,\n type UserIdentity,\n type CreateUserIdentityRequest,\n type VerifyUserIdentityRequest,\n type ListUserIdentitiesParams,\n} from '@23blocks/block-onboarding';\nimport { TRANSPORT, ONBOARDING_CONFIG } from '../tokens.js';\n\n/**\n * Angular service wrapping the Onboarding block.\n * Converts Promise-based APIs to RxJS Observables.\n *\n * @example\n * ```typescript\n * @Component({...})\n * export class OnboardingComponent {\n * constructor(private onboarding: OnboardingService) {}\n *\n * createOnboarding() {\n * this.onboarding.createOnboarding({\n * code: 'user-onboarding',\n * name: 'User Onboarding',\n * steps: []\n * }).subscribe({\n * next: (onboarding) => console.log('Created:', onboarding),\n * error: (err) => console.error('Failed:', err),\n * });\n * }\n * }\n * ```\n */\n@Injectable({ providedIn: 'root' })\nexport class OnboardingService {\n private readonly block: OnboardingBlock;\n\n constructor(\n @Inject(TRANSPORT) transport: Transport,\n @Inject(ONBOARDING_CONFIG) config: OnboardingBlockConfig\n ) {\n this.block = createOnboardingBlock(transport, config);\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Onboardings Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listOnboardings(params?: ListOnboardingsParams): Observable<PageResult<Onboarding>> {\n return from(this.block.onboardings.list(params));\n }\n\n getOnboarding(uniqueId: string): Observable<Onboarding> {\n return from(this.block.onboardings.get(uniqueId));\n }\n\n createOnboarding(request: CreateOnboardingRequest): Observable<Onboarding> {\n return from(this.block.onboardings.create(request));\n }\n\n updateOnboarding(uniqueId: string, request: UpdateOnboardingRequest): Observable<Onboarding> {\n return from(this.block.onboardings.update(uniqueId, request));\n }\n\n deleteOnboarding(uniqueId: string): Observable<void> {\n return from(this.block.onboardings.delete(uniqueId));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Flows Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listFlows(params?: ListFlowsParams): Observable<PageResult<Flow>> {\n return from(this.block.flows.list(params));\n }\n\n getFlow(uniqueId: string): Observable<Flow> {\n return from(this.block.flows.get(uniqueId));\n }\n\n createFlow(request: CreateFlowRequest): Observable<Flow> {\n return from(this.block.flows.create(request));\n }\n\n updateFlow(uniqueId: string, request: UpdateFlowRequest): Observable<Flow> {\n return from(this.block.flows.update(uniqueId, request));\n }\n\n deleteFlow(uniqueId: string): Observable<void> {\n return from(this.block.flows.delete(uniqueId));\n }\n\n listFlowsByOnboarding(onboardingUniqueId: string): Observable<Flow[]> {\n return from(this.block.flows.listByOnboarding(onboardingUniqueId));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // User Journeys Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listUserJourneys(params?: ListUserJourneysParams): Observable<PageResult<UserJourney>> {\n return from(this.block.userJourneys.list(params));\n }\n\n getUserJourney(uniqueId: string): Observable<UserJourney> {\n return from(this.block.userJourneys.get(uniqueId));\n }\n\n startJourney(request: StartJourneyRequest): Observable<UserJourney> {\n return from(this.block.userJourneys.start(request));\n }\n\n completeStep(uniqueId: string, request: CompleteStepRequest): Observable<UserJourney> {\n return from(this.block.userJourneys.completeStep(uniqueId, request));\n }\n\n abandonJourney(uniqueId: string): Observable<UserJourney> {\n return from(this.block.userJourneys.abandon(uniqueId));\n }\n\n getJourneysByUser(userUniqueId: string): Observable<UserJourney[]> {\n return from(this.block.userJourneys.getByUser(userUniqueId));\n }\n\n getJourneyProgress(uniqueId: string): Observable<{ progress: number; currentStep?: number; completedSteps?: number[] }> {\n return from(this.block.userJourneys.getProgress(uniqueId));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // User Identities Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listUserIdentities(params?: ListUserIdentitiesParams): Observable<PageResult<UserIdentity>> {\n return from(this.block.userIdentities.list(params));\n }\n\n getUserIdentity(uniqueId: string): Observable<UserIdentity> {\n return from(this.block.userIdentities.get(uniqueId));\n }\n\n createUserIdentity(request: CreateUserIdentityRequest): Observable<UserIdentity> {\n return from(this.block.userIdentities.create(request));\n }\n\n verifyUserIdentity(uniqueId: string, request: VerifyUserIdentityRequest): Observable<UserIdentity> {\n return from(this.block.userIdentities.verify(uniqueId, request));\n }\n\n deleteUserIdentity(uniqueId: string): Observable<void> {\n return from(this.block.userIdentities.delete(uniqueId));\n }\n\n listIdentitiesByUser(userUniqueId: string): Observable<UserIdentity[]> {\n return from(this.block.userIdentities.listByUser(userUniqueId));\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(): OnboardingBlock {\n return this.block;\n }\n}\n"],"names":["Injectable","Inject","from","createOnboardingBlock","TRANSPORT","ONBOARDING_CONFIG","OnboardingService","listOnboardings","params","block","onboardings","list","getOnboarding","uniqueId","get","createOnboarding","request","create","updateOnboarding","update","deleteOnboarding","delete","listFlows","flows","getFlow","createFlow","updateFlow","deleteFlow","listFlowsByOnboarding","onboardingUniqueId","listByOnboarding","listUserJourneys","userJourneys","getUserJourney","startJourney","start","completeStep","abandonJourney","abandon","getJourneysByUser","userUniqueId","getByUser","getJourneyProgress","getProgress","listUserIdentities","userIdentities","getUserIdentity","createUserIdentity","verifyUserIdentity","verify","deleteUserIdentity","listIdentitiesByUser","listByUser","rawBlock","constructor","transport","config","providedIn"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;AAAA,SAASA,UAAU,EAAEC,MAAM,QAAQ,gBAAgB;AACnD,SAAqBC,IAAI,QAAQ,OAAO;AAExC,SACEC,qBAAqB,QAmBhB,6BAA6B;AACpC,SAASC,SAAS,EAAEC,iBAAiB,QAAQ,eAAe;AA0B5D,OAAO,MAAMC;IAUX,gFAAgF;IAChF,sBAAsB;IACtB,gFAAgF;IAEhFC,gBAAgBC,MAA8B,EAAsC;QAClF,O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KAAK,IAAI,CAACO,KAAK,CAACoC,cAAc,CAACI,MAAM,CAACpC,UAAUG;IACzD;IAEAkC,mBAAmBrC,QAAgB,EAAoB;QACrD,OAAOX,KAAK,IAAI,CAACO,KAAK,CAACoC,cAAc,CAACxB,MAAM,CAACR;IAC/C;IAEAsC,qBAAqBX,YAAoB,EAA8B;QACrE,OAAOtC,KAAK,IAAI,CAACO,KAAK,CAACoC,cAAc,CAACO,UAAU,CAACZ;IACnD;IAEA,gFAAgF;IAChF,2CAA2C;IAC3C,gFAAgF;IAEhF;;;GAGC,GACD,IAAIa,WAA4B;QAC9B,OAAO,IAAI,CAAC5C,KAAK;IACnB;IAjIA6C,YACE,AAAmBC,SAAoB,EACvC,AAA2BC,MAA6B,CACxD;QACA,IAAI,CAAC/C,KAAK,GAAGN,sBAAsBoD,WAAWC;IAChD;AA6HF;AArIalD;IADZN,WAAW;QAAEyD,YAAY;IAAO;IAK5BxD,aAAAA,OAAOG;IACPH,aAAAA,OAAOI;;;eADsB,qCAAA;eACK,iDAAA;;GAL1BC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/products/index.ts"],"sourcesContent":["export * from './products.service';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,qBAAqB"}
|
|
@@ -0,0 +1,242 @@
|
|
|
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 { createProductsBlock } from '@23blocks/block-products';
|
|
7
|
+
import { TRANSPORT, PRODUCTS_CONFIG } from '../tokens.js';
|
|
8
|
+
export class ProductsService {
|
|
9
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
10
|
+
// Products Service
|
|
11
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
12
|
+
listProducts(params) {
|
|
13
|
+
return from(this.block.products.list(params));
|
|
14
|
+
}
|
|
15
|
+
getProduct(uniqueId) {
|
|
16
|
+
return from(this.block.products.get(uniqueId));
|
|
17
|
+
}
|
|
18
|
+
createProduct(data) {
|
|
19
|
+
return from(this.block.products.create(data));
|
|
20
|
+
}
|
|
21
|
+
updateProduct(uniqueId, data) {
|
|
22
|
+
return from(this.block.products.update(uniqueId, data));
|
|
23
|
+
}
|
|
24
|
+
deleteProduct(uniqueId) {
|
|
25
|
+
return from(this.block.products.delete(uniqueId));
|
|
26
|
+
}
|
|
27
|
+
recoverProduct(uniqueId) {
|
|
28
|
+
return from(this.block.products.recover(uniqueId));
|
|
29
|
+
}
|
|
30
|
+
searchProducts(query, params) {
|
|
31
|
+
return from(this.block.products.search(query, params));
|
|
32
|
+
}
|
|
33
|
+
listDeletedProducts(params) {
|
|
34
|
+
return from(this.block.products.listDeleted(params));
|
|
35
|
+
}
|
|
36
|
+
// Variations
|
|
37
|
+
listVariations(productUniqueId) {
|
|
38
|
+
return from(this.block.products.listVariations(productUniqueId));
|
|
39
|
+
}
|
|
40
|
+
getVariation(uniqueId) {
|
|
41
|
+
return from(this.block.products.getVariation(uniqueId));
|
|
42
|
+
}
|
|
43
|
+
createVariation(data) {
|
|
44
|
+
return from(this.block.products.createVariation(data));
|
|
45
|
+
}
|
|
46
|
+
updateVariation(uniqueId, data) {
|
|
47
|
+
return from(this.block.products.updateVariation(uniqueId, data));
|
|
48
|
+
}
|
|
49
|
+
deleteVariation(uniqueId) {
|
|
50
|
+
return from(this.block.products.deleteVariation(uniqueId));
|
|
51
|
+
}
|
|
52
|
+
// Images
|
|
53
|
+
listImages(productUniqueId) {
|
|
54
|
+
return from(this.block.products.listImages(productUniqueId));
|
|
55
|
+
}
|
|
56
|
+
addImage(productUniqueId, imageUrl, isPrimary) {
|
|
57
|
+
return from(this.block.products.addImage(productUniqueId, imageUrl, isPrimary));
|
|
58
|
+
}
|
|
59
|
+
deleteImage(uniqueId) {
|
|
60
|
+
return from(this.block.products.deleteImage(uniqueId));
|
|
61
|
+
}
|
|
62
|
+
// Stock
|
|
63
|
+
getStock(productUniqueId, vendorUniqueId) {
|
|
64
|
+
return from(this.block.products.getStock(productUniqueId, vendorUniqueId));
|
|
65
|
+
}
|
|
66
|
+
updateStock(productUniqueId, vendorUniqueId, warehouseUniqueId, quantity) {
|
|
67
|
+
return from(this.block.products.updateStock(productUniqueId, vendorUniqueId, warehouseUniqueId, quantity));
|
|
68
|
+
}
|
|
69
|
+
// Reviews
|
|
70
|
+
listReviews(productUniqueId) {
|
|
71
|
+
return from(this.block.products.listReviews(productUniqueId));
|
|
72
|
+
}
|
|
73
|
+
addReview(productUniqueId, rating, title, content) {
|
|
74
|
+
return from(this.block.products.addReview(productUniqueId, rating, title, content));
|
|
75
|
+
}
|
|
76
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
77
|
+
// Cart Service
|
|
78
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
79
|
+
getCart(userUniqueId) {
|
|
80
|
+
return from(this.block.cart.get(userUniqueId));
|
|
81
|
+
}
|
|
82
|
+
getOrCreateCart(userUniqueId) {
|
|
83
|
+
return from(this.block.cart.getOrCreate(userUniqueId));
|
|
84
|
+
}
|
|
85
|
+
updateCart(userUniqueId, data) {
|
|
86
|
+
return from(this.block.cart.update(userUniqueId, data));
|
|
87
|
+
}
|
|
88
|
+
deleteCart(userUniqueId) {
|
|
89
|
+
return from(this.block.cart.delete(userUniqueId));
|
|
90
|
+
}
|
|
91
|
+
// Cart Items
|
|
92
|
+
addCartItem(userUniqueId, item) {
|
|
93
|
+
return from(this.block.cart.addItem(userUniqueId, item));
|
|
94
|
+
}
|
|
95
|
+
updateCartItem(userUniqueId, productUniqueId, data) {
|
|
96
|
+
return from(this.block.cart.updateItem(userUniqueId, productUniqueId, data));
|
|
97
|
+
}
|
|
98
|
+
removeCartItem(userUniqueId, productUniqueId) {
|
|
99
|
+
return from(this.block.cart.removeItem(userUniqueId, productUniqueId));
|
|
100
|
+
}
|
|
101
|
+
getCartItems(userUniqueId) {
|
|
102
|
+
return from(this.block.cart.getItems(userUniqueId));
|
|
103
|
+
}
|
|
104
|
+
// Checkout
|
|
105
|
+
checkout(userUniqueId, data) {
|
|
106
|
+
return from(this.block.cart.checkout(userUniqueId, data));
|
|
107
|
+
}
|
|
108
|
+
orderCart(userUniqueId) {
|
|
109
|
+
return from(this.block.cart.order(userUniqueId));
|
|
110
|
+
}
|
|
111
|
+
orderCartItem(userUniqueId, productUniqueId) {
|
|
112
|
+
return from(this.block.cart.orderItem(userUniqueId, productUniqueId));
|
|
113
|
+
}
|
|
114
|
+
cancelCart(userUniqueId) {
|
|
115
|
+
return from(this.block.cart.cancel(userUniqueId));
|
|
116
|
+
}
|
|
117
|
+
cancelCartItem(userUniqueId, productUniqueId) {
|
|
118
|
+
return from(this.block.cart.cancelItem(userUniqueId, productUniqueId));
|
|
119
|
+
}
|
|
120
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
121
|
+
// Categories Service
|
|
122
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
123
|
+
listCategories(params) {
|
|
124
|
+
return from(this.block.categories.list(params));
|
|
125
|
+
}
|
|
126
|
+
getCategory(uniqueId) {
|
|
127
|
+
return from(this.block.categories.get(uniqueId));
|
|
128
|
+
}
|
|
129
|
+
createCategory(data) {
|
|
130
|
+
return from(this.block.categories.create(data));
|
|
131
|
+
}
|
|
132
|
+
updateCategory(uniqueId, data) {
|
|
133
|
+
return from(this.block.categories.update(uniqueId, data));
|
|
134
|
+
}
|
|
135
|
+
deleteCategory(uniqueId) {
|
|
136
|
+
return from(this.block.categories.delete(uniqueId));
|
|
137
|
+
}
|
|
138
|
+
recoverCategory(uniqueId) {
|
|
139
|
+
return from(this.block.categories.recover(uniqueId));
|
|
140
|
+
}
|
|
141
|
+
getCategoryChildren(uniqueId) {
|
|
142
|
+
return from(this.block.categories.getChildren(uniqueId));
|
|
143
|
+
}
|
|
144
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
145
|
+
// Brands Service
|
|
146
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
147
|
+
listBrands(page, perPage) {
|
|
148
|
+
return from(this.block.brands.list(page, perPage));
|
|
149
|
+
}
|
|
150
|
+
getBrand(uniqueId) {
|
|
151
|
+
return from(this.block.brands.get(uniqueId));
|
|
152
|
+
}
|
|
153
|
+
createBrand(data) {
|
|
154
|
+
return from(this.block.brands.create(data));
|
|
155
|
+
}
|
|
156
|
+
updateBrand(uniqueId, data) {
|
|
157
|
+
return from(this.block.brands.update(uniqueId, data));
|
|
158
|
+
}
|
|
159
|
+
deleteBrand(uniqueId) {
|
|
160
|
+
return from(this.block.brands.delete(uniqueId));
|
|
161
|
+
}
|
|
162
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
163
|
+
// Vendors Service
|
|
164
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
165
|
+
listVendors(params) {
|
|
166
|
+
return from(this.block.vendors.list(params));
|
|
167
|
+
}
|
|
168
|
+
getVendor(uniqueId) {
|
|
169
|
+
return from(this.block.vendors.get(uniqueId));
|
|
170
|
+
}
|
|
171
|
+
createVendor(data) {
|
|
172
|
+
return from(this.block.vendors.create(data));
|
|
173
|
+
}
|
|
174
|
+
updateVendor(uniqueId, data) {
|
|
175
|
+
return from(this.block.vendors.update(uniqueId, data));
|
|
176
|
+
}
|
|
177
|
+
deleteVendor(uniqueId) {
|
|
178
|
+
return from(this.block.vendors.delete(uniqueId));
|
|
179
|
+
}
|
|
180
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
181
|
+
// Warehouses Service
|
|
182
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
183
|
+
listWarehouses(params) {
|
|
184
|
+
return from(this.block.warehouses.list(params));
|
|
185
|
+
}
|
|
186
|
+
getWarehouse(uniqueId) {
|
|
187
|
+
return from(this.block.warehouses.get(uniqueId));
|
|
188
|
+
}
|
|
189
|
+
createWarehouse(data) {
|
|
190
|
+
return from(this.block.warehouses.create(data));
|
|
191
|
+
}
|
|
192
|
+
updateWarehouse(uniqueId, data) {
|
|
193
|
+
return from(this.block.warehouses.update(uniqueId, data));
|
|
194
|
+
}
|
|
195
|
+
deleteWarehouse(uniqueId) {
|
|
196
|
+
return from(this.block.warehouses.delete(uniqueId));
|
|
197
|
+
}
|
|
198
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
199
|
+
// Channels Service
|
|
200
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
201
|
+
listChannels() {
|
|
202
|
+
return from(this.block.channels.list());
|
|
203
|
+
}
|
|
204
|
+
getChannel(uniqueId) {
|
|
205
|
+
return from(this.block.channels.get(uniqueId));
|
|
206
|
+
}
|
|
207
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
208
|
+
// Collections Service
|
|
209
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
210
|
+
listCollections() {
|
|
211
|
+
return from(this.block.collections.list());
|
|
212
|
+
}
|
|
213
|
+
getCollection(uniqueId) {
|
|
214
|
+
return from(this.block.collections.get(uniqueId));
|
|
215
|
+
}
|
|
216
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
217
|
+
// Direct Block Access (for advanced usage)
|
|
218
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
219
|
+
/**
|
|
220
|
+
* Access the underlying block for advanced operations
|
|
221
|
+
* Use this when you need access to services not wrapped by this Angular service
|
|
222
|
+
*/ get rawBlock() {
|
|
223
|
+
return this.block;
|
|
224
|
+
}
|
|
225
|
+
constructor(transport, config){
|
|
226
|
+
this.block = createProductsBlock(transport, config);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
ProductsService = _ts_decorate([
|
|
230
|
+
Injectable({
|
|
231
|
+
providedIn: 'root'
|
|
232
|
+
}),
|
|
233
|
+
_ts_param(0, Inject(TRANSPORT)),
|
|
234
|
+
_ts_param(1, Inject(PRODUCTS_CONFIG)),
|
|
235
|
+
_ts_metadata("design:type", Function),
|
|
236
|
+
_ts_metadata("design:paramtypes", [
|
|
237
|
+
typeof Transport === "undefined" ? Object : Transport,
|
|
238
|
+
typeof ProductsBlockConfig === "undefined" ? Object : ProductsBlockConfig
|
|
239
|
+
])
|
|
240
|
+
], ProductsService);
|
|
241
|
+
|
|
242
|
+
//# sourceMappingURL=products.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/products/products.service.ts"],"sourcesContent":["import { Injectable, Inject } from '@angular/core';\nimport { Observable, from } from 'rxjs';\nimport type { Transport, PageResult } from '@23blocks/contracts';\nimport {\n createProductsBlock,\n type ProductsBlock,\n type ProductsBlockConfig,\n type Product,\n type ProductVariation,\n type ProductImage,\n type ProductStock,\n type ProductReview,\n type CreateProductRequest,\n type UpdateProductRequest,\n type ListProductsParams,\n type CreateVariationRequest,\n type UpdateVariationRequest,\n type Cart,\n type CartDetail,\n type AddToCartRequest,\n type UpdateCartItemRequest,\n type UpdateCartRequest,\n type CheckoutRequest,\n type Category,\n type Brand,\n type Vendor,\n type Warehouse,\n type Channel,\n type Collection,\n type CreateCategoryRequest,\n type UpdateCategoryRequest,\n type CreateBrandRequest,\n type UpdateBrandRequest,\n type CreateVendorRequest,\n type UpdateVendorRequest,\n type CreateWarehouseRequest,\n type UpdateWarehouseRequest,\n type ListCategoriesParams,\n type ListVendorsParams,\n type ListWarehousesParams,\n} from '@23blocks/block-products';\nimport { TRANSPORT, PRODUCTS_CONFIG } from '../tokens.js';\n\n/**\n * Angular service wrapping the Products block.\n * Converts Promise-based APIs to RxJS Observables.\n *\n * @example\n * ```typescript\n * @Component({...})\n * export class ProductsComponent {\n * constructor(private products: ProductsService) {}\n *\n * loadProducts() {\n * this.products.listProducts().subscribe({\n * next: (result) => console.log('Products:', result.data),\n * error: (err) => console.error('Failed:', err),\n * });\n * }\n * }\n * ```\n */\n@Injectable({ providedIn: 'root' })\nexport class ProductsService {\n private readonly block: ProductsBlock;\n\n constructor(\n @Inject(TRANSPORT) transport: Transport,\n @Inject(PRODUCTS_CONFIG) config: ProductsBlockConfig\n ) {\n this.block = createProductsBlock(transport, config);\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Products Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listProducts(params?: ListProductsParams): Observable<PageResult<Product>> {\n return from(this.block.products.list(params));\n }\n\n getProduct(uniqueId: string): Observable<Product> {\n return from(this.block.products.get(uniqueId));\n }\n\n createProduct(data: CreateProductRequest): Observable<Product> {\n return from(this.block.products.create(data));\n }\n\n updateProduct(uniqueId: string, data: UpdateProductRequest): Observable<Product> {\n return from(this.block.products.update(uniqueId, data));\n }\n\n deleteProduct(uniqueId: string): Observable<void> {\n return from(this.block.products.delete(uniqueId));\n }\n\n recoverProduct(uniqueId: string): Observable<Product> {\n return from(this.block.products.recover(uniqueId));\n }\n\n searchProducts(query: string, params?: ListProductsParams): Observable<PageResult<Product>> {\n return from(this.block.products.search(query, params));\n }\n\n listDeletedProducts(params?: ListProductsParams): Observable<PageResult<Product>> {\n return from(this.block.products.listDeleted(params));\n }\n\n // Variations\n listVariations(productUniqueId: string): Observable<ProductVariation[]> {\n return from(this.block.products.listVariations(productUniqueId));\n }\n\n getVariation(uniqueId: string): Observable<ProductVariation> {\n return from(this.block.products.getVariation(uniqueId));\n }\n\n createVariation(data: CreateVariationRequest): Observable<ProductVariation> {\n return from(this.block.products.createVariation(data));\n }\n\n updateVariation(uniqueId: string, data: UpdateVariationRequest): Observable<ProductVariation> {\n return from(this.block.products.updateVariation(uniqueId, data));\n }\n\n deleteVariation(uniqueId: string): Observable<void> {\n return from(this.block.products.deleteVariation(uniqueId));\n }\n\n // Images\n listImages(productUniqueId: string): Observable<ProductImage[]> {\n return from(this.block.products.listImages(productUniqueId));\n }\n\n addImage(productUniqueId: string, imageUrl: string, isPrimary?: boolean): Observable<ProductImage> {\n return from(this.block.products.addImage(productUniqueId, imageUrl, isPrimary));\n }\n\n deleteImage(uniqueId: string): Observable<void> {\n return from(this.block.products.deleteImage(uniqueId));\n }\n\n // Stock\n getStock(productUniqueId: string, vendorUniqueId?: string): Observable<ProductStock[]> {\n return from(this.block.products.getStock(productUniqueId, vendorUniqueId));\n }\n\n updateStock(\n productUniqueId: string,\n vendorUniqueId: string,\n warehouseUniqueId: string,\n quantity: number\n ): Observable<ProductStock> {\n return from(this.block.products.updateStock(productUniqueId, vendorUniqueId, warehouseUniqueId, quantity));\n }\n\n // Reviews\n listReviews(productUniqueId: string): Observable<PageResult<ProductReview>> {\n return from(this.block.products.listReviews(productUniqueId));\n }\n\n addReview(\n productUniqueId: string,\n rating: number,\n title?: string,\n content?: string\n ): Observable<ProductReview> {\n return from(this.block.products.addReview(productUniqueId, rating, title, content));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Cart Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n getCart(userUniqueId: string): Observable<Cart> {\n return from(this.block.cart.get(userUniqueId));\n }\n\n getOrCreateCart(userUniqueId: string): Observable<Cart> {\n return from(this.block.cart.getOrCreate(userUniqueId));\n }\n\n updateCart(userUniqueId: string, data: UpdateCartRequest): Observable<Cart> {\n return from(this.block.cart.update(userUniqueId, data));\n }\n\n deleteCart(userUniqueId: string): Observable<void> {\n return from(this.block.cart.delete(userUniqueId));\n }\n\n // Cart Items\n addCartItem(userUniqueId: string, item: AddToCartRequest): Observable<Cart> {\n return from(this.block.cart.addItem(userUniqueId, item));\n }\n\n updateCartItem(userUniqueId: string, productUniqueId: string, data: UpdateCartItemRequest): Observable<Cart> {\n return from(this.block.cart.updateItem(userUniqueId, productUniqueId, data));\n }\n\n removeCartItem(userUniqueId: string, productUniqueId: string): Observable<Cart> {\n return from(this.block.cart.removeItem(userUniqueId, productUniqueId));\n }\n\n getCartItems(userUniqueId: string): Observable<CartDetail[]> {\n return from(this.block.cart.getItems(userUniqueId));\n }\n\n // Checkout\n checkout(userUniqueId: string, data?: CheckoutRequest): Observable<Cart> {\n return from(this.block.cart.checkout(userUniqueId, data));\n }\n\n orderCart(userUniqueId: string): Observable<{ cart: Cart; orderUniqueId: string }> {\n return from(this.block.cart.order(userUniqueId));\n }\n\n orderCartItem(userUniqueId: string, productUniqueId: string): Observable<{ cart: Cart; orderUniqueId: string }> {\n return from(this.block.cart.orderItem(userUniqueId, productUniqueId));\n }\n\n cancelCart(userUniqueId: string): Observable<Cart> {\n return from(this.block.cart.cancel(userUniqueId));\n }\n\n cancelCartItem(userUniqueId: string, productUniqueId: string): Observable<Cart> {\n return from(this.block.cart.cancelItem(userUniqueId, productUniqueId));\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 // Brands Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listBrands(page?: number, perPage?: number): Observable<PageResult<Brand>> {\n return from(this.block.brands.list(page, perPage));\n }\n\n getBrand(uniqueId: string): Observable<Brand> {\n return from(this.block.brands.get(uniqueId));\n }\n\n createBrand(data: CreateBrandRequest): Observable<Brand> {\n return from(this.block.brands.create(data));\n }\n\n updateBrand(uniqueId: string, data: UpdateBrandRequest): Observable<Brand> {\n return from(this.block.brands.update(uniqueId, data));\n }\n\n deleteBrand(uniqueId: string): Observable<void> {\n return from(this.block.brands.delete(uniqueId));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Vendors Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listVendors(params?: ListVendorsParams): Observable<PageResult<Vendor>> {\n return from(this.block.vendors.list(params));\n }\n\n getVendor(uniqueId: string): Observable<Vendor> {\n return from(this.block.vendors.get(uniqueId));\n }\n\n createVendor(data: CreateVendorRequest): Observable<Vendor> {\n return from(this.block.vendors.create(data));\n }\n\n updateVendor(uniqueId: string, data: UpdateVendorRequest): Observable<Vendor> {\n return from(this.block.vendors.update(uniqueId, data));\n }\n\n deleteVendor(uniqueId: string): Observable<void> {\n return from(this.block.vendors.delete(uniqueId));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Warehouses Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listWarehouses(params?: ListWarehousesParams): Observable<PageResult<Warehouse>> {\n return from(this.block.warehouses.list(params));\n }\n\n getWarehouse(uniqueId: string): Observable<Warehouse> {\n return from(this.block.warehouses.get(uniqueId));\n }\n\n createWarehouse(data: CreateWarehouseRequest): Observable<Warehouse> {\n return from(this.block.warehouses.create(data));\n }\n\n updateWarehouse(uniqueId: string, data: UpdateWarehouseRequest): Observable<Warehouse> {\n return from(this.block.warehouses.update(uniqueId, data));\n }\n\n deleteWarehouse(uniqueId: string): Observable<void> {\n return from(this.block.warehouses.delete(uniqueId));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Channels Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listChannels(): Observable<Channel[]> {\n return from(this.block.channels.list());\n }\n\n getChannel(uniqueId: string): Observable<Channel> {\n return from(this.block.channels.get(uniqueId));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Collections Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listCollections(): Observable<Collection[]> {\n return from(this.block.collections.list());\n }\n\n getCollection(uniqueId: string): Observable<Collection> {\n return from(this.block.collections.get(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(): ProductsBlock {\n return this.block;\n }\n}\n"],"names":["Injectable","Inject","from","createProductsBlock","TRANSPORT","PRODUCTS_CONFIG","ProductsService","listProducts","params","block","products","list","getProduct","uniqueId","get","createProduct","data","create","updateProduct","update","deleteProduct","delete","recoverProduct","recover","searchProducts","query","search","listDeletedProducts","listDeleted","listVariations","productUniqueId","getVariation","createVariation","updateVariation","deleteVariation","listImages","addImage","imageUrl","isPrimary","deleteImage","getStock","vendorUniqueId","updateStock","warehouseUniqueId","quantity","listReviews","addReview","rating","title","content","getCart","userUniqueId","cart","getOrCreateCart","getOrCreate","updateCart","deleteCart","addCartItem","item","addItem","updateCartItem","updateItem","removeCartItem","removeItem","getCartItems","getItems","checkout","orderCart","order","orderCartItem","orderItem","cancelCart","cancel","cancelCartItem","cancelItem","listCategories","categories","getCategory","createCategory","updateCategory","deleteCategory","recoverCategory","getCategoryChildren","getChildren","listBrands","page","perPage","brands","getBrand","createBrand","updateBrand","deleteBrand","listVendors","vendors","getVendor","createVendor","updateVendor","deleteVendor","listWarehouses","warehouses","getWarehouse","createWarehouse","updateWarehouse","deleteWarehouse","listChannels","channels","getChannel","listCollections","collections","getCollection","rawBlock","constructor","transport","config","providedIn"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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