stuff
This commit is contained in:
18
buildfiles/node_modules/builder-util-runtime/out/CancellationToken.d.ts
generated
vendored
Normal file
18
buildfiles/node_modules/builder-util-runtime/out/CancellationToken.d.ts
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
/// <reference types="node" />
|
||||
import { EventEmitter } from "events";
|
||||
export declare class CancellationToken extends EventEmitter {
|
||||
private parentCancelHandler;
|
||||
private _cancelled;
|
||||
get cancelled(): boolean;
|
||||
private _parent;
|
||||
set parent(value: CancellationToken);
|
||||
constructor(parent?: CancellationToken);
|
||||
cancel(): void;
|
||||
private onCancel;
|
||||
createPromise<R>(callback: (resolve: (thenableOrResult?: R) => void, reject: (error: Error) => void, onCancel: (callback: () => void) => void) => void): Promise<R>;
|
||||
private removeParentCancelHandler;
|
||||
dispose(): void;
|
||||
}
|
||||
export declare class CancellationError extends Error {
|
||||
constructor();
|
||||
}
|
134
buildfiles/node_modules/builder-util-runtime/out/CancellationToken.js
generated
vendored
Normal file
134
buildfiles/node_modules/builder-util-runtime/out/CancellationToken.js
generated
vendored
Normal file
@ -0,0 +1,134 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.CancellationError = exports.CancellationToken = void 0;
|
||||
|
||||
function _events() {
|
||||
const data = require("events");
|
||||
|
||||
_events = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
class CancellationToken extends _events().EventEmitter {
|
||||
// babel cannot compile ... correctly for super calls
|
||||
constructor(parent) {
|
||||
super();
|
||||
this.parentCancelHandler = null;
|
||||
this._parent = null;
|
||||
this._cancelled = false;
|
||||
|
||||
if (parent != null) {
|
||||
this.parent = parent;
|
||||
}
|
||||
}
|
||||
|
||||
get cancelled() {
|
||||
return this._cancelled || this._parent != null && this._parent.cancelled;
|
||||
}
|
||||
|
||||
set parent(value) {
|
||||
this.removeParentCancelHandler();
|
||||
this._parent = value;
|
||||
|
||||
this.parentCancelHandler = () => this.cancel();
|
||||
|
||||
this._parent.onCancel(this.parentCancelHandler);
|
||||
}
|
||||
|
||||
cancel() {
|
||||
this._cancelled = true;
|
||||
this.emit("cancel");
|
||||
}
|
||||
|
||||
onCancel(handler) {
|
||||
if (this.cancelled) {
|
||||
handler();
|
||||
} else {
|
||||
this.once("cancel", handler);
|
||||
}
|
||||
}
|
||||
|
||||
createPromise(callback) {
|
||||
if (this.cancelled) {
|
||||
return Promise.reject(new CancellationError());
|
||||
}
|
||||
|
||||
const finallyHandler = () => {
|
||||
if (cancelHandler != null) {
|
||||
try {
|
||||
this.removeListener("cancel", cancelHandler);
|
||||
cancelHandler = null;
|
||||
} catch (ignore) {// ignore
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let cancelHandler = null;
|
||||
return new Promise((resolve, reject) => {
|
||||
let addedCancelHandler = null;
|
||||
|
||||
cancelHandler = () => {
|
||||
try {
|
||||
if (addedCancelHandler != null) {
|
||||
addedCancelHandler();
|
||||
addedCancelHandler = null;
|
||||
}
|
||||
} finally {
|
||||
reject(new CancellationError());
|
||||
}
|
||||
};
|
||||
|
||||
if (this.cancelled) {
|
||||
cancelHandler();
|
||||
return;
|
||||
}
|
||||
|
||||
this.onCancel(cancelHandler);
|
||||
callback(resolve, reject, callback => {
|
||||
addedCancelHandler = callback;
|
||||
});
|
||||
}).then(it => {
|
||||
finallyHandler();
|
||||
return it;
|
||||
}).catch(e => {
|
||||
finallyHandler();
|
||||
throw e;
|
||||
});
|
||||
}
|
||||
|
||||
removeParentCancelHandler() {
|
||||
const parent = this._parent;
|
||||
|
||||
if (parent != null && this.parentCancelHandler != null) {
|
||||
parent.removeListener("cancel", this.parentCancelHandler);
|
||||
this.parentCancelHandler = null;
|
||||
}
|
||||
}
|
||||
|
||||
dispose() {
|
||||
try {
|
||||
this.removeParentCancelHandler();
|
||||
} finally {
|
||||
this.removeAllListeners();
|
||||
this._parent = null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.CancellationToken = CancellationToken;
|
||||
|
||||
class CancellationError extends Error {
|
||||
constructor() {
|
||||
super("cancelled");
|
||||
}
|
||||
|
||||
} exports.CancellationError = CancellationError;
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=CancellationToken.js.map
|
1
buildfiles/node_modules/builder-util-runtime/out/CancellationToken.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/builder-util-runtime/out/CancellationToken.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
22
buildfiles/node_modules/builder-util-runtime/out/ProgressCallbackTransform.d.ts
generated
vendored
Normal file
22
buildfiles/node_modules/builder-util-runtime/out/ProgressCallbackTransform.d.ts
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
/// <reference types="node" />
|
||||
import { Transform } from "stream";
|
||||
import { CancellationToken } from "./CancellationToken";
|
||||
export interface ProgressInfo {
|
||||
total: number;
|
||||
delta: number;
|
||||
transferred: number;
|
||||
percent: number;
|
||||
bytesPerSecond: number;
|
||||
}
|
||||
export declare class ProgressCallbackTransform extends Transform {
|
||||
private readonly total;
|
||||
private readonly cancellationToken;
|
||||
private readonly onProgress;
|
||||
private start;
|
||||
private transferred;
|
||||
private delta;
|
||||
private nextUpdate;
|
||||
constructor(total: number, cancellationToken: CancellationToken, onProgress: (info: ProgressInfo) => any);
|
||||
_transform(chunk: any, encoding: string, callback: any): void;
|
||||
_flush(callback: any): void;
|
||||
}
|
76
buildfiles/node_modules/builder-util-runtime/out/ProgressCallbackTransform.js
generated
vendored
Normal file
76
buildfiles/node_modules/builder-util-runtime/out/ProgressCallbackTransform.js
generated
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.ProgressCallbackTransform = void 0;
|
||||
|
||||
function _stream() {
|
||||
const data = require("stream");
|
||||
|
||||
_stream = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
class ProgressCallbackTransform extends _stream().Transform {
|
||||
constructor(total, cancellationToken, onProgress) {
|
||||
super();
|
||||
this.total = total;
|
||||
this.cancellationToken = cancellationToken;
|
||||
this.onProgress = onProgress;
|
||||
this.start = Date.now();
|
||||
this.transferred = 0;
|
||||
this.delta = 0;
|
||||
this.nextUpdate = this.start + 1000;
|
||||
}
|
||||
|
||||
_transform(chunk, encoding, callback) {
|
||||
if (this.cancellationToken.cancelled) {
|
||||
callback(new Error("cancelled"), null);
|
||||
return;
|
||||
}
|
||||
|
||||
this.transferred += chunk.length;
|
||||
this.delta += chunk.length;
|
||||
const now = Date.now();
|
||||
|
||||
if (now >= this.nextUpdate && this.transferred !== this.total
|
||||
/* will be emitted on _flush */
|
||||
) {
|
||||
this.nextUpdate = now + 1000;
|
||||
this.onProgress({
|
||||
total: this.total,
|
||||
delta: this.delta,
|
||||
transferred: this.transferred,
|
||||
percent: this.transferred / this.total * 100,
|
||||
bytesPerSecond: Math.round(this.transferred / ((now - this.start) / 1000))
|
||||
});
|
||||
this.delta = 0;
|
||||
}
|
||||
|
||||
callback(null, chunk);
|
||||
}
|
||||
|
||||
_flush(callback) {
|
||||
if (this.cancellationToken.cancelled) {
|
||||
callback(new Error("cancelled"));
|
||||
return;
|
||||
}
|
||||
|
||||
this.onProgress({
|
||||
total: this.total,
|
||||
delta: this.delta,
|
||||
transferred: this.total,
|
||||
percent: 100,
|
||||
bytesPerSecond: Math.round(this.transferred / ((Date.now() - this.start) / 1000))
|
||||
});
|
||||
this.delta = 0;
|
||||
callback(null);
|
||||
}
|
||||
|
||||
} exports.ProgressCallbackTransform = ProgressCallbackTransform;
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=ProgressCallbackTransform.js.map
|
1
buildfiles/node_modules/builder-util-runtime/out/ProgressCallbackTransform.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/builder-util-runtime/out/ProgressCallbackTransform.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../src/ProgressCallbackTransform.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAWM,MAAO,yBAAP,SAAyC,mBAAzC,CAAkD;AAOtD,EAAA,WAAA,CAA6B,KAA7B,EAA6D,iBAA7D,EAAoH,UAApH,EAA2J;AACzJ;AAD2B,SAAA,KAAA,GAAA,KAAA;AAAgC,SAAA,iBAAA,GAAA,iBAAA;AAAuD,SAAA,UAAA,GAAA,UAAA;AAN5G,SAAA,KAAA,GAAQ,IAAI,CAAC,GAAL,EAAR;AACA,SAAA,WAAA,GAAc,CAAd;AACA,SAAA,KAAA,GAAQ,CAAR;AAEA,SAAA,UAAA,GAAa,KAAK,KAAL,GAAa,IAA1B;AAIP;;AAED,EAAA,UAAU,CAAC,KAAD,EAAa,QAAb,EAA+B,QAA/B,EAA4C;AACpD,QAAI,KAAK,iBAAL,CAAuB,SAA3B,EAAsC;AACpC,MAAA,QAAQ,CAAC,IAAI,KAAJ,CAAU,WAAV,CAAD,EAAyB,IAAzB,CAAR;AACA;AACD;;AAED,SAAK,WAAL,IAAoB,KAAK,CAAC,MAA1B;AACA,SAAK,KAAL,IAAc,KAAK,CAAC,MAApB;AAEA,UAAM,GAAG,GAAG,IAAI,CAAC,GAAL,EAAZ;;AACA,QAAI,GAAG,IAAI,KAAK,UAAZ,IAA0B,KAAK,WAAL,KAAqB,KAAK;AAAM;AAA9D,MAA+F;AAC7F,aAAK,UAAL,GAAkB,GAAG,GAAG,IAAxB;AAEA,aAAK,UAAL,CAAgB;AACd,UAAA,KAAK,EAAE,KAAK,KADE;AAEd,UAAA,KAAK,EAAE,KAAK,KAFE;AAGd,UAAA,WAAW,EAAE,KAAK,WAHJ;AAId,UAAA,OAAO,EAAG,KAAK,WAAL,GAAmB,KAAK,KAAzB,GAAkC,GAJ7B;AAKd,UAAA,cAAc,EAAE,IAAI,CAAC,KAAL,CAAW,KAAK,WAAL,IAAoB,CAAC,GAAG,GAAG,KAAK,KAAZ,IAAqB,IAAzC,CAAX;AALF,SAAhB;AAOA,aAAK,KAAL,GAAa,CAAb;AACD;;AAED,IAAA,QAAQ,CAAC,IAAD,EAAO,KAAP,CAAR;AACD;;AAED,EAAA,MAAM,CAAC,QAAD,EAAc;AAClB,QAAI,KAAK,iBAAL,CAAuB,SAA3B,EAAsC;AACpC,MAAA,QAAQ,CAAC,IAAI,KAAJ,CAAU,WAAV,CAAD,CAAR;AACA;AACD;;AAED,SAAK,UAAL,CAAgB;AACd,MAAA,KAAK,EAAE,KAAK,KADE;AAEd,MAAA,KAAK,EAAE,KAAK,KAFE;AAGd,MAAA,WAAW,EAAE,KAAK,KAHJ;AAId,MAAA,OAAO,EAAE,GAJK;AAKd,MAAA,cAAc,EAAE,IAAI,CAAC,KAAL,CAAW,KAAK,WAAL,IAAoB,CAAC,IAAI,CAAC,GAAL,KAAa,KAAK,KAAnB,IAA4B,IAAhD,CAAX;AALF,KAAhB;AAOA,SAAK,KAAL,GAAa,CAAb;AAEA,IAAA,QAAQ,CAAC,IAAD,CAAR;AACD;;AArDqD,C","sourcesContent":["import { Transform } from \"stream\"\nimport { CancellationToken } from \"./CancellationToken\"\n\nexport interface ProgressInfo {\n total: number\n delta: number\n transferred: number\n percent: number\n bytesPerSecond: number\n}\n\nexport class ProgressCallbackTransform extends Transform {\n private start = Date.now()\n private transferred = 0\n private delta = 0\n\n private nextUpdate = this.start + 1000\n\n constructor(private readonly total: number, private readonly cancellationToken: CancellationToken, private readonly onProgress: (info: ProgressInfo) => any) {\n super()\n }\n\n _transform(chunk: any, encoding: string, callback: any) {\n if (this.cancellationToken.cancelled) {\n callback(new Error(\"cancelled\"), null)\n return\n }\n\n this.transferred += chunk.length\n this.delta += chunk.length\n\n const now = Date.now()\n if (now >= this.nextUpdate && this.transferred !== this.total /* will be emitted on _flush */) {\n this.nextUpdate = now + 1000\n\n this.onProgress({\n total: this.total,\n delta: this.delta,\n transferred: this.transferred,\n percent: (this.transferred / this.total) * 100,\n bytesPerSecond: Math.round(this.transferred / ((now - this.start) / 1000))\n })\n this.delta = 0\n }\n\n callback(null, chunk)\n }\n\n _flush(callback: any): void {\n if (this.cancellationToken.cancelled) {\n callback(new Error(\"cancelled\"))\n return\n }\n\n this.onProgress({\n total: this.total,\n delta: this.delta,\n transferred: this.total,\n percent: 100,\n bytesPerSecond: Math.round(this.transferred / ((Date.now() - this.start) / 1000))\n })\n this.delta = 0\n\n callback(null)\n }\n}\n"],"sourceRoot":""}
|
33
buildfiles/node_modules/builder-util-runtime/out/bintray.d.ts
generated
vendored
Normal file
33
buildfiles/node_modules/builder-util-runtime/out/bintray.d.ts
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
import { CancellationToken } from "./CancellationToken";
|
||||
import { HttpExecutor, RequestHeaders } from "./httpExecutor";
|
||||
import { BintrayOptions } from "./publishOptions";
|
||||
export interface Version {
|
||||
readonly name: string;
|
||||
readonly package: string;
|
||||
}
|
||||
export interface File {
|
||||
name: string;
|
||||
path: string;
|
||||
sha1: string;
|
||||
sha256: string;
|
||||
}
|
||||
export declare class BintrayClient {
|
||||
private readonly httpExecutor;
|
||||
private readonly cancellationToken;
|
||||
private readonly basePath;
|
||||
readonly auth: string | null;
|
||||
readonly repo: string;
|
||||
readonly owner: string;
|
||||
readonly user: string;
|
||||
readonly component: string | null;
|
||||
readonly distribution: string | null;
|
||||
readonly packageName: string;
|
||||
private requestHeaders;
|
||||
setRequestHeaders(value: RequestHeaders | null): void;
|
||||
constructor(options: BintrayOptions, httpExecutor: HttpExecutor<any>, cancellationToken: CancellationToken, apiKey?: string | null);
|
||||
private bintrayRequest;
|
||||
getVersion(version: string): Promise<Version>;
|
||||
getVersionFiles(version: string): Promise<Array<File>>;
|
||||
createVersion(version: string): Promise<any>;
|
||||
deleteVersion(version: string): Promise<any>;
|
||||
}
|
74
buildfiles/node_modules/builder-util-runtime/out/bintray.js
generated
vendored
Normal file
74
buildfiles/node_modules/builder-util-runtime/out/bintray.js
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.BintrayClient = void 0;
|
||||
|
||||
function _httpExecutor() {
|
||||
const data = require("./httpExecutor");
|
||||
|
||||
_httpExecutor = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
class BintrayClient {
|
||||
constructor(options, httpExecutor, cancellationToken, apiKey) {
|
||||
this.httpExecutor = httpExecutor;
|
||||
this.cancellationToken = cancellationToken;
|
||||
this.requestHeaders = null;
|
||||
|
||||
if (options.owner == null) {
|
||||
throw new Error("owner is not specified");
|
||||
}
|
||||
|
||||
if (options.package == null) {
|
||||
throw new Error("package is not specified");
|
||||
}
|
||||
|
||||
this.repo = options.repo || "generic";
|
||||
this.packageName = options.package;
|
||||
this.owner = options.owner;
|
||||
this.user = options.user || options.owner;
|
||||
this.component = options.component || null;
|
||||
this.distribution = options.distribution || "stable";
|
||||
this.auth = apiKey == null ? null : `Basic ${Buffer.from(`${this.user}:${apiKey}`).toString("base64")}`;
|
||||
this.basePath = `/packages/${this.owner}/${this.repo}/${this.packageName}`;
|
||||
}
|
||||
|
||||
setRequestHeaders(value) {
|
||||
this.requestHeaders = value;
|
||||
}
|
||||
|
||||
bintrayRequest(path, auth, data = null, cancellationToken, method) {
|
||||
return (0, _httpExecutor().parseJson)(this.httpExecutor.request((0, _httpExecutor().configureRequestOptions)({
|
||||
hostname: "api.bintray.com",
|
||||
path,
|
||||
headers: this.requestHeaders || undefined
|
||||
}, auth, method), cancellationToken, data));
|
||||
}
|
||||
|
||||
getVersion(version) {
|
||||
return this.bintrayRequest(`${this.basePath}/versions/${version}`, this.auth, null, this.cancellationToken);
|
||||
}
|
||||
|
||||
getVersionFiles(version) {
|
||||
return this.bintrayRequest(`${this.basePath}/versions/${version}/files`, this.auth, null, this.cancellationToken);
|
||||
}
|
||||
|
||||
createVersion(version) {
|
||||
return this.bintrayRequest(`${this.basePath}/versions`, this.auth, {
|
||||
name: version
|
||||
}, this.cancellationToken);
|
||||
}
|
||||
|
||||
deleteVersion(version) {
|
||||
return this.bintrayRequest(`${this.basePath}/versions/${version}`, this.auth, null, this.cancellationToken, "DELETE");
|
||||
}
|
||||
|
||||
} exports.BintrayClient = BintrayClient;
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=bintray.js.map
|
1
buildfiles/node_modules/builder-util-runtime/out/bintray.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/builder-util-runtime/out/bintray.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../src/bintray.ts"],"names":[],"mappings":";;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAiBM,MAAO,aAAP,CAAoB;AAiBxB,EAAA,WAAA,CAAY,OAAZ,EAAsD,YAAtD,EAAwG,iBAAxG,EAA8I,MAA9I,EAAoK;AAA9G,SAAA,YAAA,GAAA,YAAA;AAAkD,SAAA,iBAAA,GAAA,iBAAA;AANhG,SAAA,cAAA,GAAwC,IAAxC;;AAON,QAAI,OAAO,CAAC,KAAR,IAAiB,IAArB,EAA2B;AACzB,YAAM,IAAI,KAAJ,CAAU,wBAAV,CAAN;AACD;;AACD,QAAI,OAAO,CAAC,OAAR,IAAmB,IAAvB,EAA6B;AAC3B,YAAM,IAAI,KAAJ,CAAU,0BAAV,CAAN;AACD;;AAED,SAAK,IAAL,GAAY,OAAO,CAAC,IAAR,IAAgB,SAA5B;AACA,SAAK,WAAL,GAAmB,OAAO,CAAC,OAA3B;AACA,SAAK,KAAL,GAAa,OAAO,CAAC,KAArB;AACA,SAAK,IAAL,GAAY,OAAO,CAAC,IAAR,IAAgB,OAAO,CAAC,KAApC;AACA,SAAK,SAAL,GAAiB,OAAO,CAAC,SAAR,IAAqB,IAAtC;AACA,SAAK,YAAL,GAAoB,OAAO,CAAC,YAAR,IAAwB,QAA5C;AACA,SAAK,IAAL,GAAY,MAAM,IAAI,IAAV,GAAiB,IAAjB,GAAwB,SAAS,MAAM,CAAC,IAAP,CAAY,GAAG,KAAK,IAAI,IAAI,MAAM,EAAlC,EAAsC,QAAtC,CAA+C,QAA/C,CAAwD,EAArG;AACA,SAAK,QAAL,GAAgB,aAAa,KAAK,KAAK,IAAI,KAAK,IAAI,IAAI,KAAK,WAAW,EAAxE;AACD;;AApBD,EAAA,iBAAiB,CAAC,KAAD,EAA6B;AAC5C,SAAK,cAAL,GAAsB,KAAtB;AACD;;AAoBO,EAAA,cAAc,CAAI,IAAJ,EAAkB,IAAlB,EAAuC,IAAA,GAAsC,IAA7E,EAAmF,iBAAnF,EAAyH,MAAzH,EAA0J;AAC9K,WAAO,+BAAU,KAAK,YAAL,CAAkB,OAAlB,CAA0B,6CAAwB;AAAC,MAAA,QAAQ,EAAE,iBAAX;AAA8B,MAAA,IAA9B;AAAoC,MAAA,OAAO,EAAE,KAAK,cAAL,IAAuB;AAApE,KAAxB,EAAwG,IAAxG,EAA8G,MAA9G,CAA1B,EAAiJ,iBAAjJ,EAAoK,IAApK,CAAV,CAAP;AACD;;AAED,EAAA,UAAU,CAAC,OAAD,EAAgB;AACxB,WAAO,KAAK,cAAL,CAAoB,GAAG,KAAK,QAAQ,aAAa,OAAO,EAAxD,EAA4D,KAAK,IAAjE,EAAuE,IAAvE,EAA6E,KAAK,iBAAlF,CAAP;AACD;;AAED,EAAA,eAAe,CAAC,OAAD,EAAgB;AAC7B,WAAO,KAAK,cAAL,CAAiC,GAAG,KAAK,QAAQ,aAAa,OAAO,QAArE,EAA+E,KAAK,IAApF,EAA0F,IAA1F,EAAgG,KAAK,iBAArG,CAAP;AACD;;AAED,EAAA,aAAa,CAAC,OAAD,EAAgB;AAC3B,WAAO,KAAK,cAAL,CAA6B,GAAG,KAAK,QAAQ,WAA7C,EAA0D,KAAK,IAA/D,EAAqE;AAC1E,MAAA,IAAI,EAAE;AADoE,KAArE,EAEJ,KAAK,iBAFD,CAAP;AAGD;;AAED,EAAA,aAAa,CAAC,OAAD,EAAgB;AAC3B,WAAO,KAAK,cAAL,CAAoB,GAAG,KAAK,QAAQ,aAAa,OAAO,EAAxD,EAA4D,KAAK,IAAjE,EAAuE,IAAvE,EAA6E,KAAK,iBAAlF,EAAqG,QAArG,CAAP;AACD;;AAvDuB,C","sourcesContent":["import { CancellationToken } from \"./CancellationToken\"\nimport { configureRequestOptions, HttpExecutor, parseJson, RequestHeaders } from \"./httpExecutor\"\nimport { BintrayOptions } from \"./publishOptions\"\n\nexport interface Version {\n readonly name: string\n //noinspection ReservedWordAsName\n readonly package: string\n}\n\nexport interface File {\n name: string\n path: string\n\n sha1: string\n sha256: string\n}\n\nexport class BintrayClient {\n private readonly basePath: string\n readonly auth: string | null\n readonly repo: string\n\n readonly owner: string\n readonly user: string\n readonly component: string | null\n readonly distribution: string | null\n readonly packageName: string\n\n private requestHeaders: RequestHeaders | null = null\n\n setRequestHeaders(value: RequestHeaders | null) {\n this.requestHeaders = value\n }\n\n constructor(options: BintrayOptions, private readonly httpExecutor: HttpExecutor<any>, private readonly cancellationToken: CancellationToken, apiKey?: string | null) {\n if (options.owner == null) {\n throw new Error(\"owner is not specified\")\n }\n if (options.package == null) {\n throw new Error(\"package is not specified\")\n }\n\n this.repo = options.repo || \"generic\"\n this.packageName = options.package\n this.owner = options.owner\n this.user = options.user || options.owner\n this.component = options.component || null\n this.distribution = options.distribution || \"stable\"\n this.auth = apiKey == null ? null : `Basic ${Buffer.from(`${this.user}:${apiKey}`).toString(\"base64\")}`\n this.basePath = `/packages/${this.owner}/${this.repo}/${this.packageName}`\n }\n\n private bintrayRequest<T>(path: string, auth: string | null, data: {[name: string]: any } | null = null, cancellationToken: CancellationToken, method?: \"GET\" | \"DELETE\" | \"PUT\"): Promise<T> {\n return parseJson(this.httpExecutor.request(configureRequestOptions({hostname: \"api.bintray.com\", path, headers: this.requestHeaders || undefined}, auth, method), cancellationToken, data))\n }\n\n getVersion(version: string): Promise<Version> {\n return this.bintrayRequest(`${this.basePath}/versions/${version}`, this.auth, null, this.cancellationToken)\n }\n\n getVersionFiles(version: string): Promise<Array<File>> {\n return this.bintrayRequest<Array<File>>(`${this.basePath}/versions/${version}/files`, this.auth, null, this.cancellationToken)\n }\n\n createVersion(version: string): Promise<any> {\n return this.bintrayRequest<Version>(`${this.basePath}/versions`, this.auth, {\n name: version,\n }, this.cancellationToken)\n }\n\n deleteVersion(version: string): Promise<any> {\n return this.bintrayRequest(`${this.basePath}/versions/${version}`, this.auth, null, this.cancellationToken, \"DELETE\")\n }\n}"],"sourceRoot":""}
|
12
buildfiles/node_modules/builder-util-runtime/out/blockMapApi.d.ts
generated
vendored
Normal file
12
buildfiles/node_modules/builder-util-runtime/out/blockMapApi.d.ts
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
export interface FileChunks {
|
||||
checksums: Array<string>;
|
||||
sizes: Array<number>;
|
||||
}
|
||||
export interface BlockMap {
|
||||
version: "1" | "2";
|
||||
files: Array<BlockMapFile>;
|
||||
}
|
||||
export interface BlockMapFile extends FileChunks {
|
||||
name: string;
|
||||
offset: number;
|
||||
}
|
3
buildfiles/node_modules/builder-util-runtime/out/blockMapApi.js
generated
vendored
Normal file
3
buildfiles/node_modules/builder-util-runtime/out/blockMapApi.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=blockMapApi.js.map
|
1
buildfiles/node_modules/builder-util-runtime/out/blockMapApi.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/builder-util-runtime/out/blockMapApi.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
|
64
buildfiles/node_modules/builder-util-runtime/out/httpExecutor.d.ts
generated
vendored
Normal file
64
buildfiles/node_modules/builder-util-runtime/out/httpExecutor.d.ts
generated
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
/// <reference types="node" />
|
||||
import { IncomingMessage, OutgoingHttpHeaders, RequestOptions } from "http";
|
||||
import { Transform } from "stream";
|
||||
import { URL } from "url";
|
||||
import { CancellationToken } from "./CancellationToken";
|
||||
import { ProgressInfo } from "./ProgressCallbackTransform";
|
||||
export interface RequestHeaders extends OutgoingHttpHeaders {
|
||||
[key: string]: string;
|
||||
}
|
||||
export interface DownloadOptions {
|
||||
readonly headers?: OutgoingHttpHeaders | null;
|
||||
readonly sha2?: string | null;
|
||||
readonly sha512?: string | null;
|
||||
readonly cancellationToken: CancellationToken;
|
||||
onProgress?(progress: ProgressInfo): void;
|
||||
}
|
||||
export declare function createHttpError(response: IncomingMessage, description?: any | null): HttpError;
|
||||
export declare class HttpError extends Error {
|
||||
readonly statusCode: number;
|
||||
readonly description: any | null;
|
||||
constructor(statusCode: number, message?: string, description?: any | null);
|
||||
}
|
||||
export declare function parseJson(result: Promise<string | null>): Promise<any>;
|
||||
export declare abstract class HttpExecutor<REQUEST> {
|
||||
protected readonly maxRedirects = 10;
|
||||
request(options: RequestOptions, cancellationToken?: CancellationToken, data?: {
|
||||
[name: string]: any;
|
||||
} | null): Promise<string | null>;
|
||||
doApiRequest(options: RequestOptions, cancellationToken: CancellationToken, requestProcessor: (request: REQUEST, reject: (error: Error) => void) => void, redirectCount?: number): Promise<string>;
|
||||
protected addRedirectHandlers(request: any, options: RequestOptions, reject: (error: Error) => void, redirectCount: number, handler: (options: RequestOptions) => void): void;
|
||||
addErrorAndTimeoutHandlers(request: any, reject: (error: Error) => void): void;
|
||||
private handleResponse;
|
||||
abstract createRequest(options: any, callback: (response: any) => void): any;
|
||||
downloadToBuffer(url: URL, options: DownloadOptions): Promise<Buffer>;
|
||||
protected doDownload(requestOptions: any, options: DownloadCallOptions, redirectCount: number): void;
|
||||
protected createMaxRedirectError(): Error;
|
||||
private addTimeOutHandler;
|
||||
static prepareRedirectUrlOptions(redirectUrl: string, options: RequestOptions): RequestOptions;
|
||||
}
|
||||
export interface DownloadCallOptions {
|
||||
responseHandler: ((response: IncomingMessage, callback: (error: Error | null) => void) => void) | null;
|
||||
onCancel: (callback: () => void) => void;
|
||||
callback: (error: Error | null) => void;
|
||||
options: DownloadOptions;
|
||||
destination: string | null;
|
||||
}
|
||||
export declare function configureRequestOptionsFromUrl(url: string, options: RequestOptions): RequestOptions;
|
||||
export declare function configureRequestUrl(url: URL, options: RequestOptions): void;
|
||||
export declare class DigestTransform extends Transform {
|
||||
readonly expected: string;
|
||||
private readonly algorithm;
|
||||
private readonly encoding;
|
||||
private readonly digester;
|
||||
private _actual;
|
||||
get actual(): string | null;
|
||||
isValidateOnEnd: boolean;
|
||||
constructor(expected: string, algorithm?: string, encoding?: "hex" | "base64" | "latin1");
|
||||
_transform(chunk: Buffer, encoding: string, callback: any): void;
|
||||
_flush(callback: any): void;
|
||||
validate(): null;
|
||||
}
|
||||
export declare function safeGetHeader(response: any, headerKey: string): any;
|
||||
export declare function configureRequestOptions(options: RequestOptions, token?: string | null, method?: "GET" | "DELETE" | "PUT"): RequestOptions;
|
||||
export declare function safeStringifyJson(data: any, skippedNames?: Set<string>): string;
|
521
buildfiles/node_modules/builder-util-runtime/out/httpExecutor.js
generated
vendored
Normal file
521
buildfiles/node_modules/builder-util-runtime/out/httpExecutor.js
generated
vendored
Normal file
@ -0,0 +1,521 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.createHttpError = createHttpError;
|
||||
exports.parseJson = parseJson;
|
||||
exports.configureRequestOptionsFromUrl = configureRequestOptionsFromUrl;
|
||||
exports.configureRequestUrl = configureRequestUrl;
|
||||
exports.safeGetHeader = safeGetHeader;
|
||||
exports.configureRequestOptions = configureRequestOptions;
|
||||
exports.safeStringifyJson = safeStringifyJson;
|
||||
exports.DigestTransform = exports.HttpExecutor = exports.HttpError = void 0;
|
||||
|
||||
function _crypto() {
|
||||
const data = require("crypto");
|
||||
|
||||
_crypto = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _debug2 = _interopRequireDefault(require("debug"));
|
||||
|
||||
var _fs = require("fs");
|
||||
|
||||
function _stream() {
|
||||
const data = require("stream");
|
||||
|
||||
_stream = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _url() {
|
||||
const data = require("url");
|
||||
|
||||
_url = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _CancellationToken() {
|
||||
const data = require("./CancellationToken");
|
||||
|
||||
_CancellationToken = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _index() {
|
||||
const data = require("./index");
|
||||
|
||||
_index = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _ProgressCallbackTransform() {
|
||||
const data = require("./ProgressCallbackTransform");
|
||||
|
||||
_ProgressCallbackTransform = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const debug = (0, _debug2.default)("electron-builder");
|
||||
|
||||
function createHttpError(response, description = null) {
|
||||
return new HttpError(response.statusCode || -1, `${response.statusCode} ${response.statusMessage}` + (description == null ? "" : "\n" + JSON.stringify(description, null, " ")) + "\nHeaders: " + safeStringifyJson(response.headers), description);
|
||||
}
|
||||
|
||||
const HTTP_STATUS_CODES = new Map([[429, "Too many requests"], [400, "Bad request"], [403, "Forbidden"], [404, "Not found"], [405, "Method not allowed"], [406, "Not acceptable"], [408, "Request timeout"], [413, "Request entity too large"], [500, "Internal server error"], [502, "Bad gateway"], [503, "Service unavailable"], [504, "Gateway timeout"], [505, "HTTP version not supported"]]);
|
||||
|
||||
class HttpError extends Error {
|
||||
constructor(statusCode, message = `HTTP error: ${HTTP_STATUS_CODES.get(statusCode) || statusCode}`, description = null) {
|
||||
super(message);
|
||||
this.statusCode = statusCode;
|
||||
this.description = description;
|
||||
this.name = "HttpError";
|
||||
this.code = `HTTP_ERROR_${statusCode}`;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.HttpError = HttpError;
|
||||
|
||||
function parseJson(result) {
|
||||
return result.then(it => it == null || it.length === 0 ? null : JSON.parse(it));
|
||||
}
|
||||
|
||||
class HttpExecutor {
|
||||
constructor() {
|
||||
this.maxRedirects = 10;
|
||||
}
|
||||
|
||||
request(options, cancellationToken = new (_CancellationToken().CancellationToken)(), data) {
|
||||
configureRequestOptions(options);
|
||||
const encodedData = data == null ? undefined : Buffer.from(JSON.stringify(data));
|
||||
|
||||
if (encodedData != null) {
|
||||
options.method = "post";
|
||||
options.headers["Content-Type"] = "application/json";
|
||||
options.headers["Content-Length"] = encodedData.length;
|
||||
}
|
||||
|
||||
return this.doApiRequest(options, cancellationToken, it => {
|
||||
it.end(encodedData);
|
||||
});
|
||||
}
|
||||
|
||||
doApiRequest(options, cancellationToken, requestProcessor, redirectCount = 0) {
|
||||
if (debug.enabled) {
|
||||
debug(`Request: ${safeStringifyJson(options)}`);
|
||||
}
|
||||
|
||||
return cancellationToken.createPromise((resolve, reject, onCancel) => {
|
||||
const request = this.createRequest(options, response => {
|
||||
try {
|
||||
this.handleResponse(response, options, cancellationToken, resolve, reject, redirectCount, requestProcessor);
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
});
|
||||
this.addErrorAndTimeoutHandlers(request, reject);
|
||||
this.addRedirectHandlers(request, options, reject, redirectCount, options => {
|
||||
this.doApiRequest(options, cancellationToken, requestProcessor, redirectCount).then(resolve).catch(reject);
|
||||
});
|
||||
requestProcessor(request, reject);
|
||||
onCancel(() => request.abort());
|
||||
});
|
||||
} // noinspection JSUnusedLocalSymbols
|
||||
// eslint-disable-next-line
|
||||
|
||||
|
||||
addRedirectHandlers(request, options, reject, redirectCount, handler) {// not required for NodeJS
|
||||
}
|
||||
|
||||
addErrorAndTimeoutHandlers(request, reject) {
|
||||
this.addTimeOutHandler(request, reject);
|
||||
request.on("error", reject);
|
||||
request.on("aborted", () => {
|
||||
reject(new Error("Request has been aborted by the server"));
|
||||
});
|
||||
}
|
||||
|
||||
handleResponse(response, options, cancellationToken, resolve, reject, redirectCount, requestProcessor) {
|
||||
if (debug.enabled) {
|
||||
debug(`Response: ${response.statusCode} ${response.statusMessage}, request options: ${safeStringifyJson(options)}`);
|
||||
} // we handle any other >= 400 error on request end (read detailed message in the response body)
|
||||
|
||||
|
||||
if (response.statusCode === 404) {
|
||||
// error is clear, we don't need to read detailed error description
|
||||
reject(createHttpError(response, `method: ${options.method || "GET"} url: ${options.protocol || "https:"}//${options.hostname}${options.port ? `:${options.port}` : ""}${options.path}
|
||||
|
||||
Please double check that your authentication token is correct. Due to security reasons actual status maybe not reported, but 404.
|
||||
`));
|
||||
return;
|
||||
} else if (response.statusCode === 204) {
|
||||
// on DELETE request
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const redirectUrl = safeGetHeader(response, "location");
|
||||
|
||||
if (redirectUrl != null) {
|
||||
if (redirectCount > this.maxRedirects) {
|
||||
reject(this.createMaxRedirectError());
|
||||
return;
|
||||
}
|
||||
|
||||
this.doApiRequest(HttpExecutor.prepareRedirectUrlOptions(redirectUrl, options), cancellationToken, requestProcessor, redirectCount).then(resolve).catch(reject);
|
||||
return;
|
||||
}
|
||||
|
||||
response.setEncoding("utf8");
|
||||
let data = "";
|
||||
response.on("error", reject);
|
||||
response.on("data", chunk => data += chunk);
|
||||
response.on("end", () => {
|
||||
try {
|
||||
if (response.statusCode != null && response.statusCode >= 400) {
|
||||
const contentType = safeGetHeader(response, "content-type");
|
||||
const isJson = contentType != null && (Array.isArray(contentType) ? contentType.find(it => it.includes("json")) != null : contentType.includes("json"));
|
||||
reject(createHttpError(response, isJson ? JSON.parse(data) : data));
|
||||
} else {
|
||||
resolve(data.length === 0 ? null : data);
|
||||
}
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async downloadToBuffer(url, options) {
|
||||
return await options.cancellationToken.createPromise((resolve, reject, onCancel) => {
|
||||
let result = null;
|
||||
const requestOptions = {
|
||||
headers: options.headers || undefined,
|
||||
// because PrivateGitHubProvider requires HttpExecutor.prepareRedirectUrlOptions logic, so, we need to redirect manually
|
||||
redirect: "manual"
|
||||
};
|
||||
configureRequestUrl(url, requestOptions);
|
||||
configureRequestOptions(requestOptions);
|
||||
this.doDownload(requestOptions, {
|
||||
destination: null,
|
||||
options,
|
||||
onCancel,
|
||||
callback: error => {
|
||||
if (error == null) {
|
||||
resolve(result);
|
||||
} else {
|
||||
reject(error);
|
||||
}
|
||||
},
|
||||
responseHandler: (response, callback) => {
|
||||
const contentLength = safeGetHeader(response, "content-length");
|
||||
let position = -1;
|
||||
|
||||
if (contentLength != null) {
|
||||
const size = parseInt(contentLength, 10);
|
||||
|
||||
if (size > 0) {
|
||||
if (size > 52428800) {
|
||||
callback(new Error("Maximum allowed size is 50 MB"));
|
||||
return;
|
||||
}
|
||||
|
||||
result = Buffer.alloc(size);
|
||||
position = 0;
|
||||
}
|
||||
}
|
||||
|
||||
response.on("data", chunk => {
|
||||
if (position !== -1) {
|
||||
chunk.copy(result, position);
|
||||
position += chunk.length;
|
||||
} else if (result == null) {
|
||||
result = chunk;
|
||||
} else {
|
||||
if (result.length > 52428800) {
|
||||
callback(new Error("Maximum allowed size is 50 MB"));
|
||||
return;
|
||||
}
|
||||
|
||||
result = Buffer.concat([result, chunk]);
|
||||
}
|
||||
});
|
||||
response.on("end", () => {
|
||||
if (result != null && position !== -1 && position !== result.length) {
|
||||
callback(new Error(`Received data length ${position} is not equal to expected ${result.length}`));
|
||||
} else {
|
||||
callback(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, 0);
|
||||
});
|
||||
}
|
||||
|
||||
doDownload(requestOptions, options, redirectCount) {
|
||||
const request = this.createRequest(requestOptions, response => {
|
||||
if (response.statusCode >= 400) {
|
||||
options.callback(new Error(`Cannot download "${requestOptions.protocol || "https:"}//${requestOptions.hostname}${requestOptions.path}", status ${response.statusCode}: ${response.statusMessage}`));
|
||||
return;
|
||||
} // It is possible for the response stream to fail, e.g. when a network is lost while
|
||||
// response stream is in progress. Stop waiting and reject so consumer can catch the error.
|
||||
|
||||
|
||||
response.on("error", options.callback); // this code not relevant for Electron (redirect event instead handled)
|
||||
|
||||
const redirectUrl = safeGetHeader(response, "location");
|
||||
|
||||
if (redirectUrl != null) {
|
||||
if (redirectCount < this.maxRedirects) {
|
||||
this.doDownload(HttpExecutor.prepareRedirectUrlOptions(redirectUrl, requestOptions), options, redirectCount++);
|
||||
} else {
|
||||
options.callback(this.createMaxRedirectError());
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (options.responseHandler == null) {
|
||||
configurePipes(options, response);
|
||||
} else {
|
||||
options.responseHandler(response, options.callback);
|
||||
}
|
||||
});
|
||||
this.addErrorAndTimeoutHandlers(request, options.callback);
|
||||
this.addRedirectHandlers(request, requestOptions, options.callback, redirectCount, requestOptions => {
|
||||
this.doDownload(requestOptions, options, redirectCount++);
|
||||
});
|
||||
request.end();
|
||||
}
|
||||
|
||||
createMaxRedirectError() {
|
||||
return new Error(`Too many redirects (> ${this.maxRedirects})`);
|
||||
}
|
||||
|
||||
addTimeOutHandler(request, callback) {
|
||||
request.on("socket", socket => {
|
||||
socket.setTimeout(60 * 1000, () => {
|
||||
request.abort();
|
||||
callback(new Error("Request timed out"));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
static prepareRedirectUrlOptions(redirectUrl, options) {
|
||||
const newOptions = configureRequestOptionsFromUrl(redirectUrl, { ...options
|
||||
});
|
||||
const headers = newOptions.headers;
|
||||
|
||||
if (headers != null && headers.authorization != null && headers.authorization.startsWith("token")) {
|
||||
const parsedNewUrl = new (_url().URL)(redirectUrl);
|
||||
|
||||
if (parsedNewUrl.hostname.endsWith(".amazonaws.com")) {
|
||||
delete headers.authorization;
|
||||
}
|
||||
}
|
||||
|
||||
return newOptions;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.HttpExecutor = HttpExecutor;
|
||||
|
||||
function configureRequestOptionsFromUrl(url, options) {
|
||||
const result = configureRequestOptions(options);
|
||||
configureRequestUrl(new (_url().URL)(url), result);
|
||||
return result;
|
||||
}
|
||||
|
||||
function configureRequestUrl(url, options) {
|
||||
options.protocol = url.protocol;
|
||||
options.hostname = url.hostname;
|
||||
|
||||
if (url.port) {
|
||||
options.port = url.port;
|
||||
} else if (options.port) {
|
||||
delete options.port;
|
||||
}
|
||||
|
||||
options.path = url.pathname + url.search;
|
||||
}
|
||||
|
||||
class DigestTransform extends _stream().Transform {
|
||||
constructor(expected, algorithm = "sha512", encoding = "base64") {
|
||||
super();
|
||||
this.expected = expected;
|
||||
this.algorithm = algorithm;
|
||||
this.encoding = encoding;
|
||||
this._actual = null;
|
||||
this.isValidateOnEnd = true;
|
||||
this.digester = (0, _crypto().createHash)(algorithm);
|
||||
} // noinspection JSUnusedGlobalSymbols
|
||||
|
||||
|
||||
get actual() {
|
||||
return this._actual;
|
||||
} // noinspection JSUnusedGlobalSymbols
|
||||
|
||||
|
||||
_transform(chunk, encoding, callback) {
|
||||
this.digester.update(chunk);
|
||||
callback(null, chunk);
|
||||
} // noinspection JSUnusedGlobalSymbols
|
||||
|
||||
|
||||
_flush(callback) {
|
||||
this._actual = this.digester.digest(this.encoding);
|
||||
|
||||
if (this.isValidateOnEnd) {
|
||||
try {
|
||||
this.validate();
|
||||
} catch (e) {
|
||||
callback(e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
callback(null);
|
||||
}
|
||||
|
||||
validate() {
|
||||
if (this._actual == null) {
|
||||
throw (0, _index().newError)("Not finished yet", "ERR_STREAM_NOT_FINISHED");
|
||||
}
|
||||
|
||||
if (this._actual !== this.expected) {
|
||||
throw (0, _index().newError)(`${this.algorithm} checksum mismatch, expected ${this.expected}, got ${this._actual}`, "ERR_CHECKSUM_MISMATCH");
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.DigestTransform = DigestTransform;
|
||||
|
||||
function checkSha2(sha2Header, sha2, callback) {
|
||||
if (sha2Header != null && sha2 != null && sha2Header !== sha2) {
|
||||
callback(new Error(`checksum mismatch: expected ${sha2} but got ${sha2Header} (X-Checksum-Sha2 header)`));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function safeGetHeader(response, headerKey) {
|
||||
const value = response.headers[headerKey];
|
||||
|
||||
if (value == null) {
|
||||
return null;
|
||||
} else if (Array.isArray(value)) {
|
||||
// electron API
|
||||
return value.length === 0 ? null : value[value.length - 1];
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
function configurePipes(options, response) {
|
||||
if (!checkSha2(safeGetHeader(response, "X-Checksum-Sha2"), options.options.sha2, options.callback)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const streams = [];
|
||||
|
||||
if (options.options.onProgress != null) {
|
||||
const contentLength = safeGetHeader(response, "content-length");
|
||||
|
||||
if (contentLength != null) {
|
||||
streams.push(new (_ProgressCallbackTransform().ProgressCallbackTransform)(parseInt(contentLength, 10), options.options.cancellationToken, options.options.onProgress));
|
||||
}
|
||||
}
|
||||
|
||||
const sha512 = options.options.sha512;
|
||||
|
||||
if (sha512 != null) {
|
||||
streams.push(new DigestTransform(sha512, "sha512", sha512.length === 128 && !sha512.includes("+") && !sha512.includes("Z") && !sha512.includes("=") ? "hex" : "base64"));
|
||||
} else if (options.options.sha2 != null) {
|
||||
streams.push(new DigestTransform(options.options.sha2, "sha256", "hex"));
|
||||
}
|
||||
|
||||
const fileOut = (0, _fs.createWriteStream)(options.destination);
|
||||
streams.push(fileOut);
|
||||
let lastStream = response;
|
||||
|
||||
for (const stream of streams) {
|
||||
stream.on("error", error => {
|
||||
if (!options.options.cancellationToken.cancelled) {
|
||||
options.callback(error);
|
||||
}
|
||||
});
|
||||
lastStream = lastStream.pipe(stream);
|
||||
}
|
||||
|
||||
fileOut.on("finish", () => {
|
||||
fileOut.close(options.callback);
|
||||
});
|
||||
}
|
||||
|
||||
function configureRequestOptions(options, token, method) {
|
||||
if (method != null) {
|
||||
options.method = method;
|
||||
}
|
||||
|
||||
options.headers = { ...options.headers
|
||||
};
|
||||
const headers = options.headers;
|
||||
|
||||
if (token != null) {
|
||||
headers.authorization = token.startsWith("Basic") ? token : `token ${token}`;
|
||||
}
|
||||
|
||||
if (headers["User-Agent"] == null) {
|
||||
headers["User-Agent"] = "electron-builder";
|
||||
}
|
||||
|
||||
if (method == null || method === "GET" || headers["Cache-Control"] == null) {
|
||||
headers["Cache-Control"] = "no-cache";
|
||||
} // do not specify for node (in any case we use https module)
|
||||
|
||||
|
||||
if (options.protocol == null && process.versions.electron != null) {
|
||||
options.protocol = "https:";
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
function safeStringifyJson(data, skippedNames) {
|
||||
return JSON.stringify(data, (name, value) => {
|
||||
if (name.endsWith("authorization") || name.endsWith("Password") || name.endsWith("PASSWORD") || name.endsWith("Token") || name.includes("password") || name.includes("token") || skippedNames != null && skippedNames.has(name)) {
|
||||
return "<stripped sensitive data>";
|
||||
}
|
||||
|
||||
return value;
|
||||
}, 2);
|
||||
}
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=httpExecutor.js.map
|
1
buildfiles/node_modules/builder-util-runtime/out/httpExecutor.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/builder-util-runtime/out/httpExecutor.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
13
buildfiles/node_modules/builder-util-runtime/out/index.d.ts
generated
vendored
Normal file
13
buildfiles/node_modules/builder-util-runtime/out/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
export { CancellationToken, CancellationError } from "./CancellationToken";
|
||||
export { HttpError, createHttpError, HttpExecutor, DownloadOptions, DigestTransform, RequestHeaders, safeGetHeader, configureRequestOptions, configureRequestOptionsFromUrl, safeStringifyJson, parseJson, configureRequestUrl } from "./httpExecutor";
|
||||
export { BintrayOptions, GenericServerOptions, GithubOptions, PublishConfiguration, S3Options, SpacesOptions, BaseS3Options, getS3LikeProviderBaseUrl, githubUrl, PublishProvider, AllPublishOptions } from "./publishOptions";
|
||||
export { UpdateInfo, UpdateFileInfo, WindowsUpdateInfo, BlockMapDataHolder, PackageFileInfo, ReleaseNoteInfo } from "./updateInfo";
|
||||
export { parseDn } from "./rfc2253Parser";
|
||||
export { UUID } from "./uuid";
|
||||
export { ProgressCallbackTransform, ProgressInfo } from "./ProgressCallbackTransform";
|
||||
export { parseXml, XElement } from "./xml";
|
||||
export { BlockMap } from "./blockMapApi";
|
||||
export declare const CURRENT_APP_INSTALLER_FILE_NAME = "installer.exe";
|
||||
export declare const CURRENT_APP_PACKAGE_FILE_NAME = "package.7z";
|
||||
export declare function asArray<T>(v: null | undefined | T | Array<T>): Array<T>;
|
||||
export declare function newError(message: string, code: string): Error;
|
217
buildfiles/node_modules/builder-util-runtime/out/index.js
generated
vendored
Normal file
217
buildfiles/node_modules/builder-util-runtime/out/index.js
generated
vendored
Normal file
@ -0,0 +1,217 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.asArray = asArray;
|
||||
exports.newError = newError;
|
||||
Object.defineProperty(exports, "CancellationToken", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _CancellationToken().CancellationToken;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "CancellationError", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _CancellationToken().CancellationError;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "HttpError", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _httpExecutor().HttpError;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "createHttpError", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _httpExecutor().createHttpError;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "HttpExecutor", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _httpExecutor().HttpExecutor;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "DigestTransform", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _httpExecutor().DigestTransform;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "safeGetHeader", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _httpExecutor().safeGetHeader;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "configureRequestOptions", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _httpExecutor().configureRequestOptions;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "configureRequestOptionsFromUrl", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _httpExecutor().configureRequestOptionsFromUrl;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "safeStringifyJson", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _httpExecutor().safeStringifyJson;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "parseJson", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _httpExecutor().parseJson;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "configureRequestUrl", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _httpExecutor().configureRequestUrl;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "getS3LikeProviderBaseUrl", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _publishOptions().getS3LikeProviderBaseUrl;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "githubUrl", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _publishOptions().githubUrl;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "parseDn", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _rfc2253Parser().parseDn;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "UUID", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _uuid().UUID;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "ProgressCallbackTransform", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _ProgressCallbackTransform().ProgressCallbackTransform;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "parseXml", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _xml().parseXml;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "XElement", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _xml().XElement;
|
||||
}
|
||||
});
|
||||
exports.CURRENT_APP_PACKAGE_FILE_NAME = exports.CURRENT_APP_INSTALLER_FILE_NAME = void 0;
|
||||
|
||||
function _CancellationToken() {
|
||||
const data = require("./CancellationToken");
|
||||
|
||||
_CancellationToken = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _httpExecutor() {
|
||||
const data = require("./httpExecutor");
|
||||
|
||||
_httpExecutor = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _publishOptions() {
|
||||
const data = require("./publishOptions");
|
||||
|
||||
_publishOptions = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _rfc2253Parser() {
|
||||
const data = require("./rfc2253Parser");
|
||||
|
||||
_rfc2253Parser = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _uuid() {
|
||||
const data = require("./uuid");
|
||||
|
||||
_uuid = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _ProgressCallbackTransform() {
|
||||
const data = require("./ProgressCallbackTransform");
|
||||
|
||||
_ProgressCallbackTransform = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _xml() {
|
||||
const data = require("./xml");
|
||||
|
||||
_xml = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
// nsis
|
||||
const CURRENT_APP_INSTALLER_FILE_NAME = "installer.exe"; // nsis-web
|
||||
|
||||
exports.CURRENT_APP_INSTALLER_FILE_NAME = CURRENT_APP_INSTALLER_FILE_NAME;
|
||||
const CURRENT_APP_PACKAGE_FILE_NAME = "package.7z";
|
||||
exports.CURRENT_APP_PACKAGE_FILE_NAME = CURRENT_APP_PACKAGE_FILE_NAME;
|
||||
|
||||
function asArray(v) {
|
||||
if (v == null) {
|
||||
return [];
|
||||
} else if (Array.isArray(v)) {
|
||||
return v;
|
||||
} else {
|
||||
return [v];
|
||||
}
|
||||
}
|
||||
|
||||
function newError(message, code) {
|
||||
const error = new Error(message);
|
||||
error.code = code;
|
||||
return error;
|
||||
}
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=index.js.map
|
1
buildfiles/node_modules/builder-util-runtime/out/index.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/builder-util-runtime/out/index.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AACO,MAAM,+BAA+B,GAAG,eAAxC,C,CACP;;;AACO,MAAM,6BAA6B,GAAG,YAAtC;;;AAED,SAAU,OAAV,CAAqB,CAArB,EAAuD;AAC3D,MAAI,CAAC,IAAI,IAAT,EAAe;AACb,WAAO,EAAP;AACD,GAFD,MAGK,IAAI,KAAK,CAAC,OAAN,CAAc,CAAd,CAAJ,EAAsB;AACzB,WAAO,CAAP;AACD,GAFI,MAGA;AACH,WAAO,CAAC,CAAD,CAAP;AACD;AACF;;AAEK,SAAU,QAAV,CAAmB,OAAnB,EAAoC,IAApC,EAAgD;AACpD,QAAM,KAAK,GAAG,IAAI,KAAJ,CAAU,OAAV,CAAd;AACC,EAAA,KAA+B,CAAC,IAAhC,GAAuC,IAAvC;AACD,SAAO,KAAP;AACD,C","sourcesContent":["export { CancellationToken, CancellationError } from \"./CancellationToken\"\nexport { HttpError, createHttpError, HttpExecutor, DownloadOptions, DigestTransform, RequestHeaders, safeGetHeader, configureRequestOptions, configureRequestOptionsFromUrl, safeStringifyJson, parseJson, configureRequestUrl } from \"./httpExecutor\"\nexport { BintrayOptions, GenericServerOptions, GithubOptions, PublishConfiguration, S3Options, SpacesOptions, BaseS3Options, getS3LikeProviderBaseUrl, githubUrl, PublishProvider, AllPublishOptions } from \"./publishOptions\"\nexport { UpdateInfo, UpdateFileInfo, WindowsUpdateInfo, BlockMapDataHolder, PackageFileInfo, ReleaseNoteInfo } from \"./updateInfo\"\nexport { parseDn } from \"./rfc2253Parser\"\nexport { UUID } from \"./uuid\"\nexport { ProgressCallbackTransform, ProgressInfo } from \"./ProgressCallbackTransform\"\nexport { parseXml, XElement } from \"./xml\"\nexport { BlockMap } from \"./blockMapApi\"\n\n// nsis\nexport const CURRENT_APP_INSTALLER_FILE_NAME = \"installer.exe\"\n// nsis-web\nexport const CURRENT_APP_PACKAGE_FILE_NAME = \"package.7z\"\n\nexport function asArray<T>(v: null | undefined | T | Array<T>): Array<T> {\n if (v == null) {\n return []\n }\n else if (Array.isArray(v)) {\n return v\n }\n else {\n return [v]\n }\n}\n\nexport function newError(message: string, code: string) {\n const error = new Error(message);\n (error as NodeJS.ErrnoException).code = code\n return error\n}"],"sourceRoot":""}
|
221
buildfiles/node_modules/builder-util-runtime/out/publishOptions.d.ts
generated
vendored
Normal file
221
buildfiles/node_modules/builder-util-runtime/out/publishOptions.d.ts
generated
vendored
Normal file
@ -0,0 +1,221 @@
|
||||
/// <reference types="node" />
|
||||
import { OutgoingHttpHeaders } from "http";
|
||||
export declare type PublishProvider = "github" | "bintray" | "s3" | "spaces" | "generic" | "custom" | "snapStore";
|
||||
export declare type AllPublishOptions = string | GithubOptions | S3Options | SpacesOptions | GenericServerOptions | BintrayOptions | CustomPublishOptions;
|
||||
export interface PublishConfiguration {
|
||||
/**
|
||||
* The provider.
|
||||
*/
|
||||
readonly provider: PublishProvider;
|
||||
/**
|
||||
* @private
|
||||
* win-only
|
||||
*/
|
||||
publisherName?: Array<string> | null;
|
||||
/**
|
||||
* @private
|
||||
* win-only
|
||||
*/
|
||||
readonly updaterCacheDirName?: string | null;
|
||||
/**
|
||||
* Whether to publish auto update info files.
|
||||
*
|
||||
* Auto update relies only on the first provider in the list (you can specify several publishers).
|
||||
* Thus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly publishAutoUpdate?: boolean;
|
||||
/**
|
||||
* Any custom request headers
|
||||
*/
|
||||
readonly requestHeaders?: OutgoingHttpHeaders;
|
||||
}
|
||||
export interface CustomPublishOptions extends PublishConfiguration {
|
||||
[index: string]: any;
|
||||
}
|
||||
/**
|
||||
* [GitHub](https://help.github.com/articles/about-releases/) options.
|
||||
*
|
||||
* GitHub [personal access token](https://help.github.com/articles/creating-an-access-token-for-command-line-use/) is required. You can generate by going to [https://github.com/settings/tokens/new](https://github.com/settings/tokens/new). The access token should have the repo scope/permission.
|
||||
* Define `GH_TOKEN` environment variable.
|
||||
*/
|
||||
export interface GithubOptions extends PublishConfiguration {
|
||||
/**
|
||||
* The provider. Must be `github`.
|
||||
*/
|
||||
readonly provider: "github";
|
||||
/**
|
||||
* The repository name. [Detected automatically](#github-repository-and-bintray-package).
|
||||
*/
|
||||
readonly repo?: string | null;
|
||||
/**
|
||||
* The owner.
|
||||
*/
|
||||
readonly owner?: string | null;
|
||||
/**
|
||||
* Whether to use `v`-prefixed tag name.
|
||||
* @default true
|
||||
*/
|
||||
readonly vPrefixedTagName?: boolean;
|
||||
/**
|
||||
* The host (including the port if need).
|
||||
* @default github.com
|
||||
*/
|
||||
readonly host?: string | null;
|
||||
/**
|
||||
* The protocol. GitHub Publisher supports only `https`.
|
||||
* @default https
|
||||
*/
|
||||
readonly protocol?: "https" | "http" | null;
|
||||
/**
|
||||
* The access token to support auto-update from private github repositories. Never specify it in the configuration files. Only for [setFeedURL](/auto-update#appupdatersetfeedurloptions).
|
||||
*/
|
||||
readonly token?: string | null;
|
||||
/**
|
||||
* Whether to use private github auto-update provider if `GH_TOKEN` environment variable is defined. See [Private GitHub Update Repo](/auto-update#private-github-update-repo).
|
||||
*/
|
||||
readonly private?: boolean | null;
|
||||
/**
|
||||
* The type of release. By default `draft` release will be created.
|
||||
*
|
||||
* Also you can set release type using environment variable. If `EP_DRAFT`is set to `true` — `draft`, if `EP_PRE_RELEASE`is set to `true` — `prerelease`.
|
||||
* @default draft
|
||||
*/
|
||||
releaseType?: "draft" | "prerelease" | "release" | null;
|
||||
}
|
||||
/** @private */
|
||||
export declare function githubUrl(options: GithubOptions, defaultHost?: string): string;
|
||||
/**
|
||||
* Generic (any HTTP(S) server) options.
|
||||
* In all publish options [File Macros](/file-patterns#file-macros) are supported.
|
||||
*/
|
||||
export interface GenericServerOptions extends PublishConfiguration {
|
||||
/**
|
||||
* The provider. Must be `generic`.
|
||||
*/
|
||||
readonly provider: "generic";
|
||||
/**
|
||||
* The base url. e.g. `https://bucket_name.s3.amazonaws.com`.
|
||||
*/
|
||||
readonly url: string;
|
||||
/**
|
||||
* The channel.
|
||||
* @default latest
|
||||
*/
|
||||
readonly channel?: string | null;
|
||||
/**
|
||||
* Whether to use multiple range requests for differential update. Defaults to `true` if `url` doesn't contain `s3.amazonaws.com`.
|
||||
*/
|
||||
readonly useMultipleRangeRequest?: boolean;
|
||||
}
|
||||
export interface BaseS3Options extends PublishConfiguration {
|
||||
/**
|
||||
* The update channel.
|
||||
* @default latest
|
||||
*/
|
||||
channel?: string | null;
|
||||
/**
|
||||
* The directory path.
|
||||
* @default /
|
||||
*/
|
||||
readonly path?: string | null;
|
||||
/**
|
||||
* The ACL. Set to `null` to not [add](https://github.com/electron-userland/electron-builder/issues/1822).
|
||||
*
|
||||
* @default public-read
|
||||
*/
|
||||
readonly acl?: "private" | "public-read" | null;
|
||||
}
|
||||
export interface S3Options extends BaseS3Options {
|
||||
/**
|
||||
* The provider. Must be `s3`.
|
||||
*/
|
||||
readonly provider: "s3";
|
||||
/**
|
||||
* The bucket name.
|
||||
*/
|
||||
readonly bucket: string;
|
||||
/**
|
||||
* The region. Is determined and set automatically when publishing.
|
||||
*/
|
||||
region?: string | null;
|
||||
/**
|
||||
* The ACL. Set to `null` to not [add](https://github.com/electron-userland/electron-builder/issues/1822).
|
||||
*
|
||||
* Please see [required permissions for the S3 provider](https://github.com/electron-userland/electron-builder/issues/1618#issuecomment-314679128).
|
||||
*
|
||||
* @default public-read
|
||||
*/
|
||||
readonly acl?: "private" | "public-read" | null;
|
||||
/**
|
||||
* The type of storage to use for the object.
|
||||
* @default STANDARD
|
||||
*/
|
||||
readonly storageClass?: "STANDARD" | "REDUCED_REDUNDANCY" | "STANDARD_IA" | null;
|
||||
/**
|
||||
* Server-side encryption algorithm to use for the object.
|
||||
*/
|
||||
readonly encryption?: "AES256" | "aws:kms" | null;
|
||||
/**
|
||||
* The endpoint URI to send requests to. The default endpoint is built from the configured region.
|
||||
* The endpoint should be a string like `https://{service}.{region}.amazonaws.com`.
|
||||
*/
|
||||
readonly endpoint?: string | null;
|
||||
}
|
||||
/**
|
||||
* [DigitalOcean Spaces](https://www.digitalocean.com/community/tutorials/an-introduction-to-digitalocean-spaces) options.
|
||||
* Access key is required, define `DO_KEY_ID` and `DO_SECRET_KEY` environment variables.
|
||||
*/
|
||||
export interface SpacesOptions extends BaseS3Options {
|
||||
/**
|
||||
* The provider. Must be `spaces`.
|
||||
*/
|
||||
readonly provider: "spaces";
|
||||
/**
|
||||
* The space name.
|
||||
*/
|
||||
readonly name: string;
|
||||
/**
|
||||
* The region (e.g. `nyc3`).
|
||||
*/
|
||||
readonly region: string;
|
||||
}
|
||||
export declare function getS3LikeProviderBaseUrl(configuration: PublishConfiguration): string;
|
||||
/**
|
||||
* [Bintray](https://bintray.com/) options. Requires an API key. An API key can be obtained from the user [profile](https://bintray.com/profile/edit) page ("Edit Your Profile" -> API Key).
|
||||
* Define `BT_TOKEN` environment variable.
|
||||
*/
|
||||
export interface BintrayOptions extends PublishConfiguration {
|
||||
/**
|
||||
* The provider. Must be `bintray`.
|
||||
*/
|
||||
readonly provider: "bintray";
|
||||
/**
|
||||
* The Bintray package name.
|
||||
*/
|
||||
readonly package?: string | null;
|
||||
/**
|
||||
* The Bintray repository name.
|
||||
* @default generic
|
||||
*/
|
||||
readonly repo?: string | null;
|
||||
/**
|
||||
* The owner.
|
||||
*/
|
||||
readonly owner?: string | null;
|
||||
/**
|
||||
* The Bintray component (Debian only).
|
||||
*/
|
||||
readonly component?: string | null;
|
||||
/**
|
||||
* The Bintray distribution (Debian only).
|
||||
* @default stable
|
||||
*/
|
||||
readonly distribution?: string | null;
|
||||
/**
|
||||
* The Bintray user account. Used in cases where the owner is an organization.
|
||||
*/
|
||||
readonly user?: string | null;
|
||||
readonly token?: string | null;
|
||||
}
|
77
buildfiles/node_modules/builder-util-runtime/out/publishOptions.js
generated
vendored
Normal file
77
buildfiles/node_modules/builder-util-runtime/out/publishOptions.js
generated
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.githubUrl = githubUrl;
|
||||
exports.getS3LikeProviderBaseUrl = getS3LikeProviderBaseUrl;
|
||||
|
||||
/** @private */
|
||||
function githubUrl(options, defaultHost = "github.com") {
|
||||
return `${options.protocol || "https"}://${options.host || defaultHost}`;
|
||||
}
|
||||
|
||||
function getS3LikeProviderBaseUrl(configuration) {
|
||||
const provider = configuration.provider;
|
||||
|
||||
if (provider === "s3") {
|
||||
return s3Url(configuration);
|
||||
}
|
||||
|
||||
if (provider === "spaces") {
|
||||
return spacesUrl(configuration);
|
||||
}
|
||||
|
||||
throw new Error(`Not supported provider: ${provider}`);
|
||||
}
|
||||
|
||||
function s3Url(options) {
|
||||
let url;
|
||||
|
||||
if (options.endpoint != null) {
|
||||
url = `${options.endpoint}/${options.bucket}`;
|
||||
} else if (options.bucket.includes(".")) {
|
||||
if (options.region == null) {
|
||||
throw new Error(`Bucket name "${options.bucket}" includes a dot, but S3 region is missing`);
|
||||
} // special case, see http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro
|
||||
|
||||
|
||||
if (options.region === "us-east-1") {
|
||||
url = `https://s3.amazonaws.com/${options.bucket}`;
|
||||
} else {
|
||||
url = `https://s3-${options.region}.amazonaws.com/${options.bucket}`;
|
||||
}
|
||||
} else if (options.region === "cn-north-1") {
|
||||
url = `https://${options.bucket}.s3.${options.region}.amazonaws.com.cn`;
|
||||
} else {
|
||||
url = `https://${options.bucket}.s3.amazonaws.com`;
|
||||
}
|
||||
|
||||
return appendPath(url, options.path);
|
||||
}
|
||||
|
||||
function appendPath(url, p) {
|
||||
if (p != null && p.length > 0) {
|
||||
if (!p.startsWith("/")) {
|
||||
url += "/";
|
||||
}
|
||||
|
||||
url += p;
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
function spacesUrl(options) {
|
||||
if (options.name == null) {
|
||||
throw new Error(`name is missing`);
|
||||
}
|
||||
|
||||
if (options.region == null) {
|
||||
throw new Error(`region is missing`);
|
||||
}
|
||||
|
||||
return appendPath(`https://${options.name}.${options.region}.digitaloceanspaces.com`, options.path);
|
||||
}
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=publishOptions.js.map
|
1
buildfiles/node_modules/builder-util-runtime/out/publishOptions.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/builder-util-runtime/out/publishOptions.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
buildfiles/node_modules/builder-util-runtime/out/rfc2253Parser.d.ts
generated
vendored
Normal file
1
buildfiles/node_modules/builder-util-runtime/out/rfc2253Parser.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export declare function parseDn(seq: string): Map<string, string>;
|
96
buildfiles/node_modules/builder-util-runtime/out/rfc2253Parser.js
generated
vendored
Normal file
96
buildfiles/node_modules/builder-util-runtime/out/rfc2253Parser.js
generated
vendored
Normal file
@ -0,0 +1,96 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.parseDn = parseDn;
|
||||
|
||||
function parseDn(seq) {
|
||||
let quoted = false;
|
||||
let key = null;
|
||||
let token = "";
|
||||
let nextNonSpace = 0;
|
||||
seq = seq.trim();
|
||||
const result = new Map();
|
||||
|
||||
for (let i = 0; i <= seq.length; i++) {
|
||||
if (i === seq.length) {
|
||||
if (key !== null) {
|
||||
result.set(key, token);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
const ch = seq[i];
|
||||
|
||||
if (quoted) {
|
||||
if (ch === '"') {
|
||||
quoted = false;
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (ch === '"') {
|
||||
quoted = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ch === "\\") {
|
||||
i++;
|
||||
const ord = parseInt(seq.slice(i, i + 2), 16);
|
||||
|
||||
if (Number.isNaN(ord)) {
|
||||
token += seq[i];
|
||||
} else {
|
||||
i++;
|
||||
token += String.fromCharCode(ord);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (key === null && ch === "=") {
|
||||
key = token;
|
||||
token = "";
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ch === "," || ch === ";" || ch === "+") {
|
||||
if (key !== null) {
|
||||
result.set(key, token);
|
||||
}
|
||||
|
||||
key = null;
|
||||
token = "";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (ch === " " && !quoted) {
|
||||
if (token.length === 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (i > nextNonSpace) {
|
||||
let j = i;
|
||||
|
||||
while (seq[j] === " ") {
|
||||
j++;
|
||||
}
|
||||
|
||||
nextNonSpace = j;
|
||||
}
|
||||
|
||||
if (nextNonSpace >= seq.length || seq[nextNonSpace] === "," || seq[nextNonSpace] === ";" || key === null && seq[nextNonSpace] === "=" || key !== null && seq[nextNonSpace] === "+") {
|
||||
i = nextNonSpace - 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
token += ch;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=rfc2253Parser.js.map
|
1
buildfiles/node_modules/builder-util-runtime/out/rfc2253Parser.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/builder-util-runtime/out/rfc2253Parser.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../src/rfc2253Parser.ts"],"names":[],"mappings":";;;;;;;AAAM,SAAU,OAAV,CAAkB,GAAlB,EAA6B;AACjC,MAAI,MAAM,GAAG,KAAb;AACA,MAAI,GAAG,GAAkB,IAAzB;AACA,MAAI,KAAK,GAAG,EAAZ;AACA,MAAI,YAAY,GAAG,CAAnB;AAEA,EAAA,GAAG,GAAG,GAAG,CAAC,IAAJ,EAAN;AACA,QAAM,MAAM,GAAG,IAAI,GAAJ,EAAf;;AACA,OAAK,IAAI,CAAC,GAAG,CAAb,EAAgB,CAAC,IAAI,GAAG,CAAC,MAAzB,EAAiC,CAAC,EAAlC,EAAsC;AACpC,QAAI,CAAC,KAAK,GAAG,CAAC,MAAd,EAAsB;AACpB,UAAI,GAAG,KAAK,IAAZ,EAAkB;AAChB,QAAA,MAAM,CAAC,GAAP,CAAW,GAAX,EAAgB,KAAhB;AACD;;AACD;AACD;;AAED,UAAM,EAAE,GAAG,GAAG,CAAC,CAAD,CAAd;;AACA,QAAI,MAAJ,EAAY;AACV,UAAI,EAAE,KAAK,GAAX,EAAgB;AACd,QAAA,MAAM,GAAG,KAAT;AACA;AACD;AACF,KALD,MAMK;AACH,UAAI,EAAE,KAAK,GAAX,EAAgB;AACd,QAAA,MAAM,GAAG,IAAT;AACA;AACD;;AAED,UAAI,EAAE,KAAK,IAAX,EAAiB;AACf,QAAA,CAAC;AACD,cAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAJ,CAAU,CAAV,EAAa,CAAC,GAAG,CAAjB,CAAD,EAAsB,EAAtB,CAApB;;AACA,YAAI,MAAM,CAAC,KAAP,CAAa,GAAb,CAAJ,EAAuB;AACrB,UAAA,KAAK,IAAI,GAAG,CAAC,CAAD,CAAZ;AACD,SAFD,MAGK;AACH,UAAA,CAAC;AACD,UAAA,KAAK,IAAI,MAAM,CAAC,YAAP,CAAoB,GAApB,CAAT;AACD;;AACD;AACD;;AAED,UAAI,GAAG,KAAK,IAAR,IAAgB,EAAE,KAAK,GAA3B,EAAgC;AAC9B,QAAA,GAAG,GAAG,KAAN;AACA,QAAA,KAAK,GAAG,EAAR;AACA;AACD;;AAED,UAAI,EAAE,KAAK,GAAP,IAAc,EAAE,KAAK,GAArB,IAA4B,EAAE,KAAK,GAAvC,EAA4C;AAC1C,YAAI,GAAG,KAAK,IAAZ,EAAkB;AAChB,UAAA,MAAM,CAAC,GAAP,CAAW,GAAX,EAAgB,KAAhB;AACD;;AACD,QAAA,GAAG,GAAG,IAAN;AACA,QAAA,KAAK,GAAG,EAAR;AACA;AACD;AACF;;AAED,QAAI,EAAE,KAAK,GAAP,IAAc,CAAC,MAAnB,EAA2B;AACzB,UAAI,KAAK,CAAC,MAAN,KAAiB,CAArB,EAAwB;AACtB;AACD;;AAED,UAAI,CAAC,GAAG,YAAR,EAAsB;AACpB,YAAI,CAAC,GAAG,CAAR;;AACA,eAAO,GAAG,CAAC,CAAD,CAAH,KAAW,GAAlB,EAAuB;AACrB,UAAA,CAAC;AACF;;AACD,QAAA,YAAY,GAAG,CAAf;AACD;;AAED,UAAI,YAAY,IAAI,GAAG,CAAC,MAApB,IACC,GAAG,CAAC,YAAD,CAAH,KAAsB,GADvB,IAEC,GAAG,CAAC,YAAD,CAAH,KAAsB,GAFvB,IAGE,GAAG,KAAK,IAAR,IAAgB,GAAG,CAAC,YAAD,CAAH,KAAsB,GAHxC,IAIE,GAAG,KAAK,IAAR,IAAgB,GAAG,CAAC,YAAD,CAAH,KAAsB,GAJ5C,EAKE;AACA,QAAA,CAAC,GAAG,YAAY,GAAG,CAAnB;AACA;AACD;AACF;;AAED,IAAA,KAAK,IAAI,EAAT;AACD;;AAED,SAAO,MAAP;AACD,C","sourcesContent":["export function parseDn(seq: string): Map<string, string> {\n let quoted = false\n let key: string | null = null\n let token = \"\"\n let nextNonSpace = 0\n\n seq = seq.trim()\n const result = new Map<string, string>()\n for (let i = 0; i <= seq.length; i++) {\n if (i === seq.length) {\n if (key !== null) {\n result.set(key, token)\n }\n break\n }\n\n const ch = seq[i]\n if (quoted) {\n if (ch === '\"') {\n quoted = false\n continue\n }\n }\n else {\n if (ch === '\"') {\n quoted = true\n continue\n }\n\n if (ch === \"\\\\\") {\n i++\n const ord = parseInt(seq.slice(i, i + 2), 16)\n if (Number.isNaN(ord)) {\n token += seq[i]\n }\n else {\n i++\n token += String.fromCharCode(ord)\n }\n continue\n }\n\n if (key === null && ch === \"=\") {\n key = token\n token = \"\"\n continue\n }\n\n if (ch === \",\" || ch === \";\" || ch === \"+\") {\n if (key !== null) {\n result.set(key, token)\n }\n key = null\n token = \"\"\n continue\n }\n }\n\n if (ch === \" \" && !quoted) {\n if (token.length === 0) {\n continue\n }\n\n if (i > nextNonSpace) {\n let j = i\n while (seq[j] === \" \") {\n j++\n }\n nextNonSpace = j\n }\n\n if (nextNonSpace >= seq.length\n || seq[nextNonSpace] === \",\"\n || seq[nextNonSpace] === \";\"\n || (key === null && seq[nextNonSpace] === \"=\")\n || (key !== null && seq[nextNonSpace] === \"+\")\n ) {\n i = nextNonSpace - 1\n continue\n }\n }\n\n token += ch\n }\n\n return result\n}"],"sourceRoot":""}
|
71
buildfiles/node_modules/builder-util-runtime/out/updateInfo.d.ts
generated
vendored
Normal file
71
buildfiles/node_modules/builder-util-runtime/out/updateInfo.d.ts
generated
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
export interface ReleaseNoteInfo {
|
||||
/**
|
||||
* The version.
|
||||
*/
|
||||
readonly version: string;
|
||||
/**
|
||||
* The note.
|
||||
*/
|
||||
readonly note: string | null;
|
||||
}
|
||||
export interface BlockMapDataHolder {
|
||||
/**
|
||||
* The file size. Used to verify downloaded size (save one HTTP request to get length).
|
||||
* Also used when block map data is embedded into the file (appimage, windows web installer package).
|
||||
*/
|
||||
size?: number;
|
||||
/**
|
||||
* The block map file size. Used when block map data is embedded into the file (appimage, windows web installer package).
|
||||
* This information can be obtained from the file itself, but it requires additional HTTP request,
|
||||
* so, to reduce request count, block map size is specified in the update metadata too.
|
||||
*/
|
||||
blockMapSize?: number;
|
||||
/**
|
||||
* The file checksum.
|
||||
*/
|
||||
readonly sha512: string;
|
||||
readonly isAdminRightsRequired?: boolean;
|
||||
}
|
||||
export interface PackageFileInfo extends BlockMapDataHolder {
|
||||
readonly path: string;
|
||||
}
|
||||
export interface UpdateFileInfo extends BlockMapDataHolder {
|
||||
url: string;
|
||||
}
|
||||
export interface UpdateInfo {
|
||||
/**
|
||||
* The version.
|
||||
*/
|
||||
readonly version: string;
|
||||
readonly files: Array<UpdateFileInfo>;
|
||||
/** @deprecated */
|
||||
readonly path: string;
|
||||
/** @deprecated */
|
||||
readonly sha512: string;
|
||||
/**
|
||||
* The release name.
|
||||
*/
|
||||
releaseName?: string | null;
|
||||
/**
|
||||
* The release notes. List if `updater.fullChangelog` is set to `true`, `string` otherwise.
|
||||
*/
|
||||
releaseNotes?: string | Array<ReleaseNoteInfo> | null;
|
||||
/**
|
||||
* The release date.
|
||||
*/
|
||||
releaseDate: string;
|
||||
/**
|
||||
* The [staged rollout](/auto-update#staged-rollouts) percentage, 0-100.
|
||||
*/
|
||||
readonly stagingPercentage?: number;
|
||||
}
|
||||
export interface WindowsUpdateInfo extends UpdateInfo {
|
||||
packages?: {
|
||||
[arch: string]: PackageFileInfo;
|
||||
} | null;
|
||||
/**
|
||||
* @deprecated
|
||||
* @private
|
||||
*/
|
||||
sha2?: string;
|
||||
}
|
3
buildfiles/node_modules/builder-util-runtime/out/updateInfo.js
generated
vendored
Normal file
3
buildfiles/node_modules/builder-util-runtime/out/updateInfo.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=updateInfo.js.map
|
1
buildfiles/node_modules/builder-util-runtime/out/updateInfo.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/builder-util-runtime/out/updateInfo.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
|
22
buildfiles/node_modules/builder-util-runtime/out/uuid.d.ts
generated
vendored
Normal file
22
buildfiles/node_modules/builder-util-runtime/out/uuid.d.ts
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
/// <reference types="node" />
|
||||
export declare class UUID {
|
||||
private ascii;
|
||||
private readonly binary;
|
||||
private readonly version;
|
||||
static readonly OID: Buffer;
|
||||
constructor(uuid: Buffer | string);
|
||||
static v5(name: string | Buffer, namespace: Buffer): any;
|
||||
toString(): string;
|
||||
inspect(): string;
|
||||
static check(uuid: Buffer | string, offset?: number): false | {
|
||||
version: undefined;
|
||||
variant: string;
|
||||
format: string;
|
||||
} | {
|
||||
version: number;
|
||||
variant: string;
|
||||
format: string;
|
||||
};
|
||||
static parse(input: string): Buffer;
|
||||
}
|
||||
export declare const nil: UUID;
|
229
buildfiles/node_modules/builder-util-runtime/out/uuid.js
generated
vendored
Normal file
229
buildfiles/node_modules/builder-util-runtime/out/uuid.js
generated
vendored
Normal file
@ -0,0 +1,229 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.nil = exports.UUID = void 0;
|
||||
|
||||
function _crypto() {
|
||||
const data = require("crypto");
|
||||
|
||||
_crypto = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _index() {
|
||||
const data = require("./index");
|
||||
|
||||
_index = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
const invalidName = "options.name must be either a string or a Buffer"; // Node ID according to rfc4122#section-4.5
|
||||
|
||||
const randomHost = (0, _crypto().randomBytes)(16);
|
||||
randomHost[0] = randomHost[0] | 0x01; // lookup table hex to byte
|
||||
|
||||
const hex2byte = {}; // lookup table byte to hex
|
||||
|
||||
const byte2hex = []; // populate lookup tables
|
||||
|
||||
for (let i = 0; i < 256; i++) {
|
||||
const hex = (i + 0x100).toString(16).substr(1);
|
||||
hex2byte[hex] = i;
|
||||
byte2hex[i] = hex;
|
||||
} // UUID class
|
||||
|
||||
|
||||
class UUID {
|
||||
constructor(uuid) {
|
||||
this.ascii = null;
|
||||
this.binary = null;
|
||||
const check = UUID.check(uuid);
|
||||
|
||||
if (!check) {
|
||||
throw new Error("not a UUID");
|
||||
}
|
||||
|
||||
this.version = check.version;
|
||||
|
||||
if (check.format === "ascii") {
|
||||
this.ascii = uuid;
|
||||
} else {
|
||||
this.binary = uuid;
|
||||
}
|
||||
}
|
||||
|
||||
static v5(name, namespace) {
|
||||
return uuidNamed(name, "sha1", 0x50, namespace);
|
||||
}
|
||||
|
||||
toString() {
|
||||
if (this.ascii == null) {
|
||||
this.ascii = stringify(this.binary);
|
||||
}
|
||||
|
||||
return this.ascii;
|
||||
}
|
||||
|
||||
inspect() {
|
||||
return `UUID v${this.version} ${this.toString()}`;
|
||||
}
|
||||
|
||||
static check(uuid, offset = 0) {
|
||||
if (typeof uuid === "string") {
|
||||
uuid = uuid.toLowerCase();
|
||||
|
||||
if (!/^[a-f0-9]{8}(-[a-f0-9]{4}){3}-([a-f0-9]{12})$/.test(uuid)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (uuid === "00000000-0000-0000-0000-000000000000") {
|
||||
return {
|
||||
version: undefined,
|
||||
variant: "nil",
|
||||
format: "ascii"
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
version: (hex2byte[uuid[14] + uuid[15]] & 0xf0) >> 4,
|
||||
variant: getVariant((hex2byte[uuid[19] + uuid[20]] & 0xe0) >> 5),
|
||||
format: "ascii"
|
||||
};
|
||||
}
|
||||
|
||||
if (Buffer.isBuffer(uuid)) {
|
||||
if (uuid.length < offset + 16) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let i = 0;
|
||||
|
||||
for (; i < 16; i++) {
|
||||
if (uuid[offset + i] !== 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i === 16) {
|
||||
return {
|
||||
version: undefined,
|
||||
variant: "nil",
|
||||
format: "binary"
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
version: (uuid[offset + 6] & 0xf0) >> 4,
|
||||
variant: getVariant((uuid[offset + 8] & 0xe0) >> 5),
|
||||
format: "binary"
|
||||
};
|
||||
}
|
||||
|
||||
throw (0, _index().newError)("Unknown type of uuid", "ERR_UNKNOWN_UUID_TYPE");
|
||||
} // read stringified uuid into a Buffer
|
||||
|
||||
|
||||
static parse(input) {
|
||||
const buffer = Buffer.allocUnsafe(16);
|
||||
let j = 0;
|
||||
|
||||
for (let i = 0; i < 16; i++) {
|
||||
buffer[i] = hex2byte[input[j++] + input[j++]];
|
||||
|
||||
if (i === 3 || i === 5 || i === 7 || i === 9) {
|
||||
j += 1;
|
||||
}
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
} // from rfc4122#appendix-C
|
||||
|
||||
|
||||
exports.UUID = UUID;
|
||||
UUID.OID = UUID.parse("6ba7b812-9dad-11d1-80b4-00c04fd430c8"); // according to rfc4122#section-4.1.1
|
||||
|
||||
function getVariant(bits) {
|
||||
switch (bits) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 3:
|
||||
return "ncs";
|
||||
|
||||
case 4:
|
||||
case 5:
|
||||
return "rfc4122";
|
||||
|
||||
case 6:
|
||||
return "microsoft";
|
||||
|
||||
default:
|
||||
return "future";
|
||||
}
|
||||
}
|
||||
|
||||
var UuidEncoding;
|
||||
|
||||
(function (UuidEncoding) {
|
||||
UuidEncoding[UuidEncoding["ASCII"] = 0] = "ASCII";
|
||||
UuidEncoding[UuidEncoding["BINARY"] = 1] = "BINARY";
|
||||
UuidEncoding[UuidEncoding["OBJECT"] = 2] = "OBJECT";
|
||||
})(UuidEncoding || (UuidEncoding = {})); // v3 + v5
|
||||
|
||||
|
||||
function uuidNamed(name, hashMethod, version, namespace, encoding = UuidEncoding.ASCII) {
|
||||
const hash = (0, _crypto().createHash)(hashMethod);
|
||||
const nameIsNotAString = typeof name !== "string";
|
||||
|
||||
if (nameIsNotAString && !Buffer.isBuffer(name)) {
|
||||
throw (0, _index().newError)(invalidName, "ERR_INVALID_UUID_NAME");
|
||||
}
|
||||
|
||||
hash.update(namespace);
|
||||
hash.update(name);
|
||||
const buffer = hash.digest();
|
||||
let result;
|
||||
|
||||
switch (encoding) {
|
||||
case UuidEncoding.BINARY:
|
||||
buffer[6] = buffer[6] & 0x0f | version;
|
||||
buffer[8] = buffer[8] & 0x3f | 0x80;
|
||||
result = buffer;
|
||||
break;
|
||||
|
||||
case UuidEncoding.OBJECT:
|
||||
buffer[6] = buffer[6] & 0x0f | version;
|
||||
buffer[8] = buffer[8] & 0x3f | 0x80;
|
||||
result = new UUID(buffer);
|
||||
break;
|
||||
|
||||
default:
|
||||
result = byte2hex[buffer[0]] + byte2hex[buffer[1]] + byte2hex[buffer[2]] + byte2hex[buffer[3]] + "-" + byte2hex[buffer[4]] + byte2hex[buffer[5]] + "-" + byte2hex[buffer[6] & 0x0f | version] + byte2hex[buffer[7]] + "-" + byte2hex[buffer[8] & 0x3f | 0x80] + byte2hex[buffer[9]] + "-" + byte2hex[buffer[10]] + byte2hex[buffer[11]] + byte2hex[buffer[12]] + byte2hex[buffer[13]] + byte2hex[buffer[14]] + byte2hex[buffer[15]];
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function stringify(buffer) {
|
||||
return byte2hex[buffer[0]] + byte2hex[buffer[1]] + byte2hex[buffer[2]] + byte2hex[buffer[3]] + "-" + byte2hex[buffer[4]] + byte2hex[buffer[5]] + "-" + byte2hex[buffer[6]] + byte2hex[buffer[7]] + "-" + byte2hex[buffer[8]] + byte2hex[buffer[9]] + "-" + byte2hex[buffer[10]] + byte2hex[buffer[11]] + byte2hex[buffer[12]] + byte2hex[buffer[13]] + byte2hex[buffer[14]] + byte2hex[buffer[15]];
|
||||
} // according to rfc4122#section-4.1.7
|
||||
|
||||
|
||||
const nil = new UUID("00000000-0000-0000-0000-000000000000"); // UUID.v4 = uuidRandom
|
||||
// UUID.v4fast = uuidRandomFast
|
||||
// UUID.v3 = function(options, callback) {
|
||||
// return uuidNamed("md5", 0x30, options, callback)
|
||||
// }
|
||||
exports.nil = nil;
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=uuid.js.map
|
1
buildfiles/node_modules/builder-util-runtime/out/uuid.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/builder-util-runtime/out/uuid.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
17
buildfiles/node_modules/builder-util-runtime/out/xml.d.ts
generated
vendored
Normal file
17
buildfiles/node_modules/builder-util-runtime/out/xml.d.ts
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
export declare class XElement {
|
||||
readonly name: string;
|
||||
value: string;
|
||||
attributes: {
|
||||
[key: string]: string;
|
||||
} | null;
|
||||
isCData: boolean;
|
||||
elements: Array<XElement> | null;
|
||||
constructor(name: string);
|
||||
attribute(name: string): string;
|
||||
removeAttribute(name: string): void;
|
||||
element(name: string, ignoreCase?: boolean, errorIfMissed?: string | null): XElement;
|
||||
elementOrNull(name: string, ignoreCase?: boolean): XElement | null;
|
||||
getElements(name: string, ignoreCase?: boolean): XElement[];
|
||||
elementValueOrEmpty(name: string, ignoreCase?: boolean): string;
|
||||
}
|
||||
export declare function parseXml(data: string): XElement;
|
165
buildfiles/node_modules/builder-util-runtime/out/xml.js
generated
vendored
Normal file
165
buildfiles/node_modules/builder-util-runtime/out/xml.js
generated
vendored
Normal file
@ -0,0 +1,165 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.parseXml = parseXml;
|
||||
exports.XElement = void 0;
|
||||
|
||||
function sax() {
|
||||
const data = _interopRequireWildcard(require("sax"));
|
||||
|
||||
sax = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _index() {
|
||||
const data = require("./index");
|
||||
|
||||
_index = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
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 XElement {
|
||||
constructor(name) {
|
||||
this.name = name;
|
||||
this.value = "";
|
||||
this.attributes = null;
|
||||
this.isCData = false;
|
||||
this.elements = null;
|
||||
|
||||
if (!name) {
|
||||
throw (0, _index().newError)("Element name cannot be empty", "ERR_XML_ELEMENT_NAME_EMPTY");
|
||||
}
|
||||
|
||||
if (!isValidName(name)) {
|
||||
throw (0, _index().newError)(`Invalid element name: ${name}`, "ERR_XML_ELEMENT_INVALID_NAME");
|
||||
}
|
||||
}
|
||||
|
||||
attribute(name) {
|
||||
const result = this.attributes === null ? null : this.attributes[name];
|
||||
|
||||
if (result == null) {
|
||||
throw (0, _index().newError)(`No attribute "${name}"`, "ERR_XML_MISSED_ATTRIBUTE");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
removeAttribute(name) {
|
||||
if (this.attributes !== null) {
|
||||
delete this.attributes[name];
|
||||
}
|
||||
}
|
||||
|
||||
element(name, ignoreCase = false, errorIfMissed = null) {
|
||||
const result = this.elementOrNull(name, ignoreCase);
|
||||
|
||||
if (result === null) {
|
||||
throw (0, _index().newError)(errorIfMissed || `No element "${name}"`, "ERR_XML_MISSED_ELEMENT");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
elementOrNull(name, ignoreCase = false) {
|
||||
if (this.elements === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (const element of this.elements) {
|
||||
if (isNameEquals(element, name, ignoreCase)) {
|
||||
return element;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
getElements(name, ignoreCase = false) {
|
||||
if (this.elements === null) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return this.elements.filter(it => isNameEquals(it, name, ignoreCase));
|
||||
}
|
||||
|
||||
elementValueOrEmpty(name, ignoreCase = false) {
|
||||
const element = this.elementOrNull(name, ignoreCase);
|
||||
return element === null ? "" : element.value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.XElement = XElement;
|
||||
const NAME_REG_EXP = new RegExp(/^[A-Za-z_][:A-Za-z0-9_-]*$/i);
|
||||
|
||||
function isValidName(name) {
|
||||
return NAME_REG_EXP.test(name);
|
||||
}
|
||||
|
||||
function isNameEquals(element, name, ignoreCase) {
|
||||
const elementName = element.name;
|
||||
return elementName === name || ignoreCase === true && elementName.length === name.length && elementName.toLowerCase() === name.toLowerCase();
|
||||
}
|
||||
|
||||
function parseXml(data) {
|
||||
let rootElement = null;
|
||||
const parser = sax().parser(true, {});
|
||||
const elements = [];
|
||||
|
||||
parser.onopentag = saxElement => {
|
||||
const element = new XElement(saxElement.name);
|
||||
element.attributes = saxElement.attributes;
|
||||
|
||||
if (rootElement === null) {
|
||||
rootElement = element;
|
||||
} else {
|
||||
const parent = elements[elements.length - 1];
|
||||
|
||||
if (parent.elements == null) {
|
||||
parent.elements = [];
|
||||
}
|
||||
|
||||
parent.elements.push(element);
|
||||
}
|
||||
|
||||
elements.push(element);
|
||||
};
|
||||
|
||||
parser.onclosetag = () => {
|
||||
elements.pop();
|
||||
};
|
||||
|
||||
parser.ontext = text => {
|
||||
if (elements.length > 0) {
|
||||
elements[elements.length - 1].value = text;
|
||||
}
|
||||
};
|
||||
|
||||
parser.oncdata = cdata => {
|
||||
const element = elements[elements.length - 1];
|
||||
element.value = cdata;
|
||||
element.isCData = true;
|
||||
};
|
||||
|
||||
parser.onerror = err => {
|
||||
throw err;
|
||||
};
|
||||
|
||||
parser.write(data);
|
||||
return rootElement;
|
||||
}
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=xml.js.map
|
1
buildfiles/node_modules/builder-util-runtime/out/xml.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/builder-util-runtime/out/xml.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user