@rdmind/rdmind 0.0.9 → 0.0.11
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/package.json +2 -2
- package/dist/src/config/settingsSchema.d.ts +1 -1
- package/dist/src/config/settingsSchema.js +1 -1
- package/dist/src/config/settingsSchema.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +2 -2
- package/dist/src/generated/git-commit.js +2 -2
- package/dist/src/generated/git-commit.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.js +0 -4
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.test.js +0 -1
- package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -1
- package/dist/src/ui/App.js +2 -11
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/commands/docsCommand.js +1 -1
- package/dist/src/ui/commands/types.d.ts +1 -1
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/components/Tips.js +1 -1
- package/dist/src/ui/components/Tips.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.js +1 -5
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useDialogClose.d.ts +0 -2
- package/dist/src/ui/hooks/useDialogClose.js +0 -5
- package/dist/src/ui/hooks/useDialogClose.js.map +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.js +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/src/ui/commands/privacyCommand.d.ts +0 -7
- package/dist/src/ui/commands/privacyCommand.js +0 -16
- package/dist/src/ui/commands/privacyCommand.js.map +0 -1
- package/dist/src/ui/commands/setupGithubCommand.d.ts +0 -9
- package/dist/src/ui/commands/setupGithubCommand.js +0 -154
- package/dist/src/ui/commands/setupGithubCommand.js.map +0 -1
- package/dist/src/ui/commands/setupGithubCommand.test.d.ts +0 -6
- package/dist/src/ui/commands/setupGithubCommand.test.js +0 -167
- package/dist/src/ui/commands/setupGithubCommand.test.js.map +0 -1
- package/dist/src/ui/hooks/usePrivacySettings.d.ts +0 -16
- package/dist/src/ui/hooks/usePrivacySettings.js +0 -119
- package/dist/src/ui/hooks/usePrivacySettings.js.map +0 -1
- package/dist/src/ui/hooks/usePrivacySettings.test.d.ts +0 -6
- package/dist/src/ui/hooks/usePrivacySettings.test.js +0 -154
- package/dist/src/ui/hooks/usePrivacySettings.test.js.map +0 -1
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.d.ts +0 -12
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +0 -41
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +0 -1
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.d.ts +0 -10
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js +0 -18
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js.map +0 -1
- package/dist/src/ui/privacy/GeminiPrivacyNotice.d.ts +0 -10
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js +0 -18
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js.map +0 -1
- package/dist/src/ui/privacy/PrivacyNotice.d.ts +0 -12
- package/dist/src/ui/privacy/PrivacyNotice.js +0 -25
- package/dist/src/ui/privacy/PrivacyNotice.js.map +0 -1
- package/dist/src/utils/gitUtils.d.ts +0 -30
- package/dist/src/utils/gitUtils.js +0 -89
- package/dist/src/utils/gitUtils.js.map +0 -1
- package/dist/src/utils/gitUtils.test.d.ts +0 -6
- package/dist/src/utils/gitUtils.test.js +0 -113
- package/dist/src/utils/gitUtils.test.js.map +0 -1
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
7
|
-
import { renderHook, waitFor } from '@testing-library/react';
|
|
8
|
-
import { CodeAssistServer, LoggingContentGenerator, UserTierId, } from '@rdmind/rdmind-core';
|
|
9
|
-
import { usePrivacySettings } from './usePrivacySettings.js';
|
|
10
|
-
// Mock the dependencies
|
|
11
|
-
vi.mock('@rdmind/rdmind-core', () => {
|
|
12
|
-
// Mock classes for instanceof checks
|
|
13
|
-
class MockCodeAssistServer {
|
|
14
|
-
projectId = 'test-project-id';
|
|
15
|
-
loadCodeAssist = vi.fn();
|
|
16
|
-
getCodeAssistGlobalUserSetting = vi.fn();
|
|
17
|
-
setCodeAssistGlobalUserSetting = vi.fn();
|
|
18
|
-
constructor(_client, _projectId, _httpOptions, _sessionId, _userTier) { }
|
|
19
|
-
}
|
|
20
|
-
class MockLoggingContentGenerator {
|
|
21
|
-
getWrapped = vi.fn();
|
|
22
|
-
constructor(_wrapped, _config) { }
|
|
23
|
-
}
|
|
24
|
-
return {
|
|
25
|
-
Config: vi.fn(),
|
|
26
|
-
CodeAssistServer: MockCodeAssistServer,
|
|
27
|
-
LoggingContentGenerator: MockLoggingContentGenerator,
|
|
28
|
-
GeminiClient: vi.fn(),
|
|
29
|
-
UserTierId: {
|
|
30
|
-
FREE: 'free-tier',
|
|
31
|
-
LEGACY: 'legacy-tier',
|
|
32
|
-
STANDARD: 'standard-tier',
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
|
-
describe('usePrivacySettings', () => {
|
|
37
|
-
let mockConfig;
|
|
38
|
-
let mockClient;
|
|
39
|
-
let mockCodeAssistServer;
|
|
40
|
-
let mockLoggingContentGenerator;
|
|
41
|
-
beforeEach(() => {
|
|
42
|
-
vi.clearAllMocks();
|
|
43
|
-
// Create mock CodeAssistServer instance
|
|
44
|
-
mockCodeAssistServer = new CodeAssistServer(null, 'test-project-id');
|
|
45
|
-
mockCodeAssistServer.loadCodeAssist.mockResolvedValue({
|
|
46
|
-
currentTier: { id: UserTierId.FREE },
|
|
47
|
-
});
|
|
48
|
-
mockCodeAssistServer.getCodeAssistGlobalUserSetting.mockResolvedValue({
|
|
49
|
-
freeTierDataCollectionOptin: true,
|
|
50
|
-
});
|
|
51
|
-
mockCodeAssistServer.setCodeAssistGlobalUserSetting.mockResolvedValue({
|
|
52
|
-
freeTierDataCollectionOptin: false,
|
|
53
|
-
});
|
|
54
|
-
// Create mock LoggingContentGenerator that wraps the CodeAssistServer
|
|
55
|
-
mockLoggingContentGenerator = new LoggingContentGenerator(mockCodeAssistServer, null);
|
|
56
|
-
mockLoggingContentGenerator.getWrapped.mockReturnValue(mockCodeAssistServer);
|
|
57
|
-
// Create mock GeminiClient
|
|
58
|
-
mockClient = {
|
|
59
|
-
getContentGenerator: vi.fn().mockReturnValue(mockLoggingContentGenerator),
|
|
60
|
-
};
|
|
61
|
-
// Create mock Config
|
|
62
|
-
mockConfig = {
|
|
63
|
-
getGeminiClient: vi.fn().mockReturnValue(mockClient),
|
|
64
|
-
};
|
|
65
|
-
});
|
|
66
|
-
it('should handle LoggingContentGenerator wrapper correctly and not throw "Oauth not being used" error', async () => {
|
|
67
|
-
const { result } = renderHook(() => usePrivacySettings(mockConfig));
|
|
68
|
-
// Initial state should be loading
|
|
69
|
-
expect(result.current.privacyState.isLoading).toBe(true);
|
|
70
|
-
expect(result.current.privacyState.error).toBeUndefined();
|
|
71
|
-
// Wait for the hook to complete
|
|
72
|
-
await waitFor(() => {
|
|
73
|
-
expect(result.current.privacyState.isLoading).toBe(false);
|
|
74
|
-
});
|
|
75
|
-
// Should not have the "Oauth not being used" error
|
|
76
|
-
expect(result.current.privacyState.error).toBeUndefined();
|
|
77
|
-
expect(result.current.privacyState.isFreeTier).toBe(true);
|
|
78
|
-
expect(result.current.privacyState.dataCollectionOptIn).toBe(true);
|
|
79
|
-
// Verify that getWrapped was called to unwrap the LoggingContentGenerator
|
|
80
|
-
expect(mockLoggingContentGenerator.getWrapped).toHaveBeenCalled();
|
|
81
|
-
});
|
|
82
|
-
it('should work with direct CodeAssistServer (no wrapper)', async () => {
|
|
83
|
-
// Test case where the content generator is directly a CodeAssistServer
|
|
84
|
-
const directServer = new CodeAssistServer(null, 'test-project-id');
|
|
85
|
-
directServer.loadCodeAssist.mockResolvedValue({
|
|
86
|
-
currentTier: { id: UserTierId.FREE },
|
|
87
|
-
});
|
|
88
|
-
directServer.getCodeAssistGlobalUserSetting.mockResolvedValue({
|
|
89
|
-
freeTierDataCollectionOptin: true,
|
|
90
|
-
});
|
|
91
|
-
mockClient.getContentGenerator = vi.fn().mockReturnValue(directServer);
|
|
92
|
-
const { result } = renderHook(() => usePrivacySettings(mockConfig));
|
|
93
|
-
await waitFor(() => {
|
|
94
|
-
expect(result.current.privacyState.isLoading).toBe(false);
|
|
95
|
-
});
|
|
96
|
-
expect(result.current.privacyState.error).toBeUndefined();
|
|
97
|
-
expect(result.current.privacyState.isFreeTier).toBe(true);
|
|
98
|
-
expect(result.current.privacyState.dataCollectionOptIn).toBe(true);
|
|
99
|
-
});
|
|
100
|
-
it('should handle paid tier users correctly', async () => {
|
|
101
|
-
// Mock paid tier response
|
|
102
|
-
mockCodeAssistServer.loadCodeAssist.mockResolvedValue({
|
|
103
|
-
currentTier: { id: UserTierId.STANDARD },
|
|
104
|
-
});
|
|
105
|
-
const { result } = renderHook(() => usePrivacySettings(mockConfig));
|
|
106
|
-
await waitFor(() => {
|
|
107
|
-
expect(result.current.privacyState.isLoading).toBe(false);
|
|
108
|
-
});
|
|
109
|
-
expect(result.current.privacyState.error).toBeUndefined();
|
|
110
|
-
expect(result.current.privacyState.isFreeTier).toBe(false);
|
|
111
|
-
expect(result.current.privacyState.dataCollectionOptIn).toBeUndefined();
|
|
112
|
-
});
|
|
113
|
-
it('should throw error when content generator is not a CodeAssistServer', async () => {
|
|
114
|
-
// Mock a non-CodeAssistServer content generator
|
|
115
|
-
const mockOtherGenerator = { someOtherMethod: vi.fn() };
|
|
116
|
-
mockLoggingContentGenerator.getWrapped.mockReturnValue(mockOtherGenerator);
|
|
117
|
-
const { result } = renderHook(() => usePrivacySettings(mockConfig));
|
|
118
|
-
await waitFor(() => {
|
|
119
|
-
expect(result.current.privacyState.isLoading).toBe(false);
|
|
120
|
-
});
|
|
121
|
-
expect(result.current.privacyState.error).toBe('Oauth not being used');
|
|
122
|
-
});
|
|
123
|
-
it('should throw error when CodeAssistServer has no projectId', async () => {
|
|
124
|
-
// Mock CodeAssistServer without projectId
|
|
125
|
-
const mockServerNoProject = {
|
|
126
|
-
...mockCodeAssistServer,
|
|
127
|
-
projectId: undefined,
|
|
128
|
-
};
|
|
129
|
-
mockLoggingContentGenerator.getWrapped.mockReturnValue(mockServerNoProject);
|
|
130
|
-
const { result } = renderHook(() => usePrivacySettings(mockConfig));
|
|
131
|
-
await waitFor(() => {
|
|
132
|
-
expect(result.current.privacyState.isLoading).toBe(false);
|
|
133
|
-
});
|
|
134
|
-
expect(result.current.privacyState.error).toBe('Oauth not being used');
|
|
135
|
-
});
|
|
136
|
-
it('should update data collection opt-in setting', async () => {
|
|
137
|
-
const { result } = renderHook(() => usePrivacySettings(mockConfig));
|
|
138
|
-
// Wait for initial load
|
|
139
|
-
await waitFor(() => {
|
|
140
|
-
expect(result.current.privacyState.isLoading).toBe(false);
|
|
141
|
-
});
|
|
142
|
-
// Update the setting
|
|
143
|
-
await result.current.updateDataCollectionOptIn(false);
|
|
144
|
-
// Wait for update to complete
|
|
145
|
-
await waitFor(() => {
|
|
146
|
-
expect(result.current.privacyState.dataCollectionOptIn).toBe(false);
|
|
147
|
-
});
|
|
148
|
-
expect(mockCodeAssistServer.setCodeAssistGlobalUserSetting).toHaveBeenCalledWith({
|
|
149
|
-
cloudaicompanionProject: 'test-project-id',
|
|
150
|
-
freeTierDataCollectionOptin: false,
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
});
|
|
154
|
-
//# sourceMappingURL=usePrivacySettings.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePrivacySettings.test.js","sourceRoot":"","sources":["../../../../src/ui/hooks/usePrivacySettings.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAM7D,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,UAAU,GACX,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,wBAAwB;AACxB,EAAE,CAAC,IAAI,CAAC,qBAAqB,EAAE,GAAG,EAAE;IAClC,qCAAqC;IACrC,MAAM,oBAAoB;QACxB,SAAS,GAAG,iBAAiB,CAAC;QAC9B,cAAc,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QACzB,8BAA8B,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QACzC,8BAA8B,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAEzC,YACE,OAAsB,EACtB,UAAmB,EACnB,YAAsC,EACtC,UAAmB,EACnB,SAAsB,IACrB,CAAC;KACL;IAED,MAAM,2BAA2B;QAC/B,UAAU,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAErB,YACE,QAA2B,EAC3B,OAAiC,IAChC,CAAC;KACL;IAED,OAAO;QACL,MAAM,EAAE,EAAE,CAAC,EAAE,EAAE;QACf,gBAAgB,EAAE,oBAAoB;QACtC,uBAAuB,EAAE,2BAA2B;QACpD,YAAY,EAAE,EAAE,CAAC,EAAE,EAAE;QACrB,UAAU,EAAE;YACV,IAAI,EAAE,WAAW;YACjB,MAAM,EAAE,aAAa;YACrB,QAAQ,EAAE,eAAe;SAC1B;KACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,oBAAoB,EAAE,GA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AAY,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8CAA8C,EAAE,KAAK,IAAI,EAAE;QAC5D,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAAC;QAEpE,wBAAwB;QACxB,MAAM,OAAO,CAAC,GAAG,EAAE;YACjB,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;QAEH,qBAAqB;QACrB,MAAM,MAAM,CAAC,OAAO,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC;QAEtD,8BAA8B;QAC9B,MAAM,OAAO,CAAC,GAAG,EAAE;YACjB,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;QAEH,MAAM,CACJ,oBAAoB,CAAC,8BAA8B,CACpD,CAAC,oBAAoB,CAAC;YACrB,uBAAuB,EAAE,iBAAiB;YAC1C,2BAA2B,EAAE,KAAK;SACnC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import type { Config } from '@rdmind/rdmind-core';
|
|
7
|
-
interface CloudFreePrivacyNoticeProps {
|
|
8
|
-
config: Config;
|
|
9
|
-
onExit: () => void;
|
|
10
|
-
}
|
|
11
|
-
export declare const CloudFreePrivacyNotice: ({ config, onExit, }: CloudFreePrivacyNoticeProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright 2025 Google LLC
|
|
5
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
-
*/
|
|
7
|
-
import { Box, Newline, Text } from 'ink';
|
|
8
|
-
import { RadioButtonSelect } from '../components/shared/RadioButtonSelect.js';
|
|
9
|
-
import { usePrivacySettings } from '../hooks/usePrivacySettings.js';
|
|
10
|
-
import { CloudPaidPrivacyNotice } from './CloudPaidPrivacyNotice.js';
|
|
11
|
-
import { Colors } from '../colors.js';
|
|
12
|
-
import { useKeypress } from '../hooks/useKeypress.js';
|
|
13
|
-
export const CloudFreePrivacyNotice = ({ config, onExit, }) => {
|
|
14
|
-
const { privacyState, updateDataCollectionOptIn } = usePrivacySettings(config);
|
|
15
|
-
useKeypress((key) => {
|
|
16
|
-
if (privacyState.error && key.name === 'escape') {
|
|
17
|
-
onExit();
|
|
18
|
-
}
|
|
19
|
-
}, { isActive: true });
|
|
20
|
-
if (privacyState.isLoading) {
|
|
21
|
-
return _jsx(Text, { color: Colors.Gray, children: "Loading..." });
|
|
22
|
-
}
|
|
23
|
-
if (privacyState.error) {
|
|
24
|
-
return (_jsxs(Box, { flexDirection: "column", marginY: 1, children: [_jsxs(Text, { color: Colors.AccentRed, children: ["Error loading Opt-in settings: ", privacyState.error] }), _jsx(Text, { color: Colors.Gray, children: "Press Esc to exit." })] }));
|
|
25
|
-
}
|
|
26
|
-
if (privacyState.isFreeTier === false) {
|
|
27
|
-
return _jsx(CloudPaidPrivacyNotice, { onExit: onExit });
|
|
28
|
-
}
|
|
29
|
-
const items = [
|
|
30
|
-
{ label: 'Yes', value: true },
|
|
31
|
-
{ label: 'No', value: false },
|
|
32
|
-
];
|
|
33
|
-
return (_jsxs(Box, { flexDirection: "column", marginY: 1, children: [_jsx(Text, { bold: true, color: Colors.AccentPurple, children: "Gemini Code Assist for Individuals Privacy Notice" }), _jsx(Newline, {}), _jsxs(Text, { children: ["This notice and our Privacy Policy", _jsx(Text, { color: Colors.AccentBlue, children: "[1]" }), " describe how Gemini Code Assist handles your data. Please read them carefully."] }), _jsx(Newline, {}), _jsx(Text, { children: "When you use Gemini Code Assist for individuals with Gemini CLI, Google collects your prompts, related code, generated output, code edits, related feature usage information, and your feedback to provide, improve, and develop Google products and services and machine learning technologies." }), _jsx(Newline, {}), _jsx(Text, { children: "To help with quality and improve our products (such as generative machine-learning models), human reviewers may read, annotate, and process the data collected above. We take steps to protect your privacy as part of this process. This includes disconnecting the data from your Google Account before reviewers see or annotate it, and storing those disconnected copies for up to 18 months. Please don't submit confidential information or any data you wouldn't want a reviewer to see or Google to use to improve our products, services and machine-learning technologies." }), _jsx(Newline, {}), _jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { children: "Allow Google to use this data to develop and improve our products?" }), _jsx(RadioButtonSelect, { items: items, initialIndex: privacyState.dataCollectionOptIn ? 0 : 1, onSelect: (value) => {
|
|
34
|
-
updateDataCollectionOptIn(value);
|
|
35
|
-
// Only exit if there was no error.
|
|
36
|
-
if (!privacyState.error) {
|
|
37
|
-
onExit();
|
|
38
|
-
}
|
|
39
|
-
} })] }), _jsx(Newline, {}), _jsxs(Text, { children: [_jsx(Text, { color: Colors.AccentBlue, children: "[1]" }), ' ', "https://policies.google.com/privacy"] }), _jsx(Newline, {}), _jsx(Text, { color: Colors.Gray, children: "Press Enter to choose an option and exit." })] }));
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=CloudFreePrivacyNotice.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CloudFreePrivacyNotice.js","sourceRoot":"","sources":["../../../../src/ui/privacy/CloudFreePrivacyNotice.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,M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
-
* Copyright 2025 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
interface CloudPaidPrivacyNoticeProps {
|
|
7
|
-
onExit: () => void;
|
|
8
|
-
}
|
|
9
|
-
export declare const CloudPaidPrivacyNotice: ({ onExit, }: CloudPaidPrivacyNoticeProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright 2025 Google LLC
|
|
5
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
-
*/
|
|
7
|
-
import { Box, Newline, Text } from 'ink';
|
|
8
|
-
import { Colors } from '../colors.js';
|
|
9
|
-
import { useKeypress } from '../hooks/useKeypress.js';
|
|
10
|
-
export const CloudPaidPrivacyNotice = ({ onExit, }) => {
|
|
11
|
-
useKeypress((key) => {
|
|
12
|
-
if (key.name === 'escape') {
|
|
13
|
-
onExit();
|
|
14
|
-
}
|
|
15
|
-
}, { isActive: true });
|
|
16
|
-
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { bold: true, color: Colors.AccentPurple, children: "Vertex AI Notice" }), _jsx(Newline, {}), _jsxs(Text, { children: ["Service Specific Terms", _jsx(Text, { color: Colors.AccentBlue, children: "[1]" }), " are incorporated into the agreement under which Google has agreed to provide Google Cloud Platform", _jsx(Text, { color: Colors.AccentGreen, children: "[2]" }), " to Customer (the \u201CAgreement\u201D). If the Agreement authorizes the resale or supply of Google Cloud Platform under a Google Cloud partner or reseller program, then except for in the section entitled \u201CPartner-Specific Terms\u201D, all references to Customer in the Service Specific Terms mean Partner or Reseller (as applicable), and all references to Customer Data in the Service Specific Terms mean Partner Data. Capitalized terms used but not defined in the Service Specific Terms have the meaning given to them in the Agreement."] }), _jsx(Newline, {}), _jsxs(Text, { children: [_jsx(Text, { color: Colors.AccentBlue, children: "[1]" }), ' ', "https://cloud.google.com/terms/service-terms"] }), _jsxs(Text, { children: [_jsx(Text, { color: Colors.AccentGreen, children: "[2]" }), ' ', "https://cloud.google.com/terms/services"] }), _jsx(Newline, {}), _jsx(Text, { color: Colors.Gray, children: "Press Esc to exit." })] }));
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=CloudPaidPrivacyNotice.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CloudPaidPrivacyNotice.js","sourceRoot":"","sources":["../../../../src/ui/privacy/CloudPaidPrivacyNotice.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAMtD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACrC,MAAM,GACsB,EAAE,EAAE;IAChC,WAAW,CACT,CAAC,GAAG,EAAE,EAAE;QACN,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC1B,MAAM,EAAE,CAAC;QACX,CAAC;IACH,CAAC,EACD,EAAE,QAAQ,EAAE,IAAI,EAAE,CACnB,CAAC;IAEF,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,YAAY,EAAE,CAAC,aACzC,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAE,MAAM,CAAC,YAAY,iCAE9B,EACP,KAAC,OAAO,KAAG,EACX,MAAC,IAAI,yCACmB,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,UAAU,oBAAY,yGAE3C,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,WAAW,oBAAY,uiBAS3D,EACP,KAAC,OAAO,KAAG,EACX,MAAC,IAAI,eACH,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,UAAU,oBAAY,EAAC,GAAG,oDAEzC,EACP,MAAC,IAAI,eACH,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,WAAW,oBAAY,EAAC,GAAG,+CAE1C,EACP,KAAC,OAAO,KAAG,EACX,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,mCAA2B,IAC/C,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
interface GeminiPrivacyNoticeProps {
|
|
7
|
-
onExit: () => void;
|
|
8
|
-
}
|
|
9
|
-
export declare const GeminiPrivacyNotice: ({ onExit }: GeminiPrivacyNoticeProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright 2025 Google LLC
|
|
5
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
-
*/
|
|
7
|
-
import { Box, Newline, Text } from 'ink';
|
|
8
|
-
import { Colors } from '../colors.js';
|
|
9
|
-
import { useKeypress } from '../hooks/useKeypress.js';
|
|
10
|
-
export const GeminiPrivacyNotice = ({ onExit }) => {
|
|
11
|
-
useKeypress((key) => {
|
|
12
|
-
if (key.name === 'escape') {
|
|
13
|
-
onExit();
|
|
14
|
-
}
|
|
15
|
-
}, { isActive: true });
|
|
16
|
-
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { bold: true, color: Colors.AccentPurple, children: "Gemini API Key Notice" }), _jsx(Newline, {}), _jsxs(Text, { children: ["By using the Gemini API", _jsx(Text, { color: Colors.AccentBlue, children: "[1]" }), ", Google AI Studio", _jsx(Text, { color: Colors.AccentRed, children: "[2]" }), ", and the other Google developer services that reference these terms (collectively, the \"APIs\" or \"Services\"), you are agreeing to Google APIs Terms of Service (the \"API Terms\")", _jsx(Text, { color: Colors.AccentGreen, children: "[3]" }), ", and the Gemini API Additional Terms of Service (the \"Additional Terms\")", _jsx(Text, { color: Colors.AccentPurple, children: "[4]" }), "."] }), _jsx(Newline, {}), _jsxs(Text, { children: [_jsx(Text, { color: Colors.AccentBlue, children: "[1]" }), ' ', "https://ai.google.dev/docs/gemini_api_overview"] }), _jsxs(Text, { children: [_jsx(Text, { color: Colors.AccentRed, children: "[2]" }), " https://aistudio.google.com/"] }), _jsxs(Text, { children: [_jsx(Text, { color: Colors.AccentGreen, children: "[3]" }), ' ', "https://developers.google.com/terms"] }), _jsxs(Text, { children: [_jsx(Text, { color: Colors.AccentPurple, children: "[4]" }), ' ', "https://ai.google.dev/gemini-api/terms"] }), _jsx(Newline, {}), _jsx(Text, { color: Colors.Gray, children: "Press Esc to exit." })] }));
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=GeminiPrivacyNotice.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GeminiPrivacyNotice.js","sourceRoot":"","sources":["../../../../src/ui/privacy/GeminiPrivacyNotice.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAMtD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAAE,MAAM,EAA4B,EAAE,EAAE;IAC1E,WAAW,CACT,CAAC,GAAG,EAAE,EAAE;QACN,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC1B,MAAM,EAAE,C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|
7
|
-
interface PrivacyNoticeProps {
|
|
8
|
-
onExit: () => void;
|
|
9
|
-
config: Config;
|
|
10
|
-
}
|
|
11
|
-
export declare const PrivacyNotice: ({ onExit, config }: PrivacyNoticeProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright 2025 Google LLC
|
|
5
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
-
*/
|
|
7
|
-
import { Box } from 'ink';
|
|
8
|
-
import { AuthType } from '@rdmind/rdmind-core';
|
|
9
|
-
import { GeminiPrivacyNotice } from './GeminiPrivacyNotice.js';
|
|
10
|
-
import { CloudPaidPrivacyNotice } from './CloudPaidPrivacyNotice.js';
|
|
11
|
-
import { CloudFreePrivacyNotice } from './CloudFreePrivacyNotice.js';
|
|
12
|
-
const PrivacyNoticeText = ({ config, onExit, }) => {
|
|
13
|
-
const authType = config.getContentGeneratorConfig()?.authType;
|
|
14
|
-
switch (authType) {
|
|
15
|
-
case AuthType.USE_GEMINI:
|
|
16
|
-
return _jsx(GeminiPrivacyNotice, { onExit: onExit });
|
|
17
|
-
case AuthType.USE_VERTEX_AI:
|
|
18
|
-
return _jsx(CloudPaidPrivacyNotice, { onExit: onExit });
|
|
19
|
-
case AuthType.LOGIN_WITH_GOOGLE:
|
|
20
|
-
default:
|
|
21
|
-
return _jsx(CloudFreePrivacyNotice, { config: config, onExit: onExit });
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
export const PrivacyNotice = ({ onExit, config }) => (_jsx(Box, { borderStyle: "round", padding: 1, flexDirection: "column", children: _jsx(PrivacyNoticeText, { config: config, onExit: onExit }) }));
|
|
25
|
-
//# sourceMappingURL=PrivacyNotice.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrivacyNotice.js","sourceRoot":"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
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Checks if a directory is within a git repository hosted on GitHub.
|
|
8
|
-
* @returns true if the directory is in a git repository with a github.com remote, false otherwise
|
|
9
|
-
*/
|
|
10
|
-
export declare const isGitHubRepository: () => boolean;
|
|
11
|
-
/**
|
|
12
|
-
* getGitRepoRoot returns the root directory of the git repository.
|
|
13
|
-
* @returns the path to the root of the git repo.
|
|
14
|
-
* @throws error if the exec command fails.
|
|
15
|
-
*/
|
|
16
|
-
export declare const getGitRepoRoot: () => string;
|
|
17
|
-
/**
|
|
18
|
-
* getLatestGitHubRelease returns the release tag as a string.
|
|
19
|
-
* @returns string of the release tag (e.g. "v1.2.3").
|
|
20
|
-
*/
|
|
21
|
-
export declare const getLatestGitHubRelease: (proxy?: string) => Promise<string>;
|
|
22
|
-
/**
|
|
23
|
-
* getGitHubRepoInfo returns the owner and repository for a GitHub repo.
|
|
24
|
-
* @returns the owner and repository of the github repo.
|
|
25
|
-
* @throws error if the exec command fails.
|
|
26
|
-
*/
|
|
27
|
-
export declare function getGitHubRepoInfo(): {
|
|
28
|
-
owner: string;
|
|
29
|
-
repo: string;
|
|
30
|
-
};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { execSync } from 'node:child_process';
|
|
7
|
-
import { ProxyAgent } from 'undici';
|
|
8
|
-
/**
|
|
9
|
-
* Checks if a directory is within a git repository hosted on GitHub.
|
|
10
|
-
* @returns true if the directory is in a git repository with a github.com remote, false otherwise
|
|
11
|
-
*/
|
|
12
|
-
export const isGitHubRepository = () => {
|
|
13
|
-
try {
|
|
14
|
-
const remotes = (execSync('git remote -v', {
|
|
15
|
-
encoding: 'utf-8',
|
|
16
|
-
}) || '').trim();
|
|
17
|
-
const pattern = /github\.com/;
|
|
18
|
-
return pattern.test(remotes);
|
|
19
|
-
}
|
|
20
|
-
catch (_error) {
|
|
21
|
-
// If any filesystem error occurs, assume not a git repo
|
|
22
|
-
console.debug(`Failed to get git remote:`, _error);
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* getGitRepoRoot returns the root directory of the git repository.
|
|
28
|
-
* @returns the path to the root of the git repo.
|
|
29
|
-
* @throws error if the exec command fails.
|
|
30
|
-
*/
|
|
31
|
-
export const getGitRepoRoot = () => {
|
|
32
|
-
const gitRepoRoot = (execSync('git rev-parse --show-toplevel', {
|
|
33
|
-
encoding: 'utf-8',
|
|
34
|
-
}) || '').trim();
|
|
35
|
-
if (!gitRepoRoot) {
|
|
36
|
-
throw new Error(`Git repo returned empty value`);
|
|
37
|
-
}
|
|
38
|
-
return gitRepoRoot;
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* getLatestGitHubRelease returns the release tag as a string.
|
|
42
|
-
* @returns string of the release tag (e.g. "v1.2.3").
|
|
43
|
-
*/
|
|
44
|
-
export const getLatestGitHubRelease = async (proxy) => {
|
|
45
|
-
try {
|
|
46
|
-
const controller = new AbortController();
|
|
47
|
-
const endpoint = `https://api.github.com/repos/google-github-actions/run-gemini-cli/releases/latest`;
|
|
48
|
-
const response = await fetch(endpoint, {
|
|
49
|
-
method: 'GET',
|
|
50
|
-
headers: {
|
|
51
|
-
Accept: 'application/vnd.github+json',
|
|
52
|
-
'Content-Type': 'application/json',
|
|
53
|
-
'X-GitHub-Api-Version': '2022-11-28',
|
|
54
|
-
},
|
|
55
|
-
dispatcher: proxy ? new ProxyAgent(proxy) : undefined,
|
|
56
|
-
signal: AbortSignal.any([AbortSignal.timeout(30_000), controller.signal]),
|
|
57
|
-
});
|
|
58
|
-
if (!response.ok) {
|
|
59
|
-
throw new Error(`Invalid response code: ${response.status} - ${response.statusText}`);
|
|
60
|
-
}
|
|
61
|
-
const releaseTag = (await response.json()).tag_name;
|
|
62
|
-
if (!releaseTag) {
|
|
63
|
-
throw new Error(`Response did not include tag_name field`);
|
|
64
|
-
}
|
|
65
|
-
return releaseTag;
|
|
66
|
-
}
|
|
67
|
-
catch (_error) {
|
|
68
|
-
console.debug(`Failed to determine latest run-gemini-cli release:`, _error);
|
|
69
|
-
throw new Error(`Unable to determine the latest run-gemini-cli release on GitHub.`);
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
/**
|
|
73
|
-
* getGitHubRepoInfo returns the owner and repository for a GitHub repo.
|
|
74
|
-
* @returns the owner and repository of the github repo.
|
|
75
|
-
* @throws error if the exec command fails.
|
|
76
|
-
*/
|
|
77
|
-
export function getGitHubRepoInfo() {
|
|
78
|
-
const remoteUrl = execSync('git remote get-url origin', {
|
|
79
|
-
encoding: 'utf-8',
|
|
80
|
-
}).trim();
|
|
81
|
-
// Matches either https://github.com/owner/repo.git or git@github.com:owner/repo.git
|
|
82
|
-
const match = remoteUrl.match(/(?:https?:\/\/|git@)github\.com(?::|\/)([^/]+)\/([^/]+?)(?:\.git)?$/);
|
|
83
|
-
// If the regex fails match, throw an error.
|
|
84
|
-
if (!match || !match[1] || !match[2]) {
|
|
85
|
-
throw new Error(`Owner & repo could not be extracted from remote URL: ${remoteUrl}`);
|
|
86
|
-
}
|
|
87
|
-
return { owner: match[1], repo: match[2] };
|
|
88
|
-
}
|
|
89
|
-
//# sourceMappingURL=gitUtils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gitUtils.js","sourceRoot":"","sources":["../../../src/utils/gitUtils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAY,EAAE;IAC9C,IAAI,CAAC;QACH,MAAM,OAAO,GAAG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-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { vi, describe, expect, it, afterEach, beforeEach } from 'vitest';
|
|
7
|
-
import * as child_process from 'node:child_process';
|
|
8
|
-
import { isGitHubRepository, getGitRepoRoot, getLatestGitHubRelease, getGitHubRepoInfo, } from './gitUtils.js';
|
|
9
|
-
vi.mock('child_process');
|
|
10
|
-
describe('isGitHubRepository', async () => {
|
|
11
|
-
beforeEach(() => {
|
|
12
|
-
vi.resetAllMocks();
|
|
13
|
-
});
|
|
14
|
-
afterEach(() => {
|
|
15
|
-
vi.restoreAllMocks();
|
|
16
|
-
});
|
|
17
|
-
it('returns false if the git command fails', async () => {
|
|
18
|
-
vi.mocked(child_process.execSync).mockImplementation(() => {
|
|
19
|
-
throw new Error('oops');
|
|
20
|
-
});
|
|
21
|
-
expect(isGitHubRepository()).toBe(false);
|
|
22
|
-
});
|
|
23
|
-
it('returns false if the remote is not github.com', async () => {
|
|
24
|
-
vi.mocked(child_process.execSync).mockReturnValueOnce('https://gitlab.com');
|
|
25
|
-
expect(isGitHubRepository()).toBe(false);
|
|
26
|
-
});
|
|
27
|
-
it('returns true if the remote is github.com', async () => {
|
|
28
|
-
vi.mocked(child_process.execSync).mockReturnValueOnce(`
|
|
29
|
-
origin https://github.com/sethvargo/gemini-cli (fetch)
|
|
30
|
-
origin https://github.com/sethvargo/gemini-cli (push)
|
|
31
|
-
`);
|
|
32
|
-
expect(isGitHubRepository()).toBe(true);
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
describe('getGitHubRepoInfo', async () => {
|
|
36
|
-
beforeEach(() => {
|
|
37
|
-
vi.resetAllMocks();
|
|
38
|
-
});
|
|
39
|
-
afterEach(() => {
|
|
40
|
-
vi.restoreAllMocks();
|
|
41
|
-
});
|
|
42
|
-
it('throws an error if github repo info cannot be determined', async () => {
|
|
43
|
-
vi.mocked(child_process.execSync).mockImplementation(() => {
|
|
44
|
-
throw new Error('oops');
|
|
45
|
-
});
|
|
46
|
-
expect(() => {
|
|
47
|
-
getGitHubRepoInfo();
|
|
48
|
-
}).toThrowError(/oops/);
|
|
49
|
-
});
|
|
50
|
-
it('throws an error if owner/repo could not be determined', async () => {
|
|
51
|
-
vi.mocked(child_process.execSync).mockReturnValueOnce('');
|
|
52
|
-
expect(() => {
|
|
53
|
-
getGitHubRepoInfo();
|
|
54
|
-
}).toThrowError(/Owner & repo could not be extracted from remote URL/);
|
|
55
|
-
});
|
|
56
|
-
it('returns the owner and repo', async () => {
|
|
57
|
-
vi.mocked(child_process.execSync).mockReturnValueOnce('https://github.com/owner/repo.git ');
|
|
58
|
-
expect(getGitHubRepoInfo()).toEqual({ owner: 'owner', repo: 'repo' });
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
describe('getGitRepoRoot', async () => {
|
|
62
|
-
beforeEach(() => {
|
|
63
|
-
vi.resetAllMocks();
|
|
64
|
-
});
|
|
65
|
-
afterEach(() => {
|
|
66
|
-
vi.restoreAllMocks();
|
|
67
|
-
});
|
|
68
|
-
it('throws an error if git root cannot be determined', async () => {
|
|
69
|
-
vi.mocked(child_process.execSync).mockImplementation(() => {
|
|
70
|
-
throw new Error('oops');
|
|
71
|
-
});
|
|
72
|
-
expect(() => {
|
|
73
|
-
getGitRepoRoot();
|
|
74
|
-
}).toThrowError(/oops/);
|
|
75
|
-
});
|
|
76
|
-
it('throws an error if git root is empty', async () => {
|
|
77
|
-
vi.mocked(child_process.execSync).mockReturnValueOnce('');
|
|
78
|
-
expect(() => {
|
|
79
|
-
getGitRepoRoot();
|
|
80
|
-
}).toThrowError(/Git repo returned empty value/);
|
|
81
|
-
});
|
|
82
|
-
it('returns the root', async () => {
|
|
83
|
-
vi.mocked(child_process.execSync).mockReturnValueOnce('/path/to/git/repo');
|
|
84
|
-
expect(getGitRepoRoot()).toBe('/path/to/git/repo');
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
describe('getLatestRelease', async () => {
|
|
88
|
-
beforeEach(() => {
|
|
89
|
-
vi.resetAllMocks();
|
|
90
|
-
});
|
|
91
|
-
afterEach(() => {
|
|
92
|
-
vi.restoreAllMocks();
|
|
93
|
-
});
|
|
94
|
-
it('throws an error if the fetch fails', async () => {
|
|
95
|
-
global.fetch = vi.fn(() => Promise.reject('nope'));
|
|
96
|
-
await expect(getLatestGitHubRelease()).rejects.toThrowError(/Unable to determine the latest/);
|
|
97
|
-
});
|
|
98
|
-
it('throws an error if the fetch does not return a json body', async () => {
|
|
99
|
-
global.fetch = vi.fn(() => Promise.resolve({
|
|
100
|
-
ok: true,
|
|
101
|
-
json: () => Promise.resolve({ foo: 'bar' }),
|
|
102
|
-
}));
|
|
103
|
-
await expect(getLatestGitHubRelease()).rejects.toThrowError(/Unable to determine the latest/);
|
|
104
|
-
});
|
|
105
|
-
it('returns the release version', async () => {
|
|
106
|
-
global.fetch = vi.fn(() => Promise.resolve({
|
|
107
|
-
ok: true,
|
|
108
|
-
json: () => Promise.resolve({ tag_name: 'v1.2.3' }),
|
|
109
|
-
}));
|
|
110
|
-
await expect(getLatestGitHubRelease()).resolves.toBe('v1.2.3');
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
//# sourceMappingURL=gitUtils.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gitUtils.test.js","sourceRoot":"","sources":["../../../src/utils/gitUtils.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,EAAE,CAAC,IAAI,CAAC,eAAe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