@23blocks/angular 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/assets/assets.service.js +110 -0
- package/dist/lib/assets/assets.service.js.map +1 -0
- package/dist/lib/assets/index.js +3 -0
- package/dist/lib/assets/index.js.map +1 -0
- package/dist/lib/campaigns/campaigns.service.js +137 -0
- package/dist/lib/campaigns/campaigns.service.js.map +1 -0
- package/dist/lib/campaigns/index.js +3 -0
- package/dist/lib/campaigns/index.js.map +1 -0
- package/dist/lib/company/company.service.js +137 -0
- package/dist/lib/company/company.service.js.map +1 -0
- package/dist/lib/company/index.js +3 -0
- package/dist/lib/company/index.js.map +1 -0
- package/dist/lib/content/content.service.js +140 -0
- package/dist/lib/content/content.service.js.map +1 -0
- package/dist/lib/content/index.js +3 -0
- package/dist/lib/content/index.js.map +1 -0
- package/dist/lib/conversations/conversations.service.js +164 -0
- package/dist/lib/conversations/conversations.service.js.map +1 -0
- package/dist/lib/conversations/index.js +3 -0
- package/dist/lib/conversations/index.js.map +1 -0
- package/dist/lib/crm/crm.service.js +197 -0
- package/dist/lib/crm/crm.service.js.map +1 -0
- package/dist/lib/crm/index.js +3 -0
- package/dist/lib/crm/index.js.map +1 -0
- package/dist/lib/files/files.service.js +107 -0
- package/dist/lib/files/files.service.js.map +1 -0
- package/dist/lib/files/index.js +3 -0
- package/dist/lib/files/index.js.map +1 -0
- package/dist/lib/forms/forms.service.js +119 -0
- package/dist/lib/forms/forms.service.js.map +1 -0
- package/dist/lib/forms/index.js +3 -0
- package/dist/lib/forms/index.js.map +1 -0
- package/dist/lib/geolocation/geolocation.service.js +227 -0
- package/dist/lib/geolocation/geolocation.service.js.map +1 -0
- package/dist/lib/geolocation/index.js +3 -0
- package/dist/lib/geolocation/index.js.map +1 -0
- package/dist/lib/index.js +17 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/jarvis/index.js +3 -0
- package/dist/lib/jarvis/index.js.map +1 -0
- package/dist/lib/jarvis/jarvis.service.js +149 -0
- package/dist/lib/jarvis/jarvis.service.js.map +1 -0
- package/dist/lib/onboarding/index.js +3 -0
- package/dist/lib/onboarding/index.js.map +1 -0
- package/dist/lib/onboarding/onboarding.service.js +119 -0
- package/dist/lib/onboarding/onboarding.service.js.map +1 -0
- package/dist/lib/products/index.js +3 -0
- package/dist/lib/products/index.js.map +1 -0
- package/dist/lib/products/products.service.js +242 -0
- package/dist/lib/products/products.service.js.map +1 -0
- package/dist/lib/providers.js +195 -1
- package/dist/lib/providers.js.map +1 -1
- package/dist/lib/rewards/index.js +3 -0
- package/dist/lib/rewards/index.js.map +1 -0
- package/dist/lib/rewards/rewards.service.js +125 -0
- package/dist/lib/rewards/rewards.service.js.map +1 -0
- package/dist/lib/sales/index.js +3 -0
- package/dist/lib/sales/index.js.map +1 -0
- package/dist/lib/sales/sales.service.js +125 -0
- package/dist/lib/sales/sales.service.js.map +1 -0
- package/dist/lib/tokens.js +48 -0
- package/dist/lib/tokens.js.map +1 -1
- package/dist/lib/university/index.js +3 -0
- package/dist/lib/university/index.js.map +1 -0
- package/dist/lib/university/university.service.js +161 -0
- package/dist/lib/university/university.service.js.map +1 -0
- package/dist/lib/wallet/index.js +3 -0
- package/dist/lib/wallet/index.js.map +1 -0
- package/dist/lib/wallet/wallet.service.js +98 -0
- package/dist/lib/wallet/wallet.service.js.map +1 -0
- package/package.json +19 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/sales/sales.service.ts"],"sourcesContent":["import { Injectable, Inject } from '@angular/core';\nimport { Observable, from } from 'rxjs';\nimport type { Transport, PageResult } from '@23blocks/contracts';\nimport {\n createSalesBlock,\n type SalesBlock,\n type SalesBlockConfig,\n type Order,\n type OrderStatus,\n type CreateOrderRequest,\n type UpdateOrderRequest,\n type ListOrdersParams,\n type OrderDetail,\n type UpdateOrderDetailRequest,\n type Payment,\n type PaymentStatus,\n type CreatePaymentRequest,\n type ListPaymentsParams,\n type Subscription,\n type SubscriptionInterval,\n type SubscriptionStatus,\n type CreateSubscriptionRequest,\n type UpdateSubscriptionRequest,\n type ListSubscriptionsParams,\n} from '@23blocks/block-sales';\nimport { TRANSPORT, SALES_CONFIG } from '../tokens.js';\n\n/**\n * Angular service wrapping the Sales block.\n * Converts Promise-based APIs to RxJS Observables.\n *\n * @example\n * ```typescript\n * @Component({...})\n * export class CheckoutComponent {\n * constructor(private sales: SalesService) {}\n *\n * createOrder(items: any[]) {\n * this.sales.createOrder({ userUniqueId: '123', items }).subscribe({\n * next: (order) => console.log('Order created:', order),\n * error: (err) => console.error('Failed:', err),\n * });\n * }\n * }\n * ```\n */\n@Injectable({ providedIn: 'root' })\nexport class SalesService {\n private readonly block: SalesBlock;\n\n constructor(\n @Inject(TRANSPORT) transport: Transport,\n @Inject(SALES_CONFIG) config: SalesBlockConfig\n ) {\n this.block = createSalesBlock(transport, config);\n }\n\n // ───────────────────────────────────────────────────────────────────────────\n // Orders Service\n // ───────────────────────────────────────────────────────────────────────────\n\n listOrders(params?: ListOrdersParams): Observable<PageResult<Order>> {\n return from(this.block.orders.list(params));\n }\n\n getOrder(uniqueId: string): Observable<Order> {\n return from(this.block.orders.get(uniqueId));\n }\n\n createOrder(data: CreateOrderRequest): Observable<Order> {\n return from(this.block.orders.create(data));\n }\n\n updateOrder(uniqueId: string, data: UpdateOrderRequest): Observable<Order> {\n return from(this.block.orders.update(uniqueId, data));\n }\n\n cancelOrder(uniqueId: string): Observable<Order> {\n return from(this.block.orders.cancel(uniqueId));\n }\n\n confirmOrder(uniqueId: string): Observable<Order> {\n return from(this.block.orders.confirm(uniqueId));\n }\n\n shipOrder(uniqueId: string, trackingNumber?: string): Observable<Order> {\n return from(this.block.orders.ship(uniqueId, trackingNumber));\n }\n\n deliverOrder(uniqueId: string): Observable<Order> {\n return from(this.block.orders.deliver(uniqueId));\n }\n\n listOrdersByUser(userUniqueId: string, params?: ListOrdersParams): Observable<PageResult<Order>> {\n return from(this.block.orders.listByUser(userUniqueId, params));\n }\n\n // ───────────────────────────────────────────────────────────────────────────\n // Order Details Service\n // ───────────────────────────────────────────────────────────────────────────\n\n listOrderDetails(): Observable<OrderDetail[]> {\n return from(this.block.orderDetails.list());\n }\n\n getOrderDetail(uniqueId: string): Observable<OrderDetail> {\n return from(this.block.orderDetails.get(uniqueId));\n }\n\n updateOrderDetail(uniqueId: string, data: UpdateOrderDetailRequest): Observable<OrderDetail> {\n return from(this.block.orderDetails.update(uniqueId, data));\n }\n\n listOrderDetailsByOrder(orderUniqueId: string): Observable<OrderDetail[]> {\n return from(this.block.orderDetails.listByOrder(orderUniqueId));\n }\n\n // ───────────────────────────────────────────────────────────────────────────\n // Payments Service\n // ───────────────────────────────────────────────────────────────────────────\n\n listPayments(params?: ListPaymentsParams): Observable<PageResult<Payment>> {\n return from(this.block.payments.list(params));\n }\n\n getPayment(uniqueId: string): Observable<Payment> {\n return from(this.block.payments.get(uniqueId));\n }\n\n createPayment(data: CreatePaymentRequest): Observable<Payment> {\n return from(this.block.payments.create(data));\n }\n\n refundPayment(uniqueId: string, amount?: number): Observable<Payment> {\n return from(this.block.payments.refund(uniqueId, amount));\n }\n\n listPaymentsByOrder(orderUniqueId: string): Observable<Payment[]> {\n return from(this.block.payments.listByOrder(orderUniqueId));\n }\n\n // ───────────────────────────────────────────────────────────────────────────\n // Subscriptions Service\n // ───────────────────────────────────────────────────────────────────────────\n\n listSubscriptions(params?: ListSubscriptionsParams): Observable<PageResult<Subscription>> {\n return from(this.block.subscriptions.list(params));\n }\n\n getSubscription(uniqueId: string): Observable<Subscription> {\n return from(this.block.subscriptions.get(uniqueId));\n }\n\n createSubscription(data: CreateSubscriptionRequest): Observable<Subscription> {\n return from(this.block.subscriptions.create(data));\n }\n\n updateSubscription(uniqueId: string, data: UpdateSubscriptionRequest): Observable<Subscription> {\n return from(this.block.subscriptions.update(uniqueId, data));\n }\n\n cancelSubscription(uniqueId: string): Observable<Subscription> {\n return from(this.block.subscriptions.cancel(uniqueId));\n }\n\n pauseSubscription(uniqueId: string): Observable<Subscription> {\n return from(this.block.subscriptions.pause(uniqueId));\n }\n\n resumeSubscription(uniqueId: string): Observable<Subscription> {\n return from(this.block.subscriptions.resume(uniqueId));\n }\n\n listSubscriptionsByUser(userUniqueId: string, params?: ListSubscriptionsParams): Observable<PageResult<Subscription>> {\n return from(this.block.subscriptions.listByUser(userUniqueId, 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(): SalesBlock {\n return this.block;\n }\n}\n"],"names":["Injectable","Inject","from","createSalesBlock","TRANSPORT","SALES_CONFIG","SalesService","listOrders","params","block","orders","list","getOrder","uniqueId","get","createOrder","data","create","updateOrder","update","cancelOrder","cancel","confirmOrder","confirm","shipOrder","trackingNumber","ship","deliverOrder","deliver","listOrdersByUser","userUniqueId","listByUser","listOrderDetails","orderDetails","getOrderDetail","updateOrderDetail","listOrderDetailsByOrder","orderUniqueId","listByOrder","listPayments","payments","getPayment","createPayment","refundPayment","amount","refund","listPaymentsByOrder","listSubscriptions","subscriptions","getSubscription","createSubscription","updateSubscription","cancelSubscription","pauseSubscription","pause","resumeSubscription","resume","listSubscriptionsByUser","rawBlock","constructor","transport","config","providedIn"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;AAAA,SAASA,UAAU,EAAEC,MAAM,QAAQ,gBAAgB;AACnD,SAAqBC,IAAI,QAAQ,OAAO;AAExC,SACEC,gBAAgB,QAoBX,wBAAwB;AAC/B,SAASC,SAAS,EAAEC,YAAY,QAAQ,eAAe;AAsBvD,OAAO,MAAMC;IAUX,8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O,KAAK,CAACuC,aAAa,CAAC/B,MAAM,CAACD;IAC9C;IAEAmC,mBAAmBtC,QAAgB,EAAEG,IAA+B,EAA4B;QAC9F,OAAOd,KAAK,IAAI,CAACO,KAAK,CAACuC,aAAa,CAAC7B,MAAM,CAACN,UAAUG;IACxD;IAEAoC,mBAAmBvC,QAAgB,EAA4B;QAC7D,OAAOX,KAAK,IAAI,CAACO,KAAK,CAACuC,aAAa,CAAC3B,MAAM,CAACR;IAC9C;IAEAwC,kBAAkBxC,QAAgB,EAA4B;QAC5D,OAAOX,KAAK,IAAI,CAACO,KAAK,CAACuC,aAAa,CAACM,KAAK,CAACzC;IAC7C;IAEA0C,mBAAmB1C,QAAgB,EAA4B;QAC7D,OAAOX,KAAK,IAAI,CAACO,KAAK,CAACuC,aAAa,CAACQ,MAAM,CAAC3C;IAC9C;IAEA4C,wBAAwB3B,YAAoB,EAAEtB,MAAgC,EAAwC;QACpH,OAAON,KAAK,IAAI,CAACO,KAAK,CAACuC,aAAa,CAACjB,UAAU,CAACD,cAActB;IAChE;IAEA,8EAA8E;IAC9E,2CAA2C;IAC3C,8EAA8E;IAE9E;;;GAGC,GACD,IAAIkD,WAAuB;QACzB,OAAO,IAAI,CAACjD,KAAK;IACnB;IAzIAkD,YACE,AAAmBC,SAAoB,EACvC,AAAsBC,MAAwB,CAC9C;QACA,IAAI,CAACpD,KAAK,GAAGN,iBAAiByD,WAAWC;IAC3C;AAqIF;AA7IavD;IADZN,WAAW;QAAE8D,YAAY;IAAO;IAK5B7D,aAAAA,OAAOG;IACPH,aAAAA,OAAOI;;;eADsB,qCAAA;eACA,4CAAA;;GALrBC"}
|
package/dist/lib/tokens.js
CHANGED
|
@@ -8,5 +8,53 @@ import { InjectionToken } from '@angular/core';
|
|
|
8
8
|
/**
|
|
9
9
|
* Injection token for Search block configuration
|
|
10
10
|
*/ export const SEARCH_CONFIG = new InjectionToken('23blocks.search.config');
|
|
11
|
+
/**
|
|
12
|
+
* Injection token for Geolocation block configuration
|
|
13
|
+
*/ export const GEOLOCATION_CONFIG = new InjectionToken('23blocks.geolocation.config');
|
|
14
|
+
/**
|
|
15
|
+
* Injection token for Content block configuration
|
|
16
|
+
*/ export const CONTENT_CONFIG = new InjectionToken('23blocks.content.config');
|
|
17
|
+
/**
|
|
18
|
+
* Injection token for CRM block configuration
|
|
19
|
+
*/ export const CRM_CONFIG = new InjectionToken('23blocks.crm.config');
|
|
20
|
+
/**
|
|
21
|
+
* Injection token for Products block configuration
|
|
22
|
+
*/ export const PRODUCTS_CONFIG = new InjectionToken('23blocks.products.config');
|
|
23
|
+
/**
|
|
24
|
+
* Injection token for Conversations block configuration
|
|
25
|
+
*/ export const CONVERSATIONS_CONFIG = new InjectionToken('23blocks.conversations.config');
|
|
26
|
+
/**
|
|
27
|
+
* Injection token for Files block configuration
|
|
28
|
+
*/ export const FILES_CONFIG = new InjectionToken('23blocks.files.config');
|
|
29
|
+
/**
|
|
30
|
+
* Injection token for Assets block configuration
|
|
31
|
+
*/ export const ASSETS_CONFIG = new InjectionToken('23blocks.assets.config');
|
|
32
|
+
/**
|
|
33
|
+
* Injection token for Forms block configuration
|
|
34
|
+
*/ export const FORMS_CONFIG = new InjectionToken('23blocks.forms.config');
|
|
35
|
+
/**
|
|
36
|
+
* Injection token for Sales block configuration
|
|
37
|
+
*/ export const SALES_CONFIG = new InjectionToken('23blocks.sales.config');
|
|
38
|
+
/**
|
|
39
|
+
* Injection token for Campaigns block configuration
|
|
40
|
+
*/ export const CAMPAIGNS_CONFIG = new InjectionToken('23blocks.campaigns.config');
|
|
41
|
+
/**
|
|
42
|
+
* Injection token for Company block configuration
|
|
43
|
+
*/ export const COMPANY_CONFIG = new InjectionToken('23blocks.company.config');
|
|
44
|
+
/**
|
|
45
|
+
* Injection token for Rewards block configuration
|
|
46
|
+
*/ export const REWARDS_CONFIG = new InjectionToken('23blocks.rewards.config');
|
|
47
|
+
/**
|
|
48
|
+
* Injection token for Jarvis block configuration
|
|
49
|
+
*/ export const JARVIS_CONFIG = new InjectionToken('23blocks.jarvis.config');
|
|
50
|
+
/**
|
|
51
|
+
* Injection token for Onboarding block configuration
|
|
52
|
+
*/ export const ONBOARDING_CONFIG = new InjectionToken('23blocks.onboarding.config');
|
|
53
|
+
/**
|
|
54
|
+
* Injection token for University block configuration
|
|
55
|
+
*/ export const UNIVERSITY_CONFIG = new InjectionToken('23blocks.university.config');
|
|
56
|
+
/**
|
|
57
|
+
* Injection token for Wallet block configuration
|
|
58
|
+
*/ export const WALLET_CONFIG = new InjectionToken('23blocks.wallet.config');
|
|
11
59
|
|
|
12
60
|
//# sourceMappingURL=tokens.js.map
|
package/dist/lib/tokens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/tokens.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport type { Transport } from '@23blocks/contracts';\nimport type { AuthenticationBlockConfig } from '@23blocks/block-authentication';\nimport type { SearchBlockConfig } from '@23blocks/block-search';\n\n/**\n * Injection token for the Transport instance\n */\nexport const TRANSPORT = new InjectionToken<Transport>('23blocks.transport');\n\n/**\n * Injection token for Authentication block configuration\n */\nexport const AUTHENTICATION_CONFIG = new InjectionToken<AuthenticationBlockConfig>(\n '23blocks.authentication.config'\n);\n\n/**\n * Injection token for Search block configuration\n */\nexport const SEARCH_CONFIG = new InjectionToken<SearchBlockConfig>(\n '23blocks.search.config'\n);\n"],"names":["InjectionToken","TRANSPORT","AUTHENTICATION_CONFIG","SEARCH_CONFIG"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/lib/tokens.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport type { Transport } from '@23blocks/contracts';\nimport type { AuthenticationBlockConfig } from '@23blocks/block-authentication';\nimport type { SearchBlockConfig } from '@23blocks/block-search';\nimport type { GeolocationBlockConfig } from '@23blocks/block-geolocation';\nimport type { ContentBlockConfig } from '@23blocks/block-content';\nimport type { CrmBlockConfig } from '@23blocks/block-crm';\nimport type { ProductsBlockConfig } from '@23blocks/block-products';\nimport type { ConversationsBlockConfig } from '@23blocks/block-conversations';\nimport type { FilesBlockConfig } from '@23blocks/block-files';\nimport type { AssetsBlockConfig } from '@23blocks/block-assets';\nimport type { FormsBlockConfig } from '@23blocks/block-forms';\nimport type { SalesBlockConfig } from '@23blocks/block-sales';\nimport type { CampaignsBlockConfig } from '@23blocks/block-campaigns';\nimport type { CompanyBlockConfig } from '@23blocks/block-company';\nimport type { RewardsBlockConfig } from '@23blocks/block-rewards';\nimport type { JarvisBlockConfig } from '@23blocks/block-jarvis';\nimport type { OnboardingBlockConfig } from '@23blocks/block-onboarding';\nimport type { UniversityBlockConfig } from '@23blocks/block-university';\nimport type { WalletBlockConfig } from '@23blocks/block-wallet';\n\n/**\n * Injection token for the Transport instance\n */\nexport const TRANSPORT = new InjectionToken<Transport>('23blocks.transport');\n\n/**\n * Injection token for Authentication block configuration\n */\nexport const AUTHENTICATION_CONFIG = new InjectionToken<AuthenticationBlockConfig>(\n '23blocks.authentication.config'\n);\n\n/**\n * Injection token for Search block configuration\n */\nexport const SEARCH_CONFIG = new InjectionToken<SearchBlockConfig>(\n '23blocks.search.config'\n);\n\n/**\n * Injection token for Geolocation block configuration\n */\nexport const GEOLOCATION_CONFIG = new InjectionToken<GeolocationBlockConfig>(\n '23blocks.geolocation.config'\n);\n\n/**\n * Injection token for Content block configuration\n */\nexport const CONTENT_CONFIG = new InjectionToken<ContentBlockConfig>(\n '23blocks.content.config'\n);\n\n/**\n * Injection token for CRM block configuration\n */\nexport const CRM_CONFIG = new InjectionToken<CrmBlockConfig>(\n '23blocks.crm.config'\n);\n\n/**\n * Injection token for Products block configuration\n */\nexport const PRODUCTS_CONFIG = new InjectionToken<ProductsBlockConfig>(\n '23blocks.products.config'\n);\n\n/**\n * Injection token for Conversations block configuration\n */\nexport const CONVERSATIONS_CONFIG = new InjectionToken<ConversationsBlockConfig>(\n '23blocks.conversations.config'\n);\n\n/**\n * Injection token for Files block configuration\n */\nexport const FILES_CONFIG = new InjectionToken<FilesBlockConfig>(\n '23blocks.files.config'\n);\n\n/**\n * Injection token for Assets block configuration\n */\nexport const ASSETS_CONFIG = new InjectionToken<AssetsBlockConfig>(\n '23blocks.assets.config'\n);\n\n/**\n * Injection token for Forms block configuration\n */\nexport const FORMS_CONFIG = new InjectionToken<FormsBlockConfig>(\n '23blocks.forms.config'\n);\n\n/**\n * Injection token for Sales block configuration\n */\nexport const SALES_CONFIG = new InjectionToken<SalesBlockConfig>(\n '23blocks.sales.config'\n);\n\n/**\n * Injection token for Campaigns block configuration\n */\nexport const CAMPAIGNS_CONFIG = new InjectionToken<CampaignsBlockConfig>(\n '23blocks.campaigns.config'\n);\n\n/**\n * Injection token for Company block configuration\n */\nexport const COMPANY_CONFIG = new InjectionToken<CompanyBlockConfig>(\n '23blocks.company.config'\n);\n\n/**\n * Injection token for Rewards block configuration\n */\nexport const REWARDS_CONFIG = new InjectionToken<RewardsBlockConfig>(\n '23blocks.rewards.config'\n);\n\n/**\n * Injection token for Jarvis block configuration\n */\nexport const JARVIS_CONFIG = new InjectionToken<JarvisBlockConfig>(\n '23blocks.jarvis.config'\n);\n\n/**\n * Injection token for Onboarding block configuration\n */\nexport const ONBOARDING_CONFIG = new InjectionToken<OnboardingBlockConfig>(\n '23blocks.onboarding.config'\n);\n\n/**\n * Injection token for University block configuration\n */\nexport const UNIVERSITY_CONFIG = new InjectionToken<UniversityBlockConfig>(\n '23blocks.university.config'\n);\n\n/**\n * Injection token for Wallet block configuration\n */\nexport const WALLET_CONFIG = new InjectionToken<WalletBlockConfig>(\n '23blocks.wallet.config'\n);\n"],"names":["InjectionToken","TRANSPORT","AUTHENTICATION_CONFIG","SEARCH_CONFIG","GEOLOCATION_CONFIG","CONTENT_CONFIG","CRM_CONFIG","PRODUCTS_CONFIG","CONVERSATIONS_CONFIG","FILES_CONFIG","ASSETS_CONFIG","FORMS_CONFIG","SALES_CONFIG","CAMPAIGNS_CONFIG","COMPANY_CONFI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O,MAAMkB,oBAAoB,IAAIlB,eACnC,8BACA;AAEF;;CAEC,GACD,OAAO,MAAMmB,gBAAgB,IAAInB,eAC/B,0BACA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/university/index.ts"],"sourcesContent":["export { UniversityService } from './university.service';\n"],"names":["UniversityService"],"rangeMappings":"","mappings":"AAAA,SAASA,iBAAiB,QAAQ,uBAAuB"}
|
|
@@ -0,0 +1,161 @@
|
|
|
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 { createUniversityBlock } from '@23blocks/block-university';
|
|
7
|
+
import { TRANSPORT, UNIVERSITY_CONFIG } from '../tokens.js';
|
|
8
|
+
export class UniversityService {
|
|
9
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
10
|
+
// Courses Service
|
|
11
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
12
|
+
listCourses(params) {
|
|
13
|
+
return from(this.block.courses.list(params));
|
|
14
|
+
}
|
|
15
|
+
getCourse(uniqueId) {
|
|
16
|
+
return from(this.block.courses.get(uniqueId));
|
|
17
|
+
}
|
|
18
|
+
createCourse(data) {
|
|
19
|
+
return from(this.block.courses.create(data));
|
|
20
|
+
}
|
|
21
|
+
updateCourse(uniqueId, data) {
|
|
22
|
+
return from(this.block.courses.update(uniqueId, data));
|
|
23
|
+
}
|
|
24
|
+
deleteCourse(uniqueId) {
|
|
25
|
+
return from(this.block.courses.delete(uniqueId));
|
|
26
|
+
}
|
|
27
|
+
publishCourse(uniqueId) {
|
|
28
|
+
return from(this.block.courses.publish(uniqueId));
|
|
29
|
+
}
|
|
30
|
+
unpublishCourse(uniqueId) {
|
|
31
|
+
return from(this.block.courses.unpublish(uniqueId));
|
|
32
|
+
}
|
|
33
|
+
listCoursesByInstructor(instructorUniqueId, params) {
|
|
34
|
+
return from(this.block.courses.listByInstructor(instructorUniqueId, params));
|
|
35
|
+
}
|
|
36
|
+
listCoursesByCategory(categoryUniqueId, params) {
|
|
37
|
+
return from(this.block.courses.listByCategory(categoryUniqueId, params));
|
|
38
|
+
}
|
|
39
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
40
|
+
// Lessons Service
|
|
41
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
42
|
+
listLessons(params) {
|
|
43
|
+
return from(this.block.lessons.list(params));
|
|
44
|
+
}
|
|
45
|
+
getLesson(uniqueId) {
|
|
46
|
+
return from(this.block.lessons.get(uniqueId));
|
|
47
|
+
}
|
|
48
|
+
createLesson(data) {
|
|
49
|
+
return from(this.block.lessons.create(data));
|
|
50
|
+
}
|
|
51
|
+
updateLesson(uniqueId, data) {
|
|
52
|
+
return from(this.block.lessons.update(uniqueId, data));
|
|
53
|
+
}
|
|
54
|
+
deleteLesson(uniqueId) {
|
|
55
|
+
return from(this.block.lessons.delete(uniqueId));
|
|
56
|
+
}
|
|
57
|
+
reorderLessons(courseUniqueId, data) {
|
|
58
|
+
return from(this.block.lessons.reorder(courseUniqueId, data));
|
|
59
|
+
}
|
|
60
|
+
listLessonsByCourse(courseUniqueId, params) {
|
|
61
|
+
return from(this.block.lessons.listByCourse(courseUniqueId, params));
|
|
62
|
+
}
|
|
63
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
64
|
+
// Enrollments Service
|
|
65
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
66
|
+
listEnrollments(params) {
|
|
67
|
+
return from(this.block.enrollments.list(params));
|
|
68
|
+
}
|
|
69
|
+
getEnrollment(uniqueId) {
|
|
70
|
+
return from(this.block.enrollments.get(uniqueId));
|
|
71
|
+
}
|
|
72
|
+
enroll(data) {
|
|
73
|
+
return from(this.block.enrollments.enroll(data));
|
|
74
|
+
}
|
|
75
|
+
updateEnrollmentProgress(uniqueId, data) {
|
|
76
|
+
return from(this.block.enrollments.updateProgress(uniqueId, data));
|
|
77
|
+
}
|
|
78
|
+
completeEnrollment(uniqueId) {
|
|
79
|
+
return from(this.block.enrollments.complete(uniqueId));
|
|
80
|
+
}
|
|
81
|
+
dropEnrollment(uniqueId) {
|
|
82
|
+
return from(this.block.enrollments.drop(uniqueId));
|
|
83
|
+
}
|
|
84
|
+
listEnrollmentsByCourse(courseUniqueId, params) {
|
|
85
|
+
return from(this.block.enrollments.listByCourse(courseUniqueId, params));
|
|
86
|
+
}
|
|
87
|
+
listEnrollmentsByUser(userUniqueId, params) {
|
|
88
|
+
return from(this.block.enrollments.listByUser(userUniqueId, params));
|
|
89
|
+
}
|
|
90
|
+
getCertificate(uniqueId) {
|
|
91
|
+
return from(this.block.enrollments.getCertificate(uniqueId));
|
|
92
|
+
}
|
|
93
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
94
|
+
// Assignments Service
|
|
95
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
96
|
+
listAssignments(params) {
|
|
97
|
+
return from(this.block.assignments.list(params));
|
|
98
|
+
}
|
|
99
|
+
getAssignment(uniqueId) {
|
|
100
|
+
return from(this.block.assignments.get(uniqueId));
|
|
101
|
+
}
|
|
102
|
+
createAssignment(data) {
|
|
103
|
+
return from(this.block.assignments.create(data));
|
|
104
|
+
}
|
|
105
|
+
updateAssignment(uniqueId, data) {
|
|
106
|
+
return from(this.block.assignments.update(uniqueId, data));
|
|
107
|
+
}
|
|
108
|
+
deleteAssignment(uniqueId) {
|
|
109
|
+
return from(this.block.assignments.delete(uniqueId));
|
|
110
|
+
}
|
|
111
|
+
listAssignmentsByLesson(lessonUniqueId, params) {
|
|
112
|
+
return from(this.block.assignments.listByLesson(lessonUniqueId, params));
|
|
113
|
+
}
|
|
114
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
115
|
+
// Submissions Service
|
|
116
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
117
|
+
listSubmissions(params) {
|
|
118
|
+
return from(this.block.submissions.list(params));
|
|
119
|
+
}
|
|
120
|
+
getSubmission(uniqueId) {
|
|
121
|
+
return from(this.block.submissions.get(uniqueId));
|
|
122
|
+
}
|
|
123
|
+
submitAssignment(data) {
|
|
124
|
+
return from(this.block.submissions.submit(data));
|
|
125
|
+
}
|
|
126
|
+
gradeSubmission(uniqueId, data) {
|
|
127
|
+
return from(this.block.submissions.grade(uniqueId, data));
|
|
128
|
+
}
|
|
129
|
+
listSubmissionsByAssignment(assignmentUniqueId, params) {
|
|
130
|
+
return from(this.block.submissions.listByAssignment(assignmentUniqueId, params));
|
|
131
|
+
}
|
|
132
|
+
listSubmissionsByUser(userUniqueId, params) {
|
|
133
|
+
return from(this.block.submissions.listByUser(userUniqueId, params));
|
|
134
|
+
}
|
|
135
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
136
|
+
// Direct Block Access (for advanced usage)
|
|
137
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
138
|
+
/**
|
|
139
|
+
* Access the underlying block for advanced operations
|
|
140
|
+
* Use this when you need access to services not wrapped by this Angular service
|
|
141
|
+
*/ get rawBlock() {
|
|
142
|
+
return this.block;
|
|
143
|
+
}
|
|
144
|
+
constructor(transport, config){
|
|
145
|
+
this.block = createUniversityBlock(transport, config);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
UniversityService = _ts_decorate([
|
|
149
|
+
Injectable({
|
|
150
|
+
providedIn: 'root'
|
|
151
|
+
}),
|
|
152
|
+
_ts_param(0, Inject(TRANSPORT)),
|
|
153
|
+
_ts_param(1, Inject(UNIVERSITY_CONFIG)),
|
|
154
|
+
_ts_metadata("design:type", Function),
|
|
155
|
+
_ts_metadata("design:paramtypes", [
|
|
156
|
+
typeof Transport === "undefined" ? Object : Transport,
|
|
157
|
+
typeof UniversityBlockConfig === "undefined" ? Object : UniversityBlockConfig
|
|
158
|
+
])
|
|
159
|
+
], UniversityService);
|
|
160
|
+
|
|
161
|
+
//# sourceMappingURL=university.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/university/university.service.ts"],"sourcesContent":["import { Injectable, Inject } from '@angular/core';\nimport { Observable, from } from 'rxjs';\nimport type { Transport, PageResult } from '@23blocks/contracts';\nimport {\n createUniversityBlock,\n type UniversityBlock,\n type UniversityBlockConfig,\n type Course,\n type CreateCourseRequest,\n type UpdateCourseRequest,\n type ListCoursesParams,\n type Lesson,\n type CreateLessonRequest,\n type UpdateLessonRequest,\n type ListLessonsParams,\n type ReorderLessonsRequest,\n type Enrollment,\n type EnrollRequest,\n type UpdateEnrollmentProgressRequest,\n type ListEnrollmentsParams,\n type Assignment,\n type CreateAssignmentRequest,\n type UpdateAssignmentRequest,\n type ListAssignmentsParams,\n type Submission,\n type SubmitAssignmentRequest,\n type GradeSubmissionRequest,\n type ListSubmissionsParams,\n} from '@23blocks/block-university';\nimport { TRANSPORT, UNIVERSITY_CONFIG } from '../tokens.js';\n\n/**\n * Angular service wrapping the University block.\n * Converts Promise-based APIs to RxJS Observables.\n *\n * @example\n * ```typescript\n * @Component({...})\n * export class CourseListComponent {\n * constructor(private university: UniversityService) {}\n *\n * loadCourses() {\n * this.university.listCourses({ page: 1, perPage: 10 }).subscribe({\n * next: (result) => console.log('Courses:', result.data),\n * error: (err) => console.error('Failed:', err),\n * });\n * }\n * }\n * ```\n */\n@Injectable({ providedIn: 'root' })\nexport class UniversityService {\n private readonly block: UniversityBlock;\n\n constructor(\n @Inject(TRANSPORT) transport: Transport,\n @Inject(UNIVERSITY_CONFIG) config: UniversityBlockConfig\n ) {\n this.block = createUniversityBlock(transport, config);\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Courses Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listCourses(params?: ListCoursesParams): Observable<PageResult<Course>> {\n return from(this.block.courses.list(params));\n }\n\n getCourse(uniqueId: string): Observable<Course> {\n return from(this.block.courses.get(uniqueId));\n }\n\n createCourse(data: CreateCourseRequest): Observable<Course> {\n return from(this.block.courses.create(data));\n }\n\n updateCourse(uniqueId: string, data: UpdateCourseRequest): Observable<Course> {\n return from(this.block.courses.update(uniqueId, data));\n }\n\n deleteCourse(uniqueId: string): Observable<void> {\n return from(this.block.courses.delete(uniqueId));\n }\n\n publishCourse(uniqueId: string): Observable<Course> {\n return from(this.block.courses.publish(uniqueId));\n }\n\n unpublishCourse(uniqueId: string): Observable<Course> {\n return from(this.block.courses.unpublish(uniqueId));\n }\n\n listCoursesByInstructor(instructorUniqueId: string, params?: ListCoursesParams): Observable<PageResult<Course>> {\n return from(this.block.courses.listByInstructor(instructorUniqueId, params));\n }\n\n listCoursesByCategory(categoryUniqueId: string, params?: ListCoursesParams): Observable<PageResult<Course>> {\n return from(this.block.courses.listByCategory(categoryUniqueId, params));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Lessons Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listLessons(params?: ListLessonsParams): Observable<PageResult<Lesson>> {\n return from(this.block.lessons.list(params));\n }\n\n getLesson(uniqueId: string): Observable<Lesson> {\n return from(this.block.lessons.get(uniqueId));\n }\n\n createLesson(data: CreateLessonRequest): Observable<Lesson> {\n return from(this.block.lessons.create(data));\n }\n\n updateLesson(uniqueId: string, data: UpdateLessonRequest): Observable<Lesson> {\n return from(this.block.lessons.update(uniqueId, data));\n }\n\n deleteLesson(uniqueId: string): Observable<void> {\n return from(this.block.lessons.delete(uniqueId));\n }\n\n reorderLessons(courseUniqueId: string, data: ReorderLessonsRequest): Observable<Lesson[]> {\n return from(this.block.lessons.reorder(courseUniqueId, data));\n }\n\n listLessonsByCourse(courseUniqueId: string, params?: ListLessonsParams): Observable<PageResult<Lesson>> {\n return from(this.block.lessons.listByCourse(courseUniqueId, params));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Enrollments Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listEnrollments(params?: ListEnrollmentsParams): Observable<PageResult<Enrollment>> {\n return from(this.block.enrollments.list(params));\n }\n\n getEnrollment(uniqueId: string): Observable<Enrollment> {\n return from(this.block.enrollments.get(uniqueId));\n }\n\n enroll(data: EnrollRequest): Observable<Enrollment> {\n return from(this.block.enrollments.enroll(data));\n }\n\n updateEnrollmentProgress(uniqueId: string, data: UpdateEnrollmentProgressRequest): Observable<Enrollment> {\n return from(this.block.enrollments.updateProgress(uniqueId, data));\n }\n\n completeEnrollment(uniqueId: string): Observable<Enrollment> {\n return from(this.block.enrollments.complete(uniqueId));\n }\n\n dropEnrollment(uniqueId: string): Observable<Enrollment> {\n return from(this.block.enrollments.drop(uniqueId));\n }\n\n listEnrollmentsByCourse(courseUniqueId: string, params?: ListEnrollmentsParams): Observable<PageResult<Enrollment>> {\n return from(this.block.enrollments.listByCourse(courseUniqueId, params));\n }\n\n listEnrollmentsByUser(userUniqueId: string, params?: ListEnrollmentsParams): Observable<PageResult<Enrollment>> {\n return from(this.block.enrollments.listByUser(userUniqueId, params));\n }\n\n getCertificate(uniqueId: string): Observable<{ certificateUrl: string }> {\n return from(this.block.enrollments.getCertificate(uniqueId));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Assignments Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listAssignments(params?: ListAssignmentsParams): Observable<PageResult<Assignment>> {\n return from(this.block.assignments.list(params));\n }\n\n getAssignment(uniqueId: string): Observable<Assignment> {\n return from(this.block.assignments.get(uniqueId));\n }\n\n createAssignment(data: CreateAssignmentRequest): Observable<Assignment> {\n return from(this.block.assignments.create(data));\n }\n\n updateAssignment(uniqueId: string, data: UpdateAssignmentRequest): Observable<Assignment> {\n return from(this.block.assignments.update(uniqueId, data));\n }\n\n deleteAssignment(uniqueId: string): Observable<void> {\n return from(this.block.assignments.delete(uniqueId));\n }\n\n listAssignmentsByLesson(lessonUniqueId: string, params?: ListAssignmentsParams): Observable<PageResult<Assignment>> {\n return from(this.block.assignments.listByLesson(lessonUniqueId, params));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Submissions Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listSubmissions(params?: ListSubmissionsParams): Observable<PageResult<Submission>> {\n return from(this.block.submissions.list(params));\n }\n\n getSubmission(uniqueId: string): Observable<Submission> {\n return from(this.block.submissions.get(uniqueId));\n }\n\n submitAssignment(data: SubmitAssignmentRequest): Observable<Submission> {\n return from(this.block.submissions.submit(data));\n }\n\n gradeSubmission(uniqueId: string, data: GradeSubmissionRequest): Observable<Submission> {\n return from(this.block.submissions.grade(uniqueId, data));\n }\n\n listSubmissionsByAssignment(assignmentUniqueId: string, params?: ListSubmissionsParams): Observable<PageResult<Submission>> {\n return from(this.block.submissions.listByAssignment(assignmentUniqueId, params));\n }\n\n listSubmissionsByUser(userUniqueId: string, params?: ListSubmissionsParams): Observable<PageResult<Submission>> {\n return from(this.block.submissions.listByUser(userUniqueId, 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(): UniversityBlock {\n return this.block;\n }\n}\n"],"names":["Injectable","Inject","from","createUniversityBlock","TRANSPORT","UNIVERSITY_CONFIG","UniversityService","listCourses","params","block","courses","list","getCourse","uniqueId","get","createCourse","data","create","updateCourse","update","deleteCourse","delete","publishCourse","publish","unpublishCourse","unpublish","listCoursesByInstructor","instructorUniqueId","listByInstructor","listCoursesByCategory","categoryUniqueId","listByCategory","listLessons","lessons","getLesson","createLesson","updateLesson","deleteLesson","reorderLessons","courseUniqueId","reorder","listLessonsByCourse","listByCourse","listEnrollments","enrollments","getEnrollment","enroll","updateEnrollmentProgress","updateProgress","completeEnrollment","complete","dropEnrollment","drop","listEnrollmentsByCourse","listEnrollmentsByUser","userUniqueId","listByUser","getCertificate","listAssignments","assignments","getAssignment","createAssignment","updateAssignment","deleteAssignment","listAssignmentsByLesson","lessonUniqueId","listByLesson","listSubmissions","submissions","getSubmission","submitAssignment","submit","gradeSubmission","grade","listSubmissionsByAssignment","assignmentUniqueId","listByAssignment","listSubmissionsByUser","rawBlock","constructor","transport","config","providedIn"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;AAAA,SAASA,UAAU,EAAEC,MAAM,QAAQ,gBAAgB;AACnD,SAAqBC,IAAI,QAAQ,OAAO;AAExC,SACEC,qBAAqB,QAwBhB,6BAA6B;AACpC,SAASC,SAAS,EAAEC,iBAAiB,QAAQ,eAAe;AAsB5D,OAAO,MAAMC;IAUX,gFAAgF;IAChF,kBAAkB;IAClB,gFAAgF;IAEhFC,YAAYC,MAA0B,EAAkC;QACtE,OAAON,KAAK,IAAI,CAACO,KAAK,CAACC,OAAO,CAACC,IAAI,CAACH;IACtC;IAEAI,UAAUC,QAAgB,EAAsB;QAC9C,OAAOX,KAAK,IAAI,CAACO,KAAK,CAACC,OAAO,CAACI,GAAG,CAACD;IACrC;IAEAE,aAAaC,IAAyB,EAAsB;QAC1D,OAAOd,KAAK,IAAI,CAACO,KAAK,CAACC,OAAO,CAACO,MAAM,CAACD;IACxC;IAEAE,aAAaL,QAAgB,EAAEG,IAAyB,EAAsB;QAC5E,OAAOd,KAAK,IAAI,CAACO,KAAK,CAACC,OAAO,CAACS,MAAM,CAACN,UAAUG;IAClD;IAEAI,aAAaP,QAAgB,EAAoB;QAC/C,OAAOX,KAAK,IAAI,CAACO,KAAK,CAACC,OAAO,CAACW,MAAM,CAACR;IACxC;IAEAS,cAAcT,QAAgB,EAAsB;QAClD,OAAOX,KAAK,IAAI,CAACO,KAAK,CAACC,OAAO,CAAC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ACO,KAAK,CAAC2D,WAAW,CAACQ,gBAAgB,CAACD,oBAAoBnE;IAC1E;IAEAqE,sBAAsBtB,YAAoB,EAAE/C,MAA8B,EAAsC;QAC9G,OAAON,KAAK,IAAI,CAACO,KAAK,CAAC2D,WAAW,CAACZ,UAAU,CAACD,cAAc/C;IAC9D;IAEA,gFAAgF;IAChF,2CAA2C;IAC3C,gFAAgF;IAEhF;;;GAGC,GACD,IAAIsE,WAA4B;QAC9B,OAAO,IAAI,CAACrE,KAAK;IACnB;IAzLAsE,YACE,AAAmBC,SAAoB,EACvC,AAA2BC,MAA6B,CACxD;QACA,IAAI,CAACxE,KAAK,GAAGN,sBAAsB6E,WAAWC;IAChD;AAqLF;AA7La3E;IADZN,WAAW;QAAEkF,YAAY;IAAO;IAK5BjF,aAAAA,OAAOG;IACPH,aAAAA,OAAOI;;;eADsB,qCAAA;eACK,iDAAA;;GAL1BC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/wallet/index.ts"],"sourcesContent":["export { WalletService } from './wallet.service.js';\n"],"names":["WalletService"],"rangeMappings":"","mappings":"AAAA,SAASA,aAAa,QAAQ,sBAAsB"}
|
|
@@ -0,0 +1,98 @@
|
|
|
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 { createWalletBlock } from '@23blocks/block-wallet';
|
|
7
|
+
import { TRANSPORT, WALLET_CONFIG } from '../tokens.js';
|
|
8
|
+
export class WalletService {
|
|
9
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
10
|
+
// Wallets Service
|
|
11
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
12
|
+
listWallets(params) {
|
|
13
|
+
return from(this.block.wallets.list(params));
|
|
14
|
+
}
|
|
15
|
+
getWallet(uniqueId) {
|
|
16
|
+
return from(this.block.wallets.get(uniqueId));
|
|
17
|
+
}
|
|
18
|
+
getWalletByUser(userUniqueId) {
|
|
19
|
+
return from(this.block.wallets.getByUser(userUniqueId));
|
|
20
|
+
}
|
|
21
|
+
createWallet(data) {
|
|
22
|
+
return from(this.block.wallets.create(data));
|
|
23
|
+
}
|
|
24
|
+
updateWallet(uniqueId, data) {
|
|
25
|
+
return from(this.block.wallets.update(uniqueId, data));
|
|
26
|
+
}
|
|
27
|
+
creditWallet(uniqueId, data) {
|
|
28
|
+
return from(this.block.wallets.credit(uniqueId, data));
|
|
29
|
+
}
|
|
30
|
+
debitWallet(uniqueId, data) {
|
|
31
|
+
return from(this.block.wallets.debit(uniqueId, data));
|
|
32
|
+
}
|
|
33
|
+
getWalletBalance(uniqueId) {
|
|
34
|
+
return from(this.block.wallets.getBalance(uniqueId));
|
|
35
|
+
}
|
|
36
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
37
|
+
// Transactions Service
|
|
38
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
39
|
+
listTransactions(params) {
|
|
40
|
+
return from(this.block.transactions.list(params));
|
|
41
|
+
}
|
|
42
|
+
getTransaction(uniqueId) {
|
|
43
|
+
return from(this.block.transactions.get(uniqueId));
|
|
44
|
+
}
|
|
45
|
+
listTransactionsByWallet(walletUniqueId, params) {
|
|
46
|
+
return from(this.block.transactions.listByWallet(walletUniqueId, params));
|
|
47
|
+
}
|
|
48
|
+
listTransactionsByReference(referenceType, referenceUniqueId, params) {
|
|
49
|
+
return from(this.block.transactions.listByReference(referenceType, referenceUniqueId, params));
|
|
50
|
+
}
|
|
51
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
52
|
+
// Authorization Codes Service
|
|
53
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
54
|
+
listAuthorizationCodes(params) {
|
|
55
|
+
return from(this.block.authorizationCodes.list(params));
|
|
56
|
+
}
|
|
57
|
+
getAuthorizationCode(uniqueId) {
|
|
58
|
+
return from(this.block.authorizationCodes.get(uniqueId));
|
|
59
|
+
}
|
|
60
|
+
createAuthorizationCode(data) {
|
|
61
|
+
return from(this.block.authorizationCodes.create(data));
|
|
62
|
+
}
|
|
63
|
+
validateAuthorizationCode(data) {
|
|
64
|
+
return from(this.block.authorizationCodes.validate(data));
|
|
65
|
+
}
|
|
66
|
+
useAuthorizationCode(data) {
|
|
67
|
+
return from(this.block.authorizationCodes.use(data));
|
|
68
|
+
}
|
|
69
|
+
invalidateAuthorizationCode(uniqueId) {
|
|
70
|
+
return from(this.block.authorizationCodes.invalidate(uniqueId));
|
|
71
|
+
}
|
|
72
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
73
|
+
// Direct Block Access (for advanced usage)
|
|
74
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
75
|
+
/**
|
|
76
|
+
* Access the underlying block for advanced operations
|
|
77
|
+
* Use this when you need access to services not wrapped by this Angular service
|
|
78
|
+
*/ get rawBlock() {
|
|
79
|
+
return this.block;
|
|
80
|
+
}
|
|
81
|
+
constructor(transport, config){
|
|
82
|
+
this.block = createWalletBlock(transport, config);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
WalletService = _ts_decorate([
|
|
86
|
+
Injectable({
|
|
87
|
+
providedIn: 'root'
|
|
88
|
+
}),
|
|
89
|
+
_ts_param(0, Inject(TRANSPORT)),
|
|
90
|
+
_ts_param(1, Inject(WALLET_CONFIG)),
|
|
91
|
+
_ts_metadata("design:type", Function),
|
|
92
|
+
_ts_metadata("design:paramtypes", [
|
|
93
|
+
typeof Transport === "undefined" ? Object : Transport,
|
|
94
|
+
typeof WalletBlockConfig === "undefined" ? Object : WalletBlockConfig
|
|
95
|
+
])
|
|
96
|
+
], WalletService);
|
|
97
|
+
|
|
98
|
+
//# sourceMappingURL=wallet.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/wallet/wallet.service.ts"],"sourcesContent":["import { Injectable, Inject } from '@angular/core';\nimport { Observable, from } from 'rxjs';\nimport type { Transport, PageResult } from '@23blocks/contracts';\nimport {\n createWalletBlock,\n type WalletBlock,\n type WalletBlockConfig,\n type Wallet,\n type CreateWalletRequest,\n type UpdateWalletRequest,\n type ListWalletsParams,\n type CreditWalletRequest,\n type DebitWalletRequest,\n type Transaction,\n type ListTransactionsParams,\n type AuthorizationCode,\n type CreateAuthorizationCodeRequest,\n type ValidateAuthorizationCodeRequest,\n type UseAuthorizationCodeRequest,\n type ListAuthorizationCodesParams,\n} from '@23blocks/block-wallet';\nimport { TRANSPORT, WALLET_CONFIG } from '../tokens.js';\n\n/**\n * Angular service wrapping the Wallet block.\n * Converts Promise-based APIs to RxJS Observables.\n *\n * @example\n * ```typescript\n * @Component({...})\n * export class WalletComponent {\n * constructor(private wallet: WalletService) {}\n *\n * createWallet(userUniqueId: string) {\n * this.wallet.createWallet({ userUniqueId }).subscribe({\n * next: (wallet) => console.log('Created:', wallet),\n * error: (err) => console.error('Failed:', err),\n * });\n * }\n * }\n * ```\n */\n@Injectable({ providedIn: 'root' })\nexport class WalletService {\n private readonly block: WalletBlock;\n\n constructor(\n @Inject(TRANSPORT) transport: Transport,\n @Inject(WALLET_CONFIG) config: WalletBlockConfig\n ) {\n this.block = createWalletBlock(transport, config);\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Wallets Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listWallets(params?: ListWalletsParams): Observable<PageResult<Wallet>> {\n return from(this.block.wallets.list(params));\n }\n\n getWallet(uniqueId: string): Observable<Wallet> {\n return from(this.block.wallets.get(uniqueId));\n }\n\n getWalletByUser(userUniqueId: string): Observable<Wallet> {\n return from(this.block.wallets.getByUser(userUniqueId));\n }\n\n createWallet(data: CreateWalletRequest): Observable<Wallet> {\n return from(this.block.wallets.create(data));\n }\n\n updateWallet(uniqueId: string, data: UpdateWalletRequest): Observable<Wallet> {\n return from(this.block.wallets.update(uniqueId, data));\n }\n\n creditWallet(uniqueId: string, data: CreditWalletRequest): Observable<Transaction> {\n return from(this.block.wallets.credit(uniqueId, data));\n }\n\n debitWallet(uniqueId: string, data: DebitWalletRequest): Observable<Transaction> {\n return from(this.block.wallets.debit(uniqueId, data));\n }\n\n getWalletBalance(uniqueId: string): Observable<{ balance: number; currency: string }> {\n return from(this.block.wallets.getBalance(uniqueId));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Transactions Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listTransactions(params?: ListTransactionsParams): Observable<PageResult<Transaction>> {\n return from(this.block.transactions.list(params));\n }\n\n getTransaction(uniqueId: string): Observable<Transaction> {\n return from(this.block.transactions.get(uniqueId));\n }\n\n listTransactionsByWallet(\n walletUniqueId: string,\n params?: ListTransactionsParams\n ): Observable<PageResult<Transaction>> {\n return from(this.block.transactions.listByWallet(walletUniqueId, params));\n }\n\n listTransactionsByReference(\n referenceType: string,\n referenceUniqueId: string,\n params?: ListTransactionsParams\n ): Observable<PageResult<Transaction>> {\n return from(this.block.transactions.listByReference(referenceType, referenceUniqueId, params));\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Authorization Codes Service\n // ─────────────────────────────────────────────────────────────────────────────\n\n listAuthorizationCodes(params?: ListAuthorizationCodesParams): Observable<PageResult<AuthorizationCode>> {\n return from(this.block.authorizationCodes.list(params));\n }\n\n getAuthorizationCode(uniqueId: string): Observable<AuthorizationCode> {\n return from(this.block.authorizationCodes.get(uniqueId));\n }\n\n createAuthorizationCode(data: CreateAuthorizationCodeRequest): Observable<AuthorizationCode> {\n return from(this.block.authorizationCodes.create(data));\n }\n\n validateAuthorizationCode(\n data: ValidateAuthorizationCodeRequest\n ): Observable<{ valid: boolean; authorizationCode?: AuthorizationCode }> {\n return from(this.block.authorizationCodes.validate(data));\n }\n\n useAuthorizationCode(data: UseAuthorizationCodeRequest): Observable<Transaction> {\n return from(this.block.authorizationCodes.use(data));\n }\n\n invalidateAuthorizationCode(uniqueId: string): Observable<AuthorizationCode> {\n return from(this.block.authorizationCodes.invalidate(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(): WalletBlock {\n return this.block;\n }\n}\n"],"names":["Injectable","Inject","from","createWalletBlock","TRANSPORT","WALLET_CONFIG","WalletService","listWallets","params","block","wallets","list","getWallet","uniqueId","get","getWalletByUser","userUniqueId","getByUser","createWallet","data","create","updateWallet","update","creditWallet","credit","debitWallet","debit","getWalletBalance","getBalance","listTransactions","transactions","getTransaction","listTransactionsByWallet","walletUniqueId","listByWallet","listTransactionsByReference","referenceType","referenceUniqueId","listByReference","listAuthorizationCodes","authorizationCodes","getAuthorizationCode","createAuthorizationCode","validateAuthorizationCode","validate","useAuthorizationCode","use","invalidateAuthorizationCode","invalidate","rawBlock","constructor","transport","config","providedIn"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;AAAA,SAASA,UAAU,EAAEC,MAAM,QAAQ,gBAAgB;AACnD,SAAqBC,IAAI,QAAQ,OAAO;AAExC,SACEC,iBAAiB,QAgBZ,yBAAyB;AAChC,SAASC,SAAS,EAAEC,aAAa,QAAQ,eAAe;AAsBxD,OAAO,MAAMC;IAUX,gFAAgF;IAChF,kBAAkB;IAClB,gFAAgF;IAEhFC,YAAYC,MAA0B,EAAkC;QACtE,OAAON,KAAK,IAAI,CAACO,KAAK,CAACC,OAAO,CAACC,IAAI,CAACH;IACtC;IAEAI,UAAUC,QAAgB,EAAsB;QAC9C,OAAOX,KAAK,IAAI,CAACO,KAAK,CAACC,OAAO,CAACI,GAAG,CAACD;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": "0.2.1",
|
|
4
4
|
"description": "Angular bindings for 23blocks SDK - Injectable services with RxJS Observables",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "23blocks <hello@23blocks.com>",
|
|
@@ -59,10 +59,26 @@
|
|
|
59
59
|
"@23blocks/contracts": "*",
|
|
60
60
|
"@23blocks/block-authentication": "*",
|
|
61
61
|
"@23blocks/block-search": "*",
|
|
62
|
+
"@23blocks/block-products": "*",
|
|
63
|
+
"@23blocks/block-crm": "*",
|
|
64
|
+
"@23blocks/block-content": "*",
|
|
65
|
+
"@23blocks/block-geolocation": "*",
|
|
66
|
+
"@23blocks/block-conversations": "*",
|
|
67
|
+
"@23blocks/block-files": "*",
|
|
68
|
+
"@23blocks/block-forms": "*",
|
|
69
|
+
"@23blocks/block-assets": "*",
|
|
70
|
+
"@23blocks/block-campaigns": "*",
|
|
71
|
+
"@23blocks/block-company": "*",
|
|
72
|
+
"@23blocks/block-rewards": "*",
|
|
73
|
+
"@23blocks/block-sales": "*",
|
|
74
|
+
"@23blocks/block-wallet": "*",
|
|
75
|
+
"@23blocks/block-jarvis": "*",
|
|
76
|
+
"@23blocks/block-onboarding": "*",
|
|
77
|
+
"@23blocks/block-university": "*",
|
|
62
78
|
"@swc/helpers": "~0.5.11"
|
|
63
79
|
},
|
|
64
80
|
"peerDependencies": {
|
|
65
|
-
"@angular/core": ">=
|
|
66
|
-
"rxjs": ">=
|
|
81
|
+
"@angular/core": ">=10.0.0",
|
|
82
|
+
"rxjs": ">=6.0.0"
|
|
67
83
|
}
|
|
68
84
|
}
|