stuff
This commit is contained in:
10
buildfiles/node_modules/app-builder-lib/out/publish/s3/BaseS3Publisher.d.ts
generated
vendored
Normal file
10
buildfiles/node_modules/app-builder-lib/out/publish/s3/BaseS3Publisher.d.ts
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
import { BaseS3Options } from "builder-util-runtime";
|
||||
import { PublishContext, Publisher, UploadTask } from "electron-publish";
|
||||
export declare abstract class BaseS3Publisher extends Publisher {
|
||||
private options;
|
||||
protected constructor(context: PublishContext, options: BaseS3Options);
|
||||
protected abstract getBucketName(): string;
|
||||
protected configureS3Options(args: Array<string>): void;
|
||||
upload(task: UploadTask): Promise<any>;
|
||||
toString(): string;
|
||||
}
|
107
buildfiles/node_modules/app-builder-lib/out/publish/s3/BaseS3Publisher.js
generated
vendored
Normal file
107
buildfiles/node_modules/app-builder-lib/out/publish/s3/BaseS3Publisher.js
generated
vendored
Normal file
@ -0,0 +1,107 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.BaseS3Publisher = void 0;
|
||||
|
||||
function _builderUtil() {
|
||||
const data = require("builder-util");
|
||||
|
||||
_builderUtil = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _electronPublish() {
|
||||
const data = require("electron-publish");
|
||||
|
||||
_electronPublish = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _fsExtra() {
|
||||
const data = require("fs-extra");
|
||||
|
||||
_fsExtra = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var path = _interopRequireWildcard(require("path"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
class BaseS3Publisher extends _electronPublish().Publisher {
|
||||
constructor(context, options) {
|
||||
super(context);
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
configureS3Options(args) {
|
||||
// if explicitly set to null, do not add
|
||||
if (this.options.acl !== null) {
|
||||
args.push("--acl", this.options.acl || "public-read");
|
||||
}
|
||||
} // http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/s3-example-creating-buckets.html
|
||||
|
||||
|
||||
async upload(task) {
|
||||
const fileName = path.basename(task.file);
|
||||
const cancellationToken = this.context.cancellationToken;
|
||||
const target = (this.options.path == null ? "" : `${this.options.path}/`) + fileName;
|
||||
const args = ["publish-s3", "--bucket", this.getBucketName(), "--key", target, "--file", task.file];
|
||||
this.configureS3Options(args);
|
||||
|
||||
if (process.env.__TEST_S3_PUBLISHER__ != null) {
|
||||
const testFile = path.join(process.env.__TEST_S3_PUBLISHER__, target);
|
||||
await (0, _fsExtra().ensureDir)(path.dirname(testFile));
|
||||
await (0, _fsExtra().symlink)(task.file, testFile);
|
||||
return;
|
||||
} // https://github.com/aws/aws-sdk-go/issues/279
|
||||
|
||||
|
||||
this.createProgressBar(fileName, -1); // if (progressBar != null) {
|
||||
// const callback = new ProgressCallback(progressBar)
|
||||
// uploader.on("progress", () => {
|
||||
// if (!cancellationToken.cancelled) {
|
||||
// callback.update(uploader.loaded, uploader.contentLength)
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
return await cancellationToken.createPromise((resolve, reject, onCancel) => {
|
||||
(0, _builderUtil().executeAppBuilder)(args, process => {
|
||||
onCancel(() => {
|
||||
process.kill("SIGINT");
|
||||
});
|
||||
}).then(() => {
|
||||
try {
|
||||
_builderUtil().log.debug({
|
||||
provider: this.providerName,
|
||||
file: fileName,
|
||||
bucket: this.getBucketName()
|
||||
}, "uploaded");
|
||||
} finally {
|
||||
resolve();
|
||||
}
|
||||
}).catch(reject);
|
||||
});
|
||||
}
|
||||
|
||||
toString() {
|
||||
return `${this.providerName} (bucket: ${this.getBucketName()})`;
|
||||
}
|
||||
|
||||
} exports.BaseS3Publisher = BaseS3Publisher;
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=BaseS3Publisher.js.map
|
1
buildfiles/node_modules/app-builder-lib/out/publish/s3/BaseS3Publisher.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/publish/s3/BaseS3Publisher.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/publish/s3/BaseS3Publisher.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;;;;;AAEM,MAAgB,eAAhB,SAAwC,4BAAxC,CAAiD;AACrD,EAAA,WAAA,CAAsB,OAAtB,EAAuD,OAAvD,EAA6E;AAC3E,UAAM,OAAN;AADqD,SAAA,OAAA,GAAA,OAAA;AAEtD;;AAIS,EAAA,kBAAkB,CAAC,IAAD,EAAoB;AAC9C;AACA,QAAI,KAAK,OAAL,CAAa,GAAb,KAAqB,IAAzB,EAA+B;AAC7B,MAAA,IAAI,CAAC,IAAL,CAAU,OAAV,EAAmB,KAAK,OAAL,CAAa,GAAb,IAAoB,aAAvC;AACD;AACF,GAZoD,CAcrD;;;AACA,QAAM,MAAN,CAAa,IAAb,EAA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EAAE,QAApC;AAA8C,YAAA,MAAM,EAAE,KAAK,aAAL;AAAtD,WAAV,EAAuF,UAAvF;AACD,SAFD,SAGQ;AACN,UAAA,OAAO;AACR;AACF,OAZH,EAaG,KAbH,CAaS,MAbT;AAcD,KAfY,CAAb;AAgBD;;AAED,EAAA,QAAQ,GAAA;AACN,WAAO,GAAG,KAAK,YAAY,aAAa,KAAK,aAAL,EAAoB,GAA5D;AACD;;AA9DoD,C","sourcesContent":["import { log, executeAppBuilder } from \"builder-util\"\nimport { BaseS3Options } from \"builder-util-runtime\"\nimport { PublishContext, Publisher, UploadTask } from \"electron-publish\"\nimport { ensureDir, symlink } from \"fs-extra\"\nimport * as path from \"path\"\n\nexport abstract class BaseS3Publisher extends Publisher {\n protected constructor(context: PublishContext, private options: BaseS3Options) {\n super(context)\n }\n\n protected abstract getBucketName(): string\n\n protected configureS3Options(args: Array<string>) {\n // if explicitly set to null, do not add\n if (this.options.acl !== null) {\n args.push(\"--acl\", this.options.acl || \"public-read\")\n }\n }\n\n // http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/s3-example-creating-buckets.html\n async upload(task: UploadTask): Promise<any> {\n const fileName = path.basename(task.file)\n const cancellationToken = this.context.cancellationToken\n\n const target = (this.options.path == null ? \"\" : `${this.options.path}/`) + fileName\n\n const args = [\"publish-s3\", \"--bucket\", this.getBucketName(), \"--key\", target, \"--file\", task.file]\n this.configureS3Options(args)\n\n if (process.env.__TEST_S3_PUBLISHER__ != null) {\n const testFile = path.join(process.env.__TEST_S3_PUBLISHER__!, target)\n await ensureDir(path.dirname(testFile))\n await symlink(task.file, testFile)\n return\n }\n\n // https://github.com/aws/aws-sdk-go/issues/279\n this.createProgressBar(fileName, -1)\n // if (progressBar != null) {\n // const callback = new ProgressCallback(progressBar)\n // uploader.on(\"progress\", () => {\n // if (!cancellationToken.cancelled) {\n // callback.update(uploader.loaded, uploader.contentLength)\n // }\n // })\n // }\n\n return await cancellationToken.createPromise((resolve, reject, onCancel) => {\n executeAppBuilder(args, process => {\n onCancel(() => {\n process.kill(\"SIGINT\")\n })\n })\n .then(() => {\n try {\n log.debug({provider: this.providerName, file: fileName, bucket: this.getBucketName()}, \"uploaded\")\n }\n finally {\n resolve()\n }\n })\n .catch(reject)\n })\n }\n\n toString() {\n return `${this.providerName} (bucket: ${this.getBucketName()})`\n }\n}\n"],"sourceRoot":""}
|
12
buildfiles/node_modules/app-builder-lib/out/publish/s3/s3Publisher.d.ts
generated
vendored
Normal file
12
buildfiles/node_modules/app-builder-lib/out/publish/s3/s3Publisher.d.ts
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
import { S3Options } from "builder-util-runtime";
|
||||
import { PublishContext } from "electron-publish";
|
||||
import { BaseS3Publisher } from "./BaseS3Publisher";
|
||||
export default class S3Publisher extends BaseS3Publisher {
|
||||
private readonly info;
|
||||
readonly providerName = "S3";
|
||||
constructor(context: PublishContext, info: S3Options);
|
||||
static checkAndResolveOptions(options: S3Options, channelFromAppVersion: string | null, errorIfCannot: boolean): Promise<void>;
|
||||
protected getBucketName(): string;
|
||||
protected configureS3Options(args: Array<string>): void;
|
||||
toString(): string;
|
||||
}
|
101
buildfiles/node_modules/app-builder-lib/out/publish/s3/s3Publisher.js
generated
vendored
Normal file
101
buildfiles/node_modules/app-builder-lib/out/publish/s3/s3Publisher.js
generated
vendored
Normal file
@ -0,0 +1,101 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _builderUtil() {
|
||||
const data = require("builder-util");
|
||||
|
||||
_builderUtil = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _BaseS3Publisher() {
|
||||
const data = require("./BaseS3Publisher");
|
||||
|
||||
_BaseS3Publisher = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
class S3Publisher extends _BaseS3Publisher().BaseS3Publisher {
|
||||
constructor(context, info) {
|
||||
super(context, info);
|
||||
this.info = info;
|
||||
this.providerName = "S3";
|
||||
}
|
||||
|
||||
static async checkAndResolveOptions(options, channelFromAppVersion, errorIfCannot) {
|
||||
const bucket = options.bucket;
|
||||
|
||||
if (bucket == null) {
|
||||
throw new (_builderUtil().InvalidConfigurationError)(`Please specify "bucket" for "s3" publish provider`);
|
||||
}
|
||||
|
||||
if (options.endpoint == null && bucket.includes(".") && options.region == null) {
|
||||
// on dotted bucket names, we need to use a path-based endpoint URL. Path-based endpoint URLs need to include the region.
|
||||
try {
|
||||
options.region = await (0, _builderUtil().executeAppBuilder)(["get-bucket-location", "--bucket", bucket]);
|
||||
} catch (e) {
|
||||
if (errorIfCannot) {
|
||||
throw e;
|
||||
} else {
|
||||
_builderUtil().log.warn(`cannot compute region for bucket (required because on dotted bucket names, we need to use a path-based endpoint URL): ${e}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (options.channel == null && channelFromAppVersion != null) {
|
||||
options.channel = channelFromAppVersion;
|
||||
}
|
||||
|
||||
if (options.endpoint != null && options.endpoint.endsWith("/")) {
|
||||
options.endpoint = options.endpoint.slice(0, -1);
|
||||
}
|
||||
}
|
||||
|
||||
getBucketName() {
|
||||
return this.info.bucket;
|
||||
}
|
||||
|
||||
configureS3Options(args) {
|
||||
super.configureS3Options(args);
|
||||
|
||||
if (this.info.endpoint != null) {
|
||||
args.push("--endpoint", this.info.endpoint);
|
||||
}
|
||||
|
||||
if (this.info.region != null) {
|
||||
args.push("--region", this.info.region);
|
||||
}
|
||||
|
||||
if (this.info.storageClass != null) {
|
||||
args.push("--storageClass", this.info.storageClass);
|
||||
}
|
||||
|
||||
if (this.info.encryption != null) {
|
||||
args.push("--encryption", this.info.encryption);
|
||||
}
|
||||
}
|
||||
|
||||
toString() {
|
||||
const result = super.toString();
|
||||
const endpoint = this.info.endpoint;
|
||||
|
||||
if (endpoint != null) {
|
||||
return result.substring(0, result.length - 1) + `, endpoint: ${endpoint})`;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
} exports.default = S3Publisher;
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=s3Publisher.js.map
|
1
buildfiles/node_modules/app-builder-lib/out/publish/s3/s3Publisher.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/publish/s3/s3Publisher.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/publish/s3/s3Publisher.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEc,MAAO,WAAP,SAA2B,kCAA3B,CAA0C;AAGtD,EAAA,WAAA,CAAY,OAAZ,EAAsD,IAAtD,EAAqE;AACnE,UAAM,OAAN,EAAe,IAAf;AADoD,SAAA,IAAA,GAAA,IAAA;AAF7C,SAAA,YAAA,GAAe,IAAf;AAIR;;AAED,eAAa,sBAAb,CAAoC,OAApC,EAAwD,qBAAxD,EAA8F,aAA9F,EAAoH;AAClH,UAAM,MAAM,GAAG,OAAO,CAAC,MAAvB;;AACA,QAAI,MAAM,IAAI,IAAd,EAAoB;AAClB,YAAM,KAAI,wCAAJ,EAA8B,mDAA9B,CAAN;AACD;;AAED,QAAI,OAAO,CAAC,QAAR,IAAoB,IAApB,IAA6B,MAAM,CAAC,QAAP,CAAgB,GAAhB,KAAwB,OAAO,CAAC,MAAR,IAAkB,IAA3E,EAAkF;AAChF;AACA,UAAI;AACF,QAAA,OAAO,CAAC,MAAR,GAAiB,MAAM,sCAAkB,CAAC,qBAAD,EAAwB,UAAxB,EAAoC,MAApC,CAAlB,CAAvB;AACD,OAFD,CAGA,OAAO,CAAP,EAAU;AACR,YAAI,aAAJ,EAAmB;AACjB,gBAAM,CAAN;AACD,SAFD,MAGK;AACH,6BAAI,IAAJ,CAAS,yHAAyH,CAAC,EAAnI;AACD;AACF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,aAAO,MAAM,CAAC,SAAP,CAAiB,CAAjB,EAAoB,MAAM,CAAC,MAAP,GAAgB,CAApC,IAAyC,eAAe,QAAQ,GAAvE;AACD;;AACD,WAAO,MAAP;AACD;;AAlEqD,C","sourcesContent":["import { executeAppBuilder, InvalidConfigurationError, log } from \"builder-util\"\nimport { S3Options } from \"builder-util-runtime\"\nimport { PublishContext } from \"electron-publish\"\nimport { BaseS3Publisher } from \"./BaseS3Publisher\"\n\nexport default class S3Publisher extends BaseS3Publisher {\n readonly providerName = \"S3\"\n\n constructor(context: PublishContext, private readonly info: S3Options) {\n super(context, info)\n }\n\n static async checkAndResolveOptions(options: S3Options, channelFromAppVersion: string | null, errorIfCannot: boolean) {\n const bucket = options.bucket\n if (bucket == null) {\n throw new InvalidConfigurationError(`Please specify \"bucket\" for \"s3\" publish provider`)\n }\n\n if (options.endpoint == null && (bucket.includes(\".\") && options.region == null)) {\n // on dotted bucket names, we need to use a path-based endpoint URL. Path-based endpoint URLs need to include the region.\n try {\n options.region = await executeAppBuilder([\"get-bucket-location\", \"--bucket\", bucket])\n }\n catch (e) {\n if (errorIfCannot) {\n throw e\n }\n else {\n log.warn(`cannot compute region for bucket (required because on dotted bucket names, we need to use a path-based endpoint URL): ${e}`)\n }\n }\n }\n\n if (options.channel == null && channelFromAppVersion != null) {\n options.channel = channelFromAppVersion\n }\n\n if (options.endpoint != null && options.endpoint.endsWith(\"/\")) {\n (options as any).endpoint = options.endpoint.slice(0, -1)\n }\n }\n\n protected getBucketName(): string {\n return this.info.bucket!\n }\n\n protected configureS3Options(args: Array<string>): void {\n super.configureS3Options(args)\n\n if (this.info.endpoint != null) {\n args.push(\"--endpoint\", this.info.endpoint)\n }\n if (this.info.region != null) {\n args.push(\"--region\", this.info.region)\n }\n\n if (this.info.storageClass != null) {\n args.push(\"--storageClass\", this.info.storageClass)\n }\n if (this.info.encryption != null) {\n args.push(\"--encryption\", this.info.encryption)\n }\n }\n\n toString() {\n const result = super.toString()\n const endpoint = this.info.endpoint\n if (endpoint != null) {\n return result.substring(0, result.length - 1) + `, endpoint: ${endpoint})`\n }\n return result\n }\n}\n"],"sourceRoot":""}
|
11
buildfiles/node_modules/app-builder-lib/out/publish/s3/spacesPublisher.d.ts
generated
vendored
Normal file
11
buildfiles/node_modules/app-builder-lib/out/publish/s3/spacesPublisher.d.ts
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
import { SpacesOptions } from "builder-util-runtime";
|
||||
import { PublishContext } from "electron-publish";
|
||||
import { BaseS3Publisher } from "./BaseS3Publisher";
|
||||
export default class SpacesPublisher extends BaseS3Publisher {
|
||||
private readonly info;
|
||||
readonly providerName = "Spaces";
|
||||
constructor(context: PublishContext, info: SpacesOptions);
|
||||
static checkAndResolveOptions(options: SpacesOptions, channelFromAppVersion: string | null, errorIfCannot: boolean): Promise<void>;
|
||||
protected getBucketName(): string;
|
||||
protected configureS3Options(args: Array<string>): void;
|
||||
}
|
75
buildfiles/node_modules/app-builder-lib/out/publish/s3/spacesPublisher.js
generated
vendored
Normal file
75
buildfiles/node_modules/app-builder-lib/out/publish/s3/spacesPublisher.js
generated
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _builderUtil() {
|
||||
const data = require("builder-util");
|
||||
|
||||
_builderUtil = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _BaseS3Publisher() {
|
||||
const data = require("./BaseS3Publisher");
|
||||
|
||||
_BaseS3Publisher = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
class SpacesPublisher extends _BaseS3Publisher().BaseS3Publisher {
|
||||
constructor(context, info) {
|
||||
super(context, info);
|
||||
this.info = info;
|
||||
this.providerName = "Spaces";
|
||||
} // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
|
||||
|
||||
static async checkAndResolveOptions(options, channelFromAppVersion, errorIfCannot) {
|
||||
if (options.name == null) {
|
||||
throw new (_builderUtil().InvalidConfigurationError)(`Please specify "name" for "spaces" publish provider (see https://www.electron.build/configuration/publish#spacesoptions)`);
|
||||
}
|
||||
|
||||
if (options.region == null) {
|
||||
throw new (_builderUtil().InvalidConfigurationError)(`Please specify "region" for "spaces" publish provider (see https://www.electron.build/configuration/publish#spacesoptions)`);
|
||||
}
|
||||
|
||||
if (options.channel == null && channelFromAppVersion != null) {
|
||||
options.channel = channelFromAppVersion;
|
||||
}
|
||||
}
|
||||
|
||||
getBucketName() {
|
||||
return this.info.name;
|
||||
}
|
||||
|
||||
configureS3Options(args) {
|
||||
super.configureS3Options(args);
|
||||
args.push("--endpoint", `${this.info.region}.digitaloceanspaces.com`);
|
||||
args.push("--region", this.info.region);
|
||||
const accessKey = process.env.DO_KEY_ID;
|
||||
const secretKey = process.env.DO_SECRET_KEY;
|
||||
|
||||
if ((0, _builderUtil().isEmptyOrSpaces)(accessKey)) {
|
||||
throw new (_builderUtil().InvalidConfigurationError)("Please set env DO_KEY_ID (see https://www.electron.build/configuration/publish#spacesoptions)");
|
||||
}
|
||||
|
||||
if ((0, _builderUtil().isEmptyOrSpaces)(secretKey)) {
|
||||
throw new (_builderUtil().InvalidConfigurationError)("Please set env DO_SECRET_KEY (see https://www.electron.build/configuration/publish#spacesoptions)");
|
||||
}
|
||||
|
||||
args.push("--accessKey", accessKey);
|
||||
args.push("--secretKey", secretKey);
|
||||
}
|
||||
|
||||
} exports.default = SpacesPublisher;
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=spacesPublisher.js.map
|
1
buildfiles/node_modules/app-builder-lib/out/publish/s3/spacesPublisher.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/publish/s3/spacesPublisher.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/publish/s3/spacesPublisher.ts"],"names":[],"mappings":";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ACD,QAAI,oCAAgB,SAAhB,CAAJ,EAAgC;AAC9B,YAAM,KAAI,wCAAJ,EAA8B,mGAA9B,CAAN;AACD;;AACD,IAAA,IAAI,CAAC,IAAL,CAAU,aAAV,EAAyB,SAAzB;AACA,IAAA,IAAI,CAAC,IAAL,CAAU,aAAV,EAAyB,SAAzB;AACD;;AAzCyD,C","sourcesContent":["import { InvalidConfigurationError, isEmptyOrSpaces } from \"builder-util\"\nimport { SpacesOptions } from \"builder-util-runtime\"\nimport { PublishContext } from \"electron-publish\"\nimport { BaseS3Publisher } from \"./BaseS3Publisher\"\n\nexport default class SpacesPublisher extends BaseS3Publisher {\n readonly providerName = \"Spaces\"\n\n constructor(context: PublishContext, private readonly info: SpacesOptions) {\n super(context, info)\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static async checkAndResolveOptions(options: SpacesOptions, channelFromAppVersion: string | null, errorIfCannot: boolean) {\n if (options.name == null) {\n throw new InvalidConfigurationError(`Please specify \"name\" for \"spaces\" publish provider (see https://www.electron.build/configuration/publish#spacesoptions)`)\n }\n if (options.region == null) {\n throw new InvalidConfigurationError(`Please specify \"region\" for \"spaces\" publish provider (see https://www.electron.build/configuration/publish#spacesoptions)`)\n }\n\n if (options.channel == null && channelFromAppVersion != null) {\n options.channel = channelFromAppVersion\n }\n }\n\n protected getBucketName(): string {\n return this.info.name\n }\n\n protected configureS3Options(args: Array<string>): void {\n super.configureS3Options(args)\n\n args.push(\"--endpoint\", `${this.info.region}.digitaloceanspaces.com`)\n args.push(\"--region\", this.info.region)\n\n const accessKey = process.env.DO_KEY_ID\n const secretKey = process.env.DO_SECRET_KEY\n if (isEmptyOrSpaces(accessKey)) {\n throw new InvalidConfigurationError(\"Please set env DO_KEY_ID (see https://www.electron.build/configuration/publish#spacesoptions)\")\n }\n if (isEmptyOrSpaces(secretKey)) {\n throw new InvalidConfigurationError(\"Please set env DO_SECRET_KEY (see https://www.electron.build/configuration/publish#spacesoptions)\")\n }\n args.push(\"--accessKey\", accessKey)\n args.push(\"--secretKey\", secretKey)\n }\n}"],"sourceRoot":""}
|
Reference in New Issue
Block a user