@hypercerts-org/sdk-core 0.10.0-beta.2 → 0.10.0-beta.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @hypercerts-org/sdk-core
2
2
 
3
+ ## 0.10.0-beta.4
4
+
5
+ ### Minor Changes
6
+
7
+ - [#80](https://github.com/hypercerts-org/hypercerts-sdk/pull/80)
8
+ [`3419471`](https://github.com/hypercerts-org/hypercerts-sdk/commit/34194710cae3a53b4106d8b8dc4007505a8b5f0a) Thanks
9
+ [@Kzoeps](https://github.com/Kzoeps)! - Update the params for create organization. Created a separate interface for
10
+ it. Changed the params from handle to handlePrefix as expected by the actual `sds.organizations.create` procedure
11
+ call. Added validation to check the required parameters in the call
12
+
13
+ ### Patch Changes
14
+
15
+ - [#79](https://github.com/hypercerts-org/hypercerts-sdk/pull/79)
16
+ [`48ecd6c`](https://github.com/hypercerts-org/hypercerts-sdk/commit/48ecd6cfddfb13a6c155df7c6618965dd2157253) Thanks
17
+ [@Kzoeps](https://github.com/Kzoeps)! - Remove validation from hypercert.get
18
+
19
+ ## 0.10.0-beta.3
20
+
21
+ ### Minor Changes
22
+
23
+ - [#72](https://github.com/hypercerts-org/hypercerts-sdk/pull/72)
24
+ [`31dc76a`](https://github.com/hypercerts-org/hypercerts-sdk/commit/31dc76ae819f4c53e1a411a7fc6c0a6239552a66) Thanks
25
+ [@Kzoeps](https://github.com/Kzoeps)! - Fixed params for creation to mirror the lexicon types. Remove extra `#` to
26
+ remove duplicate # created during validation which fails the validation.
27
+
3
28
  ## 0.10.0-beta.2
4
29
 
5
30
  ### Patch Changes
package/README.md CHANGED
@@ -20,6 +20,11 @@ const sdk = createATProtoSDK({
20
20
  jwksUri: "https://your-app.com/jwks.json",
21
21
  jwkPrivate: process.env.ATPROTO_JWK_PRIVATE!,
22
22
  },
23
+ // set up with your pds url.
24
+ // entryway doesn't work for this. Has to be a PDS URL.
25
+ servers: {
26
+ pds: "https://pds-eu-west4.test.certified.app",
27
+ },
23
28
  });
24
29
 
25
30
  // 2. Authenticate user
package/dist/index.cjs CHANGED
@@ -3153,8 +3153,8 @@ class HypercertOperationsImpl extends eventemitter3.EventEmitter {
3153
3153
  shortDescription: params.shortDescription,
3154
3154
  description: params.description,
3155
3155
  workScope: params.workScope,
3156
- workTimeFrameFrom: params.workTimeFrameFrom,
3157
- workTimeFrameTo: params.workTimeFrameTo,
3156
+ startDate: params.startDate,
3157
+ endDate: params.endDate,
3158
3158
  rights: { uri: rightsUri, cid: rightsCid },
3159
3159
  createdAt,
3160
3160
  };
@@ -3164,7 +3164,7 @@ class HypercertOperationsImpl extends eventemitter3.EventEmitter {
3164
3164
  if (params.evidence && params.evidence.length > 0) {
3165
3165
  hypercertRecord.evidence = params.evidence;
3166
3166
  }
3167
- const hypercertValidation = lexicon.validate(hypercertRecord, HYPERCERT_COLLECTIONS.CLAIM, "#main", false);
3167
+ const hypercertValidation = lexicon.validate(hypercertRecord, HYPERCERT_COLLECTIONS.CLAIM, "main", false);
3168
3168
  if (!hypercertValidation.success) {
3169
3169
  throw new ValidationError(`Invalid hypercert record: ${hypercertValidation.error?.message}`);
3170
3170
  }
@@ -3500,11 +3500,6 @@ class HypercertOperationsImpl extends eventemitter3.EventEmitter {
3500
3500
  if (!result.success) {
3501
3501
  throw new NetworkError("Failed to get hypercert");
3502
3502
  }
3503
- // Validate with lexicon (more lenient - doesn't require $type)
3504
- const validation = lexicon.validate(result.data.value, HYPERCERT_COLLECTIONS.CLAIM, "main", false);
3505
- if (!validation.success) {
3506
- throw new ValidationError(`Invalid hypercert record format: ${validation.error?.message}`);
3507
- }
3508
3503
  return {
3509
3504
  uri: result.data.uri,
3510
3505
  cid: result.data.cid ?? "",
@@ -3670,7 +3665,7 @@ class HypercertOperationsImpl extends eventemitter3.EventEmitter {
3670
3665
  else {
3671
3666
  // Use value as a URI reference
3672
3667
  locationData = {
3673
- $type: "app.certified.defs#uri",
3668
+ $type: "org.hypercerts.defs#uri",
3674
3669
  uri: location.value,
3675
3670
  };
3676
3671
  locationType = "coordinate-decimal";
@@ -4031,7 +4026,7 @@ class HypercertOperationsImpl extends eventemitter3.EventEmitter {
4031
4026
  throw new NetworkError("Failed to get collection");
4032
4027
  }
4033
4028
  // Validate with lexicon registry (more lenient - doesn't require $type)
4034
- const validation = lexicon.validate(result.data.value, HYPERCERT_COLLECTIONS.COLLECTION, "#main", false);
4029
+ const validation = lexicon.validate(result.data.value, HYPERCERT_COLLECTIONS.COLLECTION, "main", false);
4035
4030
  if (!validation.success) {
4036
4031
  throw new ValidationError(`Invalid collection record format: ${validation.error?.message}`);
4037
4032
  }
@@ -4600,6 +4595,12 @@ class OrganizationOperationsImpl {
4600
4595
  if (!userDid) {
4601
4596
  throw new NetworkError("No authenticated user found");
4602
4597
  }
4598
+ if (!params.handlePrefix) {
4599
+ throw new ValidationError("Missing handlePrefix");
4600
+ }
4601
+ if (!params.name) {
4602
+ throw new ValidationError("Missing name");
4603
+ }
4603
4604
  const response = await this.session.fetchHandler(`${this.serverUrl}/xrpc/com.sds.organization.create`, {
4604
4605
  method: "POST",
4605
4606
  headers: { "Content-Type": "application/json" },