Skip to content

Commit

Permalink
Merge branch 'main' into junedomingo/main
Browse files Browse the repository at this point in the history
* main:
  wiring up github action to dmno
  chore: release v4.1.4
  add dmno and remove/encrypt test-related secrets, swap jest for vitest
  fix(updateProperties): getFieldMask ignore gridProperties (theoephraim#674)
  chore: release v4.1.3
  fix bugs introduced by PRs
  update axios, fix new google-auth-library issue, fixes theoephraim#701 theoephraim#700
  Read headers in batch on getRows() (theoephraim#693)
  Update authentication.md
  allow CI manual reruns
  Update FUNDING.yml
  use correct type in docs

# Conflicts:
#	.gitignore
#	pnpm-lock.yaml
  • Loading branch information
junedomingo committed Sep 23, 2024
2 parents 2bcd0f5 + d5f0734 commit b1958f3
Show file tree
Hide file tree
Showing 25 changed files with 6,463 additions and 6,197 deletions.
48 changes: 48 additions & 0 deletions .dmno/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { DmnoBaseTypes, defineDmnoService, configPath } from 'dmno';

import { EncryptedVaultDmnoPlugin, EncryptedVaultTypes } from '@dmno/encrypted-vault-plugin';

const SecretsVault = new EncryptedVaultDmnoPlugin('vault', {
key: configPath('DMNO_VAULT_KEY'),
});

export default defineDmnoService({
isRoot: true,
settings: {
redactSensitiveLogs: true,
interceptSensitiveLeakRequests: true,
preventClientLeaks: true,
},
schema: {
DMNO_VAULT_KEY: {
extends: EncryptedVaultTypes.encryptionKey,
},
GOOGLE_API_KEY: {
sensitive: true,
required: true,
value: SecretsVault.item(),
},
GOOGLE_SERVICE_ACCOUNT_EMAIL: {
sensitive: true,
required: true,
extends: DmnoBaseTypes.email,
value: SecretsVault.item(),
},
GOOGLE_SERVICE_ACCOUNT_KEY: {
sensitive: true,
required: true,
value: SecretsVault.item(),
coerce: (val: string) => val.replaceAll('\\n', '\n'),
},
CI: {
extends: 'boolean',
description: 'flag to denote running tests in CI'
},
TEST_DELAY: {
extends: 'number',
required: true,
value: (ctx) => DMNO_CONFIG.CI ? 1000 : 500,
}

},
});
18 changes: 18 additions & 0 deletions .dmno/default.vault.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": "0.0.1",
"keyName": "default-2024-08-31",
"items": {
"root!GOOGLE_SERVICE_ACCOUNT_EMAIL": {
"encryptedValue": "GzfuVZ14HAtQY2omwCJv/IlQe5S3p7zkFnslFY7cFNZN6YFOF4N9b/6efvRskT+560Oh3DHtKMDz2N8luozaEOyKWW2r9MFHUTuoZN/VfY8wJD2AQqw7wCRXD/CA+1JqciRwIsSzcIRw",
"updatedAt": "2024-08-31T21:40:59.749Z"
},
"root!GOOGLE_SERVICE_ACCOUNT_KEY": {
"encryptedValue": "n54cKou9mWEoOzWMNy613YgLfJnhdrmk5KNgJDmmFRC9X4MRueiNmKzdOQsXmdK9Fz4JNz6hiq9Wfqri2syTCjl+NOCp9H4kQEhpPX7dGw+Z4msPqsM7bsEtjmQkz8HOLlFCOVnnqoyBsOuCuS89ZlCd9bODpx0Mx6x4kXZBTlRJ+jHYEzhkD8IQL6lhuQDY9YqCFBzguHosqebjqfXBnEBXckKfBaYlit/CfW03bsdR4Qg3mWRSugk/sGyc15YKcLKcfy62Fq4x6GZ0Js663uQ1Rdgxs+uzoujB+cp2N9Lc01BLQP4LnMy55VzjUxcneVVivonhOvGGx/COaLehifP1dYFdhtWcZX8btEwaL9piYJTKcv3SsTLFLY4ngolqbMXVwnBIDmDGZZWCMDbrzNK3fuXdw2rxMK8WboBM3n4UAXC0vwoXuP41U6+8oVtxZ7XDta+O8Dd6Co5YedFJKjqoekPBd2Khu3mcKji6ZH8z57/Sz97USn6K/58SNxvUOubdrdljjNKKKjd+9MkFtnUCF3Xb1ADp/ZLxc2HJPnHsPck3scTG5xgPwuqmIGEiUZ+hq+GJ086qhcTGhwHyKYePoOLuSaWUKTjzLNWYqqFiZmsh5/D9vIjWEWyJr0mOpXKvV8QPzOcO1vn4DPw/9oYRCsRhaS+oKkJD3QNJJ0pTJCbznaVmG9pDwq4fbEuWPAVhx13xvxb71mL7YFnQSqcl1+h5Np8u0mnlX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O5QldSnbZ2mMz7KqgdrFuc60XF4zEoCFO1QBFJEX4c+fo8sBGh1BN90v5w19accvD8lCCdDvu5mlstvIiYsOujBgvz8Q4aWbywfYrkYFzHG0iccOtDEwRwJjfa9sWMy/qj4MUjiHyP6kLleCnF1sDKnKys7EHW9O2MPvSgsy/sbGEAKh69ktYxvhoQhAao4b+0XNQyOaHyt0xF2zdKCRNYzIeiDTJ8JVScQbOFNax+zb4b/lTH8xEUvdXO61IE3TtPH/rv/VTRgq8TvknfuMXY4z3ryZRJvQzeq91HSTOsh1IPfpLcEVW/MDNbx0KRiyzrOMsJ5H5CV/aRK/WRcNZyOjMsqd2SVJbgFy2Pl9D+D90BinJtjzcu+5k/UCzcf4zDY4YzYE/jhxbpowJsWwvvlm5dfJVXuFytB7boYFpdzbXuAryMX3klphoQf28x35den42Ru013F7f8jVs3hmmfG84ygJaPz1rvvaABjA+Z1qK+3ppcmXtE9giG+Mvk7G67lxoYxyJsMAYS5F27n0HpLIMmjsEAbnyLRmhyeC4=",
"updatedAt": "2024-08-31T21:41:14.313Z"
},
"root!GOOGLE_API_KEY": {
"encryptedValue": "iniwEDUzy+Sgr53pbm7Bh0a0F9COHWQcHHfrm0GhOXKHkmuSfOIO/MNt3zkLKJ+MzktUSs3C6OgDKpfBdRD3ymeREh7K",
"updatedAt": "2024-08-31T21:42:08.303Z"
}
}
}
12 changes: 12 additions & 0 deletions .dmno/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"strict": true,
"moduleResolution": "Bundler",
"module": "ESNext",
"lib": [ "ESNext" ]
},
"include": [
"./**/*.mts",
"./.typegen/global.d.ts"
]
}
9 changes: 1 addition & 8 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,9 @@ module.exports = {

},
overrides: [
{ // extra jest related rules for tests
{ // extra rules for tests
files: 'test/*',
plugins: ['jest'],
extends: ['plugin:jest/recommended'],
env: {
'jest/globals': true,
},
rules: {
'jest/consistent-test-it': 'error',
'jest/expect-expect': 0, // sometimes the lack of an error thrown is a good test
'no-await-in-loop': 0,
}
},
Expand Down
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github: [theoephraim]
custom: ['https://paypal.me/theoephraim']
custom: ['https://buymeacoffee.com/theo.dmno']
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch: # allow manual reruns

jobs:
ci:
Expand All @@ -30,7 +31,7 @@ jobs:
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 8
version: 9
run_install: false

- name: Get pnpm store directory
Expand All @@ -53,10 +54,12 @@ jobs:
run: pnpm run lint --format junit -o reports/junit/js-lint-results.xml

- name: Test
run: pnpm run test --ci --runInBand --reporters=default --reporters=jest-junit --coverage
run: pnpm run test
env:
CI: 1
NODE_ENV: ci
JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml"
DMNO_VAULT_KEY: ${{ secrets.DMNO_VAULT_KEY }}

- uses: actions/upload-artifact@v4
with:
Expand Down
15 changes: 14 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,17 @@ src/ignore/
.env
.DS_Store
examples/
TODO
TODO
dist

# dmno files ###
# local cache for resolved values
**/.dmno/cache.json
# encryption key used for cache
**/.dmno/cache-key.json
# generated type files
**/.dmno/.typegen
# iconify cache used in generated types
**/.dmno/.icon-cache
# local config overrides
**/.dmno/.env.local
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,23 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [4.1.2](https://github.com/theoephraim/node-google-spreadsheet/compare/v4.1.2...HEAD)
#### [4.1.4](https://github.com/theoephraim/node-google-spreadsheet/compare/v4.1.4...v4.1.3)

- fix(updateProperties): getFieldMask ignore gridProperties [`#674`](https://github.com/theoephraim/node-google-spreadsheet/pull/674)
- add dmno and remove/encrypt test-related secrets, swap jest for vitest [`927e9e8`](https://github.com/theoephraim/node-google-spreadsheet/commit/927e9e8618404e9f0bea6acc8e1aa95bce22e4e8)

#### [4.1.3](https://github.com/theoephraim/node-google-spreadsheet/compare/v4.1.3...v4.1.2)

- Read headers in batch on getRows() [`#693`](https://github.com/theoephraim/node-google-spreadsheet/pull/693)
- Fix type of sheetsById in docs [`#658`](https://github.com/theoephraim/node-google-spreadsheet/pull/658)
- Update authentication.md [`#699`](https://github.com/theoephraim/node-google-spreadsheet/pull/699)
- update axios, fix new google-auth-library issue, fixes #701 #700 [`#701`](https://github.com/theoephraim/node-google-spreadsheet/issues/701)
- fix setDataValidation docs [`2bca048`](https://github.com/theoephraim/node-google-spreadsheet/commit/2bca048d1d8a81977967bfd618180461639672f2)
- Update FUNDING.yml [`5459a87`](https://github.com/theoephraim/node-google-spreadsheet/commit/5459a872b54b99364705f82da18d5c45cabb6374)
- use correct type in docs [`6d210a2`](https://github.com/theoephraim/node-google-spreadsheet/commit/6d210a2875adec62a37b108615fbd58d5803e8ec)
- allow CI manual reruns [`e10cbb1`](https://github.com/theoephraim/node-google-spreadsheet/commit/e10cbb1777cb1fe80bed822019e518e0416c0ec2)

#### [4.1.2](https://github.com/theoephraim/node-google-spreadsheet/compare/v4.1.2...4.1.1)

- add setDataValidation [`#691`](https://github.com/theoephraim/node-google-spreadsheet/pull/691)
- fix docs typos
Expand Down
2 changes: 1 addition & 1 deletion docs/classes/google-spreadsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ The child worksheets (each an instance of [`GoogleSpreadsheetWorksheet`](classes

Property|Type|Description
---|---|---
`sheetsById`| `{ [sheetId: string]: GoogleSpreadsheetWorksheet }` | Child worksheets, keyed by their `sheetId`
`sheetsById`| `{ [sheetId: number]: GoogleSpreadsheetWorksheet }` | Child worksheets, keyed by their `sheetId`
`sheetsByTitle`| `{ [title: string]: GoogleSpreadsheetWorksheet }` | Child worksheets keyed by their `title`<br/>_⚠️ beware of title conflicts_
`sheetsByIndex`| `GoogleSpreadsheetWorksheet[]` |Array of sheets, ordered by their index<br>_this is the order they appear in the Google sheets UI_
`sheetCount`| `number` |Count of child worksheets<br>_same as `doc.sheetsByIndex.length`_
Expand Down
13 changes: 10 additions & 3 deletions docs/guides/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,20 @@ __Setup Instructions__
- Click blue "+ CREATE CREDENTIALS" and select "Service account" option
- Enter name, description, click "CREATE"
- You can skip permissions, click "CONTINUE"
- Click "+ CREATE KEY" button
- Click "CREATE AND CONTINUE" button
- Step 2 and 3 are optional, you can skip it.
- Click "DONE" button
3. Edit your new service account
- In the bottom of the page, you can see the "Service Account" tab with your new Service Account
- In column actions, click the pencil button to edit
- Select the "Keys" tab
- Click "ADD KEY" then "Create new key"
- Select the "JSON" key type option
- Click "Create" button
- your JSON key file is generated and downloaded to your machine (__it is the only copy!__)
- click "DONE"
- click "CLOSE"
- note your service account's email address (also available in the JSON key file)
3. Share the doc (or docs) with your service account using the email noted above
4. Share the doc (or docs) with your service account using the email noted above

!> Be careful - never check your API keys / secrets into version control (git)

Expand Down
14 changes: 0 additions & 14 deletions jest.config.cjs

This file was deleted.

24 changes: 11 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "google-spreadsheet",
"version": "4.1.2",
"version": "4.1.4",
"description": "Google Sheets API -- simple interface to read/write data and manage sheets",
"keywords": [
"google spreadsheets",
Expand Down Expand Up @@ -46,27 +46,26 @@
"commit": "cz",
"docs:preview": "docsify serve docs",
"lint": "eslint ./ --ext .ts",
"lint:fix": "npm run lint --fix",
"lint:fix": "pnpm run lint --fix",
"nodev": "node -v",
"readme:copy": "echo \"<!-- DO NOT EDIT THIS FILE, EDIT MAIN README.md AND RUN \\`npm readme:copy\\` instead -->\n\n_Welcome to the docs site for_\n\" | cat - README.md > docs/README.md",
"changelog": "auto-changelog --commit-limit false --unreleased-only --stdout",
"release": "pnpm run build && release-it",
"runscript": "NODE_NO_WARNINGS=1 node --experimental-specifier-resolution=node --loader ts-node/esm",
"test": "jest --runInBand"
"test": "dmno run -- vitest --no-file-parallelism"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"dependencies": {
"axios": "^1.4.0",
"axios": "^1.7.7",
"lodash": "^4.17.21"
},
"devDependencies": {
"@dmno/encrypted-vault-plugin": "^0.0.5",
"@swc/core": "^1.3.60",
"@swc/jest": "^0.2.26",
"@types/jest": "^29.5.1",
"@types/lodash": "^4.14.195",
"@types/node": "^20.2.5",
"@typescript-eslint/eslint-plugin": "^5.59.7",
Expand All @@ -75,20 +74,19 @@
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"delay": "^4.3.0",
"dmno": "^0.0.22",
"docsify-cli": "^4.4.3",
"eslint": "^8.41.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-no-floating-promise": "^1.0.2",
"google-auth-library": "^9.2.0",
"jest": "^29.5.0",
"jest-junit": "^16.0.0",
"google-auth-library": "^9.14.0",
"release-it": "^15.11.0",
"ts-node": "^10.9.1",
"typescript": "^4.9.5",
"unbuild": "^1.2.1"
"typescript": "^5.5.4",
"unbuild": "^1.2.1",
"vitest": "^2.0.5"
},
"peerDependencies": {
"google-auth-library": "^8.8.0 || ^9.0.0"
Expand All @@ -99,6 +97,6 @@
}
},
"volta": {
"node": "18.16.0"
"node": "20.17.0"
}
}
Loading

0 comments on commit b1958f3

Please sign in to comment.