@jskit-ai/workspaces-core 0.2.2 → 0.2.4
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 +9 -9
- package/src/server/common/repositories/repositoryUtils.js +2 -0
- package/src/server/common/repositories/workspaceInvitesRepository.js +3 -2
- package/src/server/common/repositories/workspaceMembershipsRepository.js +3 -2
- package/src/server/common/repositories/workspacesRepository.js +3 -2
- package/src/server/workspaceSettings/workspaceSettingsRepository.js +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/workspaces-core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "node --test --test-concurrency=1"
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"./locales/en.json": "./locales/en.json"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@jskit-ai/database-runtime": "0.1.
|
|
23
|
-
"@jskit-ai/json-rest-api-core": "0.2.
|
|
24
|
-
"@jskit-ai/resource-core": "0.1.
|
|
25
|
-
"@jskit-ai/resource-crud-core": "0.1.
|
|
26
|
-
"@jskit-ai/users-core": "0.2.
|
|
22
|
+
"@jskit-ai/database-runtime": "0.1.252",
|
|
23
|
+
"@jskit-ai/json-rest-api-core": "0.2.3",
|
|
24
|
+
"@jskit-ai/resource-core": "0.1.194",
|
|
25
|
+
"@jskit-ai/resource-crud-core": "0.1.194",
|
|
26
|
+
"@jskit-ai/users-core": "0.2.4",
|
|
27
27
|
"json-rest-schema": "^1.0.17"
|
|
28
28
|
},
|
|
29
29
|
"description": "Workspace tenancy runtime plus HTTP routes, role catalog, and workspace config scaffolding.",
|
|
@@ -171,8 +171,8 @@
|
|
|
171
171
|
}
|
|
172
172
|
},
|
|
173
173
|
"peerDependencies": {
|
|
174
|
-
"@jskit-ai/auth-core": "0.2.
|
|
175
|
-
"@jskit-ai/http-runtime": "0.2.
|
|
176
|
-
"@jskit-ai/kernel": "0.2.
|
|
174
|
+
"@jskit-ai/auth-core": "0.2.3",
|
|
175
|
+
"@jskit-ai/http-runtime": "0.2.3",
|
|
176
|
+
"@jskit-ai/kernel": "0.2.3"
|
|
177
177
|
}
|
|
178
178
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeDbRecordId,
|
|
3
|
+
retryDeadlocks,
|
|
3
4
|
toIsoString
|
|
4
5
|
} from "@jskit-ai/database-runtime/shared";
|
|
5
6
|
import { isDuplicateEntryError } from "@jskit-ai/database-runtime/shared/duplicateEntry";
|
|
@@ -30,6 +31,7 @@ function toDbJson(value, fallback = {}) {
|
|
|
30
31
|
|
|
31
32
|
export {
|
|
32
33
|
toIsoString,
|
|
34
|
+
retryDeadlocks,
|
|
33
35
|
isDuplicateEntryError,
|
|
34
36
|
normalizeText,
|
|
35
37
|
normalizeLowerText,
|
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
normalizeDbRecordId,
|
|
6
6
|
normalizeText,
|
|
7
7
|
isDuplicateEntryError,
|
|
8
|
-
toIsoString
|
|
8
|
+
toIsoString,
|
|
9
|
+
retryDeadlocks
|
|
9
10
|
} from "./repositoryUtils.js";
|
|
10
11
|
import {
|
|
11
12
|
createJsonRestContext,
|
|
@@ -81,7 +82,7 @@ function createRepository({ api } = {}) {
|
|
|
81
82
|
throw new TypeError("workspaceInvitesRepository requires json-rest-api workspaceInvites resource.");
|
|
82
83
|
}
|
|
83
84
|
|
|
84
|
-
const withTransaction = (work) => api.transaction(work);
|
|
85
|
+
const withTransaction = (work) => retryDeadlocks(() => api.transaction(work));
|
|
85
86
|
|
|
86
87
|
async function queryInvites(filters = {}, options = {}, { includeWorkspace = false } = {}) {
|
|
87
88
|
if (options.lock === true) {
|
|
@@ -4,7 +4,8 @@ import {
|
|
|
4
4
|
normalizeDbRecordId,
|
|
5
5
|
normalizeText,
|
|
6
6
|
isDuplicateEntryError,
|
|
7
|
-
toIsoString
|
|
7
|
+
toIsoString,
|
|
8
|
+
retryDeadlocks
|
|
8
9
|
} from "./repositoryUtils.js";
|
|
9
10
|
import {
|
|
10
11
|
createJsonRestContext,
|
|
@@ -61,7 +62,7 @@ function createRepository({ api } = {}) {
|
|
|
61
62
|
throw new TypeError("workspaceMembershipsRepository requires json-rest-api workspaceMemberships resource.");
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
const withTransaction = (work) => api.transaction(work);
|
|
65
|
+
const withTransaction = (work) => retryDeadlocks(() => api.transaction(work));
|
|
65
66
|
|
|
66
67
|
async function queryMemberships(filters = {}, options = {}, { include = [] } = {}) {
|
|
67
68
|
const normalizedInclude = Array.from(
|
|
@@ -2,7 +2,8 @@ import {
|
|
|
2
2
|
normalizeRecordId,
|
|
3
3
|
isDuplicateEntryError,
|
|
4
4
|
normalizeText,
|
|
5
|
-
toIsoString
|
|
5
|
+
toIsoString,
|
|
6
|
+
retryDeadlocks
|
|
6
7
|
} from "./repositoryUtils.js";
|
|
7
8
|
import {
|
|
8
9
|
createJsonRestContext,
|
|
@@ -32,7 +33,7 @@ function createRepository({ api } = {}) {
|
|
|
32
33
|
throw new TypeError("workspacesRepository requires json-rest-api workspaces and workspaceMemberships resources.");
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
const withTransaction = (work) => api.transaction(work);
|
|
36
|
+
const withTransaction = (work) => retryDeadlocks(() => api.transaction(work));
|
|
36
37
|
|
|
37
38
|
async function queryFirst(filters = {}, options = {}) {
|
|
38
39
|
const rows = extractJsonRestCollectionRows(
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeRecordId,
|
|
3
|
-
isDuplicateEntryError
|
|
3
|
+
isDuplicateEntryError,
|
|
4
|
+
retryDeadlocks
|
|
4
5
|
} from "../common/repositories/repositoryUtils.js";
|
|
5
6
|
import {
|
|
6
7
|
createJsonRestContext,
|
|
@@ -31,7 +32,7 @@ function createRepository({ api, defaultInvitesEnabled = true, defaultColorSetti
|
|
|
31
32
|
if (!api?.resources?.workspaceSettings) {
|
|
32
33
|
throw new TypeError("workspaceSettingsRepository requires json-rest-api workspaceSettings resource.");
|
|
33
34
|
}
|
|
34
|
-
const withTransaction = (work) => api.transaction(work);
|
|
35
|
+
const withTransaction = (work) => retryDeadlocks(() => api.transaction(work));
|
|
35
36
|
|
|
36
37
|
async function queryFirst(filters = {}, options = {}) {
|
|
37
38
|
const rows = extractJsonRestCollectionRows(
|