@hypercerts-org/sdk-core 0.5.0-beta.0 → 0.7.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 (57) hide show
  1. package/README.md +130 -8
  2. package/dist/index.cjs +93 -15
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.ts +64 -1
  5. package/dist/index.mjs +93 -16
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +9 -5
  8. package/.turbo/turbo-build.log +0 -40
  9. package/.turbo/turbo-test.log +0 -119
  10. package/CHANGELOG.md +0 -62
  11. package/eslint.config.mjs +0 -22
  12. package/rollup.config.js +0 -75
  13. package/src/auth/OAuthClient.ts +0 -497
  14. package/src/core/SDK.ts +0 -410
  15. package/src/core/config.ts +0 -243
  16. package/src/core/errors.ts +0 -257
  17. package/src/core/interfaces.ts +0 -324
  18. package/src/core/types.ts +0 -282
  19. package/src/errors.ts +0 -57
  20. package/src/index.ts +0 -107
  21. package/src/lexicons.ts +0 -64
  22. package/src/repository/BlobOperationsImpl.ts +0 -199
  23. package/src/repository/CollaboratorOperationsImpl.ts +0 -442
  24. package/src/repository/HypercertOperationsImpl.ts +0 -1146
  25. package/src/repository/LexiconRegistry.ts +0 -332
  26. package/src/repository/OrganizationOperationsImpl.ts +0 -282
  27. package/src/repository/ProfileOperationsImpl.ts +0 -281
  28. package/src/repository/RecordOperationsImpl.ts +0 -340
  29. package/src/repository/Repository.ts +0 -482
  30. package/src/repository/interfaces.ts +0 -909
  31. package/src/repository/types.ts +0 -111
  32. package/src/services/hypercerts/types.ts +0 -87
  33. package/src/storage/InMemorySessionStore.ts +0 -127
  34. package/src/storage/InMemoryStateStore.ts +0 -146
  35. package/src/storage.ts +0 -63
  36. package/src/testing/index.ts +0 -67
  37. package/src/testing/mocks.ts +0 -142
  38. package/src/testing/stores.ts +0 -285
  39. package/src/testing.ts +0 -64
  40. package/src/types.ts +0 -86
  41. package/tests/auth/OAuthClient.test.ts +0 -164
  42. package/tests/core/SDK.test.ts +0 -176
  43. package/tests/core/errors.test.ts +0 -81
  44. package/tests/repository/BlobOperationsImpl.test.ts +0 -155
  45. package/tests/repository/CollaboratorOperationsImpl.test.ts +0 -438
  46. package/tests/repository/HypercertOperationsImpl.test.ts +0 -652
  47. package/tests/repository/LexiconRegistry.test.ts +0 -192
  48. package/tests/repository/OrganizationOperationsImpl.test.ts +0 -240
  49. package/tests/repository/ProfileOperationsImpl.test.ts +0 -254
  50. package/tests/repository/RecordOperationsImpl.test.ts +0 -375
  51. package/tests/repository/Repository.test.ts +0 -149
  52. package/tests/utils/fixtures.ts +0 -117
  53. package/tests/utils/mocks.ts +0 -109
  54. package/tests/utils/repository-fixtures.ts +0 -78
  55. package/tsconfig.json +0 -11
  56. package/tsconfig.tsbuildinfo +0 -1
  57. package/vitest.config.ts +0 -30
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hypercerts-org/sdk-core",
3
- "version": "0.5.0-beta.0",
3
+ "version": "0.7.0-beta.0",
4
4
  "description": "Framework-agnostic ATProto SDK core for authentication, repository operations, and lexicon management",
5
5
  "main": "dist/index.cjs",
6
6
  "repository": {
@@ -10,6 +10,10 @@
10
10
  "access": "public",
11
11
  "registry": "https://registry.npmjs.org/"
12
12
  },
13
+ "files": [
14
+ "dist",
15
+ "README.md"
16
+ ],
13
17
  "keywords": [
14
18
  "atproto",
15
19
  "hypercerts",
@@ -27,7 +31,7 @@
27
31
  "@types/node": ">=20.10.0",
28
32
  "@vitest/coverage-v8": "^3.2.4",
29
33
  "@vitest/ui": "^3.2.4",
30
- "jose": "^6.0.13",
34
+ "jose": "^6.1.3",
31
35
  "rollup": "^4.53.3",
32
36
  "rollup-plugin-dts": "^6.2.3",
33
37
  "vitest": "^3.2.4"
@@ -71,11 +75,11 @@
71
75
  "dependencies": {
72
76
  "@atproto/api": "^0.17.5",
73
77
  "@atproto/lexicon": "^0.5.1",
74
- "@atproto/oauth-client": "^0.5.9",
75
- "@atproto/oauth-client-node": "^0.3.10",
78
+ "@atproto/oauth-client": "^0.5.10",
79
+ "@atproto/oauth-client-node": "^0.3.12",
76
80
  "eventemitter3": "^5.0.1",
77
81
  "zod": "^3.24.4",
78
- "@hypercerts-org/lexicon": "0.5.0-beta.0"
82
+ "@hypercerts-org/lexicon": "0.7.0-beta.0"
79
83
  },
80
84
  "scripts": {
81
85
  "test": "vitest",
@@ -1,40 +0,0 @@
1
-
2
- > @hypercerts-org/sdk-core@0.4.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
- created dist/index.mjs, dist/index.cjs in 2.8s
8
- 
9
- /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/types.ts → dist/types.mjs, dist/types.cjs...
10
- created dist/types.mjs, dist/types.cjs in 2.2s
11
- 
12
- /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/errors.ts → dist/errors.mjs, dist/errors.cjs...
13
- created dist/errors.mjs, dist/errors.cjs in 2.2s
14
- 
15
- /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/lexicons.ts → dist/lexicons.mjs, dist/lexicons.cjs...
16
- created dist/lexicons.mjs, dist/lexicons.cjs in 1.7s
17
- 
18
- /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/storage.ts → dist/storage.mjs, dist/storage.cjs...
19
- created dist/storage.mjs, dist/storage.cjs in 1.5s
20
- 
21
- /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/testing.ts → dist/testing.mjs, dist/testing.cjs...
22
- created dist/testing.mjs, dist/testing.cjs in 1.5s
23
- 
24
- /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/index.ts → dist/index.d.ts...
25
- created dist/index.d.ts in 1.2s
26
- 
27
- /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/types.ts → dist/types.d.ts...
28
- created dist/types.d.ts in 1.1s
29
- 
30
- /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/errors.ts → dist/errors.d.ts...
31
- created dist/errors.d.ts in 465ms
32
- 
33
- /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/lexicons.ts → dist/lexicons.d.ts...
34
- created dist/lexicons.d.ts in 913ms
35
- 
36
- /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/storage.ts → dist/storage.d.ts...
37
- created dist/storage.d.ts in 837ms
38
- 
39
- /home/runner/work/hypercerts-sdk/hypercerts-sdk/packages/sdk-core/src/testing.ts → dist/testing.d.ts...
40
- created dist/testing.d.ts in 700ms
@@ -1,119 +0,0 @@
1
-
2
- > @hypercerts-org/sdk-core@0.4.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 (25 tests) 25ms
9
- ✓ tests/repository/RecordOperationsImpl.test.ts (21 tests) 34ms
10
- ✓ tests/repository/HypercertOperationsImpl.test.ts (30 tests) 38ms
11
- ✓ tests/repository/ProfileOperationsImpl.test.ts (14 tests) 20ms
12
- ✓ tests/repository/OrganizationOperationsImpl.test.ts (12 tests) 17ms
13
- ✓ tests/repository/LexiconRegistry.test.ts (16 tests) 16ms
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
- stderr | tests/auth/OAuthClient.test.ts > OAuthClient > callback > should throw AuthenticationError for OAuth error params
55
- No lock mechanism provided. Credentials might get revoked.
56
-
57
- stderr | tests/auth/OAuthClient.test.ts > OAuthClient > callback > should throw AuthenticationError for missing code
58
- No lock mechanism provided. Credentials might get revoked.
59
-
60
- stderr | tests/auth/OAuthClient.test.ts > OAuthClient > restore > should return null for non-existent session
61
- No lock mechanism provided. Credentials might get revoked.
62
-
63
- stderr | tests/auth/OAuthClient.test.ts > OAuthClient > restore > should throw AuthenticationError for invalid DID
64
- No lock mechanism provided. Credentials might get revoked.
65
-
66
- stderr | tests/auth/OAuthClient.test.ts > OAuthClient > revoke > should not throw for non-existent session
67
- No lock mechanism provided. Credentials might get revoked.
68
-
69
- stderr | tests/auth/OAuthClient.test.ts > OAuthClient > storage integration > should use provided session store
70
- No lock mechanism provided. Credentials might get revoked.
71
-
72
- stderr | tests/auth/OAuthClient.test.ts > OAuthClient > storage integration > should use provided state store
73
- No lock mechanism provided. Credentials might get revoked.
74
-
75
- stderr | tests/auth/OAuthClient.test.ts > OAuthClient > logger integration > should use provided logger
76
- No lock mechanism provided. Credentials might get revoked.
77
-
78
- ✓ tests/auth/OAuthClient.test.ts (14 tests) 301ms
79
- ✓ tests/repository/Repository.test.ts (12 tests) 60ms
80
- ✓ tests/repository/BlobOperationsImpl.test.ts (9 tests) 14ms
81
- ✓ tests/core/errors.test.ts (9 tests) 5ms
82
- stderr | tests/core/SDK.test.ts > ATProtoSDK > restoreSession > should throw ValidationError for empty DID
83
- No lock mechanism provided. Credentials might get revoked.
84
-
85
- stderr | tests/core/SDK.test.ts > ATProtoSDK > restoreSession > should handle non-existent session
86
- No lock mechanism provided. Credentials might get revoked.
87
-
88
- stderr | tests/core/SDK.test.ts > ATProtoSDK > revokeSession > should throw ValidationError for empty DID
89
- No lock mechanism provided. Credentials might get revoked.
90
-
91
- stderr | tests/core/SDK.test.ts > ATProtoSDK > repository > should throw ValidationError when session is null
92
- No lock mechanism provided. Credentials might get revoked.
93
-
94
- stderr | tests/core/SDK.test.ts > ATProtoSDK > repository > should throw ValidationError when PDS not configured and no server specified
95
- No lock mechanism provided. Credentials might get revoked.
96
-
97
- stderr | tests/core/SDK.test.ts > ATProtoSDK > repository > should throw ValidationError when SDS not configured and server=sds
98
- No lock mechanism provided. Credentials might get revoked.
99
-
100
- stderr | tests/core/SDK.test.ts > ATProtoSDK > repository > should create repository with custom serverUrl
101
- No lock mechanism provided. Credentials might get revoked.
102
-
103
- stderr | tests/core/SDK.test.ts > ATProtoSDK > setup examples > should work with minimal config (no storage provided)
104
- No lock mechanism provided. Credentials might get revoked.
105
-
106
- stderr | tests/core/SDK.test.ts > ATProtoSDK > setup examples > should work with all optional fields
107
- No lock mechanism provided. Credentials might get revoked.
108
-
109
- stderr | tests/core/SDK.test.ts > ATProtoSDK > setup examples > should work with custom storage implementations
110
- No lock mechanism provided. Credentials might get revoked.
111
-
112
- ✓ tests/core/SDK.test.ts (19 tests) 442ms
113
- ✓ ATProtoSDK > authorize > should trim identifier  360ms
114
-
115
-  Test Files  11 passed (11)
116
-  Tests  181 passed (181)
117
-  Start at  08:04:07
118
-  Duration  2.02s (transform 506ms, setup 0ms, collect 2.39s, tests 972ms, environment 2ms, prepare 983ms)
119
-
package/CHANGELOG.md DELETED
@@ -1,62 +0,0 @@
1
- # @hypercerts-org/sdk-core
2
-
3
- ## 0.5.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
- - [#56](https://github.com/hypercerts-org/hypercerts-sdk/pull/56)
13
- [`caceacb`](https://github.com/hypercerts-org/hypercerts-sdk/commit/caceacbc5572a590c750a95ccfda23fff2dd0c61) Thanks
14
- [@bitbeckers](https://github.com/bitbeckers)! - Add pagination support and fix React hooks for SDS operations
15
-
16
- **Breaking Changes (sdk-core):**
17
- - `CollaboratorOperations.list()` now returns `{ collaborators: RepositoryAccessGrant[], cursor?: string }` instead of
18
- `RepositoryAccessGrant[]`
19
- - `OrganizationOperations.list()` now returns `{ organizations: OrganizationInfo[], cursor?: string }` instead of
20
- `OrganizationInfo[]`
21
-
22
- **Features:**
23
- - Add cursor-based pagination support to collaborator and organization list operations
24
- - Support optional `limit` and `cursor` parameters for paginated queries
25
- - Update internal methods (`hasAccess`, `getRole`, `get`) to handle new pagination structure
26
-
27
- **Bug Fixes (sdk-react):**
28
- - Fix `useCollaborators` hook to correctly destructure paginated response
29
- - Fix `useOrganizations` hook to correctly destructure paginated response
30
- - All React hooks now properly handle the new pagination structure
31
-
32
- **Documentation:**
33
- - Comprehensive README updates with clear examples for all SDK operations
34
- - Added pagination examples throughout documentation
35
- - Improved code samples with realistic use cases
36
-
37
- **Tests:**
38
- - All 317 tests passing (181 sdk-core + 136 sdk-react)
39
- - Updated test mocks to match new pagination response structure
40
- - Build completes with zero warnings
41
-
42
- ### Patch Changes
43
-
44
- - [#56](https://github.com/hypercerts-org/hypercerts-sdk/pull/56)
45
- [`cb3268d`](https://github.com/hypercerts-org/hypercerts-sdk/commit/cb3268d78614efaf15aecc57a5dc3bce8313f3ca) Thanks
46
- [@bitbeckers](https://github.com/bitbeckers)! - Fix SDS organization and collaborator operations to match API
47
- contracts
48
- - Add required creatorDid parameter to organization.create endpoint
49
- - Fix organization.list to parse organizations field instead of repositories
50
- - Update accessType values to match SDS API: owner|shared|none (was owner|collaborator)
51
- - Add permission string array parser for collaborator.list endpoint
52
- - Update type definitions to match actual SDS API response formats
53
-
54
- - [#55](https://github.com/hypercerts-org/hypercerts-sdk/pull/55)
55
- [`23c3d9a`](https://github.com/hypercerts-org/hypercerts-sdk/commit/23c3d9a3b71f326df68b65420c83f7ae42c2432d) Thanks
56
- [@bitbeckers](https://github.com/bitbeckers)! - Fix endpoints and NSIDs for SDS operations in CollaboratorOperations
57
- and OrganizationOperations
58
-
59
- - Updated dependencies
60
- [[`23c3d9a`](https://github.com/hypercerts-org/hypercerts-sdk/commit/23c3d9a3b71f326df68b65420c83f7ae42c2432d),
61
- [`eda4ac2`](https://github.com/hypercerts-org/hypercerts-sdk/commit/eda4ac233e09764d83f042ba7df94d4c9884cc01)]:
62
- - @hypercerts-org/lexicon@0.5.0-beta.0
package/eslint.config.mjs DELETED
@@ -1,22 +0,0 @@
1
- import baseConfig from "../../eslint.config.mjs";
2
- import path from "path";
3
- import { fileURLToPath } from "url";
4
-
5
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
6
-
7
- /**
8
- * SDK Core ESLint configuration.
9
- * Extends the shared base config with package-specific settings.
10
- */
11
- export default [
12
- ...baseConfig,
13
- {
14
- files: ["**/*.ts", "**/*.tsx"],
15
- languageOptions: {
16
- parserOptions: {
17
- project: path.resolve(__dirname, "./tsconfig.json"),
18
- tsconfigRootDir: __dirname,
19
- },
20
- },
21
- },
22
- ];
package/rollup.config.js DELETED
@@ -1,75 +0,0 @@
1
- import { fileURLToPath } from "node:url";
2
- import { dirname, resolve } from "node:path";
3
- import typescript from "@rollup/plugin-typescript";
4
- import nodeResolve from "@rollup/plugin-node-resolve";
5
- import commonjs from "@rollup/plugin-commonjs";
6
- import json from "@rollup/plugin-json";
7
- import dts from "rollup-plugin-dts";
8
-
9
- const __dirname = dirname(fileURLToPath(import.meta.url));
10
-
11
- // Entrypoints for the package
12
- const entrypoints = [
13
- { name: "index", input: "src/index.ts" },
14
- { name: "types", input: "src/types.ts" },
15
- { name: "errors", input: "src/errors.ts" },
16
- { name: "lexicons", input: "src/lexicons.ts" },
17
- { name: "storage", input: "src/storage.ts" },
18
- { name: "testing", input: "src/testing.ts" },
19
- ];
20
-
21
- // Common plugins for JS builds
22
- const getPlugins = () => [
23
- json(),
24
- typescript({
25
- tsconfig: resolve(__dirname, "tsconfig.json"),
26
- declaration: false,
27
- declarationMap: false,
28
- rootDir: resolve(__dirname, "src"),
29
- outDir: resolve(__dirname, "dist"),
30
- }),
31
- nodeResolve({
32
- preferBuiltins: true,
33
- }),
34
- commonjs(),
35
- ];
36
-
37
- // External dependencies check
38
- const external = (id) => !id.startsWith(".") && !id.startsWith("/");
39
-
40
- // Generate JS builds (ESM and CJS) for each entrypoint
41
- const jsBuild = entrypoints.map(({ name, input }) => ({
42
- input: resolve(__dirname, input),
43
- output: [
44
- {
45
- file: resolve(__dirname, `dist/${name}.mjs`),
46
- format: "es",
47
- sourcemap: true,
48
- },
49
- {
50
- file: resolve(__dirname, `dist/${name}.cjs`),
51
- format: "cjs",
52
- sourcemap: true,
53
- exports: "named",
54
- },
55
- ],
56
- plugins: getPlugins(),
57
- external,
58
- }));
59
-
60
- // Generate type declaration builds for each entrypoint
61
- const dtsBuild = entrypoints.map(({ name, input }) => ({
62
- input: resolve(__dirname, input),
63
- output: {
64
- file: resolve(__dirname, `dist/${name}.d.ts`),
65
- format: "es",
66
- },
67
- plugins: [
68
- dts({
69
- tsconfig: resolve(__dirname, "tsconfig.json"),
70
- }),
71
- ],
72
- external,
73
- }));
74
-
75
- export default [...jsBuild, ...dtsBuild];