feat: type def for youtube resource
This commit is contained in:
parent
44a289266f
commit
036320a7f8
3 changed files with 30 additions and 5 deletions
19
package-lock.json
generated
19
package-lock.json
generated
|
@ -26,6 +26,7 @@
|
||||||
"@nuxtjs/eslint-module": "^3.0.2",
|
"@nuxtjs/eslint-module": "^3.0.2",
|
||||||
"@nuxtjs/stylelint-module": "^4.1.0",
|
"@nuxtjs/stylelint-module": "^4.1.0",
|
||||||
"@nuxtjs/tailwindcss": "^4.2.1",
|
"@nuxtjs/tailwindcss": "^4.2.1",
|
||||||
|
"@types/gapi.youtube": "^3.0.35",
|
||||||
"@vue/test-utils": "^1.3.0",
|
"@vue/test-utils": "^1.3.0",
|
||||||
"babel-core": "7.0.0-bridge.0",
|
"babel-core": "7.0.0-bridge.0",
|
||||||
"babel-jest": "^27.4.4",
|
"babel-jest": "^27.4.4",
|
||||||
|
@ -4809,6 +4810,15 @@
|
||||||
"@types/gapi": "*"
|
"@types/gapi": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/gapi.youtube": {
|
||||||
|
"version": "3.0.35",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/gapi.youtube/-/gapi.youtube-3.0.35.tgz",
|
||||||
|
"integrity": "sha512-U17CuGgwn+EiA5EWRFN3IST1s69TIDeUmvilwKmWUqoVBSfKju2bWJcaSQbxEyC05b/9F15zAd41pkfOCmhUWA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@types/gapi": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@types/graceful-fs": {
|
"node_modules/@types/graceful-fs": {
|
||||||
"version": "4.1.5",
|
"version": "4.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz",
|
"resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz",
|
||||||
|
@ -30338,6 +30348,15 @@
|
||||||
"@types/gapi": "*"
|
"@types/gapi": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@types/gapi.youtube": {
|
||||||
|
"version": "3.0.35",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/gapi.youtube/-/gapi.youtube-3.0.35.tgz",
|
||||||
|
"integrity": "sha512-U17CuGgwn+EiA5EWRFN3IST1s69TIDeUmvilwKmWUqoVBSfKju2bWJcaSQbxEyC05b/9F15zAd41pkfOCmhUWA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/gapi": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@types/graceful-fs": {
|
"@types/graceful-fs": {
|
||||||
"version": "4.1.5",
|
"version": "4.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz",
|
"resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz",
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
"@nuxtjs/eslint-module": "^3.0.2",
|
"@nuxtjs/eslint-module": "^3.0.2",
|
||||||
"@nuxtjs/stylelint-module": "^4.1.0",
|
"@nuxtjs/stylelint-module": "^4.1.0",
|
||||||
"@nuxtjs/tailwindcss": "^4.2.1",
|
"@nuxtjs/tailwindcss": "^4.2.1",
|
||||||
|
"@types/gapi.youtube": "^3.0.35",
|
||||||
"@vue/test-utils": "^1.3.0",
|
"@vue/test-utils": "^1.3.0",
|
||||||
"babel-core": "7.0.0-bridge.0",
|
"babel-core": "7.0.0-bridge.0",
|
||||||
"babel-jest": "^27.4.4",
|
"babel-jest": "^27.4.4",
|
||||||
|
|
|
@ -17,17 +17,22 @@
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
|
import { GoogleApiYouTubeActivityResource } from '@types/gapi.youtube'
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
name: 'IndexPage',
|
name: 'IndexPage',
|
||||||
|
|
||||||
data: () => ({
|
data(): {
|
||||||
hasError: false,
|
hasError: boolean
|
||||||
videos: [],
|
videos: GoogleApiYouTubeActivityResource[]
|
||||||
}),
|
} {
|
||||||
|
return {
|
||||||
|
hasError: false,
|
||||||
|
videos: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
async fetch() {
|
async fetch() {
|
||||||
/* this.videos = await fetch(`GET https://www.googleapis.com/youtube/v3/playlistItems?part=snippet%2CcontentDetails&maxResults=50&playlistId=${process.env.YOUTUBE_UPLOADS_PLAYLIST_ID}&key=${process.env.YOUTUBE_API_KEY}`) */
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
`https://www.googleapis.com/youtube/v3/playlistItems?part=snippet%2CcontentDetails&maxResults=50&playlistId=${process.env.YOUTUBE_UPLOADS_PLAYLIST_ID}&key=${process.env.YOUTUBE_API_KEY}`
|
`https://www.googleapis.com/youtube/v3/playlistItems?part=snippet%2CcontentDetails&maxResults=50&playlistId=${process.env.YOUTUBE_UPLOADS_PLAYLIST_ID}&key=${process.env.YOUTUBE_API_KEY}`
|
||||||
|
|
Loading…
Add table
Reference in a new issue