@hypercerts-org/sdk-core 0.2.0-beta.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 (83) hide show
  1. package/.turbo/turbo-build.log +328 -0
  2. package/.turbo/turbo-test.log +118 -0
  3. package/CHANGELOG.md +16 -0
  4. package/LICENSE +21 -0
  5. package/README.md +100 -0
  6. package/dist/errors.cjs +260 -0
  7. package/dist/errors.cjs.map +1 -0
  8. package/dist/errors.d.ts +233 -0
  9. package/dist/errors.mjs +253 -0
  10. package/dist/errors.mjs.map +1 -0
  11. package/dist/index.cjs +4531 -0
  12. package/dist/index.cjs.map +1 -0
  13. package/dist/index.d.ts +3430 -0
  14. package/dist/index.mjs +4448 -0
  15. package/dist/index.mjs.map +1 -0
  16. package/dist/lexicons.cjs +420 -0
  17. package/dist/lexicons.cjs.map +1 -0
  18. package/dist/lexicons.d.ts +227 -0
  19. package/dist/lexicons.mjs +410 -0
  20. package/dist/lexicons.mjs.map +1 -0
  21. package/dist/storage.cjs +270 -0
  22. package/dist/storage.cjs.map +1 -0
  23. package/dist/storage.d.ts +474 -0
  24. package/dist/storage.mjs +267 -0
  25. package/dist/storage.mjs.map +1 -0
  26. package/dist/testing.cjs +415 -0
  27. package/dist/testing.cjs.map +1 -0
  28. package/dist/testing.d.ts +928 -0
  29. package/dist/testing.mjs +410 -0
  30. package/dist/testing.mjs.map +1 -0
  31. package/dist/types.cjs +220 -0
  32. package/dist/types.cjs.map +1 -0
  33. package/dist/types.d.ts +2118 -0
  34. package/dist/types.mjs +212 -0
  35. package/dist/types.mjs.map +1 -0
  36. package/eslint.config.mjs +22 -0
  37. package/package.json +90 -0
  38. package/rollup.config.js +75 -0
  39. package/src/auth/OAuthClient.ts +497 -0
  40. package/src/core/SDK.ts +410 -0
  41. package/src/core/config.ts +243 -0
  42. package/src/core/errors.ts +257 -0
  43. package/src/core/interfaces.ts +324 -0
  44. package/src/core/types.ts +281 -0
  45. package/src/errors.ts +57 -0
  46. package/src/index.ts +107 -0
  47. package/src/lexicons.ts +64 -0
  48. package/src/repository/BlobOperationsImpl.ts +199 -0
  49. package/src/repository/CollaboratorOperationsImpl.ts +288 -0
  50. package/src/repository/HypercertOperationsImpl.ts +1146 -0
  51. package/src/repository/LexiconRegistry.ts +332 -0
  52. package/src/repository/OrganizationOperationsImpl.ts +234 -0
  53. package/src/repository/ProfileOperationsImpl.ts +281 -0
  54. package/src/repository/RecordOperationsImpl.ts +340 -0
  55. package/src/repository/Repository.ts +482 -0
  56. package/src/repository/interfaces.ts +868 -0
  57. package/src/repository/types.ts +111 -0
  58. package/src/services/hypercerts/types.ts +87 -0
  59. package/src/storage/InMemorySessionStore.ts +127 -0
  60. package/src/storage/InMemoryStateStore.ts +146 -0
  61. package/src/storage.ts +63 -0
  62. package/src/testing/index.ts +67 -0
  63. package/src/testing/mocks.ts +142 -0
  64. package/src/testing/stores.ts +285 -0
  65. package/src/testing.ts +64 -0
  66. package/src/types.ts +86 -0
  67. package/tests/auth/OAuthClient.test.ts +164 -0
  68. package/tests/core/SDK.test.ts +176 -0
  69. package/tests/core/errors.test.ts +81 -0
  70. package/tests/repository/BlobOperationsImpl.test.ts +154 -0
  71. package/tests/repository/CollaboratorOperationsImpl.test.ts +323 -0
  72. package/tests/repository/HypercertOperationsImpl.test.ts +652 -0
  73. package/tests/repository/LexiconRegistry.test.ts +192 -0
  74. package/tests/repository/OrganizationOperationsImpl.test.ts +242 -0
  75. package/tests/repository/ProfileOperationsImpl.test.ts +254 -0
  76. package/tests/repository/RecordOperationsImpl.test.ts +375 -0
  77. package/tests/repository/Repository.test.ts +149 -0
  78. package/tests/utils/fixtures.ts +117 -0
  79. package/tests/utils/mocks.ts +109 -0
  80. package/tests/utils/repository-fixtures.ts +78 -0
  81. package/tsconfig.json +11 -0
  82. package/tsconfig.tsbuildinfo +1 -0
  83. package/vitest.config.ts +30 -0
@@ -0,0 +1,328 @@
1
+
2
+ > @hypercerts-org/sdk-core@0.1.0 build /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core
3
+ > rollup -c
4
+
5
+ 
6
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/index.ts → dist/index.mjs, dist/index.cjs...
7
+ (!) [plugin typescript] src/repository/BlobOperationsImpl.ts (125:9): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
8
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/BlobOperationsImpl.ts:125:9
9
+ 
10
+ 125 ref: result.data.blob.ref,
11
+    ~~~
12
+
13
+ src/repository/BlobOperationsImpl.ts:111:46
14
+ 111 async upload(blob: Blob): Promise<{ ref: { $link: string }; mimeType: string; size: number }> {
15
+    ~~~~~
16
+ '$link' is declared here.
17
+ src/repository/BlobOperationsImpl.ts:111:39
18
+ 111 async upload(blob: Blob): Promise<{ ref: { $link: string }; mimeType: string; size: number }> {
19
+    ~~~
20
+ The expected type comes from property 'ref' which is declared here on type '{ ref: { $link: string; }; mimeType: string; size: number; }'
21
+ 
22
+ (!) [plugin typescript] src/repository/HypercertOperationsImpl.ts (211:15): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
23
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/HypercertOperationsImpl.ts:211:15
24
+ 
25
+ 211 ref: uploadResult.data.blob.ref,
26
+    ~~~
27
+
28
+ src/services/hypercerts/types.ts:67:10
29
+ 67 ref: { $link: string };
30
+    ~~~~~
31
+ '$link' is declared here.
32
+ 
33
+ (!) [plugin typescript] src/repository/HypercertOperationsImpl.ts (679:13): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
34
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/HypercertOperationsImpl.ts:679:13
35
+ 
36
+ 679 ref: uploadResult.data.blob.ref,
37
+    ~~~
38
+
39
+ src/services/hypercerts/types.ts:67:10
40
+ 67 ref: { $link: string };
41
+    ~~~~~
42
+ '$link' is declared here.
43
+ 
44
+ (!) [plugin typescript] src/repository/HypercertOperationsImpl.ts (1002:13): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
45
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/HypercertOperationsImpl.ts:1002:13
46
+ 
47
+ 1002 ref: uploadResult.data.blob.ref,
48
+    ~~~
49
+
50
+ src/services/hypercerts/types.ts:67:10
51
+ 67 ref: { $link: string };
52
+    ~~~~~
53
+ '$link' is declared here.
54
+ 
55
+ created dist/index.mjs, dist/index.cjs in 3s
56
+ 
57
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/types.ts → dist/types.mjs, dist/types.cjs...
58
+ (!) [plugin typescript] src/repository/BlobOperationsImpl.ts (125:9): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
59
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/BlobOperationsImpl.ts:125:9
60
+ 
61
+ 125 ref: result.data.blob.ref,
62
+    ~~~
63
+
64
+ src/repository/BlobOperationsImpl.ts:111:46
65
+ 111 async upload(blob: Blob): Promise<{ ref: { $link: string }; mimeType: string; size: number }> {
66
+    ~~~~~
67
+ '$link' is declared here.
68
+ src/repository/BlobOperationsImpl.ts:111:39
69
+ 111 async upload(blob: Blob): Promise<{ ref: { $link: string }; mimeType: string; size: number }> {
70
+    ~~~
71
+ The expected type comes from property 'ref' which is declared here on type '{ ref: { $link: string; }; mimeType: string; size: number; }'
72
+ 
73
+ (!) [plugin typescript] src/repository/HypercertOperationsImpl.ts (211:15): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
74
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/HypercertOperationsImpl.ts:211:15
75
+ 
76
+ 211 ref: uploadResult.data.blob.ref,
77
+    ~~~
78
+
79
+ src/services/hypercerts/types.ts:67:10
80
+ 67 ref: { $link: string };
81
+    ~~~~~
82
+ '$link' is declared here.
83
+ 
84
+ (!) [plugin typescript] src/repository/HypercertOperationsImpl.ts (679:13): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
85
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/HypercertOperationsImpl.ts:679:13
86
+ 
87
+ 679 ref: uploadResult.data.blob.ref,
88
+    ~~~
89
+
90
+ src/services/hypercerts/types.ts:67:10
91
+ 67 ref: { $link: string };
92
+    ~~~~~
93
+ '$link' is declared here.
94
+ 
95
+ (!) [plugin typescript] src/repository/HypercertOperationsImpl.ts (1002:13): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
96
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/HypercertOperationsImpl.ts:1002:13
97
+ 
98
+ 1002 ref: uploadResult.data.blob.ref,
99
+    ~~~
100
+
101
+ src/services/hypercerts/types.ts:67:10
102
+ 67 ref: { $link: string };
103
+    ~~~~~
104
+ '$link' is declared here.
105
+ 
106
+ created dist/types.mjs, dist/types.cjs in 2.1s
107
+ 
108
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/errors.ts → dist/errors.mjs, dist/errors.cjs...
109
+ (!) [plugin typescript] src/repository/BlobOperationsImpl.ts (125:9): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
110
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/BlobOperationsImpl.ts:125:9
111
+ 
112
+ 125 ref: result.data.blob.ref,
113
+    ~~~
114
+
115
+ src/repository/BlobOperationsImpl.ts:111:46
116
+ 111 async upload(blob: Blob): Promise<{ ref: { $link: string }; mimeType: string; size: number }> {
117
+    ~~~~~
118
+ '$link' is declared here.
119
+ src/repository/BlobOperationsImpl.ts:111:39
120
+ 111 async upload(blob: Blob): Promise<{ ref: { $link: string }; mimeType: string; size: number }> {
121
+    ~~~
122
+ The expected type comes from property 'ref' which is declared here on type '{ ref: { $link: string; }; mimeType: string; size: number; }'
123
+ 
124
+ (!) [plugin typescript] src/repository/HypercertOperationsImpl.ts (211:15): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
125
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/HypercertOperationsImpl.ts:211:15
126
+ 
127
+ 211 ref: uploadResult.data.blob.ref,
128
+    ~~~
129
+
130
+ src/services/hypercerts/types.ts:67:10
131
+ 67 ref: { $link: string };
132
+    ~~~~~
133
+ '$link' is declared here.
134
+ 
135
+ (!) [plugin typescript] src/repository/HypercertOperationsImpl.ts (679:13): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
136
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/HypercertOperationsImpl.ts:679:13
137
+ 
138
+ 679 ref: uploadResult.data.blob.ref,
139
+    ~~~
140
+
141
+ src/services/hypercerts/types.ts:67:10
142
+ 67 ref: { $link: string };
143
+    ~~~~~
144
+ '$link' is declared here.
145
+ 
146
+ (!) [plugin typescript] src/repository/HypercertOperationsImpl.ts (1002:13): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
147
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/HypercertOperationsImpl.ts:1002:13
148
+ 
149
+ 1002 ref: uploadResult.data.blob.ref,
150
+    ~~~
151
+
152
+ src/services/hypercerts/types.ts:67:10
153
+ 67 ref: { $link: string };
154
+    ~~~~~
155
+ '$link' is declared here.
156
+ 
157
+ created dist/errors.mjs, dist/errors.cjs in 2.1s
158
+ 
159
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/lexicons.ts → dist/lexicons.mjs, dist/lexicons.cjs...
160
+ (!) [plugin typescript] src/repository/BlobOperationsImpl.ts (125:9): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
161
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/BlobOperationsImpl.ts:125:9
162
+ 
163
+ 125 ref: result.data.blob.ref,
164
+    ~~~
165
+
166
+ src/repository/BlobOperationsImpl.ts:111:46
167
+ 111 async upload(blob: Blob): Promise<{ ref: { $link: string }; mimeType: string; size: number }> {
168
+    ~~~~~
169
+ '$link' is declared here.
170
+ src/repository/BlobOperationsImpl.ts:111:39
171
+ 111 async upload(blob: Blob): Promise<{ ref: { $link: string }; mimeType: string; size: number }> {
172
+    ~~~
173
+ The expected type comes from property 'ref' which is declared here on type '{ ref: { $link: string; }; mimeType: string; size: number; }'
174
+ 
175
+ (!) [plugin typescript] src/repository/HypercertOperationsImpl.ts (211:15): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
176
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/HypercertOperationsImpl.ts:211:15
177
+ 
178
+ 211 ref: uploadResult.data.blob.ref,
179
+    ~~~
180
+
181
+ src/services/hypercerts/types.ts:67:10
182
+ 67 ref: { $link: string };
183
+    ~~~~~
184
+ '$link' is declared here.
185
+ 
186
+ (!) [plugin typescript] src/repository/HypercertOperationsImpl.ts (679:13): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
187
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/HypercertOperationsImpl.ts:679:13
188
+ 
189
+ 679 ref: uploadResult.data.blob.ref,
190
+    ~~~
191
+
192
+ src/services/hypercerts/types.ts:67:10
193
+ 67 ref: { $link: string };
194
+    ~~~~~
195
+ '$link' is declared here.
196
+ 
197
+ (!) [plugin typescript] src/repository/HypercertOperationsImpl.ts (1002:13): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
198
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/HypercertOperationsImpl.ts:1002:13
199
+ 
200
+ 1002 ref: uploadResult.data.blob.ref,
201
+    ~~~
202
+
203
+ src/services/hypercerts/types.ts:67:10
204
+ 67 ref: { $link: string };
205
+    ~~~~~
206
+ '$link' is declared here.
207
+ 
208
+ created dist/lexicons.mjs, dist/lexicons.cjs in 1.8s
209
+ 
210
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/storage.ts → dist/storage.mjs, dist/storage.cjs...
211
+ (!) [plugin typescript] src/repository/BlobOperationsImpl.ts (125:9): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
212
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/BlobOperationsImpl.ts:125:9
213
+ 
214
+ 125 ref: result.data.blob.ref,
215
+    ~~~
216
+
217
+ src/repository/BlobOperationsImpl.ts:111:46
218
+ 111 async upload(blob: Blob): Promise<{ ref: { $link: string }; mimeType: string; size: number }> {
219
+    ~~~~~
220
+ '$link' is declared here.
221
+ src/repository/BlobOperationsImpl.ts:111:39
222
+ 111 async upload(blob: Blob): Promise<{ ref: { $link: string }; mimeType: string; size: number }> {
223
+    ~~~
224
+ The expected type comes from property 'ref' which is declared here on type '{ ref: { $link: string; }; mimeType: string; size: number; }'
225
+ 
226
+ (!) [plugin typescript] src/repository/HypercertOperationsImpl.ts (211:15): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
227
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/HypercertOperationsImpl.ts:211:15
228
+ 
229
+ 211 ref: uploadResult.data.blob.ref,
230
+    ~~~
231
+
232
+ src/services/hypercerts/types.ts:67:10
233
+ 67 ref: { $link: string };
234
+    ~~~~~
235
+ '$link' is declared here.
236
+ 
237
+ (!) [plugin typescript] src/repository/HypercertOperationsImpl.ts (679:13): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
238
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/HypercertOperationsImpl.ts:679:13
239
+ 
240
+ 679 ref: uploadResult.data.blob.ref,
241
+    ~~~
242
+
243
+ src/services/hypercerts/types.ts:67:10
244
+ 67 ref: { $link: string };
245
+    ~~~~~
246
+ '$link' is declared here.
247
+ 
248
+ (!) [plugin typescript] src/repository/HypercertOperationsImpl.ts (1002:13): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
249
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/HypercertOperationsImpl.ts:1002:13
250
+ 
251
+ 1002 ref: uploadResult.data.blob.ref,
252
+    ~~~
253
+
254
+ src/services/hypercerts/types.ts:67:10
255
+ 67 ref: { $link: string };
256
+    ~~~~~
257
+ '$link' is declared here.
258
+ 
259
+ created dist/storage.mjs, dist/storage.cjs in 1.7s
260
+ 
261
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/testing.ts → dist/testing.mjs, dist/testing.cjs...
262
+ (!) [plugin typescript] src/repository/BlobOperationsImpl.ts (125:9): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
263
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/BlobOperationsImpl.ts:125:9
264
+ 
265
+ 125 ref: result.data.blob.ref,
266
+    ~~~
267
+
268
+ src/repository/BlobOperationsImpl.ts:111:46
269
+ 111 async upload(blob: Blob): Promise<{ ref: { $link: string }; mimeType: string; size: number }> {
270
+    ~~~~~
271
+ '$link' is declared here.
272
+ src/repository/BlobOperationsImpl.ts:111:39
273
+ 111 async upload(blob: Blob): Promise<{ ref: { $link: string }; mimeType: string; size: number }> {
274
+    ~~~
275
+ The expected type comes from property 'ref' which is declared here on type '{ ref: { $link: string; }; mimeType: string; size: number; }'
276
+ 
277
+ (!) [plugin typescript] src/repository/HypercertOperationsImpl.ts (211:15): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
278
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/HypercertOperationsImpl.ts:211:15
279
+ 
280
+ 211 ref: uploadResult.data.blob.ref,
281
+    ~~~
282
+
283
+ src/services/hypercerts/types.ts:67:10
284
+ 67 ref: { $link: string };
285
+    ~~~~~
286
+ '$link' is declared here.
287
+ 
288
+ (!) [plugin typescript] src/repository/HypercertOperationsImpl.ts (679:13): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
289
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/HypercertOperationsImpl.ts:679:13
290
+ 
291
+ 679 ref: uploadResult.data.blob.ref,
292
+    ~~~
293
+
294
+ src/services/hypercerts/types.ts:67:10
295
+ 67 ref: { $link: string };
296
+    ~~~~~
297
+ '$link' is declared here.
298
+ 
299
+ (!) [plugin typescript] src/repository/HypercertOperationsImpl.ts (1002:13): @rollup/plugin-typescript TS2741: Property '$link' is missing in type 'CID<unknown, number, number, Version>' but required in type '{ $link: string; }'.
300
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/repository/HypercertOperationsImpl.ts:1002:13
301
+ 
302
+ 1002 ref: uploadResult.data.blob.ref,
303
+    ~~~
304
+
305
+ src/services/hypercerts/types.ts:67:10
306
+ 67 ref: { $link: string };
307
+    ~~~~~
308
+ '$link' is declared here.
309
+ 
310
+ created dist/testing.mjs, dist/testing.cjs in 1.8s
311
+ 
312
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/index.ts → dist/index.d.ts...
313
+ created dist/index.d.ts in 1.5s
314
+ 
315
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/types.ts → dist/types.d.ts...
316
+ created dist/types.d.ts in 1.2s
317
+ 
318
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/errors.ts → dist/errors.d.ts...
319
+ created dist/errors.d.ts in 486ms
320
+ 
321
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/lexicons.ts → dist/lexicons.d.ts...
322
+ created dist/lexicons.d.ts in 1s
323
+ 
324
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/storage.ts → dist/storage.d.ts...
325
+ created dist/storage.d.ts in 553ms
326
+ 
327
+ /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/testing.ts → dist/testing.d.ts...
328
+ created dist/testing.d.ts in 1s
@@ -0,0 +1,118 @@
1
+
2
+ > @hypercerts-org/sdk-core@0.1.0 test /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core
3
+ > vitest
4
+
5
+
6
+  RUN  v3.2.4 /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core
7
+
8
+ ✓ tests/repository/CollaboratorOperationsImpl.test.ts (18 tests) 28ms
9
+ ✓ tests/repository/RecordOperationsImpl.test.ts (21 tests) 33ms
10
+ ✓ tests/repository/HypercertOperationsImpl.test.ts (30 tests) 43ms
11
+ ✓ tests/repository/ProfileOperationsImpl.test.ts (14 tests) 26ms
12
+ ✓ tests/repository/OrganizationOperationsImpl.test.ts (12 tests) 19ms
13
+ ✓ tests/repository/LexiconRegistry.test.ts (16 tests) 18ms
14
+ stderr | tests/auth/OAuthClient.test.ts > OAuthClient > constructor > should initialize with valid config
15
+ No lock mechanism provided. Credentials might get revoked.
16
+
17
+ stderr | tests/auth/OAuthClient.test.ts > OAuthClient > constructor > should use custom fetch handler if provided
18
+ No lock mechanism provided. Credentials might get revoked.
19
+
20
+ stderr | tests/auth/OAuthClient.test.ts > OAuthClient > constructor > should use custom timeout configuration
21
+ No lock mechanism provided. Credentials might get revoked.
22
+
23
+ stderr | tests/auth/OAuthClient.test.ts > OAuthClient > authorize > should throw AuthenticationError for invalid identifier
24
+ No lock mechanism provided. Credentials might get revoked.
25
+
26
+ stderr | tests/auth/OAuthClient.test.ts > OAuthClient > authorize > should use custom scope if provided
27
+ No lock mechanism provided. Credentials might get revoked.
28
+
29
+ stderr | tests/core/SDK.test.ts > ATProtoSDK > constructor > should create SDK instance with valid config
30
+ No lock mechanism provided. Credentials might get revoked.
31
+
32
+ stderr | tests/core/SDK.test.ts > ATProtoSDK > constructor > should accept optional cache
33
+ No lock mechanism provided. Credentials might get revoked.
34
+
35
+ stderr | tests/core/SDK.test.ts > ATProtoSDK > constructor > should accept optional logger
36
+ No lock mechanism provided. Credentials might get revoked.
37
+
38
+ stderr | tests/core/SDK.test.ts > ATProtoSDK > constructor > should work without storage (uses in-memory defaults)
39
+ No lock mechanism provided. Credentials might get revoked.
40
+
41
+ stderr | tests/core/SDK.test.ts > ATProtoSDK > createATProtoSDK factory > should create SDK instance
42
+ No lock mechanism provided. Credentials might get revoked.
43
+
44
+ stderr | tests/core/SDK.test.ts > ATProtoSDK > createATProtoSDK factory > should be equivalent to constructor
45
+ No lock mechanism provided. Credentials might get revoked.
46
+ No lock mechanism provided. Credentials might get revoked.
47
+
48
+ stderr | tests/core/SDK.test.ts > ATProtoSDK > authorize > should throw ValidationError for empty identifier
49
+ No lock mechanism provided. Credentials might get revoked.
50
+
51
+ stderr | tests/core/SDK.test.ts > ATProtoSDK > authorize > should trim identifier
52
+ No lock mechanism provided. Credentials might get revoked.
53
+
54
+ ✓ tests/repository/Repository.test.ts (12 tests) 49ms
55
+ stderr | tests/core/SDK.test.ts > ATProtoSDK > restoreSession > should throw ValidationError for empty DID
56
+ No lock mechanism provided. Credentials might get revoked.
57
+
58
+ stderr | tests/core/SDK.test.ts > ATProtoSDK > restoreSession > should handle non-existent session
59
+ No lock mechanism provided. Credentials might get revoked.
60
+
61
+ stderr | tests/auth/OAuthClient.test.ts > OAuthClient > callback > should throw AuthenticationError for OAuth error params
62
+ No lock mechanism provided. Credentials might get revoked.
63
+
64
+ stderr | tests/auth/OAuthClient.test.ts > OAuthClient > callback > should throw AuthenticationError for missing code
65
+ No lock mechanism provided. Credentials might get revoked.
66
+
67
+ stderr | tests/core/SDK.test.ts > ATProtoSDK > revokeSession > should throw ValidationError for empty DID
68
+ No lock mechanism provided. Credentials might get revoked.
69
+
70
+ stderr | tests/auth/OAuthClient.test.ts > OAuthClient > restore > should return null for non-existent session
71
+ No lock mechanism provided. Credentials might get revoked.
72
+
73
+ stderr | tests/core/SDK.test.ts > ATProtoSDK > repository > should throw ValidationError when session is null
74
+ No lock mechanism provided. Credentials might get revoked.
75
+
76
+ stderr | tests/auth/OAuthClient.test.ts > OAuthClient > restore > should throw AuthenticationError for invalid DID
77
+ No lock mechanism provided. Credentials might get revoked.
78
+
79
+ stderr | tests/core/SDK.test.ts > ATProtoSDK > repository > should throw ValidationError when PDS not configured and no server specified
80
+ No lock mechanism provided. Credentials might get revoked.
81
+
82
+ stderr | tests/auth/OAuthClient.test.ts > OAuthClient > revoke > should not throw for non-existent session
83
+ No lock mechanism provided. Credentials might get revoked.
84
+
85
+ stderr | tests/core/SDK.test.ts > ATProtoSDK > repository > should throw ValidationError when SDS not configured and server=sds
86
+ No lock mechanism provided. Credentials might get revoked.
87
+
88
+ stderr | tests/auth/OAuthClient.test.ts > OAuthClient > storage integration > should use provided session store
89
+ No lock mechanism provided. Credentials might get revoked.
90
+
91
+ stderr | tests/auth/OAuthClient.test.ts > OAuthClient > storage integration > should use provided state store
92
+ No lock mechanism provided. Credentials might get revoked.
93
+
94
+ stderr | tests/auth/OAuthClient.test.ts > OAuthClient > logger integration > should use provided logger
95
+ No lock mechanism provided. Credentials might get revoked.
96
+
97
+ ✓ tests/auth/OAuthClient.test.ts (14 tests) 356ms
98
+ stderr | tests/core/SDK.test.ts > ATProtoSDK > repository > should create repository with custom serverUrl
99
+ No lock mechanism provided. Credentials might get revoked.
100
+
101
+ stderr | tests/core/SDK.test.ts > ATProtoSDK > setup examples > should work with minimal config (no storage provided)
102
+ No lock mechanism provided. Credentials might get revoked.
103
+
104
+ stderr | tests/core/SDK.test.ts > ATProtoSDK > setup examples > should work with all optional fields
105
+ No lock mechanism provided. Credentials might get revoked.
106
+
107
+ stderr | tests/core/SDK.test.ts > ATProtoSDK > setup examples > should work with custom storage implementations
108
+ No lock mechanism provided. Credentials might get revoked.
109
+
110
+ ✓ tests/core/SDK.test.ts (19 tests) 234ms
111
+ ✓ tests/repository/BlobOperationsImpl.test.ts (9 tests) 12ms
112
+ ✓ tests/core/errors.test.ts (9 tests) 5ms
113
+
114
+  Test Files  11 passed (11)
115
+  Tests  174 passed (174)
116
+  Start at  19:15:42
117
+  Duration  2.20s (transform 569ms, setup 0ms, collect 2.69s, tests 824ms, environment 2ms, prepare 1.08s)
118
+
package/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ # @hypercerts-org/sdk-core
2
+
3
+ ## 0.2.0-beta.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#46](https://github.com/hypercerts-org/hypercerts-sdk/pull/46)
8
+ [`eda4ac2`](https://github.com/hypercerts-org/hypercerts-sdk/commit/eda4ac233e09764d83f042ba7df94d4c9884cc01) Thanks
9
+ [@bitbeckers](https://github.com/bitbeckers)! - Initial release of sdk-core package with ATProto SDK for
10
+ authentication, repository operations, and lexicon management
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+ [[`eda4ac2`](https://github.com/hypercerts-org/hypercerts-sdk/commit/eda4ac233e09764d83f042ba7df94d4c9884cc01)]:
16
+ - @hypercerts-org/lexicon@0.2.0-beta.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Hypercerts Foundation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,100 @@
1
+ # @hypercerts-org/sdk-core
2
+
3
+ Framework-agnostic ATProto SDK for Hypercerts.
4
+
5
+ ```bash
6
+ pnpm add @hypercerts-org/sdk-core
7
+ ```
8
+
9
+ ## Entrypoints
10
+
11
+ ```
12
+ @hypercerts-org/sdk-core
13
+ ├── / → Full SDK (createATProtoSDK, Repository, types, errors)
14
+ ├── /types → TypeScript types (re-exported from @hypercerts-org/lexicon)
15
+ ├── /errors → Error classes
16
+ ├── /lexicons → LexiconRegistry, HYPERCERT_LEXICONS, HYPERCERT_COLLECTIONS
17
+ ├── /storage → InMemorySessionStore, InMemoryStateStore
18
+ └── /testing → createMockSession, MockSessionStore
19
+ ```
20
+
21
+ ## Type System
22
+
23
+ Types are generated from ATProto lexicon definitions in `@hypercerts-org/lexicon` and re-exported with friendly aliases:
24
+
25
+ | Lexicon Type | SDK Alias |
26
+ |--------------|-----------|
27
+ | `OrgHypercertsClaim.Main` | `HypercertClaim` |
28
+ | `OrgHypercertsClaimRights.Main` | `HypercertRights` |
29
+ | `OrgHypercertsClaimContribution.Main` | `HypercertContribution` |
30
+ | `OrgHypercertsClaimMeasurement.Main` | `HypercertMeasurement` |
31
+ | `OrgHypercertsClaimEvaluation.Main` | `HypercertEvaluation` |
32
+ | `OrgHypercertsCollection.Main` | `HypercertCollection` |
33
+ | `AppCertifiedLocation.Main` | `HypercertLocation` |
34
+
35
+ ```typescript
36
+ import type { HypercertClaim, HypercertRights } from "@hypercerts-org/sdk-core";
37
+
38
+ // For validation functions, import the namespaced types
39
+ import { OrgHypercertsClaim } from "@hypercerts-org/sdk-core";
40
+
41
+ if (OrgHypercertsClaim.isRecord(data)) {
42
+ // data is typed as HypercertClaim
43
+ }
44
+ ```
45
+
46
+ ## Usage
47
+
48
+ ```typescript
49
+ import { createATProtoSDK } from "@hypercerts-org/sdk-core";
50
+
51
+ // 1. Create SDK instance
52
+ const sdk = createATProtoSDK({
53
+ oauth: {
54
+ clientId: "https://your-app.com/client-metadata.json",
55
+ redirectUri: "https://your-app.com/callback",
56
+ scope: "atproto",
57
+ jwksUri: "https://your-app.com/jwks.json",
58
+ jwkPrivate: process.env.ATPROTO_JWK_PRIVATE!,
59
+ },
60
+ });
61
+
62
+ // 2. Start OAuth flow → redirect user to authUrl
63
+ const authUrl = await sdk.authorize("user.bsky.social");
64
+
65
+ // 3. Handle callback at redirectUri → exchange code for session
66
+ const session = await sdk.callback(params); // params from callback URL
67
+
68
+ // 4. Use session to interact with repositories
69
+ const repo = sdk.getRepository(session);
70
+ await repo.hypercerts.create({ title: "My Hypercert", ... });
71
+
72
+ // For returning users, restore session by DID
73
+ const existingSession = await sdk.restoreSession("did:plc:...");
74
+ ```
75
+
76
+ ## Repository API
77
+
78
+ ```
79
+ repo
80
+ ├── .records → create, get, update, delete, list
81
+ ├── .blobs → upload, get
82
+ ├── .profile → get, update
83
+ ├── .hypercerts → create, get, update, delete, list, addContribution, addMeasurement
84
+ ├── .collaborators → grant, revoke, list, hasAccess (SDS only)
85
+ └── .organizations → create, get, list (SDS only)
86
+ ```
87
+
88
+ ## Errors
89
+
90
+ ```typescript
91
+ import { ValidationError, NetworkError, AuthenticationError } from "@hypercerts-org/sdk-core/errors";
92
+ ```
93
+
94
+ ## Development
95
+
96
+ ```bash
97
+ pnpm build # Build
98
+ pnpm test # Test
99
+ pnpm test:coverage # Coverage
100
+ ```