@tdacorp/hyle-sdk 0.9.0 → 0.12.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.
Files changed (37) hide show
  1. package/README.md +111 -2
  2. package/bin/hyle-sdk-engage-keygen.mjs +3 -0
  3. package/dist/check-routes-bin.js +5 -1
  4. package/dist/{chunk-54JF4E53.js → chunk-N7ZQUAGM.js} +45 -2
  5. package/dist/chunk-R5EMI4HQ.js +61 -0
  6. package/dist/{chunk-XKR74Y5G.js → chunk-S7PCCEHP.js} +1 -1
  7. package/dist/{chunk-6LW33475.js → chunk-ZQFYH4FX.js} +538 -50
  8. package/dist/comments.cjs +1048 -0
  9. package/dist/comments.d.cts +152 -0
  10. package/dist/comments.d.ts +152 -0
  11. package/dist/comments.js +1025 -0
  12. package/dist/{types-BPPZrYOZ.d.cts → embed-DL5QIZRJ.d.ts} +44 -3
  13. package/dist/{types-C1eCQ2As.d.ts → embed-jCaSI31t.d.cts} +44 -3
  14. package/dist/engage-keygen-bin.js +67 -0
  15. package/dist/index.cjs +26 -1
  16. package/dist/index.d.cts +11 -3
  17. package/dist/index.d.ts +11 -3
  18. package/dist/index.js +5 -1
  19. package/dist/mermaid-diagram.js +9 -54
  20. package/dist/next.cjs +1010 -78
  21. package/dist/next.d.cts +163 -6
  22. package/dist/next.d.ts +163 -6
  23. package/dist/next.js +442 -14
  24. package/dist/react.cjs +340 -49
  25. package/dist/react.d.cts +112 -7
  26. package/dist/react.d.ts +112 -7
  27. package/dist/react.js +7 -1
  28. package/dist/{resolve-Dpb6Orsj.d.ts → resolve-DvmuBlpO.d.ts} +1 -1
  29. package/dist/{resolve-D2rnnho9.d.cts → resolve-f6IJ6SL9.d.cts} +1 -1
  30. package/dist/styles.css +117 -0
  31. package/dist/{types-CHxH5E0S.d.cts → types-5D6ZD0Wi.d.cts} +59 -1
  32. package/dist/{types-CHxH5E0S.d.ts → types-5D6ZD0Wi.d.ts} +59 -1
  33. package/dist/use-cache.cjs +5 -1
  34. package/dist/use-cache.d.cts +2 -2
  35. package/dist/use-cache.d.ts +2 -2
  36. package/dist/use-cache.js +2 -2
  37. package/package.json +4 -3
@@ -122,7 +122,11 @@ function createHyleClient(options) {
122
122
  if (opts.limit !== void 0) query.set("limit", String(opts.limit));
123
123
  const reply = await get("/cp1/read/resolve", query, opts.init);
124
124
  const data = reply.parsed?.data;
125
- if (data && data.cp === 1 && typeof data.kind === "string" && KINDS.has(data.kind)) return data;
125
+ if (data && data.cp === 1 && typeof data.kind === "string" && KINDS.has(data.kind)) {
126
+ const resolved = data;
127
+ if (resolved.kind === "article" && resolved.content.format === "html" && opts.format !== "html") throw failure(reply);
128
+ return resolved;
129
+ }
126
130
  throw failure(reply);
127
131
  }
128
132
  async function mounts(opts = {}) {
@@ -1,5 +1,5 @@
1
- import { H as HyleResolver } from './resolve-D2rnnho9.cjs';
2
- import './types-CHxH5E0S.cjs';
1
+ import { H as HyleResolver } from './resolve-f6IJ6SL9.cjs';
2
+ import './types-5D6ZD0Wi.cjs';
3
3
 
4
4
  /**
5
5
  * The exact caching strategy: a `'use cache'` function that fetches, then tags its own entry with the tags the response
@@ -1,5 +1,5 @@
1
- import { H as HyleResolver } from './resolve-Dpb6Orsj.js';
2
- import './types-CHxH5E0S.js';
1
+ import { H as HyleResolver } from './resolve-DvmuBlpO.js';
2
+ import './types-5D6ZD0Wi.js';
3
3
 
4
4
  /**
5
5
  * The exact caching strategy: a `'use cache'` function that fetches, then tags its own entry with the tags the response
package/dist/use-cache.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  DEFAULT_REVALIDATE
3
- } from "./chunk-XKR74Y5G.js";
3
+ } from "./chunk-S7PCCEHP.js";
4
4
  import {
5
5
  createHyleClient,
6
6
  isValidCacheTag
7
- } from "./chunk-54JF4E53.js";
7
+ } from "./chunk-N7ZQUAGM.js";
8
8
  import "./chunk-67IOIAVW.js";
9
9
 
10
10
  // src/next/use-cache.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tdacorp/hyle-sdk",
3
- "version": "0.9.0",
3
+ "version": "0.12.0",
4
4
  "description": "hyle SDK: a typed client for hyle's resolve endpoint, a hast renderer for React, and a Next.js catch-all page with tag-based revalidation.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -64,7 +64,8 @@
64
64
  "./package.json": "./package.json"
65
65
  },
66
66
  "bin": {
67
- "hyle-sdk-check-routes": "./bin/hyle-sdk-check-routes.mjs"
67
+ "hyle-sdk-check-routes": "./bin/hyle-sdk-check-routes.mjs",
68
+ "hyle-sdk-engage-keygen": "./bin/hyle-sdk-engage-keygen.mjs"
68
69
  },
69
70
  "main": "./dist/index.cjs",
70
71
  "module": "./dist/index.js",
@@ -101,7 +102,7 @@
101
102
  "tsup": "^8.5.1",
102
103
  "typescript": "^5.9.3",
103
104
  "vitest": "^4.1.10",
104
- "@hyle/renderer": "0.2.0"
105
+ "@hyle/renderer": "0.3.0"
105
106
  },
106
107
  "keywords": [
107
108
  "hyle",