Skip to content

Commit

Permalink
Upgrade packages
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwofford committed Dec 1, 2024
1 parent 11e95bf commit 412f0ea
Show file tree
Hide file tree
Showing 8 changed files with 368 additions and 194 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
"@babel/runtime": "^7.7.7",
"@bugsnag/js": "^6.5.0",
"@bugsnag/plugin-express": "^6.5.0",
"airtable": "^0.10.1",
"airtable": "^0.12.2",
"cors": "^2.8.5",
"express": "^4.17.3",
"friendly-words": "^1.1.10",
"isomorphic-unfetch": "^3.0.0",
"js-yaml": "^3.13.1",
"node-cache": "^5.1.2"
"js-yaml": "^4.1.0",
"node-cache": "^5.1.2",
"node-fetch": "^2"
},
"devDependencies": {
"@babel/cli": "^7.6.4",
Expand Down
4 changes: 2 additions & 2 deletions src/v0.1/utils.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import Airtable from "airtable"
import friendlyWords from "friendly-words"
import fetch from "isomorphic-unfetch"
import fetch from "node-fetch"
import yaml from "js-yaml"
import path from "path"
import fs from "fs"

const allowlist = (() => {
try {
const doc = yaml.safeLoad(
const doc = yaml.load(
fs.readFileSync(path.resolve(__dirname, "./airtable-info.yml"), "utf8")
)
return doc
Expand Down
4 changes: 2 additions & 2 deletions src/v0.2/permissions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import fetch from "isomorphic-unfetch"
import fetch from "node-fetch"
import fs from "fs"
import path from "path"
import yaml from "js-yaml"
Expand All @@ -24,6 +24,6 @@ export async function getPermissions(authId) {
path.resolve(__dirname, `./auth/${filename}`),
"utf8"
)
const doc = yaml.safeLoad(file)
const doc = yaml.load(file)
return doc
}
4 changes: 2 additions & 2 deletions src/v0/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { airtableLookup } from "./utils"

router.get("/:base/:tableName/:recordID", async (req, res, next) => {
/*
version: Required. api version to use. Before version 1.0 this isn't being checked– go ahead and put a 0 there
version: Required. api version to use. Before version 0.1 this isn't being checked– go ahead and put a 0 there
base: Required. Either base ID ("routertEEFG5HTfGQE7h") or base name ("Operations")
tableName: Required. WARNING: this table doesn't get read
tableName: Required. WARNING: this field doesn't get read due to a bug in Airtable they've committed to not patching
RecordID: Required. ex "Clubs"
*/
const startTime = Date.now()
Expand Down
4 changes: 2 additions & 2 deletions tests/v0.1/allowlist.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe("load allowlist info (basic)", () => {
})

it("is a parsable yaml file", () => {
const data = yaml.safeLoad(
const data = yaml.load(
fs.readFileSync(path.resolve(__dirname, allowlistPath), "utf8")
)

Expand All @@ -33,7 +33,7 @@ describe("GET allowlisted routes (production)", () => {
jest.setTimeout(30000)

const routes = []
const tables = yaml.safeLoad(
const tables = yaml.load(
fs.readFileSync(path.resolve(__dirname, allowlistPath), "utf8")
)
Object.keys(tables).forEach((tableN) => {
Expand Down
4 changes: 2 additions & 2 deletions tests/v0.2/auth-files.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ describe("auth lists load & are valid yml (basic)", () => {
path.resolve(__dirname, authDirectory, fileName),
"utf-8"
)
expect(() => yaml.safeLoad(file)).not.toThrow()
expect(() => yaml.load(file)).not.toThrow()
})

test.each(cases)("%s is valid YAML", (fileName) => {
const file = fs.readFileSync(
path.resolve(__dirname, authDirectory, fileName),
"utf-8"
)
expect(() => yaml.safeLoad(file)).not.toThrow()
expect(() => yaml.load(file)).not.toThrow()
})
})
2 changes: 1 addition & 1 deletion tests/v0.2/auth-test-file.test._js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe("test auth file", () => {
})

it("is a parsable yaml file", () => {
const data = yaml.safeLoad(
const data = yaml.load(
fs.readFileSync(path.resolve(__dirname, authDirectory, testFile), "utf8")
)

Expand Down
Loading

0 comments on commit 412f0ea

Please sign in to comment.