@better-i18n/sdk 0.4.0 → 1.0.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.
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/content-api.ts +4 -4
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ClientConfig, ContentClient } from "./types";
|
|
2
2
|
import { createContentAPIClient } from "./content-api";
|
|
3
3
|
|
|
4
|
-
const DEFAULT_API_BASE = "https://
|
|
4
|
+
const DEFAULT_API_BASE = "https://content.better-i18n.com";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Creates a Better i18n content client.
|
package/src/content-api.ts
CHANGED
|
@@ -15,9 +15,9 @@ import type {
|
|
|
15
15
|
* Requires an API key for authentication via the `x-api-key` header.
|
|
16
16
|
*
|
|
17
17
|
* URL patterns:
|
|
18
|
-
* - Models: `{apiBase}/
|
|
19
|
-
* - Entries: `{apiBase}/
|
|
20
|
-
* - Entry: `{apiBase}/
|
|
18
|
+
* - Models: `{apiBase}/v1/content/{org}/{project}/models`
|
|
19
|
+
* - Entries: `{apiBase}/v1/content/{org}/{project}/models/{model}/entries`
|
|
20
|
+
* - Entry: `{apiBase}/v1/content/{org}/{project}/models/{model}/entries/{slug}`
|
|
21
21
|
*/
|
|
22
22
|
export function createContentAPIClient(
|
|
23
23
|
apiBase: string,
|
|
@@ -26,7 +26,7 @@ export function createContentAPIClient(
|
|
|
26
26
|
apiKey: string,
|
|
27
27
|
debug = false,
|
|
28
28
|
): ContentClient {
|
|
29
|
-
const base = `${apiBase}/
|
|
29
|
+
const base = `${apiBase}/v1/content/${org}/${project}`;
|
|
30
30
|
const headers: Record<string, string> = {
|
|
31
31
|
"x-api-key": apiKey,
|
|
32
32
|
"content-type": "application/json",
|