@hypercerts-org/sdk-core 0.5.0-beta.0 → 0.6.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.
- package/dist/index.cjs +16 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +16 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -4
- package/.turbo/turbo-build.log +0 -40
- package/.turbo/turbo-test.log +0 -119
- package/CHANGELOG.md +0 -62
- package/eslint.config.mjs +0 -22
- package/rollup.config.js +0 -75
- package/src/auth/OAuthClient.ts +0 -497
- package/src/core/SDK.ts +0 -410
- package/src/core/config.ts +0 -243
- package/src/core/errors.ts +0 -257
- package/src/core/interfaces.ts +0 -324
- package/src/core/types.ts +0 -282
- package/src/errors.ts +0 -57
- package/src/index.ts +0 -107
- package/src/lexicons.ts +0 -64
- package/src/repository/BlobOperationsImpl.ts +0 -199
- package/src/repository/CollaboratorOperationsImpl.ts +0 -442
- package/src/repository/HypercertOperationsImpl.ts +0 -1146
- package/src/repository/LexiconRegistry.ts +0 -332
- package/src/repository/OrganizationOperationsImpl.ts +0 -282
- package/src/repository/ProfileOperationsImpl.ts +0 -281
- package/src/repository/RecordOperationsImpl.ts +0 -340
- package/src/repository/Repository.ts +0 -482
- package/src/repository/interfaces.ts +0 -909
- package/src/repository/types.ts +0 -111
- package/src/services/hypercerts/types.ts +0 -87
- package/src/storage/InMemorySessionStore.ts +0 -127
- package/src/storage/InMemoryStateStore.ts +0 -146
- package/src/storage.ts +0 -63
- package/src/testing/index.ts +0 -67
- package/src/testing/mocks.ts +0 -142
- package/src/testing/stores.ts +0 -285
- package/src/testing.ts +0 -64
- package/src/types.ts +0 -86
- package/tests/auth/OAuthClient.test.ts +0 -164
- package/tests/core/SDK.test.ts +0 -176
- package/tests/core/errors.test.ts +0 -81
- package/tests/repository/BlobOperationsImpl.test.ts +0 -155
- package/tests/repository/CollaboratorOperationsImpl.test.ts +0 -438
- package/tests/repository/HypercertOperationsImpl.test.ts +0 -652
- package/tests/repository/LexiconRegistry.test.ts +0 -192
- package/tests/repository/OrganizationOperationsImpl.test.ts +0 -240
- package/tests/repository/ProfileOperationsImpl.test.ts +0 -254
- package/tests/repository/RecordOperationsImpl.test.ts +0 -375
- package/tests/repository/Repository.test.ts +0 -149
- package/tests/utils/fixtures.ts +0 -117
- package/tests/utils/mocks.ts +0 -109
- package/tests/utils/repository-fixtures.ts +0 -78
- package/tsconfig.json +0 -11
- package/tsconfig.tsbuildinfo +0 -1
- package/vitest.config.ts +0 -30
package/dist/index.cjs
CHANGED
|
@@ -3119,23 +3119,24 @@ class CollaboratorOperationsImpl {
|
|
|
3119
3119
|
return "viewer";
|
|
3120
3120
|
}
|
|
3121
3121
|
/**
|
|
3122
|
-
*
|
|
3122
|
+
* Normalizes permissions from SDS API format to SDK format.
|
|
3123
3123
|
*
|
|
3124
|
-
* The SDS API returns permissions as an
|
|
3125
|
-
*
|
|
3124
|
+
* The SDS API returns permissions as an object with boolean flags
|
|
3125
|
+
* (e.g., `{ read: true, create: true, update: false, ... }`).
|
|
3126
|
+
* This method ensures all expected fields are present with default values.
|
|
3126
3127
|
*
|
|
3127
|
-
* @param
|
|
3128
|
-
* @returns
|
|
3128
|
+
* @param permissions - Permissions object from SDS API
|
|
3129
|
+
* @returns Normalized permission flags object
|
|
3129
3130
|
* @internal
|
|
3130
3131
|
*/
|
|
3131
|
-
parsePermissions(
|
|
3132
|
+
parsePermissions(permissions) {
|
|
3132
3133
|
return {
|
|
3133
|
-
read:
|
|
3134
|
-
create:
|
|
3135
|
-
update:
|
|
3136
|
-
delete:
|
|
3137
|
-
admin:
|
|
3138
|
-
owner:
|
|
3134
|
+
read: permissions.read ?? false,
|
|
3135
|
+
create: permissions.create ?? false,
|
|
3136
|
+
update: permissions.update ?? false,
|
|
3137
|
+
delete: permissions.delete ?? false,
|
|
3138
|
+
admin: permissions.admin ?? false,
|
|
3139
|
+
owner: permissions.owner ?? false,
|
|
3139
3140
|
};
|
|
3140
3141
|
}
|
|
3141
3142
|
/**
|
|
@@ -3773,6 +3774,9 @@ class Repository {
|
|
|
3773
3774
|
this.logger = logger;
|
|
3774
3775
|
// Create Agent with OAuth session
|
|
3775
3776
|
this.agent = new api.Agent(session);
|
|
3777
|
+
// Configure Agent to use the specified server URL (PDS or SDS)
|
|
3778
|
+
// This ensures queries are routed to the correct server
|
|
3779
|
+
this.agent.api.xrpc.uri = new URL(serverUrl);
|
|
3776
3780
|
this.lexiconRegistry.addToAgent(this.agent);
|
|
3777
3781
|
// Register hypercert lexicons
|
|
3778
3782
|
this.lexiconRegistry.registerMany(lexicon.HYPERCERT_LEXICONS);
|