@nuffieldtechnologies/rugged-schema-types 0.8.2 → 1.0.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/.jshintrc +5 -5
- package/README.md +0 -0
- package/{distribution/index.js → index.ts} +56 -49
- package/package.json +12 -12
- package/tsconfig.json +11 -0
- package/.babelrc +0 -9
package/.jshintrc
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"esversion": 6,
|
|
3
|
-
"undef": true,
|
|
4
|
-
"unused": true,
|
|
5
|
-
"devel": true
|
|
1
|
+
{
|
|
2
|
+
"esversion": 6,
|
|
3
|
+
"undef": true,
|
|
4
|
+
"unused": true,
|
|
5
|
+
"devel": true
|
|
6
6
|
}
|
package/README.md
ADDED
|
File without changes
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.All = exports.AllOrganisationFields = exports.Organisations = exports.OrganisationInput = exports.Organisation = exports.AllFormFields = exports.Forms = exports.FormFilter = exports.FormInput = exports.Form = exports.AllRolesFields = exports.AllUserFields = exports.Users = exports.UserInput = exports.User = exports.AllTaskFields = exports.Tasks = exports.TaskFilter = exports.TaskInput = exports.Task = void 0;
|
|
7
1
|
const _TimeStamps = `
|
|
8
2
|
type TimeStamps {
|
|
9
3
|
started: String,
|
|
@@ -22,6 +16,7 @@ const _TimeStampsInput = `
|
|
|
22
16
|
upgraded: String
|
|
23
17
|
}
|
|
24
18
|
`;
|
|
19
|
+
|
|
25
20
|
const _Event = `
|
|
26
21
|
type Event {
|
|
27
22
|
appVersion: String,
|
|
@@ -33,7 +28,8 @@ const _Event = `
|
|
|
33
28
|
user: String,
|
|
34
29
|
userEmail: String
|
|
35
30
|
}
|
|
36
|
-
|
|
31
|
+
`
|
|
32
|
+
|
|
37
33
|
const _EventInput = `
|
|
38
34
|
input EventInput {
|
|
39
35
|
appVersion: String,
|
|
@@ -46,6 +42,7 @@ const _EventInput = `
|
|
|
46
42
|
userEmail: String
|
|
47
43
|
}
|
|
48
44
|
`;
|
|
45
|
+
|
|
49
46
|
const _Events = `
|
|
50
47
|
type Events {
|
|
51
48
|
started: Event,
|
|
@@ -54,6 +51,7 @@ type Events {
|
|
|
54
51
|
discarded: Event,
|
|
55
52
|
}
|
|
56
53
|
`;
|
|
54
|
+
|
|
57
55
|
const _EventsInput = `
|
|
58
56
|
input EventsInput {
|
|
59
57
|
started: EventInput,
|
|
@@ -62,6 +60,7 @@ input EventsInput {
|
|
|
62
60
|
discarded: EventInput,
|
|
63
61
|
}
|
|
64
62
|
`;
|
|
63
|
+
|
|
65
64
|
const _TemplateInfo = `
|
|
66
65
|
type TemplateInfo {
|
|
67
66
|
name: String,
|
|
@@ -70,6 +69,7 @@ const _TemplateInfo = `
|
|
|
70
69
|
version: String
|
|
71
70
|
}
|
|
72
71
|
`;
|
|
72
|
+
|
|
73
73
|
const _TemplateInfoInput = `
|
|
74
74
|
input TemplateInfoInput {
|
|
75
75
|
name: String,
|
|
@@ -78,18 +78,21 @@ const _TemplateInfoInput = `
|
|
|
78
78
|
version: String
|
|
79
79
|
}
|
|
80
80
|
`;
|
|
81
|
+
|
|
81
82
|
const _TaskIdentifiers = `
|
|
82
83
|
type TaskIdentifiers {
|
|
83
84
|
primary: String
|
|
84
85
|
secondary: String
|
|
85
86
|
}
|
|
86
87
|
`;
|
|
88
|
+
|
|
87
89
|
const _TaskIdentifiersInput = `
|
|
88
90
|
input TaskIdentifiersInput {
|
|
89
91
|
primary: String
|
|
90
92
|
secondary: String
|
|
91
93
|
}
|
|
92
94
|
`;
|
|
95
|
+
|
|
93
96
|
const _Task = `
|
|
94
97
|
type Task {
|
|
95
98
|
id: ID,
|
|
@@ -107,10 +110,14 @@ const _Task = `
|
|
|
107
110
|
fails: [String]
|
|
108
111
|
reportUrl: String
|
|
109
112
|
data: String
|
|
113
|
+
refNo: String
|
|
110
114
|
}
|
|
111
115
|
`;
|
|
116
|
+
|
|
112
117
|
const _AllEventFields = `{appVersion, at, atForHumans, device, deviceModel, osVersion, user, userEmail}`;
|
|
118
|
+
|
|
113
119
|
const _AllTaskFields = `{id, name, definition, user, userEmail, form, id, organisation, timestamps {started, updated, submitted, processed, upgraded} events {started ${_AllEventFields}, updated ${_AllEventFields}, submitted ${_AllEventFields}, discarded ${_AllEventFields}} , template { type, id, version}, identifiers { primary, secondary}, status, fails, reportUrl, data}`;
|
|
120
|
+
|
|
114
121
|
const _TaskInput = `
|
|
115
122
|
input TaskInput {
|
|
116
123
|
# The name of the task. TODO does this actually exist?
|
|
@@ -139,8 +146,12 @@ const _TaskInput = `
|
|
|
139
146
|
template: TemplateInfoInput
|
|
140
147
|
identifiers: TaskIdentifiersInput
|
|
141
148
|
data: String
|
|
149
|
+
|
|
150
|
+
#A unique identifier for the task that is intended to be human-readable.
|
|
151
|
+
refNo: String
|
|
142
152
|
}
|
|
143
153
|
`;
|
|
154
|
+
|
|
144
155
|
const _TaskFilter = `
|
|
145
156
|
input TaskFilter {
|
|
146
157
|
users: [ID]
|
|
@@ -150,6 +161,7 @@ const _TaskFilter = `
|
|
|
150
161
|
before: String
|
|
151
162
|
},
|
|
152
163
|
`;
|
|
164
|
+
|
|
153
165
|
const _Roles = `
|
|
154
166
|
type Roles {
|
|
155
167
|
user: Boolean
|
|
@@ -160,6 +172,7 @@ const _Roles = `
|
|
|
160
172
|
legacyPush: Boolean
|
|
161
173
|
}
|
|
162
174
|
`;
|
|
175
|
+
|
|
163
176
|
const _RolesInput = `
|
|
164
177
|
input RolesInput {
|
|
165
178
|
user: Boolean
|
|
@@ -167,6 +180,7 @@ const _RolesInput = `
|
|
|
167
180
|
api: Boolean
|
|
168
181
|
}
|
|
169
182
|
`;
|
|
183
|
+
|
|
170
184
|
const _User = `
|
|
171
185
|
type User {
|
|
172
186
|
id: ID
|
|
@@ -178,6 +192,7 @@ const _User = `
|
|
|
178
192
|
permissions: String
|
|
179
193
|
}
|
|
180
194
|
`;
|
|
195
|
+
|
|
181
196
|
const _UserInput = `
|
|
182
197
|
input UserInput {
|
|
183
198
|
id: ID
|
|
@@ -188,8 +203,10 @@ const _UserInput = `
|
|
|
188
203
|
roles: RolesInput
|
|
189
204
|
}
|
|
190
205
|
`;
|
|
206
|
+
|
|
191
207
|
const _AllRolesFields = `{user, admin, api, uber, super, legacyPush}`;
|
|
192
208
|
const _AllUserFields = `{id, organisation, name, email, roles ${_AllRolesFields}, permissions}`;
|
|
209
|
+
|
|
193
210
|
const _FormInput = `
|
|
194
211
|
|
|
195
212
|
input ParamInput {
|
|
@@ -210,11 +227,13 @@ const _FormInput = `
|
|
|
210
227
|
body: String
|
|
211
228
|
}
|
|
212
229
|
`;
|
|
230
|
+
|
|
213
231
|
const _FormFilter = `
|
|
214
232
|
input FormFilter {
|
|
215
233
|
status: String
|
|
216
234
|
}
|
|
217
235
|
`;
|
|
236
|
+
|
|
218
237
|
const _Form = `
|
|
219
238
|
|
|
220
239
|
type Param {
|
|
@@ -235,7 +254,9 @@ const _Form = `
|
|
|
235
254
|
body: String
|
|
236
255
|
}
|
|
237
256
|
`;
|
|
257
|
+
|
|
238
258
|
const _AllFormFields = `{id, name, key, definition, status, updated, params {name, value}, resources, body}`;
|
|
259
|
+
|
|
239
260
|
const _OrganisationInput = `
|
|
240
261
|
input OrganisationInput {
|
|
241
262
|
id: ID
|
|
@@ -243,6 +264,7 @@ const _OrganisationInput = `
|
|
|
243
264
|
logoUrl: String
|
|
244
265
|
}
|
|
245
266
|
`;
|
|
267
|
+
|
|
246
268
|
const _Organisation = `
|
|
247
269
|
type Organisation {
|
|
248
270
|
id: ID
|
|
@@ -250,46 +272,31 @@ const _Organisation = `
|
|
|
250
272
|
logoUrl: String
|
|
251
273
|
}
|
|
252
274
|
`;
|
|
275
|
+
|
|
253
276
|
const _AllOrganisationFields = `{id, name, logoUrl}`;
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
const TaskInput = _TimeStampsInput + _EventInput + _EventsInput + _TemplateInfoInput + _TaskInput + _TaskIdentifiersInput;
|
|
257
|
-
|
|
258
|
-
const
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
const
|
|
263
|
-
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
const
|
|
275
|
-
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
const Forms = Form + FormInput + FormFilter;
|
|
281
|
-
exports.Forms = Forms;
|
|
282
|
-
const AllFormFields = _AllFormFields;
|
|
283
|
-
exports.AllFormFields = AllFormFields;
|
|
284
|
-
const Organisation = _Organisation;
|
|
285
|
-
exports.Organisation = Organisation;
|
|
286
|
-
const OrganisationInput = _OrganisationInput;
|
|
287
|
-
exports.OrganisationInput = OrganisationInput;
|
|
288
|
-
const Organisations = Organisation + OrganisationInput;
|
|
289
|
-
exports.Organisations = Organisations;
|
|
290
|
-
const AllOrganisationFields = _AllOrganisationFields;
|
|
291
|
-
exports.AllOrganisationFields = AllOrganisationFields;
|
|
292
|
-
const All = Tasks + Users + Forms + Organisations;
|
|
293
|
-
exports.All = All;
|
|
294
|
-
var _default = All;
|
|
295
|
-
exports.default = _default;
|
|
277
|
+
|
|
278
|
+
export const Task = _TimeStamps + _Event + _Events + _TemplateInfo + _Task + _TaskIdentifiers;
|
|
279
|
+
export const TaskInput = _TimeStampsInput + _EventInput + _EventsInput + _TemplateInfoInput + _TaskInput + _TaskIdentifiersInput;
|
|
280
|
+
export const TaskFilter = _TaskFilter;
|
|
281
|
+
export const Tasks = Task + TaskInput + TaskFilter;
|
|
282
|
+
export const AllTaskFields = _AllTaskFields;
|
|
283
|
+
|
|
284
|
+
export const User = _Roles + _User;
|
|
285
|
+
export const UserInput = _RolesInput + _UserInput;
|
|
286
|
+
export const Users = User + UserInput;
|
|
287
|
+
export const AllUserFields = _AllUserFields;
|
|
288
|
+
export const AllRolesFields = _AllRolesFields;
|
|
289
|
+
|
|
290
|
+
export const Form = _Form;
|
|
291
|
+
export const FormInput = _FormInput;
|
|
292
|
+
export const FormFilter = _FormFilter;
|
|
293
|
+
export const Forms = Form + FormInput + FormFilter;
|
|
294
|
+
export const AllFormFields = _AllFormFields;
|
|
295
|
+
|
|
296
|
+
export const Organisation = _Organisation;
|
|
297
|
+
export const OrganisationInput = _OrganisationInput;
|
|
298
|
+
export const Organisations = Organisation + OrganisationInput;
|
|
299
|
+
export const AllOrganisationFields = _AllOrganisationFields;
|
|
300
|
+
|
|
301
|
+
export const All = Tasks + Users + Forms + Organisations;
|
|
302
|
+
export default All;
|
package/package.json
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuffieldtechnologies/rugged-schema-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Graphql schema for rugged data",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "dist/index.js",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"graphql",
|
|
8
8
|
"schema"
|
|
9
9
|
],
|
|
10
10
|
"devDependencies": {
|
|
11
|
-
"@
|
|
12
|
-
"@
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
11
|
+
"@types/chai": "^4.1.3",
|
|
12
|
+
"@types/mocha": "^5.2.0",
|
|
13
|
+
"chai": "^4.2.0",
|
|
14
|
+
"mocha": "^6.1.3",
|
|
15
|
+
"ts-node": "^6.0.3",
|
|
16
|
+
"tslint": "^5.10.0",
|
|
17
|
+
"typescript": "^3.4.3"
|
|
18
18
|
},
|
|
19
19
|
"author": "Tom Edge",
|
|
20
20
|
"license": "UNLICENSED",
|
|
21
21
|
"scripts": {
|
|
22
|
-
"test": "
|
|
23
|
-
"build": "
|
|
24
|
-
"
|
|
22
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
23
|
+
"build": "tsc",
|
|
24
|
+
"push": "yarn run build && npm publish"
|
|
25
25
|
}
|
|
26
26
|
}
|
package/tsconfig.json
ADDED