clipugc 1.2.2 → 1.3.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/dist/types/index.d.ts +1 -1
- package/dist/utils/config.d.ts +7 -1
- package/dist/utils/config.js +12 -2
- package/dist/utils/config.js.map +1 -1
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
/** Persisted CLI configuration (~/.config/clipugc/config.json). */
|
|
9
9
|
export interface ClipUgcConfig {
|
|
10
|
-
/** API base URL, e.g. https://clipugc.com/api/
|
|
10
|
+
/** API base URL, e.g. https://clipugc.com/api/v2 */
|
|
11
11
|
apiBaseUrl: string;
|
|
12
12
|
/** Sanctum personal access token created from the ClipUGC dashboard. */
|
|
13
13
|
apiKey: string;
|
package/dist/utils/config.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import type { ClipUgcConfig } from '../types/index.js';
|
|
2
|
-
export declare const DEFAULT_API_BASE_URL = "https://clipugc.com/api/
|
|
2
|
+
export declare const DEFAULT_API_BASE_URL = "https://clipugc.com/api/v2";
|
|
3
|
+
/**
|
|
4
|
+
* The default up to 1.2.x: saveConfig writes the whole config, so installs carry it in
|
|
5
|
+
* config.json. Read as the current default; a custom URL is left alone. /api/v1 keeps
|
|
6
|
+
* working on the server for older CLI versions.
|
|
7
|
+
*/
|
|
8
|
+
export declare const LEGACY_DEFAULT_API_BASE_URL = "https://clipugc.com/api/v1";
|
|
3
9
|
export declare function getConfigDir(): string;
|
|
4
10
|
export declare function getConfigPath(): string;
|
|
5
11
|
export declare function getDefaultConfig(): ClipUgcConfig;
|
package/dist/utils/config.js
CHANGED
|
@@ -3,7 +3,13 @@ import os from 'node:os';
|
|
|
3
3
|
import fs from 'fs-extra';
|
|
4
4
|
const CONFIG_DIR = path.join(os.homedir(), '.config', 'clipugc');
|
|
5
5
|
const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
|
|
6
|
-
export const DEFAULT_API_BASE_URL = 'https://clipugc.com/api/
|
|
6
|
+
export const DEFAULT_API_BASE_URL = 'https://clipugc.com/api/v2';
|
|
7
|
+
/**
|
|
8
|
+
* The default up to 1.2.x: saveConfig writes the whole config, so installs carry it in
|
|
9
|
+
* config.json. Read as the current default; a custom URL is left alone. /api/v1 keeps
|
|
10
|
+
* working on the server for older CLI versions.
|
|
11
|
+
*/
|
|
12
|
+
export const LEGACY_DEFAULT_API_BASE_URL = 'https://clipugc.com/api/v1';
|
|
7
13
|
const DEFAULT_CONFIG = {
|
|
8
14
|
apiBaseUrl: DEFAULT_API_BASE_URL,
|
|
9
15
|
apiKey: '',
|
|
@@ -23,7 +29,11 @@ export async function loadConfig() {
|
|
|
23
29
|
const file = getConfigPath();
|
|
24
30
|
if (await fs.pathExists(file)) {
|
|
25
31
|
const raw = await fs.readJson(file);
|
|
26
|
-
|
|
32
|
+
const config = { ...DEFAULT_CONFIG, ...raw };
|
|
33
|
+
if (config.apiBaseUrl.replace(/\/+$/, '') === LEGACY_DEFAULT_API_BASE_URL) {
|
|
34
|
+
config.apiBaseUrl = DEFAULT_API_BASE_URL;
|
|
35
|
+
}
|
|
36
|
+
return config;
|
|
27
37
|
}
|
|
28
38
|
}
|
|
29
39
|
catch {
|
package/dist/utils/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,UAAU,CAAC;AAG1B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AACjE,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;A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,GAAG,MAAM,UAAU,EAAE,CAAC;IAClC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,GAAwB,EAAE,KAAa;IAC1E,MAAM,MAAM,GAAG,MAAM,UAAU,EAAE,CAAC;IAClC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACpB,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,OAAO,GAAG,IAAI,cAAc,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,MAAM,CAAC,IAAI,CAAC,cAAc,CAA4B,CAAC;AAChE,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,OAAO,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,CAAC,MAAM,UAAU,EAAE,CAAC,CAAC,MAAM,IAAI,EAAE,CAAC;AAC1E,CAAC;AAED,sFAAsF;AACtF,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACrC,OAAO,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,CAAC,MAAM,UAAU,EAAE,CAAC,CAAC,UAAU,IAAI,oBAAoB,CAAC;AACrG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clipugc",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Official CLI for ClipUGC — create AI characters, generate looks, and produce UGC-style videos for your mobile app from the terminal.",
|
|
5
5
|
"mcpName": "io.github.clipugc/clipugc",
|
|
6
6
|
"type": "module",
|