-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
revokeToken()
returns void, schedule testing
- Loading branch information
Showing
8 changed files
with
54 additions
and
53 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -6,6 +6,8 @@ on: | |
pull_request: | ||
branches: | ||
- "**" | ||
schedule: | ||
- cron: "45 10 12 * *" | ||
|
||
jobs: | ||
build: | ||
|
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 |
---|---|---|
|
@@ -5,6 +5,6 @@ | |
lib/ | ||
docs/ | ||
tests/ | ||
yarn.lock | ||
package-lock.json | ||
tsconfig.json | ||
CONTRIBUTING.md |
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
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,30 @@ | ||
export type AR<T extends (...args: any) => any> = Awaited<ReturnType<T>>; | ||
|
||
/** ajv will not work properly if type is not changed from string to object where format is date-time */ | ||
export function fixDate(arg: any) { | ||
if (typeof arg === "object" && arg !== null) { | ||
if (arg["format"] && arg["format"] === "date-time" && arg["type"] && arg["type"] === "string") { | ||
arg["type"] = "object" | ||
} | ||
|
||
const keys = Object.keys(arg) | ||
const value = Object.values(arg) | ||
for (let i = 0; i < keys.length; i++) { | ||
arg[keys[i]] = fixDate(value[i]) | ||
} | ||
} | ||
|
||
return arg | ||
} | ||
|
||
/** cool for automatically coming up with the latest x-api-verison */ | ||
export function getCurrentDateString(): string { | ||
const today = new Date() | ||
const year = today.getFullYear() | ||
const month = String(today.getMonth() + 1).padStart(2, "0") // Months are zero-based | ||
const day = String(today.getDate()).padStart(2, "0") | ||
|
||
const str = `${year}${month}${day}` | ||
console.log("Using the following x-api-version:", str) | ||
return str | ||
} |
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