@contember/binding 1.1.0-alpha.6 → 1.1.0-alpha.9

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.
Files changed (155) hide show
  1. package/dist/development/accessorTree/AccessorTreeStateContext.js +1 -3
  2. package/dist/development/accessorTree/AccessorTreeStateContext.js.map +1 -1
  3. package/dist/development/accessorTree/NormalizedPersistedData.js.map +1 -1
  4. package/dist/development/accessorTree/accessorTreeStateReducer.js +7 -1
  5. package/dist/development/accessorTree/accessorTreeStateReducer.js.map +1 -1
  6. package/dist/development/accessorTree/useAccessorTreeState.js +8 -1
  7. package/dist/development/accessorTree/useAccessorTreeState.js.map +1 -1
  8. package/dist/development/accessorTree/useDataBinding.js +18 -16
  9. package/dist/development/accessorTree/useDataBinding.js.map +1 -1
  10. package/dist/development/core/AccessorErrorManager.js +2 -2
  11. package/dist/development/core/AccessorErrorManager.js.map +1 -1
  12. package/dist/development/core/DataBinding.js +14 -13
  13. package/dist/development/core/DataBinding.js.map +1 -1
  14. package/dist/development/core/ErrorsPreprocessor.js +9 -13
  15. package/dist/development/core/ErrorsPreprocessor.js.map +1 -1
  16. package/dist/development/core/MutationGenerator.js +79 -43
  17. package/dist/development/core/MutationGenerator.js.map +1 -1
  18. package/dist/development/core/RequestResponseNormalizer.js +93 -130
  19. package/dist/development/core/RequestResponseNormalizer.js.map +1 -1
  20. package/dist/development/core/StateInitializer.js +5 -1
  21. package/dist/development/core/StateInitializer.js.map +1 -1
  22. package/dist/development/core/TreeAugmenter.js +4 -4
  23. package/dist/development/core/TreeAugmenter.js.map +1 -1
  24. package/dist/development/core/TreeStore.js +4 -4
  25. package/dist/development/core/TreeStore.js.map +1 -1
  26. package/dist/development/core/VariableInputTransformer.js.map +1 -1
  27. package/dist/development/core/requestAliases/MutationAlias.js +2 -40
  28. package/dist/development/core/requestAliases/MutationAlias.js.map +1 -1
  29. package/dist/development/helperComponents/helpers/evaluateCondition.js.map +1 -1
  30. package/dist/production/accessorTree/AccessorTreeStateContext.js +1 -3
  31. package/dist/production/accessorTree/AccessorTreeStateContext.js.map +1 -1
  32. package/dist/production/accessorTree/NormalizedPersistedData.js.map +1 -1
  33. package/dist/production/accessorTree/accessorTreeStateReducer.js +7 -1
  34. package/dist/production/accessorTree/accessorTreeStateReducer.js.map +1 -1
  35. package/dist/production/accessorTree/useAccessorTreeState.js +8 -1
  36. package/dist/production/accessorTree/useAccessorTreeState.js.map +1 -1
  37. package/dist/production/accessorTree/useDataBinding.js +18 -16
  38. package/dist/production/accessorTree/useDataBinding.js.map +1 -1
  39. package/dist/production/core/AccessorErrorManager.js +2 -2
  40. package/dist/production/core/AccessorErrorManager.js.map +1 -1
  41. package/dist/production/core/DataBinding.js +14 -13
  42. package/dist/production/core/DataBinding.js.map +1 -1
  43. package/dist/production/core/ErrorsPreprocessor.js +9 -13
  44. package/dist/production/core/ErrorsPreprocessor.js.map +1 -1
  45. package/dist/production/core/MutationGenerator.js +79 -43
  46. package/dist/production/core/MutationGenerator.js.map +1 -1
  47. package/dist/production/core/RequestResponseNormalizer.js +93 -130
  48. package/dist/production/core/RequestResponseNormalizer.js.map +1 -1
  49. package/dist/production/core/StateInitializer.js +5 -1
  50. package/dist/production/core/StateInitializer.js.map +1 -1
  51. package/dist/production/core/TreeAugmenter.js +4 -4
  52. package/dist/production/core/TreeAugmenter.js.map +1 -1
  53. package/dist/production/core/TreeStore.js +4 -4
  54. package/dist/production/core/TreeStore.js.map +1 -1
  55. package/dist/production/core/VariableInputTransformer.js.map +1 -1
  56. package/dist/production/core/requestAliases/MutationAlias.js +2 -33
  57. package/dist/production/core/requestAliases/MutationAlias.js.map +1 -1
  58. package/dist/production/helperComponents/helpers/evaluateCondition.js.map +1 -1
  59. package/dist/types/accessorTree/AccessorTreeState.d.ts +4 -0
  60. package/dist/types/accessorTree/AccessorTreeState.d.ts.map +1 -1
  61. package/dist/types/accessorTree/AccessorTreeStateAction.d.ts +4 -0
  62. package/dist/types/accessorTree/AccessorTreeStateAction.d.ts.map +1 -1
  63. package/dist/types/accessorTree/AccessorTreeStateContext.d.ts +1 -1
  64. package/dist/types/accessorTree/AccessorTreeStateContext.d.ts.map +1 -1
  65. package/dist/types/accessorTree/NormalizedPersistedData.d.ts +2 -2
  66. package/dist/types/accessorTree/NormalizedPersistedData.d.ts.map +1 -1
  67. package/dist/types/accessorTree/QueryRequestResponse.d.ts +2 -2
  68. package/dist/types/accessorTree/QueryRequestResponse.d.ts.map +1 -1
  69. package/dist/types/accessorTree/accessorTreeStateReducer.d.ts.map +1 -1
  70. package/dist/types/accessorTree/useAccessorTreeState.d.ts.map +1 -1
  71. package/dist/types/accessorTree/useDataBinding.d.ts.map +1 -1
  72. package/dist/types/core/AccessorErrorManager.d.ts +2 -1
  73. package/dist/types/core/AccessorErrorManager.d.ts.map +1 -1
  74. package/dist/types/core/DataBinding.d.ts +1 -1
  75. package/dist/types/core/DataBinding.d.ts.map +1 -1
  76. package/dist/types/core/ErrorsPreprocessor.d.ts +3 -1
  77. package/dist/types/core/ErrorsPreprocessor.d.ts.map +1 -1
  78. package/dist/types/core/MutationGenerator.d.ts +25 -1
  79. package/dist/types/core/MutationGenerator.d.ts.map +1 -1
  80. package/dist/types/core/RequestResponseNormalizer.d.ts +6 -7
  81. package/dist/types/core/RequestResponseNormalizer.d.ts.map +1 -1
  82. package/dist/types/core/StateInitializer.d.ts.map +1 -1
  83. package/dist/types/core/TreeAugmenter.d.ts +3 -2
  84. package/dist/types/core/TreeAugmenter.d.ts.map +1 -1
  85. package/dist/types/core/TreeStore.d.ts +3 -2
  86. package/dist/types/core/TreeStore.d.ts.map +1 -1
  87. package/dist/types/core/VariableInputTransformer.d.ts +2 -2
  88. package/dist/types/core/VariableInputTransformer.d.ts.map +1 -1
  89. package/dist/types/core/requestAliases/MutationAlias.d.ts +0 -3
  90. package/dist/types/core/requestAliases/MutationAlias.d.ts.map +1 -1
  91. package/dist/types/core/requestAliases/index.d.ts +0 -3
  92. package/dist/types/core/requestAliases/index.d.ts.map +1 -1
  93. package/dist/types/core/state/FieldState.d.ts +2 -2
  94. package/dist/types/core/state/FieldState.d.ts.map +1 -1
  95. package/dist/types/coreComponents/Field.d.ts +1 -1
  96. package/dist/types/coreComponents/Field.d.ts.map +1 -1
  97. package/dist/types/entityEvents/useDerivedField.d.ts +2 -2
  98. package/dist/types/entityEvents/useDerivedField.d.ts.map +1 -1
  99. package/dist/types/helperComponents/FieldView.d.ts +7 -7
  100. package/dist/types/helperComponents/FieldView.d.ts.map +1 -1
  101. package/dist/types/helperComponents/SugaredField.d.ts +1 -1
  102. package/dist/types/helperComponents/SugaredField.d.ts.map +1 -1
  103. package/dist/types/helperComponents/helpers/evaluateCondition.d.ts +2 -2
  104. package/dist/types/helperComponents/helpers/evaluateCondition.d.ts.map +1 -1
  105. package/dist/types/markers/FieldMarker.d.ts +3 -3
  106. package/dist/types/markers/FieldMarker.d.ts.map +1 -1
  107. package/dist/types/treeParameters/primitives/FieldValue.d.ts +2 -2
  108. package/dist/types/treeParameters/primitives/FieldValue.d.ts.map +1 -1
  109. package/dist/types/treeParameters/primitives/Json.d.ts +7 -0
  110. package/dist/types/treeParameters/primitives/Json.d.ts.map +1 -0
  111. package/dist/types/treeParameters/primitives/index.d.ts +1 -0
  112. package/dist/types/treeParameters/primitives/index.d.ts.map +1 -1
  113. package/dist/types/tsconfig.tsbuildinfo +1 -1
  114. package/package.json +5 -5
  115. package/src/accessorTree/AccessorTreeState.ts +4 -0
  116. package/src/accessorTree/AccessorTreeStateAction.ts +4 -0
  117. package/src/accessorTree/AccessorTreeStateContext.ts +1 -3
  118. package/src/accessorTree/NormalizedPersistedData.ts +2 -2
  119. package/src/accessorTree/QueryRequestResponse.ts +2 -2
  120. package/src/accessorTree/accessorTreeStateReducer.ts +7 -1
  121. package/src/accessorTree/useAccessorTreeState.ts +8 -1
  122. package/src/accessorTree/useDataBinding.ts +15 -15
  123. package/src/core/AccessorErrorManager.ts +3 -2
  124. package/src/core/DataBinding.ts +17 -15
  125. package/src/core/ErrorsPreprocessor.ts +14 -16
  126. package/src/core/MutationGenerator.ts +112 -56
  127. package/src/core/RequestResponseNormalizer.ts +110 -161
  128. package/src/core/StateInitializer.ts +10 -6
  129. package/src/core/TreeAugmenter.ts +5 -4
  130. package/src/core/TreeStore.ts +5 -4
  131. package/src/core/VariableInputTransformer.ts +2 -2
  132. package/src/core/requestAliases/MutationAlias.ts +2 -57
  133. package/src/core/requestAliases/index.ts +0 -3
  134. package/src/core/state/FieldState.ts +2 -2
  135. package/src/helperComponents/helpers/evaluateCondition.ts +2 -2
  136. package/src/treeParameters/primitives/FieldValue.ts +2 -2
  137. package/src/treeParameters/primitives/Json.ts +7 -0
  138. package/src/treeParameters/primitives/index.ts +1 -0
  139. package/dist/development/core/requestAliases/mutationOperationSubTreeType.js +0 -6
  140. package/dist/development/core/requestAliases/mutationOperationSubTreeType.js.map +0 -1
  141. package/dist/development/core/requestAliases/mutationOperationType.js +0 -7
  142. package/dist/development/core/requestAliases/mutationOperationType.js.map +0 -1
  143. package/dist/production/core/requestAliases/mutationOperationSubTreeType.js +0 -6
  144. package/dist/production/core/requestAliases/mutationOperationSubTreeType.js.map +0 -1
  145. package/dist/production/core/requestAliases/mutationOperationType.js +0 -7
  146. package/dist/production/core/requestAliases/mutationOperationType.js.map +0 -1
  147. package/dist/types/core/requestAliases/TopLevelMutationOperation.d.ts +0 -11
  148. package/dist/types/core/requestAliases/TopLevelMutationOperation.d.ts.map +0 -1
  149. package/dist/types/core/requestAliases/mutationOperationSubTreeType.d.ts +0 -5
  150. package/dist/types/core/requestAliases/mutationOperationSubTreeType.d.ts.map +0 -1
  151. package/dist/types/core/requestAliases/mutationOperationType.d.ts +0 -6
  152. package/dist/types/core/requestAliases/mutationOperationType.d.ts.map +0 -1
  153. package/src/core/requestAliases/TopLevelMutationOperation.ts +0 -11
  154. package/src/core/requestAliases/mutationOperationSubTreeType.ts +0 -4
  155. package/src/core/requestAliases/mutationOperationType.ts +0 -5
@@ -10,13 +10,15 @@ import {
10
10
  } from '../markers'
11
11
  import { BijectiveIndexedMap } from '../structures'
12
12
  import type {
13
- EntityEventListenerStore, EntityId,
13
+ EntityEventListenerStore,
14
+ EntityId,
14
15
  EntityListEventListenerStore,
15
16
  EntityName,
16
17
  FieldEventListenerStore,
17
18
  FieldName,
18
- Scalar,
19
+ FieldValue,
19
20
  } from '../treeParameters'
21
+ import { EventListenersStore } from '../treeParameters'
20
22
  import { assertNever } from '../utils'
21
23
  import type { AccessorErrorManager } from './AccessorErrorManager'
22
24
  import type { EventManager } from './EventManager'
@@ -35,7 +37,6 @@ import {
35
37
  } from './state'
36
38
  import { TreeParameterMerger } from './TreeParameterMerger'
37
39
  import type { TreeStore } from './TreeStore'
38
- import { EventListenersStore } from '../treeParameters'
39
40
 
40
41
  export class StateInitializer {
41
42
  private readonly fieldOperations: FieldOperations
@@ -127,8 +128,11 @@ export class StateInitializer {
127
128
  }
128
129
  this.initializeFromFieldMarker(realm, field, undefined, value)
129
130
  } else if (field instanceof HasManyRelationMarker) {
130
- // todo: get from copyFrom
131
- this.initializeFromHasManyRelationMarker(realm, field, new Set())
131
+ const value = copyFrom.children.get(placeholderName)
132
+ if (!value || value.type !== 'entityList') {
133
+ throw new BindingError()
134
+ }
135
+ this.initializeFromHasManyRelationMarker(realm, field, new Set(value.children.keys()))
132
136
  } else if (field instanceof HasOneRelationMarker) {
133
137
  let runtimeId: RuntimeId
134
138
  let subCopyFrom: EntityRealmState | undefined = undefined
@@ -349,7 +353,7 @@ export class StateInitializer {
349
353
  parent: EntityRealmState,
350
354
  placeholderName: FieldName,
351
355
  fieldMarker: FieldMarker,
352
- persistedValue: Scalar | undefined,
356
+ persistedValue: FieldValue | undefined,
353
357
  copyFromState: FieldState | undefined,
354
358
  ): FieldState {
355
359
  const resolvedFieldValue = copyFromState ? copyFromState.value : (persistedValue ?? fieldMarker.defaultValue ?? null)
@@ -15,6 +15,7 @@ import { OperationsHelpers } from './operations/OperationsHelpers'
15
15
  import type { EntityListState, EntityRealmState, EntityRealmStateStub, RootStateNode } from './state'
16
16
  import type { StateInitializer } from './StateInitializer'
17
17
  import type { TreeStore } from './TreeStore'
18
+ import { SubMutationOperation } from './MutationGenerator'
18
19
 
19
20
  export class TreeAugmenter {
20
21
  public constructor(
@@ -23,9 +24,9 @@ export class TreeAugmenter {
23
24
  private readonly treeStore: TreeStore,
24
25
  ) {}
25
26
 
26
- public extendPersistedData(newPersistedData: ReceivedDataTree) {
27
+ public extendPersistedData(newPersistedData: ReceivedDataTree, markerTree: MarkerTreeRoot) {
27
28
  // TODO this doesn't yet handle updates for entities whose persisted data just gets magically changed without notice.
28
- this.treeStore.mergeInQueryResponse(newPersistedData)
29
+ this.treeStore.mergeInQueryResponse(newPersistedData, markerTree)
29
30
  }
30
31
 
31
32
  public extendTreeStates(newTreeId: TreeRootId | undefined, newMarkerTree: MarkerTreeRoot): void {
@@ -40,8 +41,8 @@ export class TreeAugmenter {
40
41
  }
41
42
  }
42
43
 
43
- public updatePersistedData(response: ReceivedDataTree) {
44
- this.treeStore.mergeInMutationResponse(response)
44
+ public updatePersistedData(response: ReceivedDataTree, operations: SubMutationOperation[]) {
45
+ this.treeStore.mergeInMutationResponse(response, operations)
45
46
 
46
47
  this.eventManager.syncTransaction(() => {
47
48
  for (const rootStates of this.treeStore.subTreeStatesByRoot.values()) {
@@ -27,6 +27,7 @@ import { MarkerComparator } from './MarkerComparator'
27
27
  import { RequestResponseNormalizer } from './RequestResponseNormalizer'
28
28
  import type { Schema } from './schema'
29
29
  import type { EntityListState, EntityRealmState, EntityRealmStateStub, EntityState, RootStateNode } from './state'
30
+ import { SubMutationOperation } from './MutationGenerator'
30
31
 
31
32
  const emptyEntityIdSet: ReadonlySet<EntityId> = new Set()
32
33
 
@@ -44,12 +45,12 @@ export class TreeStore {
44
45
 
45
46
  public constructor() {}
46
47
 
47
- public mergeInQueryResponse(response: ReceivedDataTree): void {
48
- RequestResponseNormalizer.mergeInQueryResponse(this.persistedData, response)
48
+ public mergeInQueryResponse(response: ReceivedDataTree, markerTree: MarkerTreeRoot): void {
49
+ RequestResponseNormalizer.mergeInQueryResponse(this.persistedData, response, markerTree)
49
50
  }
50
51
 
51
- public mergeInMutationResponse(response: ReceivedDataTree): void {
52
- RequestResponseNormalizer.mergeInMutationResponse(this.persistedData, response)
52
+ public mergeInMutationResponse(response: ReceivedDataTree, operations: SubMutationOperation[]): void {
53
+ RequestResponseNormalizer.mergeInMutationResponse(this.persistedData, response, operations)
53
54
  }
54
55
 
55
56
  public setSchema(newSchema: Schema): void {
@@ -1,6 +1,6 @@
1
1
  import { BindingError } from '../BindingError'
2
2
  import { Environment, VariableFieldValue } from '../dao'
3
- import type { FieldValue, OptionallyVariableFieldValue, Scalar } from '../treeParameters'
3
+ import type { FieldValue, OptionallyVariableFieldValue } from '../treeParameters'
4
4
 
5
5
  export class VariableInputTransformer {
6
6
  public static transformValue(value: OptionallyVariableFieldValue, environment: Environment): FieldValue {
@@ -10,7 +10,7 @@ export class VariableInputTransformer {
10
10
  return value
11
11
  }
12
12
 
13
- public static transformVariableFieldValue(variableFieldValue: VariableFieldValue, environment: Environment): Scalar {
13
+ public static transformVariableFieldValue(variableFieldValue: VariableFieldValue, environment: Environment): FieldValue {
14
14
  const value = environment.getVariableOrElse(variableFieldValue.variableName, undefined)
15
15
  ?? environment.getParameterOrElse(variableFieldValue.variableName, undefined)
16
16
 
@@ -1,67 +1,12 @@
1
1
  import type { RuntimeId } from '../../accessorTree'
2
- import { BindingError } from '../../BindingError'
3
- import type { PlaceholderName, TreeRootId } from '../../treeParameters'
4
- import { mutationOperationSubTreeType } from './mutationOperationSubTreeType'
5
- import type { mutationOperationType } from './mutationOperationType'
6
- import type { TopLevelMutationOperation } from './TopLevelMutationOperation'
7
-
8
- const mutationAliasRegex = /^(?:(u)|(t)([^t]+)t)(.+)__([cud])([sl])(.+)$/
9
-
10
- const uuidToAliasRegex = /-/g
11
- const uuidToAliasReplacement = '_'
12
-
13
- const aliasToUuidRegex = /_/g
14
- const aliasToUuidReplacement = '-'
15
-
16
- // This is just a random character we use to make sure the alias doesn't start with a number as UUIDs often do.
17
- const standaloneUuidPrefix = uuidToAliasReplacement
18
2
 
19
3
  export class MutationAlias {
20
- public static encodeTopLevel(operation: TopLevelMutationOperation): string {
21
- const treeRootId = operation.treeRootId === undefined ? 'u' : `t${operation.treeRootId.replace('-', '_')}t`
22
- const entityId = String(operation.entityId).replace(uuidToAliasRegex, uuidToAliasReplacement)
23
-
24
- const alias = `${treeRootId}${operation.subTreePlaceholder}__${operation.type}${operation.subTreeType}${entityId}`
25
-
26
- if (import.meta.env.DEV) {
27
- const matches = alias.match(mutationAliasRegex)
28
-
29
- if (!matches) {
30
- throw new BindingError()
31
- }
32
- }
33
-
34
- return alias
35
- }
36
-
37
- public static decodeTopLevel(alias: string): TopLevelMutationOperation | undefined {
38
- const matches = alias.match(mutationAliasRegex)
39
-
40
- if (!matches) {
41
- return undefined
42
- }
43
- const treeRootId: TreeRootId | undefined = matches[1] === 'u' ? undefined : matches[3]
44
- const subTreePlaceholder: PlaceholderName = matches[4]
45
- const type = matches[5] as typeof mutationOperationType[keyof typeof mutationOperationType]
46
- const subTreeType =
47
- matches[6] === 's' ? mutationOperationSubTreeType.singleEntity : mutationOperationSubTreeType.entityList
48
- const entityId = matches[7].replace(aliasToUuidRegex, aliasToUuidReplacement)
49
-
50
- return {
51
- treeRootId,
52
- subTreePlaceholder,
53
- type,
54
- subTreeType,
55
- entityId,
56
- }
57
- }
58
-
59
4
  public static encodeEntityId(entityId: RuntimeId): string {
60
- return `${standaloneUuidPrefix}${String(entityId.value).replace(uuidToAliasRegex, uuidToAliasReplacement)}`
5
+ return `_${String(entityId.value).replace(/-/g, '_')}`
61
6
  }
62
7
 
63
8
  public static decodeEntityId(alias: string): RuntimeId['value'] {
64
- const stringId = `${alias.substring(standaloneUuidPrefix.length).replace(aliasToUuidRegex, aliasToUuidReplacement)}`
9
+ const stringId = `${alias.substring(1).replace(/_/g, '-')}`
65
10
  const intId = parseInt(stringId)
66
11
  return intId.toString() === stringId ? intId : stringId
67
12
  }
@@ -1,4 +1 @@
1
1
  export * from './MutationAlias'
2
- export * from './mutationOperationSubTreeType'
3
- export * from './mutationOperationType'
4
- export * from './TopLevelMutationOperation'
@@ -1,6 +1,6 @@
1
1
  import type { ErrorAccessor, FieldAccessor } from '../../accessors'
2
2
  import type { FieldMarker } from '../../markers'
3
- import type { FieldEventListenerStore, FieldName, FieldValue, Scalar } from '../../treeParameters'
3
+ import type { FieldEventListenerStore, FieldName, FieldValue } from '../../treeParameters'
4
4
  import type { EntityRealmState } from './EntityRealmState'
5
5
 
6
6
  export interface FieldState<Value extends FieldValue = FieldValue> {
@@ -13,7 +13,7 @@ export interface FieldState<Value extends FieldValue = FieldValue> {
13
13
  readonly getAccessor: () => FieldAccessor
14
14
  hasUnpersistedChanges: boolean
15
15
  parent: EntityRealmState
16
- persistedValue: Scalar | undefined // Undefined means that the parent entity doesn't exist on server
16
+ persistedValue: Value | undefined // Undefined means that the parent entity doesn't exist on server
17
17
  placeholderName: FieldName
18
18
  touchLog: Set<string> | undefined
19
19
  value: Value | null
@@ -1,5 +1,5 @@
1
1
  import { GraphQlLiteral, Input } from '@contember/client'
2
- import { Scalar } from '../../treeParameters'
2
+ import { FieldValue } from '../../treeParameters'
3
3
  import { BindingError } from '../../BindingError'
4
4
 
5
5
  const unwrapGraphqlLiteral = (value: Input.ColumnValue<GraphQlLiteral>): any => {
@@ -9,7 +9,7 @@ const unwrapGraphqlLiteral = (value: Input.ColumnValue<GraphQlLiteral>): any =>
9
9
  return value
10
10
  }
11
11
 
12
- export const evaluateCondition = (value: Scalar | null, condition: Input.Condition<Input.ColumnValue<GraphQlLiteral>>) => {
12
+ export const evaluateCondition = (value: FieldValue | null, condition: Input.Condition<Input.ColumnValue<GraphQlLiteral>>) => {
13
13
  const handlers: {
14
14
  [K in keyof Required<Input.Condition<any>>]: (
15
15
  param: Exclude<Input.Condition<any>[K], undefined>,
@@ -1,6 +1,6 @@
1
1
  import type { VariableFieldValue } from '../../dao'
2
- import type { Scalar } from './Scalar'
2
+ import { JsonValue } from './Json'
3
3
 
4
- export type FieldValue = Scalar
4
+ export type FieldValue = JsonValue
5
5
 
6
6
  export type OptionallyVariableFieldValue = FieldValue | VariableFieldValue
@@ -0,0 +1,7 @@
1
+ export interface JsonObject<Ext = never> {
2
+ [key: string]: JsonValue<Ext>
3
+ }
4
+
5
+ export interface JsonArray<Ext = never> extends Array<JsonValue<Ext>> {}
6
+
7
+ export type JsonValue<Ext = never> = string | number | boolean | null | JsonObject<Ext> | JsonArray<Ext> | Ext
@@ -8,6 +8,7 @@ export * from './ExpectedRelationMutation'
8
8
  export * from './FieldName'
9
9
  export * from './FieldValue'
10
10
  export * from './Filter'
11
+ export * from './Json'
11
12
  export * from './Limit'
12
13
  export * from './Offset'
13
14
  export * from './OrderBy'
@@ -1,6 +0,0 @@
1
- const mutationOperationSubTreeType = {
2
- singleEntity: "s",
3
- entityList: "l"
4
- };
5
- export { mutationOperationSubTreeType };
6
- //# sourceMappingURL=mutationOperationSubTreeType.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mutationOperationSubTreeType.js","sources":["../../../../src/core/requestAliases/mutationOperationSubTreeType.ts"],"sourcesContent":["export const mutationOperationSubTreeType = {\n\tsingleEntity: 's',\n\tentityList: 'l',\n} as const\n"],"names":[],"mappings":"AAAO,MAAM,+BAA+B;AAAA,EAC3C,cAAc;AAAA,EACd,YAAY;AACb;;"}
@@ -1,7 +0,0 @@
1
- const mutationOperationType = {
2
- create: "c",
3
- update: "u",
4
- delete: "d"
5
- };
6
- export { mutationOperationType };
7
- //# sourceMappingURL=mutationOperationType.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mutationOperationType.js","sources":["../../../../src/core/requestAliases/mutationOperationType.ts"],"sourcesContent":["export const mutationOperationType = {\n\tcreate: 'c',\n\tupdate: 'u',\n\tdelete: 'd',\n} as const\n"],"names":[],"mappings":"AAAO,MAAM,wBAAwB;AAAA,EACpC,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AACT;;"}
@@ -1,6 +0,0 @@
1
- const mutationOperationSubTreeType = {
2
- singleEntity: "s",
3
- entityList: "l"
4
- };
5
- export { mutationOperationSubTreeType };
6
- //# sourceMappingURL=mutationOperationSubTreeType.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mutationOperationSubTreeType.js","sources":["../../../../src/core/requestAliases/mutationOperationSubTreeType.ts"],"sourcesContent":["export const mutationOperationSubTreeType = {\n\tsingleEntity: 's',\n\tentityList: 'l',\n} as const\n"],"names":[],"mappings":"AAAO,MAAM,+BAA+B;AAAA,EAC3C,cAAc;AAAA,EACd,YAAY;AACb;;"}
@@ -1,7 +0,0 @@
1
- const mutationOperationType = {
2
- create: "c",
3
- update: "u",
4
- delete: "d"
5
- };
6
- export { mutationOperationType };
7
- //# sourceMappingURL=mutationOperationType.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mutationOperationType.js","sources":["../../../../src/core/requestAliases/mutationOperationType.ts"],"sourcesContent":["export const mutationOperationType = {\n\tcreate: 'c',\n\tupdate: 'u',\n\tdelete: 'd',\n} as const\n"],"names":[],"mappings":"AAAO,MAAM,wBAAwB;AAAA,EACpC,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AACT;;"}
@@ -1,11 +0,0 @@
1
- import type { EntityId, PlaceholderName, TreeRootId } from '../../treeParameters';
2
- import type { mutationOperationSubTreeType } from './mutationOperationSubTreeType';
3
- import type { mutationOperationType } from './mutationOperationType';
4
- export interface TopLevelMutationOperation {
5
- treeRootId: TreeRootId | undefined;
6
- subTreePlaceholder: PlaceholderName;
7
- type: typeof mutationOperationType[keyof typeof mutationOperationType];
8
- subTreeType: typeof mutationOperationSubTreeType[keyof typeof mutationOperationSubTreeType];
9
- entityId: EntityId;
10
- }
11
- //# sourceMappingURL=TopLevelMutationOperation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TopLevelMutationOperation.d.ts","sourceRoot":"","sources":["../../../../src/core/requestAliases/TopLevelMutationOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAClF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAEpE,MAAM,WAAW,yBAAyB;IACzC,UAAU,EAAE,UAAU,GAAG,SAAS,CAAA;IAClC,kBAAkB,EAAE,eAAe,CAAA;IACnC,IAAI,EAAE,OAAO,qBAAqB,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAA;IACtE,WAAW,EAAE,OAAO,4BAA4B,CAAC,MAAM,OAAO,4BAA4B,CAAC,CAAA;IAC3F,QAAQ,EAAE,QAAQ,CAAA;CAClB"}
@@ -1,5 +0,0 @@
1
- export declare const mutationOperationSubTreeType: {
2
- readonly singleEntity: "s";
3
- readonly entityList: "l";
4
- };
5
- //# sourceMappingURL=mutationOperationSubTreeType.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mutationOperationSubTreeType.d.ts","sourceRoot":"","sources":["../../../../src/core/requestAliases/mutationOperationSubTreeType.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B;;;CAG/B,CAAA"}
@@ -1,6 +0,0 @@
1
- export declare const mutationOperationType: {
2
- readonly create: "c";
3
- readonly update: "u";
4
- readonly delete: "d";
5
- };
6
- //# sourceMappingURL=mutationOperationType.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mutationOperationType.d.ts","sourceRoot":"","sources":["../../../../src/core/requestAliases/mutationOperationType.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB;;;;CAIxB,CAAA"}
@@ -1,11 +0,0 @@
1
- import type { EntityId, PlaceholderName, TreeRootId } from '../../treeParameters'
2
- import type { mutationOperationSubTreeType } from './mutationOperationSubTreeType'
3
- import type { mutationOperationType } from './mutationOperationType'
4
-
5
- export interface TopLevelMutationOperation {
6
- treeRootId: TreeRootId | undefined
7
- subTreePlaceholder: PlaceholderName
8
- type: typeof mutationOperationType[keyof typeof mutationOperationType]
9
- subTreeType: typeof mutationOperationSubTreeType[keyof typeof mutationOperationSubTreeType]
10
- entityId: EntityId
11
- }
@@ -1,4 +0,0 @@
1
- export const mutationOperationSubTreeType = {
2
- singleEntity: 's',
3
- entityList: 'l',
4
- } as const
@@ -1,5 +0,0 @@
1
- export const mutationOperationType = {
2
- create: 'c',
3
- update: 'u',
4
- delete: 'd',
5
- } as const