@digdir/dialogporten-schema 1.7.1 → 1.8.1-2a6fe0f

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 CHANGED
@@ -1,10 +1,22 @@
1
1
  {
2
2
  "name": "@digdir/dialogporten-schema",
3
- "version": "1.7.1",
3
+ "version": "1.8.1-2a6fe0f",
4
4
  "description": "GraphQl schema and OpenAPI spec for Dialogporten",
5
5
  "author": "DigDir",
6
+ "main": "src/index.js",
6
7
  "repository": {
7
8
  "url": "git+https://github.com/digdir/dialogporten.git"
8
9
  },
9
- "license": "ISC"
10
+ "scripts": {
11
+ "build": "./gql-to-js.js",
12
+ "prepublishOnly": "npm run build",
13
+ "test": "npm run build && vitest run --test-timeout=10000"
14
+ },
15
+ "devDependencies": {
16
+ "vitest": "^1.2.2",
17
+ "glob": "^10.3.12",
18
+ "graphql-tag": "^2.12.6"
19
+ },
20
+ "license": "ISC",
21
+ "type": "module"
10
22
  }
@@ -16,17 +16,21 @@ type Activity {
16
16
  extendedType: URL
17
17
  type: ActivityType!
18
18
  relatedActivityId: UUID
19
- dialogElementId: UUID
20
- performedBy: [Localization!]
19
+ performedBy: Actor!
21
20
  description: [Localization!]!
22
21
  }
23
22
 
23
+ type Actor {
24
+ actorType: ActorType
25
+ actorId: String
26
+ actorName: String
27
+ }
28
+
24
29
  type ApiAction {
25
30
  id: UUID!
26
31
  action: String!
27
32
  authorizationAttribute: String
28
33
  isAuthorized: Boolean!
29
- dialogElementId: UUID
30
34
  endpoints: [ApiActionEndpoint!]!
31
35
  }
32
36
 
@@ -42,6 +46,18 @@ type ApiActionEndpoint {
42
46
  sunsetAt: DateTime
43
47
  }
44
48
 
49
+ type Attachment {
50
+ id: UUID!
51
+ displayName: [Localization!]!
52
+ urls: [AttachmentUrl!]!
53
+ }
54
+
55
+ type AttachmentUrl {
56
+ id: UUID!
57
+ url: URL!
58
+ consumerType: AttachmentUrlConsumer!
59
+ }
60
+
45
61
  type AuthorizedParty {
46
62
  party: String!
47
63
  name: String!
@@ -57,6 +73,7 @@ type AuthorizedParty {
57
73
  type Content {
58
74
  type: ContentType!
59
75
  value: [Localization!]!
76
+ mediaType: String
60
77
  }
61
78
 
62
79
  type Dialog {
@@ -77,7 +94,7 @@ type Dialog {
77
94
  dialogToken: String
78
95
  status: DialogStatus!
79
96
  content: [Content!]!
80
- elements: [Element!]!
97
+ attachments: [Attachment!]!
81
98
  guiActions: [GuiAction!]!
82
99
  apiActions: [ApiAction!]!
83
100
  activities: [Activity!]!
@@ -101,39 +118,22 @@ type DialogByIdPayload {
101
118
  errors: [DialogByIdError!]!
102
119
  }
103
120
 
104
- type Element {
105
- id: UUID!
106
- type: URL
107
- externalReference: String
108
- authorizationAttribute: String
109
- isAuthorized: Boolean!
110
- relatedDialogElementId: UUID
111
- displayName: [Localization!]!
112
- urls: [ElementUrl!]!
113
- }
114
-
115
- type ElementUrl {
116
- id: UUID!
117
- url: URL!
118
- mimeType: String
119
- consumerType: ElementUrlConsumer!
120
- }
121
-
122
121
  type GuiAction {
123
122
  id: UUID!
124
123
  action: String!
125
124
  url: URL!
126
125
  authorizationAttribute: String
127
126
  isAuthorized: Boolean!
128
- isBackChannel: Boolean!
129
- isDeleteAction: Boolean!
127
+ isDeleteDialogAction: Boolean!
130
128
  priority: GuiActionPriority!
129
+ httpMethod: HttpVerb!
131
130
  title: [Localization!]!
131
+ prompt: [Localization!]
132
132
  }
133
133
 
134
134
  type Localization {
135
135
  value: String!
136
- cultureCode: String!
136
+ languageCode: String!
137
137
  }
138
138
 
139
139
  type Queries @authorize(policy: "enduser") {
@@ -179,8 +179,7 @@ type SearchDialogsPayload {
179
179
  type SeenLog {
180
180
  id: UUID!
181
181
  seenAt: DateTime!
182
- endUserIdHash: String!
183
- endUserName: String
182
+ seenBy: Actor!
184
183
  isCurrentEndUser: Boolean!
185
184
  }
186
185
 
@@ -211,8 +210,8 @@ input SearchDialogInput {
211
210
  dueBefore: DateTime
212
211
  "Search string for free text search. Will attempt to fuzzily match in all free text fields in the aggregate"
213
212
  search: String
214
- "Limit free text search to texts with this culture code, e.g. \"nb-NO\". Default: search all culture codes"
215
- searchCultureCode: String
213
+ "Limit free text search to texts with this language code, e.g. 'no', 'en'. Culture codes will be normalized to neutral language codes (ISO 639). Default: search all culture codes"
214
+ searchLanguageCode: String
216
215
  }
217
216
 
218
217
  enum ActivityType {
@@ -230,40 +229,46 @@ enum ActivityType {
230
229
  FORWARDED
231
230
  }
232
231
 
232
+ enum ActorType {
233
+ PARTY_REPRESENTATIVE
234
+ SERVICE_OWNER
235
+ }
236
+
233
237
  enum ApplyPolicy {
234
238
  BEFORE_RESOLVER
235
239
  AFTER_RESOLVER
236
240
  VALIDATION
237
241
  }
238
242
 
243
+ enum AttachmentUrlConsumer {
244
+ GUI
245
+ API
246
+ }
247
+
239
248
  enum ContentType {
240
249
  TITLE
241
250
  SENDER_NAME
242
251
  SUMMARY
243
252
  ADDITIONAL_INFO
244
253
  EXTENDED_STATUS
254
+ MAIN_CONTENT_REFERENCE
245
255
  }
246
256
 
247
257
  enum DialogStatus {
248
- "New"
258
+ "The dialogue is considered new. Typically used for simple messages that do not require any interaction, or as an initial step for dialogues. This is the default."
249
259
  NEW
250
- "In progress. General status used for dialog services where further user input is expected."
260
+ "Started. In a serial process, this is used to indicate that, for example, a form filling is ongoing."
251
261
  IN_PROGRESS
252
- "Waiting for feedback from the service provider"
253
- WAITING
254
- "The dialog is in a state where it is waiting for signing. Typically the last step after all completion is carried out and validated."
262
+ "Equivalent to \"InProgress\", but will be used by the workspace\/frontend for display purposes."
255
263
  SIGNING
256
- "The dialog was cancelled. This typically removes the dialog from normal GUI views."
257
- CANCELLED
258
- "The dialog was completed. This typically moves the dialog to a GUI archive or similar."
264
+ "For processing by the service owner. In a serial process, this is used after a submission is made."
265
+ PROCESSING
266
+ "Used to indicate that the dialogue is in progress\/under work, but is in a state where the user must do something - for example, correct an error, or other conditions that hinder further processing."
267
+ REQUIRES_ATTENTION
268
+ "The dialogue was completed. This typically means that the dialogue is moved to a GUI archive or similar."
259
269
  COMPLETED
260
270
  }
261
271
 
262
- enum ElementUrlConsumer {
263
- GUI
264
- API
265
- }
266
-
267
272
  enum GuiActionPriority {
268
273
  PRIMARY
269
274
  SECONDARY
package/src/index.js ADDED
@@ -0,0 +1,297 @@
1
+ export const schema_verified_graphql = `schema {
2
+ query: Queries
3
+ }
4
+
5
+ interface DialogByIdError {
6
+ message: String!
7
+ }
8
+
9
+ interface SearchDialogError {
10
+ message: String!
11
+ }
12
+
13
+ type Activity {
14
+ id: UUID!
15
+ createdAt: DateTime
16
+ extendedType: URL
17
+ type: ActivityType!
18
+ relatedActivityId: UUID
19
+ performedBy: Actor!
20
+ description: [Localization!]!
21
+ }
22
+
23
+ type Actor {
24
+ actorType: ActorType
25
+ actorId: String
26
+ actorName: String
27
+ }
28
+
29
+ type ApiAction {
30
+ id: UUID!
31
+ action: String!
32
+ authorizationAttribute: String
33
+ isAuthorized: Boolean!
34
+ endpoints: [ApiActionEndpoint!]!
35
+ }
36
+
37
+ type ApiActionEndpoint {
38
+ id: UUID!
39
+ version: String
40
+ url: URL!
41
+ httpMethod: HttpVerb!
42
+ documentationUrl: URL
43
+ requestSchema: URL
44
+ responseSchema: URL
45
+ deprecated: Boolean!
46
+ sunsetAt: DateTime
47
+ }
48
+
49
+ type Attachment {
50
+ id: UUID!
51
+ displayName: [Localization!]!
52
+ urls: [AttachmentUrl!]!
53
+ }
54
+
55
+ type AttachmentUrl {
56
+ id: UUID!
57
+ url: URL!
58
+ consumerType: AttachmentUrlConsumer!
59
+ }
60
+
61
+ type AuthorizedParty {
62
+ party: String!
63
+ name: String!
64
+ partyType: String!
65
+ isDeleted: Boolean!
66
+ hasKeyRole: Boolean!
67
+ isMainAdministrator: Boolean!
68
+ isAccessManager: Boolean!
69
+ hasOnlyAccessToSubParties: Boolean!
70
+ subParties: [AuthorizedParty!]
71
+ }
72
+
73
+ type Content {
74
+ type: ContentType!
75
+ value: [Localization!]!
76
+ mediaType: String
77
+ }
78
+
79
+ type Dialog {
80
+ id: UUID!
81
+ revision: UUID!
82
+ org: String!
83
+ serviceResource: String!
84
+ serviceResourceType: String!
85
+ party: String!
86
+ progress: Int
87
+ extendedStatus: String
88
+ externalReference: String
89
+ visibleFrom: DateTime
90
+ dueAt: DateTime
91
+ expiresAt: DateTime
92
+ createdAt: DateTime!
93
+ updatedAt: DateTime!
94
+ dialogToken: String
95
+ status: DialogStatus!
96
+ content: [Content!]!
97
+ attachments: [Attachment!]!
98
+ guiActions: [GuiAction!]!
99
+ apiActions: [ApiAction!]!
100
+ activities: [Activity!]!
101
+ seenSinceLastUpdate: [SeenLog!]!
102
+ }
103
+
104
+ type DialogByIdDeleted implements DialogByIdError {
105
+ message: String!
106
+ }
107
+
108
+ type DialogByIdForbidden implements DialogByIdError {
109
+ message: String!
110
+ }
111
+
112
+ type DialogByIdNotFound implements DialogByIdError {
113
+ message: String!
114
+ }
115
+
116
+ type DialogByIdPayload {
117
+ dialog: Dialog
118
+ errors: [DialogByIdError!]!
119
+ }
120
+
121
+ type GuiAction {
122
+ id: UUID!
123
+ action: String!
124
+ url: URL!
125
+ authorizationAttribute: String
126
+ isAuthorized: Boolean!
127
+ isDeleteDialogAction: Boolean!
128
+ priority: GuiActionPriority!
129
+ httpMethod: HttpVerb!
130
+ title: [Localization!]!
131
+ prompt: [Localization!]
132
+ }
133
+
134
+ type Localization {
135
+ value: String!
136
+ languageCode: String!
137
+ }
138
+
139
+ type Queries @authorize(policy: "enduser") {
140
+ dialogById(dialogId: UUID!): DialogByIdPayload!
141
+ searchDialogs(input: SearchDialogInput!): SearchDialogsPayload!
142
+ parties: [AuthorizedParty!]!
143
+ }
144
+
145
+ type SearchDialog {
146
+ id: UUID!
147
+ org: String!
148
+ serviceResource: String!
149
+ serviceResourceType: String!
150
+ party: String!
151
+ progress: Int
152
+ guiAttachmentCount: Int
153
+ extendedStatus: String
154
+ createdAt: DateTime!
155
+ updatedAt: DateTime!
156
+ dueAt: DateTime
157
+ status: DialogStatus!
158
+ latestActivity: Activity
159
+ content: [Content!]!
160
+ seenSinceLastUpdate: [SeenLog!]!
161
+ }
162
+
163
+ type SearchDialogForbidden implements SearchDialogError {
164
+ message: String!
165
+ }
166
+
167
+ type SearchDialogValidationError implements SearchDialogError {
168
+ message: String!
169
+ }
170
+
171
+ type SearchDialogsPayload {
172
+ items: [SearchDialog!]
173
+ hasNextPage: Boolean!
174
+ continuationToken: String
175
+ orderBy: String
176
+ errors: [SearchDialogError!]!
177
+ }
178
+
179
+ type SeenLog {
180
+ id: UUID!
181
+ seenAt: DateTime!
182
+ seenBy: Actor!
183
+ isCurrentEndUser: Boolean!
184
+ }
185
+
186
+ input SearchDialogInput {
187
+ "Filter by one or more service owner codes"
188
+ org: [String!]
189
+ "Filter by one or more service resources"
190
+ serviceResource: [String!]
191
+ "Filter by one or more owning parties"
192
+ party: [String!]
193
+ "Filter by one or more extended statuses"
194
+ extendedStatus: [String!]
195
+ "Filter by external reference"
196
+ externalReference: String
197
+ "Filter by status"
198
+ status: [DialogStatus!]
199
+ "Only return dialogs created after this date"
200
+ createdAfter: DateTime
201
+ "Only return dialogs created before this date"
202
+ createdBefore: DateTime
203
+ "Only return dialogs updated after this date"
204
+ updatedAfter: DateTime
205
+ "Only return dialogs updated before this date"
206
+ updatedBefore: DateTime
207
+ "Only return dialogs with due date after this date"
208
+ dueAfter: DateTime
209
+ "Only return dialogs with due date before this date"
210
+ dueBefore: DateTime
211
+ "Search string for free text search. Will attempt to fuzzily match in all free text fields in the aggregate"
212
+ search: String
213
+ "Limit free text search to texts with this language code, e.g. 'no', 'en'. Culture codes will be normalized to neutral language codes (ISO 639). Default: search all culture codes"
214
+ searchLanguageCode: String
215
+ }
216
+
217
+ enum ActivityType {
218
+ "Refers to a submission made by a party that has been received by the service provider."
219
+ SUBMISSION
220
+ "Indicates feedback from the service provider on a submission. Contains a reference to the current submission."
221
+ FEEDBACK
222
+ "Information from the service provider, not (directly) related to any submission."
223
+ INFORMATION
224
+ "Used to indicate an error situation, typically on a submission. Contains a service-specific activityErrorCode."
225
+ ERROR
226
+ "Indicates that the dialog is closed for further changes. This typically happens when the dialog is completed or deleted."
227
+ CLOSED
228
+ "When the dialog is forwarded (delegated access) by someone with access to others."
229
+ FORWARDED
230
+ }
231
+
232
+ enum ActorType {
233
+ PARTY_REPRESENTATIVE
234
+ SERVICE_OWNER
235
+ }
236
+
237
+ enum ApplyPolicy {
238
+ BEFORE_RESOLVER
239
+ AFTER_RESOLVER
240
+ VALIDATION
241
+ }
242
+
243
+ enum AttachmentUrlConsumer {
244
+ GUI
245
+ API
246
+ }
247
+
248
+ enum ContentType {
249
+ TITLE
250
+ SENDER_NAME
251
+ SUMMARY
252
+ ADDITIONAL_INFO
253
+ EXTENDED_STATUS
254
+ MAIN_CONTENT_REFERENCE
255
+ }
256
+
257
+ enum DialogStatus {
258
+ "The dialogue is considered new. Typically used for simple messages that do not require any interaction, or as an initial step for dialogues. This is the default."
259
+ NEW
260
+ "Started. In a serial process, this is used to indicate that, for example, a form filling is ongoing."
261
+ IN_PROGRESS
262
+ "Equivalent to 'InProgress', but will be used by the workspace\/frontend for display purposes."
263
+ SIGNING
264
+ "For processing by the service owner. In a serial process, this is used after a submission is made."
265
+ PROCESSING
266
+ "Used to indicate that the dialogue is in progress\/under work, but is in a state where the user must do something - for example, correct an error, or other conditions that hinder further processing."
267
+ REQUIRES_ATTENTION
268
+ "The dialogue was completed. This typically means that the dialogue is moved to a GUI archive or similar."
269
+ COMPLETED
270
+ }
271
+
272
+ enum GuiActionPriority {
273
+ PRIMARY
274
+ SECONDARY
275
+ TERTIARY
276
+ }
277
+
278
+ enum HttpVerb {
279
+ GET
280
+ POST
281
+ PUT
282
+ PATCH
283
+ DELETE
284
+ HEAD
285
+ OPTIONS
286
+ TRACE
287
+ CONNECT
288
+ }
289
+
290
+ directive @authorize("The name of the authorization policy that determines access to the annotated resource." policy: String "Roles that are allowed to access the annotated resource." roles: [String!] "Defines when when the authorize directive shall be applied.By default the authorize directives are applied during the validation phase." apply: ApplyPolicy! = BEFORE_RESOLVER) repeatable on OBJECT | FIELD_DEFINITION
291
+
292
+ "The 'DateTime' scalar represents an ISO-8601 compliant date time type."
293
+ scalar DateTime @specifiedBy(url: "https:\/\/www.graphql-scalars.com\/date-time")
294
+
295
+ scalar URL @specifiedBy(url: "https:\/\/tools.ietf.org\/html\/rfc3986")
296
+
297
+ scalar UUID @specifiedBy(url: "https:\/\/tools.ietf.org\/html\/rfc4122")`