-
Notifications
You must be signed in to change notification settings - Fork 51
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 #1 from SoftwareBrothers/beta
Beta
- Loading branch information
Showing
37 changed files
with
1,952 additions
and
372 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
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 |
---|---|---|
|
@@ -161,3 +161,4 @@ build | |
.adminbro | ||
|
||
example-app/cypress/videos | ||
example-app/public |
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,7 @@ | ||
POSTGRES_PASSWORD= | ||
POSTGRES_DATABASE= | ||
POSTGRES_USER= | ||
AWS_ACCESS_KEY_ID= | ||
AWS_SECRET_ACCESS_KEY= | ||
AWS_REGION= | ||
AWS_BUCKET= |
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,40 @@ | ||
/* eslint-disable no-console */ | ||
/* eslint-disable class-methods-use-this */ | ||
import uploadFeature, { BaseProvider } from '@admin-bro/upload' | ||
|
||
import { CreateResourceResult } from '../create-resource-result.type' | ||
import { Custom } from '../../../custom/custom.entity' | ||
|
||
class MyProvider extends BaseProvider { | ||
constructor() { | ||
super('bucketName') | ||
} | ||
|
||
public async upload() { | ||
console.log('uploaded') | ||
return true | ||
} | ||
|
||
public async delete() { | ||
console.log('deleted') | ||
return true | ||
} | ||
|
||
public async path() { | ||
return '/fle-url' | ||
} | ||
} | ||
|
||
const createPhotoResource = (): CreateResourceResult<typeof Custom> => ({ | ||
resource: Custom, | ||
options: { | ||
properties: { file: { isVisible: { list: true, show: true, edit: true, filter: false } } }, | ||
}, | ||
features: [uploadFeature({ | ||
provider: new MyProvider(), | ||
properties: { file: 'file', key: 'filePath', bucket: 'bucket' }, | ||
validation: { mimeTypes: ['image/png'] }, | ||
})], | ||
}) | ||
|
||
export default createPhotoResource |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
const credentials = { | ||
accessKeyId: process.env.AWS_ACCESS_KEY_ID || 'AKIAWDVPBGHHOMJ3EOAL', | ||
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY || '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', | ||
region: process.env.AWS_REGION || 'eu-west-2', | ||
bucket: process.env.AWS_BUCKET || 'onserro-media-local-plorenc', | ||
accessKeyId: process.env.AWS_ACCESS_KEY_ID as string, | ||
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY as string, | ||
region: process.env.AWS_REGION as string, | ||
bucket: process.env.AWS_BUCKET as string, | ||
} | ||
export default credentials |
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,29 @@ | ||
/* eslint-disable import/prefer-default-export */ | ||
/* eslint-disable import/no-cycle */ | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
import { | ||
BaseEntity, | ||
Column, | ||
CreateDateColumn, | ||
Entity, | ||
PrimaryGeneratedColumn, | ||
UpdateDateColumn, | ||
} from 'typeorm' | ||
|
||
@Entity({ name: 'custom' }) | ||
export class Custom extends BaseEntity { | ||
@PrimaryGeneratedColumn() | ||
public id: number; | ||
|
||
@Column({ nullable: true }) | ||
public filePath: string; | ||
|
||
@Column({ nullable: true }) | ||
public bucket: string; | ||
|
||
@CreateDateColumn() | ||
public createdAt: Date; | ||
|
||
@UpdateDateColumn() | ||
public updatedAt: Date; | ||
} |
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.