teamplay 0.4.0 → 0.5.0-alpha.1
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/babel-loader.cjs +1 -0
- package/babel.cjs +1 -0
- package/dist/connect/index.d.ts +1 -0
- package/dist/connect/index.js +9 -0
- package/dist/connect/lib/sharedb-crosstab-pubsub.d.cts +10 -0
- package/dist/connect/offline/index.d.ts +1 -0
- package/dist/connect/offline/index.js +126 -0
- package/dist/connect/offline/react-native.d.ts +10 -0
- package/dist/connect/offline/react-native.js +25 -0
- package/dist/connect/offline/web.d.ts +9 -0
- package/dist/connect/offline/web.js +12 -0
- package/dist/connect/sharedbConnection.d.cts +2 -0
- package/dist/connect/test.d.ts +1 -0
- package/dist/connect/test.js +12 -0
- package/dist/index.d.ts +66 -0
- package/dist/index.js +74 -0
- package/dist/orm/$.d.ts +9 -0
- package/dist/orm/$.js +34 -0
- package/dist/orm/Aggregation.d.ts +17 -0
- package/dist/orm/Aggregation.js +115 -0
- package/dist/orm/Cache.d.ts +9 -0
- package/dist/orm/Cache.js +32 -0
- package/dist/orm/Compat/SignalCompat.d.ts +3 -0
- package/dist/orm/Compat/SignalCompat.js +1542 -0
- package/dist/orm/Compat/eventsCompat.d.ts +3 -0
- package/dist/orm/Compat/eventsCompat.js +73 -0
- package/dist/orm/Compat/hooksCompat.d.ts +33 -0
- package/dist/orm/Compat/hooksCompat.js +360 -0
- package/dist/orm/Compat/modelEvents.d.ts +6 -0
- package/dist/orm/Compat/modelEvents.js +228 -0
- package/dist/orm/Compat/queryReadiness.d.ts +5 -0
- package/dist/orm/Compat/queryReadiness.js +185 -0
- package/dist/orm/Compat/refFallback.d.ts +13 -0
- package/dist/orm/Compat/refFallback.js +65 -0
- package/dist/orm/Compat/refRegistry.d.ts +6 -0
- package/dist/orm/Compat/refRegistry.js +54 -0
- package/dist/orm/Compat/silentContext.d.ts +5 -0
- package/dist/orm/Compat/silentContext.js +48 -0
- package/dist/orm/Compat/startStopCompat.d.ts +3 -0
- package/dist/orm/Compat/startStopCompat.js +217 -0
- package/dist/orm/Doc.d.ts +96 -0
- package/dist/orm/Doc.js +966 -0
- package/dist/orm/Query.d.ts +117 -0
- package/dist/orm/Query.js +1111 -0
- package/dist/orm/Reaction.d.ts +10 -0
- package/dist/orm/Reaction.js +41 -0
- package/dist/orm/Root.d.ts +22 -0
- package/dist/orm/Root.js +85 -0
- package/dist/orm/Signal.d.ts +12 -0
- package/dist/orm/Signal.js +7 -0
- package/dist/orm/SignalBase.d.ts +168 -0
- package/dist/orm/SignalBase.js +625 -0
- package/dist/orm/SubscriptionState.d.ts +17 -0
- package/dist/orm/SubscriptionState.js +123 -0
- package/dist/orm/Value.d.ts +9 -0
- package/dist/orm/Value.js +25 -0
- package/dist/orm/addModel.d.ts +6 -0
- package/dist/orm/addModel.js +39 -0
- package/dist/orm/associations.d.ts +18 -0
- package/dist/orm/associations.js +70 -0
- package/dist/orm/batchScheduler.d.ts +7 -0
- package/dist/orm/batchScheduler.js +62 -0
- package/dist/orm/compatEnv.d.ts +1 -0
- package/dist/orm/compatEnv.js +4 -0
- package/dist/orm/connection.d.ts +26 -0
- package/dist/orm/connection.js +38 -0
- package/dist/orm/dataTree.d.ts +34 -0
- package/dist/orm/dataTree.js +880 -0
- package/dist/orm/disposeRootContext.d.ts +4 -0
- package/dist/orm/disposeRootContext.js +59 -0
- package/dist/orm/getSignal.d.ts +16 -0
- package/dist/orm/getSignal.js +133 -0
- package/dist/orm/idFields.d.ts +14 -0
- package/dist/orm/idFields.js +95 -0
- package/dist/orm/index.d.ts +7 -0
- package/dist/orm/index.js +6 -0
- package/dist/orm/initModels.d.ts +5 -0
- package/dist/orm/initModels.js +74 -0
- package/dist/orm/missingDoc.d.ts +1 -0
- package/dist/orm/missingDoc.js +3 -0
- package/dist/orm/pluralize.d.ts +12 -0
- package/dist/orm/privateData.d.ts +22 -0
- package/dist/orm/privateData.js +170 -0
- package/dist/orm/rootContext.d.ts +78 -0
- package/dist/orm/rootContext.js +297 -0
- package/dist/orm/rootScope.d.ts +12 -0
- package/dist/orm/rootScope.js +46 -0
- package/dist/orm/signalArrayReaders.d.ts +22 -0
- package/dist/orm/signalArrayReaders.js +42 -0
- package/dist/orm/signalMetadata.d.ts +17 -0
- package/dist/orm/signalMetadata.js +56 -0
- package/dist/orm/signalMutationGuards.d.ts +4 -0
- package/dist/orm/signalMutationGuards.js +14 -0
- package/dist/orm/signalPathKind.d.ts +2 -0
- package/dist/orm/signalPathKind.js +10 -0
- package/dist/orm/signalPathRules.d.ts +6 -0
- package/dist/orm/signalPathRules.js +28 -0
- package/dist/orm/signalReads.d.ts +26 -0
- package/dist/orm/signalReads.js +64 -0
- package/dist/orm/signalRuntimeAccess.d.ts +16 -0
- package/dist/orm/signalRuntimeAccess.js +24 -0
- package/dist/orm/signalRuntimeDescriptor.d.ts +19 -0
- package/dist/orm/signalRuntimeDescriptor.js +97 -0
- package/dist/orm/signalStorageMutations.d.ts +18 -0
- package/dist/orm/signalStorageMutations.js +26 -0
- package/dist/orm/signalSymbols.d.ts +5 -0
- package/dist/orm/signalSymbols.js +5 -0
- package/dist/orm/signalValueMutations.d.ts +14 -0
- package/dist/orm/signalValueMutations.js +36 -0
- package/dist/orm/sub.d.ts +37 -0
- package/dist/orm/sub.js +187 -0
- package/dist/orm/subscriptionGcDelay.d.ts +4 -0
- package/dist/orm/subscriptionGcDelay.js +26 -0
- package/dist/orm/types/baseMethods.d.ts +43 -0
- package/dist/orm/types/baseMethods.js +1 -0
- package/dist/orm/types/jsonSchema.d.ts +75 -0
- package/dist/orm/types/jsonSchema.js +1 -0
- package/dist/orm/types/modelManifest.d.ts +37 -0
- package/dist/orm/types/modelManifest.js +1 -0
- package/dist/orm/types/path.d.ts +8 -0
- package/dist/orm/types/path.js +1 -0
- package/dist/orm/types/query.d.ts +29 -0
- package/dist/orm/types/query.js +1 -0
- package/dist/orm/types/signal.d.ts +132 -0
- package/dist/orm/types/signal.js +1 -0
- package/dist/react/compatComponentRegistry.d.ts +4 -0
- package/dist/react/compatComponentRegistry.js +19 -0
- package/dist/react/convertToObserver.d.ts +26 -0
- package/dist/react/convertToObserver.js +114 -0
- package/dist/react/executionContextTracker.d.ts +11 -0
- package/dist/react/executionContextTracker.js +28 -0
- package/dist/react/helpers.d.ts +34 -0
- package/dist/react/helpers.js +134 -0
- package/dist/react/observer.d.ts +22 -0
- package/dist/react/observer.js +8 -0
- package/dist/react/promiseBatcher.d.ts +13 -0
- package/dist/react/promiseBatcher.js +118 -0
- package/dist/react/renderAttemptDestroyer.d.ts +19 -0
- package/dist/react/renderAttemptDestroyer.js +46 -0
- package/dist/react/trapRender.d.ts +6 -0
- package/dist/react/trapRender.js +48 -0
- package/dist/react/universal$.d.ts +1 -0
- package/dist/react/universal$.js +18 -0
- package/dist/react/universalSub.d.ts +1 -0
- package/dist/react/universalSub.js +22 -0
- package/dist/react/useApi.d.ts +13 -0
- package/dist/react/useApi.js +67 -0
- package/dist/react/useSub.d.ts +102 -0
- package/dist/react/useSub.js +189 -0
- package/dist/react/useSuspendMemo.d.ts +3 -0
- package/dist/react/useSuspendMemo.js +102 -0
- package/dist/react/wrapIntoSuspense.d.ts +9 -0
- package/dist/react/wrapIntoSuspense.js +102 -0
- package/dist/server.d.ts +11 -0
- package/dist/server.js +28 -0
- package/dist/utils/MockFinalizationRegistry.d.ts +37 -0
- package/dist/utils/MockFinalizationRegistry.js +85 -0
- package/dist/utils/MockWeakRef.d.ts +12 -0
- package/dist/utils/MockWeakRef.js +23 -0
- package/dist/utils/isServer.d.ts +3 -0
- package/dist/utils/isServer.js +18 -0
- package/dist/utils/setDiffDeep.d.ts +1 -0
- package/dist/utils/setDiffDeep.js +61 -0
- package/dist/utils/useIsomorphicLayoutEffect.d.ts +3 -0
- package/dist/utils/useIsomorphicLayoutEffect.js +3 -0
- package/file-based-models.js +3 -0
- package/file-based-models.node.js +6 -0
- package/package.json +77 -32
- package/teamplay.models.auto-init.virtual.js +1 -0
- package/teamplay.models.virtual.js +1 -0
- package/connect/index.js +0 -9
- package/connect/offline/index.js +0 -124
- package/connect/offline/react-native.js +0 -28
- package/connect/offline/web.js +0 -15
- package/connect/test.js +0 -12
- package/index.d.ts +0 -106
- package/index.js +0 -125
- package/orm/$.js +0 -38
- package/orm/Aggregation.js +0 -117
- package/orm/Cache.js +0 -46
- package/orm/Compat/README.md +0 -1064
- package/orm/Compat/SignalCompat.js +0 -1479
- package/orm/Compat/eventsCompat.js +0 -79
- package/orm/Compat/hooksCompat.js +0 -374
- package/orm/Compat/modelEvents.js +0 -225
- package/orm/Compat/queryReadiness.js +0 -191
- package/orm/Compat/refFallback.js +0 -62
- package/orm/Compat/refRegistry.js +0 -61
- package/orm/Compat/silentContext.js +0 -51
- package/orm/Compat/startStopCompat.js +0 -207
- package/orm/Doc.js +0 -969
- package/orm/Query.js +0 -1127
- package/orm/Reaction.js +0 -48
- package/orm/Root.js +0 -88
- package/orm/Signal.js +0 -22
- package/orm/SignalBase.js +0 -696
- package/orm/SubscriptionState.js +0 -138
- package/orm/Value.js +0 -30
- package/orm/addModel.js +0 -31
- package/orm/associations.js +0 -97
- package/orm/batchScheduler.js +0 -62
- package/orm/compatEnv.js +0 -4
- package/orm/connection.js +0 -46
- package/orm/dataTree.js +0 -869
- package/orm/disposeRootContext.js +0 -68
- package/orm/getSignal.js +0 -130
- package/orm/idFields.js +0 -88
- package/orm/index.d.ts +0 -6
- package/orm/index.js +0 -5
- package/orm/missingDoc.js +0 -3
- package/orm/privateData.js +0 -181
- package/orm/rootContext.js +0 -313
- package/orm/rootScope.js +0 -51
- package/orm/sub.js +0 -151
- package/orm/subscriptionGcDelay.js +0 -32
- package/react/compatComponentRegistry.js +0 -20
- package/react/convertToObserver.js +0 -117
- package/react/executionContextTracker.js +0 -32
- package/react/helpers.js +0 -141
- package/react/observer.js +0 -9
- package/react/promiseBatcher.js +0 -115
- package/react/renderAttemptDestroyer.js +0 -47
- package/react/trapRender.js +0 -50
- package/react/universal$.js +0 -18
- package/react/universalSub.js +0 -21
- package/react/useApi.js +0 -63
- package/react/useSub.js +0 -169
- package/react/useSuspendMemo.js +0 -96
- package/react/wrapIntoSuspense.js +0 -119
- package/server.js +0 -31
- package/utils/MockFinalizationRegistry.js +0 -94
- package/utils/MockWeakRef.js +0 -25
- package/utils/isServer.js +0 -17
- package/utils/setDiffDeep.js +0 -58
- package/utils/useIsomorphicLayoutEffect.js +0 -4
- /package/{connect → dist/connect}/lib/sharedb-crosstab-pubsub.cjs +0 -0
- /package/{connect → dist/connect}/sharedbConnection.cjs +0 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type Signal from './Signal.js'
|
|
2
|
+
import type {
|
|
3
|
+
PendingDestroyEntry,
|
|
4
|
+
ReadonlyMapView,
|
|
5
|
+
SubscriptionIntent,
|
|
6
|
+
TransportMode,
|
|
7
|
+
TransportPhase
|
|
8
|
+
} from './Doc.js'
|
|
9
|
+
|
|
10
|
+
export const COLLECTION_NAME: unique symbol
|
|
11
|
+
export const PARAMS: unique symbol
|
|
12
|
+
export const HASH: unique symbol
|
|
13
|
+
export const IS_QUERY: unique symbol
|
|
14
|
+
export const QUERIES: '$queries'
|
|
15
|
+
|
|
16
|
+
export interface QueryHashParts {
|
|
17
|
+
collectionName?: string
|
|
18
|
+
params?: unknown
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface QuerySignalOptions {
|
|
22
|
+
root?: Signal
|
|
23
|
+
rootId?: string
|
|
24
|
+
[option: string]: unknown
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface QueryOwnerMeta {
|
|
28
|
+
collectionName: string
|
|
29
|
+
params: unknown
|
|
30
|
+
transportHash: string
|
|
31
|
+
rootId?: string
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface QueryOwnerRecord extends QueryOwnerMeta {
|
|
35
|
+
ownerKey: string
|
|
36
|
+
fetchCount: number
|
|
37
|
+
subscribeCount: number
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface QueryRuntimeEntry {
|
|
41
|
+
transportHash: string
|
|
42
|
+
mode: TransportMode
|
|
43
|
+
targetMode: TransportMode
|
|
44
|
+
phase: TransportPhase
|
|
45
|
+
runtime: Query | null
|
|
46
|
+
owners: Set<string>
|
|
47
|
+
pendingDestroyByOwner: Map<string, PendingQueryDestroyEntry>
|
|
48
|
+
reconcilePromise: Promise<void> | null
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface PendingQueryDestroyEntry extends PendingDestroyEntry {
|
|
52
|
+
collectionName?: string
|
|
53
|
+
params?: unknown
|
|
54
|
+
transportHash?: string
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export class Query {
|
|
58
|
+
initialized?: boolean
|
|
59
|
+
collectionName: string
|
|
60
|
+
params: unknown
|
|
61
|
+
hash: string
|
|
62
|
+
rootIds: Set<string>
|
|
63
|
+
docSignals: Set<Signal>
|
|
64
|
+
requestedTransportMode: TransportMode
|
|
65
|
+
activeTransportMode: TransportMode
|
|
66
|
+
readonly subscribed: boolean
|
|
67
|
+
constructor (collectionName: string, params: unknown, options?: { hash?: string })
|
|
68
|
+
init (): void
|
|
69
|
+
subscribe (options?: { mode?: Exclude<TransportMode, 'idle'> }): Promise<void>
|
|
70
|
+
unsubscribe (): Promise<void>
|
|
71
|
+
attachRoot (rootId?: string): void
|
|
72
|
+
detachRoot (rootId?: string): void
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export type QueryConstructor = new (
|
|
76
|
+
collectionName: string,
|
|
77
|
+
params: unknown,
|
|
78
|
+
options?: { hash?: string }
|
|
79
|
+
) => Query
|
|
80
|
+
|
|
81
|
+
export class QuerySubscriptions {
|
|
82
|
+
QueryClass: QueryConstructor
|
|
83
|
+
runtimeKind: 'query' | 'aggregation'
|
|
84
|
+
ownerRecords: Map<string, QueryOwnerRecord>
|
|
85
|
+
entries: Map<string, QueryRuntimeEntry>
|
|
86
|
+
subCount: ReadonlyMapView<string, number>
|
|
87
|
+
transportSubCount: ReadonlyMapView<string, number>
|
|
88
|
+
ownerFetchCount: ReadonlyMapView<string, number>
|
|
89
|
+
ownerSubscribeCount: ReadonlyMapView<string, number>
|
|
90
|
+
queries: ReadonlyMapView<string, Query>
|
|
91
|
+
ownerToTransport: ReadonlyMapView<string, string>
|
|
92
|
+
ownerMeta: ReadonlyMapView<string, QueryOwnerMeta>
|
|
93
|
+
ownerKeysByTransport: ReadonlyMapView<string, Set<string>>
|
|
94
|
+
pendingDestroyTimers: ReadonlyMapView<string, PendingQueryDestroyEntry>
|
|
95
|
+
constructor (QueryClass?: QueryConstructor)
|
|
96
|
+
subscribe ($query: Signal, options?: { intent?: SubscriptionIntent }): Promise<void> | void
|
|
97
|
+
unsubscribe ($query: Signal, options?: { intent?: SubscriptionIntent }): Promise<void>
|
|
98
|
+
destroy (collectionName: string, params: unknown, options?: { force?: boolean }): Promise<void>
|
|
99
|
+
clear (): Promise<void>
|
|
100
|
+
flushPendingDestroys (): Promise<void>
|
|
101
|
+
scheduleDestroy (
|
|
102
|
+
collectionName: string,
|
|
103
|
+
params: unknown,
|
|
104
|
+
ownerKey?: string,
|
|
105
|
+
options?: { transportHash?: string, force?: boolean }
|
|
106
|
+
): Promise<void> | void
|
|
107
|
+
cancelDestroy (ownerKey: string, transportHash?: string): void
|
|
108
|
+
destroyByRuntimeHash (runtimeHash: string, options?: { rootId?: string, force?: boolean }): Promise<void>
|
|
109
|
+
getOwnerMeta (ownerKey: string): QueryOwnerMeta | undefined
|
|
110
|
+
getOwnerKeys (transportHash: string): Set<string> | undefined
|
|
111
|
+
getPendingDestroyOwnerKeys (): IterableIterator<string>
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export const querySubscriptions: QuerySubscriptions
|
|
115
|
+
export function getQuerySignal (collectionName: string, params: unknown, options?: QuerySignalOptions): Signal
|
|
116
|
+
export function hashQuery (collectionName: string, params: unknown): string
|
|
117
|
+
export function parseQueryHash (hash: string): QueryHashParts
|