@furystack/repository 7.0.5 → 7.0.7
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/esm/repository.js +1 -2
- package/esm/repository.js.map +1 -1
- package/package.json +6 -6
- package/src/dataset.spec.ts +6 -6
package/esm/repository.js
CHANGED
|
@@ -13,7 +13,7 @@ import { DataSet } from './data-set.js';
|
|
|
13
13
|
/**
|
|
14
14
|
* Collection of authorized physical stores
|
|
15
15
|
*/
|
|
16
|
-
let Repository = class Repository {
|
|
16
|
+
export let Repository = class Repository {
|
|
17
17
|
constructor() {
|
|
18
18
|
this.dataSets = new Map();
|
|
19
19
|
}
|
|
@@ -48,5 +48,4 @@ __decorate([
|
|
|
48
48
|
Repository = __decorate([
|
|
49
49
|
Injectable({ lifetime: 'singleton' })
|
|
50
50
|
], Repository);
|
|
51
|
-
export { Repository };
|
|
52
51
|
//# sourceMappingURL=repository.js.map
|
package/esm/repository.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository.js","sourceRoot":"","sources":["../src/repository.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAGxD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC;;GAEG;
|
|
1
|
+
{"version":3,"file":"repository.js","sourceRoot":"","sources":["../src/repository.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAGxD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC;;GAEG;AAEI,WAAM,UAAU,GAAhB,MAAM,UAAU;IAAhB;QAMG,aAAQ,GAAgC,IAAI,GAAG,EAAE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7.0.7",
|
|
4
4
|
"description": "Repository implementation for FuryStack",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
},
|
|
38
38
|
"homepage": "https://github.com/furystack/furystack",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@furystack/core": "^12.0.
|
|
41
|
-
"@furystack/inject": "^8.0.
|
|
42
|
-
"@furystack/utils": "^4.0.
|
|
40
|
+
"@furystack/core": "^12.0.7",
|
|
41
|
+
"@furystack/inject": "^8.0.6",
|
|
42
|
+
"@furystack/utils": "^4.0.6"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"typescript": "^5.
|
|
46
|
-
"vitest": "^0.
|
|
45
|
+
"typescript": "^5.1.6",
|
|
46
|
+
"vitest": "^0.33.0"
|
|
47
47
|
},
|
|
48
48
|
"gitHead": "1045d854bfd8c475b7035471d130d401417a2321"
|
|
49
49
|
}
|
package/src/dataset.spec.ts
CHANGED
|
@@ -74,7 +74,7 @@ describe('DataSet', () => {
|
|
|
74
74
|
|
|
75
75
|
it('should call the add async authorizer and add the entity on pass', async () => {
|
|
76
76
|
await usingAsync(new Injector(), async (i) => {
|
|
77
|
-
const authorizeAdd = vi.fn(async () => ({ isAllowed: true } as AuthorizationResult)
|
|
77
|
+
const authorizeAdd = vi.fn(async () => ({ isAllowed: true }) as AuthorizationResult)
|
|
78
78
|
addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
|
|
79
79
|
|
|
80
80
|
getRepository(i).createDataSet(TestClass, 'id', { authorizeAdd })
|
|
@@ -88,7 +88,7 @@ describe('DataSet', () => {
|
|
|
88
88
|
|
|
89
89
|
it('should throw if the add authorizer returns a non-valid result and should not add a value to the store', async () => {
|
|
90
90
|
await usingAsync(new Injector(), async (i) => {
|
|
91
|
-
const authorizeAdd = vi.fn(async () => ({ isAllowed: false, message: '...' } as AuthorizationResult)
|
|
91
|
+
const authorizeAdd = vi.fn(async () => ({ isAllowed: false, message: '...' }) as AuthorizationResult)
|
|
92
92
|
addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
|
|
93
93
|
|
|
94
94
|
getRepository(i).createDataSet(TestClass, 'id', { authorizeAdd })
|
|
@@ -162,7 +162,7 @@ describe('DataSet', () => {
|
|
|
162
162
|
|
|
163
163
|
it('should call the authorizeUpdate authorizer and add the entity on pass', async () => {
|
|
164
164
|
await usingAsync(new Injector(), async (i) => {
|
|
165
|
-
const authorizeUpdate = vi.fn(async () => ({ isAllowed: true } as AuthorizationResult)
|
|
165
|
+
const authorizeUpdate = vi.fn(async () => ({ isAllowed: true }) as AuthorizationResult)
|
|
166
166
|
addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
|
|
167
167
|
getRepository(i).createDataSet(TestClass, 'id', { authorizeUpdate })
|
|
168
168
|
const dataSet = getDataSetFor(i, TestClass, 'id')
|
|
@@ -176,7 +176,7 @@ describe('DataSet', () => {
|
|
|
176
176
|
|
|
177
177
|
it('should throw if the authorizeUpdateEntity returns a non-valid result and should not update a value to the store', async () => {
|
|
178
178
|
await usingAsync(new Injector(), async (i) => {
|
|
179
|
-
const authorizeUpdateEntity = vi.fn(async () => ({ isAllowed: false, message: '...' } as AuthorizationResult)
|
|
179
|
+
const authorizeUpdateEntity = vi.fn(async () => ({ isAllowed: false, message: '...' }) as AuthorizationResult)
|
|
180
180
|
addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
|
|
181
181
|
getRepository(i).createDataSet(TestClass, 'id', { authorizeUpdateEntity })
|
|
182
182
|
|
|
@@ -196,7 +196,7 @@ describe('DataSet', () => {
|
|
|
196
196
|
})
|
|
197
197
|
it('should call the authorizeUpdateEntity authorizer and add the entity on pass', async () => {
|
|
198
198
|
await usingAsync(new Injector(), async (i) => {
|
|
199
|
-
const authorizeUpdateEntity = vi.fn(async () => ({ isAllowed: true } as AuthorizationResult)
|
|
199
|
+
const authorizeUpdateEntity = vi.fn(async () => ({ isAllowed: true }) as AuthorizationResult)
|
|
200
200
|
addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
|
|
201
201
|
getRepository(i).createDataSet(TestClass, 'id', { authorizeUpdateEntity })
|
|
202
202
|
const dataSet = getDataSetFor(i, TestClass, 'id')
|
|
@@ -210,7 +210,7 @@ describe('DataSet', () => {
|
|
|
210
210
|
|
|
211
211
|
it('should throw if the authorizeUpdate returns a non-valid result and should not update a value to the store', async () => {
|
|
212
212
|
await usingAsync(new Injector(), async (i) => {
|
|
213
|
-
const authorizeUpdate = vi.fn(async () => ({ isAllowed: false, message: '...' } as AuthorizationResult)
|
|
213
|
+
const authorizeUpdate = vi.fn(async () => ({ isAllowed: false, message: '...' }) as AuthorizationResult)
|
|
214
214
|
addStore(i, new InMemoryStore({ model: TestClass, primaryKey: 'id' }))
|
|
215
215
|
getRepository(i).createDataSet(TestClass, 'id', { authorizeUpdate })
|
|
216
216
|
|