@plyaz/core 1.0.0 → 1.0.2
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/README.md +38 -300
- package/dist/base/cache/index.d.ts.map +1 -0
- package/dist/base/cache/strategies/memory.d.ts.map +1 -0
- package/dist/base/cache/strategies/redis.d.ts.map +1 -0
- package/dist/base/index.d.ts +5 -0
- package/dist/base/index.d.ts.map +1 -0
- package/dist/domain/featureFlags/provider.d.ts +1 -1
- package/dist/domain/featureFlags/provider.d.ts.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/cache/index.d.ts.map +0 -1
- package/dist/cache/strategies/memory.d.ts.map +0 -1
- package/dist/cache/strategies/redis.d.ts.map +0 -1
- /package/dist/{cache → base/cache}/index.d.ts +0 -0
- /package/dist/{cache → base/cache}/strategies/memory.d.ts +0 -0
- /package/dist/{cache → base/cache}/strategies/redis.d.ts +0 -0
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ The `@plyaz/core` package serves as the orchestration layer that combines functi
|
|
|
13
13
|
|
|
14
14
|
## 🏗️ Architecture Philosophy
|
|
15
15
|
|
|
16
|
-
`@plyaz/core` acts as the **orchestration layer** - it
|
|
16
|
+
`@plyaz/core` acts as the **orchestration layer** - while it primarily coordinates between specialized packages, it also implements core business logic, domain models, and foundational utilities that are central to the Plyaz ecosystem:
|
|
17
17
|
|
|
18
18
|
```typescript
|
|
19
19
|
// Core orchestrates other packages
|
|
@@ -30,322 +30,54 @@ import { createLogger } from '@plyaz/logger';
|
|
|
30
30
|
```
|
|
31
31
|
@plyaz/core/
|
|
32
32
|
├── src/
|
|
33
|
-
│ ├──
|
|
34
|
-
│
|
|
33
|
+
│ ├── base/ # Generic functionalities used across domain, engine, and other layers
|
|
34
|
+
│ │ └── cache/ # Caching system for performance optimization
|
|
35
|
+
│ ├── domain/ # Pure business domain logic
|
|
35
36
|
│ │ ├── user/ # User entity models and business rules
|
|
36
37
|
│ │ ├── asset/ # Digital asset models and economics
|
|
37
38
|
│ │ ├── transaction/ # Transaction domain and validation
|
|
38
39
|
│ │ └── community/ # Community governance and interaction
|
|
40
|
+
│ │ └── featureFlags/ # Domain logic feature flag system
|
|
39
41
|
│ ├── engine/ # Core computational engines
|
|
40
42
|
│ │ ├── calculation/ # Mathematical computation algorithms
|
|
41
43
|
│ │ ├── incentive/ # Reward and incentive systems
|
|
42
44
|
│ │ ├── validation/ # Business rule validation engines
|
|
43
45
|
│ │ └── insights/ # Data analysis and pattern recognition
|
|
44
|
-
│
|
|
46
|
+
│ │ └── featureFlags/ # Engine feature flag system
|
|
45
47
|
│ ├── frontend/ # Frontend-specific implementations
|
|
48
|
+
│ │ └── featureFlags/ # Frontend hooks, providers of feature flag system
|
|
46
49
|
│ ├── backend/ # Backend-specific implementations
|
|
50
|
+
│ │ └── featureFlags/ # Backend service, module, controller, repository of feature flag system. Generally in NestJs, but should be compatible without NestJs.
|
|
47
51
|
│ ├── sdk/ # B2B SDK foundation
|
|
48
52
|
│ └── contracts/ # External service contracts
|
|
49
53
|
```
|
|
50
54
|
|
|
51
|
-
## 🚀
|
|
55
|
+
## 🚀 Currently Available Features
|
|
52
56
|
|
|
53
|
-
|
|
57
|
+
### Feature Flag System
|
|
58
|
+
- **Providers**: Memory (implemented), Redis/API/Database/File (stubs)
|
|
59
|
+
- **Frontend**: React hooks and context providers
|
|
60
|
+
- **Backend**: NestJS module with service, controller, and repository
|
|
61
|
+
- **Engine**: Rule-based evaluation with targeting and rollouts
|
|
62
|
+
- **Testing**: Override capabilities for test scenarios
|
|
54
63
|
|
|
55
|
-
###
|
|
64
|
+
### Cache System
|
|
65
|
+
- **Strategies**: Memory with LRU eviction (implemented), Redis (stub)
|
|
66
|
+
- **Features**: TTL management, statistics, automatic cleanup
|
|
67
|
+
- **Integration**: Used internally by feature flag system
|
|
56
68
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
@Module({
|
|
62
|
-
imports: [
|
|
63
|
-
FeatureFlagModule.forRoot({
|
|
64
|
-
provider: 'redis',
|
|
65
|
-
isCacheEnabled: true,
|
|
66
|
-
cacheTtl: 600,
|
|
67
|
-
redisConfig: { url: 'redis://localhost:6379' }
|
|
68
|
-
})
|
|
69
|
-
],
|
|
70
|
-
})
|
|
71
|
-
export class AppModule {}
|
|
72
|
-
|
|
73
|
-
// my.service.ts
|
|
74
|
-
import { FeatureFlagService } from '@plyaz/core/backend';
|
|
75
|
-
|
|
76
|
-
@Injectable()
|
|
77
|
-
export class MyService {
|
|
78
|
-
constructor(private featureFlagService: FeatureFlagService) {}
|
|
79
|
-
|
|
80
|
-
async processPayment(userId: string) {
|
|
81
|
-
const isEnabled = await this.featureFlagService.isEnabled('NEW_PAYMENT_FLOW', {
|
|
82
|
-
userId,
|
|
83
|
-
environment: 'production'
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
if (isEnabled) {
|
|
87
|
-
// New payment implementation
|
|
88
|
-
} else {
|
|
89
|
-
// Legacy payment implementation
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### Backend Integration (Express/Node.js)
|
|
96
|
-
|
|
97
|
-
```typescript
|
|
98
|
-
// server.js
|
|
99
|
-
import { MemoryFeatureFlagProvider } from '@plyaz/core/domain';
|
|
100
|
-
import { FEATURES } from '@plyaz/config';
|
|
101
|
-
|
|
102
|
-
// Initialize provider
|
|
103
|
-
const featureFlagProvider = new MemoryFeatureFlagProvider({
|
|
104
|
-
provider: 'memory',
|
|
105
|
-
isCacheEnabled: true,
|
|
106
|
-
cacheTtl: 300
|
|
107
|
-
}, FEATURES);
|
|
108
|
-
|
|
109
|
-
await featureFlagProvider.initialize();
|
|
110
|
-
|
|
111
|
-
// Use in routes
|
|
112
|
-
app.get('/api/features/:key', async (req, res) => {
|
|
113
|
-
const evaluation = await featureFlagProvider.getFlag(req.params.key, {
|
|
114
|
-
userId: req.user?.id,
|
|
115
|
-
environment: process.env.NODE_ENV
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
res.json(evaluation);
|
|
119
|
-
});
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### Frontend Integration (React)
|
|
123
|
-
|
|
124
|
-
```typescript
|
|
125
|
-
// App.tsx
|
|
126
|
-
import { FeatureFlagAppProvider } from '@plyaz/core/frontend';
|
|
127
|
-
import { FEATURES } from '@plyaz/config';
|
|
128
|
-
|
|
129
|
-
function App() {
|
|
130
|
-
return (
|
|
131
|
-
<FeatureFlagAppProvider
|
|
132
|
-
config={{
|
|
133
|
-
provider: 'api',
|
|
134
|
-
apiEndpoint: 'https://api.example.com/feature-flags',
|
|
135
|
-
isCacheEnabled: true,
|
|
136
|
-
cacheTtl: 300
|
|
137
|
-
}}
|
|
138
|
-
features={FEATURES}
|
|
139
|
-
>
|
|
140
|
-
<MyApplication />
|
|
141
|
-
</FeatureFlagAppProvider>
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// Component.tsx
|
|
146
|
-
import { useFeatureFlag, useFeatureFlagEnabled } from '@plyaz/core/frontend';
|
|
147
|
-
|
|
148
|
-
function PaymentComponent() {
|
|
149
|
-
// Full feature flag data with loading state
|
|
150
|
-
const { value, isLoading, error } = useFeatureFlag('NEW_PAYMENT_FLOW');
|
|
151
|
-
|
|
152
|
-
// Simple boolean check
|
|
153
|
-
const isGoogleAuthEnabled = useFeatureFlagEnabled('AUTH_GOOGLE');
|
|
154
|
-
|
|
155
|
-
if (isLoading) return <Spinner />;
|
|
156
|
-
|
|
157
|
-
return (
|
|
158
|
-
<div>
|
|
159
|
-
{value && <NewPaymentFlow />}
|
|
160
|
-
{isGoogleAuthEnabled && <GoogleSignInButton />}
|
|
161
|
-
</div>
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### Frontend Integration (Vanilla JavaScript)
|
|
167
|
-
|
|
168
|
-
```typescript
|
|
169
|
-
import { MemoryFeatureFlagProvider } from '@plyaz/core/domain';
|
|
170
|
-
import { FEATURES } from '@plyaz/config';
|
|
171
|
-
|
|
172
|
-
// Initialize provider
|
|
173
|
-
const provider = new MemoryFeatureFlagProvider({
|
|
174
|
-
provider: 'memory',
|
|
175
|
-
isCacheEnabled: true
|
|
176
|
-
}, FEATURES);
|
|
177
|
-
|
|
178
|
-
await provider.initialize();
|
|
179
|
-
|
|
180
|
-
// Check feature flags
|
|
181
|
-
async function renderPaymentButton() {
|
|
182
|
-
const isEnabled = await provider.isEnabled('NEW_PAYMENT_FLOW', {
|
|
183
|
-
userId: getCurrentUserId(),
|
|
184
|
-
environment: 'production'
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
if (isEnabled) {
|
|
188
|
-
document.getElementById('payment-btn').innerHTML = 'New Payment';
|
|
189
|
-
} else {
|
|
190
|
-
document.getElementById('payment-btn').innerHTML = 'Legacy Payment';
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
// Subscribe to changes
|
|
195
|
-
provider.subscribe(() => {
|
|
196
|
-
renderPaymentButton();
|
|
197
|
-
});
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
### Testing Support
|
|
201
|
-
|
|
202
|
-
```typescript
|
|
203
|
-
import { MemoryFeatureFlagProvider } from '@plyaz/core/domain';
|
|
204
|
-
import { FEATURES } from '@plyaz/config';
|
|
205
|
-
|
|
206
|
-
// Initialize for testing with overrides
|
|
207
|
-
const testProvider = new MemoryFeatureFlagProvider({
|
|
208
|
-
provider: 'memory',
|
|
209
|
-
isLoggingEnabled: false
|
|
210
|
-
}, FEATURES);
|
|
211
|
-
|
|
212
|
-
await testProvider.initialize();
|
|
213
|
-
|
|
214
|
-
// Override specific flags for testing
|
|
215
|
-
testProvider.setOverride('NEW_PAYMENT_FLOW', true);
|
|
216
|
-
testProvider.setOverride('BETA_FEATURE', false);
|
|
217
|
-
|
|
218
|
-
// Use in tests
|
|
219
|
-
describe('Payment Flow', () => {
|
|
220
|
-
it('should use new payment flow when enabled', async () => {
|
|
221
|
-
const isEnabled = await testProvider.isEnabled('NEW_PAYMENT_FLOW');
|
|
222
|
-
expect(isEnabled).toBe(true);
|
|
223
|
-
});
|
|
224
|
-
});
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
## 🗄️ Cache System
|
|
228
|
-
|
|
229
|
-
The cache system provides intelligent caching strategies for business logic coordination:
|
|
230
|
-
|
|
231
|
-
### Basic Usage
|
|
232
|
-
|
|
233
|
-
```typescript
|
|
234
|
-
import { CacheManager } from '@plyaz/core/cache';
|
|
235
|
-
|
|
236
|
-
// Initialize with memory strategy
|
|
237
|
-
const cache = new CacheManager({
|
|
238
|
-
isEnabled: true,
|
|
239
|
-
ttl: 300, // 5 minutes
|
|
240
|
-
strategy: 'memory',
|
|
241
|
-
memoryConfig: {
|
|
242
|
-
maxSize: 1000,
|
|
243
|
-
cleanupInterval: 60000 // 1 minute
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
|
|
247
|
-
// Store data
|
|
248
|
-
await cache.set('user:123', userData, 600); // Custom TTL of 10 minutes
|
|
249
|
-
|
|
250
|
-
// Retrieve data
|
|
251
|
-
const user = await cache.get<User>('user:123');
|
|
69
|
+
### Engine Layer
|
|
70
|
+
- **Feature Flag Engine**: Complete evaluation logic with rules and conditions
|
|
71
|
+
- **Future Engines**: Calculation, Incentive, Validation, Insights (planned)
|
|
252
72
|
|
|
253
|
-
|
|
254
|
-
const exists = await cache.has('user:123');
|
|
255
|
-
|
|
256
|
-
// Remove specific key
|
|
257
|
-
await cache.delete('user:123');
|
|
258
|
-
|
|
259
|
-
// Clear all cache
|
|
260
|
-
await cache.clear();
|
|
261
|
-
|
|
262
|
-
// Get cache statistics
|
|
263
|
-
const stats = await cache.getStats();
|
|
264
|
-
console.log(`Cache hit ratio: ${stats.hitRatio}`);
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
### Redis Strategy
|
|
268
|
-
|
|
269
|
-
```typescript
|
|
270
|
-
import { CacheManager } from '@plyaz/core/cache';
|
|
271
|
-
|
|
272
|
-
const cache = new CacheManager({
|
|
273
|
-
isEnabled: true,
|
|
274
|
-
ttl: 300,
|
|
275
|
-
strategy: 'redis',
|
|
276
|
-
redisConfig: {
|
|
277
|
-
url: 'redis://localhost:6379',
|
|
278
|
-
keyPrefix: 'myapp:',
|
|
279
|
-
db: 0
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
### Integration with Feature Flags
|
|
285
|
-
|
|
286
|
-
```typescript
|
|
287
|
-
// Feature flags use the cache system internally
|
|
288
|
-
const provider = new MemoryFeatureFlagProvider({
|
|
289
|
-
provider: 'memory',
|
|
290
|
-
isCacheEnabled: true, // Enables caching
|
|
291
|
-
cacheTtl: 300 // Cache TTL in seconds
|
|
292
|
-
}, FEATURES);
|
|
293
|
-
|
|
294
|
-
// The provider automatically caches evaluations for performance
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
### Business Logic Caching Patterns
|
|
298
|
-
|
|
299
|
-
```typescript
|
|
300
|
-
import { CacheManager } from '@plyaz/core/cache';
|
|
301
|
-
|
|
302
|
-
class UserService {
|
|
303
|
-
constructor(private cache: CacheManager) {}
|
|
304
|
-
|
|
305
|
-
async getUser(userId: string): Promise<User> {
|
|
306
|
-
// Try cache first
|
|
307
|
-
const cacheKey = `user:${userId}`;
|
|
308
|
-
const cached = await this.cache.get<User>(cacheKey);
|
|
309
|
-
|
|
310
|
-
if (cached) {
|
|
311
|
-
return cached;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
// Fetch from database
|
|
315
|
-
const user = await this.fetchUserFromDb(userId);
|
|
316
|
-
|
|
317
|
-
// Cache for future requests
|
|
318
|
-
await this.cache.set(cacheKey, user, 600); // 10 minutes
|
|
319
|
-
|
|
320
|
-
return user;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
async invalidateUser(userId: string): Promise<void> {
|
|
324
|
-
await this.cache.delete(`user:${userId}`);
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
```
|
|
328
|
-
|
|
329
|
-
## 🔧 Key Features
|
|
73
|
+
## 🔧 Key Capabilities
|
|
330
74
|
|
|
331
75
|
- **Environment Isolation**: Complete separation of frontend and backend code
|
|
332
|
-
- **
|
|
333
|
-
- **
|
|
334
|
-
- **
|
|
335
|
-
- **
|
|
336
|
-
- **
|
|
337
|
-
|
|
338
|
-
## 🏛️ Microservice Strategy
|
|
339
|
-
|
|
340
|
-
Install `@plyaz/core` into individual microservices and import only needed functionality:
|
|
341
|
-
|
|
342
|
-
```typescript
|
|
343
|
-
// User Service - only imports user-related functionality
|
|
344
|
-
import { UserDomainService, UserCacheService } from '@plyaz/core/domain';
|
|
345
|
-
|
|
346
|
-
// Asset Service - only imports asset-related functionality
|
|
347
|
-
import { AssetDomainService, CalculationEngine } from '@plyaz/core';
|
|
348
|
-
```
|
|
76
|
+
- **Type Safety**: Full TypeScript support with strict boundaries
|
|
77
|
+
- **Domain-Driven Design**: Clear bounded contexts for business domains
|
|
78
|
+
- **Extensible Architecture**: Provider pattern for easy extension
|
|
79
|
+
- **Performance Optimized**: Built-in caching and efficient evaluation
|
|
80
|
+
- **Testing Support**: Override capabilities and test utilities
|
|
349
81
|
|
|
350
82
|
## 📚 Documentation
|
|
351
83
|
|
|
@@ -353,6 +85,12 @@ For detailed architecture information, implementation guides, and examples:
|
|
|
353
85
|
|
|
354
86
|
**[📖 Full Documentation](https://plyaz.atlassian.net/wiki/spaces/SD/pages/37257227/Core+Package?atlOrigin=eyJpIjoiNmQxZmNhYTllYmZjNDU2Njk0YmRhYWI2M2JkNTA3NDMiLCJwIjoiYyJ9)**
|
|
355
87
|
|
|
88
|
+
### 📄 Confluence Documentation
|
|
89
|
+
|
|
90
|
+
- **[Feature Flag System](https://plyaz.atlassian.net/wiki/spaces/SD/pages/44859395/Feature+Flag+System+plyaz+core?atlOrigin=eyJpIjoiNjEyMWY3N2ViZDUxNDIxZTgxNGRmZWMwNjQwMzhiOTQiLCJwIjoiYyJ9)** - Complete feature flag implementation guide
|
|
91
|
+
- **[Engine Layer](https://plyaz.atlassian.net/wiki/spaces/SD/pages/44892169/Engine+Layer+plyaz+core?atlOrigin=eyJpIjoiYTI5M2JhOTA5M2Q4NDY1ZjkzZjM2Yzk5M2U5MTZlMzUiLCJwIjoiYyJ9)** - Core computational engines documentation
|
|
92
|
+
- **[Cache System](https://plyaz.atlassian.net/wiki/spaces/SD/pages/44892180/Cache+System+plyaz+core?atlOrigin=eyJpIjoiNDU2MTU5MWU0NTQ1NDIyMzk0MzJkNjE3MDkyOWVkZDQiLCJwIjoiYyJ9)** - Caching strategies and implementation
|
|
93
|
+
|
|
356
94
|
## 🔗 Related Packages
|
|
357
95
|
|
|
358
96
|
| Package | Purpose | Core Usage |
|
|
@@ -412,13 +150,13 @@ The package uses TypeScript path aliases for cleaner imports:
|
|
|
412
150
|
|
|
413
151
|
**Before:**
|
|
414
152
|
```typescript
|
|
415
|
-
import { CacheManager } from '../../cache';
|
|
153
|
+
import { CacheManager } from '../../base/cache';
|
|
416
154
|
import { FeatureFlagEngine } from '../../../engine/featureFlags/engine';
|
|
417
155
|
```
|
|
418
156
|
|
|
419
157
|
**After:**
|
|
420
158
|
```typescript
|
|
421
|
-
import { CacheManager } from '@cache/index';
|
|
159
|
+
import { CacheManager } from '@base/cache/index';
|
|
422
160
|
import { FeatureFlagEngine } from '@engine/featureFlags/engine';
|
|
423
161
|
```
|
|
424
162
|
|
|
@@ -428,11 +166,11 @@ import { FeatureFlagEngine } from '@engine/featureFlags/engine';
|
|
|
428
166
|
- `@engine/*` → `src/engine/*`
|
|
429
167
|
- `@backend/*` → `src/backend/*`
|
|
430
168
|
- `@frontend/*` → `src/frontend/*`
|
|
431
|
-
- `@
|
|
169
|
+
- `@base/*` → `src/base/*` (generic functionalities for cross-layer use)
|
|
432
170
|
- `@utils/*` → `src/utils/*`
|
|
433
171
|
- `@tests/*` → `tests/*`
|
|
434
172
|
|
|
435
|
-
**Important:** When importing from index files, always specify `/index` explicitly (e.g., `@cache/index` not `@cache`).
|
|
173
|
+
**Important:** When importing from index files, always specify `/index` explicitly (e.g., `@base/cache/index` not `@base/cache`).
|
|
436
174
|
|
|
437
175
|
---
|
|
438
176
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/base/cache/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAiB,WAAW,EAAc,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAE9F;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,YAAY;IAQX,OAAO,CAAC,MAAM;IAP1B,OAAO,CAAC,QAAQ,CAAgB;IAEhC;;;;OAIG;gBACiB,MAAM,EAAE,WAAW;IAIvC;;;;;;;;OAQG;IACG,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAahE;;;;;;OAMG;IACG,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAe5C;;;;;OAKG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKxC;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAK5B;;;;;OAKG;IACG,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAexC;;;;OAIG;IACG,QAAQ,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAI5C;;;;;;O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OAAO,CAAC,aAAa;CAGtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/base/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,cAAc,SAAS,CAAC"}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { FeatureFlagProvider as IFeatureFlagProvider, FeatureFlagConfig, FeatureFlagContext, FeatureFlagEvaluation, FeatureFlagValue, FetchFeatureFlagDataResponse } from '@plyaz/types';
|
|
11
11
|
import { FeatureFlagEngine } from '@engine/featureFlags/engine';
|
|
12
|
-
import { CacheManager } from '@cache/index';
|
|
12
|
+
import { CacheManager } from '@base/cache/index';
|
|
13
13
|
/**
|
|
14
14
|
* Subscription callback function type
|
|
15
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/domain/featureFlags/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,mBAAmB,IAAI,oBAAoB,EAC3C,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,4BAA4B,EAC7B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/domain/featureFlags/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,mBAAmB,IAAI,oBAAoB,EAC3C,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,4BAA4B,EAC7B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE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GAAG,gBAAgB,EACjC,GAAG,EAAE,cAAc,EACnB,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,CAAC,CAAC;IAKb;;;;;OAKG;IACG,WAAW,CACf,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,cAAc,CAAC,CAAC,CAAC;IAuBjE;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAoB9B;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,EAAE,oBAAoB,GAAG,MAAM,IAAI;IAOrD;;;;;OAKG;IACH,WAAW,CAAC,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,gBAAgB,GAAG,IAAI;IAM/D;;;;OAIG;IACH,cAAc,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;IAMzC;;OAEG;IACH,cAAc,IAAI,IAAI;IAMtB;;OAEG;IACH,OAAO,IAAI,IAAI;IAaf;;;;;;;OAOG;IACH,SAAS,CAAC,gBAAgB,CAAC,GAAG,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,MAAM;IAkBrF;;;;OAIG;IACH,SAAS,CAAC,iBAAiB,IAAI,IAAI;IAUnC;;;;OAIG;IACH,SAAS,CAAC,iBAAiB,IAAI,IAAI;IAUnC;;;;;OAKG;IACH,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;CAKxC"}
|
package/dist/index.cjs
CHANGED
|
@@ -977,7 +977,7 @@ var FeatureFlagEngine = class {
|
|
|
977
977
|
}
|
|
978
978
|
};
|
|
979
979
|
|
|
980
|
-
// src/cache/strategies/memory.ts
|
|
980
|
+
// src/base/cache/strategies/memory.ts
|
|
981
981
|
var MemoryCacheStrategy = class {
|
|
982
982
|
static {
|
|
983
983
|
__name(this, "MemoryCacheStrategy");
|
|
@@ -1157,7 +1157,7 @@ var MemoryCacheStrategy = class {
|
|
|
1157
1157
|
}
|
|
1158
1158
|
};
|
|
1159
1159
|
|
|
1160
|
-
// src/cache/strategies/redis.ts
|
|
1160
|
+
// src/base/cache/strategies/redis.ts
|
|
1161
1161
|
var RedisCacheStrategy = class {
|
|
1162
1162
|
/**
|
|
1163
1163
|
* Creates a new Redis cache strategy.
|
|
@@ -1337,7 +1337,7 @@ var RedisCacheStrategy = class {
|
|
|
1337
1337
|
}
|
|
1338
1338
|
};
|
|
1339
1339
|
|
|
1340
|
-
// src/cache/index.ts
|
|
1340
|
+
// src/base/cache/index.ts
|
|
1341
1341
|
var CacheManager = class {
|
|
1342
1342
|
/**
|
|
1343
1343
|
* Creates a new cache manager with the specified configuration.
|