@nuffieldtechnologies/rugged-schema-types 2.1.26 → 2.1.31

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.
@@ -2,26 +2,26 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports._AllUserFields = exports._UserInput = exports._User = void 0;
4
4
  const Roles = require("./roles");
5
- exports._User = `
6
- type User {
7
- id: ID
8
- organisation: ID
9
- firebaseId: ID
10
- name: String
11
- email: String
12
- roles: Roles
13
- permissions: String
14
- }
5
+ exports._User = `
6
+ type User {
7
+ id: ID
8
+ organisation: ID
9
+ firebaseId: ID
10
+ name: String
11
+ email: String
12
+ roles: Roles
13
+ permissions: String
14
+ }
15
15
  `;
16
- exports._UserInput = `
17
- input UserInput {
18
- id: ID
19
- organisation: ID
20
- firebaseId: ID
21
- name: String
22
- email: String
23
- roles: RolesInput
24
- }
16
+ exports._UserInput = `
17
+ input UserInput {
18
+ id: ID
19
+ organisation: ID
20
+ firebaseId: ID
21
+ name: String
22
+ email: String
23
+ roles: RolesInput
24
+ }
25
25
  `;
26
26
  exports._AllUserFields = `{id, organisation, name, email, roles ${Roles._AllRolesFields}, permissions}`;
27
27
  //# sourceMappingURL=user.js.map
package/index.ts CHANGED
@@ -3,14 +3,14 @@ import * as Events from './schemas/events'
3
3
  import * as TemplateInfo from './schemas/template-info'
4
4
  import * as UserSchemas from './schemas/user'
5
5
  import * as Roles from './schemas/roles'
6
- import * as FormShemas from './schemas/form'
6
+ import * as FormSchemas from './schemas/form'
7
7
  import * as OrganisationSchemas from './schemas/organisation'
8
8
  import * as TaskIdentifiers from './schemas/task-identifiers'
9
9
  import * as TaskOldSchemas from './schemas/task-old'
10
10
  import * as TaskSchemas from './schemas/task'
11
11
 
12
- export const Task = TimeStamps._TimeStamps + Events._Event + Events._Events + TemplateInfo._TemplateInfo + TaskSchemas._TaskInfo + TaskSchemas._Task + TaskIdentifiers._TaskIdentifiers;
13
- export const TaskInput = TimeStamps._TimeStampsInput + Events._EventInput + Events._EventsInput + TemplateInfo._TemplateInfoInput + TaskSchemas._TaskInfoInput + TaskSchemas._TaskInput + TaskIdentifiers._TaskIdentifiersInput;
12
+ export const Task = TimeStamps._TimeStamps + Events._Event + Events._Events + TemplateInfo._TemplateInfo + TaskSchemas._TaskInfo + TaskSchemas._WorkflowInfo + TaskSchemas._Task + TaskIdentifiers._TaskIdentifiers;
13
+ export const TaskInput = TimeStamps._TimeStampsInput + Events._EventInput + Events._EventsInput + TemplateInfo._TemplateInfoInput + TaskSchemas._TaskInfoInput + TaskSchemas._WorkflowInfoInput + TaskSchemas._TaskInput + TaskIdentifiers._TaskIdentifiersInput;
14
14
  export const TaskFilter = TaskSchemas._TaskFilter;
15
15
  export const Tasks = Task + TaskInput + TaskFilter + TaskOldSchemas._TaskOld;
16
16
  export const AllTaskFields = TaskSchemas._AllTaskFields;
@@ -21,11 +21,11 @@ export const Users = User + UserInput;
21
21
  export const AllUserFields = UserSchemas._AllUserFields;
22
22
  export const AllRolesFields = Roles._AllRolesFields;
23
23
 
24
- export const Form = FormShemas._Form;
25
- export const FormInput = FormShemas._FormInput;
26
- export const FormFilter = FormShemas._FormFilter;
24
+ export const Form = FormSchemas._Form;
25
+ export const FormInput = FormSchemas._FormInput;
26
+ export const FormFilter = FormSchemas._FormFilter;
27
27
  export const Forms = Form + FormInput + FormFilter;
28
- export const AllFormFields = FormShemas._AllFormFields;
28
+ export const AllFormFields = FormSchemas._AllFormFields;
29
29
 
30
30
  export const Organisation = OrganisationSchemas._Organisation;
31
31
  export const OrganisationInput = OrganisationSchemas._OrganisationInput;
package/package.json CHANGED
@@ -1,30 +1,30 @@
1
- {
2
- "name": "@nuffieldtechnologies/rugged-schema-types",
3
- "version": "2.1.26",
4
- "description": "Graphql schema for rugged data",
5
- "main": "dist/index.js",
6
- "keywords": [
7
- "graphql",
8
- "schema"
9
- ],
10
- "devDependencies": {
11
- "@types/chai": "^4.3.4",
12
- "@types/mocha": "^10.0.1",
13
- "chai": "^4.3.7",
14
- "mocha": "^10.2.0",
15
- "ts-node": "^10.9.1",
16
- "@typescript-eslint/eslint-plugin": "^5.48.2",
17
- "@typescript-eslint/parser": "^5.48.2",
18
- "eslint": "^8.32.0",
19
- "typescript": "^4.9.4"
20
- },
21
- "author": "Tom Edge",
22
- "license": "UNLICENSED",
23
- "scripts": {
24
- "test": "echo \"Error: no test specified\" && exit 1",
25
- "lint": "eslint \"./**/*.ts\"",
26
- "prebuild": "npm run lint",
27
- "build": "tsc",
28
- "push": "npm run build && npm publish"
29
- }
30
- }
1
+ {
2
+ "name": "@nuffieldtechnologies/rugged-schema-types",
3
+ "version": "2.1.31",
4
+ "description": "Graphql schema for rugged data",
5
+ "main": "dist/index.js",
6
+ "keywords": [
7
+ "graphql",
8
+ "schema"
9
+ ],
10
+ "devDependencies": {
11
+ "@types/chai": "^4.3.4",
12
+ "@types/mocha": "^10.0.1",
13
+ "chai": "^4.3.7",
14
+ "mocha": "^10.2.0",
15
+ "ts-node": "^10.9.1",
16
+ "@typescript-eslint/eslint-plugin": "^5.48.2",
17
+ "@typescript-eslint/parser": "^5.48.2",
18
+ "eslint": "^8.32.0",
19
+ "typescript": "^4.9.4"
20
+ },
21
+ "author": "Tom Edge",
22
+ "license": "UNLICENSED",
23
+ "scripts": {
24
+ "test": "echo \"Error: no test specified\" && exit 1",
25
+ "lint": "eslint --fix \"./**/*.ts\"",
26
+ "prebuild": "npm run lint",
27
+ "build": "tsc",
28
+ "push": "npm run build && npm publish"
29
+ }
30
+ }
package/schemas/events.ts CHANGED
@@ -1,49 +1,51 @@
1
- export const _Event = `
2
- type Event {
3
- appVersion: String,
4
- at: Float,
5
- atForHumans: String,
6
- device: String,
7
- deviceModel: String,
8
- osVersion: String,
9
- user: String,
10
- userEmail: String
11
- }
12
- `
13
-
14
- export const _EventInput = `
15
- input EventInput {
16
- appVersion: String,
17
- at: Float,
18
- atForHumans: String,
19
- device: String,
20
- deviceModel: String,
21
- osVersion: String,
22
- user: String,
23
- userEmail: String
24
- }
25
- `;
26
-
27
- export const _Events = `
28
- type Events {
29
- started: Event,
30
- updated: Event,
31
- upgraded: Event,
32
- processed: Event,
33
- submitted: Event,
34
- discarded: Event,
35
- }
36
- `;
37
-
38
- export const _EventsInput = `
39
- input EventsInput {
40
- started: EventInput,
41
- updated: EventInput,
42
- upgraded: EventInput,
43
- processed: EventInput,
44
- submitted: EventInput,
45
- discarded: EventInput,
46
- }
47
- `;
48
-
1
+ export const _Event = `
2
+ type Event {
3
+ appVersion: String,
4
+ at: Float,
5
+ atForHumans: String,
6
+ device: String,
7
+ deviceModel: String,
8
+ osVersion: String,
9
+ user: String,
10
+ userEmail: String
11
+ }
12
+ `
13
+
14
+ export const _EventInput = `
15
+ input EventInput {
16
+ appVersion: String,
17
+ at: Float,
18
+ atForHumans: String,
19
+ device: String,
20
+ deviceModel: String,
21
+ osVersion: String,
22
+ user: String,
23
+ userEmail: String
24
+ }
25
+ `;
26
+
27
+ export const _Events = `
28
+ type Events {
29
+ started: Event,
30
+ updated: Event,
31
+ upgraded: Event,
32
+ processed: Event,
33
+ submitted: Event,
34
+ discarded: Event,
35
+ reviewed: Event
36
+ }
37
+ `;
38
+
39
+ export const _EventsInput = `
40
+ input EventsInput {
41
+ started: EventInput,
42
+ updated: EventInput,
43
+ upgraded: EventInput,
44
+ processed: EventInput,
45
+ submitted: EventInput,
46
+ discarded: EventInput,
47
+ reviewed: EventInput
48
+ }
49
+ `;
50
+
49
51
  export const _AllEventFields = `{appVersion, at, atForHumans, device, deviceModel, osVersion, user, userEmail}`;
package/schemas/form.ts CHANGED
@@ -1,49 +1,49 @@
1
- export const _FormInput = `
2
-
3
- input ParamInput {
4
- name: String
5
- value: String
6
- }
7
-
8
- input FormInput {
9
- id: ID
10
- name: String
11
- key: String
12
- definition: String
13
- version: String
14
- status: String
15
- updated: String
16
- params: [ParamInput]
17
- resources: String
18
- body: String
19
- }
20
- `;
21
-
22
- export const _Form = `
23
-
24
- type Param {
25
- name: String
26
- value: String
27
- }
28
-
29
- type Form {
30
- id: ID
31
- name: String
32
- key: String
33
- definition: String
34
- version: String
35
- status: String
36
- updated: String
37
- params: [Param]
38
- resources: String
39
- body: String
40
- }
41
- `;
42
-
43
- export const _FormFilter = `
44
- input FormFilter {
45
- status: String
46
- }
47
- `;
48
-
1
+ export const _FormInput = `
2
+
3
+ input ParamInput {
4
+ name: String
5
+ value: String
6
+ }
7
+
8
+ input FormInput {
9
+ id: ID
10
+ name: String
11
+ key: String
12
+ definition: String
13
+ version: String
14
+ status: String
15
+ updated: String
16
+ params: [ParamInput]
17
+ resources: String
18
+ body: String
19
+ }
20
+ `;
21
+
22
+ export const _Form = `
23
+
24
+ type Param {
25
+ name: String
26
+ value: String
27
+ }
28
+
29
+ type Form {
30
+ id: ID
31
+ name: String
32
+ key: String
33
+ definition: String
34
+ version: String
35
+ status: String
36
+ updated: String
37
+ params: [Param]
38
+ resources: String
39
+ body: String
40
+ }
41
+ `;
42
+
43
+ export const _FormFilter = `
44
+ input FormFilter {
45
+ status: String
46
+ }
47
+ `;
48
+
49
49
  export const _AllFormFields = `{id, name, key, definition, status, updated, params {name, value}, resources, body}`;
@@ -1,17 +1,17 @@
1
- export const _OrganisationInput = `
2
- input OrganisationInput {
3
- id: ID
4
- name: String
5
- logoUrl: String
6
- }
7
- `;
8
-
9
- export const _Organisation = `
10
- type Organisation {
11
- id: ID
12
- name: String
13
- logoUrl: String
14
- }
15
- `;
16
-
1
+ export const _OrganisationInput = `
2
+ input OrganisationInput {
3
+ id: ID
4
+ name: String
5
+ logoUrl: String
6
+ }
7
+ `;
8
+
9
+ export const _Organisation = `
10
+ type Organisation {
11
+ id: ID
12
+ name: String
13
+ logoUrl: String
14
+ }
15
+ `;
16
+
17
17
  export const _AllOrganisationFields = `{id, name, logoUrl}`;
package/schemas/roles.ts CHANGED
@@ -1,20 +1,20 @@
1
- export const _Roles = `
2
- type Roles {
3
- user: Boolean
4
- admin: Boolean
5
- api: Boolean
6
- uber: Boolean
7
- super: Boolean
8
- legacyPush: Boolean
9
- }
10
- `;
11
-
12
- export const _RolesInput = `
13
- input RolesInput {
14
- user: Boolean
15
- admin: Boolean
16
- api: Boolean
17
- }
18
- `;
19
-
1
+ export const _Roles = `
2
+ type Roles {
3
+ user: Boolean
4
+ admin: Boolean
5
+ api: Boolean
6
+ uber: Boolean
7
+ super: Boolean
8
+ legacyPush: Boolean
9
+ }
10
+ `;
11
+
12
+ export const _RolesInput = `
13
+ input RolesInput {
14
+ user: Boolean
15
+ admin: Boolean
16
+ api: Boolean
17
+ }
18
+ `;
19
+
20
20
  export const _AllRolesFields = `{user, admin, api, uber, super, legacyPush}`;
@@ -1,13 +1,13 @@
1
- export const _TaskIdentifiers = `
2
- type TaskIdentifiers {
3
- primary: String
4
- secondary: String
5
- }
6
- `;
7
-
8
- export const _TaskIdentifiersInput = `
9
- input TaskIdentifiersInput {
10
- primary: String
11
- secondary: String
12
- }
1
+ export const _TaskIdentifiers = `
2
+ type TaskIdentifiers {
3
+ primary: String
4
+ secondary: String
5
+ }
6
+ `;
7
+
8
+ export const _TaskIdentifiersInput = `
9
+ input TaskIdentifiersInput {
10
+ primary: String
11
+ secondary: String
12
+ }
13
13
  `;
@@ -1,20 +1,20 @@
1
- export const _TaskOld = `
2
- type TaskOld {
3
- id: ID,
4
- name: String
5
- definition: String
6
- user: ID
7
- userEmail: String
8
- form: ID
9
- organisation: ID
10
- timestamps: TimeStamps
11
- events: Events
12
- template: TemplateInfo
13
- identifiers: TaskIdentifiers
14
- status: String
15
- fails: [String]
16
- reportUrl: String
17
- data: String
18
- refNo: String
19
- }
1
+ export const _TaskOld = `
2
+ type TaskOld {
3
+ id: ID,
4
+ name: String
5
+ definition: String
6
+ user: ID
7
+ userEmail: String
8
+ form: ID
9
+ organisation: ID
10
+ timestamps: TimeStamps
11
+ events: Events
12
+ template: TemplateInfo
13
+ identifiers: TaskIdentifiers
14
+ status: String
15
+ fails: [String]
16
+ reportUrl: String
17
+ data: String
18
+ refNo: String
19
+ }
20
20
  `;
package/schemas/task.ts CHANGED
@@ -1,78 +1,95 @@
1
- import * as Events from './events'
2
-
3
- export const _Task = `
4
- type Task {
5
- collections: String
6
- fields: String
7
- info: TaskInfo
8
- sections: String
9
- }
10
- `;
11
-
12
- export const _TaskInfo = `
13
- type TaskInfo {
14
- status: String
15
- statusBeforeEdit: String
16
- rootEntityId: String
17
- rootEntityName: String
18
- rootEntityAncestry: String
19
- id: String
20
- refNo: String
21
- tags: String
22
- workflowStep: String
23
- workflow: String
24
- workflowHistory: String
25
- name: String
26
- events: Events
27
- identifiers: TaskIdentifiers
28
- template: TemplateInfo
29
- userIds: String
30
- users: String
31
- timestamps: TimeStamps
32
- }
33
- `;
34
-
35
- export const _TaskInput = `
36
- input TaskInput {
37
- collections: String
38
- fields: String
39
- info: TaskInfoInput
40
- sections: String
41
- }
42
- `;
43
-
44
- export const _TaskInfoInput = `
45
- input TaskInfoInput {
46
- status: String
47
- statusBeforeEdit: String
48
- rootEntityId: String
49
- rootEntityAncestry: String
50
- id: String
51
- refNo: String
52
- tags: String
53
- workflowStep: String
54
- workflow: String
55
- workflowHistory: String
56
- name: String
57
- events: EventsInput
58
- identifiers: TaskIdentifiersInput
59
- template: TemplateInfoInput
60
- userIds: String
61
- users: String
62
- timestamps: TimeStampsInput
63
- }
64
- `;
65
-
66
- export const _TaskFilter = `
67
- input TaskFilter {
68
- users: [ID]
69
- userEmails: [String]
70
- rootEntityIds: [String]
71
- entityIds: [String]
72
- forms: [ID]
73
- after: String
74
- before: String
75
- }
76
- `;
77
-
78
- export const _AllTaskFields = `{collections, fields, info {status, id, rootEntityId, rootEntityName, rootEntityAncestry, name, refNo, tags, workflowHistory, workflowStep, workflow, userIds, users, timestamps {started, updated, submitted, processed, upgraded, discarded}, events {started ${Events._AllEventFields}, updated ${Events._AllEventFields}, submitted ${Events._AllEventFields}, discarded ${Events._AllEventFields}, processed ${Events._AllEventFields}, upgraded ${Events._AllEventFields}}, template { name, shortName, type, id, version}, identifiers { primary, secondary}}, sections}`;
1
+ import * as Events from './events'
2
+
3
+ export const _Task = `
4
+ type Task {
5
+ collections: String
6
+ fields: String
7
+ info: TaskInfo
8
+ sections: String
9
+ workflow: WorkflowInfo
10
+ }
11
+ `;
12
+
13
+ export const _TaskInfo = `
14
+ type TaskInfo {
15
+ status: String
16
+ statusBeforeEdit: String
17
+ rootEntityId: String
18
+ rootEntityName: String
19
+ rootEntityAncestry: String
20
+ id: String
21
+ refNo: String
22
+ tags: String
23
+ workflowStep: String
24
+ workflow: String
25
+ workflowHistory: String
26
+ name: String
27
+ events: Events
28
+ identifiers: TaskIdentifiers
29
+ template: TemplateInfo
30
+ userIds: String
31
+ users: String
32
+ timestamps: TimeStamps
33
+ }
34
+ `;
35
+ export const _WorkflowInfo = `
36
+ type WorkflowInfo {
37
+ slug: String
38
+ step: String
39
+ history: String
40
+ }
41
+ `;
42
+
43
+ export const _TaskInput = `
44
+ input TaskInput {
45
+ collections: String
46
+ fields: String
47
+ info: TaskInfoInput
48
+ sections: String,
49
+ workflow: WorkflowInfoInput
50
+ }
51
+ `;
52
+
53
+ export const _TaskInfoInput = `
54
+ input TaskInfoInput {
55
+ status: String
56
+ statusBeforeEdit: String
57
+ rootEntityId: String
58
+ rootEntityAncestry: String
59
+ id: String
60
+ refNo: String
61
+ tags: String
62
+ workflowStep: String
63
+ workflow: String
64
+ workflowHistory: String
65
+ name: String
66
+ events: EventsInput
67
+ identifiers: TaskIdentifiersInput
68
+ template: TemplateInfoInput
69
+ userIds: String
70
+ users: String
71
+ timestamps: TimeStampsInput
72
+ }
73
+ `;
74
+
75
+ export const _WorkflowInfoInput = `
76
+ input WorkflowInfoInput {
77
+ slug: String
78
+ step: String
79
+ history: String
80
+ }
81
+ `;
82
+
83
+ export const _TaskFilter = `
84
+ input TaskFilter {
85
+ users: [ID]
86
+ userEmails: [String]
87
+ rootEntityIds: [String]
88
+ entityIds: [String]
89
+ forms: [ID]
90
+ after: String
91
+ before: String
92
+ }
93
+ `;
94
+
95
+ export const _AllTaskFields = `{collections, fields, workflow {slug, step, history}, info {status, id, rootEntityId, rootEntityName, rootEntityAncestry, name, refNo, tags, workflowStep, workflow, userIds, users, timestamps {started, updated, submitted, processed, upgraded, discarded}, events {started ${Events._AllEventFields}, updated ${Events._AllEventFields}, submitted ${Events._AllEventFields}, discarded ${Events._AllEventFields}, processed ${Events._AllEventFields}, upgraded ${Events._AllEventFields}}, reviewed ${Events._AllEventFields}}, template { name, shortName, type, id, version}, identifiers { primary, secondary}}, sections}`;