@actuate-media/client 0.2.0 → 0.2.2
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/LICENSE +21 -0
- package/dist/next.d.ts +8 -1
- package/dist/next.d.ts.map +1 -1
- package/dist/next.js +10 -10
- package/dist/next.js.map +1 -1
- package/package.json +9 -9
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Actuate Media
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/next.d.ts
CHANGED
|
@@ -45,7 +45,14 @@ export declare function createNextClient<Config extends ActuateConfigLike = Actu
|
|
|
45
45
|
export declare function actuateTag(kind: 'collection' | 'global', slug: string): string;
|
|
46
46
|
/**
|
|
47
47
|
* Quick-helper to fetch a single document by URL path inside a Server
|
|
48
|
-
* Component. Returns `null`
|
|
48
|
+
* Component. Returns `null` when no document matches the path.
|
|
49
|
+
*
|
|
50
|
+
* @remarks Thin re-export of {@link ActuateClient.resolve} kept for
|
|
51
|
+
* Server-Component ergonomics (you can pass the client as the first arg
|
|
52
|
+
* without wrapping in a closure). `client.resolve()` already returns
|
|
53
|
+
* `null` on 404 as of `@actuate-media/client@0.2.1`, so this helper does
|
|
54
|
+
* not catch any additional errors — non-404 failures still throw, which
|
|
55
|
+
* is what you want inside Server Components (Next.js renders a 500).
|
|
49
56
|
*/
|
|
50
57
|
export declare function resolvePagePath<Config extends ActuateConfigLike>(client: ActuateClient<Config>, path: string): Promise<ActuateDocument | null>;
|
|
51
58
|
export type { ActuateClientOptions, ActuateDocument, ActuateList } from './index.js';
|
package/dist/next.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,aAAa,EAAgB,MAAM,YAAY,CAAA;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAe,MAAM,YAAY,CAAA;AACpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,UAAU,EAAa,MAAM,YAAY,CAAA;AAE1F,MAAM,WAAW,wBAAyB,SAAQ,oBAAoB;IACpE,4FAA4F;IAC5F,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;IAC3B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;CAChB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,SAAS,iBAAiB,GAAG,iBAAiB,EACnF,IAAI,EAAE,wBAAwB,GAC7B,aAAa,CAAC,MAAM,CAAC,CAUvB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iB,EAChC,IAAI,SAAS,MAAM,WAAW,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,MAAM,IAC5D,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;AAEhC,MAAM,MAAM,YAAY,CACtB,MAAM,SAAS,iBAAiB,EAChC,IAAI,SAAS,MAAM,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,MAAM,IACxD,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;AAE5B,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/next.js
CHANGED
|
@@ -44,17 +44,17 @@ export function actuateTag(kind, slug) {
|
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* Quick-helper to fetch a single document by URL path inside a Server
|
|
47
|
-
* Component. Returns `null`
|
|
47
|
+
* Component. Returns `null` when no document matches the path.
|
|
48
|
+
*
|
|
49
|
+
* @remarks Thin re-export of {@link ActuateClient.resolve} kept for
|
|
50
|
+
* Server-Component ergonomics (you can pass the client as the first arg
|
|
51
|
+
* without wrapping in a closure). `client.resolve()` already returns
|
|
52
|
+
* `null` on 404 as of `@actuate-media/client@0.2.1`, so this helper does
|
|
53
|
+
* not catch any additional errors — non-404 failures still throw, which
|
|
54
|
+
* is what you want inside Server Components (Next.js renders a 500).
|
|
48
55
|
*/
|
|
49
|
-
export
|
|
50
|
-
|
|
51
|
-
return await client.resolve(path);
|
|
52
|
-
}
|
|
53
|
-
catch (err) {
|
|
54
|
-
if (err?.status === 404)
|
|
55
|
-
return null;
|
|
56
|
-
throw err;
|
|
57
|
-
}
|
|
56
|
+
export function resolvePagePath(client, path) {
|
|
57
|
+
return client.resolve(path);
|
|
58
58
|
}
|
|
59
59
|
export { ActuateClient, ActuateError, createClient } from './index.js';
|
|
60
60
|
//# sourceMappingURL=next.js.map
|
package/dist/next.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.js","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAiB,YAAY,EAAE,MAAM,YAAY,CAAA;AAgBxD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,gBAAgB,CAC9B,IAA8B;IAE9B,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAA;IAC1C,OAAO,YAAY,CAAS;QAC1B,GAAG,IAAI;QACP,YAAY,EAAE;YACZ,GAAG,CAAC,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACzD,GAAG,CAAC,UAAU,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,KAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC/D,IAAI,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC;SAC1B;KACF,CAAC,CAAA;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,IAA6B,EAAE,IAAY;IACpE,OAAO,WAAW,IAAI,IAAI,IAAI,EAAE,CAAA;AAClC,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"next.js","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAiB,YAAY,EAAE,MAAM,YAAY,CAAA;AAgBxD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,gBAAgB,CAC9B,IAA8B;IAE9B,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAA;IAC1C,OAAO,YAAY,CAAS;QAC1B,GAAG,IAAI;QACP,YAAY,EAAE;YACZ,GAAG,CAAC,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACzD,GAAG,CAAC,UAAU,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,KAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC/D,IAAI,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC;SAC1B;KACF,CAAC,CAAA;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,IAA6B,EAAE,IAAY;IACpE,OAAO,WAAW,IAAI,IAAI,IAAI,EAAE,CAAA;AAClC,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAC7B,MAA6B,EAC7B,IAAY;IAEZ,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AAC7B,CAAC;AAID,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@actuate-media/client",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Type-safe HTTP client and React hooks for the Actuate CMS REST API.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,13 +33,6 @@
|
|
|
33
33
|
"files": [
|
|
34
34
|
"dist"
|
|
35
35
|
],
|
|
36
|
-
"scripts": {
|
|
37
|
-
"build": "tsc --project tsconfig.json",
|
|
38
|
-
"dev": "tsc --project tsconfig.json --watch --preserveWatchOutput",
|
|
39
|
-
"type-check": "tsc --noEmit",
|
|
40
|
-
"test": "vitest run",
|
|
41
|
-
"clean": "rm -rf dist .turbo"
|
|
42
|
-
},
|
|
43
36
|
"peerDependencies": {
|
|
44
37
|
"react": ">=18.0.0"
|
|
45
38
|
},
|
|
@@ -53,5 +46,12 @@
|
|
|
53
46
|
"react": "^19.2.0",
|
|
54
47
|
"typescript": "^5.7.0",
|
|
55
48
|
"vitest": "^3.0.0"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "tsc --project tsconfig.json",
|
|
52
|
+
"dev": "tsc --project tsconfig.json --watch --preserveWatchOutput",
|
|
53
|
+
"type-check": "tsc --noEmit",
|
|
54
|
+
"test": "vitest run",
|
|
55
|
+
"clean": "rm -rf dist .turbo"
|
|
56
56
|
}
|
|
57
|
-
}
|
|
57
|
+
}
|