@seed-hypermedia/client 0.0.56 → 0.0.58

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.
@@ -280,7 +280,7 @@ var HMDocumentMetadataSchema = z.object({
280
280
  // Import taxonomy fields (comma-separated values from external sources like WordPress)
281
281
  importCategories: z.string().optional(),
282
282
  importTags: z.string().optional()
283
- });
283
+ }).passthrough();
284
284
  function hmMetadataJsonCorrection(metadata) {
285
285
  if (typeof metadata.theme === "string") {
286
286
  return {
@@ -290,6 +290,17 @@ function hmMetadataJsonCorrection(metadata) {
290
290
  }
291
291
  return metadata;
292
292
  }
293
+ var BUILTIN_METADATA_KEYS = new Set(Object.keys(HMDocumentMetadataSchema.shape));
294
+ function countCustomMetadataFields(metadata) {
295
+ if (!metadata) return 0;
296
+ let count = 0;
297
+ for (const [key, value] of Object.entries(metadata)) {
298
+ if (BUILTIN_METADATA_KEYS.has(key)) continue;
299
+ if (value === void 0 || value === null) continue;
300
+ count++;
301
+ }
302
+ return count;
303
+ }
293
304
  var visibilityMap = {
294
305
  0: "PUBLIC",
295
306
  1: "PUBLIC",
@@ -1096,6 +1107,23 @@ var HMListDomainsRequestSchema = z.object({
1096
1107
  input: HMListDomainsInputSchema,
1097
1108
  output: HMListDomainsOutputSchema
1098
1109
  });
1110
+ var HMDiscoveryStatusInputSchema = z.object({
1111
+ uid: z.string(),
1112
+ path: z.array(z.string()),
1113
+ version: z.string().optional(),
1114
+ /** Accept any discovered version as success, not just `version`. */
1115
+ latest: z.boolean().optional()
1116
+ });
1117
+ var HMDiscoveryStatusOutputSchema = z.object({
1118
+ state: z.enum(["pending", "found", "failed"]),
1119
+ version: z.string().optional(),
1120
+ error: z.string().optional()
1121
+ });
1122
+ var HMDiscoveryStatusRequestSchema = z.object({
1123
+ key: z.literal("DiscoveryStatus"),
1124
+ input: HMDiscoveryStatusInputSchema,
1125
+ output: HMDiscoveryStatusOutputSchema
1126
+ });
1099
1127
  var HMGetRequestSchema = z.discriminatedUnion("key", [
1100
1128
  HMResourceRequestSchema,
1101
1129
  HMResourceMetadataRequestSchema,
@@ -1121,7 +1149,8 @@ var HMGetRequestSchema = z.discriminatedUnion("key", [
1121
1149
  HMInteractionSummaryRequestSchema,
1122
1150
  HMListCommentVersionsRequestSchema,
1123
1151
  HMGetDomainRequestSchema,
1124
- HMListDomainsRequestSchema
1152
+ HMListDomainsRequestSchema,
1153
+ HMDiscoveryStatusRequestSchema
1125
1154
  ]);
1126
1155
  var HMActionSchema = z.discriminatedUnion("key", [
1127
1156
  HMPublishBlobsRequestSchema,
@@ -1153,6 +1182,7 @@ var HMRequestSchema = z.discriminatedUnion("key", [
1153
1182
  HMListCommentVersionsRequestSchema,
1154
1183
  HMGetDomainRequestSchema,
1155
1184
  HMListDomainsRequestSchema,
1185
+ HMDiscoveryStatusRequestSchema,
1156
1186
  HMPublishBlobsRequestSchema,
1157
1187
  HMPrepareDocumentChangeRequestSchema
1158
1188
  ]);
@@ -1349,6 +1379,8 @@ export {
1349
1379
  HMBlockNodeSchema,
1350
1380
  HMDocumentMetadataSchema,
1351
1381
  hmMetadataJsonCorrection,
1382
+ BUILTIN_METADATA_KEYS,
1383
+ countCustomMetadataFields,
1352
1384
  HMResourceVisibilitySchema,
1353
1385
  HMCommentSchema,
1354
1386
  HMBreadcrumbSchema,
@@ -1478,6 +1510,9 @@ export {
1478
1510
  HMListDomainsInputSchema,
1479
1511
  HMListDomainsOutputSchema,
1480
1512
  HMListDomainsRequestSchema,
1513
+ HMDiscoveryStatusInputSchema,
1514
+ HMDiscoveryStatusOutputSchema,
1515
+ HMDiscoveryStatusRequestSchema,
1481
1516
  HMGetRequestSchema,
1482
1517
  HMActionSchema,
1483
1518
  HMRequestSchema,