@opensaas/stack-core 0.44.0-alpha.6 → 0.44.0-alpha.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/CHANGELOG.md +655 -0
- package/dist/.build-hash +1 -1
- package/dist/access/actor.d.ts +56 -0
- package/dist/access/actor.d.ts.map +1 -0
- package/dist/access/actor.js +66 -0
- package/dist/access/actor.js.map +1 -0
- package/dist/access/decide-advertisement.d.ts +55 -0
- package/dist/access/decide-advertisement.d.ts.map +1 -0
- package/dist/access/decide-advertisement.js +125 -0
- package/dist/access/decide-advertisement.js.map +1 -0
- package/dist/access/declared-dependencies.d.ts +4 -89
- package/dist/access/declared-dependencies.d.ts.map +1 -1
- package/dist/access/declared-dependencies.js +14 -84
- package/dist/access/declared-dependencies.js.map +1 -1
- package/dist/access/depth-limits.d.ts +2 -0
- package/dist/access/depth-limits.d.ts.map +1 -1
- package/dist/access/depth-limits.js +2 -0
- package/dist/access/depth-limits.js.map +1 -1
- package/dist/access/engine.d.ts +1 -24
- package/dist/access/engine.d.ts.map +1 -1
- package/dist/access/engine.js +0 -35
- package/dist/access/engine.js.map +1 -1
- package/dist/access/field-access.d.ts +21 -19
- package/dist/access/field-access.d.ts.map +1 -1
- package/dist/access/field-access.js +100 -122
- package/dist/access/field-access.js.map +1 -1
- package/dist/access/index.d.ts +3 -6
- package/dist/access/index.d.ts.map +1 -1
- package/dist/access/index.js +3 -6
- package/dist/access/index.js.map +1 -1
- package/dist/access/rule-item.d.ts +7 -7
- package/dist/access/rule-item.d.ts.map +1 -1
- package/dist/access/rule-item.js +38 -38
- package/dist/access/rule-item.js.map +1 -1
- package/dist/access/session-vocabulary.d.ts +124 -0
- package/dist/access/session-vocabulary.d.ts.map +1 -0
- package/dist/access/session-vocabulary.js +366 -0
- package/dist/access/session-vocabulary.js.map +1 -0
- package/dist/access/transaction-registry.d.ts +6 -0
- package/dist/access/transaction-registry.d.ts.map +1 -1
- package/dist/access/transaction-registry.js +19 -2
- package/dist/access/transaction-registry.js.map +1 -1
- package/dist/access/types.d.ts +55 -6
- package/dist/access/types.d.ts.map +1 -1
- package/dist/access/vocabulary-filter-specs.d.ts +17 -0
- package/dist/access/vocabulary-filter-specs.d.ts.map +1 -0
- package/dist/access/vocabulary-filter-specs.js +27 -0
- package/dist/access/vocabulary-filter-specs.js.map +1 -0
- package/dist/client-safe.d.ts +8 -0
- package/dist/client-safe.d.ts.map +1 -0
- package/dist/client-safe.js +8 -0
- package/dist/client-safe.js.map +1 -0
- package/dist/config/field-kind.d.ts +7 -21
- package/dist/config/field-kind.d.ts.map +1 -1
- package/dist/config/field-kind.js +8 -5
- package/dist/config/field-kind.js.map +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +3 -2
- package/dist/config/index.js.map +1 -1
- package/dist/config/mcp-default-tools.d.ts +3 -0
- package/dist/config/mcp-default-tools.d.ts.map +1 -0
- package/dist/config/mcp-default-tools.js +14 -0
- package/dist/config/mcp-default-tools.js.map +1 -0
- package/dist/config/mcp-tool-names.d.ts +2 -0
- package/dist/config/mcp-tool-names.d.ts.map +1 -1
- package/dist/config/mcp-tool-names.js +17 -5
- package/dist/config/mcp-tool-names.js.map +1 -1
- package/dist/config/nav-count.d.ts +8 -16
- package/dist/config/nav-count.d.ts.map +1 -1
- package/dist/config/nav-count.js +20 -32
- package/dist/config/nav-count.js.map +1 -1
- package/dist/config/plugin-engine.d.ts.map +1 -1
- package/dist/config/plugin-engine.js +6 -0
- package/dist/config/plugin-engine.js.map +1 -1
- package/dist/config/types.d.ts +141 -28
- package/dist/config/types.d.ts.map +1 -1
- package/dist/context/engine-context.d.ts +2 -0
- package/dist/context/engine-context.d.ts.map +1 -1
- package/dist/context/engine-context.js +8 -0
- package/dist/context/engine-context.js.map +1 -1
- package/dist/context/hook-pipeline.d.ts +2 -1
- package/dist/context/hook-pipeline.d.ts.map +1 -1
- package/dist/context/hook-pipeline.js +4 -2
- package/dist/context/hook-pipeline.js.map +1 -1
- package/dist/context/index.d.ts +5 -1
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +156 -84
- package/dist/context/index.js.map +1 -1
- package/dist/context/junction.d.ts +28 -21
- package/dist/context/junction.d.ts.map +1 -1
- package/dist/context/junction.js +74 -69
- package/dist/context/junction.js.map +1 -1
- package/dist/context/plugin-field-write.d.ts.map +1 -1
- package/dist/context/plugin-field-write.js +19 -25
- package/dist/context/plugin-field-write.js.map +1 -1
- package/dist/context/process-lifetime.d.ts +8 -0
- package/dist/context/process-lifetime.d.ts.map +1 -0
- package/dist/context/process-lifetime.js +14 -0
- package/dist/context/process-lifetime.js.map +1 -0
- package/dist/context/relationship-input.d.ts +2 -15
- package/dist/context/relationship-input.d.ts.map +1 -1
- package/dist/context/relationship-input.js +44 -85
- package/dist/context/relationship-input.js.map +1 -1
- package/dist/context/transaction-boundary.d.ts +3 -2
- package/dist/context/transaction-boundary.d.ts.map +1 -1
- package/dist/context/transaction-boundary.js +17 -2
- package/dist/context/transaction-boundary.js.map +1 -1
- package/dist/context/write-pipeline.d.ts +5 -19
- package/dist/context/write-pipeline.d.ts.map +1 -1
- package/dist/context/write-pipeline.js +40 -98
- package/dist/context/write-pipeline.js.map +1 -1
- package/dist/context/write-target.d.ts +52 -0
- package/dist/context/write-target.d.ts.map +1 -0
- package/dist/context/write-target.js +118 -0
- package/dist/context/write-target.js.map +1 -0
- package/dist/contract/dependencies.d.ts +24 -10
- package/dist/contract/dependencies.d.ts.map +1 -1
- package/dist/contract/dependencies.js +120 -80
- package/dist/contract/dependencies.js.map +1 -1
- package/dist/contract/derive.d.ts +6 -11
- package/dist/contract/derive.d.ts.map +1 -1
- package/dist/contract/derive.js +256 -211
- package/dist/contract/derive.js.map +1 -1
- package/dist/contract/id-boundary.js +1 -1
- package/dist/contract/id-boundary.js.map +1 -1
- package/dist/contract/strategy.d.ts +13 -0
- package/dist/contract/strategy.d.ts.map +1 -0
- package/dist/contract/strategy.js +38 -0
- package/dist/contract/strategy.js.map +1 -0
- package/dist/db/client-alias.d.ts +12 -0
- package/dist/db/client-alias.d.ts.map +1 -0
- package/dist/db/client-alias.js +8 -0
- package/dist/db/client-alias.js.map +1 -0
- package/dist/extend.d.ts +1 -1
- package/dist/extend.d.ts.map +1 -1
- package/dist/extend.js.map +1 -1
- package/dist/fields/index.d.ts +0 -3
- package/dist/fields/index.d.ts.map +1 -1
- package/dist/fields/index.js +25 -10
- package/dist/fields/index.js.map +1 -1
- package/dist/filter/collect.d.ts +28 -39
- package/dist/filter/collect.d.ts.map +1 -1
- package/dist/filter/collect.js +46 -68
- package/dist/filter/collect.js.map +1 -1
- package/dist/filter/index.d.ts +1 -1
- package/dist/filter/index.d.ts.map +1 -1
- package/dist/filter/index.js +1 -1
- package/dist/filter/index.js.map +1 -1
- package/dist/filter/map.d.ts +4 -0
- package/dist/filter/map.d.ts.map +1 -1
- package/dist/filter/map.js +36 -3
- package/dist/filter/map.js.map +1 -1
- package/dist/hooks/index.d.ts +4 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +34 -5
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.d.ts +8 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +5 -2
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +4 -5
- package/dist/internal.js.map +1 -1
- package/dist/mcp/advertise.d.ts +5 -13
- package/dist/mcp/advertise.d.ts.map +1 -1
- package/dist/mcp/advertise.js +7 -22
- package/dist/mcp/advertise.js.map +1 -1
- package/dist/mcp/arguments.d.ts.map +1 -1
- package/dist/mcp/arguments.js +8 -11
- package/dist/mcp/arguments.js.map +1 -1
- package/dist/mcp/field-schema.d.ts +4 -15
- package/dist/mcp/field-schema.d.ts.map +1 -1
- package/dist/mcp/field-schema.js +41 -71
- package/dist/mcp/field-schema.js.map +1 -1
- package/dist/mcp/handler.d.ts +111 -18
- package/dist/mcp/handler.d.ts.map +1 -1
- package/dist/mcp/handler.js +168 -73
- package/dist/mcp/handler.js.map +1 -1
- package/dist/mcp/index.d.ts +2 -1
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/procedure-tools.d.ts +63 -0
- package/dist/mcp/procedure-tools.d.ts.map +1 -0
- package/dist/mcp/procedure-tools.js +139 -0
- package/dist/mcp/procedure-tools.js.map +1 -0
- package/dist/mcp/projection.d.ts.map +1 -1
- package/dist/mcp/projection.js +28 -36
- package/dist/mcp/projection.js.map +1 -1
- package/dist/mcp/reachability.d.ts +5 -1
- package/dist/mcp/reachability.d.ts.map +1 -1
- package/dist/mcp/reachability.js +24 -5
- package/dist/mcp/reachability.js.map +1 -1
- package/dist/mcp/relation-member.d.ts +15 -0
- package/dist/mcp/relation-member.d.ts.map +1 -0
- package/dist/mcp/relation-member.js +50 -0
- package/dist/mcp/relation-member.js.map +1 -0
- package/dist/mcp/types.d.ts +12 -0
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/mcp/where-id-boundary.d.ts.map +1 -1
- package/dist/mcp/where-id-boundary.js +12 -24
- package/dist/mcp/where-id-boundary.js.map +1 -1
- package/dist/mcp/where-reachability.d.ts +2 -0
- package/dist/mcp/where-reachability.d.ts.map +1 -1
- package/dist/mcp/where-reachability.js +39 -23
- package/dist/mcp/where-reachability.js.map +1 -1
- package/dist/members/claims.d.ts +71 -0
- package/dist/members/claims.d.ts.map +1 -0
- package/dist/members/claims.js +199 -0
- package/dist/members/claims.js.map +1 -0
- package/dist/members/list-members.d.ts +87 -0
- package/dist/members/list-members.d.ts.map +1 -0
- package/dist/members/list-members.js +250 -0
- package/dist/members/list-members.js.map +1 -0
- package/dist/procedures/client.d.ts +163 -0
- package/dist/procedures/client.d.ts.map +1 -0
- package/dist/procedures/client.js +152 -0
- package/dist/procedures/client.js.map +1 -0
- package/dist/procedures/codes.d.ts +23 -0
- package/dist/procedures/codes.d.ts.map +1 -0
- package/dist/procedures/codes.js +46 -0
- package/dist/procedures/codes.js.map +1 -0
- package/dist/procedures/context-face.d.ts +4 -0
- package/dist/procedures/context-face.d.ts.map +1 -0
- package/dist/procedures/context-face.js +31 -0
- package/dist/procedures/context-face.js.map +1 -0
- package/dist/procedures/failures.d.ts +31 -0
- package/dist/procedures/failures.d.ts.map +1 -0
- package/dist/procedures/failures.js +51 -0
- package/dist/procedures/failures.js.map +1 -0
- package/dist/procedures/http.d.ts +114 -0
- package/dist/procedures/http.d.ts.map +1 -0
- package/dist/procedures/http.js +224 -0
- package/dist/procedures/http.js.map +1 -0
- package/dist/procedures/index.d.ts +7 -0
- package/dist/procedures/index.d.ts.map +1 -0
- package/dist/procedures/index.js +11 -0
- package/dist/procedures/index.js.map +1 -0
- package/dist/procedures/procedure.d.ts +204 -0
- package/dist/procedures/procedure.d.ts.map +1 -0
- package/dist/procedures/procedure.js +123 -0
- package/dist/procedures/procedure.js.map +1 -0
- package/dist/procedures/result.d.ts +42 -0
- package/dist/procedures/result.d.ts.map +1 -0
- package/dist/procedures/result.js +51 -0
- package/dist/procedures/result.js.map +1 -0
- package/dist/procedures/run.d.ts +36 -0
- package/dist/procedures/run.d.ts.map +1 -0
- package/dist/procedures/run.js +76 -0
- package/dist/procedures/run.js.map +1 -0
- package/dist/procedures/server.d.ts +131 -0
- package/dist/procedures/server.d.ts.map +1 -0
- package/dist/procedures/server.js +115 -0
- package/dist/procedures/server.js.map +1 -0
- package/dist/procedures/validate.d.ts +60 -0
- package/dist/procedures/validate.d.ts.map +1 -0
- package/dist/procedures/validate.js +254 -0
- package/dist/procedures/validate.js.map +1 -0
- package/dist/procedures/web-session.d.ts +12 -0
- package/dist/procedures/web-session.d.ts.map +1 -0
- package/dist/procedures/web-session.js +35 -0
- package/dist/procedures/web-session.js.map +1 -0
- package/dist/query/relationship-options.d.ts +2 -0
- package/dist/query/relationship-options.d.ts.map +1 -1
- package/dist/query/relationship-options.js +3 -2
- package/dist/query/relationship-options.js.map +1 -1
- package/dist/secured/binding.d.ts +84 -0
- package/dist/secured/binding.d.ts.map +1 -0
- package/dist/secured/binding.js +52 -0
- package/dist/secured/binding.js.map +1 -0
- package/dist/secured/declared-branch.d.ts +11 -0
- package/dist/secured/declared-branch.d.ts.map +1 -0
- package/dist/secured/declared-branch.js +17 -0
- package/dist/secured/declared-branch.js.map +1 -0
- package/dist/secured/field-visibility.d.ts +56 -0
- package/dist/secured/field-visibility.d.ts.map +1 -0
- package/dist/secured/field-visibility.js +624 -0
- package/dist/secured/field-visibility.js.map +1 -0
- package/dist/secured/include.d.ts +68 -41
- package/dist/secured/include.d.ts.map +1 -1
- package/dist/secured/include.js +217 -115
- package/dist/secured/include.js.map +1 -1
- package/dist/secured/lower.d.ts.map +1 -1
- package/dist/secured/lower.js +1 -3
- package/dist/secured/lower.js.map +1 -1
- package/dist/secured/read.d.ts +11 -108
- package/dist/secured/read.d.ts.map +1 -1
- package/dist/secured/read.js +46 -633
- package/dist/secured/read.js.map +1 -1
- package/dist/secured/select.d.ts +0 -24
- package/dist/secured/select.d.ts.map +1 -1
- package/dist/secured/select.js +60 -153
- package/dist/secured/select.js.map +1 -1
- package/dist/secured/vocabulary.d.ts +13 -1
- package/dist/secured/vocabulary.d.ts.map +1 -1
- package/dist/secured/vocabulary.js +173 -83
- package/dist/secured/vocabulary.js.map +1 -1
- package/dist/testing/untyped-rule.d.ts +8 -0
- package/dist/testing/untyped-rule.d.ts.map +1 -0
- package/dist/testing/untyped-rule.js +4 -0
- package/dist/testing/untyped-rule.js.map +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/rows.d.ts +18 -1
- package/dist/types/rows.d.ts.map +1 -1
- package/dist/validation/config-refusal.d.ts +3 -1
- package/dist/validation/config-refusal.d.ts.map +1 -1
- package/dist/validation/database-config.d.ts +1 -0
- package/dist/validation/database-config.d.ts.map +1 -1
- package/dist/validation/database-config.js +1 -1
- package/dist/validation/database-config.js.map +1 -1
- package/dist/validation/default-value.d.ts.map +1 -1
- package/dist/validation/default-value.js +3 -8
- package/dist/validation/default-value.js.map +1 -1
- package/dist/validation/extension-packs.d.ts.map +1 -1
- package/dist/validation/extension-packs.js +1 -0
- package/dist/validation/extension-packs.js.map +1 -1
- package/dist/validation/field-config.d.ts +3 -2
- package/dist/validation/field-config.d.ts.map +1 -1
- package/dist/validation/field-config.js +3 -1
- package/dist/validation/field-config.js.map +1 -1
- package/dist/validation/field-names.d.ts +2 -1
- package/dist/validation/field-names.d.ts.map +1 -1
- package/dist/validation/field-names.js +76 -63
- package/dist/validation/field-names.js.map +1 -1
- package/dist/validation/identifier-names.d.ts +1 -0
- package/dist/validation/identifier-names.d.ts.map +1 -1
- package/dist/validation/identifier-names.js +17 -9
- package/dist/validation/identifier-names.js.map +1 -1
- package/dist/validation/needs-closure.d.ts +30 -14
- package/dist/validation/needs-closure.d.ts.map +1 -1
- package/dist/validation/needs-closure.js +184 -31
- package/dist/validation/needs-closure.js.map +1 -1
- package/dist/validation/schema.d.ts +1 -0
- package/dist/validation/schema.d.ts.map +1 -1
- package/dist/validation/schema.js +4 -2
- package/dist/validation/schema.js.map +1 -1
- package/package.json +20 -4
- package/dist/access/field-visibility.d.ts +0 -11
- package/dist/access/field-visibility.d.ts.map +0 -1
- package/dist/access/field-visibility.js +0 -366
- package/dist/access/field-visibility.js.map +0 -1
- package/dist/access/query-validation.d.ts +0 -30
- package/dist/access/query-validation.d.ts.map +0 -1
- package/dist/access/query-validation.js +0 -49
- package/dist/access/query-validation.js.map +0 -1
- package/dist/access/system-fields.d.ts +0 -2
- package/dist/access/system-fields.d.ts.map +0 -1
- package/dist/access/system-fields.js +0 -7
- package/dist/access/system-fields.js.map +0 -1
package/dist/context/index.js
CHANGED
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
import { checkAccess } from '../access/index.js';
|
|
2
|
-
import {
|
|
3
|
-
import { ValidationError, DatabaseError } from '../hooks/index.js';
|
|
2
|
+
import { bindSessionReadOnly, sealSession } from '../access/actor.js';
|
|
3
|
+
import { ValidationError, DatabaseError, isPlainObject } from '../hooks/index.js';
|
|
4
4
|
import { databaseErrorMessage, normalizeDatabaseError } from '../lib/prisma-errors.js';
|
|
5
5
|
import { isClientSafeError } from '../lib/client-safe-error.js';
|
|
6
6
|
import { nullPrototypeRegistry } from '../lib/null-prototype-registry.js';
|
|
7
7
|
import { warnOnce } from '../lib/warn-once.js';
|
|
8
|
-
import { createSecuredRead
|
|
9
|
-
import {
|
|
8
|
+
import { createSecuredRead } from '../secured/read.js';
|
|
9
|
+
import { invalidatesSessionVocabularyOf, withOwnSessionVocabulary, } from '../access/session-vocabulary.js';
|
|
10
|
+
import { withSingletonProbe } from './write-target.js';
|
|
11
|
+
import { createLivenessProbe, createRowLockLane, RowLockUnavailableError, RowLockLaneUnavailableError, unusableRowLockLane, } from '../secured/lock.js';
|
|
10
12
|
import { createUnsafeSurface, createUnsafeTransactionSurface, unavailableUnsafeSurface, } from '../unsafe.js';
|
|
11
13
|
import { ENGINE_FACE, engineContextOf } from './engine-context.js';
|
|
12
14
|
import { withOrigin } from '../origin.js';
|
|
13
15
|
import { getRelationshipOptions, isRelationshipLabelReadable, relationshipSearchWhere, } from '../query/relationship-options.js';
|
|
14
16
|
import { runWritePipeline, createWriteStrategy, updateWriteStrategy, deleteWriteStrategy, } from './write-pipeline.js';
|
|
15
|
-
import { resolveJunctionEdge,
|
|
16
|
-
import {
|
|
17
|
+
import { resolveJunctionEdge, resolveLinkableScope } from './junction.js';
|
|
18
|
+
import { assertListMembersResolve, resolveListMember, resolveListMembers, } from '../members/list-members.js';
|
|
17
19
|
import { parseListId } from '../contract/id-boundary.js';
|
|
18
20
|
import { reportAfterTransactionFailures } from './transaction-boundary.js';
|
|
19
21
|
import { isRowActionAvailable } from '../config/row-action-availability.js';
|
|
20
22
|
import { checkHasAccess } from '../config/has-access-gate.js';
|
|
21
23
|
import { TransactionRegistry, TransactionRolledBackError, } from '../access/transaction-registry.js';
|
|
22
24
|
export { TransactionRolledBackError };
|
|
25
|
+
const LINKED_TARGET_LIMIT = 1000;
|
|
23
26
|
/**
|
|
24
27
|
* Warn once per (list, operation) when a caller passes `select` to a read op
|
|
25
28
|
* that ignores it. See "Narrowing Reads" in packages/core/CLAUDE.md.
|
|
@@ -32,30 +35,30 @@ function warnIfSelectIgnored(args, listName, operation) {
|
|
|
32
35
|
`Narrow a read with \`include\`, or with \`.select()\` on the secured surface, instead. ` +
|
|
33
36
|
`See https://stack.opensaas.au/docs/concepts/queries`);
|
|
34
37
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
38
|
+
function classifyBackReference(listKey, fieldName, config) {
|
|
39
|
+
const member = resolveListMember(config, listKey, fieldName);
|
|
40
|
+
if (member === undefined)
|
|
41
|
+
return { kind: 'notRelationship' };
|
|
42
|
+
switch (member.kind) {
|
|
43
|
+
case 'field': {
|
|
44
|
+
const { storage } = member;
|
|
45
|
+
if (storage.kind !== 'relation')
|
|
46
|
+
return { kind: 'notRelationship' };
|
|
47
|
+
return storage.foreignKey === undefined
|
|
48
|
+
? { kind: 'nonOwning' }
|
|
49
|
+
: { kind: 'owning', relatedList: storage.relatedList, foreignKey: storage.foreignKey.name };
|
|
50
|
+
}
|
|
51
|
+
case 'syntheticBackRelation':
|
|
52
|
+
return { kind: 'nonOwning' };
|
|
53
|
+
case 'foreignKey':
|
|
54
|
+
case 'partColumn':
|
|
55
|
+
case 'systemField':
|
|
56
|
+
return { kind: 'notRelationship' };
|
|
57
|
+
default: {
|
|
58
|
+
const unhandled = member;
|
|
59
|
+
return unhandled;
|
|
60
|
+
}
|
|
55
61
|
}
|
|
56
|
-
return resolveSyntheticReverseRelation(fieldName, listKey, config) !== null
|
|
57
|
-
? { kind: 'nonOwning' }
|
|
58
|
-
: { kind: 'notRelationship' };
|
|
59
62
|
}
|
|
60
63
|
function isRawRowCollection(value) {
|
|
61
64
|
return (typeof value === 'object' &&
|
|
@@ -92,12 +95,8 @@ function assertIdentityWhere(where, listName, terminal) {
|
|
|
92
95
|
], {});
|
|
93
96
|
}
|
|
94
97
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- ListConfig must accept any TypeInfo
|
|
95
|
-
function
|
|
96
|
-
|
|
97
|
-
return false;
|
|
98
|
-
if (typeof listConfig.isSingleton === 'boolean')
|
|
99
|
-
return true;
|
|
100
|
-
return listConfig.isSingleton.autoCreate !== false;
|
|
98
|
+
function autoCreates(listConfig) {
|
|
99
|
+
return typeof listConfig.isSingleton !== 'object' || listConfig.isSingleton.autoCreate !== false;
|
|
101
100
|
}
|
|
102
101
|
/**
|
|
103
102
|
* Thrown when `context.transaction()` can neither open a transaction nor join
|
|
@@ -344,13 +343,19 @@ function transactionFace(base, lock, owner) {
|
|
|
344
343
|
advisoryLock: async (key) => {
|
|
345
344
|
if (lock === undefined)
|
|
346
345
|
throw new RowLockUnavailableError('advisoryLock()');
|
|
347
|
-
|
|
346
|
+
try {
|
|
347
|
+
await lock.advisory(key);
|
|
348
|
+
}
|
|
349
|
+
catch (error) {
|
|
350
|
+
owner.poison(error);
|
|
351
|
+
throw error;
|
|
352
|
+
}
|
|
348
353
|
},
|
|
349
354
|
sudo: () => transactionFace(base.sudo(), lock, owner),
|
|
350
355
|
withSession: (session) => transactionFace(base.withSession(session), lock, owner),
|
|
351
356
|
transaction: (fn) => joinNested(fn, face, owner),
|
|
352
357
|
};
|
|
353
|
-
return face;
|
|
358
|
+
return bindSessionReadOnly(face);
|
|
354
359
|
}
|
|
355
360
|
// A database failure reaches the client as the stack's own message (ADR-0042),
|
|
356
361
|
// so the driver's diagnostic text — carried on `cause` — reaches no channel at
|
|
@@ -446,7 +451,7 @@ function assertValidSession(session) {
|
|
|
446
451
|
if (undefinedKeys.length > 0)
|
|
447
452
|
throw new InvalidSessionError(undefinedKeys);
|
|
448
453
|
}
|
|
449
|
-
export function getContext(config, ormHandle,
|
|
454
|
+
export function getContext(config, ormHandle, givenSession, storage, _isSudo = false,
|
|
450
455
|
// Internal: when rebuilding the context against a transaction client, reuse the
|
|
451
456
|
// already-initialised plugin services rather than re-running plugin runtimes.
|
|
452
457
|
_sharedPlugins,
|
|
@@ -474,7 +479,8 @@ _unsafeTransaction,
|
|
|
474
479
|
// carried through by `sudo()`/`withSession()` unchanged; omitted for a
|
|
475
480
|
// fresh, non-transactional context, which is its own base.
|
|
476
481
|
_baseContext) {
|
|
477
|
-
assertValidSession(
|
|
482
|
+
assertValidSession(givenSession);
|
|
483
|
+
const session = givenSession === null ? null : sealSession(givenSession);
|
|
478
484
|
// Broad type to allow dynamic model access; populated by populateDbDelegate below.
|
|
479
485
|
const db = {};
|
|
480
486
|
const openTransaction = transactionOpenerFor(config, client, _unsafeTransaction);
|
|
@@ -516,8 +522,9 @@ _baseContext) {
|
|
|
516
522
|
_rowLock: lock,
|
|
517
523
|
_config: config,
|
|
518
524
|
_baseContext,
|
|
519
|
-
_orderableKeys: (listKey, keys) => orderableKeys(context, config, listKey, keys),
|
|
520
525
|
};
|
|
526
|
+
withOwnSessionVocabulary(context, config);
|
|
527
|
+
withSingletonProbe(context);
|
|
521
528
|
populateDbDelegate(db, config, ormHandle, context, lock);
|
|
522
529
|
// Skipped when reusing shared plugins (transaction rebind) so runtimes — and
|
|
523
530
|
// any side effects they carry — run exactly once per top-level context.
|
|
@@ -598,11 +605,11 @@ _baseContext) {
|
|
|
598
605
|
return { bulkAction: false, error: 'Access denied' };
|
|
599
606
|
}
|
|
600
607
|
try {
|
|
601
|
-
const result = await action.handler({
|
|
608
|
+
const result = await transaction(async (tx) => action.handler({
|
|
602
609
|
listKey: props.listKey,
|
|
603
610
|
ids: props.ids,
|
|
604
|
-
context,
|
|
605
|
-
});
|
|
611
|
+
context: engineContextOf(tx),
|
|
612
|
+
}));
|
|
606
613
|
return { bulkAction: true, message: result?.message };
|
|
607
614
|
}
|
|
608
615
|
catch (error) {
|
|
@@ -686,7 +693,7 @@ _baseContext) {
|
|
|
686
693
|
if (!props.field) {
|
|
687
694
|
return { removed: false, error: 'Missing back-reference field for disconnect' };
|
|
688
695
|
}
|
|
689
|
-
const backRef = classifyBackReference(props.listKey, props.field,
|
|
696
|
+
const backRef = classifyBackReference(props.listKey, props.field, config);
|
|
690
697
|
if (backRef.kind === 'notRelationship') {
|
|
691
698
|
return {
|
|
692
699
|
removed: false,
|
|
@@ -712,9 +719,8 @@ _baseContext) {
|
|
|
712
719
|
// owning foreign-key column `<field>Id` (relationship-input.ts),
|
|
713
720
|
// which is the key a bare read (no `include`) returns it under.
|
|
714
721
|
const fieldName = props.field;
|
|
715
|
-
const foreignKeyColumn =
|
|
716
|
-
const
|
|
717
|
-
const expectedParentId = parseId(parentListKey, props.parentId);
|
|
722
|
+
const foreignKeyColumn = backRef.foreignKey;
|
|
723
|
+
const expectedParentId = parseId(backRef.relatedList, props.parentId);
|
|
718
724
|
if (expectedParentId === null) {
|
|
719
725
|
return { removed: false, error: 'Access denied or operation failed' };
|
|
720
726
|
}
|
|
@@ -811,7 +817,7 @@ _baseContext) {
|
|
|
811
817
|
}
|
|
812
818
|
const data = { ...props.data };
|
|
813
819
|
if (props.field && props.parentId) {
|
|
814
|
-
const backRef = classifyBackReference(props.listKey, props.field,
|
|
820
|
+
const backRef = classifyBackReference(props.listKey, props.field, config);
|
|
815
821
|
// The back-reference must name a relationship field on this list; a
|
|
816
822
|
// non-relationship field would otherwise receive a nonsensical
|
|
817
823
|
// { connect } value. Also hardening — the drawer only ever passes a
|
|
@@ -833,7 +839,7 @@ _baseContext) {
|
|
|
833
839
|
`Link the parent from the side that holds the column.`,
|
|
834
840
|
};
|
|
835
841
|
}
|
|
836
|
-
const parentId = parseId(backRef.
|
|
842
|
+
const parentId = parseId(backRef.relatedList, props.parentId);
|
|
837
843
|
if (parentId === null) {
|
|
838
844
|
return { created: false, error: 'Access denied or operation failed' };
|
|
839
845
|
}
|
|
@@ -909,26 +915,26 @@ _baseContext) {
|
|
|
909
915
|
// update returns `null`, surfaced as `{ linked: false }` with a generic
|
|
910
916
|
// reason.
|
|
911
917
|
if (props.action === 'linkRelated') {
|
|
912
|
-
const backRef = classifyBackReference(props.listKey, props.field, listConfig, config);
|
|
913
|
-
if (backRef.kind === 'notRelationship') {
|
|
914
|
-
return {
|
|
915
|
-
linked: false,
|
|
916
|
-
error: `Field "${props.field}" on list "${props.listKey}" is not a relationship field`,
|
|
917
|
-
};
|
|
918
|
-
}
|
|
919
|
-
if (backRef.kind === 'nonOwning') {
|
|
920
|
-
return {
|
|
921
|
-
linked: false,
|
|
922
|
-
error: `Cannot link through "${props.field}": a non-owning back-reference owns no foreign key. ` +
|
|
923
|
-
`Link the parent from the side that holds the column.`,
|
|
924
|
-
};
|
|
925
|
-
}
|
|
926
|
-
const relatedId = parseId(props.listKey, props.id);
|
|
927
|
-
const parentId = parseId(backRef.field.ref.split('.')[0], props.parentId);
|
|
928
|
-
if (relatedId === null || parentId === null) {
|
|
929
|
-
return { linked: false, error: 'Access denied or operation failed' };
|
|
930
|
-
}
|
|
931
918
|
try {
|
|
919
|
+
const backRef = classifyBackReference(props.listKey, props.field, config);
|
|
920
|
+
if (backRef.kind === 'notRelationship') {
|
|
921
|
+
return {
|
|
922
|
+
linked: false,
|
|
923
|
+
error: `Field "${props.field}" on list "${props.listKey}" is not a relationship field`,
|
|
924
|
+
};
|
|
925
|
+
}
|
|
926
|
+
if (backRef.kind === 'nonOwning') {
|
|
927
|
+
return {
|
|
928
|
+
linked: false,
|
|
929
|
+
error: `Cannot link through "${props.field}": a non-owning back-reference owns no foreign key. ` +
|
|
930
|
+
`Link the parent from the side that holds the column.`,
|
|
931
|
+
};
|
|
932
|
+
}
|
|
933
|
+
const relatedId = parseId(props.listKey, props.id);
|
|
934
|
+
const parentId = parseId(backRef.relatedList, props.parentId);
|
|
935
|
+
if (relatedId === null || parentId === null) {
|
|
936
|
+
return { linked: false, error: 'Access denied or operation failed' };
|
|
937
|
+
}
|
|
932
938
|
const result = await model.update({
|
|
933
939
|
where: { id: relatedId },
|
|
934
940
|
data: { [props.field]: { connect: { id: parentId } } },
|
|
@@ -974,13 +980,38 @@ _baseContext) {
|
|
|
974
980
|
error: `Field "${props.field}" on list "${props.listKey}" is not a relationship field`,
|
|
975
981
|
};
|
|
976
982
|
}
|
|
977
|
-
const
|
|
983
|
+
const linkedTargetIds = async (linkable) => {
|
|
984
|
+
const rows = await context.db[linkable.junctionListKey]
|
|
985
|
+
.where(linkable.linkedRows)
|
|
986
|
+
.limit(LINKED_TARGET_LIMIT)
|
|
987
|
+
.all();
|
|
988
|
+
return rows.flatMap((row) => {
|
|
989
|
+
const id = row[linkable.targetForeignKey];
|
|
990
|
+
return typeof id === 'string' || typeof id === 'number' ? [id] : [];
|
|
991
|
+
});
|
|
992
|
+
};
|
|
993
|
+
let relatedListKey = fieldConfig.ref.split('.')[0];
|
|
994
|
+
let scope;
|
|
995
|
+
if (props.linkableFor !== undefined) {
|
|
996
|
+
const parentId = parseId(props.listKey, props.linkableFor);
|
|
997
|
+
if (parentId === null)
|
|
998
|
+
return { options: [], searched: false };
|
|
999
|
+
const linkable = resolveLinkableScope(config, props.listKey, props.field, parentId);
|
|
1000
|
+
if (linkable === null)
|
|
1001
|
+
return { options: [], searched: false };
|
|
1002
|
+
relatedListKey = linkable.listKey;
|
|
1003
|
+
scope =
|
|
1004
|
+
linkable.kind === 'where'
|
|
1005
|
+
? linkable.where
|
|
1006
|
+
: { id: { notIn: await linkedTargetIds(linkable) } };
|
|
1007
|
+
}
|
|
978
1008
|
const labelReadable = await isRelationshipLabelReadable(context, config, relatedListKey);
|
|
979
1009
|
const options = await getRelationshipOptions(context, config, relatedListKey, {
|
|
980
1010
|
labelReadable,
|
|
981
1011
|
search: props.search,
|
|
982
1012
|
take: props.take,
|
|
983
1013
|
selectedIds: props.selectedIds,
|
|
1014
|
+
scope,
|
|
984
1015
|
});
|
|
985
1016
|
const searched = relationshipSearchWhere(config, relatedListKey, {
|
|
986
1017
|
search: props.search,
|
|
@@ -1017,24 +1048,24 @@ _baseContext) {
|
|
|
1017
1048
|
}
|
|
1018
1049
|
// Bypasses access control; hooks and validation still run.
|
|
1019
1050
|
function sudo() {
|
|
1020
|
-
return getContext(config, ormHandle, session, context.storage, true, undefined,
|
|
1051
|
+
return vocabularyDerivedFrom(context, getContext(config, ormHandle, session, context.storage, true, undefined,
|
|
1021
1052
|
// ADR-0028: a sudo write issued from inside an owned transaction (e.g.
|
|
1022
1053
|
// `tx.sudo().db.x.create()`) must still defer to that owner.
|
|
1023
1054
|
context._transactionOwner, client, _unsafeTransaction,
|
|
1024
1055
|
// Carry the same base-client context forward (issue #1348) — sudo()
|
|
1025
1056
|
// derives a new context, not a new transaction boundary.
|
|
1026
|
-
context._baseContext);
|
|
1057
|
+
context._baseContext));
|
|
1027
1058
|
}
|
|
1028
1059
|
// Substitutes the session; access control and hooks still run against it
|
|
1029
1060
|
// (orthogonal to `sudo`, so the receiver's sudo state is preserved).
|
|
1030
1061
|
function withSession(newSession) {
|
|
1031
|
-
return getContext(config, ormHandle, newSession, context.storage, _isSudo, undefined,
|
|
1062
|
+
return vocabularyDerivedFrom(context, getContext(config, ormHandle, newSession, context.storage, _isSudo, undefined,
|
|
1032
1063
|
// ADR-0028: a write issued from inside an owned transaction (e.g.
|
|
1033
1064
|
// `tx.withSession(s).db.x.create()`) must still defer to that owner.
|
|
1034
1065
|
context._transactionOwner, client, _unsafeTransaction,
|
|
1035
1066
|
// Carry the same base-client context forward (issue #1348) — withSession()
|
|
1036
1067
|
// derives a new context, not a new transaction boundary.
|
|
1037
|
-
context._baseContext);
|
|
1068
|
+
context._baseContext));
|
|
1038
1069
|
}
|
|
1039
1070
|
// Interactive, hook-firing transaction (#614). See the `transaction` doc on
|
|
1040
1071
|
// `StackContext` above for the atomicity/isolation/retry contract.
|
|
@@ -1053,7 +1084,11 @@ _baseContext) {
|
|
|
1053
1084
|
}
|
|
1054
1085
|
const registry = new TransactionRegistry();
|
|
1055
1086
|
const ormClient = ormHandle;
|
|
1056
|
-
const settled = runTransactionBody(fn, registry, ormClient)
|
|
1087
|
+
const settled = runTransactionBody(fn, registry, ormClient).then((result) => {
|
|
1088
|
+
if (registry.hasWritten)
|
|
1089
|
+
context._invalidateSessionVocabulary?.();
|
|
1090
|
+
return result;
|
|
1091
|
+
});
|
|
1057
1092
|
return settleTransactionOwner(settled, registry, config);
|
|
1058
1093
|
}
|
|
1059
1094
|
function runTransactionBody(fn, registry, ormClient) {
|
|
@@ -1118,7 +1153,12 @@ _baseContext) {
|
|
|
1118
1153
|
_isSudo,
|
|
1119
1154
|
[ENGINE_FACE]: context,
|
|
1120
1155
|
};
|
|
1121
|
-
|
|
1156
|
+
bindSessionReadOnly(context);
|
|
1157
|
+
return bindSessionReadOnly(returned);
|
|
1158
|
+
}
|
|
1159
|
+
function vocabularyDerivedFrom(receiver, derived) {
|
|
1160
|
+
invalidatesSessionVocabularyOf(engineContextOf(derived), receiver);
|
|
1161
|
+
return derived;
|
|
1122
1162
|
}
|
|
1123
1163
|
/**
|
|
1124
1164
|
* Complete the normalisation the engine terminal started, for a write.
|
|
@@ -1156,6 +1196,7 @@ function resolvingConstraints(operation, config) {
|
|
|
1156
1196
|
export function populateDbDelegate(target, config, ormHandle, context,
|
|
1157
1197
|
/** The row-lock lane, on a transaction-bound context alone (ADR-0047). */
|
|
1158
1198
|
lock) {
|
|
1199
|
+
const listMembers = assertListMembersResolve(config);
|
|
1159
1200
|
for (const [listName, listConfig] of Object.entries(config.lists)) {
|
|
1160
1201
|
const createOp = resolvingConstraints(createCreate(listName, listConfig, ormHandle, context, config), config);
|
|
1161
1202
|
const updateOp = resolvingConstraints(createUpdate(listName, listConfig, ormHandle, context, config), config);
|
|
@@ -1164,9 +1205,17 @@ lock) {
|
|
|
1164
1205
|
update: updateOp,
|
|
1165
1206
|
delete: resolvingConstraints(createDelete(listName, listConfig, ormHandle, context, config), config),
|
|
1166
1207
|
};
|
|
1167
|
-
const read = createSecuredRead({
|
|
1168
|
-
|
|
1169
|
-
|
|
1208
|
+
const read = createSecuredRead({
|
|
1209
|
+
listName,
|
|
1210
|
+
listConfig,
|
|
1211
|
+
ormHandle,
|
|
1212
|
+
context,
|
|
1213
|
+
config,
|
|
1214
|
+
rebindDb: rebindDb(config),
|
|
1215
|
+
lock,
|
|
1216
|
+
});
|
|
1217
|
+
if (listMembers.get(listName)?.singleton === true) {
|
|
1218
|
+
operations.get = resolvingConstraints(createGet(listName, listConfig, read, context, createOp, lock), config);
|
|
1170
1219
|
}
|
|
1171
1220
|
else {
|
|
1172
1221
|
operations.where = read.where;
|
|
@@ -1202,6 +1251,10 @@ export function buildDbDelegate(config, ormHandle, context) {
|
|
|
1202
1251
|
populateDbDelegate(db, config, ormHandle, context, context._rowLock);
|
|
1203
1252
|
return db;
|
|
1204
1253
|
}
|
|
1254
|
+
/** The read binding's `rebindDb`: a hook's `context.db`, built against the hook's own context. */
|
|
1255
|
+
export function rebindDb(config) {
|
|
1256
|
+
return (derived) => buildDbDelegate(config, derived.ormHandle, derived);
|
|
1257
|
+
}
|
|
1205
1258
|
const WRITE_ARG_KEYS = {
|
|
1206
1259
|
create: ['data'],
|
|
1207
1260
|
update: ['where', 'data'],
|
|
@@ -1212,6 +1265,9 @@ function assertWriteArgs(args, listName, operation, isSingleton) {
|
|
|
1212
1265
|
if (args === null || typeof args !== 'object') {
|
|
1213
1266
|
throw new ValidationError([`${operation}() on "${listName}" takes an argument object with ${allowed.join(', ')}.`], {});
|
|
1214
1267
|
}
|
|
1268
|
+
if (operation !== 'delete' && !isPlainObject(Reflect.get(args, 'data'))) {
|
|
1269
|
+
throw new ValidationError([`${operation}() on "${listName}" takes \`data\` as an object of field values.`], {});
|
|
1270
|
+
}
|
|
1215
1271
|
for (const [key, value] of Object.entries(args)) {
|
|
1216
1272
|
if (allowed.includes(key) || value === undefined)
|
|
1217
1273
|
continue;
|
|
@@ -1231,7 +1287,7 @@ listConfig, ormHandle, context, config) {
|
|
|
1231
1287
|
// Thin adapter over the Write Pipeline: pick the create strategy, run the
|
|
1232
1288
|
// canonical secured write sequence, return its result.
|
|
1233
1289
|
return async (args) => {
|
|
1234
|
-
assertWriteArgs(args, listName, 'create',
|
|
1290
|
+
assertWriteArgs(args, listName, 'create', resolveListMembers(config, listName).singleton);
|
|
1235
1291
|
return runWritePipeline({
|
|
1236
1292
|
listName,
|
|
1237
1293
|
listConfig,
|
|
@@ -1239,7 +1295,7 @@ listConfig, ormHandle, context, config) {
|
|
|
1239
1295
|
context,
|
|
1240
1296
|
config,
|
|
1241
1297
|
inputData: args.data,
|
|
1242
|
-
strategy: createWriteStrategy(listName, listConfig),
|
|
1298
|
+
strategy: createWriteStrategy(listName, listConfig, config),
|
|
1243
1299
|
});
|
|
1244
1300
|
};
|
|
1245
1301
|
}
|
|
@@ -1251,7 +1307,7 @@ listConfig, ormHandle, context, config) {
|
|
|
1251
1307
|
return async (args) => {
|
|
1252
1308
|
// Runs before the pipeline's access gate — a `where` the engine cannot
|
|
1253
1309
|
// lower is the caller's own shape error, not a denial.
|
|
1254
|
-
assertWriteArgs(args, listName, 'update',
|
|
1310
|
+
assertWriteArgs(args, listName, 'update', resolveListMembers(config, listName).singleton);
|
|
1255
1311
|
assertIdentityWhere(args.where, listName, 'update');
|
|
1256
1312
|
return runWritePipeline({
|
|
1257
1313
|
listName,
|
|
@@ -1270,7 +1326,7 @@ listConfig, ormHandle, context, config) {
|
|
|
1270
1326
|
// Thin adapter over the Write Pipeline: pick the delete strategy, run the
|
|
1271
1327
|
// canonical secured write sequence, return its result.
|
|
1272
1328
|
return async (args) => {
|
|
1273
|
-
assertWriteArgs(args, listName, 'delete',
|
|
1329
|
+
assertWriteArgs(args, listName, 'delete', resolveListMembers(config, listName).singleton);
|
|
1274
1330
|
assertIdentityWhere(args.where, listName, 'delete');
|
|
1275
1331
|
return runWritePipeline({
|
|
1276
1332
|
listName,
|
|
@@ -1322,9 +1378,20 @@ function assertBooleanInclude(include, listName) {
|
|
|
1322
1378
|
* so the create is refused and `get()` answers `null` — the same `null` a
|
|
1323
1379
|
* denied or an absent row answers with.
|
|
1324
1380
|
*/
|
|
1381
|
+
async function tookSingletonLock(lock, listName) {
|
|
1382
|
+
try {
|
|
1383
|
+
await lock.advisory(`opensaas:singleton-create:${listName}`);
|
|
1384
|
+
return true;
|
|
1385
|
+
}
|
|
1386
|
+
catch (error) {
|
|
1387
|
+
if (error instanceof RowLockLaneUnavailableError)
|
|
1388
|
+
return false;
|
|
1389
|
+
throw error;
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1325
1392
|
function createGet(listName,
|
|
1326
1393
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- ListConfig must accept any TypeInfo
|
|
1327
|
-
listConfig, read, context, createFn) {
|
|
1394
|
+
listConfig, read, context, createFn, lock) {
|
|
1328
1395
|
return async (args) => {
|
|
1329
1396
|
warnIfSelectIgnored(args, listName, 'get');
|
|
1330
1397
|
assertBooleanInclude(args?.include, listName);
|
|
@@ -1332,7 +1399,7 @@ listConfig, read, context, createFn) {
|
|
|
1332
1399
|
const item = await scoped.first();
|
|
1333
1400
|
if (item)
|
|
1334
1401
|
return item;
|
|
1335
|
-
if (!
|
|
1402
|
+
if (!autoCreates(listConfig))
|
|
1336
1403
|
return null;
|
|
1337
1404
|
// `first()` conflates denied with absent, and auto-create must fire only on
|
|
1338
1405
|
// absent — a denied session that provoked a create would both write a row it
|
|
@@ -1349,6 +1416,11 @@ listConfig, read, context, createFn) {
|
|
|
1349
1416
|
if (readable !== true)
|
|
1350
1417
|
return null;
|
|
1351
1418
|
}
|
|
1419
|
+
if (lock !== undefined && (await tookSingletonLock(lock, listName))) {
|
|
1420
|
+
const settled = await scoped.first();
|
|
1421
|
+
if (settled)
|
|
1422
|
+
return settled;
|
|
1423
|
+
}
|
|
1352
1424
|
try {
|
|
1353
1425
|
await createFn({ data: {} });
|
|
1354
1426
|
}
|