sdmx-rest
Version:
SDMX REST API client for JavaScript
150 lines (94 loc) • 5.66 kB
JavaScript
// Generated by CoffeeScript 2.7.0
(function() {
var ContextRefType, ContextType, FilterValue, FiltersType, FlowRefType, IDType, IDTypeAlone, MultipleAgencies, MultipleAgenciesRefType, MultipleContextType, MultipleIDType, MultipleIDs, MultipleNestedIDType, MultipleProviderRefType, MultipleVersions, MultipleVersionsType, NCNameIDType, NCNameIDTypeAlone, NestedIDType, NestedIDTypeAlone, NestedNCNameIDType, NestedNCNameIDTypeAlone, Operators, ProviderRefType, ReportingPeriodType, Sdmx3SeriesKeyType, Sdmx_3_0_all, SemVer, SeriesKeyType, SingleVersionType, SingleVersionTypeAlone, VersionNumber, VersionNumberAlone, VersionType, VersionTypeAlone;
NCNameIDType = /[A-Za-z][A-Za-z0-9_-]*/; // Must begin with a letter
// May be followed by letters, numbers, _ or -
NCNameIDTypeAlone = RegExp(`^${NCNameIDType.source}$`);
NestedNCNameIDType = RegExp(`${NCNameIDType.source // An ID
// May be followed by a dot and other IDs
}(\\.${NCNameIDType.source})*`);
NestedNCNameIDTypeAlone = RegExp(`^${NestedNCNameIDType.source}$`);
IDType = /[A-Za-z0-9_@$-]+/; // Letters, numbers, _, @, $ or -
IDTypeAlone = RegExp(`^${IDType.source}$`);
VersionNumber = /[0-9]+(\.[0-9]+)*/; // A version number (e.g. 1.0)
SemVer = /\+|~|(0|[1-9]\d*[\+~]?|[\+~]?)\.(0|[1-9]\d*[\+~]?|[\+~]?)\.?(0|[1-9]\d*[\+~]?|[\+~]?)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?/; // Latest stable
// Latest (un)stable
// Major part
// Minor part
// Patch part
VersionType = RegExp(`(all|latest|${VersionNumber.source // Starts the OR clause
// The string all
// Or the string latest
// Or a version number
// Or semver
// Ends the OR clause
}|${SemVer.source})`);
SingleVersionType = RegExp(`(latest|${VersionNumber.source // Starts the OR clause
// the string latest
// Or a version number
// Or semver
// Ends the OR clause
}|${SemVer.source})`);
SingleVersionTypeAlone = RegExp(`^${SingleVersionType.source}$`);
VersionNumberAlone = RegExp(`^${VersionNumber.source}$`);
VersionTypeAlone = RegExp(`^${VersionType.source}$`);
NestedIDType = /[A-Za-z0-9_@$-]+(\.[A-Za-z0-9_@$-]+)*/; // Letters, numbers, _, @, $ or -
// Potentially hierarchical (e.g. A.B.C)
NestedIDTypeAlone = RegExp(`^${NestedIDType.source}$`);
SeriesKeyType = RegExp(`^(${IDType.source // One or more dimension values
// separated by a +
// Potentially followed by a dot
// and repeating above pattern
}([+]${IDType.source})*)?([.](${IDType.source}([+]${IDType.source})*)?)*$`);
Sdmx3SeriesKeyType = RegExp(`^(\\*|${IDType.source // One star or a dimension value
// Potentially followed by a dot
// and repeating above pattern
})?([.](\\*|${IDType.source})?)*$`);
FlowRefType = RegExp(`^(${IDType.source}|(${NestedNCNameIDType.source},${IDType.source}(,(latest|(${VersionNumber.source})))?))$`);
ProviderRefType = RegExp(`(${NestedNCNameIDType.source // May start with the agency owning the scheme
// The id of the provider
},)?${IDType.source}`);
MultipleProviderRefType = RegExp(`^(${ProviderRefType.source}([+]${ProviderRefType.source})*)$`);
Sdmx_3_0_all = /\*/;
MultipleAgencies = RegExp(`(${Sdmx_3_0_all.source}|${NestedNCNameIDType.source}([+,]${NestedNCNameIDType.source})*)`);
MultipleAgenciesRefType = RegExp(`^${MultipleAgencies.source}$`);
MultipleIDs = RegExp(`(${Sdmx_3_0_all.source}|${IDType.source}([+,]${IDType.source})*)`);
MultipleIDType = RegExp(`^${MultipleIDs.source}$`);
MultipleNestedIDType = RegExp(`^(${Sdmx_3_0_all.source}|${NestedIDType.source}([+]${NestedIDType.source})*)$`);
MultipleVersions = RegExp(`(${Sdmx_3_0_all.source}|${VersionType.source}([,]${VersionType.source})*)`);
MultipleVersionsType = RegExp(`^${VersionType.source}([+,]${VersionType.source})*$`);
ReportingPeriodType = /^\d{4}-([ASTQ]\d{1}|[MW]\d{2}|[D]\d{3})$/;
ContextType = /(datastructure|dataflow|provisionagreement)/;
MultipleContextType = RegExp(`(${Sdmx_3_0_all.source}|${ContextType.source}([+,]${ContextType.source})*)`);
ContextRefType = RegExp(`^(${MultipleContextType.source // The context
// Then the separator between context & agency
// Then one or more agencies
// Then the separator between agency & id
// Then one or more artefact IDs
// Then an open parenthesis
// Then one or more versions
// Then a closing parenthesis
}=${MultipleAgencies.source}:${MultipleIDs.source}\\(${MultipleVersions.source}\\))$`);
Operators = /(eq|ne|lt|le|gt|ge|co|nc|sw|ew)/;
FilterValue = RegExp(`((${Operators.source}:)?${IDType.source})`);
FiltersType = RegExp(`^(${NCNameIDType.source}=${FilterValue.source}([+,]${FilterValue.source})*)$`);
exports.NCNameIDType = NCNameIDTypeAlone;
exports.NestedNCNameIDType = NestedNCNameIDTypeAlone;
exports.IDType = IDTypeAlone;
exports.VersionType = VersionTypeAlone;
exports.SingleVersionType = SingleVersionTypeAlone;
exports.VersionNumber = VersionNumberAlone;
exports.NestedIDType = NestedIDTypeAlone;
exports.FlowRefType = FlowRefType;
exports.ProviderRefType = ProviderRefType;
exports.MultipleProviderRefType = MultipleProviderRefType;
exports.AgenciesRefType = MultipleAgenciesRefType;
exports.ReportingPeriodType = ReportingPeriodType;
exports.SeriesKeyType = SeriesKeyType;
exports.Sdmx3SeriesKeyType = Sdmx3SeriesKeyType;
exports.MultipleIDType = MultipleIDType;
exports.MultipleVersionsType = MultipleVersionsType;
exports.MultipleNestedIDType = MultipleNestedIDType;
exports.ContextRefType = ContextRefType;
exports.FiltersType = FiltersType;
}).call(this);