-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #193 from hermanho/dev
2.1.7
- Loading branch information
Showing
11 changed files
with
594 additions
and
999 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Lint | ||
|
||
on: | ||
# Trigger the workflow on push or pull request, | ||
# but only for the main branch | ||
push: | ||
branches: | ||
- master | ||
# Replace pull_request with pull_request_target if you | ||
# plan to use this action with forks, see the Limitations section | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
run-linters: | ||
name: Run linters | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
# ESLint and Prettier must be in `package.json` | ||
- name: Install Node.js dependencies | ||
run: npm ci | ||
|
||
- uses: sibiraj-s/action-eslint@v3 | ||
with: | ||
annotations: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ const { OAuth2Client } = require("google-auth-library"); | |
*/ | ||
const Axios = require("axios"); | ||
const moment = require("moment"); | ||
const { isAxiosError } = require("axios"); | ||
const { error_to_string } = require("./error_to_string"); | ||
const { ConfigFileError, AuthError } = require("./Errors"); | ||
|
||
|
@@ -45,7 +44,7 @@ class Auth extends EventEmitter { | |
console.log("[GPHOTOS:AUTH]", ...args); | ||
} | ||
: () => { }; | ||
if (this.#config === undefined) config = {}; | ||
if (this.#config === undefined) this.#config = {}; | ||
if (this.#config.keyFilePath === undefined) { | ||
throw new ConfigFileError('Missing "keyFilePath" from config (This should be where your Credential file is)'); | ||
} | ||
|
@@ -174,6 +173,9 @@ class GPhotos { | |
} | ||
} | ||
|
||
/** | ||
* @returns {Promise<GooglePhotos.Album[]>} | ||
Check warning on line 177 in GPhotos.js
|
||
*/ | ||
async getAlbums() { | ||
let albums = await this.getAlbumType("albums"); | ||
let shared = await this.getAlbumType("sharedAlbums"); | ||
|
@@ -196,7 +198,6 @@ class GPhotos { | |
const client = await this.onAuthReady(); | ||
let token = client.credentials.access_token; | ||
let list = []; | ||
let found = 0; | ||
const getAlbum = async (pageSize = 50, pageToken = "") => { | ||
this.log("Getting Album info chunks."); | ||
let params = { | ||
|
@@ -207,7 +208,6 @@ class GPhotos { | |
let response = await this.request(token, type, "get", params, null); | ||
let body = response.data; | ||
if (body[type] && Array.isArray(body[type])) { | ||
found += body[type].length; | ||
list = list.concat(body[type]); | ||
} | ||
if (body.nextPageToken) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import globals from "globals"; | ||
import js from "@eslint/js"; | ||
import jsdoc from "eslint-plugin-jsdoc"; | ||
|
||
export default [ | ||
js.configs.recommended, | ||
jsdoc.configs['flat/recommended'], | ||
jsdoc.configs['flat/recommended-typescript-flavor'], | ||
{ | ||
plugins: { | ||
jsdoc, | ||
}, | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
...globals.node, | ||
Log: true, | ||
MM: true, | ||
Module: true, | ||
moment: true, | ||
}, | ||
|
||
ecmaVersion: 13, | ||
sourceType: "module", | ||
|
||
parserOptions: { | ||
ecmaFeatures: { | ||
globalReturn: true, | ||
}, | ||
}, | ||
}, | ||
|
||
rules: { | ||
"comma-dangle": ["error", { | ||
arrays: "always-multiline", | ||
objects: "always-multiline", | ||
imports: "always-multiline", | ||
exports: "always-multiline", | ||
functions: "only-multiline", | ||
}], | ||
|
||
eqeqeq: "error", | ||
"no-prototype-builtins": "off", | ||
"no-unused-vars": "warn", | ||
"no-useless-return": "error", | ||
"no-var": "error", | ||
"jsdoc/require-returns": "off", | ||
"jsdoc/require-param-description": "off", | ||
semi: "error", | ||
}, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.