@23blocks/angular 1.1.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +4230 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/lib/assets/assets.service.d.ts +58 -0
- package/dist/src/lib/assets/assets.service.d.ts.map +1 -0
- package/dist/{lib/assets/index.js → src/lib/assets/index.d.ts} +1 -2
- package/dist/src/lib/assets/index.d.ts.map +1 -0
- package/dist/src/lib/authentication/authentication.service.d.ts +105 -0
- package/dist/src/lib/authentication/authentication.service.d.ts.map +1 -0
- package/dist/{lib/authentication/index.js → src/lib/authentication/index.d.ts} +1 -2
- package/dist/src/lib/authentication/index.d.ts.map +1 -0
- package/dist/src/lib/campaigns/campaigns.service.d.ts +66 -0
- package/dist/src/lib/campaigns/campaigns.service.d.ts.map +1 -0
- package/dist/{lib/campaigns/index.js → src/lib/campaigns/index.d.ts} +1 -2
- package/dist/src/lib/campaigns/index.d.ts.map +1 -0
- package/dist/src/lib/company/company.service.d.ts +65 -0
- package/dist/src/lib/company/company.service.d.ts.map +1 -0
- package/dist/{lib/company/index.js → src/lib/company/index.d.ts} +1 -2
- package/dist/src/lib/company/index.d.ts.map +1 -0
- package/dist/src/lib/content/content.service.d.ts +67 -0
- package/dist/src/lib/content/content.service.d.ts.map +1 -0
- package/dist/{lib/content/index.js → src/lib/content/index.d.ts} +1 -2
- package/dist/src/lib/content/index.d.ts.map +1 -0
- package/dist/src/lib/conversations/conversations.service.d.ts +74 -0
- package/dist/src/lib/conversations/conversations.service.d.ts.map +1 -0
- package/dist/{lib/conversations/index.js → src/lib/conversations/index.d.ts} +1 -2
- package/dist/src/lib/conversations/index.d.ts.map +1 -0
- package/dist/src/lib/crm/crm.service.d.ts +84 -0
- package/dist/src/lib/crm/crm.service.d.ts.map +1 -0
- package/dist/{lib/crm/index.js → src/lib/crm/index.d.ts} +1 -2
- package/dist/src/lib/crm/index.d.ts.map +1 -0
- package/dist/src/lib/files/files.service.d.ts +62 -0
- package/dist/src/lib/files/files.service.d.ts.map +1 -0
- package/dist/{lib/files/index.js → src/lib/files/index.d.ts} +1 -2
- package/dist/src/lib/files/index.d.ts.map +1 -0
- package/dist/src/lib/forms/forms.service.d.ts +60 -0
- package/dist/src/lib/forms/forms.service.d.ts.map +1 -0
- package/dist/src/lib/forms/index.d.ts +2 -0
- package/dist/src/lib/forms/index.d.ts.map +1 -0
- package/dist/src/lib/geolocation/geolocation.service.d.ts +93 -0
- package/dist/src/lib/geolocation/geolocation.service.d.ts.map +1 -0
- package/dist/{lib/geolocation/index.js → src/lib/geolocation/index.d.ts} +1 -2
- package/dist/src/lib/geolocation/index.d.ts.map +1 -0
- package/dist/src/lib/index.d.ts +22 -0
- package/dist/src/lib/index.d.ts.map +1 -0
- package/dist/{lib/jarvis/index.js → src/lib/jarvis/index.d.ts} +1 -2
- package/dist/src/lib/jarvis/index.d.ts.map +1 -0
- package/dist/src/lib/jarvis/jarvis.service.d.ts +69 -0
- package/dist/src/lib/jarvis/jarvis.service.d.ts.map +1 -0
- package/dist/{lib/onboarding/index.js → src/lib/onboarding/index.d.ts} +1 -2
- package/dist/src/lib/onboarding/index.d.ts.map +1 -0
- package/dist/src/lib/onboarding/onboarding.service.d.ts +68 -0
- package/dist/src/lib/onboarding/onboarding.service.d.ts.map +1 -0
- package/dist/{lib/products/index.js → src/lib/products/index.d.ts} +1 -2
- package/dist/src/lib/products/index.d.ts.map +1 -0
- package/dist/src/lib/products/products.service.d.ts +101 -0
- package/dist/src/lib/products/products.service.d.ts.map +1 -0
- package/dist/src/lib/providers.d.ts +97 -0
- package/dist/src/lib/providers.d.ts.map +1 -0
- package/dist/{lib/rewards/index.js → src/lib/rewards/index.d.ts} +1 -2
- package/dist/src/lib/rewards/index.d.ts.map +1 -0
- package/dist/src/lib/rewards/rewards.service.d.ts +62 -0
- package/dist/src/lib/rewards/rewards.service.d.ts.map +1 -0
- package/dist/{lib/sales/index.js → src/lib/sales/index.d.ts} +1 -2
- package/dist/src/lib/sales/index.d.ts.map +1 -0
- package/dist/src/lib/sales/sales.service.d.ts +62 -0
- package/dist/src/lib/sales/sales.service.d.ts.map +1 -0
- package/dist/{lib/search/index.js → src/lib/search/index.d.ts} +1 -2
- package/dist/src/lib/search/index.d.ts.map +1 -0
- package/dist/src/lib/search/search.service.d.ts +80 -0
- package/dist/src/lib/search/search.service.d.ts.map +1 -0
- package/dist/src/lib/simple-providers.d.ts +202 -0
- package/dist/src/lib/simple-providers.d.ts.map +1 -0
- package/dist/src/lib/tokens.d.ts +114 -0
- package/dist/src/lib/tokens.d.ts.map +1 -0
- package/dist/{lib/university/index.js → src/lib/university/index.d.ts} +1 -2
- package/dist/src/lib/university/index.d.ts.map +1 -0
- package/dist/src/lib/university/university.service.d.ts +75 -0
- package/dist/src/lib/university/university.service.d.ts.map +1 -0
- package/dist/{lib/wallet/index.js → src/lib/wallet/index.d.ts} +1 -2
- package/dist/src/lib/wallet/index.d.ts.map +1 -0
- package/dist/src/lib/wallet/wallet.service.d.ts +60 -0
- package/dist/src/lib/wallet/wallet.service.d.ts.map +1 -0
- package/package.json +10 -8
- package/dist/index.js +0 -3
- package/dist/index.js.map +0 -1
- package/dist/lib/assets/assets.service.js +0 -123
- package/dist/lib/assets/assets.service.js.map +0 -1
- package/dist/lib/assets/index.js.map +0 -1
- package/dist/lib/authentication/authentication.service.js +0 -209
- package/dist/lib/authentication/authentication.service.js.map +0 -1
- package/dist/lib/authentication/index.js.map +0 -1
- package/dist/lib/campaigns/campaigns.service.js +0 -150
- package/dist/lib/campaigns/campaigns.service.js.map +0 -1
- package/dist/lib/campaigns/index.js.map +0 -1
- package/dist/lib/company/company.service.js +0 -150
- package/dist/lib/company/company.service.js.map +0 -1
- package/dist/lib/company/index.js.map +0 -1
- package/dist/lib/content/content.service.js +0 -153
- package/dist/lib/content/content.service.js.map +0 -1
- package/dist/lib/content/index.js.map +0 -1
- package/dist/lib/conversations/conversations.service.js +0 -177
- package/dist/lib/conversations/conversations.service.js.map +0 -1
- package/dist/lib/conversations/index.js.map +0 -1
- package/dist/lib/crm/crm.service.js +0 -210
- package/dist/lib/crm/crm.service.js.map +0 -1
- package/dist/lib/crm/index.js.map +0 -1
- package/dist/lib/files/files.service.js +0 -120
- package/dist/lib/files/files.service.js.map +0 -1
- package/dist/lib/files/index.js.map +0 -1
- package/dist/lib/forms/forms.service.js +0 -132
- package/dist/lib/forms/forms.service.js.map +0 -1
- package/dist/lib/forms/index.js +0 -3
- package/dist/lib/forms/index.js.map +0 -1
- package/dist/lib/geolocation/geolocation.service.js +0 -240
- package/dist/lib/geolocation/geolocation.service.js.map +0 -1
- package/dist/lib/geolocation/index.js.map +0 -1
- package/dist/lib/index.js +0 -36
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/jarvis/index.js.map +0 -1
- package/dist/lib/jarvis/jarvis.service.js +0 -162
- package/dist/lib/jarvis/jarvis.service.js.map +0 -1
- package/dist/lib/onboarding/index.js.map +0 -1
- package/dist/lib/onboarding/onboarding.service.js +0 -132
- package/dist/lib/onboarding/onboarding.service.js.map +0 -1
- package/dist/lib/products/index.js.map +0 -1
- package/dist/lib/products/products.service.js +0 -255
- package/dist/lib/products/products.service.js.map +0 -1
- package/dist/lib/providers.js +0 -286
- package/dist/lib/providers.js.map +0 -1
- package/dist/lib/rewards/index.js.map +0 -1
- package/dist/lib/rewards/rewards.service.js +0 -138
- package/dist/lib/rewards/rewards.service.js.map +0 -1
- package/dist/lib/sales/index.js.map +0 -1
- package/dist/lib/sales/sales.service.js +0 -138
- package/dist/lib/sales/sales.service.js.map +0 -1
- package/dist/lib/search/index.js.map +0 -1
- package/dist/lib/search/search.service.js +0 -106
- package/dist/lib/search/search.service.js.map +0 -1
- package/dist/lib/simple-providers.js +0 -498
- package/dist/lib/simple-providers.js.map +0 -1
- package/dist/lib/tokens.js +0 -85
- package/dist/lib/tokens.js.map +0 -1
- package/dist/lib/university/index.js.map +0 -1
- package/dist/lib/university/university.service.js +0 -174
- package/dist/lib/university/university.service.js.map +0 -1
- package/dist/lib/wallet/index.js.map +0 -1
- package/dist/lib/wallet/wallet.service.js +0 -111
- package/dist/lib/wallet/wallet.service.js.map +0 -1
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import type { Provider, EnvironmentProviders } from '@angular/core';
|
|
2
|
+
/**
|
|
3
|
+
* Authentication mode
|
|
4
|
+
*/
|
|
5
|
+
export type AuthMode = 'token' | 'cookie';
|
|
6
|
+
/**
|
|
7
|
+
* Storage type for token mode
|
|
8
|
+
*/
|
|
9
|
+
export type StorageType = 'localStorage' | 'sessionStorage' | 'memory';
|
|
10
|
+
/**
|
|
11
|
+
* Service URL configuration - each microservice has its own URL.
|
|
12
|
+
* All URLs are optional - only configure the services you need.
|
|
13
|
+
*/
|
|
14
|
+
export interface ServiceUrls {
|
|
15
|
+
/** Authentication service URL */
|
|
16
|
+
authentication?: string;
|
|
17
|
+
/** Search service URL */
|
|
18
|
+
search?: string;
|
|
19
|
+
/** Products service URL */
|
|
20
|
+
products?: string;
|
|
21
|
+
/** CRM service URL */
|
|
22
|
+
crm?: string;
|
|
23
|
+
/** Content service URL */
|
|
24
|
+
content?: string;
|
|
25
|
+
/** Geolocation service URL */
|
|
26
|
+
geolocation?: string;
|
|
27
|
+
/** Conversations service URL */
|
|
28
|
+
conversations?: string;
|
|
29
|
+
/** Files service URL */
|
|
30
|
+
files?: string;
|
|
31
|
+
/** Forms service URL */
|
|
32
|
+
forms?: string;
|
|
33
|
+
/** Assets service URL */
|
|
34
|
+
assets?: string;
|
|
35
|
+
/** Campaigns service URL */
|
|
36
|
+
campaigns?: string;
|
|
37
|
+
/** Company service URL */
|
|
38
|
+
company?: string;
|
|
39
|
+
/** Rewards service URL */
|
|
40
|
+
rewards?: string;
|
|
41
|
+
/** Sales service URL */
|
|
42
|
+
sales?: string;
|
|
43
|
+
/** Wallet service URL */
|
|
44
|
+
wallet?: string;
|
|
45
|
+
/** Jarvis (AI) service URL */
|
|
46
|
+
jarvis?: string;
|
|
47
|
+
/** Onboarding service URL */
|
|
48
|
+
onboarding?: string;
|
|
49
|
+
/** University (LMS) service URL */
|
|
50
|
+
university?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Configuration for providing 23blocks services
|
|
54
|
+
*/
|
|
55
|
+
export interface ProviderConfig {
|
|
56
|
+
/**
|
|
57
|
+
* Service URLs for each microservice.
|
|
58
|
+
* Only configure the services you need - accessing a service without
|
|
59
|
+
* a configured URL will throw an error.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```typescript
|
|
63
|
+
* provideBlocks23({
|
|
64
|
+
* appId: 'your-app-id',
|
|
65
|
+
* urls: {
|
|
66
|
+
* authentication: 'https://gateway.23blocks.com',
|
|
67
|
+
* crm: 'https://crm.23blocks.com',
|
|
68
|
+
* products: 'https://products.23blocks.com',
|
|
69
|
+
* },
|
|
70
|
+
* })
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
urls: ServiceUrls;
|
|
74
|
+
/**
|
|
75
|
+
* Application ID
|
|
76
|
+
*/
|
|
77
|
+
appId: string;
|
|
78
|
+
/**
|
|
79
|
+
* Tenant ID (optional, for multi-tenant setups)
|
|
80
|
+
*/
|
|
81
|
+
tenantId?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Authentication mode
|
|
84
|
+
* - 'token' (default): SDK stores tokens in localStorage/sessionStorage/memory
|
|
85
|
+
* - 'cookie': Backend manages auth via httpOnly cookies
|
|
86
|
+
*/
|
|
87
|
+
authMode?: AuthMode;
|
|
88
|
+
/**
|
|
89
|
+
* Storage type for token mode
|
|
90
|
+
* @default 'localStorage'
|
|
91
|
+
*/
|
|
92
|
+
storage?: StorageType;
|
|
93
|
+
/**
|
|
94
|
+
* Additional headers to include with every request
|
|
95
|
+
*/
|
|
96
|
+
headers?: Record<string, string>;
|
|
97
|
+
/**
|
|
98
|
+
* Request timeout in milliseconds
|
|
99
|
+
* @default 30000
|
|
100
|
+
*/
|
|
101
|
+
timeout?: number;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Injection token for the token manager (internal use)
|
|
105
|
+
*/
|
|
106
|
+
export declare const TOKEN_MANAGER: any;
|
|
107
|
+
/**
|
|
108
|
+
* Injection token for provider config
|
|
109
|
+
*/
|
|
110
|
+
export declare const PROVIDER_CONFIG: any;
|
|
111
|
+
/** @deprecated Use PROVIDER_CONFIG instead */
|
|
112
|
+
export declare const SIMPLE_CONFIG: any;
|
|
113
|
+
/**
|
|
114
|
+
* Token manager interface
|
|
115
|
+
*/
|
|
116
|
+
export interface TokenManagerService {
|
|
117
|
+
getAccessToken(): string | null;
|
|
118
|
+
getRefreshToken(): string | null;
|
|
119
|
+
setTokens(accessToken: string, refreshToken?: string): void;
|
|
120
|
+
clearTokens(): void;
|
|
121
|
+
/**
|
|
122
|
+
* Subscribe to storage changes from other tabs/windows.
|
|
123
|
+
* Returns an unsubscribe function.
|
|
124
|
+
*/
|
|
125
|
+
onStorageChange(callback: () => void): () => void;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Provide 23blocks services with simplified configuration.
|
|
129
|
+
*
|
|
130
|
+
* This is the recommended way to set up 23blocks in new Angular applications.
|
|
131
|
+
* It automatically handles token storage and authentication headers.
|
|
132
|
+
*
|
|
133
|
+
* Services are only available if their URL is configured. Accessing a service
|
|
134
|
+
* without a configured URL will throw an error.
|
|
135
|
+
*
|
|
136
|
+
* @example Basic usage with multiple services
|
|
137
|
+
* ```typescript
|
|
138
|
+
* // app.config.ts
|
|
139
|
+
* import { ApplicationConfig } from '@angular/core';
|
|
140
|
+
* import { provideBlocks23 } from '@23blocks/angular';
|
|
141
|
+
*
|
|
142
|
+
* export const appConfig: ApplicationConfig = {
|
|
143
|
+
* providers: [
|
|
144
|
+
* provideBlocks23({
|
|
145
|
+
* appId: 'your-app-id',
|
|
146
|
+
* urls: {
|
|
147
|
+
* authentication: 'https://gateway.23blocks.com',
|
|
148
|
+
* crm: 'https://crm.23blocks.com',
|
|
149
|
+
* products: 'https://products.23blocks.com',
|
|
150
|
+
* },
|
|
151
|
+
* }),
|
|
152
|
+
* ],
|
|
153
|
+
* };
|
|
154
|
+
* ```
|
|
155
|
+
*
|
|
156
|
+
* @example Cookie mode (recommended for security)
|
|
157
|
+
* ```typescript
|
|
158
|
+
* export const appConfig: ApplicationConfig = {
|
|
159
|
+
* providers: [
|
|
160
|
+
* provideBlocks23({
|
|
161
|
+
* appId: 'your-app-id',
|
|
162
|
+
* authMode: 'cookie',
|
|
163
|
+
* urls: {
|
|
164
|
+
* authentication: 'https://gateway.23blocks.com',
|
|
165
|
+
* crm: 'https://crm.23blocks.com',
|
|
166
|
+
* },
|
|
167
|
+
* }),
|
|
168
|
+
* ],
|
|
169
|
+
* };
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
export declare function provideBlocks23(config: ProviderConfig): EnvironmentProviders;
|
|
173
|
+
/**
|
|
174
|
+
* Get providers array for NgModule-based applications with simplified config.
|
|
175
|
+
*
|
|
176
|
+
* Services are only available if their URL is configured. Accessing a service
|
|
177
|
+
* without a configured URL will throw an error.
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* ```typescript
|
|
181
|
+
* // app.module.ts
|
|
182
|
+
* import { NgModule } from '@angular/core';
|
|
183
|
+
* import { getBlocks23Providers } from '@23blocks/angular';
|
|
184
|
+
*
|
|
185
|
+
* @NgModule({
|
|
186
|
+
* providers: [
|
|
187
|
+
* ...getBlocks23Providers({
|
|
188
|
+
* appId: 'your-app-id',
|
|
189
|
+
* urls: {
|
|
190
|
+
* authentication: 'https://gateway.23blocks.com',
|
|
191
|
+
* crm: 'https://crm.23blocks.com',
|
|
192
|
+
* },
|
|
193
|
+
* }),
|
|
194
|
+
* ],
|
|
195
|
+
* })
|
|
196
|
+
* export class AppModule {}
|
|
197
|
+
* ```
|
|
198
|
+
*/
|
|
199
|
+
export declare function getBlocks23Providers(config: ProviderConfig): Provider[];
|
|
200
|
+
/** @deprecated Use `ProviderConfig` instead */
|
|
201
|
+
export type Simple23BlocksConfig = ProviderConfig;
|
|
202
|
+
//# sourceMappingURL=simple-providers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simple-providers.d.ts","sourceRoot":"","sources":["../../../src/lib/simple-providers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AA8CpE;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE1C;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,gBAAgB,GAAG,QAAQ,CAAC;AAEvE;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,iCAAiC;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yBAAyB;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sBAAsB;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8BAA8B;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gCAAgC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0BAA0B;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0BAA0B;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wBAAwB;I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Ae,CAAC,MAAM,EAAE,cAAc,GAAG,oBAAoB,CA+F5E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,QAAQ,EAAE,CA0FvE;AAMD,+CAA+C;AAC/C,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Use per-service transport tokens (AUTHENTICATION_TRANSPORT, etc.)
|
|
3
|
+
* Shared transport token - only for backward compatibility with advanced API
|
|
4
|
+
*/
|
|
5
|
+
export declare const TRANSPORT: any;
|
|
6
|
+
/** Transport for Authentication service */
|
|
7
|
+
export declare const AUTHENTICATION_TRANSPORT: any;
|
|
8
|
+
/** Transport for Search service */
|
|
9
|
+
export declare const SEARCH_TRANSPORT: any;
|
|
10
|
+
/** Transport for Products service */
|
|
11
|
+
export declare const PRODUCTS_TRANSPORT: any;
|
|
12
|
+
/** Transport for CRM service */
|
|
13
|
+
export declare const CRM_TRANSPORT: any;
|
|
14
|
+
/** Transport for Content service */
|
|
15
|
+
export declare const CONTENT_TRANSPORT: any;
|
|
16
|
+
/** Transport for Geolocation service */
|
|
17
|
+
export declare const GEOLOCATION_TRANSPORT: any;
|
|
18
|
+
/** Transport for Conversations service */
|
|
19
|
+
export declare const CONVERSATIONS_TRANSPORT: any;
|
|
20
|
+
/** Transport for Files service */
|
|
21
|
+
export declare const FILES_TRANSPORT: any;
|
|
22
|
+
/** Transport for Forms service */
|
|
23
|
+
export declare const FORMS_TRANSPORT: any;
|
|
24
|
+
/** Transport for Assets service */
|
|
25
|
+
export declare const ASSETS_TRANSPORT: any;
|
|
26
|
+
/** Transport for Campaigns service */
|
|
27
|
+
export declare const CAMPAIGNS_TRANSPORT: any;
|
|
28
|
+
/** Transport for Company service */
|
|
29
|
+
export declare const COMPANY_TRANSPORT: any;
|
|
30
|
+
/** Transport for Rewards service */
|
|
31
|
+
export declare const REWARDS_TRANSPORT: any;
|
|
32
|
+
/** Transport for Sales service */
|
|
33
|
+
export declare const SALES_TRANSPORT: any;
|
|
34
|
+
/** Transport for Wallet service */
|
|
35
|
+
export declare const WALLET_TRANSPORT: any;
|
|
36
|
+
/** Transport for Jarvis service */
|
|
37
|
+
export declare const JARVIS_TRANSPORT: any;
|
|
38
|
+
/** Transport for Onboarding service */
|
|
39
|
+
export declare const ONBOARDING_TRANSPORT: any;
|
|
40
|
+
/** Transport for University service */
|
|
41
|
+
export declare const UNIVERSITY_TRANSPORT: any;
|
|
42
|
+
/**
|
|
43
|
+
* Injection token for Authentication block configuration
|
|
44
|
+
*/
|
|
45
|
+
export declare const AUTHENTICATION_CONFIG: any;
|
|
46
|
+
/**
|
|
47
|
+
* Injection token for Search block configuration
|
|
48
|
+
*/
|
|
49
|
+
export declare const SEARCH_CONFIG: any;
|
|
50
|
+
/**
|
|
51
|
+
* Injection token for Geolocation block configuration
|
|
52
|
+
*/
|
|
53
|
+
export declare const GEOLOCATION_CONFIG: any;
|
|
54
|
+
/**
|
|
55
|
+
* Injection token for Content block configuration
|
|
56
|
+
*/
|
|
57
|
+
export declare const CONTENT_CONFIG: any;
|
|
58
|
+
/**
|
|
59
|
+
* Injection token for CRM block configuration
|
|
60
|
+
*/
|
|
61
|
+
export declare const CRM_CONFIG: any;
|
|
62
|
+
/**
|
|
63
|
+
* Injection token for Products block configuration
|
|
64
|
+
*/
|
|
65
|
+
export declare const PRODUCTS_CONFIG: any;
|
|
66
|
+
/**
|
|
67
|
+
* Injection token for Conversations block configuration
|
|
68
|
+
*/
|
|
69
|
+
export declare const CONVERSATIONS_CONFIG: any;
|
|
70
|
+
/**
|
|
71
|
+
* Injection token for Files block configuration
|
|
72
|
+
*/
|
|
73
|
+
export declare const FILES_CONFIG: any;
|
|
74
|
+
/**
|
|
75
|
+
* Injection token for Assets block configuration
|
|
76
|
+
*/
|
|
77
|
+
export declare const ASSETS_CONFIG: any;
|
|
78
|
+
/**
|
|
79
|
+
* Injection token for Forms block configuration
|
|
80
|
+
*/
|
|
81
|
+
export declare const FORMS_CONFIG: any;
|
|
82
|
+
/**
|
|
83
|
+
* Injection token for Sales block configuration
|
|
84
|
+
*/
|
|
85
|
+
export declare const SALES_CONFIG: any;
|
|
86
|
+
/**
|
|
87
|
+
* Injection token for Campaigns block configuration
|
|
88
|
+
*/
|
|
89
|
+
export declare const CAMPAIGNS_CONFIG: any;
|
|
90
|
+
/**
|
|
91
|
+
* Injection token for Company block configuration
|
|
92
|
+
*/
|
|
93
|
+
export declare const COMPANY_CONFIG: any;
|
|
94
|
+
/**
|
|
95
|
+
* Injection token for Rewards block configuration
|
|
96
|
+
*/
|
|
97
|
+
export declare const REWARDS_CONFIG: any;
|
|
98
|
+
/**
|
|
99
|
+
* Injection token for Jarvis block configuration
|
|
100
|
+
*/
|
|
101
|
+
export declare const JARVIS_CONFIG: any;
|
|
102
|
+
/**
|
|
103
|
+
* Injection token for Onboarding block configuration
|
|
104
|
+
*/
|
|
105
|
+
export declare const ONBOARDING_CONFIG: any;
|
|
106
|
+
/**
|
|
107
|
+
* Injection token for University block configuration
|
|
108
|
+
*/
|
|
109
|
+
export declare const UNIVERSITY_CONFIG: any;
|
|
110
|
+
/**
|
|
111
|
+
* Injection token for Wallet block configuration
|
|
112
|
+
*/
|
|
113
|
+
export declare const WALLET_CONFIG: any;
|
|
114
|
+
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../src/lib/tokens.ts"],"names":[],"mappings":"AAyBA;;;GAGG;AACH,eAAO,MAAM,SAAS,KAAsD,CAAC;AAE7E,2CAA2C;AAC3C,eAAO,MAAM,wBAAwB,KAA4E,CAAC;AAElH,mCAAmC;AACnC,eAAO,MAAM,gBAAgB,KAAoE,CAAC;AAElG,qCAAqC;AACrC,eAAO,MAAM,kBAAkB,KAAsE,CAAC;AAEtG,gCAAgC;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,aAAa,KAEzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,KAExB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,KAExB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,KAE5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,KAE1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,KAE1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,KAEzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,KAE7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,KAE7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,KAEzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/university/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import type { Transport, PageResult } from '@23blocks/contracts';
|
|
3
|
+
import { type UniversityBlock, type UniversityBlockConfig, type Course, type CreateCourseRequest, type UpdateCourseRequest, type ListCoursesParams, type Lesson, type CreateLessonRequest, type UpdateLessonRequest, type ListLessonsParams, type ReorderLessonsRequest, type Enrollment, type EnrollRequest, type UpdateEnrollmentProgressRequest, type ListEnrollmentsParams, type Assignment, type CreateAssignmentRequest, type UpdateAssignmentRequest, type ListAssignmentsParams, type Submission, type SubmitAssignmentRequest, type GradeSubmissionRequest, type ListSubmissionsParams } from '@23blocks/block-university';
|
|
4
|
+
/**
|
|
5
|
+
* Angular service wrapping the University block.
|
|
6
|
+
* Converts Promise-based APIs to RxJS Observables.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* @Component({...})
|
|
11
|
+
* export class CourseListComponent {
|
|
12
|
+
* constructor(private university: UniversityService) {}
|
|
13
|
+
*
|
|
14
|
+
* loadCourses() {
|
|
15
|
+
* this.university.listCourses({ page: 1, perPage: 10 }).subscribe({
|
|
16
|
+
* next: (result) => console.log('Courses:', result.data),
|
|
17
|
+
* error: (err) => console.error('Failed:', err),
|
|
18
|
+
* });
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare class UniversityService {
|
|
24
|
+
private readonly block;
|
|
25
|
+
constructor(serviceTransport: Transport | null, legacyTransport: Transport | null, config: UniversityBlockConfig);
|
|
26
|
+
/**
|
|
27
|
+
* Ensure the service is configured, throw helpful error if not
|
|
28
|
+
*/
|
|
29
|
+
private ensureConfigured;
|
|
30
|
+
listCourses(params?: ListCoursesParams): Observable<PageResult<Course>>;
|
|
31
|
+
getCourse(uniqueId: string): Observable<Course>;
|
|
32
|
+
createCourse(data: CreateCourseRequest): Observable<Course>;
|
|
33
|
+
updateCourse(uniqueId: string, data: UpdateCourseRequest): Observable<Course>;
|
|
34
|
+
deleteCourse(uniqueId: string): Observable<void>;
|
|
35
|
+
publishCourse(uniqueId: string): Observable<Course>;
|
|
36
|
+
unpublishCourse(uniqueId: string): Observable<Course>;
|
|
37
|
+
listCoursesByInstructor(instructorUniqueId: string, params?: ListCoursesParams): Observable<PageResult<Course>>;
|
|
38
|
+
listCoursesByCategory(categoryUniqueId: string, params?: ListCoursesParams): Observable<PageResult<Course>>;
|
|
39
|
+
listLessons(params?: ListLessonsParams): Observable<PageResult<Lesson>>;
|
|
40
|
+
getLesson(uniqueId: string): Observable<Lesson>;
|
|
41
|
+
createLesson(data: CreateLessonRequest): Observable<Lesson>;
|
|
42
|
+
updateLesson(uniqueId: string, data: UpdateLessonRequest): Observable<Lesson>;
|
|
43
|
+
deleteLesson(uniqueId: string): Observable<void>;
|
|
44
|
+
reorderLessons(courseUniqueId: string, data: ReorderLessonsRequest): Observable<Lesson[]>;
|
|
45
|
+
listLessonsByCourse(courseUniqueId: string, params?: ListLessonsParams): Observable<PageResult<Lesson>>;
|
|
46
|
+
listEnrollments(params?: ListEnrollmentsParams): Observable<PageResult<Enrollment>>;
|
|
47
|
+
getEnrollment(uniqueId: string): Observable<Enrollment>;
|
|
48
|
+
enroll(data: EnrollRequest): Observable<Enrollment>;
|
|
49
|
+
updateEnrollmentProgress(uniqueId: string, data: UpdateEnrollmentProgressRequest): Observable<Enrollment>;
|
|
50
|
+
completeEnrollment(uniqueId: string): Observable<Enrollment>;
|
|
51
|
+
dropEnrollment(uniqueId: string): Observable<Enrollment>;
|
|
52
|
+
listEnrollmentsByCourse(courseUniqueId: string, params?: ListEnrollmentsParams): Observable<PageResult<Enrollment>>;
|
|
53
|
+
listEnrollmentsByUser(userUniqueId: string, params?: ListEnrollmentsParams): Observable<PageResult<Enrollment>>;
|
|
54
|
+
getCertificate(uniqueId: string): Observable<{
|
|
55
|
+
certificateUrl: string;
|
|
56
|
+
}>;
|
|
57
|
+
listAssignments(params?: ListAssignmentsParams): Observable<PageResult<Assignment>>;
|
|
58
|
+
getAssignment(uniqueId: string): Observable<Assignment>;
|
|
59
|
+
createAssignment(data: CreateAssignmentRequest): Observable<Assignment>;
|
|
60
|
+
updateAssignment(uniqueId: string, data: UpdateAssignmentRequest): Observable<Assignment>;
|
|
61
|
+
deleteAssignment(uniqueId: string): Observable<void>;
|
|
62
|
+
listAssignmentsByLesson(lessonUniqueId: string, params?: ListAssignmentsParams): Observable<PageResult<Assignment>>;
|
|
63
|
+
listSubmissions(params?: ListSubmissionsParams): Observable<PageResult<Submission>>;
|
|
64
|
+
getSubmission(uniqueId: string): Observable<Submission>;
|
|
65
|
+
submitAssignment(data: SubmitAssignmentRequest): Observable<Submission>;
|
|
66
|
+
gradeSubmission(uniqueId: string, data: GradeSubmissionRequest): Observable<Submission>;
|
|
67
|
+
listSubmissionsByAssignment(assignmentUniqueId: string, params?: ListSubmissionsParams): Observable<PageResult<Submission>>;
|
|
68
|
+
listSubmissionsByUser(userUniqueId: string, params?: ListSubmissionsParams): Observable<PageResult<Submission>>;
|
|
69
|
+
/**
|
|
70
|
+
* Access the underlying block for advanced operations
|
|
71
|
+
* Use this when you need access to services not wrapped by this Angular service
|
|
72
|
+
*/
|
|
73
|
+
get rawBlock(): UniversityBlock;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=university.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"university.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/university/university.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAQ,MAAM,MAAM,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,MAAM,EACX,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,MAAM,EACX,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,+BAA+B,EACpC,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC3B,MAAM,4BAA4B,CAAC;AAGpC;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBACa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAyB;gBAGH,gBAAgB,EAAE,SAAS,GAAG,IAAI,EAC7C,eAAe,EAAE,SAAS,GAAG,IAAI,EACrC,MAAM,EAAE,qBAAqB;IAM1D;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAcxB,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EAAE,IAAI,EAAE,uBAAuB,GAAG,UAAU,CAAC,UAAU,CAAC;IAIzF,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC;IAIpD,uBAAuB,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,qBAAqB,GAAG,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAQnH,eAAe,CAAC,MAAM,CAAC,EAAE,qBAAqB,GAAG,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAInF,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAAC,UAAU,CAAC;IAIvD,gBAAgB,CAAC,IAAI,EAAE,uBAAuB,GAAG,UAAU,CAAC,UAAU,CAAC;IAIvE,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,sBAAsB,GAAG,UAAU,CAAC,UAAU,CAAC;IAIvF,2BAA2B,CAAC,kBAAkB,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,qBAAqB,GAAG,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAI3H,qBAAqB,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,qBAAqB,GAAG,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAQ/G;;;OAGG;IACH,IAAI,QAAQ,IAAI,eAAe,CAE9B;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/wallet/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import type { Transport, PageResult } from '@23blocks/contracts';
|
|
3
|
+
import { type WalletBlock, type WalletBlockConfig, type Wallet, type CreateWalletRequest, type UpdateWalletRequest, type ListWalletsParams, type CreditWalletRequest, type DebitWalletRequest, type Transaction, type ListTransactionsParams, type AuthorizationCode, type CreateAuthorizationCodeRequest, type ValidateAuthorizationCodeRequest, type UseAuthorizationCodeRequest, type ListAuthorizationCodesParams } from '@23blocks/block-wallet';
|
|
4
|
+
/**
|
|
5
|
+
* Angular service wrapping the Wallet block.
|
|
6
|
+
* Converts Promise-based APIs to RxJS Observables.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* @Component({...})
|
|
11
|
+
* export class WalletComponent {
|
|
12
|
+
* constructor(private wallet: WalletService) {}
|
|
13
|
+
*
|
|
14
|
+
* createWallet(userUniqueId: string) {
|
|
15
|
+
* this.wallet.createWallet({ userUniqueId }).subscribe({
|
|
16
|
+
* next: (wallet) => console.log('Created:', wallet),
|
|
17
|
+
* error: (err) => console.error('Failed:', err),
|
|
18
|
+
* });
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare class WalletService {
|
|
24
|
+
private readonly block;
|
|
25
|
+
constructor(serviceTransport: Transport | null, legacyTransport: Transport | null, config: WalletBlockConfig);
|
|
26
|
+
/**
|
|
27
|
+
* Ensure the service is configured, throw helpful error if not
|
|
28
|
+
*/
|
|
29
|
+
private ensureConfigured;
|
|
30
|
+
listWallets(params?: ListWalletsParams): Observable<PageResult<Wallet>>;
|
|
31
|
+
getWallet(uniqueId: string): Observable<Wallet>;
|
|
32
|
+
getWalletByUser(userUniqueId: string): Observable<Wallet>;
|
|
33
|
+
createWallet(data: CreateWalletRequest): Observable<Wallet>;
|
|
34
|
+
updateWallet(uniqueId: string, data: UpdateWalletRequest): Observable<Wallet>;
|
|
35
|
+
creditWallet(uniqueId: string, data: CreditWalletRequest): Observable<Transaction>;
|
|
36
|
+
debitWallet(uniqueId: string, data: DebitWalletRequest): Observable<Transaction>;
|
|
37
|
+
getWalletBalance(uniqueId: string): Observable<{
|
|
38
|
+
balance: number;
|
|
39
|
+
currency: string;
|
|
40
|
+
}>;
|
|
41
|
+
listTransactions(params?: ListTransactionsParams): Observable<PageResult<Transaction>>;
|
|
42
|
+
getTransaction(uniqueId: string): Observable<Transaction>;
|
|
43
|
+
listTransactionsByWallet(walletUniqueId: string, params?: ListTransactionsParams): Observable<PageResult<Transaction>>;
|
|
44
|
+
listTransactionsByReference(referenceType: string, referenceUniqueId: string, params?: ListTransactionsParams): Observable<PageResult<Transaction>>;
|
|
45
|
+
listAuthorizationCodes(params?: ListAuthorizationCodesParams): Observable<PageResult<AuthorizationCode>>;
|
|
46
|
+
getAuthorizationCode(uniqueId: string): Observable<AuthorizationCode>;
|
|
47
|
+
createAuthorizationCode(data: CreateAuthorizationCodeRequest): Observable<AuthorizationCode>;
|
|
48
|
+
validateAuthorizationCode(data: ValidateAuthorizationCodeRequest): Observable<{
|
|
49
|
+
valid: boolean;
|
|
50
|
+
authorizationCode?: AuthorizationCode;
|
|
51
|
+
}>;
|
|
52
|
+
useAuthorizationCode(data: UseAuthorizationCodeRequest): Observable<Transaction>;
|
|
53
|
+
invalidateAuthorizationCode(uniqueId: string): Observable<AuthorizationCode>;
|
|
54
|
+
/**
|
|
55
|
+
* Access the underlying block for advanced operations
|
|
56
|
+
* Use this when you need access to services not wrapped by this Angular service
|
|
57
|
+
*/
|
|
58
|
+
get rawBlock(): WalletBlock;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=wallet.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/wallet/wallet.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAQ,MAAM,MAAM,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,MAAM,EACX,KAAK,mBAAmB,EACxB,KAAK,m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sBAAsB,GAAG,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAItF,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC;IAIzD,wBAAwB,CACtB,cAAc,EAAE,MAAM,EACtB,MAAM,CAAC,EAAE,sBAAsB,GAC9B,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAItC,2BAA2B,CACzB,aAAa,EAAE,MAAM,EACrB,iBAAiB,EAAE,MAAM,EACzB,MAAM,CAAC,EAAE,sBAAsB,GAC9B,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAQtC,sBAAsB,CAAC,MAAM,CAAC,EAAE,4BAA4B,GAAG,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAIxG,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAAC,iBAAiB,CAAC;IAIrE,uBAAuB,CAAC,IAAI,EAAE,8BAA8B,GAAG,UAAU,CAAC,iBAAiB,CAAC;IAI5F,yBAAyB,CACvB,IAAI,EAAE,gCAAgC,GACrC,UAAU,CAAC;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;KAAE,CAAC;IAIxE,oBAAoB,CAAC,IAAI,EAAE,2BAA2B,GAAG,UAAU,CAAC,WAAW,CAAC;IAIhF,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAAC,iBAAiB,CAAC;IAQ5E;;;OAGG;IACH,IAAI,QAAQ,IAAI,WAAW,CAE1B;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@23blocks/angular",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Angular bindings for 23blocks SDK - Injectable services with RxJS Observables",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "23blocks <hello@23blocks.com>",
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
"injectable"
|
|
23
23
|
],
|
|
24
24
|
"type": "module",
|
|
25
|
-
"main": "./dist/index.js",
|
|
26
|
-
"module": "./dist/index.js",
|
|
25
|
+
"main": "./dist/index.esm.js",
|
|
26
|
+
"module": "./dist/index.esm.js",
|
|
27
27
|
"types": "./dist/index.d.ts",
|
|
28
28
|
"exports": {
|
|
29
29
|
"./package.json": "./package.json",
|
|
30
30
|
".": {
|
|
31
31
|
"types": "./dist/index.d.ts",
|
|
32
|
-
"import": "./dist/index.js",
|
|
33
|
-
"default": "./dist/index.js"
|
|
32
|
+
"import": "./dist/index.esm.js",
|
|
33
|
+
"default": "./dist/index.esm.js"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"sourceRoot": "packages/angular/src",
|
|
42
42
|
"targets": {
|
|
43
43
|
"build": {
|
|
44
|
-
"executor": "@nx/
|
|
44
|
+
"executor": "@nx/rollup:rollup",
|
|
45
45
|
"outputs": [
|
|
46
46
|
"{options.outputPath}"
|
|
47
47
|
],
|
|
@@ -49,8 +49,10 @@
|
|
|
49
49
|
"outputPath": "packages/angular/dist",
|
|
50
50
|
"main": "packages/angular/src/index.ts",
|
|
51
51
|
"tsConfig": "packages/angular/tsconfig.lib.json",
|
|
52
|
-
"
|
|
53
|
-
"
|
|
52
|
+
"compiler": "swc",
|
|
53
|
+
"format": [
|
|
54
|
+
"esm"
|
|
55
|
+
]
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
58
|
}
|
package/dist/index.js
DELETED
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './lib/index.js';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,iBAAiB"}
|