@cero-base/cero 0.5.2 → 0.6.0
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 +4 -4
- package/src/build/builtins.js +137 -0
- package/src/{builder.js → build/index.js} +35 -34
- package/src/build/schemas.js +162 -0
- package/src/handle/index.js +11 -15
- package/src/index.js +3 -7
- package/src/lib/constants.js +20 -0
- package/types/build/builtins.d.ts +88 -0
- package/types/build/schemas.d.ts +153 -0
- package/types/handle/index.d.ts +1 -5
- package/types/lib/constants.d.ts +14 -0
- package/src/lib/builtins.js +0 -413
- package/types/lib/builtins.d.ts +0 -141
- /package/types/{builder.d.ts → build/index.d.ts} +0 -0
package/types/lib/builtins.d.ts
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Map a schema-DSL primitive name to its HyperDB type name.
|
|
3
|
-
*
|
|
4
|
-
* @param {string} prim
|
|
5
|
-
* @returns {string}
|
|
6
|
-
*/
|
|
7
|
-
export function hyperdbType(prim: string): string;
|
|
8
|
-
/**
|
|
9
|
-
* Type descriptors registered into every main schema.
|
|
10
|
-
*
|
|
11
|
-
* @returns {TypeDesc[]}
|
|
12
|
-
*/
|
|
13
|
-
export function builtinTypes(): TypeDesc[];
|
|
14
|
-
/**
|
|
15
|
-
* Collection descriptors for every main schema, namespaced under `ns`.
|
|
16
|
-
*
|
|
17
|
-
* @param {string} ns
|
|
18
|
-
* @returns {CollectionDesc[]}
|
|
19
|
-
*/
|
|
20
|
-
export function builtinCollections(ns: string): CollectionDesc[];
|
|
21
|
-
/**
|
|
22
|
-
* Dispatch (mutation) descriptors for every main schema, namespaced under `ns`.
|
|
23
|
-
*
|
|
24
|
-
* @param {string} ns
|
|
25
|
-
* @returns {DispatchDesc[]}
|
|
26
|
-
*/
|
|
27
|
-
export function builtinDispatches(ns: string): DispatchDesc[];
|
|
28
|
-
/**
|
|
29
|
-
* Type descriptors registered into every local schema.
|
|
30
|
-
*
|
|
31
|
-
* @returns {TypeDesc[]}
|
|
32
|
-
*/
|
|
33
|
-
export function localBuiltinTypes(): TypeDesc[];
|
|
34
|
-
/**
|
|
35
|
-
* Collection descriptors for every local schema, namespaced under `ns`.
|
|
36
|
-
*
|
|
37
|
-
* @param {string} ns
|
|
38
|
-
* @returns {CollectionDesc[]}
|
|
39
|
-
*/
|
|
40
|
-
export function localBuiltinCollections(ns: string): CollectionDesc[];
|
|
41
|
-
/**
|
|
42
|
-
* Request/response type descriptors for the RPC facade.
|
|
43
|
-
*
|
|
44
|
-
* @returns {TypeDesc[]}
|
|
45
|
-
*/
|
|
46
|
-
export function rpcTypes(): TypeDesc[];
|
|
47
|
-
/**
|
|
48
|
-
* RPC command (verb) descriptors for the cero server, namespaced under `ns`.
|
|
49
|
-
*
|
|
50
|
-
* @param {string} ns
|
|
51
|
-
* @returns {CommandDesc[]}
|
|
52
|
-
*/
|
|
53
|
-
export function rpcCommands(ns: string): CommandDesc[];
|
|
54
|
-
/**
|
|
55
|
-
* Builtin type/collection/dispatch/rpc definitions used by the builder.
|
|
56
|
-
* Every cero schema includes these; user-defined refs are added on top.
|
|
57
|
-
*
|
|
58
|
-
* @typedef {{ name: string, type: string, verb?: string, kind?: string }} BuiltinRef
|
|
59
|
-
* @typedef {{ name: string, type: string, required: boolean }} FieldDesc
|
|
60
|
-
* @typedef {{ name: string, compact: boolean, fields: FieldDesc[] }} TypeDesc
|
|
61
|
-
* @typedef {{ name: string, schema: string, key: string[] }} CollectionDesc
|
|
62
|
-
* @typedef {{ name: string, requestType: string }} DispatchDesc
|
|
63
|
-
* @typedef {{
|
|
64
|
-
* name: string,
|
|
65
|
-
* request: { name: string },
|
|
66
|
-
* response: { name: string, stream?: boolean }
|
|
67
|
-
* }} CommandDesc
|
|
68
|
-
*/
|
|
69
|
-
/**
|
|
70
|
-
* Refs that exist on every main (Handle) schema.
|
|
71
|
-
*
|
|
72
|
-
* @type {BuiltinRef[]}
|
|
73
|
-
*/
|
|
74
|
-
export const BUILTINS: BuiltinRef[];
|
|
75
|
-
/**
|
|
76
|
-
* Refs that exist on every local schema.
|
|
77
|
-
*
|
|
78
|
-
* @type {BuiltinRef[]}
|
|
79
|
-
*/
|
|
80
|
-
export const LOCAL_BUILTINS: BuiltinRef[];
|
|
81
|
-
/** Collection name for the internal counters table. */
|
|
82
|
-
export const COUNTERS: "counters";
|
|
83
|
-
/**
|
|
84
|
-
* Builtin type/collection/dispatch/rpc definitions used by the builder.
|
|
85
|
-
* Every cero schema includes these; user-defined refs are added on top.
|
|
86
|
-
*/
|
|
87
|
-
export type BuiltinRef = {
|
|
88
|
-
name: string;
|
|
89
|
-
type: string;
|
|
90
|
-
verb?: string;
|
|
91
|
-
kind?: string;
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* Builtin type/collection/dispatch/rpc definitions used by the builder.
|
|
95
|
-
* Every cero schema includes these; user-defined refs are added on top.
|
|
96
|
-
*/
|
|
97
|
-
export type FieldDesc = {
|
|
98
|
-
name: string;
|
|
99
|
-
type: string;
|
|
100
|
-
required: boolean;
|
|
101
|
-
};
|
|
102
|
-
/**
|
|
103
|
-
* Builtin type/collection/dispatch/rpc definitions used by the builder.
|
|
104
|
-
* Every cero schema includes these; user-defined refs are added on top.
|
|
105
|
-
*/
|
|
106
|
-
export type TypeDesc = {
|
|
107
|
-
name: string;
|
|
108
|
-
compact: boolean;
|
|
109
|
-
fields: FieldDesc[];
|
|
110
|
-
};
|
|
111
|
-
/**
|
|
112
|
-
* Builtin type/collection/dispatch/rpc definitions used by the builder.
|
|
113
|
-
* Every cero schema includes these; user-defined refs are added on top.
|
|
114
|
-
*/
|
|
115
|
-
export type CollectionDesc = {
|
|
116
|
-
name: string;
|
|
117
|
-
schema: string;
|
|
118
|
-
key: string[];
|
|
119
|
-
};
|
|
120
|
-
/**
|
|
121
|
-
* Builtin type/collection/dispatch/rpc definitions used by the builder.
|
|
122
|
-
* Every cero schema includes these; user-defined refs are added on top.
|
|
123
|
-
*/
|
|
124
|
-
export type DispatchDesc = {
|
|
125
|
-
name: string;
|
|
126
|
-
requestType: string;
|
|
127
|
-
};
|
|
128
|
-
/**
|
|
129
|
-
* Builtin type/collection/dispatch/rpc definitions used by the builder.
|
|
130
|
-
* Every cero schema includes these; user-defined refs are added on top.
|
|
131
|
-
*/
|
|
132
|
-
export type CommandDesc = {
|
|
133
|
-
name: string;
|
|
134
|
-
request: {
|
|
135
|
-
name: string;
|
|
136
|
-
};
|
|
137
|
-
response: {
|
|
138
|
-
name: string;
|
|
139
|
-
stream?: boolean;
|
|
140
|
-
};
|
|
141
|
-
};
|
|
File without changes
|