gitverse-release 3.7.0 → 4.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.
@@ -3,6 +3,50 @@ import type { GitRepoInfo } from "./types";
3
3
  * Retry функция type
4
4
  */
5
5
  export type RetryFunction = <T>(fn: () => Promise<T>, operationName?: string) => Promise<T>;
6
+ /**
7
+ * Имя переменной окружения для токена
8
+ */
9
+ export declare const TOKEN_ENV_VAR = "GVR_TOKEN";
10
+ /**
11
+ * Устаревшее имя переменной (для обратной совместимости)
12
+ * @deprecated Используйте GVR_TOKEN
13
+ */
14
+ export declare const LEGACY_TOKEN_ENV_VAR = "GITVERSE_TOKEN";
15
+ /**
16
+ * Результат валидации токена
17
+ */
18
+ export interface TokenValidationResult {
19
+ /** Валиден ли токен */
20
+ valid: boolean;
21
+ /** Имя пользователя (если токен валиден) */
22
+ username?: string;
23
+ /** Сообщение об ошибке (если токен невалиден) */
24
+ error?: string;
25
+ }
26
+ /**
27
+ * Результат получения токена
28
+ */
29
+ interface TokenResult {
30
+ /** Токен */
31
+ token: string;
32
+ /** Имя переменной из которой получен токен */
33
+ source: string;
34
+ /** Использован ли устаревший способ */
35
+ isLegacy: boolean;
36
+ }
37
+ /**
38
+ * Проверяет, запущен ли скрипт в GitVerse Actions CI
39
+ */
40
+ export declare function isGitVerseActionsCI(): boolean;
41
+ /**
42
+ * Получает токен из переменных окружения
43
+ * Приоритет: GVR_TOKEN > GITVERSE_TOKEN (legacy, требует проверки)
44
+ */
45
+ export declare function getToken(): TokenResult | null;
46
+ /**
47
+ * Генерирует сообщение об ошибке отсутствия токена
48
+ */
49
+ export declare function getTokenNotFoundError(): string;
6
50
  /**
7
51
  * GitVerse API клиент для создания релизов
8
52
  */
@@ -11,6 +55,10 @@ export declare class GitVerseReleaseClient {
11
55
  private repoInfo;
12
56
  private retryFn?;
13
57
  constructor(token: string, repoInfo: GitRepoInfo, retryFn?: RetryFunction);
58
+ /**
59
+ * Проверяет валидность токена через API
60
+ */
61
+ validateToken(): Promise<TokenValidationResult>;
14
62
  /**
15
63
  * Создает релиз на GitVerse
16
64
  */
@@ -29,5 +77,15 @@ export declare class GitVerseReleaseClient {
29
77
  }
30
78
  /**
31
79
  * Создает клиент для работы с GitVerse API
80
+ * Примечание: validateGitVerseToken() должен быть вызван до этой функции
81
+ * для проверки токена и вывода deprecation warnings
32
82
  */
33
83
  export declare function createGitVerseClient(repoInfo: GitRepoInfo, retryFn?: RetryFunction): GitVerseReleaseClient;
84
+ /**
85
+ * Проверяет наличие и валидность токена до начала релиза
86
+ *
87
+ * @param repoInfo Информация о репозитории
88
+ * @returns Результат валидации токена
89
+ */
90
+ export declare function validateGitVerseToken(repoInfo: GitRepoInfo): Promise<TokenValidationResult>;
91
+ export {};
package/dist/index.d.ts CHANGED
@@ -10,6 +10,7 @@ export declare function release(packageName?: string, options?: CliOptions): Pro
10
10
  export declare function createReleaseOnly(tag: string, packageName?: string, configPath?: string): Promise<ReleaseResult>;
11
11
  export { generateBinaryPackages, publishBinaries } from "./binaries";
12
12
  export { configExists, DEFAULT_BINARIES_CONFIG, DEFAULT_BINARY_PLATFORMS, DEFAULT_CONFIG_FILE_NAME, generateConfigContent, initConfig, loadConfig, validateBinariesConfig, validateConfig, } from "./config";
13
- export { createGitVerseClient } from "./gitverse";
13
+ export type { TokenValidationResult } from "./gitverse";
14
+ export { createGitVerseClient, getToken, getTokenNotFoundError, isGitVerseActionsCI, LEGACY_TOKEN_ENV_VAR, TOKEN_ENV_VAR, validateGitVerseToken, } from "./gitverse";
14
15
  export * from "./types";
15
16
  export { ALL_PLATFORMS, expandPlaceholders, getBinaryPath, getPackageName, getPackageOutputPath, getPlatformDir, isValidPlatform, PLATFORM_MAPPINGS, parsePlatforms, platformToNodeValues, validateAllBinaries, validateBinaryExists, } from "./utils/binary-platforms";