@kubun/protocol 0.1.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/LICENSE.md +57 -0
- package/README.md +11 -0
- package/lib/index.d.ts +14 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +6 -0
- package/lib/models/cluster.d.ts +17 -0
- package/lib/models/cluster.d.ts.map +1 -0
- package/lib/models/cluster.js +102 -0
- package/lib/models/document.d.ts +3788 -0
- package/lib/models/document.d.ts.map +1 -0
- package/lib/models/document.js +229 -0
- package/lib/models/graph.d.ts +23 -0
- package/lib/models/graph.d.ts.map +1 -0
- package/lib/models/graph.js +39 -0
- package/lib/models/json-schema.d.ts +845 -0
- package/lib/models/json-schema.d.ts.map +1 -0
- package/lib/models/json-schema.js +245 -0
- package/lib/models/value.d.ts +16 -0
- package/lib/models/value.d.ts.map +1 -0
- package/lib/models/value.js +15 -0
- package/lib/services/graph.d.ts +2539 -0
- package/lib/services/graph.d.ts.map +1 -0
- package/lib/services/graph.js +164 -0
- package/package.json +35 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-schema.d.ts","sourceRoot":"","sources":["../../src/models/json-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAU,MAAM,gBAAgB,CAAA;AAExD,eAAO,MAAM,YAAY;;;;;;;;;;;;;CAQE,CAAA;AAC3B,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAA;AAE1D,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;CAUE,CAAA;AAC3B,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAA;AAE1D,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;CAUG,CAAA;AAC3B,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAA;AAExD,eAAO,MAAM,eAAe;;;;;;;;;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+
],
|
|
15
|
+
additionalProperties: false
|
|
16
|
+
};
|
|
17
|
+
export const integerModel = {
|
|
18
|
+
type: 'object',
|
|
19
|
+
properties: {
|
|
20
|
+
type: {
|
|
21
|
+
type: 'string',
|
|
22
|
+
const: 'integer'
|
|
23
|
+
},
|
|
24
|
+
default: {
|
|
25
|
+
type: 'integer'
|
|
26
|
+
},
|
|
27
|
+
min: {
|
|
28
|
+
type: 'integer'
|
|
29
|
+
},
|
|
30
|
+
max: {
|
|
31
|
+
type: 'integer'
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
required: [
|
|
35
|
+
'type'
|
|
36
|
+
],
|
|
37
|
+
additionalProperties: false
|
|
38
|
+
};
|
|
39
|
+
export const numberModel = {
|
|
40
|
+
type: 'object',
|
|
41
|
+
properties: {
|
|
42
|
+
type: {
|
|
43
|
+
type: 'string',
|
|
44
|
+
const: 'number'
|
|
45
|
+
},
|
|
46
|
+
default: {
|
|
47
|
+
type: 'number'
|
|
48
|
+
},
|
|
49
|
+
min: {
|
|
50
|
+
type: 'number'
|
|
51
|
+
},
|
|
52
|
+
max: {
|
|
53
|
+
type: 'number'
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
required: [
|
|
57
|
+
'type'
|
|
58
|
+
],
|
|
59
|
+
additionalProperties: false
|
|
60
|
+
};
|
|
61
|
+
export const stringEnumModel = {
|
|
62
|
+
type: 'object',
|
|
63
|
+
properties: {
|
|
64
|
+
type: {
|
|
65
|
+
type: 'string',
|
|
66
|
+
const: 'string'
|
|
67
|
+
},
|
|
68
|
+
title: {
|
|
69
|
+
type: 'string'
|
|
70
|
+
},
|
|
71
|
+
enum: {
|
|
72
|
+
type: 'array',
|
|
73
|
+
items: {
|
|
74
|
+
type: 'string'
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
default: {
|
|
78
|
+
type: 'string'
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
required: [
|
|
82
|
+
'type',
|
|
83
|
+
'title',
|
|
84
|
+
'enum'
|
|
85
|
+
],
|
|
86
|
+
additionalProperties: false
|
|
87
|
+
};
|
|
88
|
+
export const supportedStringFormat = {
|
|
89
|
+
type: 'string',
|
|
90
|
+
enum: [
|
|
91
|
+
'date',
|
|
92
|
+
'date-time',
|
|
93
|
+
'duration',
|
|
94
|
+
'time',
|
|
95
|
+
'uri'
|
|
96
|
+
]
|
|
97
|
+
};
|
|
98
|
+
export const stringFormatModel = {
|
|
99
|
+
type: 'object',
|
|
100
|
+
properties: {
|
|
101
|
+
type: {
|
|
102
|
+
type: 'string',
|
|
103
|
+
const: 'string'
|
|
104
|
+
},
|
|
105
|
+
format: supportedStringFormat
|
|
106
|
+
},
|
|
107
|
+
required: [
|
|
108
|
+
'type',
|
|
109
|
+
'format'
|
|
110
|
+
],
|
|
111
|
+
additionalProperties: false
|
|
112
|
+
};
|
|
113
|
+
export const stringCustomModel = {
|
|
114
|
+
type: 'object',
|
|
115
|
+
properties: {
|
|
116
|
+
type: {
|
|
117
|
+
type: 'string',
|
|
118
|
+
const: 'string'
|
|
119
|
+
},
|
|
120
|
+
title: {
|
|
121
|
+
type: 'string'
|
|
122
|
+
},
|
|
123
|
+
pattern: {
|
|
124
|
+
type: 'string'
|
|
125
|
+
},
|
|
126
|
+
default: {
|
|
127
|
+
type: 'string'
|
|
128
|
+
},
|
|
129
|
+
minLength: {
|
|
130
|
+
type: 'integer'
|
|
131
|
+
},
|
|
132
|
+
maxLength: {
|
|
133
|
+
type: 'integer'
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
required: [
|
|
137
|
+
'type'
|
|
138
|
+
],
|
|
139
|
+
additionalProperties: false
|
|
140
|
+
};
|
|
141
|
+
export const stringModel = {
|
|
142
|
+
anyOf: [
|
|
143
|
+
stringCustomModel,
|
|
144
|
+
stringEnumModel,
|
|
145
|
+
stringFormatModel
|
|
146
|
+
]
|
|
147
|
+
};
|
|
148
|
+
export const scalarModel = {
|
|
149
|
+
anyOf: [
|
|
150
|
+
booleanModel,
|
|
151
|
+
integerModel,
|
|
152
|
+
numberModel,
|
|
153
|
+
stringModel
|
|
154
|
+
]
|
|
155
|
+
};
|
|
156
|
+
export const refModel = {
|
|
157
|
+
type: 'object',
|
|
158
|
+
properties: {
|
|
159
|
+
$ref: {
|
|
160
|
+
type: 'string'
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
required: [
|
|
164
|
+
'$ref'
|
|
165
|
+
],
|
|
166
|
+
additionalProperties: false
|
|
167
|
+
};
|
|
168
|
+
export const arrayModel = {
|
|
169
|
+
type: 'object',
|
|
170
|
+
properties: {
|
|
171
|
+
type: {
|
|
172
|
+
type: 'string',
|
|
173
|
+
const: 'array'
|
|
174
|
+
},
|
|
175
|
+
title: {
|
|
176
|
+
type: 'string'
|
|
177
|
+
},
|
|
178
|
+
items: refModel
|
|
179
|
+
},
|
|
180
|
+
required: [
|
|
181
|
+
'type',
|
|
182
|
+
'title',
|
|
183
|
+
'items'
|
|
184
|
+
],
|
|
185
|
+
additionalProperties: false
|
|
186
|
+
};
|
|
187
|
+
export const baseObjectModel = {
|
|
188
|
+
type: 'object',
|
|
189
|
+
properties: {
|
|
190
|
+
type: {
|
|
191
|
+
type: 'string',
|
|
192
|
+
const: 'object'
|
|
193
|
+
},
|
|
194
|
+
properties: {
|
|
195
|
+
type: 'object',
|
|
196
|
+
additionalProperties: refModel
|
|
197
|
+
},
|
|
198
|
+
required: {
|
|
199
|
+
type: 'array',
|
|
200
|
+
items: {
|
|
201
|
+
type: 'string'
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
additionalProperties: {
|
|
205
|
+
type: 'boolean'
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
required: [
|
|
209
|
+
'type',
|
|
210
|
+
'properties',
|
|
211
|
+
'required',
|
|
212
|
+
'additionalProperties'
|
|
213
|
+
],
|
|
214
|
+
additionalProperties: false
|
|
215
|
+
};
|
|
216
|
+
export const objectModel = {
|
|
217
|
+
type: 'object',
|
|
218
|
+
properties: {
|
|
219
|
+
...baseObjectModel.properties,
|
|
220
|
+
title: {
|
|
221
|
+
type: 'string'
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
required: [
|
|
225
|
+
...baseObjectModel.required,
|
|
226
|
+
'title'
|
|
227
|
+
],
|
|
228
|
+
additionalProperties: false
|
|
229
|
+
};
|
|
230
|
+
export const shapeModel = {
|
|
231
|
+
anyOf: [
|
|
232
|
+
arrayModel,
|
|
233
|
+
objectModel
|
|
234
|
+
]
|
|
235
|
+
};
|
|
236
|
+
export const typeModel = {
|
|
237
|
+
anyOf: [
|
|
238
|
+
scalarModel,
|
|
239
|
+
shapeModel
|
|
240
|
+
]
|
|
241
|
+
};
|
|
242
|
+
export const referencesRecordModel = {
|
|
243
|
+
type: 'object',
|
|
244
|
+
additionalProperties: typeModel
|
|
245
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const binaryStringValue: {
|
|
2
|
+
readonly title: "KubunBinaryValue";
|
|
3
|
+
readonly type: "string";
|
|
4
|
+
readonly pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$";
|
|
5
|
+
};
|
|
6
|
+
export declare const didStringValue: {
|
|
7
|
+
readonly title: "KubunDIDValue";
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly pattern: "^did:[a-z0-9]+:";
|
|
10
|
+
};
|
|
11
|
+
export declare const signedJWTStringValue: {
|
|
12
|
+
readonly title: "KubunSignedJWTValue";
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
readonly pattern: "^[a-zA-Z0-9_-]+.[a-zA-Z0-9_-]+.[a-zA-Z0-9_-]+$";
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=value.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value.d.ts","sourceRoot":"","sources":["../../src/models/value.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB;;;;CAIH,CAAA;AAE3B,eAAO,MAAM,cAAc;;;;CAIA,CAAA;AAE3B,eAAO,MAAM,oBAAoB;;;;CAIN,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const binaryStringValue = {
|
|
2
|
+
title: 'KubunBinaryValue',
|
|
3
|
+
type: 'string',
|
|
4
|
+
pattern: '^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$'
|
|
5
|
+
};
|
|
6
|
+
export const didStringValue = {
|
|
7
|
+
title: 'KubunDIDValue',
|
|
8
|
+
type: 'string',
|
|
9
|
+
pattern: '^did:[a-z0-9]+:'
|
|
10
|
+
};
|
|
11
|
+
export const signedJWTStringValue = {
|
|
12
|
+
title: 'KubunSignedJWTValue',
|
|
13
|
+
type: 'string',
|
|
14
|
+
pattern: '^[a-zA-Z0-9_-]+.[a-zA-Z0-9_-]+.[a-zA-Z0-9_-]+$'
|
|
15
|
+
};
|