@mcpher/gas-fakes 1.0.21 → 1.0.23
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/README.RU.md +0 -1
- package/README.md +37 -4
- package/gasmess/bruce/pbx.js +1 -1
- package/gasmess/bruce/testlogging.js +7 -0
- package/gprompts/gas-inventory.js +71 -67
- package/package.json +44 -42
- package/src/index.js +5 -4
- package/src/services/logger/fakelogger.js +52 -7
- package/src/services/spreadsheetapp/fakeovergridimage.js +47 -0
- package/src/services/spreadsheetapp/fakesheet.js +29 -1
- package/src/support/sxxlsx.js +41 -0
- package/src/support/syncit.js +179 -141
- package/src/support/workersync/sxfunctions.js +11 -10
- package/togas.bash +1 -32
- package/setup.sh +0 -147
package/setup.sh
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# --- 1. Collect Phase ---
|
|
4
|
-
echo "Welcome to the gas-fakes project setup."
|
|
5
|
-
echo "This script will guide you through creating your .env file for testing."
|
|
6
|
-
echo "Please provide the following configuration values."
|
|
7
|
-
echo "Some values are required for the test suite to run correctly."
|
|
8
|
-
echo
|
|
9
|
-
|
|
10
|
-
# --- Required values ---
|
|
11
|
-
read -p "Enter your GCP Project ID: " gcp_project_id
|
|
12
|
-
if [ -z "$gcp_project_id" ]; then
|
|
13
|
-
echo "Error: GCP Project ID is required." >&2
|
|
14
|
-
exit 1
|
|
15
|
-
fi
|
|
16
|
-
|
|
17
|
-
read -p "Enter a Drive File ID you have read access to (for testing ADC): " drive_test_file_id
|
|
18
|
-
if [ -z "$drive_test_file_id" ]; then
|
|
19
|
-
echo "Error: Drive File ID is required." >&2
|
|
20
|
-
exit 1
|
|
21
|
-
fi
|
|
22
|
-
|
|
23
|
-
read -p "Enter a test Drive Folder Name you have write access to: " test_folder_name
|
|
24
|
-
if [ -z "$test_folder_name" ]; then
|
|
25
|
-
echo "Error: Test Folder Name is required." >&2
|
|
26
|
-
exit 1
|
|
27
|
-
fi
|
|
28
|
-
|
|
29
|
-
read -p "Enter the ID of that test Drive Folder: " test_folder_id
|
|
30
|
-
if [ -z "$test_folder_id" ]; then
|
|
31
|
-
echo "Error: Test Folder ID is required." >&2
|
|
32
|
-
exit 1
|
|
33
|
-
fi
|
|
34
|
-
|
|
35
|
-
# --- Optional values with defaults ---
|
|
36
|
-
read -p "Enter the number of files in that folder [0]: " test_folder_files
|
|
37
|
-
test_folder_files=${test_folder_files:-0}
|
|
38
|
-
|
|
39
|
-
read -p "Enter a viewer email for permission tests [viewer@mcpher.com]: " scratch_viewer
|
|
40
|
-
scratch_viewer=${scratch_viewer:-"viewer@mcpher.com"}
|
|
41
|
-
|
|
42
|
-
read -p "Enter an editor email for permission tests [editor@mcpher.com]: " scratch_editor
|
|
43
|
-
scratch_editor=${scratch_editor:-"editor@mcpher.com"}
|
|
44
|
-
|
|
45
|
-
read -p "Enter a second viewer email [viewer2@mcpher.com]: " scratch_b_viewer
|
|
46
|
-
scratch_b_viewer=${scratch_b_viewer:-"viewer2@mcpher.com"}
|
|
47
|
-
|
|
48
|
-
read -p "Enter a second editor email [editor2@mcpher.com]: " scratch_b_editor
|
|
49
|
-
scratch_b_editor=${scratch_b_editor:-"editor2@mcpher.com"}
|
|
50
|
-
|
|
51
|
-
read -p "Enter min PDFs in root for tests [20]: " min_root_pdfs
|
|
52
|
-
min_root_pdfs=${min_root_pdfs:-20}
|
|
53
|
-
|
|
54
|
-
read -p "Enter min PDFs total for tests [400]: " min_pdfs
|
|
55
|
-
min_pdfs=${min_pdfs:-400}
|
|
56
|
-
|
|
57
|
-
read -p "Enter min folders in root for tests [5]: " min_folders_root
|
|
58
|
-
min_folders_root=${min_folders_root:-5}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
# --- 2. Confirm Phase ---
|
|
62
|
-
echo
|
|
63
|
-
echo "The following configuration will be written to .env:"
|
|
64
|
-
echo "================================================="
|
|
65
|
-
echo "# User-specific values"
|
|
66
|
-
echo "GCP_PROJECT_ID=${gcp_project_id}"
|
|
67
|
-
echo "DRIVE_TEST_FILE_ID=${drive_test_file_id}"
|
|
68
|
-
echo "TEST_FOLDER_NAME=\"${test_folder_name}\""
|
|
69
|
-
echo "TEST_FOLDER_ID=${test_folder_id}"
|
|
70
|
-
echo "TEST_FOLDER_FILES=${test_folder_files}"
|
|
71
|
-
echo "SCRATCH_VIEWER=${scratch_viewer}"
|
|
72
|
-
echo "SCRATCH_EDITOR=${scratch_editor}"
|
|
73
|
-
echo "SCRATCH_B_VIEWER=${scratch_b_viewer}"
|
|
74
|
-
echo "SCRATCH_B_EDITOR=${scratch_b_editor}"
|
|
75
|
-
echo "MIN_ROOT_PDFS=${min_root_pdfs}"
|
|
76
|
-
echo "MIN_PDFS=${min_pdfs}"
|
|
77
|
-
echo "MIN_FOLDERS_ROOT=${min_folders_root}"
|
|
78
|
-
echo
|
|
79
|
-
echo "# Shared and static values will also be included."
|
|
80
|
-
echo "================================================="
|
|
81
|
-
echo
|
|
82
|
-
|
|
83
|
-
read -p "Proceed with creating the .env file? (y/N) " confirm
|
|
84
|
-
if [[ ! "$confirm" =~ ^[yY](es)?$ ]]; then
|
|
85
|
-
echo "Setup aborted. No file was written."
|
|
86
|
-
exit 0
|
|
87
|
-
fi
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
# --- 3. Commit Phase ---
|
|
91
|
-
ENV_FILE=".env"
|
|
92
|
-
TEMP_ENV_FILE="${ENV_FILE}.tmp"
|
|
93
|
-
|
|
94
|
-
# Using a heredoc to write the complete file content.
|
|
95
|
-
cat > "$TEMP_ENV_FILE" << EOL
|
|
96
|
-
# Auto-generated by setup.sh on $(date)
|
|
97
|
-
|
|
98
|
-
# --- User-specific values ---
|
|
99
|
-
# Required for authentication and core tests
|
|
100
|
-
GCP_PROJECT_ID="${gcp_project_id}"
|
|
101
|
-
DRIVE_TEST_FILE_ID="${drive_test_file_id}"
|
|
102
|
-
|
|
103
|
-
# Required for file/folder manipulation tests
|
|
104
|
-
TEST_FOLDER_NAME="${test_folder_name}"
|
|
105
|
-
TEST_FOLDER_ID="${test_folder_id}"
|
|
106
|
-
TEST_FOLDER_FILES=${test_folder_files}
|
|
107
|
-
|
|
108
|
-
# For permission tests
|
|
109
|
-
SCRATCH_VIEWER="${scratch_viewer}"
|
|
110
|
-
SCRATCH_EDITOR="${scratch_editor}"
|
|
111
|
-
SCRATCH_B_VIEWER="${scratch_b_viewer}"
|
|
112
|
-
SCRATCH_B_EDITOR="${scratch_b_editor}"
|
|
113
|
-
|
|
114
|
-
# For iterator/search tests (adjust to your Drive content)
|
|
115
|
-
MIN_ROOT_PDFS=${min_root_pdfs}
|
|
116
|
-
MIN_PDFS=${min_pdfs}
|
|
117
|
-
MIN_FOLDERS_ROOT=${min_folders_root}
|
|
118
|
-
|
|
119
|
-
# --- Static auth config ---
|
|
120
|
-
# we'll use the default config for application default credentials
|
|
121
|
-
# probably dont need to change these
|
|
122
|
-
AC=default
|
|
123
|
-
DEFAULT_SCOPES="https://www.googleapis.com/auth/userinfo.email,openid,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/sqlservice.login"
|
|
124
|
-
EXTRA_SCOPES=",https://www.googleapis.com/auth/drive,https://www.googleapis.com/auth/spreadsheets"
|
|
125
|
-
|
|
126
|
-
# --- Shared test file fixtures (read-only) ---
|
|
127
|
-
TEST_BORDERS_ID=1hRGdrYHEPixXTuQLeL3Z0qGRZVs_8ojMIm6D4KrCh1o
|
|
128
|
-
TEST_AIRPORTS_ID=1h9IGIShgVBVUrUjjawk5MaCEQte_7t32XeEP1Z5jXKQ
|
|
129
|
-
TEXT_FILE_NAME="fake.txt"
|
|
130
|
-
TEXT_FILE_ID=1142Vn7W-pGl5nWLpUSkpOB82JDiz9R6p
|
|
131
|
-
TEXT_FILE_TYPE="text/plain"
|
|
132
|
-
TEXT_FILE_CONTENT="foo is not bar"
|
|
133
|
-
TEST_SHEET_ID=1DlKpVVYCrCPNfRbGsz6N_K3oPTgdC9gQIKi0aNb42uI
|
|
134
|
-
TEST_SHEET_NAME="sharedlibraries"
|
|
135
|
-
PDF_ID=17t4ep9Jt6jRyDx0KlxMhHQNGZ3whg6GS
|
|
136
|
-
|
|
137
|
-
# --- Test behavior ---
|
|
138
|
-
# Set to 0 to preserve test files for debugging
|
|
139
|
-
CLEAN=1
|
|
140
|
-
EOL
|
|
141
|
-
|
|
142
|
-
# Atomically rename the temp file to the final .env file.
|
|
143
|
-
mv "$TEMP_ENV_FILE" "$ENV_FILE"
|
|
144
|
-
|
|
145
|
-
echo
|
|
146
|
-
echo "✅ The .env file has been created successfully."
|
|
147
|
-
echo "You can now run 'npm install && npm test' to run the test suite."
|