@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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/services/graph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,KAAK,EAAE,UAAU,EAAU,MAAM,gBAAgB,CAAA;AAKxD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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iBAAiB,CAAC,eAAe,EAAE,eAAe,CAAC,CAAA;AAElF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;CAUJ,CAAA;AAC3B,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAEtE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBH,CAAA;AAC3B,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAEpE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQJ,CAAA;AAC3B,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAEtE,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAA;AAEzF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CASH,CAAA;AAC3B,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAEpE,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAA;AAEzF,MAAM,MAAM,aAAa,GAAG;IAC1B,cAAc,EAAE,kBAAkB,CAAA;IAClC,YAAY,EAAE,gBAAgB,CAAA;IAC9B,aAAa,EAAE,iBAAiB,CAAA;IAChC,cAAc,EAAE,kBAAkB,CAAA;CACnC,CAAA"}
@@ -0,0 +1,164 @@
1
+ import { documentModelsCluster, documentModelsRecord } from '../models/document.js';
2
+ import { binaryStringValue, didStringValue, signedJWTStringValue } from '../models/value.js';
3
+ export const createGraphParams = {
4
+ type: 'object',
5
+ properties: {
6
+ name: {
7
+ type: 'string'
8
+ },
9
+ clusters: {
10
+ type: 'array',
11
+ items: documentModelsCluster
12
+ }
13
+ },
14
+ required: [
15
+ 'name',
16
+ 'clusters'
17
+ ],
18
+ additionalProperties: false
19
+ };
20
+ export const createGraphResult = {
21
+ type: 'object',
22
+ properties: {
23
+ id: {
24
+ type: 'string'
25
+ },
26
+ models: documentModelsRecord
27
+ },
28
+ required: [
29
+ 'id',
30
+ 'models'
31
+ ],
32
+ additionalProperties: false
33
+ };
34
+ export const loadGraphParams = {
35
+ type: 'object',
36
+ properties: {
37
+ id: {
38
+ type: 'string'
39
+ }
40
+ },
41
+ required: [
42
+ 'id'
43
+ ],
44
+ additionalProperties: false
45
+ };
46
+ export const loadGraphResult = {
47
+ type: 'object',
48
+ properties: {
49
+ models: documentModelsRecord,
50
+ aliases: {
51
+ type: 'object',
52
+ additionalProperties: {
53
+ type: 'string'
54
+ }
55
+ }
56
+ },
57
+ required: [
58
+ 'models'
59
+ ],
60
+ additionalProperties: false
61
+ };
62
+ export const executeGraphParams = {
63
+ type: 'object',
64
+ properties: {
65
+ id: {
66
+ type: 'string'
67
+ },
68
+ text: {
69
+ type: 'string'
70
+ },
71
+ variables: {
72
+ type: 'object'
73
+ },
74
+ viewer: didStringValue
75
+ },
76
+ required: [
77
+ 'id',
78
+ 'text',
79
+ 'variables'
80
+ ],
81
+ additionalProperties: false
82
+ };
83
+ export const executeGraphError = {
84
+ type: 'object',
85
+ properties: {
86
+ message: {
87
+ type: 'string'
88
+ },
89
+ locations: {
90
+ type: 'array',
91
+ items: {
92
+ type: 'object',
93
+ properties: {
94
+ line: {
95
+ type: 'integer'
96
+ },
97
+ column: {
98
+ type: 'integer'
99
+ }
100
+ },
101
+ required: [
102
+ 'line',
103
+ 'column'
104
+ ],
105
+ additionalProperties: false
106
+ }
107
+ },
108
+ path: {
109
+ type: 'array',
110
+ items: {
111
+ type: 'string'
112
+ }
113
+ },
114
+ extensions: {
115
+ type: 'object'
116
+ }
117
+ },
118
+ required: [
119
+ 'message'
120
+ ],
121
+ additionalProperties: false
122
+ };
123
+ export const executeGraphResult = {
124
+ type: 'object',
125
+ properties: {
126
+ data: {
127
+ anyOf: [
128
+ {
129
+ type: 'object'
130
+ },
131
+ {
132
+ type: 'null'
133
+ }
134
+ ]
135
+ },
136
+ errors: {
137
+ type: 'array',
138
+ items: executeGraphError
139
+ },
140
+ extensions: {
141
+ type: 'object'
142
+ }
143
+ },
144
+ additionalProperties: false
145
+ };
146
+ export const mutateGraphParams = {
147
+ type: 'object',
148
+ properties: {
149
+ ...executeGraphParams.properties,
150
+ mutations: {
151
+ type: 'object',
152
+ additionalProperties: signedJWTStringValue
153
+ },
154
+ attachments: {
155
+ type: 'object',
156
+ additionalProperties: binaryStringValue
157
+ }
158
+ },
159
+ required: [
160
+ ...executeGraphParams.required,
161
+ 'mutations'
162
+ ],
163
+ additionalProperties: false
164
+ };
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@kubun/protocol",
3
+ "version": "0.1.0",
4
+ "license": "see LICENSE.md",
5
+ "keywords": [],
6
+ "type": "module",
7
+ "main": "lib/index.js",
8
+ "types": "lib/index.d.ts",
9
+ "exports": {
10
+ ".": "./lib/index.js"
11
+ },
12
+ "files": [
13
+ "lib/*",
14
+ "LICENSE.md"
15
+ ],
16
+ "sideEffects": false,
17
+ "dependencies": {
18
+ "@enkaku/protocol": "^0.2.1",
19
+ "@enkaku/schema": "^0.2.0",
20
+ "@kubun/id": "^0.1.0"
21
+ },
22
+ "devDependencies": {
23
+ "json-schema-typed": "^8.0.1"
24
+ },
25
+ "scripts": {
26
+ "build:clean": "del lib",
27
+ "build:js": "swc src -d ./lib --config-file ../../swc.json --strip-leading-paths",
28
+ "build:types": "tsc --emitDeclarationOnly --skipLibCheck",
29
+ "build:types:ci": "tsc --emitDeclarationOnly --declarationMap false",
30
+ "build": "pnpm run build:clean && pnpm run build:js && pnpm run build:types",
31
+ "test:types": "tsc --noEmit",
32
+ "test:unit": "node --experimental-vm-modules ../../node_modules/jest/bin/jest.js",
33
+ "test": "pnpm run test:types && pnpm run test:unit"
34
+ }
35
+ }