This repository has been archived by the owner on Oct 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 #4627 from withspectrum/alpha
v2.7.0
- Loading branch information
Showing
57 changed files
with
1,667 additions
and
1,321 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 |
---|---|---|
|
@@ -14,10 +14,10 @@ asynckit@^0.4.0: | |
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" | ||
integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= | ||
|
||
aws-sdk@^2.383.0: | ||
version "2.383.0" | ||
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.383.0.tgz#86045c0a4a4898dca84a4877cbe765b7dc0f8bba" | ||
integrity sha512-PN+s+NTABtBloS46c7C2dvoEzrdY2NZ5nsfljL3xDX2rvjJEQxdchS2jcCpyc5ZNudFwta66wY4EGBZqf4Attw== | ||
aws-sdk@^2.395.0: | ||
version "2.395.0" | ||
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.395.0.tgz#637e5fa06d69bfb923b17bde24a8bd2a74dedab3" | ||
integrity sha512-ldTTjctniZT4E2lq2z3D8Y2u+vpkp+laoEnDkXgjKXTKbiJ0QEtfWsUdx/IQ7awCt8stoxyqZK47DJOxIbRNoA== | ||
dependencies: | ||
buffer "4.9.1" | ||
events "1.1.1" | ||
|
@@ -26,7 +26,7 @@ aws-sdk@^2.383.0: | |
querystring "0.2.0" | ||
sax "1.2.1" | ||
url "0.10.3" | ||
uuid "3.1.0" | ||
uuid "3.3.2" | ||
xml2js "0.4.19" | ||
|
||
base64-js@^1.0.2: | ||
|
@@ -713,11 +713,6 @@ util-deprecate@~1.0.1: | |
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" | ||
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= | ||
|
||
[email protected]: | ||
version "3.1.0" | ||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" | ||
integrity sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g== | ||
|
||
[email protected], uuid@^3.1.0: | ||
version "3.3.2" | ||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" | ||
|
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,8 @@ | ||
// @flow | ||
import uploadImage from './uploadImage'; | ||
|
||
module.exports = { | ||
Mutation: { | ||
uploadImage, | ||
}, | ||
}; |
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,23 @@ | ||
// @flow | ||
import { isAuthedResolver } from '../../utils/permissions'; | ||
import { uploadImage } from '../../utils/file-storage'; | ||
import type { EntityTypes } from 'shared/types'; | ||
import type { GraphQLContext } from '../../'; | ||
import type { FileUpload } from 'shared/types'; | ||
import { signImageUrl } from 'shared/imgix'; | ||
|
||
type Args = { | ||
input: { | ||
image: FileUpload, | ||
type: EntityTypes, | ||
id?: string, | ||
}, | ||
}; | ||
|
||
export default isAuthedResolver( | ||
async (_: void, { input }: Args, { loaders }: GraphQLContext) => { | ||
const { image, type, id } = input; | ||
const url = await uploadImage(image, type, id || 'draft'); | ||
return await signImageUrl(url); | ||
} | ||
); |
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
Oops, something went wrong.