@furystack/repository 6.1.16 → 7.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/package.json CHANGED
@@ -1,8 +1,25 @@
1
1
  {
2
2
  "name": "@furystack/repository",
3
- "version": "6.1.16",
3
+ "version": "7.0.0",
4
4
  "description": "Repository implementation for FuryStack",
5
- "main": "dist/index.js",
5
+ "type": "module",
6
+ "scripts": {
7
+ "build:es6": "tsc --outDir ./esm"
8
+ },
9
+ "exports": {
10
+ ".": {
11
+ "import": "./esm/index.js",
12
+ "types": "./types/index.d.ts"
13
+ },
14
+ "./package.json": "./package.json"
15
+ },
16
+ "typesVersions": {
17
+ "*": {
18
+ "*": [
19
+ "types/*"
20
+ ]
21
+ }
22
+ },
6
23
  "files": [
7
24
  "dist",
8
25
  "types",
@@ -29,13 +46,13 @@
29
46
  },
30
47
  "homepage": "https://github.com/furystack/furystack",
31
48
  "dependencies": {
32
- "@furystack/core": "^11.3.0",
33
- "@furystack/inject": "^7.1.8",
34
- "@furystack/utils": "^3.1.7"
49
+ "@furystack/core": "^12.0.0",
50
+ "@furystack/inject": "^8.0.0",
51
+ "@furystack/utils": "^4.0.0"
35
52
  },
36
53
  "devDependencies": {
37
- "@types/jest": "^29.5.0"
54
+ "typescript": "^5.0.4",
55
+ "vitest": "^0.30.1"
38
56
  },
39
- "typings": "./types/index.d.ts",
40
57
  "gitHead": "1045d854bfd8c475b7035471d130d401417a2321"
41
58
  }
package/src/data-set.ts CHANGED
@@ -24,7 +24,6 @@ export class DataSet<T, TPrimaryKey extends keyof T, TWritableData = WithOptiona
24
24
 
25
25
  /**
26
26
  * Adds an entity to the DataSet
27
- *
28
27
  * @param injector The injector from the context
29
28
  * @param entities The entities to add
30
29
  * @returns The CreateResult with the created entities
@@ -59,7 +58,6 @@ export class DataSet<T, TPrimaryKey extends keyof T, TWritableData = WithOptiona
59
58
 
60
59
  /**
61
60
  * Updates an entity in the store
62
- *
63
61
  * @param injector The injector from the context
64
62
  * @param id The identifier of the entity
65
63
  * @param change The update
@@ -94,7 +92,6 @@ export class DataSet<T, TPrimaryKey extends keyof T, TWritableData = WithOptiona
94
92
 
95
93
  /**
96
94
  * Returns a Promise with the entity count
97
- *
98
95
  * @param injector The Injector from the context
99
96
  * @param filter The Filter that will be applied
100
97
  * @returns the Count
@@ -111,7 +108,6 @@ export class DataSet<T, TPrimaryKey extends keyof T, TWritableData = WithOptiona
111
108
 
112
109
  /**
113
110
  * Returns a filtered subset of the entity
114
- *
115
111
  * @param injector The Injector from the context
116
112
  * @param filter The Filter definition
117
113
  * @returns A result with the current items
@@ -132,7 +128,6 @@ export class DataSet<T, TPrimaryKey extends keyof T, TWritableData = WithOptiona
132
128
 
133
129
  /**
134
130
  * Returns an entity based on its primary key
135
- *
136
131
  * @param injector The injector from the context
137
132
  * @param key The identifier of the entity
138
133
  * @param select A field list used for projection
@@ -157,7 +152,6 @@ export class DataSet<T, TPrimaryKey extends keyof T, TWritableData = WithOptiona
157
152
 
158
153
  /**
159
154
  * Removes an entity based on its primary key
160
- *
161
155
  * @param injector The Injector from the context
162
156
  * @param key The primary key
163
157
  * @returns A promise that will be resolved / rejected based on the remove success
@@ -5,6 +5,7 @@ import { InMemoryStore, addStore } from '@furystack/core'
5
5
  import { Repository } from './repository'
6
6
  import type { AuthorizationResult, DataSetSettings } from './data-set-setting'
7
7
  import { getDataSetFor, getRepository } from './helpers'
8
+ import { describe, it, expect, vi } from 'vitest'
8
9
 
9
10
  class TestClass {
10
11
  public id = 1
@@ -73,7 +74,7 @@ describe('DataSet', () => {
73
74
 
74
75
  it('should call the add async authorizer and add the entity on pass', async () => {
75
76
  await usingAsync(new Injector(), async (i) => {
76
- const authorizeAdd = jest.fn(async () => ({ isAllowed: true } as AuthorizationResult))
77
+ const authorizeAdd = vi.fn(async () => ({ isAllowed: true } as AuthorizationResult))
77
78
  addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
78
79
 
79
80
  getRepository(i).createDataSet(TestClass, 'id', { authorizeAdd })
@@ -87,7 +88,7 @@ describe('DataSet', () => {
87
88
 
88
89
  it('should throw if the add authorizer returns a non-valid result and should not add a value to the store', async () => {
89
90
  await usingAsync(new Injector(), async (i) => {
90
- const authorizeAdd = jest.fn(async () => ({ isAllowed: false, message: '...' } as AuthorizationResult))
91
+ const authorizeAdd = vi.fn(async () => ({ isAllowed: false, message: '...' } as AuthorizationResult))
91
92
  addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
92
93
 
93
94
  getRepository(i).createDataSet(TestClass, 'id', { authorizeAdd })
@@ -108,7 +109,7 @@ describe('DataSet', () => {
108
109
 
109
110
  it('should modify an entity on add, if modifyOnAdd is provided', async () => {
110
111
  await usingAsync(new Injector(), async (i) => {
111
- const modifyOnAdd = jest.fn(
112
+ const modifyOnAdd = vi.fn(
112
113
  async (options: { injector: Injector; entity: WithOptionalId<TestClass, 'id'> }) => ({
113
114
  ...options.entity,
114
115
  value: options.entity.value.toUpperCase(),
@@ -161,7 +162,7 @@ describe('DataSet', () => {
161
162
 
162
163
  it('should call the authorizeUpdate authorizer and add the entity on pass', async () => {
163
164
  await usingAsync(new Injector(), async (i) => {
164
- const authorizeUpdate = jest.fn(async () => ({ isAllowed: true } as AuthorizationResult))
165
+ const authorizeUpdate = vi.fn(async () => ({ isAllowed: true } as AuthorizationResult))
165
166
  addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
166
167
  getRepository(i).createDataSet(TestClass, 'id', { authorizeUpdate })
167
168
  const dataSet = getDataSetFor(i, TestClass, 'id')
@@ -175,9 +176,7 @@ describe('DataSet', () => {
175
176
 
176
177
  it('should throw if the authorizeUpdateEntity returns a non-valid result and should not update a value to the store', async () => {
177
178
  await usingAsync(new Injector(), async (i) => {
178
- const authorizeUpdateEntity = jest.fn(
179
- async () => ({ isAllowed: false, message: '...' } as AuthorizationResult),
180
- )
179
+ const authorizeUpdateEntity = vi.fn(async () => ({ isAllowed: false, message: '...' } as AuthorizationResult))
181
180
  addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
182
181
  getRepository(i).createDataSet(TestClass, 'id', { authorizeUpdateEntity })
183
182
 
@@ -197,7 +196,7 @@ describe('DataSet', () => {
197
196
  })
198
197
  it('should call the authorizeUpdateEntity authorizer and add the entity on pass', async () => {
199
198
  await usingAsync(new Injector(), async (i) => {
200
- const authorizeUpdateEntity = jest.fn(async () => ({ isAllowed: true } as AuthorizationResult))
199
+ const authorizeUpdateEntity = vi.fn(async () => ({ isAllowed: true } as AuthorizationResult))
201
200
  addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
202
201
  getRepository(i).createDataSet(TestClass, 'id', { authorizeUpdateEntity })
203
202
  const dataSet = getDataSetFor(i, TestClass, 'id')
@@ -211,7 +210,7 @@ describe('DataSet', () => {
211
210
 
212
211
  it('should throw if the authorizeUpdate returns a non-valid result and should not update a value to the store', async () => {
213
212
  await usingAsync(new Injector(), async (i) => {
214
- const authorizeUpdate = jest.fn(async () => ({ isAllowed: false, message: '...' } as AuthorizationResult))
213
+ const authorizeUpdate = vi.fn(async () => ({ isAllowed: false, message: '...' } as AuthorizationResult))
215
214
  addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
216
215
  getRepository(i).createDataSet(TestClass, 'id', { authorizeUpdate })
217
216
 
@@ -232,7 +231,7 @@ describe('DataSet', () => {
232
231
 
233
232
  it('should modify an entity on update, if modifyOnAdd is provided', async () => {
234
233
  await usingAsync(new Injector(), async (i) => {
235
- const modifyOnUpdate: DataSetSettings<TestClass, 'id'>['modifyOnUpdate'] = jest.fn(async (options) => ({
234
+ const modifyOnUpdate: DataSetSettings<TestClass, 'id'>['modifyOnUpdate'] = vi.fn(async (options) => ({
236
235
  ...options.entity,
237
236
  value: options.entity.value?.toUpperCase(),
238
237
  }))
@@ -283,7 +282,7 @@ describe('DataSet', () => {
283
282
 
284
283
  it('should return the count if authorizeGet returns valid result', async () => {
285
284
  await usingAsync(new Injector(), async (i) => {
286
- const authorizeGet = jest.fn(async () => ({ isAllowed: true, message: '' }))
285
+ const authorizeGet = vi.fn(async () => ({ isAllowed: true, message: '' }))
287
286
  addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
288
287
  getRepository(i).createDataSet(TestClass, 'id', { authorizeGet })
289
288
 
@@ -296,7 +295,7 @@ describe('DataSet', () => {
296
295
 
297
296
  it('should throw if authorizeGet returns invalid result', async () => {
298
297
  await usingAsync(new Injector(), async (i) => {
299
- const authorizeGet = jest.fn(async () => ({ isAllowed: false, message: ':(' }))
298
+ const authorizeGet = vi.fn(async () => ({ isAllowed: false, message: ':(' }))
300
299
  addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
301
300
  getRepository(i).createDataSet(TestClass, 'id', { authorizeGet })
302
301
 
@@ -328,7 +327,7 @@ describe('DataSet', () => {
328
327
 
329
328
  it('should return the unfiltered result if authorizeGet returns valid result', async () => {
330
329
  await usingAsync(new Injector(), async (i) => {
331
- const authorizeGet = jest.fn(async () => ({ isAllowed: true, message: '' }))
330
+ const authorizeGet = vi.fn(async () => ({ isAllowed: true, message: '' }))
332
331
  addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
333
332
  getRepository(i).createDataSet(TestClass, 'id', { authorizeGet })
334
333
 
@@ -341,7 +340,7 @@ describe('DataSet', () => {
341
340
 
342
341
  it('should throw if authorizeGet returns invalid result', async () => {
343
342
  await usingAsync(new Injector(), async (i) => {
344
- const authorizeGet = jest.fn(async () => ({ isAllowed: false, message: ':(' }))
343
+ const authorizeGet = vi.fn(async () => ({ isAllowed: false, message: ':(' }))
345
344
  addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
346
345
  getRepository(i).createDataSet(TestClass, 'id', { authorizeGet })
347
346
 
@@ -372,7 +371,7 @@ describe('DataSet', () => {
372
371
 
373
372
  it('should return the entity if authorizeGet returns valid result', async () => {
374
373
  await usingAsync(new Injector(), async (i) => {
375
- const authorizeGet = jest.fn(async () => ({ isAllowed: true, message: '' }))
374
+ const authorizeGet = vi.fn(async () => ({ isAllowed: true, message: '' }))
376
375
  addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
377
376
  getRepository(i).createDataSet(TestClass, 'id', { authorizeGet })
378
377
 
@@ -385,7 +384,7 @@ describe('DataSet', () => {
385
384
 
386
385
  it('should throw if authorizeGet returns invalid result', async () => {
387
386
  await usingAsync(new Injector(), async (i) => {
388
- const authorizeGet = jest.fn(async () => ({ isAllowed: false, message: ':(' }))
387
+ const authorizeGet = vi.fn(async () => ({ isAllowed: false, message: ':(' }))
389
388
  addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
390
389
  getRepository(i).createDataSet(TestClass, 'id', { authorizeGet })
391
390
 
@@ -402,7 +401,7 @@ describe('DataSet', () => {
402
401
 
403
402
  it('should return the entity if authorizeGetEntity returns valid result', async () => {
404
403
  await usingAsync(new Injector(), async (i) => {
405
- const authorizeGetEntity = jest.fn(async () => ({ isAllowed: true, message: '' }))
404
+ const authorizeGetEntity = vi.fn(async () => ({ isAllowed: true, message: '' }))
406
405
  addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
407
406
  getRepository(i).createDataSet(TestClass, 'id', { authorizeGetEntity })
408
407
 
@@ -415,7 +414,7 @@ describe('DataSet', () => {
415
414
 
416
415
  it('should throw if authorizeGetEntity returns invalid result', async () => {
417
416
  await usingAsync(new Injector(), async (i) => {
418
- const authorizeGetEntity = jest.fn(async () => ({ isAllowed: false, message: ':(' }))
417
+ const authorizeGetEntity = vi.fn(async () => ({ isAllowed: false, message: ':(' }))
419
418
  addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
420
419
  getRepository(i).createDataSet(TestClass, 'id', { authorizeGetEntity })
421
420
 
@@ -446,7 +445,7 @@ describe('DataSet', () => {
446
445
 
447
446
  it('should remove the entity if authorizeRemove returns valid result', async () => {
448
447
  await usingAsync(new Injector(), async (i) => {
449
- const authorizeRemove = jest.fn(async () => ({ isAllowed: true, message: '' }))
448
+ const authorizeRemove = vi.fn(async () => ({ isAllowed: true, message: '' }))
450
449
  addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
451
450
  getRepository(i).createDataSet(TestClass, 'id', { authorizeRemove })
452
451
 
@@ -460,7 +459,7 @@ describe('DataSet', () => {
460
459
 
461
460
  it('should throw if authorizeRemove returns invalid result', async () => {
462
461
  await usingAsync(new Injector(), async (i) => {
463
- const authorizeRemove = jest.fn(async () => ({ isAllowed: false, message: ':(' }))
462
+ const authorizeRemove = vi.fn(async () => ({ isAllowed: false, message: ':(' }))
464
463
  addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
465
464
  getRepository(i).createDataSet(TestClass, 'id', { authorizeRemove })
466
465
 
@@ -479,7 +478,7 @@ describe('DataSet', () => {
479
478
 
480
479
  it('should remove the entity if authroizeRemoveEntity returns valid result', async () => {
481
480
  await usingAsync(new Injector(), async (i) => {
482
- const authroizeRemoveEntity = jest.fn(async () => ({ isAllowed: true, message: '' }))
481
+ const authroizeRemoveEntity = vi.fn(async () => ({ isAllowed: true, message: '' }))
483
482
  addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
484
483
  getRepository(i).createDataSet(TestClass, 'id', { authroizeRemoveEntity })
485
484
 
@@ -493,7 +492,7 @@ describe('DataSet', () => {
493
492
 
494
493
  it('should throw if authroizeRemoveEntity returns invalid result', async () => {
495
494
  await usingAsync(new Injector(), async (i) => {
496
- const authroizeRemoveEntity = jest.fn(async () => ({ isAllowed: false, message: ':(' }))
495
+ const authroizeRemoveEntity = vi.fn(async () => ({ isAllowed: false, message: ':(' }))
497
496
  addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
498
497
  getRepository(i).createDataSet(TestClass, 'id', { authroizeRemoveEntity })
499
498
 
package/src/helpers.ts CHANGED
@@ -4,7 +4,6 @@ import { Repository } from './repository'
4
4
 
5
5
  /**
6
6
  * Returns a Repository on an injector
7
- *
8
7
  * @param injector The Injector instance
9
8
  * @returns The Repository instance
10
9
  */
@@ -3,6 +3,7 @@ import { using } from '@furystack/utils'
3
3
  import { getDataSetFor, getRepository } from './helpers'
4
4
  import { addStore, InMemoryStore } from '@furystack/core'
5
5
  import { DataSet } from './data-set'
6
+ import { describe, it, expect } from 'vitest'
6
7
 
7
8
  describe('Repository', () => {
8
9
  it('Should retrieve a dataSet', () => {
@@ -15,7 +15,6 @@ export declare class DataSet<T, TPrimaryKey extends keyof T, TWritableData = Wit
15
15
  primaryKey: TPrimaryKey;
16
16
  /**
17
17
  * Adds an entity to the DataSet
18
- *
19
18
  * @param injector The injector from the context
20
19
  * @param entities The entities to add
21
20
  * @returns The CreateResult with the created entities
@@ -30,7 +29,6 @@ export declare class DataSet<T, TPrimaryKey extends keyof T, TWritableData = Wit
30
29
  }>;
31
30
  /**
32
31
  * Updates an entity in the store
33
- *
34
32
  * @param injector The injector from the context
35
33
  * @param id The identifier of the entity
36
34
  * @param change The update
@@ -46,7 +44,6 @@ export declare class DataSet<T, TPrimaryKey extends keyof T, TWritableData = Wit
46
44
  }>;
47
45
  /**
48
46
  * Returns a Promise with the entity count
49
- *
50
47
  * @param injector The Injector from the context
51
48
  * @param filter The Filter that will be applied
52
49
  * @returns the Count
@@ -54,7 +51,6 @@ export declare class DataSet<T, TPrimaryKey extends keyof T, TWritableData = Wit
54
51
  count(injector: Injector, filter?: FilterType<T>): Promise<number>;
55
52
  /**
56
53
  * Returns a filtered subset of the entity
57
- *
58
54
  * @param injector The Injector from the context
59
55
  * @param filter The Filter definition
60
56
  * @returns A result with the current items
@@ -62,7 +58,6 @@ export declare class DataSet<T, TPrimaryKey extends keyof T, TWritableData = Wit
62
58
  find<TFields extends Array<keyof T>>(injector: Injector, filter: FindOptions<T, TFields>): Promise<Array<PartialResult<T, TFields>>>;
63
59
  /**
64
60
  * Returns an entity based on its primary key
65
- *
66
61
  * @param injector The injector from the context
67
62
  * @param key The identifier of the entity
68
63
  * @param select A field list used for projection
@@ -71,7 +66,6 @@ export declare class DataSet<T, TPrimaryKey extends keyof T, TWritableData = Wit
71
66
  get(injector: Injector, key: T[TPrimaryKey], select?: Array<keyof T>): Promise<PartialResult<T, (keyof T)[]> | undefined>;
72
67
  /**
73
68
  * Removes an entity based on its primary key
74
- *
75
69
  * @param injector The Injector from the context
76
70
  * @param key The primary key
77
71
  * @returns A promise that will be resolved / rejected based on the remove success
@@ -1 +1 @@
1
- {"version":3,"file":"data-set.d.ts","sourceRoot":"","sources":["../src/data-set.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE3G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAElD;;GAEG;AACH,qBAAa,OAAO,CAAC,CAAC,EAAE,WAAW,SAAS,MAAM,CAAC,EAAE,aAAa,GAAG,cAAc,CAAC,CAAC,EAAE,WAAW,CAAC,CACjG,YAAW,UAAU;aAqLO,QAAQ,EAAE,eAAe,CAAC,CAAC,EAAE,WAAW,EAAE,aAAa,CAAC;IAnL7E,OAAO;IAMd;;OAEG;IACI,UAAU,EAAE,WAAW,CAAyC;IAEvE;;;;;;OAMG;IACU,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,QAAQ,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAuB5F;;OAEG;IACH,SAAgB,aAAa;kBAAmC,QAAQ;gBAAU,CAAC;OAAK;IAExF;;;;;;OAMG;IACU,MAAM,CAAC,QAAQ,EAAE,QA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,MAAM,EAAE,WAAW,CAAC,CAAC,EAAE,OAAO,CAAC,GAC9B,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IAW5C;;;;;;OAMG;IACU,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAiBjF;;;;;OAKG;IACU,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAoB3E;;OAEG;IACH,SAAgB,eAAe;kBACnB,QAAQ;aACb,CAAC,CAAC,WAAW,CAAC;OACjB;gBAEwB,QAAQ,EAAE,eAAe,CAAC,CAAC,EAAE,WAAW,EAAE,aAAa,CAAC;CACrF"}
@@ -3,7 +3,6 @@ import type { Injector } from '@furystack/inject';
3
3
  import { Repository } from './repository';
4
4
  /**
5
5
  * Returns a Repository on an injector
6
- *
7
6
  * @param injector The Injector instance
8
7
  * @returns The Repository instance
9
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC;;;;;GAKG;AACH,eAAO,MAAM,aAAa,aAAc,QAAQ,eAAqC,CAAA;AAErF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,6CACd,QAAQ,8JAGkD,CAAA"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC;;;;GAIG;AACH,eAAO,MAAM,aAAa,aAAc,QAAQ,eAAqC,CAAA;AAErF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,6CACd,QAAQ,8JAGkD,CAAA"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=data-set-setting.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data-set-setting.js","sourceRoot":"","sources":["../src/data-set-setting.ts"],"names":[],"mappings":""}
package/dist/data-set.js DELETED
@@ -1,171 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DataSet = void 0;
4
- const core_1 = require("@furystack/core");
5
- const utils_1 = require("@furystack/utils");
6
- /**
7
- * An authorized Repository Store instance
8
- */
9
- class DataSet {
10
- dispose() {
11
- this.onEntityAdded.dispose();
12
- this.onEntityRemoved.dispose();
13
- this.onEntityUpdated.dispose();
14
- }
15
- /**
16
- * Adds an entity to the DataSet
17
- *
18
- * @param injector The injector from the context
19
- * @param entities The entities to add
20
- * @returns The CreateResult with the created entities
21
- */
22
- async add(injector, ...entities) {
23
- await Promise.all(entities.map(async (entity) => {
24
- if (this.settings.authorizeAdd) {
25
- const result = await this.settings.authorizeAdd({ injector, entity });
26
- if (!result.isAllowed) {
27
- throw new core_1.AuthorizationError(result.message);
28
- }
29
- }
30
- }));
31
- const parsed = await Promise.all(entities.map(async (entity) => {
32
- return this.settings.modifyOnAdd ? await this.settings.modifyOnAdd({ injector, entity }) : entity;
33
- }));
34
- const createResult = await this.settings.physicalStore.add(...parsed);
35
- createResult.created.map((entity) => this.onEntityAdded.setValue({ injector, entity }));
36
- return createResult;
37
- }
38
- /**
39
- * Updates an entity in the store
40
- *
41
- * @param injector The injector from the context
42
- * @param id The identifier of the entity
43
- * @param change The update
44
- */
45
- async update(injector, id, change) {
46
- if (this.settings.authorizeUpdate) {
47
- const result = await this.settings.authorizeUpdate({ injector, change });
48
- if (!result.isAllowed) {
49
- throw new core_1.AuthorizationError(result.message);
50
- }
51
- }
52
- if (this.settings.authorizeUpdateEntity) {
53
- const entity = await this.settings.physicalStore.get(id);
54
- if (entity) {
55
- const result = await this.settings.authorizeUpdateEntity({ injector, change, entity });
56
- if (!result.isAllowed) {
57
- throw new core_1.AuthorizationError(result.message);
58
- }
59
- }
60
- }
61
- const parsed = this.settings.modifyOnUpdate
62
- ? await this.settings.modifyOnUpdate({ injector, id, entity: change })
63
- : change;
64
- await this.settings.physicalStore.update(id, parsed);
65
- this.onEntityUpdated.setValue({ injector, change: parsed, id });
66
- }
67
- /**
68
- * Returns a Promise with the entity count
69
- *
70
- * @param injector The Injector from the context
71
- * @param filter The Filter that will be applied
72
- * @returns the Count
73
- */
74
- async count(injector, filter) {
75
- if (this.settings.authorizeGet) {
76
- const result = await this.settings.authorizeGet({ injector });
77
- if (!result.isAllowed) {
78
- throw new core_1.AuthorizationError(result.message);
79
- }
80
- }
81
- return await this.settings.physicalStore.count(filter);
82
- }
83
- /**
84
- * Returns a filtered subset of the entity
85
- *
86
- * @param injector The Injector from the context
87
- * @param filter The Filter definition
88
- * @returns A result with the current items
89
- */
90
- async find(injector, filter) {
91
- if (this.settings.authorizeGet) {
92
- const result = await this.settings.authorizeGet({ injector });
93
- if (!result.isAllowed) {
94
- throw new core_1.AuthorizationError(result.message);
95
- }
96
- }
97
- const parsedFilter = this.settings.addFilter ? await this.settings.addFilter({ injector, filter }) : filter;
98
- return this.settings.physicalStore.find(parsedFilter);
99
- }
100
- /**
101
- * Returns an entity based on its primary key
102
- *
103
- * @param injector The injector from the context
104
- * @param key The identifier of the entity
105
- * @param select A field list used for projection
106
- * @returns An item with the current unique key or Undefined
107
- */
108
- async get(injector, key, select) {
109
- if (this.settings.authorizeGet) {
110
- const result = await this.settings.authorizeGet({ injector });
111
- if (!result.isAllowed) {
112
- throw new core_1.AuthorizationError(result.message);
113
- }
114
- }
115
- const instance = await this.settings.physicalStore.get(key, select);
116
- if (instance && this.settings && this.settings.authorizeGetEntity) {
117
- const result = await this.settings.authorizeGetEntity({ injector, entity: instance });
118
- if (!result.isAllowed) {
119
- throw new core_1.AuthorizationError(result.message);
120
- }
121
- }
122
- return instance;
123
- }
124
- /**
125
- * Removes an entity based on its primary key
126
- *
127
- * @param injector The Injector from the context
128
- * @param key The primary key
129
- * @returns A promise that will be resolved / rejected based on the remove success
130
- */
131
- async remove(injector, key) {
132
- if (this.settings.authorizeRemove) {
133
- const result = await this.settings.authorizeRemove({ injector });
134
- if (!result.isAllowed) {
135
- throw new core_1.AuthorizationError(result.message);
136
- }
137
- }
138
- if (this.settings.authroizeRemoveEntity) {
139
- const entity = await this.settings.physicalStore.get(key);
140
- if (entity) {
141
- const removeResult = await this.settings.authroizeRemoveEntity({ injector, entity });
142
- if (!removeResult.isAllowed) {
143
- throw new core_1.AuthorizationError(removeResult.message);
144
- }
145
- }
146
- }
147
- await this.settings.physicalStore.remove(key);
148
- this.onEntityRemoved.setValue({ injector, key });
149
- }
150
- constructor(settings) {
151
- this.settings = settings;
152
- /**
153
- * Primary key of the contained entity
154
- */
155
- this.primaryKey = this.settings.physicalStore.primaryKey;
156
- /**
157
- * Observable that will be updated after the entity has been persisted
158
- */
159
- this.onEntityAdded = new utils_1.ObservableValue();
160
- /**
161
- * Observable that will be updated right after an entity update
162
- */
163
- this.onEntityUpdated = new utils_1.ObservableValue();
164
- /**
165
- * Callback that fires right after entity update
166
- */
167
- this.onEntityRemoved = new utils_1.ObservableValue();
168
- }
169
- }
170
- exports.DataSet = DataSet;
171
- //# sourceMappingURL=data-set.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data-set.js","sourceRoot":"","sources":["../src/data-set.ts"],"names":[],"mappings":";;;AAEA,0CAAoD;AAGpD,4CAAkD;AAElD;;GAEG;AACH,MAAa,OAAO;IA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EAAE,CAAC,CAAA;gBACpF,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE;oBAC3B,MAAM,IAAI,yBAAkB,CAAC,YAAY,CAAC,OAAO,CAAC,CAAA;iBACnD;aACF;SACF;QACD,MAAM,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAC7C,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAA;IAClD,CAAC;IAUD,YAA4B,QAAwD;QAAxD,aAAQ,GAAR,QAAQ,CAAgD;QA7KpF;;WAEG;QACI,eAAU,GAAgB,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAA;QAgCvE;;WAEG;QACa,kBAAa,GAAG,IAAI,uBAAe,EAAqC,CAAA;QAgCxF;;WAEG;QACa,oBAAe,GAAG,IAAI,uBAAe,EAA8D,CAAA;QA4FnH;;WAEG;QACa,oBAAe,GAAG,IAAI,uBAAe,EAGjD,CAAA;IAEmF,CAAC;CACzF;AAvLD,0BAuLC"}
@@ -1,463 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const inject_1 = require("@furystack/inject");
4
- const utils_1 = require("@furystack/utils");
5
- const core_1 = require("@furystack/core");
6
- const repository_1 = require("./repository");
7
- const helpers_1 = require("./helpers");
8
- class TestClass {
9
- constructor() {
10
- this.id = 1;
11
- this.value = '';
12
- }
13
- }
14
- describe('DataSet', () => {
15
- describe('Construction', () => {
16
- it('can be retrieved from an extension method with class', () => {
17
- (0, utils_1.using)(new inject_1.Injector(), (i) => {
18
- (0, core_1.addStore)(i, new core_1.InMemoryStore({
19
- model: TestClass,
20
- primaryKey: 'id',
21
- }));
22
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id');
23
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
24
- expect(dataSet.settings.physicalStore.model).toBe(TestClass);
25
- });
26
- });
27
- it('can be retrieved from an extension method with string', () => {
28
- (0, utils_1.using)(new inject_1.Injector(), (i) => {
29
- (0, core_1.addStore)(i, new core_1.InMemoryStore({
30
- model: TestClass,
31
- primaryKey: 'id',
32
- }));
33
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id');
34
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
35
- expect(dataSet.settings.physicalStore.model).toBe(TestClass);
36
- });
37
- });
38
- it('Should throw if dataset is not registered through extension', () => {
39
- (0, utils_1.using)(new inject_1.Injector(), (i) => {
40
- expect(() => (0, helpers_1.getDataSetFor)(i, TestClass, 'id')).toThrowError('');
41
- });
42
- });
43
- it('Should throw if dataset is not registered through service', () => {
44
- (0, utils_1.using)(new inject_1.Injector(), (i) => {
45
- expect(() => i.getInstance(repository_1.Repository).getDataSetFor(TestClass, 'id')).toThrowError('');
46
- });
47
- });
48
- });
49
- describe('Authorizers', () => {
50
- describe('Add', () => {
51
- it('should add an entity if no settings are provided', async () => {
52
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
53
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
54
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id');
55
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
56
- await dataSet.add(i, { id: 1, value: 'asd' });
57
- const result = await dataSet.get(i, 1);
58
- expect(result && result.value).toBe('asd');
59
- });
60
- });
61
- it('should call the add async authorizer and add the entity on pass', async () => {
62
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
63
- const authorizeAdd = jest.fn(async () => ({ isAllowed: true }));
64
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
65
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id', { authorizeAdd });
66
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
67
- await dataSet.add(i, { id: 1, value: 'asd' });
68
- expect(authorizeAdd).toBeCalled();
69
- const added = await dataSet.get(i, 1);
70
- expect(added && added.value).toBe('asd');
71
- });
72
- });
73
- it('should throw if the add authorizer returns a non-valid result and should not add a value to the store', async () => {
74
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
75
- const authorizeAdd = jest.fn(async () => ({ isAllowed: false, message: '...' }));
76
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
77
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id', { authorizeAdd });
78
- const dataSet = await (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
79
- try {
80
- await dataSet.add(i, { id: 1, value: 'asd' });
81
- throw Error('Should throw');
82
- }
83
- catch (error) {
84
- /** */
85
- expect(authorizeAdd).toBeCalled();
86
- const added = await dataSet.get(i, 1);
87
- expect(added).toBeUndefined();
88
- }
89
- });
90
- });
91
- it('should modify an entity on add, if modifyOnAdd is provided', async () => {
92
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
93
- const modifyOnAdd = jest.fn(async (options) => ({
94
- ...options.entity,
95
- value: options.entity.value.toUpperCase(),
96
- }));
97
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
98
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id', { modifyOnAdd });
99
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
100
- await dataSet.add(i, { id: 1, value: 'asd' });
101
- const result = await dataSet.get(i, 1);
102
- expect(modifyOnAdd).toBeCalled();
103
- expect(result && result.value).toBe('ASD');
104
- });
105
- });
106
- it('should call the onEntityAdded callback if an entity has been added', async () => {
107
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
108
- expect.assertions(1);
109
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
110
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id', {});
111
- (0, helpers_1.getRepository)(i)
112
- .getDataSetFor(TestClass, 'id')
113
- .onEntityAdded.subscribe(({ entity }) => {
114
- expect(entity.value).toBe('asd');
115
- });
116
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
117
- await dataSet.add(i, { id: 1, value: 'asd' });
118
- });
119
- });
120
- });
121
- describe('Update', () => {
122
- it('should update an entity if no settings are provided', async () => {
123
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
124
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
125
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id');
126
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
127
- await dataSet.add(i, { id: 1, value: 'asd' });
128
- await dataSet.update(i, 1, { id: 1, value: 'asd2' });
129
- const result = await dataSet.get(i, 1);
130
- expect(result && result.value).toBe('asd2');
131
- });
132
- });
133
- it('should call the authorizeUpdate authorizer and add the entity on pass', async () => {
134
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
135
- const authorizeUpdate = jest.fn(async () => ({ isAllowed: true }));
136
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
137
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id', { authorizeUpdate });
138
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
139
- await dataSet.add(i, { id: 1, value: 'asd' });
140
- await dataSet.update(i, 1, { id: 1, value: 'asd2' });
141
- expect(authorizeUpdate).toBeCalled();
142
- const added = await dataSet.get(i, 1);
143
- expect(added && added.value).toBe('asd2');
144
- });
145
- });
146
- it('should throw if the authorizeUpdateEntity returns a non-valid result and should not update a value to the store', async () => {
147
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
148
- const authorizeUpdateEntity = jest.fn(async () => ({ isAllowed: false, message: '...' }));
149
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
150
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id', { authorizeUpdateEntity });
151
- const dataSet = await (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
152
- try {
153
- await dataSet.add(i, { id: 1, value: 'asd' });
154
- await dataSet.update(i, 1, { id: 1, value: 'asd2' });
155
- throw Error('Should throw');
156
- }
157
- catch (error) {
158
- /** */
159
- expect(authorizeUpdateEntity).toBeCalled();
160
- const added = await dataSet.get(i, 1);
161
- expect(added && added.value).toBe('asd');
162
- }
163
- });
164
- });
165
- it('should call the authorizeUpdateEntity authorizer and add the entity on pass', async () => {
166
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
167
- const authorizeUpdateEntity = jest.fn(async () => ({ isAllowed: true }));
168
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
169
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id', { authorizeUpdateEntity });
170
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
171
- await dataSet.add(i, { id: 1, value: 'asd' });
172
- await dataSet.update(i, 1, { id: 1, value: 'asd2' });
173
- expect(authorizeUpdateEntity).toBeCalled();
174
- const added = await dataSet.get(i, 1);
175
- expect(added && added.value).toBe('asd2');
176
- });
177
- });
178
- it('should throw if the authorizeUpdate returns a non-valid result and should not update a value to the store', async () => {
179
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
180
- const authorizeUpdate = jest.fn(async () => ({ isAllowed: false, message: '...' }));
181
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
182
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id', { authorizeUpdate });
183
- const dataSet = await (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
184
- try {
185
- await dataSet.add(i, { id: 1, value: 'asd' });
186
- await dataSet.update(i, 1, { id: 1, value: 'asd2' });
187
- throw Error('Should throw');
188
- }
189
- catch (error) {
190
- /** */
191
- expect(authorizeUpdate).toBeCalled();
192
- const added = await dataSet.get(i, 1);
193
- expect(added && added.value).toBe('asd');
194
- }
195
- });
196
- });
197
- it('should modify an entity on update, if modifyOnAdd is provided', async () => {
198
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
199
- const modifyOnUpdate = jest.fn(async (options) => ({
200
- ...options.entity,
201
- value: options.entity.value?.toUpperCase(),
202
- }));
203
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
204
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id', { modifyOnUpdate });
205
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
206
- await dataSet.add(i, { id: 1, value: 'asd' });
207
- await dataSet.update(i, 1, { id: 1, value: 'asd2' });
208
- const result = await dataSet.get(i, 1);
209
- expect(modifyOnUpdate).toBeCalled();
210
- expect(result && result.value).toBe('ASD2');
211
- });
212
- });
213
- it('should publish to the onEntityUpdated observable if an entity has been updated', async () => {
214
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
215
- expect.assertions(1);
216
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
217
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id');
218
- (0, helpers_1.getRepository)(i)
219
- .getDataSetFor(TestClass, 'id')
220
- .onEntityUpdated.subscribe(({ change }) => {
221
- expect(change).toEqual({ id: 1, value: 'asd2' });
222
- });
223
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
224
- await dataSet.add(i, { id: 1, value: 'asd' });
225
- await dataSet.update(i, 1, { id: 1, value: 'asd2' });
226
- });
227
- });
228
- });
229
- describe('Count', () => {
230
- it('should return the count if no settings are provided', async () => {
231
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
232
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
233
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id');
234
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
235
- await dataSet.add(i, { id: 1, value: 'asd' });
236
- const result = await dataSet.count(i);
237
- expect(result).toBe(1);
238
- });
239
- });
240
- it('should return the count if authorizeGet returns valid result', async () => {
241
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
242
- const authorizeGet = jest.fn(async () => ({ isAllowed: true, message: '' }));
243
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
244
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id', { authorizeGet });
245
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
246
- await dataSet.add(i, { id: 1, value: 'asd' });
247
- const result = await dataSet.count(i);
248
- expect(result).toBe(1);
249
- });
250
- });
251
- it('should throw if authorizeGet returns invalid result', async () => {
252
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
253
- const authorizeGet = jest.fn(async () => ({ isAllowed: false, message: ':(' }));
254
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
255
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id', { authorizeGet });
256
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
257
- await dataSet.add(i, { id: 1, value: 'asd' });
258
- try {
259
- await dataSet.count(i);
260
- throw Error('Should throw');
261
- }
262
- catch (error) {
263
- /** */
264
- }
265
- });
266
- });
267
- });
268
- });
269
- describe('filter', () => {
270
- it('should return the unfiltered result if no settings are provided', async () => {
271
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
272
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
273
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id');
274
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
275
- await dataSet.add(i, { id: 1, value: 'asd' });
276
- const result = await dataSet.find(i, {});
277
- expect(result.length).toBe(1);
278
- });
279
- });
280
- it('should return the unfiltered result if authorizeGet returns valid result', async () => {
281
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
282
- const authorizeGet = jest.fn(async () => ({ isAllowed: true, message: '' }));
283
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
284
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id', { authorizeGet });
285
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
286
- await dataSet.add(i, { id: 1, value: 'asd' });
287
- const result = await dataSet.find(i, {});
288
- expect(result.length).toBe(1);
289
- });
290
- });
291
- it('should throw if authorizeGet returns invalid result', async () => {
292
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
293
- const authorizeGet = jest.fn(async () => ({ isAllowed: false, message: ':(' }));
294
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
295
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id', { authorizeGet });
296
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
297
- await dataSet.add(i, { id: 1, value: 'asd' });
298
- try {
299
- await dataSet.find(i, {});
300
- throw Error('Should throw');
301
- }
302
- catch (error) {
303
- /** */
304
- }
305
- });
306
- });
307
- });
308
- describe('get', () => {
309
- it('should return the entity if no settings are provided', async () => {
310
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
311
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
312
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id');
313
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
314
- await dataSet.add(i, { id: 1, value: 'asd' });
315
- const result = await dataSet.get(i, 1);
316
- expect(result && result.id).toBe(1);
317
- });
318
- });
319
- it('should return the entity if authorizeGet returns valid result', async () => {
320
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
321
- const authorizeGet = jest.fn(async () => ({ isAllowed: true, message: '' }));
322
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
323
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id', { authorizeGet });
324
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
325
- await dataSet.add(i, { id: 1, value: 'asd' });
326
- const result = await dataSet.get(i, 1);
327
- expect(result && result.id).toBe(1);
328
- });
329
- });
330
- it('should throw if authorizeGet returns invalid result', async () => {
331
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
332
- const authorizeGet = jest.fn(async () => ({ isAllowed: false, message: ':(' }));
333
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
334
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id', { authorizeGet });
335
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
336
- await dataSet.add(i, { id: 1, value: 'asd' });
337
- try {
338
- await dataSet.get(i, 1);
339
- throw Error('Should throw');
340
- }
341
- catch (error) {
342
- /** */
343
- }
344
- });
345
- });
346
- it('should return the entity if authorizeGetEntity returns valid result', async () => {
347
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
348
- const authorizeGetEntity = jest.fn(async () => ({ isAllowed: true, message: '' }));
349
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
350
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id', { authorizeGetEntity });
351
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
352
- await dataSet.add(i, { id: 1, value: 'asd' });
353
- const result = await dataSet.get(i, 1);
354
- expect(result && result.id).toBe(1);
355
- });
356
- });
357
- it('should throw if authorizeGetEntity returns invalid result', async () => {
358
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
359
- const authorizeGetEntity = jest.fn(async () => ({ isAllowed: false, message: ':(' }));
360
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
361
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id', { authorizeGetEntity });
362
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
363
- await dataSet.add(i, { id: 1, value: 'asd' });
364
- try {
365
- await dataSet.get(i, 1);
366
- throw Error('Should throw');
367
- }
368
- catch (error) {
369
- /** */
370
- }
371
- });
372
- });
373
- });
374
- describe('remove', () => {
375
- it('should remove the entity if no settings are provided', async () => {
376
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
377
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
378
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id');
379
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
380
- await dataSet.add(i, { id: 1, value: 'asd' });
381
- await dataSet.remove(i, 1);
382
- const countValue = await dataSet.count(i);
383
- expect(countValue).toBe(0);
384
- });
385
- });
386
- it('should remove the entity if authorizeRemove returns valid result', async () => {
387
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
388
- const authorizeRemove = jest.fn(async () => ({ isAllowed: true, message: '' }));
389
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
390
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id', { authorizeRemove });
391
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
392
- await dataSet.add(i, { id: 1, value: 'asd' });
393
- await dataSet.remove(i, 1);
394
- const count = await dataSet.count(i);
395
- expect(count).toBe(0);
396
- });
397
- });
398
- it('should throw if authorizeRemove returns invalid result', async () => {
399
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
400
- const authorizeRemove = jest.fn(async () => ({ isAllowed: false, message: ':(' }));
401
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
402
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id', { authorizeRemove });
403
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
404
- await dataSet.add(i, { id: 1, value: 'asd' });
405
- try {
406
- await dataSet.remove(i, 1);
407
- throw Error('Should throw');
408
- }
409
- catch (error) {
410
- /** */
411
- }
412
- const count = await dataSet.count(i);
413
- expect(count).toBe(1);
414
- });
415
- });
416
- it('should remove the entity if authroizeRemoveEntity returns valid result', async () => {
417
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
418
- const authroizeRemoveEntity = jest.fn(async () => ({ isAllowed: true, message: '' }));
419
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
420
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id', { authroizeRemoveEntity });
421
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
422
- await dataSet.add(i, { id: 1, value: 'asd' });
423
- await dataSet.remove(i, 1);
424
- const count = await dataSet.count(i);
425
- expect(count).toBe(0);
426
- });
427
- });
428
- it('should throw if authroizeRemoveEntity returns invalid result', async () => {
429
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
430
- const authroizeRemoveEntity = jest.fn(async () => ({ isAllowed: false, message: ':(' }));
431
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
432
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id', { authroizeRemoveEntity });
433
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
434
- await dataSet.add(i, { id: 1, value: 'asd' });
435
- try {
436
- await dataSet.remove(i, 1);
437
- throw Error('Should throw');
438
- }
439
- catch (error) {
440
- /** */
441
- }
442
- const count = await dataSet.count(i);
443
- expect(count).toBe(1);
444
- });
445
- });
446
- it('should publish to the onEntityRemoved observable if an entity has been removed', async () => {
447
- await (0, utils_1.usingAsync)(new inject_1.Injector(), async (i) => {
448
- expect.assertions(1);
449
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: TestClass, primaryKey: 'id' }));
450
- (0, helpers_1.getRepository)(i).createDataSet(TestClass, 'id');
451
- (0, helpers_1.getRepository)(i)
452
- .getDataSetFor(TestClass, 'id')
453
- .onEntityRemoved.subscribe(({ key }) => {
454
- expect(key).toEqual(1);
455
- });
456
- const dataSet = (0, helpers_1.getDataSetFor)(i, TestClass, 'id');
457
- await dataSet.add(i, { id: 1, value: 'asd' });
458
- await dataSet.remove(i, 1);
459
- });
460
- });
461
- });
462
- });
463
- //# sourceMappingURL=dataset.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dataset.spec.js","sourceRoot":"","sources":["../src/dataset.spec.ts"],"names":[],"mappings":";;AAAA,8CAA4C;AAC5C,4CAAoD;AAEpD,0CAAyD;AACzD,6CAAyC;AAEzC,uCAAwD;AAExD,MAAM,SAAS;IAAf;QACS,OAAE,GAAG,CAAC,CAAA;QACN,UAAK,GAAG,EAAE,CAAA;IACnB,CAAC;CAAA;AAED,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;QAC5B,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;YAC9D,IAAA,aAAK,EAAC,IAAI,iBAAQ,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE;gBAC1B,IAAA,eAAQ,EACN,CAAC,EACD,IAAI,oBAAa,CAAC;oBAChB,KAAK,EAAE,SAAS;oBAChB,UAAU,EAAE,IAAI;iBACjB,CAAC,CACH,CAAA;gBACD,IAAA,uBAAa,EAAC,CAAC,CAAC,CAAC,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,CAAA;gBAC/C,MAAM,OAAO,GAAG,IAAA,uBAAa,EAAC,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,CAAA;gBACjD,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,CAA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AAA;YACvB,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QACF,EAAE,CAAC,gFAAgF,EAAE,KAAK,IAAI,EAAE;YAC9F,MAAM,IAAA,kBAAU,EAAC,IAAI,iBAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;gBAC3C,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;gBACpB,IAAA,eAAQ,EAAC,CAAC,EAAE,IAAI,oBAAa,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;gBACtE,IAAA,uBAAa,EAAC,CAAC,CAAC,CAAC,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,CAAA;gBAE/C,IAAA,uBAAa,EAAC,CAAC,CAAC;qBACb,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC;qBAC9B,eAAe,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE;oBACrC,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;gBACxB,CAAC,CAAC,CAAA;gBAEJ,MAAM,OAAO,GAAG,IAAA,uBAAa,EAAC,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,CAAA;gBACjD,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;gBAC7C,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;YAC5B,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
package/dist/helpers.js DELETED
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDataSetFor = exports.getRepository = void 0;
4
- const repository_1 = require("./repository");
5
- /**
6
- * Returns a Repository on an injector
7
- *
8
- * @param injector The Injector instance
9
- * @returns The Repository instance
10
- */
11
- const getRepository = (injector) => injector.getInstance(repository_1.Repository);
12
- exports.getRepository = getRepository;
13
- /**
14
- *
15
- * @param injector The Injector instance
16
- * @param model The Model
17
- * @param primaryKey The Primary Key field
18
- * @returns A Repository DataSet for a specific model
19
- */
20
- const getDataSetFor = (injector, model, primaryKey) => injector.getInstance(repository_1.Repository).getDataSetFor(model, primaryKey);
21
- exports.getDataSetFor = getDataSetFor;
22
- //# sourceMappingURL=helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";;;AAEA,6CAAyC;AAEzC;;;;;GAKG;AACI,MAAM,aAAa,GAAG,CAAC,QAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,uBAAU,CAAC,CAAA;AAAxE,QAAA,aAAa,iBAA2D;AAErF;;;;;;GAMG;AACI,MAAM,aAAa,GAAG,CAC3B,QAAkB,EAClB,KAAuB,EACvB,UAAuB,EACvB,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,uBAAU,CAAC,CAAC,aAAa,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;AAJzD,QAAA,aAAa,iBAI4C"}
package/dist/index.js DELETED
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./repository"), exports);
18
- __exportStar(require("./data-set"), exports);
19
- __exportStar(require("./data-set-setting"), exports);
20
- __exportStar(require("./helpers"), exports);
21
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,6CAA0B;AAC1B,qDAAkC;AAClC,4CAAyB"}
@@ -1,55 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Repository = void 0;
13
- const core_1 = require("@furystack/core");
14
- const inject_1 = require("@furystack/inject");
15
- const data_set_1 = require("./data-set");
16
- /**
17
- * Collection of authorized physical stores
18
- */
19
- let Repository = class Repository {
20
- constructor() {
21
- this.dataSets = new Map();
22
- }
23
- dispose() {
24
- this.dataSets.forEach((ds) => ds.dispose());
25
- this.dataSets.clear();
26
- }
27
- getDataSetFor(model, primaryKey) {
28
- const instance = this.dataSets.get(model);
29
- if (!instance) {
30
- throw Error(`No DataSet found for '${model}'`);
31
- }
32
- if (instance.primaryKey !== primaryKey) {
33
- throw Error('Primary key mismatch');
34
- }
35
- return instance;
36
- }
37
- createDataSet(model, primaryKey, settings) {
38
- const physicalStore = (settings && settings.physicalStore) || this.storeManager.getStoreFor(model, primaryKey);
39
- const instance = new data_set_1.DataSet({
40
- ...settings,
41
- physicalStore,
42
- });
43
- this.dataSets.set(model, instance);
44
- return this;
45
- }
46
- };
47
- __decorate([
48
- (0, inject_1.Injected)(core_1.StoreManager),
49
- __metadata("design:type", core_1.StoreManager)
50
- ], Repository.prototype, "storeManager", void 0);
51
- Repository = __decorate([
52
- (0, inject_1.Injectable)({ lifetime: 'singleton' })
53
- ], Repository);
54
- exports.Repository = Repository;
55
- //# sourceMappingURL=repository.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"repository.js","sourceRoot":"","sources":["../src/repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,0CAA8C;AAE9C,8CAAwD;AAGxD,yCAAoC;AAEpC;;GAEG;AAEH,IAAa,UAAU,GAAvB,MAAa,UAAU;IAAvB;QAMU,aAAQ,GAAgC,IAAI,GAAG,EAAE,CAAA;IA+B3D,CAAC;IApCQ,OAAO;QACZ,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAA;QAC3C,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAA;IACvB,CAAC;IAIM,aAAa,CAClB,KAAuB,EACvB,UAAuB;QAEvB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QACzC,IAAI,CAAC,QAAQ,EAAE;YACb,MAAM,KAAK,CAAC,yBAAyB,KAAK,GAAG,CAAC,CAAA;SAC/C;QACD,IAAI,QAAQ,CAAC,UAAU,KAAK,UAAU,EAAE;YACtC,MAAM,KAAK,CAAC,sBAAsB,CAAC,CAAA;SACpC;QACD,OAAO,QAA6D,CAAA;IACtE,CAAC;IACM,aAAa,CAClB,KAAuB,EACvB,UAAuB,EACvB,QAAmD;QAEnD,MAAM,aAAa,GAAG,CAAC,QAAQ,IAAI,QAAQ,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;QAC9G,MAAM,QAAQ,GAAG,IAAI,kBAAO,CAAC;YAC3B,GAAG,QAAQ;YACX,aAAa;SACd,CAAC,CAAA;QACF,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;QAClC,OAAO,IAAI,CAAA;IACb,CAAC;CAIF,CAAA;AADkB;IADhB,IAAA,iBAAQ,EAAC,mBAAY,CAAC;8BACS,mBAAY;gDAAA;AApCjC,UAAU;IADtB,IAAA,mBAAU,EAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;GACzB,UAAU,CAqCtB;AArCY,gCAAU"}
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const inject_1 = require("@furystack/inject");
4
- const utils_1 = require("@furystack/utils");
5
- const helpers_1 = require("./helpers");
6
- const core_1 = require("@furystack/core");
7
- const data_set_1 = require("./data-set");
8
- describe('Repository', () => {
9
- it('Should retrieve a dataSet', () => {
10
- (0, utils_1.using)(new inject_1.Injector(), (i) => {
11
- class ExampleClass {
12
- }
13
- (0, core_1.addStore)(i, new core_1.InMemoryStore({ model: ExampleClass, primaryKey: 'id' }));
14
- (0, helpers_1.getRepository)(i).createDataSet(ExampleClass, 'id', {});
15
- const dataSet = (0, helpers_1.getDataSetFor)(i, ExampleClass, 'id');
16
- expect(dataSet).toBeInstanceOf(data_set_1.DataSet);
17
- });
18
- });
19
- });
20
- //# sourceMappingURL=repository.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"repository.spec.js","sourceRoot":"","sources":["../src/repository.spec.ts"],"names":[],"mappings":";;AAAA,8CAA4C;AAC5C,4CAAwC;AACxC,uCAAwD;AACxD,0CAAyD;AACzD,yCAAoC;AAEpC,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACnC,IAAA,aAAK,EAAC,IAAI,iBAAQ,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE;YAC1B,MAAM,YAAY;aAEjB;YACD,IAAA,eAAQ,EAAC,CAAC,EAAE,IAAI,oBAAa,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;YACzE,IAAA,uBAAa,EAAC,CAAC,CAAC,CAAC,aAAa,CAAC,YAAY,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;YAEtD,MAAM,OAAO,GAAG,IAAA,uBAAa,EAAC,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,CAAA;YACpD,MAAM,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,kBAAO,CAAC,CAAA;QACzC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=dataset.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dataset.spec.d.ts","sourceRoot":"","sources":["../src/dataset.spec.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=repository.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"repository.spec.d.ts","sourceRoot":"","sources":["../src/repository.spec.ts"],"names":[],"mappings":""}