Skip to content

Commit

Permalink
Deploy Production Code for Commit 17103f7 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesIves committed Sep 2, 2024
1 parent 17103f7 commit e02870f
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 22 deletions.
42 changes: 31 additions & 11 deletions lib/constants.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,46 @@
* Describes the action interface.
*/
export interface ActionInterface {
/** Deployment token. */
/**
* Deployment token.
*/
token?: string;
/** The template to use. */
/**
* The template to use.
*/
template: string;
/** The file to replace the content in. */
/**
* The file to replace the content in.
*/
file: string;
/** The minimum amount sponsored to be included. */
/**
* The minimum amount sponsored to be included.
*/
minimum: number;
/** The maximum amount sponsored to be included. */
/**
* The maximum amount sponsored to be included.
*/
maximum: number;
/** The marker at which the content should be included within. */
/**
* The marker at which the content should be included within.
*/
marker: string;
/** If the user has no sponsors, we can replace it with a fallback. */
/**
* If the user has no sponsors, we can replace it with a fallback.
*/
fallback: string;
/** Fetches organization level sponsors if true. */
/**
* Fetches organization level sponsors if true.
*/
organization: boolean;
/** Determines if inactive sponsors should be returned or not. */
/**
* Determines if inactive sponsors should be returned or not.
*/
activeOnly: boolean;
/** Determines if private sponsors should be returned or not. If marked as true, the identity of the sponsor is still
kept private, however, an anonymized version of the sponsor is still included in the list. */
/**
* Determines if private sponsors should be returned or not. If marked as true, the identity of the sponsor is still
* kept private, however, an anonymized version of the sponsor is still included in the list.
*/
includePrivate: boolean;
}
/**
Expand Down
8 changes: 4 additions & 4 deletions lib/lib.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ActionInterface, Status } from './constants';
import { generateFile, getSponsors } from './template';
/** Initializes and runs the action.
*
* @param {ActionInterface} configuration - The configuration object.
/**
* Initializes and runs the action.
* If no configuration is provided, the action will run with the default configuration.
*/
export default function run(configuration: ActionInterface): Promise<Status>;
export default function run(configuration?: ActionInterface): Promise<Status>;
export { generateFile, getSponsors, ActionInterface };
11 changes: 7 additions & 4 deletions lib/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ const template_1 = require("./template");
Object.defineProperty(exports, "generateFile", { enumerable: true, get: function () { return template_1.generateFile; } });
Object.defineProperty(exports, "getSponsors", { enumerable: true, get: function () { return template_1.getSponsors; } });
const util_1 = require("./util");
/** Initializes and runs the action.
*
* @param {ActionInterface} configuration - The configuration object.
/**
* Initializes and runs the action.
* If no configuration is provided, the action will run with the default configuration.
*/
function run(configuration) {
return __awaiter(this, void 0, void 0, function* () {
let status = constants_1.Status.RUNNING;
const settings = Object.assign({}, configuration);
/**
* Merges the action configuration with the user configuration.
*/
const settings = Object.assign(Object.assign({}, constants_1.action), configuration);
try {
(0, core_1.info)(`
Expand Down
3 changes: 1 addition & 2 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const constants_1 = require("./constants");
const lib_1 = __importDefault(require("./lib"));
(0, lib_1.default)(constants_1.action);
(0, lib_1.default)();
4 changes: 3 additions & 1 deletion lib/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ function generateTemplate(response, action) {
? user.tier.monthlyPriceInCents
: 0) <= action.maximum);
}
/** If there are no valid sponsors then we return the provided fallback. */
/**
* If there are no valid sponsors then we return the provided fallback.
*/
if (!filteredSponsors.length) {
return action.fallback;
}
Expand Down

0 comments on commit e02870f

Please sign in to comment.