"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isDateExpired = exports.prepareQuery = void 0;
const luxon_1 = require("luxon");
function prepareQuery(payloadQuery) {
    return `
    query($owner: String!, $name: String!, $cursor: String, $count: Int!) {
      repository(owner: $owner, name: $name) {
        isRepoPrivate: isPrivate
        payload: ${payloadQuery}
      }
    }
  `;
}
exports.prepareQuery = prepareQuery;
/**
 * Tells whether the time `duration` is expired starting
 * from the `date` (ISO date format) at the moment of `now`.
 */
function isDateExpired(currentTime, initialTimestamp, duration) {
    const expiryTime = luxon_1.DateTime.fromISO(initialTimestamp).plus(duration);
    return currentTime >= expiryTime;
}
exports.isDateExpired = isDateExpired;
//# sourceMappingURL=util.js.map