Socket
Socket
Sign inDemoInstall

prismic-javascript

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prismic-javascript - npm Package Compare versions

Comparing version 1.0.5 to 1.1.0

11

d.ts/api.d.ts

@@ -1,2 +0,1 @@

import { IPredicate } from '@root/predicates';
import { IExperiments, IExperiment } from '@root/experiments';

@@ -54,3 +53,3 @@ import { IRequestHandler } from '@root/request';

ref(ref: string): ISearchForm;
query(query: string | IPredicate | IPredicate[]): ISearchForm;
query(query: string | string[]): ISearchForm;
pageSize(size: number): ISearchForm;

@@ -80,3 +79,3 @@ fetch(fields: string | string[]): ISearchForm;

*/
query(query: string | IPredicate | IPredicate[]): ISearchForm;
query(query: string | string[]): ISearchForm;
/**

@@ -172,3 +171,3 @@ * Sets a page size to query for this SearchForm. This is an optional method.

getQuickRoutes(callback: (err: Error, data: any, xhr: any) => void): Promise<any>;
query(q: string | IPredicate | IPredicate[], optionsOrCallback: object | ((err: Error | null, response?: any) => void), cb: (err: Error | null, response?: any) => void): Promise<IApiResponse>;
query(q: string | string[], optionsOrCallback: object | ((err: Error | null, response?: any) => void), cb: (err: Error | null, response?: any) => void): Promise<IApiResponse>;
}

@@ -247,3 +246,3 @@ export declare class Api implements IApi {

*/
query(q: string | IPredicate | IPredicate[], optionsOrCallback: object | ((err: Error | null, response?: any) => void), cb: (err: Error | null, response?: any) => void): Promise<IApiResponse>;
query(q: string | string[], optionsOrCallback: object | ((err: Error | null, response?: any) => void), cb: (err: Error | null, response?: any) => void): Promise<IApiResponse>;
/**

@@ -255,3 +254,3 @@ * Retrieve the document returned by the given query

*/
queryFirst(q: string | IPredicate[] | IPredicate, optionsOrCallback: object | ((err: Error | null, response?: any) => void), cb: (err: Error | null, response?: any) => void): Promise<any>;
queryFirst(q: string | string[], optionsOrCallback: object | ((err: Error | null, response?: any) => void), cb: (err: Error | null, response?: any) => void): Promise<any>;
/**

@@ -258,0 +257,0 @@ * Retrieve the document with the given id

@@ -1,262 +0,88 @@

export interface IPredicate {
op: Operator;
toString(): string;
}
export declare enum Operator {
at = 0,
not = 1,
missing = 2,
has = 3,
any = 4,
in = 5,
fulltext = 6,
similar = 7,
"number.gt" = 8,
"number.lt" = 9,
"number.inRange" = 10,
"date.before" = 11,
"date.after" = 12,
"date.between" = 13,
"date.day-of-month" = 14,
"date.day-of-month-after" = 15,
"date.day-of-month-before" = 16,
"date.day-of-week" = 17,
"date.day-of-week-after" = 18,
"date.day-of-week-before" = 19,
"date.month" = 20,
"date.month-before" = 21,
"date.month-after" = 22,
"date.year" = 23,
"date.hour" = 24,
"date.hour-before" = 25,
"date.hour-after" = 26,
"geopoint.near" = 27,
}
export declare class AtPredicate implements IPredicate {
fragment: string;
value: string;
op: Operator;
constructor(fragment: string, value: string);
toString(): string;
}
export declare class NotPredicate implements IPredicate {
fragment: string;
value: string;
op: Operator;
constructor(fragment: string, value: string);
toString(): string;
}
export declare class MissingPredicate implements IPredicate {
fragment: string;
op: Operator;
constructor(fragment: string);
toString(): string;
}
export declare class HasPredicate implements IPredicate {
fragment: string;
op: Operator;
constructor(fragment: string);
toString(): string;
}
export declare class AnyPredicate implements IPredicate {
fragment: string;
values: string[];
op: Operator;
constructor(fragment: string, values: string[]);
toString(): string;
}
export declare class InPredicate implements IPredicate {
fragment: string;
values: string[];
op: Operator;
constructor(fragment: string, values: string[]);
toString(): string;
}
export declare class FulltextPredicate implements IPredicate {
fragment: string;
value: string;
op: Operator;
constructor(fragment: string, value: string);
toString(): string;
}
export declare class SimilarPredicate implements IPredicate {
documentId: string;
maxResults: number;
op: Operator;
constructor(documentId: string, maxResults: number);
toString(): string;
}
export declare class GtPredicate implements IPredicate {
fragment: string;
value: number;
op: Operator;
constructor(fragment: string, value: number);
toString(): string;
}
export declare class LtPredicate implements IPredicate {
fragment: string;
value: number;
op: Operator;
constructor(fragment: string, value: number);
toString(): string;
}
export declare class InRangePredicate implements IPredicate {
fragment: string;
before: number;
after: number;
op: Operator;
constructor(fragment: string, before: number, after: number);
toString(): string;
}
export declare class DateBeforePredicate implements IPredicate {
fragment: string;
before: Date;
op: Operator;
constructor(fragment: string, before: Date);
toString(): string;
}
export declare class DateAfterPredicate implements IPredicate {
fragment: string;
after: Date;
op: Operator;
constructor(fragment: string, after: Date);
toString(): string;
}
export declare class DateBetweenPredicate implements IPredicate {
fragment: string;
before: Date;
after: Date;
op: Operator;
constructor(fragment: string, before: Date, after: Date);
toString(): string;
}
export declare class DayOfMonthPredicate implements IPredicate {
fragment: string;
day: number;
op: Operator;
constructor(fragment: string, day: number);
toString(): string;
}
export declare class DayOfMonthAfterPredicate implements IPredicate {
fragment: string;
day: number;
op: Operator;
constructor(fragment: string, day: number);
toString(): string;
}
export declare class DayOfMonthBeforePredicate implements IPredicate {
fragment: string;
day: number;
op: Operator;
constructor(fragment: string, day: number);
toString(): string;
}
export declare class DayOfWeekPredicate implements IPredicate {
fragment: string;
day: number;
op: Operator;
constructor(fragment: string, day: number);
toString(): string;
}
export declare class DayOfWeekAfterPredicate implements IPredicate {
fragment: string;
day: number;
op: Operator;
constructor(fragment: string, day: number);
toString(): string;
}
export declare class DayOfWeekBeforePredicate implements IPredicate {
fragment: string;
day: number;
op: Operator;
constructor(fragment: string, day: number);
toString(): string;
}
export declare class MonthPredicate implements IPredicate {
fragment: string;
month: number | string;
op: Operator;
constructor(fragment: string, month: number | string);
toString(): string;
}
export declare class MonthBeforePredicate implements IPredicate {
fragment: string;
month: number | string;
op: Operator;
constructor(fragment: string, month: number | string);
toString(): string;
}
export declare class MonthAfterPredicate implements IPredicate {
fragment: string;
month: number | string;
op: Operator;
constructor(fragment: string, month: number | string);
toString(): string;
}
export declare class YearPredicate implements IPredicate {
fragment: string;
year: number;
op: Operator;
constructor(fragment: string, year: number);
toString(): string;
}
export declare class HourPredicate implements IPredicate {
fragment: string;
hour: number;
op: Operator;
constructor(fragment: string, hour: number);
toString(): string;
}
export declare class HourBeforePredicate implements IPredicate {
fragment: string;
hour: number;
op: Operator;
constructor(fragment: string, hour: number);
toString(): string;
}
export declare class HourAfterPredicate implements IPredicate {
fragment: string;
hour: number;
op: Operator;
constructor(fragment: string, hour: number);
toString(): string;
}
export declare class NearPredicate implements IPredicate {
fragment: string;
latitude: number;
longitude: number;
radius: number;
op: Operator;
constructor(fragment: string, latitude: number, longitude: number, radius: number);
toString(): string;
}
export declare const Operator: {
at: string;
not: string;
missing: string;
has: string;
any: string;
in: string;
fulltext: string;
similar: string;
"number.gt": string;
"number.lt": string;
"number.inRange": string;
"date.before": string;
"date.after": string;
"date.between": string;
"date.day-of-month": string;
"date.day-of-month-after": string;
"date.day-of-month-before": string;
"date.day-of-week": string;
"date.day-of-week-after": string;
"date.day-of-week-before": string;
"date.month": string;
"date.month-before": string;
"date.month-after": string;
"date.year": string;
"date.hour": string;
"date.hour-before": string;
"date.hour-after": string;
"geopoint.near": string;
};
export declare function AtPredicate(fragment: string, value: string): string;
export declare function NotPredicate(fragment: string, value: string): string;
export declare function MissingPredicate(fragment: string): string;
export declare function HasPredicate(fragment: string): string;
export declare function AnyPredicate(fragment: string, values: string[]): string;
export declare function InPredicate(fragment: string, values: string[]): string;
export declare function FulltextPredicate(fragment: string, value: string): string;
export declare function SimilarPredicate(documentId: string, maxResults: number): string;
export declare function GtPredicate(fragment: string, value: number): string;
export declare function LtPredicate(fragment: string, value: number): string;
export declare function InRangePredicate(fragment: string, before: number, after: number): string;
export declare function DateBeforePredicate(fragment: string, before: Date): string;
export declare function DateAfterPredicate(fragment: string, after: Date): string;
export declare function DateBetweenPredicate(fragment: string, before: Date, after: Date): string;
export declare function DayOfMonthPredicate(fragment: string, day: number): string;
export declare function DayOfMonthAfterPredicate(fragment: string, day: number): string;
export declare function DayOfMonthBeforePredicate(fragment: string, day: number): string;
export declare function DayOfWeekPredicate(fragment: string, day: number): string;
export declare function DayOfWeekAfterPredicate(fragment: string, day: number): string;
export declare function DayOfWeekBeforePredicate(fragment: string, day: number): string;
export declare function MonthPredicate(fragment: string, month: number | string): string;
export declare function MonthBeforePredicate(fragment: string, month: number | string): string;
export declare function MonthAfterPredicate(fragment: string, month: number | string): string;
export declare function YearPredicate(fragment: string, year: number): string;
export declare function HourPredicate(fragment: string, hour: number): string;
export declare function HourBeforePredicate(fragment: string, hour: number): string;
export declare function HourAfterPredicate(fragment: string, hour: number): string;
export declare function NearPredicate(fragment: string, latitude: number, longitude: number, radius: number): string;
export declare const Predicates: {
at: typeof AtPredicate;
not: typeof NotPredicate;
missing: typeof MissingPredicate;
has: typeof HasPredicate;
any: typeof AnyPredicate;
in: typeof InPredicate;
fulltext: typeof FulltextPredicate;
similar: typeof SimilarPredicate;
gt: typeof GtPredicate;
lt: typeof LtPredicate;
inRange: typeof InRangePredicate;
before: typeof DateBeforePredicate;
after: typeof DateAfterPredicate;
between: typeof DateBetweenPredicate;
dayOfMonth: typeof DayOfMonthPredicate;
dayOfMonthAfter: typeof DayOfMonthAfterPredicate;
dayOfMonthBefore: typeof DayOfMonthBeforePredicate;
dayOfWeek: typeof DayOfWeekPredicate;
dayOfWeekAfter: typeof DayOfWeekAfterPredicate;
dayOfWeekBefore: typeof DayOfWeekBeforePredicate;
month: typeof MonthPredicate;
monthBefore: typeof MonthBeforePredicate;
monthAfter: typeof MonthAfterPredicate;
year: typeof YearPredicate;
hour: typeof HourPredicate;
hourBefore: typeof HourBeforePredicate;
hourAfter: typeof HourAfterPredicate;
near: typeof NearPredicate;
at: (fragment: string, value: string) => string;
not: (fragment: string, value: string) => string;
missing: (fragment: string) => string;
has: (fragment: string) => string;
any: (fragment: string, values: string[]) => string;
in: (fragment: string, values: string[]) => string;
fulltext: (fragment: string, value: string) => string;
similar: (documentId: string, maxResults: number) => string;
gt: (fragment: string, value: number) => string;
lt: (fragment: string, value: number) => string;
inRange: (fragment: string, before: number, after: number) => string;
before: (fragment: string, before: Date) => string;
after: (fragment: string, after: Date) => string;
between: (fragment: string, before: Date, after: Date) => string;
dayOfMonth: (fragment: string, day: number) => string;
dayOfMonthAfter: (fragment: string, day: number) => string;
dayOfMonthBefore: (fragment: string, day: number) => string;
dayOfWeek: (fragment: string, day: number) => string;
dayOfWeekAfter: (fragment: string, day: number) => string;
dayOfWeekBefore: (fragment: string, day: number) => string;
month: (fragment: string, month: string | number) => string;
monthBefore: (fragment: string, month: string | number) => string;
monthAfter: (fragment: string, month: string | number) => string;
year: (fragment: string, year: number) => string;
hour: (fragment: string, hour: number) => string;
hourBefore: (fragment: string, hour: number) => string;
hourAfter: (fragment: string, hour: number) => string;
near: (fragment: string, latitude: number, longitude: number, radius: number) => string;
};

@@ -162,385 +162,158 @@ (function webpackUniversalModuleDefinition(root, factory) {

exports.__esModule = true;
var Operator;
(function (Operator) {
Operator[Operator["at"] = 0] = "at";
Operator[Operator["not"] = 1] = "not";
Operator[Operator["missing"] = 2] = "missing";
Operator[Operator["has"] = 3] = "has";
Operator[Operator["any"] = 4] = "any";
Operator[Operator["in"] = 5] = "in";
Operator[Operator["fulltext"] = 6] = "fulltext";
Operator[Operator["similar"] = 7] = "similar";
Operator[Operator["number.gt"] = 8] = "number.gt";
Operator[Operator["number.lt"] = 9] = "number.lt";
Operator[Operator["number.inRange"] = 10] = "number.inRange";
Operator[Operator["date.before"] = 11] = "date.before";
Operator[Operator["date.after"] = 12] = "date.after";
Operator[Operator["date.between"] = 13] = "date.between";
Operator[Operator["date.day-of-month"] = 14] = "date.day-of-month";
Operator[Operator["date.day-of-month-after"] = 15] = "date.day-of-month-after";
Operator[Operator["date.day-of-month-before"] = 16] = "date.day-of-month-before";
Operator[Operator["date.day-of-week"] = 17] = "date.day-of-week";
Operator[Operator["date.day-of-week-after"] = 18] = "date.day-of-week-after";
Operator[Operator["date.day-of-week-before"] = 19] = "date.day-of-week-before";
Operator[Operator["date.month"] = 20] = "date.month";
Operator[Operator["date.month-before"] = 21] = "date.month-before";
Operator[Operator["date.month-after"] = 22] = "date.month-after";
Operator[Operator["date.year"] = 23] = "date.year";
Operator[Operator["date.hour"] = 24] = "date.hour";
Operator[Operator["date.hour-before"] = 25] = "date.hour-before";
Operator[Operator["date.hour-after"] = 26] = "date.hour-after";
Operator[Operator["geopoint.near"] = 27] = "geopoint.near";
})(Operator = exports.Operator || (exports.Operator = {}));
var AtPredicate = (function () {
function AtPredicate(fragment, value) {
this.op = Operator.at;
this.fragment = fragment;
this.value = value;
}
AtPredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", \"" + this.value + "\")]";
};
return AtPredicate;
}());
exports.Operator = {
at: "at",
not: "not",
missing: "missing",
has: "has",
any: "any",
"in": "in",
fulltext: "fulltext",
similar: "similar",
"number.gt": "number.gt",
"number.lt": "number.lt",
"number.inRange": "number.inRange",
"date.before": "date.before",
"date.after": "date.after",
"date.between": "date.between",
"date.day-of-month": "date.day-of-month",
"date.day-of-month-after": "date.day-of-month-after",
"date.day-of-month-before": "date.day-of-month-before",
"date.day-of-week": "date.day-of-week",
"date.day-of-week-after": "date.day-of-week-after",
"date.day-of-week-before": "date.day-of-week-before",
"date.month": "date.month",
"date.month-before": "date.month-before",
"date.month-after": "date.month-after",
"date.year": "date.year",
"date.hour": "date.hour",
"date.hour-before": "date.hour-before",
"date.hour-after": "date.hour-after",
"geopoint.near": "geopoint.near"
};
function AtPredicate(fragment, value) {
return "[:d = " + exports.Operator.at + "(" + fragment + ", \"" + value + "\")]";
}
exports.AtPredicate = AtPredicate;
var NotPredicate = (function () {
function NotPredicate(fragment, value) {
this.op = Operator.not;
this.fragment = fragment;
this.value = value;
}
NotPredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", \"" + this.value + "\")]";
};
return NotPredicate;
}());
function NotPredicate(fragment, value) {
return "[:d = " + exports.Operator.not + "(" + fragment + ", \"" + value + "\")]";
}
exports.NotPredicate = NotPredicate;
var MissingPredicate = (function () {
function MissingPredicate(fragment) {
this.op = Operator.missing;
this.fragment = fragment;
}
MissingPredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ")]";
};
return MissingPredicate;
}());
function MissingPredicate(fragment) {
return "[:d = " + exports.Operator.missing + "(" + fragment + ")]";
}
exports.MissingPredicate = MissingPredicate;
var HasPredicate = (function () {
function HasPredicate(fragment) {
this.op = Operator.has;
this.fragment = fragment;
}
HasPredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ")]";
};
return HasPredicate;
}());
function HasPredicate(fragment) {
return "[:d = " + exports.Operator.has + "(" + fragment + ")]";
}
exports.HasPredicate = HasPredicate;
var AnyPredicate = (function () {
function AnyPredicate(fragment, values) {
this.op = Operator.any;
this.fragment = fragment;
this.values = values;
}
AnyPredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", [" + this.values.join(',') + "])]";
};
return AnyPredicate;
}());
function AnyPredicate(fragment, values) {
return "[:d = " + exports.Operator.any + "(" + fragment + ", [" + values.join(',') + "])]";
}
exports.AnyPredicate = AnyPredicate;
var InPredicate = (function () {
function InPredicate(fragment, values) {
this.op = Operator["in"];
this.fragment = fragment;
this.values = values;
}
InPredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", [" + this.values.join(',') + "])]";
};
return InPredicate;
}());
function InPredicate(fragment, values) {
return "[:d = " + exports.Operator["in"] + "(" + fragment + ", [" + values.join(',') + "])]";
}
exports.InPredicate = InPredicate;
var FulltextPredicate = (function () {
function FulltextPredicate(fragment, value) {
this.op = Operator.fulltext;
this.fragment = fragment;
this.value = value;
}
FulltextPredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", \"" + this.value + "\")]";
};
return FulltextPredicate;
}());
function FulltextPredicate(fragment, value) {
return "[:d = " + exports.Operator.fulltext + "(" + fragment + ", \"" + value + "\")]";
}
exports.FulltextPredicate = FulltextPredicate;
var SimilarPredicate = (function () {
function SimilarPredicate(documentId, maxResults) {
this.op = Operator.similar;
this.documentId = documentId;
this.maxResults = maxResults;
}
SimilarPredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(\"" + this.documentId + "\", " + this.maxResults + ")]";
};
return SimilarPredicate;
}());
function SimilarPredicate(documentId, maxResults) {
return "[:d = " + exports.Operator.similar + "(\"" + this.documentId + "\", " + this.maxResults + ")]";
}
exports.SimilarPredicate = SimilarPredicate;
var GtPredicate = (function () {
function GtPredicate(fragment, value) {
this.op = Operator["number.gt"];
this.fragment = fragment;
this.value = value;
}
GtPredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", " + this.value + ")]";
};
return GtPredicate;
}());
function GtPredicate(fragment, value) {
return "[:d = " + exports.Operator["number.gt"] + "(" + fragment + ", " + value + ")]";
}
exports.GtPredicate = GtPredicate;
var LtPredicate = (function () {
function LtPredicate(fragment, value) {
this.op = Operator["number.lt"];
this.fragment = fragment;
this.value = value;
}
LtPredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", " + this.value + ")]";
};
return LtPredicate;
}());
function LtPredicate(fragment, value) {
return "[:d = " + exports.Operator["number.lt"] + "(" + fragment + ", " + value + ")]";
}
exports.LtPredicate = LtPredicate;
var InRangePredicate = (function () {
function InRangePredicate(fragment, before, after) {
this.op = Operator["number.inRange"];
this.fragment = fragment;
this.before = before;
this.after = after;
}
InRangePredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", " + this.before + ", " + this.after + ")]";
};
return InRangePredicate;
}());
function InRangePredicate(fragment, before, after) {
return "[:d = " + exports.Operator["number.inRange"] + "(" + fragment + ", " + this.before + ", " + this.after + ")]";
}
exports.InRangePredicate = InRangePredicate;
var DateBeforePredicate = (function () {
function DateBeforePredicate(fragment, before) {
this.op = Operator["date.before"];
this.fragment = fragment;
this.before = before;
}
DateBeforePredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", " + this.before.getTime() + ")]";
};
return DateBeforePredicate;
}());
function DateBeforePredicate(fragment, before) {
return "[:d = " + exports.Operator["date.before"] + "(" + fragment + ", " + this.before.getTime() + ")]";
}
exports.DateBeforePredicate = DateBeforePredicate;
var DateAfterPredicate = (function () {
function DateAfterPredicate(fragment, after) {
this.op = Operator["date.after"];
this.fragment = fragment;
this.after = after;
}
DateAfterPredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", " + this.after.getTime() + ")]";
};
return DateAfterPredicate;
}());
function DateAfterPredicate(fragment, after) {
return "[:d = " + exports.Operator["date.after"] + "(" + fragment + ", " + this.after.getTime() + ")]";
}
exports.DateAfterPredicate = DateAfterPredicate;
var DateBetweenPredicate = (function () {
function DateBetweenPredicate(fragment, before, after) {
this.op = Operator["date.between"];
this.fragment = fragment;
this.before = before;
this.after = after;
}
DateBetweenPredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", " + this.before.getTime() + ", " + this.after.getTime() + ")]";
};
return DateBetweenPredicate;
}());
function DateBetweenPredicate(fragment, before, after) {
return "[:d = " + exports.Operator["date.between"] + "(" + fragment + ", " + this.before.getTime() + ", " + this.after.getTime() + ")]";
}
exports.DateBetweenPredicate = DateBetweenPredicate;
var DayOfMonthPredicate = (function () {
function DayOfMonthPredicate(fragment, day) {
this.op = Operator["date.day-of-month"];
this.fragment = fragment;
this.day = day;
}
DayOfMonthPredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", " + this.day + ")]";
};
return DayOfMonthPredicate;
}());
function DayOfMonthPredicate(fragment, day) {
return "[:d = " + exports.Operator["date.day-of-month"] + "(" + fragment + ", " + this.day + ")]";
}
exports.DayOfMonthPredicate = DayOfMonthPredicate;
var DayOfMonthAfterPredicate = (function () {
function DayOfMonthAfterPredicate(fragment, day) {
this.op = Operator["date.day-of-month-after"];
this.fragment = fragment;
this.day = day;
}
DayOfMonthAfterPredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", " + this.day + ")]";
};
return DayOfMonthAfterPredicate;
}());
function DayOfMonthAfterPredicate(fragment, day) {
return "[:d = " + exports.Operator["date.day-of-month-after"] + "(" + fragment + ", " + this.day + ")]";
}
exports.DayOfMonthAfterPredicate = DayOfMonthAfterPredicate;
var DayOfMonthBeforePredicate = (function () {
function DayOfMonthBeforePredicate(fragment, day) {
this.op = Operator["date.day-of-month-before"];
this.fragment = fragment;
this.day = day;
}
DayOfMonthBeforePredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", " + this.day + ")]";
};
return DayOfMonthBeforePredicate;
}());
function DayOfMonthBeforePredicate(fragment, day) {
return "[:d = " + exports.Operator["date.day-of-month-before"] + "(" + fragment + ", " + this.day + ")]";
}
exports.DayOfMonthBeforePredicate = DayOfMonthBeforePredicate;
var DayOfWeekPredicate = (function () {
function DayOfWeekPredicate(fragment, day) {
this.op = Operator["date.day-of-week"];
this.fragment = fragment;
this.day = day;
}
DayOfWeekPredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", " + this.day + ")]";
};
return DayOfWeekPredicate;
}());
function DayOfWeekPredicate(fragment, day) {
return "[:d = " + exports.Operator["date.day-of-week"] + "(" + fragment + ", " + this.day + ")]";
}
exports.DayOfWeekPredicate = DayOfWeekPredicate;
var DayOfWeekAfterPredicate = (function () {
function DayOfWeekAfterPredicate(fragment, day) {
this.op = Operator["date.day-of-week-after"];
this.fragment = fragment;
this.day = day;
}
DayOfWeekAfterPredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", " + this.day + ")]";
};
return DayOfWeekAfterPredicate;
}());
function DayOfWeekAfterPredicate(fragment, day) {
return "[:d = " + exports.Operator["date.day-of-week-after"] + "(" + fragment + ", " + this.day + ")]";
}
exports.DayOfWeekAfterPredicate = DayOfWeekAfterPredicate;
var DayOfWeekBeforePredicate = (function () {
function DayOfWeekBeforePredicate(fragment, day) {
this.op = Operator["date.day-of-week-before"];
this.fragment = fragment;
this.day = day;
}
DayOfWeekBeforePredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", " + this.day + ")]";
};
return DayOfWeekBeforePredicate;
}());
function DayOfWeekBeforePredicate(fragment, day) {
return "[:d = " + exports.Operator["date.day-of-week-before"] + "(" + fragment + ", " + this.day + ")]";
}
exports.DayOfWeekBeforePredicate = DayOfWeekBeforePredicate;
var MonthPredicate = (function () {
function MonthPredicate(fragment, month) {
this.op = Operator["date.month"];
this.fragment = fragment;
this.month = month;
function MonthPredicate(fragment, month) {
if (typeof this.month === 'number') {
return "[:d = " + exports.Operator["date.month"] + "(" + fragment + ", " + this.month + ")]";
}
MonthPredicate.prototype.toString = function () {
if (typeof this.month === 'number') {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", " + this.month + ")]";
}
else {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", \"" + this.month + "\")]";
}
};
return MonthPredicate;
}());
else {
return "[:d = " + exports.Operator["date.month"] + "(" + fragment + ", \"" + this.month + "\")]";
}
}
exports.MonthPredicate = MonthPredicate;
var MonthBeforePredicate = (function () {
function MonthBeforePredicate(fragment, month) {
this.op = Operator["date.month-before"];
this.fragment = fragment;
this.month = month;
function MonthBeforePredicate(fragment, month) {
if (typeof this.month === 'number') {
return "[:d = " + exports.Operator["date.month-before"] + "(" + fragment + ", " + this.month + ")]";
}
MonthBeforePredicate.prototype.toString = function () {
if (typeof this.month === 'number') {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", " + this.month + ")]";
}
else {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", \"" + this.month + "\")]";
}
};
return MonthBeforePredicate;
}());
else {
return "[:d = " + exports.Operator["date.month-before"] + "(" + fragment + ", \"" + this.month + "\")]";
}
}
exports.MonthBeforePredicate = MonthBeforePredicate;
var MonthAfterPredicate = (function () {
function MonthAfterPredicate(fragment, month) {
this.op = Operator["date.month-after"];
this.fragment = fragment;
this.month = month;
function MonthAfterPredicate(fragment, month) {
if (typeof this.month === 'number') {
return "[:d = " + exports.Operator["date.month-after"] + "(" + fragment + ", " + this.month + ")]";
}
MonthAfterPredicate.prototype.toString = function () {
if (typeof this.month === 'number') {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", " + this.month + ")]";
}
else {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", \"" + this.month + "\")]";
}
};
return MonthAfterPredicate;
}());
else {
return "[:d = " + exports.Operator["date.month-after"] + "(" + fragment + ", \"" + this.month + "\")]";
}
}
exports.MonthAfterPredicate = MonthAfterPredicate;
var YearPredicate = (function () {
function YearPredicate(fragment, year) {
this.op = Operator["date.year"];
this.fragment = fragment;
this.year = year;
}
YearPredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", " + this.year + ")]";
};
return YearPredicate;
}());
function YearPredicate(fragment, year) {
return "[:d = " + exports.Operator["date.year"] + "(" + fragment + ", " + this.year + ")]";
}
exports.YearPredicate = YearPredicate;
var HourPredicate = (function () {
function HourPredicate(fragment, hour) {
this.op = Operator["date.hour"];
this.fragment = fragment;
this.hour = hour;
}
HourPredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", " + this.hour + ")]";
};
return HourPredicate;
}());
function HourPredicate(fragment, hour) {
return "[:d = " + exports.Operator["date.hour"] + "(" + fragment + ", " + this.hour + ")]";
}
exports.HourPredicate = HourPredicate;
var HourBeforePredicate = (function () {
function HourBeforePredicate(fragment, hour) {
this.op = Operator["date.hour-before"];
this.fragment = fragment;
this.hour = hour;
}
HourBeforePredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", " + this.hour + ")]";
};
return HourBeforePredicate;
}());
function HourBeforePredicate(fragment, hour) {
return "[:d = " + exports.Operator["date.hour-before"] + "(" + fragment + ", " + this.hour + ")]";
}
exports.HourBeforePredicate = HourBeforePredicate;
var HourAfterPredicate = (function () {
function HourAfterPredicate(fragment, hour) {
this.op = Operator["date.hour-after"];
this.fragment = fragment;
this.hour = hour;
}
HourAfterPredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", " + this.hour + ")]";
};
return HourAfterPredicate;
}());
function HourAfterPredicate(fragment, hour) {
return "[:d = " + exports.Operator["date.hour-after"] + "(" + fragment + ", " + this.hour + ")]";
}
exports.HourAfterPredicate = HourAfterPredicate;
var NearPredicate = (function () {
function NearPredicate(fragment, latitude, longitude, radius) {
this.op = Operator["geopoint.near"];
this.fragment = fragment;
this.latitude = latitude;
this.longitude = longitude;
this.radius = radius;
}
NearPredicate.prototype.toString = function () {
return "[:d = " + Operator[this.op] + "(" + this.fragment + ", " + this.latitude + ", " + this.longitude + ", " + this.radius + ")]";
};
return NearPredicate;
}());
function NearPredicate(fragment, latitude, longitude, radius) {
return "[:d = " + exports.Operator["geopoint.near"] + "(" + fragment + ", " + this.latitude + ", " + this.longitude + ", " + this.radius + ")]";
}
exports.NearPredicate = NearPredicate;

@@ -720,12 +493,9 @@ exports.Predicates = {

if (typeof query === 'string') {
return this.set("q", query);
return this.query([query]);
}
else if (query instanceof Array) {
var predicates = query.map(function (predicate) {
return predicate.toString();
});
return this.query("[" + predicates.join("") + "]");
return this.set("q", ("[" + query.join("") + "]"));
}
else {
return this.query([query]);
throw new Error("Invalid query : " + query);
}

@@ -1078,3 +848,3 @@ };

options.lang = '*';
return this.queryFirst(new predicates_1.Predicates.at('document.id', id), options, callback);
return this.queryFirst(predicates_1.Predicates.at('document.id', id), options, callback);
};

@@ -1088,3 +858,3 @@ /**

options.lang = '*';
return this.query(new predicates_1.Predicates["in"]('document.id', ids), options, callback);
return this.query(predicates_1.Predicates["in"]('document.id', ids), options, callback);
};

@@ -1098,3 +868,3 @@ /**

options.lang = '*';
return this.queryFirst(new predicates_1.Predicates.at("my." + type + ".uid", uid), options, callback);
return this.queryFirst(predicates_1.Predicates.at("my." + type + ".uid", uid), options, callback);
};

@@ -1105,3 +875,3 @@ /**

Api.prototype.getSingle = function (type, options, callback) {
return this.queryFirst(new predicates_1.Predicates.at('document.type', type), options, callback);
return this.queryFirst(predicates_1.Predicates.at('document.type', type), options, callback);
};

@@ -1154,3 +924,3 @@ /**

else {
api.everything().query(new predicates_1.Predicates.at("document.id", mainDocumentId)).ref(token).lang('*').submit(function (err, response) {
api.everything().query(predicates_1.Predicates.at("document.id", mainDocumentId)).ref(token).lang('*').submit(function (err, response) {
if (err) {

@@ -1157,0 +927,0 @@ cb(err);

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("fetch-everywhere")):"function"==typeof define&&define.amd?define("PrismicJS",["fetch-everywhere"],e):"object"==typeof exports?exports.PrismicJS=e(require("fetch-everywhere")):t.PrismicJS=e(t["fetch-everywhere"])}(this,function(t){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=10)}([function(t,e,r){"use strict";e.__esModule=!0;var n=function(){function t(t){this.data={},this.data=t}return t.prototype.id=function(){return this.data.id},t.prototype.ref=function(){return this.data.ref},t.prototype.label=function(){return this.data.label},t}();e.Variation=n;var i=function(){function t(t){this.data={},this.data=t,this.variations=(t.variations||[]).map(function(t){new n(t)})}return t.prototype.id=function(){return this.data.id},t.prototype.googleId=function(){return this.data.ref},t.prototype.name=function(){return this.data.label},t}();e.Experiment=i;var o=function(){function t(t){t&&(this.drafts=(t.drafts||[]).map(function(t){new i(t)}),this.running=(t.running||[]).map(function(t){new i(t)}))}return t.prototype.current=function(){return this.running.length>0?this.running[0]:null},t.prototype.refFromCookie=function(t){if(!t||""===t.trim())return null;var e=t.trim().split(" ");if(e.length<2)return null;var r=e[0],n=parseInt(e[1],10),i=this.running.filter(function(t){return t.googleId()==r&&t.variations.length>n})[0];return i?i.variations[n].ref():null},t}();e.Experiments=o},function(t,e,r){"use strict";e.__esModule=!0;var n;!function(t){t[t.at=0]="at",t[t.not=1]="not",t[t.missing=2]="missing",t[t.has=3]="has",t[t.any=4]="any",t[t.in=5]="in",t[t.fulltext=6]="fulltext",t[t.similar=7]="similar",t[t["number.gt"]=8]="number.gt",t[t["number.lt"]=9]="number.lt",t[t["number.inRange"]=10]="number.inRange",t[t["date.before"]=11]="date.before",t[t["date.after"]=12]="date.after",t[t["date.between"]=13]="date.between",t[t["date.day-of-month"]=14]="date.day-of-month",t[t["date.day-of-month-after"]=15]="date.day-of-month-after",t[t["date.day-of-month-before"]=16]="date.day-of-month-before",t[t["date.day-of-week"]=17]="date.day-of-week",t[t["date.day-of-week-after"]=18]="date.day-of-week-after",t[t["date.day-of-week-before"]=19]="date.day-of-week-before",t[t["date.month"]=20]="date.month",t[t["date.month-before"]=21]="date.month-before",t[t["date.month-after"]=22]="date.month-after",t[t["date.year"]=23]="date.year",t[t["date.hour"]=24]="date.hour",t[t["date.hour-before"]=25]="date.hour-before",t[t["date.hour-after"]=26]="date.hour-after",t[t["geopoint.near"]=27]="geopoint.near"}(n=e.Operator||(e.Operator={}));var i=function(){function t(t,e){this.op=n.at,this.fragment=t,this.value=e}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+', "'+this.value+'")]'},t}();e.AtPredicate=i;var o=function(){function t(t,e){this.op=n.not,this.fragment=t,this.value=e}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+', "'+this.value+'")]'},t}();e.NotPredicate=o;var s=function(){function t(t){this.op=n.missing,this.fragment=t}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+")]"},t}();e.MissingPredicate=s;var a=function(){function t(t){this.op=n.has,this.fragment=t}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+")]"},t}();e.HasPredicate=a;var u=function(){function t(t,e){this.op=n.any,this.fragment=t,this.values=e}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+", ["+this.values.join(",")+"])]"},t}();e.AnyPredicate=u;var f=function(){function t(t,e){this.op=n.in,this.fragment=t,this.values=e}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+", ["+this.values.join(",")+"])]"},t}();e.InPredicate=f;var h=function(){function t(t,e){this.op=n.fulltext,this.fragment=t,this.value=e}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+', "'+this.value+'")]'},t}();e.FulltextPredicate=h;var c=function(){function t(t,e){this.op=n.similar,this.documentId=t,this.maxResults=e}return t.prototype.toString=function(){return"[:d = "+n[this.op]+'("'+this.documentId+'", '+this.maxResults+")]"},t}();e.SimilarPredicate=c;var p=function(){function t(t,e){this.op=n["number.gt"],this.fragment=t,this.value=e}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+", "+this.value+")]"},t}();e.GtPredicate=p;var d=function(){function t(t,e){this.op=n["number.lt"],this.fragment=t,this.value=e}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+", "+this.value+")]"},t}();e.LtPredicate=d;var l=function(){function t(t,e,r){this.op=n["number.inRange"],this.fragment=t,this.before=e,this.after=r}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+", "+this.before+", "+this.after+")]"},t}();e.InRangePredicate=l;var m=function(){function t(t,e){this.op=n["date.before"],this.fragment=t,this.before=e}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+", "+this.before.getTime()+")]"},t}();e.DateBeforePredicate=m;var y=function(){function t(t,e){this.op=n["date.after"],this.fragment=t,this.after=e}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+", "+this.after.getTime()+")]"},t}();e.DateAfterPredicate=y;var g=function(){function t(t,e,r){this.op=n["date.between"],this.fragment=t,this.before=e,this.after=r}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+", "+this.before.getTime()+", "+this.after.getTime()+")]"},t}();e.DateBetweenPredicate=g;var v=function(){function t(t,e){this.op=n["date.day-of-month"],this.fragment=t,this.day=e}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+", "+this.day+")]"},t}();e.DayOfMonthPredicate=v;var k=function(){function t(t,e){this.op=n["date.day-of-month-after"],this.fragment=t,this.day=e}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+", "+this.day+")]"},t}();e.DayOfMonthAfterPredicate=k;var w=function(){function t(t,e){this.op=n["date.day-of-month-before"],this.fragment=t,this.day=e}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+", "+this.day+")]"},t}();e.DayOfMonthBeforePredicate=w;var b=function(){function t(t,e){this.op=n["date.day-of-week"],this.fragment=t,this.day=e}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+", "+this.day+")]"},t}();e.DayOfWeekPredicate=b;var P=function(){function t(t,e){this.op=n["date.day-of-week-after"],this.fragment=t,this.day=e}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+", "+this.day+")]"},t}();e.DayOfWeekAfterPredicate=P;var x=function(){function t(t,e){this.op=n["date.day-of-week-before"],this.fragment=t,this.day=e}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+", "+this.day+")]"},t}();e.DayOfWeekBeforePredicate=x;var _=function(){function t(t,e){this.op=n["date.month"],this.fragment=t,this.month=e}return t.prototype.toString=function(){return"number"==typeof this.month?"[:d = "+n[this.op]+"("+this.fragment+", "+this.month+")]":"[:d = "+n[this.op]+"("+this.fragment+', "'+this.month+'")]'},t}();e.MonthPredicate=_;var S=function(){function t(t,e){this.op=n["date.month-before"],this.fragment=t,this.month=e}return t.prototype.toString=function(){return"number"==typeof this.month?"[:d = "+n[this.op]+"("+this.fragment+", "+this.month+")]":"[:d = "+n[this.op]+"("+this.fragment+', "'+this.month+'")]'},t}();e.MonthBeforePredicate=S;var q=function(){function t(t,e){this.op=n["date.month-after"],this.fragment=t,this.month=e}return t.prototype.toString=function(){return"number"==typeof this.month?"[:d = "+n[this.op]+"("+this.fragment+", "+this.month+")]":"[:d = "+n[this.op]+"("+this.fragment+', "'+this.month+'")]'},t}();e.MonthAfterPredicate=q;var D=function(){function t(t,e){this.op=n["date.year"],this.fragment=t,this.year=e}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+", "+this.year+")]"},t}();e.YearPredicate=D;var M=function(){function t(t,e){this.op=n["date.hour"],this.fragment=t,this.hour=e}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+", "+this.hour+")]"},t}();e.HourPredicate=M;var A=function(){function t(t,e){this.op=n["date.hour-before"],this.fragment=t,this.hour=e}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+", "+this.hour+")]"},t}();e.HourBeforePredicate=A;var C=function(){function t(t,e){this.op=n["date.hour-after"],this.fragment=t,this.hour=e}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+", "+this.hour+")]"},t}();e.HourAfterPredicate=C;var O=function(){function t(t,e,r,i){this.op=n["geopoint.near"],this.fragment=t,this.latitude=e,this.longitude=r,this.radius=i}return t.prototype.toString=function(){return"[:d = "+n[this.op]+"("+this.fragment+", "+this.latitude+", "+this.longitude+", "+this.radius+")]"},t}();e.NearPredicate=O,e.Predicates={at:i,not:o,missing:s,has:a,any:u,in:f,fulltext:h,similar:c,gt:p,lt:d,inRange:l,before:m,after:y,between:g,dayOfMonth:v,dayOfMonthAfter:k,dayOfMonthBefore:w,dayOfWeek:b,dayOfWeekAfter:P,dayOfWeekBefore:x,month:_,monthBefore:S,monthAfter:q,year:D,hour:M,hourBefore:A,hourAfter:C,near:O}},function(t,e,r){"use strict";function n(t,e){var r=e||{},n=new o.Api(t,r);return new Promise(function(t,e){var i=function(n,i){r.complete&&r.complete(n,i),n?e(n):t(i)};return n.get(function(t,e){!t&&e&&(n.data=e,n.bookmarks=e.bookmarks,n.experiments=new a.Experiments(e.experiments)),i(t,n)}),n})}e.__esModule=!0;var i=r(7),o=r(4),s=r(1),a=r(0);t.exports={experimentCookie:o.ExperimentCookie,previewCookie:o.PreviewCookie,Document:i.Document,SearchForm:o.SearchForm,Form:o.Form,Experiments:a.Experiments,Predicates:s.Predicates,api:n}},function(e,r){e.exports=t},function(t,e,r){"use strict";e.__esModule=!0;var n=r(1),i=r(0),o=r(9),s=r(5),a=r(6);e.PreviewCookie="io.prismic.preview",e.ExperimentCookie="io.prismic.experiment";var u=function(){function t(t,e,r,n,i){this.ref=t,this.label=e,this.isMaster=r,this.scheduledAt=n,this.id=i}return t}();e.Ref=u;var f=function(){function t(t,e,r,n,i,o){this.fields=t,this.action=e,this.name=r,this.rel=n,this.form_method=i,this.enctype=o}return t.prototype.getField=function(t){return this.fields[t]},t.prototype.getFieldSafe=function(t){var e=this.fields[t];if(!e)throw new Error("Missing field "+e+" in form fields "+this.fields);return e},t}();e.Form=f;var h=function(){function t(t,e,r){this.api=t,this.form=e,this.data=r||{};for(var n in e.fields)e.getFieldSafe(n).default&&(this.data[n]=[e.fields[n].default])}return t.prototype.set=function(t,e){var r=this.form.getField(t);if(!r)throw new Error("Unknown field "+t);var n=""===e||void 0===e?null:e,i=this.data[t]||[];return i=r.multiple?n?i.concat([n]):i:n?[n]:i,this.data[t]=i,this},t.prototype.ref=function(t){return this.set("ref",t)},t.prototype.query=function(t){if("string"==typeof t)return this.set("q",t);if(t instanceof Array){var e=t.map(function(t){return t.toString()});return this.query("["+e.join("")+"]")}return this.query([t])},t.prototype.pageSize=function(t){return this.set("pageSize",t)},t.prototype.fetch=function(t){var e=t instanceof Array?t.join(","):t;return this.set("fetch",e)},t.prototype.fetchLinks=function(t){var e=t instanceof Array?t.join(","):t;return this.set("fetchLinks",e)},t.prototype.lang=function(t){return this.set("lang",t)},t.prototype.page=function(t){return this.set("page",t)},t.prototype.orderings=function(t){return t?this.set("orderings","["+t.join(",")+"]"):this},t.prototype.submit=function(t){var e=this.form.action;if(this.data){var r=e.indexOf("?")>-1?"&":"?";for(var n in this.data)if(this.data.hasOwnProperty(n)){var i=this.data[n];if(i)for(var o=0;o<i.length;o++)e+=r+n+"="+encodeURIComponent(i[o]),r="&"}}return this.api.request(e,t)},t}();e.SearchForm=h;var c=function(){function t(t,e,r,n,i,o,s,a){this.page=t,this.results_per_page=e,this.results_size=r,this.total_results_size=n,this.total_pages=i,this.next_page=o,this.prev_page=s,this.results=a}return t}();e.ApiResponse=c;var p=function(){function t(t,e){var r=e||{};return this.accessToken=r.accessToken,this.url=t+(this.accessToken?(t.indexOf("?")>-1?"&":"?")+"access_token="+this.accessToken:""),this.req=r.req,this.apiCache=r.apiCache||new s.DefaultApiCache,this.requestHandler=r.requestHandler||new o.DefaultRequestHandler,this.apiCacheKey=this.url+(this.accessToken?"#"+this.accessToken:""),this.apiDataTTL=r.apiDataTTL||5,this}return t.prototype.get=function(t){var e=this,r=this.apiCacheKey;return new Promise(function(n,i){var o=function(e,r,o,s){t&&t(e,r,o,s),r&&n(r),e&&i(e)};e.apiCache.get(r,function(t,n){if(t||n)return void o(t,n);e.requestHandler.request(e.url,function(t,n,i,s){if(t)return void o(t,null,i,s);var a=e.parse(n);s=s||e.apiDataTTL,e.apiCache.set(r,a,s,function(t){o(t,a,i,s)})})})})},t.prototype.refresh=function(t){var e=this.apiCacheKey;return new Promise(function(r,n){var o=this,s=function(e,i,o){t&&t(e,i,o),i&&r(i),e&&n(e)};this.apiCache.remove(e,function(t){if(t)return void s(t);o.get(function(t,e){if(t)return void s(t);o.data=e,o.bookmarks=e.bookmarks,o.experiments=new i.Experiments(e.experiments),s()})})})},t.prototype.parse=function(t){var e=this,r=Object.keys(t.forms||[]).reduce(function(r,n,i){if(t.forms.hasOwnProperty(n)){var o=t.forms[n];e.accessToken&&(o.fields.access_token={},o.fields.access_token.type="string",o.fields.access_token.default=e.accessToken);var s=new f(o.fields,o.action,o.name,o.rel,o.form_method,o.enctype);return r[n]=s,r}return r},{}),n=t.refs.map(function(t){return new u(t.ref,t.label,t.isMasterRef,t.scheduledAt,t.id)})||[],i=n.filter(function(t){return!0===t.isMaster}),o=t.types,s=t.tags;if(0===i.length)throw"No master ref.";return{bookmarks:t.bookmarks||{},refs:n,forms:r,master:i[0],types:o,tags:s,experiments:t.experiments,oauthInitiate:t.oauth_initiate,oauthToken:t.oauth_token,quickRoutes:t.quickRoutes}},t.prototype.form=function(t){var e=this.data.forms[t];return e?new h(this,e,{}):null},t.prototype.everything=function(){var t=this.form("everything");if(!t)throw new Error("Missing everything form");return t},t.prototype.master=function(){return this.data.master.ref},t.prototype.ref=function(t){for(var e=0;e<this.data.refs.length;e++)if(this.data.refs[e].label==t)return this.data.refs[e].ref;return null},t.prototype.currentExperiment=function(){return this.experiments.current()},t.prototype.quickRoutesEnabled=function(){return this.data.quickRoutes.enabled},t.prototype.getQuickRoutes=function(t){var e=this;return new Promise(function(r,n){e.requestHandler.request(e.data.quickRoutes.url,function(e,i,o){t&&t(e,i,o),e&&n(e),i&&r(i)})})},t.prototype.query=function(t,r,n){var i="function"==typeof r?{options:{},callback:r}:{options:r||{},callback:n},o=i.options,s=i.callback,u=o,f=this.everything();for(var h in u)f=f.set(h,u[h]);if(!u.ref){var c="";this.req?c=this.req.headers.cookie||"":"undefined"!=typeof window&&window.document&&(c=window.document.cookie||"");var p=a.default.parse(c),d=p[e.PreviewCookie],l=this.experiments.refFromCookie(p[e.ExperimentCookie]);f=f.ref(d||l||this.master())}return t&&f.query(t),f.submit(s)},t.prototype.queryFirst=function(t,e,r){var n="function"==typeof e?{options:{},callback:e}:{options:e||{},callback:r},i=n.options,o=n.callback,s=i;return s.page=1,s.pageSize=1,this.query(t,s,function(t,e){if(o){var r=e&&e.results&&e.results[0];o(t,r)}}).then(function(t){return t&&t.results&&t.results[0]}).catch(function(t){console.log(t)})},t.prototype.getByID=function(t,e,r){return e=e||{},e.lang||(e.lang="*"),this.queryFirst(new n.Predicates.at("document.id",t),e,r)},t.prototype.getByIDs=function(t,e,r){return e=e||{},e.lang||(e.lang="*"),this.query(new n.Predicates.in("document.id",t),e,r)},t.prototype.getByUID=function(t,e,r,i){return r=r||{},r.lang||(r.lang="*"),this.queryFirst(new n.Predicates.at("my."+t+".uid",e),r,i)},t.prototype.getSingle=function(t,e,r){return this.queryFirst(new n.Predicates.at("document.type",t),e,r)},t.prototype.getBookmark=function(t,e,r){return new Promise(function(e,n){var i=this.bookmarks[t];if(i)e(i);else{var o=new Error("Error retrieving bookmarked id");r&&r(o),n(o)}}).then(function(t){return this.getByID(t,e,r)})},t.prototype.previewSession=function(t,e,r,i){var o=this;return new Promise(function(s,a){var u=function(t,e,r){i&&i(t,e,r),t?a(t):s(e)};o.requestHandler.request(t,function(i,s,a){if(i)return void u(i,r,a);try{var f=s.mainDocument;f?o.everything().query(new n.Predicates.at("document.id",f)).ref(t).lang("*").submit(function(t,n){t&&u(t);try{0===n.results.length?u(null,r,a):u(null,e(n.results[0]),a)}catch(t){u(t)}}):u(null,r,a)}catch(t){u(t,r,a)}})})},t.prototype.request=function(t,e){function r(e){o.get(i,function(r,s){if(r||s)return void e(r,n.response(s));n.requestHandler.request(t,function(t,r,s,a){if(t)return void e(t,null,s);a?o.set(i,r,a,function(t){e(t,n.response(r))}):e(null,n.response(r))})})}var n=this,i=t+(this.accessToken?"#"+this.accessToken:""),o=this.apiCache;return new Promise(function(t,n){r(function(r,i,o){e&&e(r,i,o),r&&n(r),i&&t(i)})})},t.prototype.getNextPage=function(t,e){return this.request(t+(this.accessToken?"&access_token="+this.accessToken:""),e)},t.prototype.response=function(t){return new c(t.page,t.results_per_page,t.results_size,t.total_results_size,t.total_pages,t.next_page,t.prev_page,t.results||[])},t}();e.Api=p},function(t,e,r){"use strict";e.__esModule=!0;var n=r(8),i=function(){function t(t){this.lru=n.MakeLRUCache(t)}return t.prototype.isExpired=function(t){var e=this.lru.get(t,!1);return!!e&&0!==e.expiredIn&&e.expiredIn<Date.now()},t.prototype.get=function(t,e){var r=this.lru.get(t,!1);r&&!this.isExpired(t)&&e(null,r.data),e()},t.prototype.set=function(t,e,r,n){this.lru.remove(t),this.lru.put(t,{data:e,expiredIn:r?Date.now()+1e3*r:0}),n()},t.prototype.remove=function(t,e){this.lru.remove(t),e()},t.prototype.clear=function(t){this.lru.removeAll(),t()},t}();e.DefaultApiCache=i},function(t,e,r){"use strict";function n(t,e){try{return e(t)}catch(e){return t}}function i(t,e){if("string"!=typeof t)throw new TypeError("argument str must be a string");var r={},i=e||{},s=i.decode||o;return t.split(/; */).forEach(function(t){var e=t.indexOf("=");if(!(e<0)){var i=t.substr(0,e).trim(),o=t.substr(++e,t.length).trim();'"'==o[0]&&(o=o.slice(1,-1)),void 0==r[i]&&(r[i]=n(o,s))}}),r}e.__esModule=!0;var o=decodeURIComponent;e.default={parse:i}},function(t,e,r){"use strict";e.__esModule=!0;var n=function(){function t(t,e,r,n,i,o,s,a,u,f,h,c){this.id=t,this.uid=h,this.type=e,this.href=r,this.tags=n,this.slug=i[0],this.slugs=o,this.lang=c,this.alternateLanguages=s,this.firstPublicationDate=a?new Date(a):null,this.lastPublicationDate=u?new Date(u):null,this.data=f}return t}();e.Document=n;var i=function(){function t(t){this.data=t}return t}();e.GroupDoc=i},function(t,e,r){"use strict";function n(t){return new i(t)}function i(t){this.size=0,this.limit=t,this._keymap={}}e.__esModule=!0,e.MakeLRUCache=n,i.prototype.put=function(t,e){var r={key:t,value:e};if(this._keymap[t]=r,this.tail?(this.tail.newer=r,r.older=this.tail):this.head=r,this.tail=r,this.size===this.limit)return this.shift();this.size++},i.prototype.shift=function(){var t=this.head;return t&&(this.head.newer?(this.head=this.head.newer,this.head.older=void 0):this.head=void 0,t.newer=t.older=void 0,delete this._keymap[t.key]),console.log("purging ",t.key),t},i.prototype.get=function(t,e){var r=this._keymap[t];if(void 0!==r)return r===this.tail?e?r:r.value:(r.newer&&(r===this.head&&(this.head=r.newer),r.newer.older=r.older),r.older&&(r.older.newer=r.newer),r.newer=void 0,r.older=this.tail,this.tail&&(this.tail.newer=r),this.tail=r,e?r:r.value)},i.prototype.find=function(t){return this._keymap[t]},i.prototype.set=function(t,e){var r,n=this.get(t,!0);return n?(r=n.value,n.value=e):(r=this.put(t,e))&&(r=r.value),r},i.prototype.remove=function(t){var e=this._keymap[t];if(e)return delete this._keymap[e.key],e.newer&&e.older?(e.older.newer=e.newer,e.newer.older=e.older):e.newer?(e.newer.older=void 0,this.head=e.newer):e.older?(e.older.newer=void 0,this.tail=e.older):this.head=this.tail=void 0,this.size--,e.value},i.prototype.removeAll=function(){this.head=this.tail=void 0,this.size=0,this._keymap={}},"function"==typeof Object.keys?i.prototype.keys=function(){return Object.keys(this._keymap)}:i.prototype.keys=function(){var t=[];for(var e in this._keymap)t.push(e);return t},i.prototype.forEach=function(t,e,r){var n;if(!0===e?(r=!0,e=void 0):"object"!=typeof e&&(e=this),r)for(n=this.tail;n;)t.call(e,n.key,n.value,this),n=n.older;else for(n=this.head;n;)t.call(e,n.key,n.value,this),n=n.newer},i.prototype.toString=function(){for(var t="",e=this.head;e;)t+=String(e.key)+":"+e.value,(e=e.newer)&&(t+=" < ");return t}},function(t,e,r){"use strict";function n(t,e){return{name:"prismic-request-error",message:e,status:t}}function i(t,e,r){return fetch(t,{headers:{Accept:"application/json","User-Agent":"Prismic-javascript-kit"}}).then(function(e){if(~~(e.status/100!=2))throw n(e.status,"Unexpected status code ["+e.status+"] on URL "+t);return e.json().then(function(t){return{response:e,json:t}})}).then(function(t){var r=t.response,n=t.json,i=r.headers["cache-control"],o=i?/max-age=(\d+)/.exec(i):null,s=o?parseInt(o[1],10):void 0;e({result:n,xhr:r,ttl:s})}).catch(function(t){r({error:t})})}function o(){if(!(0===u.length||a>=s)){a++;var t=u.shift();i(t.url,function(e){var r=e.result,n=e.xhr,i=e.ttl;a--,t.callback(null,r,n,i),o()},function(e){var r=e.error;t.callback(r)})}}e.__esModule=!0;var s=20,a=0,u=[],f=function(){function t(){}return t.prototype.request=function(t,e){u.push({url:t,callback:e}),o()},t}();e.DefaultRequestHandler=f},function(t,e,r){r(3),t.exports=r(2)}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("fetch-everywhere")):"function"==typeof define&&define.amd?define("PrismicJS",["fetch-everywhere"],t):"object"==typeof exports?exports.PrismicJS=t(require("fetch-everywhere")):e.PrismicJS=t(e["fetch-everywhere"])}(this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=10)}([function(e,t,r){"use strict";t.__esModule=!0;var n=function(){function e(e){this.data={},this.data=e}return e.prototype.id=function(){return this.data.id},e.prototype.ref=function(){return this.data.ref},e.prototype.label=function(){return this.data.label},e}();t.Variation=n;var i=function(){function e(e){this.data={},this.data=e,this.variations=(e.variations||[]).map(function(e){new n(e)})}return e.prototype.id=function(){return this.data.id},e.prototype.googleId=function(){return this.data.ref},e.prototype.name=function(){return this.data.label},e}();t.Experiment=i;var o=function(){function e(e){e&&(this.drafts=(e.drafts||[]).map(function(e){new i(e)}),this.running=(e.running||[]).map(function(e){new i(e)}))}return e.prototype.current=function(){return this.running.length>0?this.running[0]:null},e.prototype.refFromCookie=function(e){if(!e||""===e.trim())return null;var t=e.trim().split(" ");if(t.length<2)return null;var r=t[0],n=parseInt(t[1],10),i=this.running.filter(function(e){return e.googleId()==r&&e.variations.length>n})[0];return i?i.variations[n].ref():null},e}();t.Experiments=o},function(e,t,r){"use strict";function n(e,r){return"[:d = "+t.Operator.at+"("+e+', "'+r+'")]'}function i(e,r){return"[:d = "+t.Operator.not+"("+e+', "'+r+'")]'}function o(e){return"[:d = "+t.Operator.missing+"("+e+")]"}function a(e){return"[:d = "+t.Operator.has+"("+e+")]"}function s(e,r){return"[:d = "+t.Operator.any+"("+e+", ["+r.join(",")+"])]"}function u(e,r){return"[:d = "+t.Operator.in+"("+e+", ["+r.join(",")+"])]"}function f(e,r){return"[:d = "+t.Operator.fulltext+"("+e+', "'+r+'")]'}function c(e,r){return"[:d = "+t.Operator.similar+'("'+this.documentId+'", '+this.maxResults+")]"}function h(e,r){return"[:d = "+t.Operator["number.gt"]+"("+e+", "+r+")]"}function d(e,r){return"[:d = "+t.Operator["number.lt"]+"("+e+", "+r+")]"}function p(e,r,n){return"[:d = "+t.Operator["number.inRange"]+"("+e+", "+this.before+", "+this.after+")]"}function l(e,r){return"[:d = "+t.Operator["date.before"]+"("+e+", "+this.before.getTime()+")]"}function m(e,r){return"[:d = "+t.Operator["date.after"]+"("+e+", "+this.after.getTime()+")]"}function y(e,r,n){return"[:d = "+t.Operator["date.between"]+"("+e+", "+this.before.getTime()+", "+this.after.getTime()+")]"}function v(e,r){return"[:d = "+t.Operator["date.day-of-month"]+"("+e+", "+this.day+")]"}function g(e,r){return"[:d = "+t.Operator["date.day-of-month-after"]+"("+e+", "+this.day+")]"}function k(e,r){return"[:d = "+t.Operator["date.day-of-month-before"]+"("+e+", "+this.day+")]"}function w(e,r){return"[:d = "+t.Operator["date.day-of-week"]+"("+e+", "+this.day+")]"}function b(e,r){return"[:d = "+t.Operator["date.day-of-week-after"]+"("+e+", "+this.day+")]"}function P(e,r){return"[:d = "+t.Operator["date.day-of-week-before"]+"("+e+", "+this.day+")]"}function O(e,r){return"number"==typeof this.month?"[:d = "+t.Operator["date.month"]+"("+e+", "+this.month+")]":"[:d = "+t.Operator["date.month"]+"("+e+', "'+this.month+'")]'}function _(e,r){return"number"==typeof this.month?"[:d = "+t.Operator["date.month-before"]+"("+e+", "+this.month+")]":"[:d = "+t.Operator["date.month-before"]+"("+e+', "'+this.month+'")]'}function x(e,r){return"number"==typeof this.month?"[:d = "+t.Operator["date.month-after"]+"("+e+", "+this.month+")]":"[:d = "+t.Operator["date.month-after"]+"("+e+', "'+this.month+'")]'}function q(e,r){return"[:d = "+t.Operator["date.year"]+"("+e+", "+this.year+")]"}function D(e,r){return"[:d = "+t.Operator["date.hour"]+"("+e+", "+this.hour+")]"}function M(e,r){return"[:d = "+t.Operator["date.hour-before"]+"("+e+", "+this.hour+")]"}function A(e,r){return"[:d = "+t.Operator["date.hour-after"]+"("+e+", "+this.hour+")]"}function C(e,r,n,i){return"[:d = "+t.Operator["geopoint.near"]+"("+e+", "+this.latitude+", "+this.longitude+", "+this.radius+")]"}t.__esModule=!0,t.Operator={at:"at",not:"not",missing:"missing",has:"has",any:"any",in:"in",fulltext:"fulltext",similar:"similar","number.gt":"number.gt","number.lt":"number.lt","number.inRange":"number.inRange","date.before":"date.before","date.after":"date.after","date.between":"date.between","date.day-of-month":"date.day-of-month","date.day-of-month-after":"date.day-of-month-after","date.day-of-month-before":"date.day-of-month-before","date.day-of-week":"date.day-of-week","date.day-of-week-after":"date.day-of-week-after","date.day-of-week-before":"date.day-of-week-before","date.month":"date.month","date.month-before":"date.month-before","date.month-after":"date.month-after","date.year":"date.year","date.hour":"date.hour","date.hour-before":"date.hour-before","date.hour-after":"date.hour-after","geopoint.near":"geopoint.near"},t.AtPredicate=n,t.NotPredicate=i,t.MissingPredicate=o,t.HasPredicate=a,t.AnyPredicate=s,t.InPredicate=u,t.FulltextPredicate=f,t.SimilarPredicate=c,t.GtPredicate=h,t.LtPredicate=d,t.InRangePredicate=p,t.DateBeforePredicate=l,t.DateAfterPredicate=m,t.DateBetweenPredicate=y,t.DayOfMonthPredicate=v,t.DayOfMonthAfterPredicate=g,t.DayOfMonthBeforePredicate=k,t.DayOfWeekPredicate=w,t.DayOfWeekAfterPredicate=b,t.DayOfWeekBeforePredicate=P,t.MonthPredicate=O,t.MonthBeforePredicate=_,t.MonthAfterPredicate=x,t.YearPredicate=q,t.HourPredicate=D,t.HourBeforePredicate=M,t.HourAfterPredicate=A,t.NearPredicate=C,t.Predicates={at:n,not:i,missing:o,has:a,any:s,in:u,fulltext:f,similar:c,gt:h,lt:d,inRange:p,before:l,after:m,between:y,dayOfMonth:v,dayOfMonthAfter:g,dayOfMonthBefore:k,dayOfWeek:w,dayOfWeekAfter:b,dayOfWeekBefore:P,month:O,monthBefore:_,monthAfter:x,year:q,hour:D,hourBefore:M,hourAfter:A,near:C}},function(e,t,r){"use strict";function n(e,t){var r=t||{},n=new o.Api(e,r);return new Promise(function(e,t){var i=function(n,i){r.complete&&r.complete(n,i),n?t(n):e(i)};return n.get(function(e,t){!e&&t&&(n.data=t,n.bookmarks=t.bookmarks,n.experiments=new s.Experiments(t.experiments)),i(e,n)}),n})}t.__esModule=!0;var i=r(7),o=r(4),a=r(1),s=r(0);e.exports={experimentCookie:o.ExperimentCookie,previewCookie:o.PreviewCookie,Document:i.Document,SearchForm:o.SearchForm,Form:o.Form,Experiments:s.Experiments,Predicates:a.Predicates,api:n}},function(t,r){t.exports=e},function(e,t,r){"use strict";t.__esModule=!0;var n=r(1),i=r(0),o=r(9),a=r(5),s=r(6);t.PreviewCookie="io.prismic.preview",t.ExperimentCookie="io.prismic.experiment";var u=function(){function e(e,t,r,n,i){this.ref=e,this.label=t,this.isMaster=r,this.scheduledAt=n,this.id=i}return e}();t.Ref=u;var f=function(){function e(e,t,r,n,i,o){this.fields=e,this.action=t,this.name=r,this.rel=n,this.form_method=i,this.enctype=o}return e.prototype.getField=function(e){return this.fields[e]},e.prototype.getFieldSafe=function(e){var t=this.fields[e];if(!t)throw new Error("Missing field "+t+" in form fields "+this.fields);return t},e}();t.Form=f;var c=function(){function e(e,t,r){this.api=e,this.form=t,this.data=r||{};for(var n in t.fields)t.getFieldSafe(n).default&&(this.data[n]=[t.fields[n].default])}return e.prototype.set=function(e,t){var r=this.form.getField(e);if(!r)throw new Error("Unknown field "+e);var n=""===t||void 0===t?null:t,i=this.data[e]||[];return i=r.multiple?n?i.concat([n]):i:n?[n]:i,this.data[e]=i,this},e.prototype.ref=function(e){return this.set("ref",e)},e.prototype.query=function(e){if("string"==typeof e)return this.query([e]);if(e instanceof Array)return this.set("q","["+e.join("")+"]");throw new Error("Invalid query : "+e)},e.prototype.pageSize=function(e){return this.set("pageSize",e)},e.prototype.fetch=function(e){var t=e instanceof Array?e.join(","):e;return this.set("fetch",t)},e.prototype.fetchLinks=function(e){var t=e instanceof Array?e.join(","):e;return this.set("fetchLinks",t)},e.prototype.lang=function(e){return this.set("lang",e)},e.prototype.page=function(e){return this.set("page",e)},e.prototype.orderings=function(e){return e?this.set("orderings","["+e.join(",")+"]"):this},e.prototype.submit=function(e){var t=this.form.action;if(this.data){var r=t.indexOf("?")>-1?"&":"?";for(var n in this.data)if(this.data.hasOwnProperty(n)){var i=this.data[n];if(i)for(var o=0;o<i.length;o++)t+=r+n+"="+encodeURIComponent(i[o]),r="&"}}return this.api.request(t,e)},e}();t.SearchForm=c;var h=function(){function e(e,t,r,n,i,o,a,s){this.page=e,this.results_per_page=t,this.results_size=r,this.total_results_size=n,this.total_pages=i,this.next_page=o,this.prev_page=a,this.results=s}return e}();t.ApiResponse=h;var d=function(){function e(e,t){var r=t||{};return this.accessToken=r.accessToken,this.url=e+(this.accessToken?(e.indexOf("?")>-1?"&":"?")+"access_token="+this.accessToken:""),this.req=r.req,this.apiCache=r.apiCache||new a.DefaultApiCache,this.requestHandler=r.requestHandler||new o.DefaultRequestHandler,this.apiCacheKey=this.url+(this.accessToken?"#"+this.accessToken:""),this.apiDataTTL=r.apiDataTTL||5,this}return e.prototype.get=function(e){var t=this,r=this.apiCacheKey;return new Promise(function(n,i){var o=function(t,r,o,a){e&&e(t,r,o,a),r&&n(r),t&&i(t)};t.apiCache.get(r,function(e,n){if(e||n)return void o(e,n);t.requestHandler.request(t.url,function(e,n,i,a){if(e)return void o(e,null,i,a);var s=t.parse(n);a=a||t.apiDataTTL,t.apiCache.set(r,s,a,function(e){o(e,s,i,a)})})})})},e.prototype.refresh=function(e){var t=this.apiCacheKey;return new Promise(function(r,n){var o=this,a=function(t,i,o){e&&e(t,i,o),i&&r(i),t&&n(t)};this.apiCache.remove(t,function(e){if(e)return void a(e);o.get(function(e,t){if(e)return void a(e);o.data=t,o.bookmarks=t.bookmarks,o.experiments=new i.Experiments(t.experiments),a()})})})},e.prototype.parse=function(e){var t=this,r=Object.keys(e.forms||[]).reduce(function(r,n,i){if(e.forms.hasOwnProperty(n)){var o=e.forms[n];t.accessToken&&(o.fields.access_token={},o.fields.access_token.type="string",o.fields.access_token.default=t.accessToken);var a=new f(o.fields,o.action,o.name,o.rel,o.form_method,o.enctype);return r[n]=a,r}return r},{}),n=e.refs.map(function(e){return new u(e.ref,e.label,e.isMasterRef,e.scheduledAt,e.id)})||[],i=n.filter(function(e){return!0===e.isMaster}),o=e.types,a=e.tags;if(0===i.length)throw"No master ref.";return{bookmarks:e.bookmarks||{},refs:n,forms:r,master:i[0],types:o,tags:a,experiments:e.experiments,oauthInitiate:e.oauth_initiate,oauthToken:e.oauth_token,quickRoutes:e.quickRoutes}},e.prototype.form=function(e){var t=this.data.forms[e];return t?new c(this,t,{}):null},e.prototype.everything=function(){var e=this.form("everything");if(!e)throw new Error("Missing everything form");return e},e.prototype.master=function(){return this.data.master.ref},e.prototype.ref=function(e){for(var t=0;t<this.data.refs.length;t++)if(this.data.refs[t].label==e)return this.data.refs[t].ref;return null},e.prototype.currentExperiment=function(){return this.experiments.current()},e.prototype.quickRoutesEnabled=function(){return this.data.quickRoutes.enabled},e.prototype.getQuickRoutes=function(e){var t=this;return new Promise(function(r,n){t.requestHandler.request(t.data.quickRoutes.url,function(t,i,o){e&&e(t,i,o),t&&n(t),i&&r(i)})})},e.prototype.query=function(e,r,n){var i="function"==typeof r?{options:{},callback:r}:{options:r||{},callback:n},o=i.options,a=i.callback,u=o,f=this.everything();for(var c in u)f=f.set(c,u[c]);if(!u.ref){var h="";this.req?h=this.req.headers.cookie||"":"undefined"!=typeof window&&window.document&&(h=window.document.cookie||"");var d=s.default.parse(h),p=d[t.PreviewCookie],l=this.experiments.refFromCookie(d[t.ExperimentCookie]);f=f.ref(p||l||this.master())}return e&&f.query(e),f.submit(a)},e.prototype.queryFirst=function(e,t,r){var n="function"==typeof t?{options:{},callback:t}:{options:t||{},callback:r},i=n.options,o=n.callback,a=i;return a.page=1,a.pageSize=1,this.query(e,a,function(e,t){if(o){var r=t&&t.results&&t.results[0];o(e,r)}}).then(function(e){return e&&e.results&&e.results[0]}).catch(function(e){console.log(e)})},e.prototype.getByID=function(e,t,r){return t=t||{},t.lang||(t.lang="*"),this.queryFirst(n.Predicates.at("document.id",e),t,r)},e.prototype.getByIDs=function(e,t,r){return t=t||{},t.lang||(t.lang="*"),this.query(n.Predicates.in("document.id",e),t,r)},e.prototype.getByUID=function(e,t,r,i){return r=r||{},r.lang||(r.lang="*"),this.queryFirst(n.Predicates.at("my."+e+".uid",t),r,i)},e.prototype.getSingle=function(e,t,r){return this.queryFirst(n.Predicates.at("document.type",e),t,r)},e.prototype.getBookmark=function(e,t,r){return new Promise(function(t,n){var i=this.bookmarks[e];if(i)t(i);else{var o=new Error("Error retrieving bookmarked id");r&&r(o),n(o)}}).then(function(e){return this.getByID(e,t,r)})},e.prototype.previewSession=function(e,t,r,i){var o=this;return new Promise(function(a,s){var u=function(e,t,r){i&&i(e,t,r),e?s(e):a(t)};o.requestHandler.request(e,function(i,a,s){if(i)return void u(i,r,s);try{var f=a.mainDocument;f?o.everything().query(n.Predicates.at("document.id",f)).ref(e).lang("*").submit(function(e,n){e&&u(e);try{0===n.results.length?u(null,r,s):u(null,t(n.results[0]),s)}catch(e){u(e)}}):u(null,r,s)}catch(e){u(e,r,s)}})})},e.prototype.request=function(e,t){function r(t){o.get(i,function(r,a){if(r||a)return void t(r,n.response(a));n.requestHandler.request(e,function(e,r,a,s){if(e)return void t(e,null,a);s?o.set(i,r,s,function(e){t(e,n.response(r))}):t(null,n.response(r))})})}var n=this,i=e+(this.accessToken?"#"+this.accessToken:""),o=this.apiCache;return new Promise(function(e,n){r(function(r,i,o){t&&t(r,i,o),r&&n(r),i&&e(i)})})},e.prototype.getNextPage=function(e,t){return this.request(e+(this.accessToken?"&access_token="+this.accessToken:""),t)},e.prototype.response=function(e){return new h(e.page,e.results_per_page,e.results_size,e.total_results_size,e.total_pages,e.next_page,e.prev_page,e.results||[])},e}();t.Api=d},function(e,t,r){"use strict";t.__esModule=!0;var n=r(8),i=function(){function e(e){this.lru=n.MakeLRUCache(e)}return e.prototype.isExpired=function(e){var t=this.lru.get(e,!1);return!!t&&0!==t.expiredIn&&t.expiredIn<Date.now()},e.prototype.get=function(e,t){var r=this.lru.get(e,!1);r&&!this.isExpired(e)&&t(null,r.data),t()},e.prototype.set=function(e,t,r,n){this.lru.remove(e),this.lru.put(e,{data:t,expiredIn:r?Date.now()+1e3*r:0}),n()},e.prototype.remove=function(e,t){this.lru.remove(e),t()},e.prototype.clear=function(e){this.lru.removeAll(),e()},e}();t.DefaultApiCache=i},function(e,t,r){"use strict";function n(e,t){try{return t(e)}catch(t){return e}}function i(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");var r={},i=t||{},a=i.decode||o;return e.split(/; */).forEach(function(e){var t=e.indexOf("=");if(!(t<0)){var i=e.substr(0,t).trim(),o=e.substr(++t,e.length).trim();'"'==o[0]&&(o=o.slice(1,-1)),void 0==r[i]&&(r[i]=n(o,a))}}),r}t.__esModule=!0;var o=decodeURIComponent;t.default={parse:i}},function(e,t,r){"use strict";t.__esModule=!0;var n=function(){function e(e,t,r,n,i,o,a,s,u,f,c,h){this.id=e,this.uid=c,this.type=t,this.href=r,this.tags=n,this.slug=i[0],this.slugs=o,this.lang=h,this.alternateLanguages=a,this.firstPublicationDate=s?new Date(s):null,this.lastPublicationDate=u?new Date(u):null,this.data=f}return e}();t.Document=n;var i=function(){function e(e){this.data=e}return e}();t.GroupDoc=i},function(e,t,r){"use strict";function n(e){return new i(e)}function i(e){this.size=0,this.limit=e,this._keymap={}}t.__esModule=!0,t.MakeLRUCache=n,i.prototype.put=function(e,t){var r={key:e,value:t};if(this._keymap[e]=r,this.tail?(this.tail.newer=r,r.older=this.tail):this.head=r,this.tail=r,this.size===this.limit)return this.shift();this.size++},i.prototype.shift=function(){var e=this.head;return e&&(this.head.newer?(this.head=this.head.newer,this.head.older=void 0):this.head=void 0,e.newer=e.older=void 0,delete this._keymap[e.key]),console.log("purging ",e.key),e},i.prototype.get=function(e,t){var r=this._keymap[e];if(void 0!==r)return r===this.tail?t?r:r.value:(r.newer&&(r===this.head&&(this.head=r.newer),r.newer.older=r.older),r.older&&(r.older.newer=r.newer),r.newer=void 0,r.older=this.tail,this.tail&&(this.tail.newer=r),this.tail=r,t?r:r.value)},i.prototype.find=function(e){return this._keymap[e]},i.prototype.set=function(e,t){var r,n=this.get(e,!0);return n?(r=n.value,n.value=t):(r=this.put(e,t))&&(r=r.value),r},i.prototype.remove=function(e){var t=this._keymap[e];if(t)return delete this._keymap[t.key],t.newer&&t.older?(t.older.newer=t.newer,t.newer.older=t.older):t.newer?(t.newer.older=void 0,this.head=t.newer):t.older?(t.older.newer=void 0,this.tail=t.older):this.head=this.tail=void 0,this.size--,t.value},i.prototype.removeAll=function(){this.head=this.tail=void 0,this.size=0,this._keymap={}},"function"==typeof Object.keys?i.prototype.keys=function(){return Object.keys(this._keymap)}:i.prototype.keys=function(){var e=[];for(var t in this._keymap)e.push(t);return e},i.prototype.forEach=function(e,t,r){var n;if(!0===t?(r=!0,t=void 0):"object"!=typeof t&&(t=this),r)for(n=this.tail;n;)e.call(t,n.key,n.value,this),n=n.older;else for(n=this.head;n;)e.call(t,n.key,n.value,this),n=n.newer},i.prototype.toString=function(){for(var e="",t=this.head;t;)e+=String(t.key)+":"+t.value,(t=t.newer)&&(e+=" < ");return e}},function(e,t,r){"use strict";function n(e,t){return{name:"prismic-request-error",message:t,status:e}}function i(e,t,r){return fetch(e,{headers:{Accept:"application/json","User-Agent":"Prismic-javascript-kit"}}).then(function(t){if(~~(t.status/100!=2))throw n(t.status,"Unexpected status code ["+t.status+"] on URL "+e);return t.json().then(function(e){return{response:t,json:e}})}).then(function(e){var r=e.response,n=e.json,i=r.headers["cache-control"],o=i?/max-age=(\d+)/.exec(i):null,a=o?parseInt(o[1],10):void 0;t({result:n,xhr:r,ttl:a})}).catch(function(e){r({error:e})})}function o(){if(!(0===u.length||s>=a)){s++;var e=u.shift();i(e.url,function(t){var r=t.result,n=t.xhr,i=t.ttl;s--,e.callback(null,r,n,i),o()},function(t){var r=t.error;e.callback(r)})}}t.__esModule=!0;var a=20,s=0,u=[],f=function(){function e(){}return e.prototype.request=function(e,t){u.push({url:e,callback:t}),o()},e}();t.DefaultRequestHandler=f},function(e,t,r){r(3),e.exports=r(2)}])});

@@ -13,3 +13,3 @@ {

],
"version": "1.0.5",
"version": "1.1.0",
"devDependencies": {

@@ -16,0 +16,0 @@ "json-loader": "^0.5.4",

@@ -1,2 +0,2 @@

import { IPredicate, Predicates } from '@root/predicates';
import { Predicates } from '@root/predicates';
import { IExperiments, IExperiment, Experiments } from '@root/experiments';

@@ -95,3 +95,3 @@ import { IRequestHandler, DefaultRequestHandler } from '@root/request';

ref(ref: string): ISearchForm;
query(query: string | IPredicate | IPredicate[]): ISearchForm;
query(query: string | string[]): ISearchForm;
pageSize(size: number): ISearchForm;

@@ -152,12 +152,9 @@ fetch(fields: string | string[]): ISearchForm;

*/
query(query: string | IPredicate | IPredicate[]): ISearchForm {
query(query: string | string[]): ISearchForm {
if (typeof query === 'string') {
return this.set("q", query);
return this.query([query]);
} else if(query instanceof Array) {
const predicates = query.map((predicate: IPredicate) => {
return predicate.toString();
});
return this.query(`[${predicates.join("")}]`);
return this.set("q", (`[${query.join("")}]`));
} else {
return this.query([query]);
throw new Error(`Invalid query : ${query}`)
}

@@ -321,3 +318,3 @@ }

getQuickRoutes(callback: (err: Error, data: any, xhr: any) => void): Promise<any>;
query(q: string | IPredicate | IPredicate[], optionsOrCallback: object | ((err: Error | null, response?: any) => void), cb: (err: Error | null, response?: any) => void): Promise<IApiResponse>;
query(q: string | string[], optionsOrCallback: object | ((err: Error | null, response?: any) => void), cb: (err: Error | null, response?: any) => void): Promise<IApiResponse>;
}

@@ -564,3 +561,3 @@

*/
query(q: string | IPredicate | IPredicate[], optionsOrCallback: object | ((err: Error | null, response?: any) => void), cb: (err: Error | null, response?: any) => void): Promise<IApiResponse> {
query(q: string | string[], optionsOrCallback: object | ((err: Error | null, response?: any) => void), cb: (err: Error | null, response?: any) => void): Promise<IApiResponse> {
const {options, callback} = typeof optionsOrCallback === 'function'

@@ -601,3 +598,3 @@ ? {options: {}, callback: optionsOrCallback}

*/
queryFirst(q: string | IPredicate[] | IPredicate, optionsOrCallback: object | ((err: Error | null, response?: any) => void), cb: (err: Error | null, response?: any) => void) {
queryFirst(q: string | string[], optionsOrCallback: object | ((err: Error | null, response?: any) => void), cb: (err: Error | null, response?: any) => void) {
const {options, callback} = typeof optionsOrCallback === 'function'

@@ -628,3 +625,3 @@ ? {options: {}, callback: optionsOrCallback}

if(!options.lang) options.lang = '*';
return this.queryFirst(new Predicates.at('document.id', id), options, callback);
return this.queryFirst(Predicates.at('document.id', id), options, callback);
}

@@ -638,3 +635,3 @@

if(!options.lang) options.lang = '*';
return this.query(new Predicates.in('document.id', ids), options, callback);
return this.query(Predicates.in('document.id', ids), options, callback);
}

@@ -648,3 +645,3 @@

if(!options.lang) options.lang = '*';
return this.queryFirst(new Predicates.at(`my.${type}.uid`, uid), options, callback);
return this.queryFirst(Predicates.at(`my.${type}.uid`, uid), options, callback);
}

@@ -656,3 +653,3 @@

getSingle(type: string, options: any, callback: (err: Error | null, response?: any) => void) {
return this.queryFirst(new Predicates.at('document.type', type), options, callback);
return this.queryFirst(Predicates.at('document.type', type), options, callback);
}

@@ -702,3 +699,3 @@

} else {
api.everything().query(new Predicates.at("document.id", mainDocumentId)).ref(token).lang('*').submit(function(err: Error, response: IApiResponse) {
api.everything().query(Predicates.at("document.id", mainDocumentId)).ref(token).lang('*').submit(function(err: Error, response: IApiResponse) {
if (err) {

@@ -705,0 +702,0 @@ cb(err);

@@ -1,471 +0,154 @@

export interface IPredicate {
op: Operator;
toString(): string;
export const Operator = {
at: "at",
not: "not",
missing: "missing",
has: "has",
any: "any",
in: "in",
fulltext: "fulltext",
similar: "similar",
"number.gt": "number.gt",
"number.lt": "number.lt",
"number.inRange": "number.inRange",
"date.before": "date.before",
"date.after": "date.after",
"date.between": "date.between",
"date.day-of-month": "date.day-of-month",
"date.day-of-month-after": "date.day-of-month-after",
"date.day-of-month-before": "date.day-of-month-before",
"date.day-of-week": "date.day-of-week",
"date.day-of-week-after": "date.day-of-week-after",
"date.day-of-week-before": "date.day-of-week-before",
"date.month": "date.month",
"date.month-before": "date.month-before",
"date.month-after": "date.month-after",
"date.year": "date.year",
"date.hour": "date.hour",
"date.hour-before": "date.hour-before",
"date.hour-after": "date.hour-after",
"geopoint.near": "geopoint.near"
}
export enum Operator {
at,
not,
missing,
has,
any,
in,
fulltext,
similar,
"number.gt",
"number.lt",
"number.inRange",
"date.before",
"date.after",
"date.between",
"date.day-of-month",
"date.day-of-month-after",
"date.day-of-month-before",
"date.day-of-week",
"date.day-of-week-after",
"date.day-of-week-before",
"date.month",
"date.month-before",
"date.month-after",
"date.year",
"date.hour",
"date.hour-before",
"date.hour-after",
"geopoint.near"
export function AtPredicate(fragment: string, value: string): string {
return `[:d = ${Operator.at}(${fragment}, "${value}")]`;
}
export class AtPredicate implements IPredicate {
fragment: string;
value: string;
op: Operator = Operator.at;
constructor(fragment: string, value: string) {
this.fragment = fragment;
this.value = value;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment}, "${this.value}")]`;
}
export function NotPredicate(fragment: string, value: string): string {
return `[:d = ${Operator.not}(${fragment}, "${value}")]`;
}
export class NotPredicate implements IPredicate {
fragment: string;
value: string;
op: Operator = Operator.not;
constructor(fragment: string, value: string) {
this.fragment = fragment;
this.value = value;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment}, "${this.value}")]`;
}
export function MissingPredicate(fragment: string): string {
return `[:d = ${Operator.missing}(${fragment})]`;
}
export class MissingPredicate implements IPredicate {
fragment: string;
op: Operator = Operator.missing;
constructor(fragment: string) {
this.fragment = fragment;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment})]`;
}
export function HasPredicate(fragment: string): string {
return `[:d = ${Operator.has}(${fragment})]`;
}
export class HasPredicate implements IPredicate {
fragment: string;
op: Operator = Operator.has;
constructor(fragment: string) {
this.fragment = fragment;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment})]`;
}
export function AnyPredicate(fragment: string, values: string[]): string {
return `[:d = ${Operator.any}(${fragment}, [${values.join(',')}])]`;
}
export class AnyPredicate implements IPredicate {
fragment: string;
values: string[];
op: Operator = Operator.any;
constructor(fragment: string, values: string[]) {
this.fragment = fragment;
this.values = values;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment}, [${this.values.join(',')}])]`;
}
export function InPredicate(fragment: string, values: string[]): string {
return `[:d = ${Operator.in}(${fragment}, [${values.join(',')}])]`;
}
export class InPredicate implements IPredicate {
fragment: string;
values: string[];
op: Operator = Operator.in;
constructor(fragment: string, values: string[]) {
this.fragment = fragment;
this.values = values;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment}, [${this.values.join(',')}])]`;
}
export function FulltextPredicate(fragment: string, value: string): string {
return `[:d = ${Operator.fulltext}(${fragment}, "${value}")]`;
}
export class FulltextPredicate implements IPredicate {
fragment: string;
value: string;
op: Operator = Operator.fulltext;
constructor(fragment: string, value: string) {
this.fragment = fragment;
this.value = value;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment}, "${this.value}")]`;
}
export function SimilarPredicate(documentId: string, maxResults: number): string {
return `[:d = ${Operator.similar}("${this.documentId}", ${this.maxResults})]`;
}
export class SimilarPredicate implements IPredicate {
documentId: string;
maxResults: number;
op: Operator = Operator.similar;
constructor(documentId: string, maxResults: number) {
this.documentId = documentId;
this.maxResults = maxResults;
}
toString(): string {
return `[:d = ${Operator[this.op]}("${this.documentId}", ${this.maxResults})]`;
}
export function GtPredicate(fragment: string, value: number): string {
return `[:d = ${Operator["number.gt"]}(${fragment}, ${value})]`;
}
export class GtPredicate implements IPredicate {
fragment: string;
value: number;
op: Operator = Operator["number.gt"];
constructor(fragment: string, value: number) {
this.fragment = fragment;
this.value = value;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment}, ${this.value})]`;
}
export function LtPredicate(fragment: string, value: number): string {
return `[:d = ${Operator["number.lt"]}(${fragment}, ${value})]`;
}
export class LtPredicate implements IPredicate {
fragment: string;
value: number;
op: Operator = Operator["number.lt"];
constructor(fragment: string, value: number) {
this.fragment = fragment;
this.value = value;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment}, ${this.value})]`;
}
export function InRangePredicate(fragment: string, before: number, after: number): string {
return `[:d = ${Operator["number.inRange"]}(${fragment}, ${this.before}, ${this.after})]`;
}
export class InRangePredicate implements IPredicate {
fragment: string;
before: number;
after: number;
op: Operator = Operator["number.inRange"];
constructor(fragment: string, before: number, after: number) {
this.fragment = fragment;
this.before = before;
this.after = after;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment}, ${this.before}, ${this.after})]`;
}
export function DateBeforePredicate(fragment: string, before: Date): string {
return `[:d = ${Operator["date.before"]}(${fragment}, ${this.before.getTime()})]`;
}
export class DateBeforePredicate implements IPredicate {
fragment: string;
before: Date;
op: Operator = Operator["date.before"];
constructor(fragment: string, before: Date) {
this.fragment = fragment;
this.before = before;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment}, ${this.before.getTime()})]`;
}
export function DateAfterPredicate(fragment: string, after: Date): string {
return `[:d = ${Operator["date.after"]}(${fragment}, ${this.after.getTime()})]`;
}
export class DateAfterPredicate implements IPredicate {
fragment: string;
after: Date;
op: Operator = Operator["date.after"];
constructor(fragment: string, after: Date) {
this.fragment = fragment;
this.after = after;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment}, ${this.after.getTime()})]`;
}
export function DateBetweenPredicate(fragment: string, before: Date, after: Date): string {
return `[:d = ${Operator["date.between"]}(${fragment}, ${this.before.getTime()}, ${this.after.getTime()})]`;
}
export class DateBetweenPredicate implements IPredicate {
fragment: string;
before: Date;
after: Date;
op: Operator = Operator["date.between"];
constructor(fragment: string, before: Date, after: Date) {
this.fragment = fragment;
this.before = before;
this.after = after;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment}, ${this.before.getTime()}, ${this.after.getTime()})]`;
}
export function DayOfMonthPredicate(fragment: string, day: number): string {
return `[:d = ${Operator["date.day-of-month"]}(${fragment}, ${this.day})]`;
}
export class DayOfMonthPredicate implements IPredicate {
fragment: string;
day: number;
op: Operator = Operator["date.day-of-month"];
constructor(fragment: string, day: number) {
this.fragment = fragment;
this.day = day;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment}, ${this.day})]`;
}
export function DayOfMonthAfterPredicate(fragment: string, day: number): string {
return `[:d = ${Operator["date.day-of-month-after"]}(${fragment}, ${this.day})]`;
}
export class DayOfMonthAfterPredicate implements IPredicate {
fragment: string;
day: number;
op: Operator = Operator["date.day-of-month-after"];
constructor(fragment: string, day: number) {
this.fragment = fragment;
this.day = day;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment}, ${this.day})]`;
}
export function DayOfMonthBeforePredicate(fragment: string, day: number): string {
return `[:d = ${Operator["date.day-of-month-before"]}(${fragment}, ${this.day})]`;
}
export class DayOfMonthBeforePredicate implements IPredicate {
fragment: string;
day: number;
op: Operator = Operator["date.day-of-month-before"];
constructor(fragment: string, day: number) {
this.fragment = fragment;
this.day = day;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment}, ${this.day})]`;
}
export function DayOfWeekPredicate(fragment: string, day: number): string {
return `[:d = ${Operator["date.day-of-week"]}(${fragment}, ${this.day})]`;
}
export class DayOfWeekPredicate implements IPredicate {
fragment: string;
day: number;
op: Operator = Operator["date.day-of-week"];
constructor(fragment: string, day: number) {
this.fragment = fragment;
this.day = day;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment}, ${this.day})]`;
}
export function DayOfWeekAfterPredicate(fragment: string, day: number): string {
return `[:d = ${Operator["date.day-of-week-after"]}(${fragment}, ${this.day})]`;
}
export class DayOfWeekAfterPredicate implements IPredicate {
fragment: string;
day: number;
op: Operator = Operator["date.day-of-week-after"];
constructor(fragment: string, day: number) {
this.fragment = fragment;
this.day = day;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment}, ${this.day})]`;
}
export function DayOfWeekBeforePredicate(fragment: string, day: number): string {
return `[:d = ${Operator["date.day-of-week-before"]}(${fragment}, ${this.day})]`;
}
export class DayOfWeekBeforePredicate implements IPredicate {
fragment: string;
day: number;
op: Operator = Operator["date.day-of-week-before"];
constructor(fragment: string, day: number) {
this.fragment = fragment;
this.day = day;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment}, ${this.day})]`;
}
}
export class MonthPredicate implements IPredicate {
fragment: string;
month: number | string;
op: Operator = Operator["date.month"];
constructor(fragment: string, month: number | string) {
this.fragment = fragment;
this.month = month;
export function MonthPredicate(fragment: string, month: number | string): string {
if(typeof this.month === 'number') {
return `[:d = ${Operator["date.month"]}(${fragment}, ${this.month})]`;
} else {
return `[:d = ${Operator["date.month"]}(${fragment}, "${this.month}")]`;
}
toString(): string {
if(typeof this.month === 'number') {
return `[:d = ${Operator[this.op]}(${this.fragment}, ${this.month})]`;
} else {
return `[:d = ${Operator[this.op]}(${this.fragment}, "${this.month}")]`;
}
}
}
export class MonthBeforePredicate implements IPredicate {
fragment: string;
month: number | string;
op: Operator = Operator["date.month-before"];
constructor(fragment: string, month: number | string) {
this.fragment = fragment;
this.month = month;
export function MonthBeforePredicate(fragment: string, month: number | string): string {
if(typeof this.month === 'number') {
return `[:d = ${Operator["date.month-before"]}(${fragment}, ${this.month})]`;
} else {
return `[:d = ${Operator["date.month-before"]}(${fragment}, "${this.month}")]`;
}
toString(): string {
if(typeof this.month === 'number') {
return `[:d = ${Operator[this.op]}(${this.fragment}, ${this.month})]`;
} else {
return `[:d = ${Operator[this.op]}(${this.fragment}, "${this.month}")]`;
}
}
}
export class MonthAfterPredicate implements IPredicate {
fragment: string;
month: number | string;
op: Operator = Operator["date.month-after"];
constructor(fragment: string, month: number | string) {
this.fragment = fragment;
this.month = month;
export function MonthAfterPredicate(fragment: string, month: number | string): string {
if(typeof this.month === 'number') {
return `[:d = ${Operator["date.month-after"]}(${fragment}, ${this.month})]`;
} else {
return `[:d = ${Operator["date.month-after"]}(${fragment}, "${this.month}")]`;
}
toString(): string {
if(typeof this.month === 'number') {
return `[:d = ${Operator[this.op]}(${this.fragment}, ${this.month})]`;
} else {
return `[:d = ${Operator[this.op]}(${this.fragment}, "${this.month}")]`;
}
}
}
export class YearPredicate implements IPredicate {
fragment: string;
year: number;
op: Operator = Operator["date.year"];
constructor(fragment: string, year: number) {
this.fragment = fragment;
this.year = year;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment}, ${this.year})]`;
}
export function YearPredicate(fragment: string, year: number): string {
return `[:d = ${Operator["date.year"]}(${fragment}, ${this.year})]`;
}
export class HourPredicate implements IPredicate {
fragment: string;
hour: number;
op: Operator = Operator["date.hour"];
constructor(fragment: string, hour: number) {
this.fragment = fragment;
this.hour = hour;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment}, ${this.hour})]`;
}
export function HourPredicate(fragment: string, hour: number): string {
return `[:d = ${Operator["date.hour"]}(${fragment}, ${this.hour})]`;
}
export class HourBeforePredicate implements IPredicate {
fragment: string;
hour: number;
op: Operator = Operator["date.hour-before"];
constructor(fragment: string, hour: number) {
this.fragment = fragment;
this.hour = hour;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment}, ${this.hour})]`;
}
export function HourBeforePredicate(fragment: string, hour: number): string {
return `[:d = ${Operator["date.hour-before"]}(${fragment}, ${this.hour})]`;
}
export class HourAfterPredicate implements IPredicate {
fragment: string;
hour: number;
op: Operator = Operator["date.hour-after"];
constructor(fragment: string, hour: number) {
this.fragment = fragment;
this.hour = hour;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment}, ${this.hour})]`;
}
export function HourAfterPredicate(fragment: string, hour: number): string {
return `[:d = ${Operator["date.hour-after"]}(${fragment}, ${this.hour})]`;
}
export class NearPredicate implements IPredicate {
fragment: string;
latitude: number;
longitude: number;
radius: number;
op: Operator = Operator["geopoint.near"];
constructor(fragment: string, latitude: number, longitude: number, radius: number) {
this.fragment = fragment;
this.latitude = latitude;
this.longitude = longitude;
this.radius = radius;
}
toString(): string {
return `[:d = ${Operator[this.op]}(${this.fragment}, ${this.latitude}, ${this.longitude}, ${this.radius})]`;
}
export function NearPredicate(fragment: string, latitude: number, longitude: number, radius: number): string {
return `[:d = ${Operator["geopoint.near"]}(${fragment}, ${this.latitude}, ${this.longitude}, ${this.radius})]`;
}

@@ -472,0 +155,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc