@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.mjs
CHANGED
|
@@ -3118,23 +3118,24 @@ class CollaboratorOperationsImpl {
|
|
|
3118
3118
|
return "viewer";
|
|
3119
3119
|
}
|
|
3120
3120
|
/**
|
|
3121
|
-
*
|
|
3121
|
+
* Normalizes permissions from SDS API format to SDK format.
|
|
3122
3122
|
*
|
|
3123
|
-
* The SDS API returns permissions as an
|
|
3124
|
-
*
|
|
3123
|
+
* The SDS API returns permissions as an object with boolean flags
|
|
3124
|
+
* (e.g., `{ read: true, create: true, update: false, ... }`).
|
|
3125
|
+
* This method ensures all expected fields are present with default values.
|
|
3125
3126
|
*
|
|
3126
|
-
* @param
|
|
3127
|
-
* @returns
|
|
3127
|
+
* @param permissions - Permissions object from SDS API
|
|
3128
|
+
* @returns Normalized permission flags object
|
|
3128
3129
|
* @internal
|
|
3129
3130
|
*/
|
|
3130
|
-
parsePermissions(
|
|
3131
|
+
parsePermissions(permissions) {
|
|
3131
3132
|
return {
|
|
3132
|
-
read:
|
|
3133
|
-
create:
|
|
3134
|
-
update:
|
|
3135
|
-
delete:
|
|
3136
|
-
admin:
|
|
3137
|
-
owner:
|
|
3133
|
+
read: permissions.read ?? false,
|
|
3134
|
+
create: permissions.create ?? false,
|
|
3135
|
+
update: permissions.update ?? false,
|
|
3136
|
+
delete: permissions.delete ?? false,
|
|
3137
|
+
admin: permissions.admin ?? false,
|
|
3138
|
+
owner: permissions.owner ?? false,
|
|
3138
3139
|
};
|
|
3139
3140
|
}
|
|
3140
3141
|
/**
|
|
@@ -3772,6 +3773,9 @@ class Repository {
|
|
|
3772
3773
|
this.logger = logger;
|
|
3773
3774
|
// Create Agent with OAuth session
|
|
3774
3775
|
this.agent = new Agent(session);
|
|
3776
|
+
// Configure Agent to use the specified server URL (PDS or SDS)
|
|
3777
|
+
// This ensures queries are routed to the correct server
|
|
3778
|
+
this.agent.api.xrpc.uri = new URL(serverUrl);
|
|
3775
3779
|
this.lexiconRegistry.addToAgent(this.agent);
|
|
3776
3780
|
// Register hypercert lexicons
|
|
3777
3781
|
this.lexiconRegistry.registerMany(HYPERCERT_LEXICONS);
|