@hypercerts-org/sdk-core 0.10.0-beta.1 → 0.10.0-beta.3
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 +18 -1
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.ts +8 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1083,22 +1083,27 @@ interface CreateHypercertParams {
|
|
|
1083
1083
|
description: string;
|
|
1084
1084
|
/**
|
|
1085
1085
|
* Scope of work or impact area.
|
|
1086
|
+
* Logical scope of the work using label-based conditions. All labels in `withinAllOf` must apply; at least one label in `withinAnyOf` must apply if provided; no label in `withinNoneOf` may apply.
|
|
1086
1087
|
*
|
|
1087
1088
|
* @example "Climate Action", "Education", "Healthcare"
|
|
1088
1089
|
*/
|
|
1089
|
-
workScope
|
|
1090
|
+
workScope?: {
|
|
1091
|
+
withinAllOf?: string[];
|
|
1092
|
+
withinAnyOf?: string[];
|
|
1093
|
+
withinNoneOf?: string[];
|
|
1094
|
+
};
|
|
1090
1095
|
/**
|
|
1091
1096
|
* Start date of the work period.
|
|
1092
1097
|
*
|
|
1093
1098
|
* ISO 8601 date format (YYYY-MM-DD).
|
|
1094
1099
|
*/
|
|
1095
|
-
|
|
1100
|
+
startDate: string;
|
|
1096
1101
|
/**
|
|
1097
1102
|
* End date of the work period.
|
|
1098
1103
|
*
|
|
1099
1104
|
* ISO 8601 date format (YYYY-MM-DD).
|
|
1100
1105
|
*/
|
|
1101
|
-
|
|
1106
|
+
endDate: string;
|
|
1102
1107
|
/**
|
|
1103
1108
|
* Rights associated with the hypercert.
|
|
1104
1109
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -3152,8 +3152,8 @@ class HypercertOperationsImpl extends EventEmitter {
|
|
|
3152
3152
|
shortDescription: params.shortDescription,
|
|
3153
3153
|
description: params.description,
|
|
3154
3154
|
workScope: params.workScope,
|
|
3155
|
-
|
|
3156
|
-
|
|
3155
|
+
startDate: params.startDate,
|
|
3156
|
+
endDate: params.endDate,
|
|
3157
3157
|
rights: { uri: rightsUri, cid: rightsCid },
|
|
3158
3158
|
createdAt,
|
|
3159
3159
|
};
|
|
@@ -3163,7 +3163,7 @@ class HypercertOperationsImpl extends EventEmitter {
|
|
|
3163
3163
|
if (params.evidence && params.evidence.length > 0) {
|
|
3164
3164
|
hypercertRecord.evidence = params.evidence;
|
|
3165
3165
|
}
|
|
3166
|
-
const hypercertValidation = validate(hypercertRecord, HYPERCERT_COLLECTIONS.CLAIM, "
|
|
3166
|
+
const hypercertValidation = validate(hypercertRecord, HYPERCERT_COLLECTIONS.CLAIM, "main", false);
|
|
3167
3167
|
if (!hypercertValidation.success) {
|
|
3168
3168
|
throw new ValidationError(`Invalid hypercert record: ${hypercertValidation.error?.message}`);
|
|
3169
3169
|
}
|
|
@@ -3669,7 +3669,7 @@ class HypercertOperationsImpl extends EventEmitter {
|
|
|
3669
3669
|
else {
|
|
3670
3670
|
// Use value as a URI reference
|
|
3671
3671
|
locationData = {
|
|
3672
|
-
$type: "
|
|
3672
|
+
$type: "org.hypercerts.defs#uri",
|
|
3673
3673
|
uri: location.value,
|
|
3674
3674
|
};
|
|
3675
3675
|
locationType = "coordinate-decimal";
|
|
@@ -4030,7 +4030,7 @@ class HypercertOperationsImpl extends EventEmitter {
|
|
|
4030
4030
|
throw new NetworkError("Failed to get collection");
|
|
4031
4031
|
}
|
|
4032
4032
|
// Validate with lexicon registry (more lenient - doesn't require $type)
|
|
4033
|
-
const validation = validate(result.data.value, HYPERCERT_COLLECTIONS.COLLECTION, "
|
|
4033
|
+
const validation = validate(result.data.value, HYPERCERT_COLLECTIONS.COLLECTION, "main", false);
|
|
4034
4034
|
if (!validation.success) {
|
|
4035
4035
|
throw new ValidationError(`Invalid collection record format: ${validation.error?.message}`);
|
|
4036
4036
|
}
|