Skip to content

Commit

Permalink
Merge pull request #3 from Expensify/master
Browse files Browse the repository at this point in the history
Merge
  • Loading branch information
tugbadogan authored Mar 18, 2021
2 parents c452e2e + 44ca84a commit acc4a79
Show file tree
Hide file tree
Showing 70 changed files with 15,768 additions and 914 deletions.
108 changes: 59 additions & 49 deletions .github/actions/bumpVersion/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1629,7 +1629,7 @@ function _objectWithoutProperties(source, excluded) {
return target;
}

const VERSION = "3.2.4";
const VERSION = "3.3.1";

class Octokit {
constructor(options = {}) {
Expand All @@ -1638,6 +1638,7 @@ class Octokit {
baseUrl: request.request.endpoint.DEFAULTS.baseUrl,
headers: {},
request: Object.assign({}, options.request, {
// @ts-ignore internal usage only, no need to type
hook: hook.bind(null, "request")
}),
mediaType: {
Expand Down Expand Up @@ -2133,7 +2134,7 @@ function withDefaults(oldDefaults, newDefaults) {
});
}

const VERSION = "6.0.10";
const VERSION = "6.0.11";

const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
// So we use RequestParameters and add method as additional required property.
Expand Down Expand Up @@ -2216,7 +2217,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
var request = __nccwpck_require__(6234);
var universalUserAgent = __nccwpck_require__(5030);

const VERSION = "4.5.8";
const VERSION = "4.6.1";

class GraphqlError extends Error {
constructor(request, response) {
Expand All @@ -2239,10 +2240,18 @@ class GraphqlError extends Error {
}

const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query", "mediaType"];
const FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
const GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
function graphql(request, query, options) {
if (typeof query === "string" && options && "query" in options) {
return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`));
if (options) {
if (typeof query === "string" && "query" in options) {
return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`));
}

for (const key in options) {
if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue;
return Promise.reject(new Error(`[@octokit/graphql] "${key}" cannot be used as variable name`));
}
}

const parsedOptions = typeof query === "string" ? Object.assign({
Expand Down Expand Up @@ -3713,7 +3722,7 @@ var isPlainObject = __nccwpck_require__(9062);
var nodeFetch = _interopDefault(__nccwpck_require__(467));
var requestError = __nccwpck_require__(537);

const VERSION = "5.4.12";
const VERSION = "5.4.14";

function getBufferResponse(response) {
return response.arrayBuffer();
Expand Down Expand Up @@ -3966,51 +3975,51 @@ module.exports.Collection = Hook.Collection
/***/ 5549:
/***/ ((module) => {

module.exports = addHook
module.exports = addHook;

function addHook (state, kind, name, hook) {
var orig = hook
function addHook(state, kind, name, hook) {
var orig = hook;
if (!state.registry[name]) {
state.registry[name] = []
state.registry[name] = [];
}

if (kind === 'before') {
if (kind === "before") {
hook = function (method, options) {
return Promise.resolve()
.then(orig.bind(null, options))
.then(method.bind(null, options))
}
.then(method.bind(null, options));
};
}

if (kind === 'after') {
if (kind === "after") {
hook = function (method, options) {
var result
var result;
return Promise.resolve()
.then(method.bind(null, options))
.then(function (result_) {
result = result_
return orig(result, options)
result = result_;
return orig(result, options);
})
.then(function () {
return result
})
}
return result;
});
};
}

if (kind === 'error') {
if (kind === "error") {
hook = function (method, options) {
return Promise.resolve()
.then(method.bind(null, options))
.catch(function (error) {
return orig(error, options)
})
}
return orig(error, options);
});
};
}

state.registry[name].push({
hook: hook,
orig: orig
})
orig: orig,
});
}


Expand All @@ -4019,33 +4028,32 @@ function addHook (state, kind, name, hook) {
/***/ 4670:
/***/ ((module) => {

module.exports = register
module.exports = register;

function register (state, name, method, options) {
if (typeof method !== 'function') {
throw new Error('method for before hook must be a function')
function register(state, name, method, options) {
if (typeof method !== "function") {
throw new Error("method for before hook must be a function");
}

if (!options) {
options = {}
options = {};
}

if (Array.isArray(name)) {
return name.reverse().reduce(function (callback, name) {
return register.bind(null, state, name, callback, options)
}, method)()
return register.bind(null, state, name, callback, options);
}, method)();
}

return Promise.resolve()
.then(function () {
if (!state.registry[name]) {
return method(options)
}
return Promise.resolve().then(function () {
if (!state.registry[name]) {
return method(options);
}

return (state.registry[name]).reduce(function (method, registered) {
return registered.hook.bind(null, method, options)
}, method)()
})
return state.registry[name].reduce(function (method, registered) {
return registered.hook.bind(null, method, options);
}, method)();
});
}


Expand All @@ -4054,22 +4062,24 @@ function register (state, name, method, options) {
/***/ 6819:
/***/ ((module) => {

module.exports = removeHook
module.exports = removeHook;

function removeHook (state, name, method) {
function removeHook(state, name, method) {
if (!state.registry[name]) {
return
return;
}

var index = state.registry[name]
.map(function (registered) { return registered.orig })
.indexOf(method)
.map(function (registered) {
return registered.orig;
})
.indexOf(method);

if (index === -1) {
return
return;
}

state.registry[name].splice(index, 1)
state.registry[name].splice(index, 1);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ githubUtils.getStagingDeployCash()
),
))
.then(({data}) => {
console.log('Successfully updated StagingDeployCash!', data.html_url);
console.log('Successfully updated StagingDeployCash! 🎉', data.html_url);
process.exit(0);
})
.catch((err) => {
Expand Down Expand Up @@ -64,7 +64,7 @@ githubUtils.getStagingDeployCash()
newVersion,
_.map(PRNumbers, GithubUtils.getPullRequestURLFromNumber),
))
.then(({data}) => console.log('Successfully created new StagingDeployCash!', data.html_url))
.then(({data}) => console.log('Successfully created new StagingDeployCash! 🎉', data.html_url))
.catch((err) => {
console.error('An error occurred!', err);
core.setFailed(err);
Expand Down
Loading

0 comments on commit acc4a79

Please sign in to comment.