stated-protocol-parser 1.0.6 → 5.0.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.
Files changed (109) hide show
  1. package/README.md +231 -22
  2. package/dist/constants.d.ts +193 -15
  3. package/dist/constants.d.ts.map +1 -1
  4. package/dist/constants.js +197 -20
  5. package/dist/constants.js.map +1 -1
  6. package/dist/esm/constants.d.ts +193 -15
  7. package/dist/esm/constants.d.ts.map +1 -1
  8. package/dist/esm/{hash.browser.d.ts → hash.d.ts} +11 -5
  9. package/dist/esm/hash.d.ts.map +1 -0
  10. package/dist/esm/index.d.ts +4 -42
  11. package/dist/esm/index.d.ts.map +1 -1
  12. package/dist/esm/index.js +2102 -641
  13. package/dist/esm/index.js.map +7 -1
  14. package/dist/esm/protocol.d.ts +30 -0
  15. package/dist/esm/protocol.d.ts.map +1 -0
  16. package/dist/esm/signature.d.ts +49 -0
  17. package/dist/esm/signature.d.ts.map +1 -0
  18. package/dist/esm/types.d.ts +26 -60
  19. package/dist/esm/types.d.ts.map +1 -1
  20. package/dist/esm/utils.d.ts +10 -0
  21. package/dist/esm/utils.d.ts.map +1 -1
  22. package/dist/{hash.browser.d.ts → hash.d.ts} +11 -5
  23. package/dist/hash.d.ts.map +1 -0
  24. package/dist/{hash.browser.js → hash.js} +44 -10
  25. package/dist/hash.js.map +1 -0
  26. package/dist/index.d.ts +4 -42
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +4 -674
  29. package/dist/index.js.map +1 -1
  30. package/dist/protocol.d.ts +30 -0
  31. package/dist/protocol.d.ts.map +1 -0
  32. package/dist/protocol.js +677 -0
  33. package/dist/protocol.js.map +1 -0
  34. package/dist/signature.d.ts +49 -0
  35. package/dist/signature.d.ts.map +1 -0
  36. package/dist/signature.js +169 -0
  37. package/dist/signature.js.map +1 -0
  38. package/dist/types.d.ts +26 -60
  39. package/dist/types.d.ts.map +1 -1
  40. package/dist/types.js +27 -0
  41. package/dist/types.js.map +1 -1
  42. package/dist/utils.d.ts +10 -0
  43. package/dist/utils.d.ts.map +1 -1
  44. package/dist/utils.js +79 -11
  45. package/dist/utils.js.map +1 -1
  46. package/package.json +25 -16
  47. package/src/constants.ts +228 -44
  48. package/src/fixtures.test.ts +236 -0
  49. package/src/hash.test.ts +217 -215
  50. package/src/hash.ts +99 -0
  51. package/src/index.ts +5 -678
  52. package/src/organisation-verification.test.ts +50 -0
  53. package/src/person-verification.test.ts +55 -0
  54. package/src/poll.test.ts +28 -0
  55. package/src/protocol.ts +871 -0
  56. package/src/rating.test.ts +25 -0
  57. package/src/signature.test.ts +200 -0
  58. package/src/signature.ts +159 -0
  59. package/src/statement.test.ts +101 -0
  60. package/src/types.ts +155 -156
  61. package/src/utils.test.ts +140 -0
  62. package/src/utils.ts +102 -16
  63. package/dist/esm/constants.js +0 -47
  64. package/dist/esm/constants.js.map +0 -1
  65. package/dist/esm/hash.browser.d.ts.map +0 -1
  66. package/dist/esm/hash.browser.js +0 -58
  67. package/dist/esm/hash.browser.js.map +0 -1
  68. package/dist/esm/hash.node.d.ts +0 -31
  69. package/dist/esm/hash.node.d.ts.map +0 -1
  70. package/dist/esm/hash.node.js +0 -43
  71. package/dist/esm/hash.node.js.map +0 -1
  72. package/dist/esm/hash.test.d.ts +0 -2
  73. package/dist/esm/hash.test.d.ts.map +0 -1
  74. package/dist/esm/hash.test.js +0 -181
  75. package/dist/esm/hash.test.js.map +0 -1
  76. package/dist/esm/index.test.d.ts +0 -2
  77. package/dist/esm/index.test.d.ts.map +0 -1
  78. package/dist/esm/index.test.js +0 -293
  79. package/dist/esm/index.test.js.map +0 -1
  80. package/dist/esm/types.js +0 -2
  81. package/dist/esm/types.js.map +0 -1
  82. package/dist/esm/utils.js +0 -23
  83. package/dist/esm/utils.js.map +0 -1
  84. package/dist/esm/v3.d.ts +0 -5
  85. package/dist/esm/v3.d.ts.map +0 -1
  86. package/dist/esm/v3.js +0 -60
  87. package/dist/esm/v3.js.map +0 -1
  88. package/dist/hash.browser.d.ts.map +0 -1
  89. package/dist/hash.browser.js.map +0 -1
  90. package/dist/hash.node.d.ts +0 -31
  91. package/dist/hash.node.d.ts.map +0 -1
  92. package/dist/hash.node.js +0 -53
  93. package/dist/hash.node.js.map +0 -1
  94. package/dist/hash.test.d.ts +0 -2
  95. package/dist/hash.test.d.ts.map +0 -1
  96. package/dist/hash.test.js +0 -183
  97. package/dist/hash.test.js.map +0 -1
  98. package/dist/index.test.d.ts +0 -2
  99. package/dist/index.test.d.ts.map +0 -1
  100. package/dist/index.test.js +0 -295
  101. package/dist/index.test.js.map +0 -1
  102. package/dist/v3.d.ts +0 -5
  103. package/dist/v3.d.ts.map +0 -1
  104. package/dist/v3.js +0 -64
  105. package/dist/v3.js.map +0 -1
  106. package/src/hash.browser.ts +0 -65
  107. package/src/hash.node.ts +0 -47
  108. package/src/index.test.ts +0 -378
  109. package/src/v3.ts +0 -62
package/src/index.test.ts DELETED
@@ -1,378 +0,0 @@
1
- import {
2
- parseRating,
3
- parseStatement,
4
- parseOrganisationVerification,
5
- parsePDFSigning,
6
- parsePersonVerification,
7
- parseDisputeAuthenticity,
8
- parseDisputeContent,
9
- parseVote,
10
- parsePoll,
11
- parseQuotation,
12
- parseBounty,
13
- parseBoycott,
14
- parseObservation,
15
- parseResponseContent,
16
- buildResponseContent,
17
- buildRating,
18
- buildStatement,
19
- buildBounty,
20
- buildDisputeAuthenticityContent,
21
- buildDisputeContentContent,
22
- buildPDFSigningContent,
23
- buildPersonVerificationContent,
24
- buildPollContent,
25
- buildQuotationContent,
26
- buildVoteContent,
27
- buildOrganisationVerificationContent,
28
- buildBoycott,
29
- buildObservation,
30
- } from './index'
31
-
32
- const randomUnicodeString = () =>
33
- Array.from({ length: 20 }, () =>
34
- String.fromCharCode(Math.floor(Math.random() * 65536))
35
- )
36
- .join('')
37
- .replace(/[\n;>=<"''\\]/g, '')
38
-
39
- test('parse statement', () => {
40
- const statement = `Publishing domain: localhost
41
- Author: chris
42
- Time: Tue, 18 Apr 2023 18:20:26 GMT
43
- Tags: hashtag1, hashtag2
44
- Format version: 4
45
- Statement content: hi
46
- `
47
- const parsedStatement = parseStatement({ statement })
48
- expect(parsedStatement.content).toBe(`hi
49
- `)
50
- })
51
-
52
- test('statement build & parse function compatibility: input=parse(build(input))', () => {
53
- const [domain, author, representative, content, supersededStatement] =
54
- Array.from({ length: 5 }, randomUnicodeString)
55
- const tags = Array.from({ length: 4 }, randomUnicodeString)
56
- const contentWithTrailingNewline =
57
- content + (content.match(/\n$/) ? '' : '\n')
58
- const time = new Date('Sun, 04 Sep 2022 14:48:50 GMT')
59
- const statementContent = buildStatement({
60
- domain,
61
- author,
62
- time,
63
- content: contentWithTrailingNewline,
64
- representative,
65
- supersededStatement,
66
- tags,
67
- })
68
- const parsedStatement = parseStatement({ statement: statementContent })
69
- expect(parsedStatement.domain).toBe(domain)
70
- expect(parsedStatement.author).toBe(author)
71
- expect(parsedStatement.time?.toUTCString()).toBe(time.toUTCString())
72
- expect(parsedStatement.content).toBe(contentWithTrailingNewline)
73
- expect(parsedStatement.representative).toBe(representative)
74
- expect(parsedStatement.supersededStatement).toBe(supersededStatement)
75
- expect(parsedStatement.tags?.sort()).toStrictEqual(tags.sort())
76
- })
77
-
78
- test('parse quotation', () => {
79
- let quotation = `Publishing domain: rixdata.net
80
- Author: Example Inc.
81
- Time: Sun, 04 Sep 2022 14:48:50 GMT
82
- Format version: 4
83
- Statement content:
84
- Type: Quotation
85
- Original author: XYZ Company Inc.
86
- Author verification: eXoVsm2CdF5Ri-SEAr33RNkG3DBuehvFoDBQ_pO9CXE
87
- Original publication time: Sun, 04 Sep 2022 14:48:50 GMT
88
- Source: https://www.facebook.com/companyxzy/posts/XXXX
89
- Picture proof: 5HKiyQXGV4xavq-Nn9RXi_ndUH-2BEux3ccFIjaSk_8
90
- Confidence: 0.9
91
- Quotation: we give example.com a 2/5 star rating
92
- Paraphrased statement:
93
- Type: Rating
94
- Organisation name: example
95
- Organisation domain: example.com
96
- Our rating: 2/5 Stars
97
- `
98
- const parsedStatement = parseStatement({ statement: quotation })
99
- const parsedQuotation = parseQuotation(parsedStatement.content)
100
- const type = parsedQuotation.type
101
- expect(type).toBe('rating')
102
- })
103
-
104
- test('quotation build & parse function compatibility: input=parse(build(input))', () => {
105
- const [originalAuthor, source, picture, quotation, paraphrasedStatement] =
106
- Array.from({ length: 6 }, randomUnicodeString)
107
- const authorVerification = 'yXoVsm2CdF5Ri-SEAr33RNkG3DBuehvFoDBQ_pO9CXE'
108
- const originalTime = 'Sun, 04 Sep 2022 14:48:50 GMT'
109
- const confidence = '' + Math.random()
110
- const quotationContent = buildQuotationContent({
111
- originalAuthor,
112
- authorVerification,
113
- originalTime,
114
- source,
115
- picture,
116
- confidence,
117
- quotation,
118
- paraphrasedStatement,
119
- })
120
- const parsedQuotation = parseQuotation(quotationContent)
121
- expect(parsedQuotation.originalAuthor).toBe(originalAuthor)
122
- expect(parsedQuotation.originalTime).toBe(originalTime)
123
- expect(parsedQuotation.source).toBe(source)
124
- expect(parsedQuotation.picture).toBe(picture)
125
- expect(parsedQuotation.confidence).toBe(confidence)
126
- expect(parsedQuotation.quotation).toBe(quotation)
127
- expect(parsedQuotation.paraphrasedStatement?.replace(/\n$/, '')).toBe(
128
- paraphrasedStatement
129
- )
130
- expect(parsedQuotation.authorVerification).toBe(authorVerification)
131
- })
132
-
133
- test('parse organisation verification', () => {
134
- let organisationVerification = `Publishing domain: rixdata.net
135
- Author: Example Inc.
136
- Time: Sun, 04 Sep 2022 14:48:50 GMT
137
- Format version: 4
138
- Statement content:
139
- Type: Organisation verification
140
- Description: We verified the following information about an organisation.
141
- Name: Walmart Inc.
142
- Country: United States of America
143
- Legal entity: corporation
144
- Owner of the domain: walmart.com
145
- Province or state: Arkansas
146
- City: Bentonville
147
- `
148
- const parsedStatement = parseStatement({
149
- statement: organisationVerification,
150
- })
151
- const parsedOVerification = parseOrganisationVerification(
152
- parsedStatement.content
153
- )
154
- const name = parsedOVerification.name
155
- expect(name).toBe('Walmart Inc.')
156
- })
157
-
158
- test('organisation verification build & parse function compatibility: input=parse(build(input))', () => {
159
- const [
160
- name,
161
- englishName,
162
- city,
163
- domain,
164
- foreignDomain,
165
- serialNumber,
166
- reliabilityPolicy,
167
- pictureHash,
168
- ] = Array.from({ length: 8 }, randomUnicodeString)
169
- const country = 'Germany'
170
- const province = 'Bayern'
171
- const legalForm = 'corporation'
172
- const employeeCount = '100-1000'
173
- const confidence = 0.8
174
- const verificationContent = buildOrganisationVerificationContent({
175
- name,
176
- englishName,
177
- country,
178
- city,
179
- province,
180
- legalForm,
181
- domain,
182
- pictureHash,
183
- foreignDomain,
184
- serialNumber,
185
- confidence,
186
- reliabilityPolicy,
187
- employeeCount,
188
- })
189
- const parsedVerification =
190
- parseOrganisationVerification(verificationContent)
191
- expect(parsedVerification.name).toBe(name)
192
- expect(parsedVerification.englishName).toBe(englishName)
193
- expect(parsedVerification.country).toBe(country)
194
- expect(parsedVerification.city).toBe(city)
195
- expect(parsedVerification.province).toBe(province)
196
- expect(parsedVerification.legalForm).toBe(legalForm)
197
- expect(parsedVerification.domain).toBe(domain)
198
- expect(parsedVerification.foreignDomain).toBe(foreignDomain)
199
- expect(parsedVerification.serialNumber).toBe(serialNumber)
200
- expect(parsedVerification.confidence).toBe(confidence)
201
- expect(parsedVerification.pictureHash).toBe(pictureHash)
202
- expect(parsedVerification.reliabilityPolicy).toBe(reliabilityPolicy)
203
- expect(parsedVerification.employeeCount).toBe(employeeCount)
204
- })
205
-
206
- test('parse person verification', () => {
207
- let personVerification = `Publishing domain: rixdata.net
208
- Author: Example Inc.
209
- Time: Sun, 04 Sep 2022 14:48:50 GMT
210
- Format version: 4
211
- Statement content:
212
- Type: Person verification
213
- Description: We verified the following information about a person.
214
- Name: Barack Hossein Obama II
215
- Date of birth: 4 Aug 1961
216
- City of birth: Honolulu
217
- Country of birth: United States of America
218
- Owner of the domain: barackobama.com
219
- `
220
- const parsedStatement = parseStatement({ statement: personVerification })
221
- const parsedPVerification = parsePersonVerification(parsedStatement.content)
222
- const name = parsedPVerification.name
223
- expect(name).toBe('Barack Hossein Obama II')
224
- })
225
-
226
- test('person verification build & parse function compatibility: input=parse(build(input))', () => {
227
- const [
228
- name,
229
- ownDomain,
230
- foreignDomain,
231
- jobTitle,
232
- employer,
233
- verificationMethod,
234
- picture,
235
- reliabilityPolicy,
236
- ] = Array.from({ length: 12 }, randomUnicodeString)
237
- const countryOfBirth = 'Germany'
238
- const cityOfBirth = 'Berlin'
239
- const confidence = Math.random()
240
- const dateOfBirth = new Date(0)
241
- const personVerificationContent = buildPersonVerificationContent({
242
- name,
243
- countryOfBirth,
244
- cityOfBirth,
245
- ownDomain,
246
- foreignDomain,
247
- dateOfBirth,
248
- jobTitle,
249
- employer,
250
- verificationMethod,
251
- confidence,
252
- picture,
253
- reliabilityPolicy,
254
- })
255
-
256
- const parsedVerification = parsePersonVerification(
257
- personVerificationContent
258
- )
259
- expect(parsedVerification.name).toBe(name)
260
- expect(parsedVerification.ownDomain).toBe(ownDomain)
261
- expect(parsedVerification.foreignDomain).toBe(foreignDomain)
262
- expect(parsedVerification.dateOfBirth.toUTCString()).toBe(
263
- dateOfBirth.toUTCString()
264
- )
265
- expect(parsedVerification.jobTitle).toBe(jobTitle)
266
- expect(parsedVerification.employer).toBe(employer)
267
- expect(parsedVerification.verificationMethod).toBe(verificationMethod)
268
- expect(parsedVerification.confidence).toBe(confidence)
269
- expect(parsedVerification.picture).toBe(picture)
270
- expect(parsedVerification.reliabilityPolicy).toBe(reliabilityPolicy)
271
- expect(parsedVerification.countryOfBirth).toBe(countryOfBirth)
272
- expect(parsedVerification.cityOfBirth).toBe(cityOfBirth)
273
- })
274
-
275
- test('parse rating', () => {
276
- let rating = `Publishing domain: localhost
277
- Author: chris
278
- Time: Tue, 18 Apr 2023 18:20:26 GMT
279
- Format version: 4
280
- Statement content:
281
- Type: Rating
282
- Subject name: AMBOSS GmbH
283
- URL that identifies the subject: amboss.com
284
- Rated quality: AI safety
285
- Our rating: 5/5 Stars
286
- `
287
- const parsedStatement = parseStatement({ statement: rating })
288
- const parsedRating = parseRating(parsedStatement.content)
289
- const ratingNumber = parsedRating.rating
290
- expect(ratingNumber).toBe(5)
291
- const subjectName = parsedRating.subjectName
292
- expect(subjectName).toBe('AMBOSS GmbH')
293
- const subjectReference = parsedRating.subjectReference
294
- expect(subjectReference).toBe('amboss.com')
295
- const quality = parsedRating.quality
296
- expect(quality).toBe('AI safety')
297
- })
298
-
299
- test('rating build & parse function compatibility: input=parse(build(input))', () => {
300
- const [subjectName, subjectReference, comment, quality] = Array.from(
301
- { length: 4 },
302
- randomUnicodeString
303
- )
304
- const rating = Math.ceil(Math.random() * 5)
305
- const ratingContent = buildRating({ subjectName, subjectReference, rating, comment, quality })
306
- const parsedRating = parseRating(ratingContent)
307
- expect(parsedRating.subjectName).toBe(subjectName)
308
- expect(parsedRating.subjectReference).toBe(subjectReference)
309
- expect(parsedRating.quality).toBe(quality)
310
- expect(parsedRating.rating).toBe(rating)
311
- expect(parsedRating.comment).toBe(comment)
312
- })
313
-
314
- test('parse poll v4', () => {
315
- let poll = `Publishing domain: rixdata.net
316
- Author: Example Inc.
317
- Time: Thu, 17 Nov 2022 13:38:20 GMT
318
- Format version: 4
319
- Statement content:
320
- Type: Poll
321
- The poll outcome is finalized when the following nodes agree: rixdata.net
322
- Voting deadline: Thu, 01 Dec 2022 13:38:26 GMT
323
- Poll: Should the UK join the EU
324
- Option 1: Yes
325
- Option 2: No
326
- Who can vote:
327
- Description: All universities with a ROR ID
328
- Legal form scope: corporation
329
- All entities with the following property: ROR ID
330
- As observed by: Rix Data NL B.V.@rixdata.net
331
- Link to query defining who can vote: https://stated.rixdata.net/?search_query=%09Observed%20property:%20ROR%20ID%0A%09&domain=rixdata.net&author=Rix%20Data%20NL%20B.V.
332
- `
333
- const parsedStatement = parseStatement({ statement: poll })
334
- const parsedPoll = parsePoll(parsedStatement.content)
335
- const pollTitle = parsedPoll.poll
336
- expect(pollTitle).toBe('Should the UK join the EU')
337
- expect(parsedPoll.options[0]).toBe('Yes')
338
- expect(parsedPoll.options[1]).toBe('No')
339
- expect(parsedPoll.deadline?.toUTCString()).toBe(
340
- 'Thu, 01 Dec 2022 13:38:26 GMT'
341
- )
342
- expect(parsedPoll.scopeDescription).toBe('All universities with a ROR ID')
343
- expect(parsedPoll.legalEntity).toBe('corporation')
344
- expect(parsedPoll.requiredProperty).toBe('ROR ID')
345
- expect(parsedPoll.requiredPropertyObserver).toBe(
346
- 'Rix Data NL B.V.@rixdata.net'
347
- )
348
- expect(parsedPoll.scopeQueryLink).toBe(
349
- 'https://stated.rixdata.net/?search_query=%09Observed%20property:%20ROR%20ID%0A%09&domain=rixdata.net&author=Rix%20Data%20NL%20B.V.'
350
- )
351
- })
352
-
353
- test('poll build & parse function compatibility: input=parse(build(input))', () => {
354
- const [country, city, legalEntity, judges, poll, scopeDescription] =
355
- Array.from({ length: 6 }, randomUnicodeString)
356
- const options = Array.from({ length: 2 }, randomUnicodeString)
357
- const domainScope = ['rixdata.net']
358
- const deadline = new Date('Thu, 01 Dec 2022 13:38:26 GMT')
359
- const pollContent = buildPollContent({
360
- country,
361
- city,
362
- legalEntity,
363
- domainScope,
364
- judges,
365
- deadline,
366
- poll,
367
- options,
368
- scopeDescription,
369
- })
370
- const parsedPoll = parsePoll(pollContent)
371
- expect(parsedPoll.poll).toBe(poll)
372
- expect(parsedPoll.country).toBe(country)
373
- expect(parsedPoll.legalEntity).toBe(legalEntity)
374
- expect(parsedPoll.judges).toBe(judges)
375
- expect(parsedPoll.deadline?.toUTCString()).toBe(deadline.toUTCString())
376
- expect(parsedPoll.options[0]).toEqual(options[0])
377
- expect(parsedPoll.options[1]).toEqual(options[1])
378
- })
package/src/v3.ts DELETED
@@ -1,62 +0,0 @@
1
- import { UTCFormat } from './constants'
2
- import { Poll } from './types'
3
-
4
- export const parsePollV3 = (s: string, version?: string): Poll & { pollType: string } => {
5
- const pollRegex = new RegExp(''
6
- + /^\n\tType: Poll\n/.source
7
- + /(?:\tPoll type: (?<pollType>[^\n]+?)\n)?/.source
8
- + /(?:\tWho can vote: (?<scopeDescription>[^\n]+?)\n)?/.source
9
- + /(?:\tLink to query defining who can vote: (?<scopeQueryLink>[^\n]+?)\n)?/.source
10
- + /(?:\tCountry scope: (?<country>[^\n]+?)\n)?/.source
11
- + /(?:\tCity scope: (?<city>[^\n]+?)\n)?/.source
12
- + /(?:\tLegal form scope: (?<legalEntity>[^\n]+?)\n)?/.source
13
- + /(?:\tDomain scope: (?<domainScope>[^\n]+?)\n)?/.source
14
- + /(?:\tThe decision is finalized when the following nodes agree: (?<judges>[^\n]+?)\n)?/.source
15
- + /(?:\tVoting deadline: (?<deadline>[^\n]+?)\n)?/.source
16
- + /\tPoll: (?<poll>[^\n]+?)\n/.source
17
- + /(?:\tOption 1: (?<option1>[^\n]+?)\n)?/.source
18
- + /(?:\tOption 2: (?<option2>[^\n]+?)\n)?/.source
19
- + /(?:\tOption 3: (?<option3>[^\n]+?)\n)?/.source
20
- + /(?:\tOption 4: (?<option4>[^\n]+?)\n)?/.source
21
- + /(?:\tOption 5: (?<option5>[^\n]+?)\n)?/.source
22
- + /$/.source)
23
- const match = s.match(pollRegex)
24
- if (!match) throw new Error("Invalid poll format: " + s)
25
-
26
- const m = {
27
- pollType: match[1],
28
- scopeDescription: match[2],
29
- scopeQueryLink: match[3],
30
- country: match[4],
31
- city: match[5],
32
- legalEntity: match[6],
33
- domainScope: match[7],
34
- judges: match[8],
35
- deadline: match[9],
36
- poll: match[10],
37
- option1: match[11],
38
- option2: match[12],
39
- option3: match[13],
40
- option4: match[14],
41
- option5: match[15]
42
- }
43
-
44
- const options = [m.option1, m.option2, m.option3, m.option4, m.option5].filter(o => o)
45
- const domainScope = m.domainScope?.split(', ')
46
- const deadlineStr = m.deadline
47
- if (!deadlineStr.match(UTCFormat)) throw new Error("Invalid poll, deadline must be in UTC: " + deadlineStr)
48
-
49
- return {
50
- pollType: m['pollType'],
51
- country: m['country'],
52
- scopeDescription: m['scopeDescription'],
53
- scopeQueryLink: m['scopeQueryLink'],
54
- city: m['city'],
55
- legalEntity: m['legalEntity'],
56
- domainScope: (domainScope && domainScope.length > 0) ? domainScope : undefined,
57
- judges: m['judges'],
58
- deadline: new Date(deadlineStr),
59
- poll: m['poll'],
60
- options
61
- }
62
- }