
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Google Drive API wrapper for Vue 2.
$ yarn add uuki/vue-gapi
$ yarn add uuki/vue-gdrive
Use VueGAPI for GAPI authentication.
import Vue from 'vue'
import VueGAPI from 'vue-gapi'
import VueGDrive from 'vue-gdrive'
/**
* https://github.com/cedpoilly/vue-gapi
*/
Vue.use(VueGAPI, {
apiKey: '<API_KEY>',
clientId: '<CLIENT_ID>',
discoveryDocs: ['<DISCOVERY_DOCS>'],
scope: '<SCOPE>',
})
Vue.use(VueGDrive)
gapi.client.drive.files.create
)gapi.client.drive.files.delete
)gapi.client.drive.files.list
)<script>
export default {
methods: {
async createFile () {
const result = await this.$gdrive.createFile({
name: '<FILE_NAME>',
parents: ['<FOLDER_ID>'],
uploadType: 'media',
fields: 'id, name, parents',
media: {
mimeType: '<MIME_TYPE>'
},
resource: {
mimeType: 'application/vnd.google-apps.<FILE_TYPE>'
}
})
},
async getListFiles () {
const result = await this.$gdrive.getListFiles({
orderBy: 'folder,modifiedTime',
q: "trashed=false and '<DRIVE_ID>' in parents",
fields: 'files(id, name, kind, size, mimeType, lastModifyingUser, modifiedTime, iconLink, owners, folderColorRgb, shared, webViewLink, webContentLink), nextPageToken',
});
},
async deleteFile () {
const result = await this.$gdrive.deleteFile({
fileId: '<FILE_ID>'
})
},
}
}
</script>
※ require scope -> https://www.googleapis.com/auth/drive
Supports multiple
attribute.
<template>
<div>
<!-- input pattern -->
<input type="file" multiple v-gd-upload-area="uploadArea">
<!-- droppable pattern -->
<div v-gd-upload-area="uploadArea" />
</div>
</template>
<script>
export default {
data () {
uploadArea: {
uploadOptions: {
path: '/upload/drive/v3/files',
},
metaExtends: {
parents:['<TARGET_FOLDER_ID>']
},
callback: this.onUploaded
}
},
onUploaded (objFile) {
console.log(objFile);
}
}
</script>
FAQs
Google Drive API wrapper for Vue 2.
We found that vue-gdrive demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.