Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dotcom-tool-kit/upload-assets-to-s3

Package Overview
Dependencies
Maintainers
2
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dotcom-tool-kit/upload-assets-to-s3 - npm Package Compare versions

Comparing version 1.0.0-beta.30 to 1.0.0-beta.31

15

lib/tasks/upload-assets-to-s3.d.ts
import { Task } from '@dotcom-tool-kit/task';
export declare type UploadAssetsToS3Options = {
accessKeyId: string;
secretAccessKey: string;
directory: string;
bucketByEnv: {
review: string[] | string;
prod: string[] | string;
};
destination: string;
extensions: string;
cacheControl: string;
};
export default class UploadAssetsToS3 extends Task<UploadAssetsToS3Options> {
import { UploadAssetsToS3Options, UploadAssetsToS3Schema } from '@dotcom-tool-kit/types/lib/schema/upload-assets-to-s3';
export default class UploadAssetsToS3 extends Task<typeof UploadAssetsToS3Schema> {
static description: string;

@@ -16,0 +5,0 @@ static defaultOptions: UploadAssetsToS3Options;

18

lib/tasks/upload-assets-to-s3.js

@@ -21,6 +21,4 @@ "use strict";

directory: 'public',
bucketByEnv: {
review: 'ft-next-hashed-assets-preview',
prod: ['ft-next-hashed-assets-prod', 'ft-next-hashed-assets-prod-us']
},
reviewBucket: ['ft-next-hashed-assets-preview'],
prodBucket: ['ft-next-hashed-assets-prod', 'ft-next-hashed-assets-prod-us'],
destination: 'hashed-assets/page-kit',

@@ -50,4 +48,12 @@ extensions: 'js,css,map,gz,br,png,jpg,jpeg,gif,webp,svg,ico,json',

const key = path_1.default.posix.join(options.destination, basename);
const { review, prod } = options.bucketByEnv;
const bucketByEnv = process.env.NODE_ENV === 'branch' ? review : prod;
const params = {
Bucket: '',
Key: key,
Body: fs.createReadStream(file),
ACL: 'public-read',
ContentType: `${type}; charset=utf-8`,
ContentEncoding: encoding,
CacheControl: options.cacheControl
};
const bucketByEnv = process.env.NODE_ENV === 'branch' ? options.reviewBucket : options.prodBucket;
let currentBucket = '';

@@ -54,0 +60,0 @@ try {

{
"name": "@dotcom-tool-kit/upload-assets-to-s3",
"version": "1.0.0-beta.30",
"version": "1.0.0-beta.31",
"description": "",

@@ -13,3 +13,4 @@ "main": "lib",

"dependencies": {
"@dotcom-tool-kit/task": "^1.0.0-beta.30",
"@dotcom-tool-kit/task": "^1.0.0-beta.31",
"@dotcom-tool-kit/types": "^1.0.0-beta.31",
"aws-sdk": "^2.901.0",

@@ -16,0 +17,0 @@ "glob": "^7.1.6",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc