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
@@ -1,4 +1,10 @@
1
- export type StatementTypeValue = 'statement' | 'quotation' | 'organisation_verification' | 'person_verification' | 'poll' | 'vote' | 'response' | 'dispute_statement_content' | 'dispute_statement_authenticity' | 'boycott' | 'observation' | 'rating' | 'sign_pdf' | 'bounty';
1
+ import type { SupportedLanguage } from './constants';
2
+ export type LegalForm = 'local government' | 'state government' | 'foreign affairs ministry' | 'corporation';
3
+ export type PeopleCountBucket = '0-10' | '10-100' | '100-1000' | '1000-10,000' | '10,000-100,000' | '100,000+' | '1,000,000+' | '10,000,000+';
4
+ export declare function isLegalForm(value: string): value is LegalForm;
5
+ export declare function isPeopleCountBucket(value: string): value is PeopleCountBucket;
6
+ export declare function isRatingValue(value: number): value is RatingValue;
7
+ export type StatementTypeValue = 'statement' | 'organisation_verification' | 'person_verification' | 'poll' | 'vote' | 'response' | 'dispute_statement_content' | 'dispute_statement_authenticity' | 'rating' | 'sign_pdf';
2
8
  export type Statement = {
3
9
  domain: string;
4
10
  author: string;
@@ -8,52 +14,42 @@ export type Statement = {
8
14
  representative?: string;
9
15
  supersededStatement?: string;
10
16
  formatVersion?: string;
17
+ translations?: Partial<Record<SupportedLanguage, string>>;
18
+ attachments?: string[];
11
19
  };
12
- export type Quotation = {
13
- originalAuthor: string;
14
- authorVerification: string;
15
- originalTime?: string;
16
- source?: string;
17
- quotation?: string;
18
- paraphrasedStatement?: string;
19
- picture?: string;
20
- confidence?: string;
20
+ export type CryptographicallySignedStatement = {
21
+ statement: string;
22
+ statementHash: string;
23
+ publicKey: string;
24
+ signature: string;
25
+ algorithm: string;
21
26
  };
22
27
  export type Poll = {
23
- country: string | undefined;
24
- city: string | undefined;
25
- legalEntity: string | undefined;
26
- domainScope: string[] | undefined;
27
- judges?: string;
28
28
  deadline: Date | undefined;
29
29
  poll: string;
30
30
  scopeDescription?: string;
31
- scopeQueryLink?: string;
32
31
  options: string[];
33
32
  allowArbitraryVote?: boolean;
34
- requiredProperty?: string;
35
- requiredPropertyValue?: string;
36
- requiredPropertyObserver?: string;
37
- requiredMinConfidence?: number;
38
33
  };
39
34
  export type OrganisationVerification = {
40
35
  name: string;
41
36
  englishName?: string;
42
37
  country: string;
43
- city: string;
44
- province: string;
45
- legalForm: string;
38
+ city?: string;
39
+ province?: string;
40
+ legalForm: LegalForm;
46
41
  department?: string;
47
42
  domain: string;
48
- foreignDomain: string;
49
- serialNumber: string;
43
+ foreignDomain?: string;
44
+ serialNumber?: string;
50
45
  confidence?: number;
51
46
  reliabilityPolicy?: string;
52
- employeeCount?: string;
47
+ employeeCount?: PeopleCountBucket;
53
48
  pictureHash?: string;
54
49
  latitude?: number;
55
50
  longitude?: number;
56
- population?: string;
51
+ population?: PeopleCountBucket;
52
+ publicKey?: string;
57
53
  };
58
54
  export type withOwnDomain = {
59
55
  ownDomain: string;
@@ -74,6 +70,7 @@ export type PersonVerification = {
74
70
  confidence?: number;
75
71
  picture?: string;
76
72
  reliabilityPolicy?: string;
73
+ publicKey?: string;
77
74
  } & (withOwnDomain | withForeignDomain);
78
75
  export type Vote = {
79
76
  pollHash: string;
@@ -98,12 +95,13 @@ export type PDFSigning = {
98
95
  hash: string;
99
96
  };
100
97
  export type RatingSubjectTypeValue = 'Organisation' | 'Policy proposal' | 'Treaty draft' | 'Research publication' | 'Regulation' | 'Product';
98
+ export type RatingValue = 1 | 2 | 3 | 4 | 5;
101
99
  export type Rating = {
102
100
  subjectType?: RatingSubjectTypeValue;
103
101
  subjectName: string;
104
102
  subjectReference?: string;
105
103
  documentFileHash?: string;
106
- rating: number;
104
+ rating: RatingValue;
107
105
  quality?: string;
108
106
  comment?: string;
109
107
  };
@@ -114,36 +112,4 @@ export type Bounty = {
114
112
  judge: string;
115
113
  judgePay?: string;
116
114
  };
117
- export type Observation = {
118
- description?: string;
119
- approach?: string;
120
- confidence?: number;
121
- reliabilityPolicy?: string;
122
- subject: string;
123
- subjectReference?: string;
124
- observationReference?: string;
125
- property: string;
126
- value?: string;
127
- };
128
- export type PollV3 = {
129
- country: string | undefined;
130
- city: string | undefined;
131
- legalEntity: string | undefined;
132
- domainScope: string[] | undefined;
133
- judges?: string;
134
- deadline: Date;
135
- poll: string;
136
- scopeDescription?: string;
137
- scopeQueryLink?: string;
138
- scopeProperty?: string;
139
- propertyScopeObserver?: string;
140
- pollType?: string;
141
- options: string[];
142
- };
143
- export type Boycott = {
144
- description?: string;
145
- reliabilityPolicy?: string;
146
- subject: string;
147
- subjectReference?: string;
148
- };
149
115
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GACxB,WAAW,GACX,WAAW,GACX,2BAA2B,GAC3B,qBAAqB,GACrB,MAAM,GACN,MAAM,GACN,UAAU,GACV,2BAA2B,GAC3B,gCAAgC,GAChC,SAAS,GACT,aAAa,GACb,QAAQ,GACR,UAAU,GACV,QAAQ,CAAA;AAEd,MAAM,MAAM,SAAS,GAAG;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM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AC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -1,3 +1,13 @@
1
+ export declare const generateFileHash: (fileContent: Buffer | string) => string;
2
+ export declare const validateFileHash: (fileContent: Buffer | string, expectedHash: string) => boolean;
3
+ export declare const generateStatementContentHash: (statementContent: string) => string;
4
+ export declare const validateStatementContentHash: (statementContent: string, expectedHash: string) => boolean;
5
+ export declare const generateStatementHash: (statement: string) => string;
6
+ export declare const validateStatementHash: (statement: string, expectedHash: string) => boolean;
7
+ export declare const generateStatementsFile: (statements: string[]) => string;
8
+ export declare const parseStatementsFile: (statementsFileContent: string) => string[];
9
+ export declare const generateStatementFilename: (statement: string) => string;
10
+ export declare const generateAttachmentFilename: (fileContent: Buffer | string, extension: string) => string;
1
11
  export declare const minPeopleCountToRange: (n: number) => string | undefined;
2
12
  export declare const monthIndex: (month: string) => number;
3
13
  export declare const birthDateFormat: RegExp;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,GAAI,GAAG,MAAM,KAAG,MAAM,GAAG,SAS1D,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,KAAG,MAEO,CAAA;AAElD,eAAO,MAAM,eAAe,EAAE,MAAgG,CAAA"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,GAAI,aAAa,MAAM,GAAG,MAAM,KAAG,MAE/D,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,aAAa,MAAM,GAAG,MAAM,EAAE,cAAc,MAAM,KAAG,OAErF,CAAC;AAEF,eAAO,MAAM,4BAA4B,GAAI,kBAAkB,MAAM,KAAG,MAEvE,CAAC;AAEF,eAAO,MAAM,4BAA4B,GACvC,kBAAkB,MAAM,EACxB,cAAc,MAAM,KACnB,OAEF,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,WAAW,MAAM,KAAG,MASzD,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,WAAW,MAAM,EAAE,cAAc,MAAM,KAAG,OAG/E,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,YAAY,MAAM,EAAE,KAAG,MAE7D,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,uBAAuB,MAAM,KAAG,MAAM,EA0BzE,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,WAAW,MAAM,KAAG,MAG7D,CAAC;AAEF,eAAO,MAAM,0BAA0B,GACrC,aAAa,MAAM,GAAG,MAAM,EAC5B,WAAW,MAAM,KAChB,MAIF,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,GAAG,MAAM,KAAG,MAAM,GAAG,SAS1D,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,KAAG,MAGxC,CAAC;AAEJ,eAAO,MAAM,eAAe,EAAE,MAC2D,CAAC"}
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Browser-compatible hash utilities using Web Crypto API
3
- * Async operations for client-side use
2
+ * Universal hash utilities using @noble/hashes
3
+ * Works in both browser and Node.js environments
4
4
  */
5
5
  /**
6
6
  * Compute SHA-256 hash of a string and return it as URL-safe base64
@@ -8,14 +8,14 @@
8
8
  * @param input - The string or buffer to hash
9
9
  * @returns URL-safe base64 encoded hash
10
10
  */
11
- export declare const sha256: (input: string | Uint8Array) => Promise<string>;
11
+ export declare const sha256: (input: string | Uint8Array) => string;
12
12
  /**
13
13
  * Verify that content matches a given hash
14
14
  * @param content - The content to verify
15
15
  * @param hash - The expected hash
16
16
  * @returns True if the hash matches
17
17
  */
18
- export declare const verify: (content: string | Uint8Array, hash: string) => Promise<boolean>;
18
+ export declare const verify: (content: string | Uint8Array, hash: string) => boolean;
19
19
  /**
20
20
  * Convert URL-safe base64 back to standard base64
21
21
  * @param urlSafe - URL-safe base64 string
@@ -28,4 +28,10 @@ export declare const fromUrlSafeBase64: (urlSafe: string) => string;
28
28
  * @returns URL-safe base64 string without padding
29
29
  */
30
30
  export declare const toUrlSafeBase64: (base64: string) => string;
31
- //# sourceMappingURL=hash.browser.d.ts.map
31
+ /**
32
+ * Convert base64 string to bytes
33
+ * @param base64 - Base64 string to convert
34
+ * @returns Uint8Array
35
+ */
36
+ export declare function base64ToBytes(base64: string): Uint8Array;
37
+ //# sourceMappingURL=hash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../src/hash.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;GAKG;AACH,eAAO,MAAM,MAAM,GAAI,OAAO,MAAM,GAAG,UAAU,KAAG,MAoBnD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,MAAM,GAAI,SAAS,MAAM,GAAG,UAAU,EAAE,MAAM,MAAM,KAAG,OAGnE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,KAAG,MAKnD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,KAAG,MAEhD,CAAC;AAgBF;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAYxD"}
@@ -1,17 +1,19 @@
1
1
  "use strict";
2
2
  /**
3
- * Browser-compatible hash utilities using Web Crypto API
4
- * Async operations for client-side use
3
+ * Universal hash utilities using @noble/hashes
4
+ * Works in both browser and Node.js environments
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.toUrlSafeBase64 = exports.fromUrlSafeBase64 = exports.verify = exports.sha256 = void 0;
8
+ exports.base64ToBytes = base64ToBytes;
9
+ const sha2_js_1 = require("@noble/hashes/sha2.js");
8
10
  /**
9
11
  * Compute SHA-256 hash of a string and return it as URL-safe base64
10
12
  * Works in both browser and Node.js environments
11
13
  * @param input - The string or buffer to hash
12
14
  * @returns URL-safe base64 encoded hash
13
15
  */
14
- const sha256 = async (input) => {
16
+ const sha256 = (input) => {
15
17
  let data;
16
18
  if (typeof input === 'string') {
17
19
  const encoder = new TextEncoder();
@@ -20,11 +22,10 @@ const sha256 = async (input) => {
20
22
  else {
21
23
  data = input;
22
24
  }
23
- // Use Web Crypto API (available in both modern browsers and Node.js 15+)
24
- const hashBuffer = await crypto.subtle.digest('SHA-256', data);
25
- const hashArray = Array.from(new Uint8Array(hashBuffer));
25
+ // Use @noble/hashes for consistent cross-platform hashing
26
+ const hashArray = (0, sha2_js_1.sha256)(data);
26
27
  // Convert to base64
27
- const base64 = btoa(String.fromCharCode(...hashArray));
28
+ const base64 = bytesToBase64(hashArray);
28
29
  // Make URL-safe: remove padding and replace + with - and / with _
29
30
  const urlSafe = base64.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_');
30
31
  return urlSafe;
@@ -36,8 +37,8 @@ exports.sha256 = sha256;
36
37
  * @param hash - The expected hash
37
38
  * @returns True if the hash matches
38
39
  */
39
- const verify = async (content, hash) => {
40
- const computed = await (0, exports.sha256)(content);
40
+ const verify = (content, hash) => {
41
+ const computed = (0, exports.sha256)(content);
41
42
  return computed === hash;
42
43
  };
43
44
  exports.verify = verify;
@@ -62,4 +63,37 @@ const toUrlSafeBase64 = (base64) => {
62
63
  return base64.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_');
63
64
  };
64
65
  exports.toUrlSafeBase64 = toUrlSafeBase64;
65
- //# sourceMappingURL=hash.browser.js.map
66
+ /**
67
+ * Convert bytes to base64 string
68
+ * @param bytes - Uint8Array to convert
69
+ * @returns Base64 string
70
+ */
71
+ function bytesToBase64(bytes) {
72
+ // Use btoa if available (browser), otherwise use Buffer (Node.js)
73
+ if (typeof btoa !== 'undefined') {
74
+ return btoa(String.fromCharCode(...Array.from(bytes)));
75
+ }
76
+ else {
77
+ return Buffer.from(bytes).toString('base64');
78
+ }
79
+ }
80
+ /**
81
+ * Convert base64 string to bytes
82
+ * @param base64 - Base64 string to convert
83
+ * @returns Uint8Array
84
+ */
85
+ function base64ToBytes(base64) {
86
+ // Use atob if available (browser), otherwise use Buffer (Node.js)
87
+ if (typeof atob !== 'undefined') {
88
+ const binaryString = atob(base64);
89
+ const bytes = new Uint8Array(binaryString.length);
90
+ for (let i = 0; i < binaryString.length; i++) {
91
+ bytes[i] = binaryString.charCodeAt(i);
92
+ }
93
+ return bytes;
94
+ }
95
+ else {
96
+ return new Uint8Array(Buffer.from(base64, 'base64'));
97
+ }
98
+ }
99
+ //# sourceMappingURL=hash.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hash.js","sourceRoot":"","sources":["../src/hash.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAmFH,sCAYC;AA7FD,mDAA8D;AAE9D;;;;;GAKG;AACI,MAAM,MAAM,GAAG,CAAC,KAA0B,EAAU,EAAE;IAC3D,IAAI,IAAgB,CAAC;IAErB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;QAClC,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;SAAM,CAAC;QACN,IAAI,GAAG,KAAK,CAAC;IACf,CAAC;IAED,0DAA0D;IAC1D,MAAM,SAAS,GAAG,IAAA,gBAAW,EAAC,IAAI,CAAC,CAAC;IAEpC,oBAAoB;IACpB,MAAM,MA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AiB;IACtC,kEAAkE;IAClE,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACzD,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAgB,aAAa,CAAC,MAAc;IAC1C,kEAAkE;IAClE,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE,CAAC;QAChC,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;QAClC,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAClD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7C,KAAK,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QACxC,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IACvD,CAAC;AACH,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,44 +1,6 @@
1
- import type { Statement, Quotation, Poll, OrganisationVerification, PersonVerification, Vote, DisputeAuthenticity, DisputeContent, ResponseContent, PDFSigning, Rating, Bounty, Observation, Boycott } from './types';
2
- export * from './types';
1
+ export * from './protocol';
2
+ export * from './hash';
3
+ export * from './signature';
3
4
  export * from './constants';
4
- export * from './utils';
5
- export * from './v3';
6
- export * from './hash.browser';
7
- export { sha256 as sha256Node, verify as verifyNode, fromUrlSafeBase64, toUrlSafeBase64 } from './hash.node';
8
- export declare const buildStatement: ({ domain, author, time, tags, content, representative, supersededStatement }: Statement) => string;
9
- export declare const parseStatement: ({ statement: s, allowNoVersion }: {
10
- statement: string;
11
- allowNoVersion?: boolean;
12
- }) => Statement & {
13
- type?: string;
14
- formatVersion: string;
15
- };
16
- export declare const buildQuotationContent: ({ originalAuthor, authorVerification, originalTime, source, quotation, paraphrasedStatement, picture, confidence }: Quotation) => string;
17
- export declare const parseQuotation: (s: string) => Quotation & {
18
- type: string | undefined;
19
- };
20
- export declare const buildPollContent: ({ country, city, legalEntity, domainScope, judges, deadline, poll, scopeDescription, scopeQueryLink, options, allowArbitraryVote, requiredProperty: propertyScope, requiredPropertyObserver: propertyScopeObserver }: Poll) => string;
21
- export declare const parsePoll: (s: string, version?: string) => Poll;
22
- export declare const buildOrganisationVerificationContent: ({ name, englishName, country, city, province, legalForm, department, domain, foreignDomain, serialNumber, confidence, reliabilityPolicy, employeeCount, pictureHash, latitude, longitude, population }: OrganisationVerification) => string;
23
- export declare const parseOrganisationVerification: (s: string) => OrganisationVerification;
24
- export declare const buildPersonVerificationContent: ({ name, countryOfBirth, cityOfBirth, ownDomain, foreignDomain, dateOfBirth, jobTitle, employer, verificationMethod, confidence, picture, reliabilityPolicy }: PersonVerification) => string;
25
- export declare const parsePersonVerification: (s: string) => PersonVerification;
26
- export declare const buildVoteContent: ({ pollHash, poll, vote }: Vote) => string;
27
- export declare const parseVote: (s: string) => Vote;
28
- export declare const buildDisputeAuthenticityContent: ({ hash, confidence, reliabilityPolicy }: DisputeAuthenticity) => string;
29
- export declare const parseDisputeAuthenticity: (s: string) => DisputeAuthenticity;
30
- export declare const buildDisputeContentContent: ({ hash, confidence, reliabilityPolicy }: DisputeContent) => string;
31
- export declare const parseDisputeContent: (s: string) => DisputeContent;
32
- export declare const buildResponseContent: ({ hash, response }: ResponseContent) => string;
33
- export declare const parseResponseContent: (s: string) => ResponseContent;
34
- export declare const buildPDFSigningContent: ({ hash }: PDFSigning) => string;
35
- export declare const parsePDFSigning: (s: string) => PDFSigning;
36
- export declare const buildRating: ({ subjectName, subjectType, subjectReference, documentFileHash, rating, quality, comment }: Rating) => string;
37
- export declare const parseRating: (s: string) => Rating;
38
- export declare const buildBounty: ({ motivation, bounty, reward, judge, judgePay }: Bounty) => string;
39
- export declare const parseBounty: (s: string) => Bounty;
40
- export declare const buildObservation: ({ approach, confidence, reliabilityPolicy, subject, subjectReference, observationReference, property, value }: Observation) => string;
41
- export declare const parseObservation: (s: string) => Observation;
42
- export declare const buildBoycott: ({ description, subject, subjectReference }: Boycott) => string;
43
- export declare const parseBoycott: (s: string) => Boycott;
5
+ export * from './types';
44
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACR,SAAS,EACT,SAAS,EACT,IAAI,EACJ,wBAAwB,EACxB,kBAAkB,EAClB,IAAI,EACJ,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,UAAU,EACV,MAAM,EAEN,MAAM,EACN,WAAW,EACX,OAAO,EACV,MAAM,SAAS,CAAA;AAKhB,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,MAAM,CAAA;AAGpB,cAAc,gBAAgB,CAAA;AAG9B,OAAO,EACH,MAAM,IAAI,UAAU,EACpB,MAAM,IAAI,UAAU,EACpB,iBAAiB,EACjB,eAAe,EAClB,MAAM,aAAa,CAAA;AAGpB,eAAO,MAAM,cAAc,GAAI,8EAA8E,SAAS,WAerH,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,kCAA0C;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,KAClH,SAAS,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAwCvD,CAAA;AAED,eAAO,MAA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