manifesto.js
Advanced tools
Comparing version
@@ -16,6 +16,6 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var vocabulary_1 = require("@iiif/vocabulary"); | ||
var ManifestResource_1 = require("./ManifestResource"); | ||
var AnnotationBody_1 = require("./AnnotationBody"); | ||
var Resource_1 = require("./Resource"); | ||
//const AnnotationMotivationEnum = require('@iiif/vocabulary').AnnotationMotivation; | ||
var Annotation = /** @class */ (function (_super) { | ||
@@ -60,3 +60,4 @@ __extends(Annotation, _super); | ||
if (motivation) { | ||
return vocabulary_1.AnnotationMotivation[motivation.toLowerCase()]; | ||
//const key: string | undefined = Object.keys(AnnotationMotivationEnum).find(k => AnnotationMotivationEnum[k] === motivation); | ||
return motivation; | ||
} | ||
@@ -63,0 +64,0 @@ return null; |
@@ -1,2 +0,1 @@ | ||
import { ServiceProfile, MediaType } from "@iiif/vocabulary"; | ||
import { IAccessToken } from "./IAccessToken"; | ||
@@ -9,3 +8,4 @@ import { IExternalResource } from "./IExternalResource"; | ||
import { TreeNode } from "./TreeNode"; | ||
import { IIIFResource } from "."; | ||
import { MediaType, ServiceProfile } from "@iiif/vocabulary"; | ||
import { IIIFResource } from "./IIIFResource"; | ||
export declare class Utils { | ||
@@ -12,0 +12,0 @@ static getMediaType(type: string): MediaType; |
@@ -38,3 +38,2 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var vocabulary_1 = require("@iiif/vocabulary"); | ||
var Service_1 = require("./Service"); | ||
@@ -46,2 +45,3 @@ var StatusCode_1 = require("./StatusCode"); | ||
var url = require('url'); | ||
var ServiceProfileEnum = require('@iiif/vocabulary').ServiceProfile; | ||
var Utils = /** @class */ (function () { | ||
@@ -56,14 +56,14 @@ function Utils() { | ||
Utils.getImageQuality = function (profile) { | ||
if (profile === vocabulary_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1 || | ||
profile === vocabulary_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2 || | ||
profile === vocabulary_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1 || | ||
profile === vocabulary_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2 || | ||
profile === vocabulary_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1 || | ||
profile === vocabulary_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2 || | ||
profile === vocabulary_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1 || | ||
profile === vocabulary_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2 || | ||
profile === vocabulary_1.ServiceProfile.IMAGE_1_LEVEL_1 || | ||
profile === vocabulary_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1 || | ||
profile === vocabulary_1.ServiceProfile.IMAGE_1_LEVEL_2 || | ||
profile === vocabulary_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) { | ||
if (profile === ServiceProfileEnum.IMAGE_0_COMPLIANCE_LEVEL_1 || | ||
profile === ServiceProfileEnum.IMAGE_0_COMPLIANCE_LEVEL_2 || | ||
profile === ServiceProfileEnum.IMAGE_1_COMPLIANCE_LEVEL_1 || | ||
profile === ServiceProfileEnum.IMAGE_1_COMPLIANCE_LEVEL_2 || | ||
profile === ServiceProfileEnum.IMAGE_0_CONFORMANCE_LEVEL_1 || | ||
profile === ServiceProfileEnum.IMAGE_0_CONFORMANCE_LEVEL_2 || | ||
profile === ServiceProfileEnum.IMAGE_1_CONFORMANCE_LEVEL_1 || | ||
profile === ServiceProfileEnum.IMAGE_1_CONFORMANCE_LEVEL_2 || | ||
profile === ServiceProfileEnum.IMAGE_1_LEVEL_1 || | ||
profile === ServiceProfileEnum.IMAGE_1_PROFILE_LEVEL_1 || | ||
profile === ServiceProfileEnum.IMAGE_1_LEVEL_2 || | ||
profile === ServiceProfileEnum.IMAGE_1_PROFILE_LEVEL_2) { | ||
return 'native'; | ||
@@ -137,24 +137,24 @@ } | ||
Utils.isImageProfile = function (profile) { | ||
if (Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_1_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_1_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_1_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_2_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_2_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_2_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2)) { | ||
if (Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_COMPLIANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_COMPLIANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_COMPLIANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_COMPLIANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_COMPLIANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_CONFORMANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_CONFORMANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_CONFORMANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_CONFORMANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_CONFORMANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_PROFILE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_PROFILE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_PROFILE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_PROFILE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_PROFILE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_PROFILE_LEVEL_2)) { | ||
return true; | ||
@@ -165,10 +165,10 @@ } | ||
Utils.isLevel0ImageProfile = function (profile) { | ||
if (Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_1_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_2_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0)) { | ||
if (Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_COMPLIANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_COMPLIANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_CONFORMANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_CONFORMANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_PROFILE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_PROFILE_LEVEL_0)) { | ||
return true; | ||
@@ -179,10 +179,10 @@ } | ||
Utils.isLevel1ImageProfile = function (profile) { | ||
if (Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_1_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_2_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1)) { | ||
if (Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_COMPLIANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_COMPLIANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_CONFORMANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_CONFORMANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_PROFILE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_PROFILE_LEVEL_1)) { | ||
return true; | ||
@@ -193,10 +193,10 @@ } | ||
Utils.isLevel2ImageProfile = function (profile) { | ||
if (Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_1_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_2_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), vocabulary_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2)) { | ||
if (Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_COMPLIANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_COMPLIANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_CONFORMANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_CONFORMANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_PROFILE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_PROFILE_LEVEL_2)) { | ||
return true; | ||
@@ -438,3 +438,3 @@ } | ||
case 0: | ||
tokenService = authService.getService(vocabulary_1.ServiceProfile.AUTH_1_TOKEN); | ||
tokenService = authService.getService(ServiceProfileEnum.AUTH_1_TOKEN); | ||
if (!tokenService) return [3 /*break*/, 3]; | ||
@@ -441,0 +441,0 @@ return [4 /*yield*/, openTokenService(resource, tokenService)]; |
@@ -14,6 +14,6 @@ var __extends = (this && this.__extends) || (function () { | ||
})(); | ||
import { AnnotationMotivation } from "@iiif/vocabulary"; | ||
import { ManifestResource } from "./ManifestResource"; | ||
import { AnnotationBody } from "./AnnotationBody"; | ||
import { Resource } from "./Resource"; | ||
//const AnnotationMotivationEnum = require('@iiif/vocabulary').AnnotationMotivation; | ||
var Annotation = /** @class */ (function (_super) { | ||
@@ -58,3 +58,4 @@ __extends(Annotation, _super); | ||
if (motivation) { | ||
return AnnotationMotivation[motivation.toLowerCase()]; | ||
//const key: string | undefined = Object.keys(AnnotationMotivationEnum).find(k => AnnotationMotivationEnum[k] === motivation); | ||
return motivation; | ||
} | ||
@@ -61,0 +62,0 @@ return null; |
@@ -1,2 +0,1 @@ | ||
import { ServiceProfile, MediaType } from "@iiif/vocabulary"; | ||
import { IAccessToken } from "./IAccessToken"; | ||
@@ -9,3 +8,4 @@ import { IExternalResource } from "./IExternalResource"; | ||
import { TreeNode } from "./TreeNode"; | ||
import { IIIFResource } from "."; | ||
import { MediaType, ServiceProfile } from "@iiif/vocabulary"; | ||
import { IIIFResource } from "./IIIFResource"; | ||
export declare class Utils { | ||
@@ -12,0 +12,0 @@ static getMediaType(type: string): MediaType; |
@@ -36,3 +36,2 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}; | ||
import { ServiceProfile } from "@iiif/vocabulary"; | ||
import { Service } from "./Service"; | ||
@@ -44,2 +43,3 @@ import { StatusCode } from "./StatusCode"; | ||
var url = require('url'); | ||
var ServiceProfileEnum = require('@iiif/vocabulary').ServiceProfile; | ||
var Utils = /** @class */ (function () { | ||
@@ -54,14 +54,14 @@ function Utils() { | ||
Utils.getImageQuality = function (profile) { | ||
if (profile === ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1 || | ||
profile === ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2 || | ||
profile === ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1 || | ||
profile === ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2 || | ||
profile === ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1 || | ||
profile === ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2 || | ||
profile === ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1 || | ||
profile === ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2 || | ||
profile === ServiceProfile.IMAGE_1_LEVEL_1 || | ||
profile === ServiceProfile.IMAGE_1_PROFILE_LEVEL_1 || | ||
profile === ServiceProfile.IMAGE_1_LEVEL_2 || | ||
profile === ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) { | ||
if (profile === ServiceProfileEnum.IMAGE_0_COMPLIANCE_LEVEL_1 || | ||
profile === ServiceProfileEnum.IMAGE_0_COMPLIANCE_LEVEL_2 || | ||
profile === ServiceProfileEnum.IMAGE_1_COMPLIANCE_LEVEL_1 || | ||
profile === ServiceProfileEnum.IMAGE_1_COMPLIANCE_LEVEL_2 || | ||
profile === ServiceProfileEnum.IMAGE_0_CONFORMANCE_LEVEL_1 || | ||
profile === ServiceProfileEnum.IMAGE_0_CONFORMANCE_LEVEL_2 || | ||
profile === ServiceProfileEnum.IMAGE_1_CONFORMANCE_LEVEL_1 || | ||
profile === ServiceProfileEnum.IMAGE_1_CONFORMANCE_LEVEL_2 || | ||
profile === ServiceProfileEnum.IMAGE_1_LEVEL_1 || | ||
profile === ServiceProfileEnum.IMAGE_1_PROFILE_LEVEL_1 || | ||
profile === ServiceProfileEnum.IMAGE_1_LEVEL_2 || | ||
profile === ServiceProfileEnum.IMAGE_1_PROFILE_LEVEL_2) { | ||
return 'native'; | ||
@@ -135,24 +135,24 @@ } | ||
Utils.isImageProfile = function (profile) { | ||
if (Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_1_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_1_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_1_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_2_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_2_PROFILE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_2_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_2_PROFILE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_2_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_2_PROFILE_LEVEL_2)) { | ||
if (Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_COMPLIANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_COMPLIANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_COMPLIANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_COMPLIANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_COMPLIANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_CONFORMANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_CONFORMANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_CONFORMANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_CONFORMANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_CONFORMANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_PROFILE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_PROFILE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_PROFILE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_PROFILE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_PROFILE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_PROFILE_LEVEL_2)) { | ||
return true; | ||
@@ -163,10 +163,10 @@ } | ||
Utils.isLevel0ImageProfile = function (profile) { | ||
if (Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_1_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_2_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_2_PROFILE_LEVEL_0)) { | ||
if (Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_COMPLIANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_COMPLIANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_CONFORMANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_CONFORMANCE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_PROFILE_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_LEVEL_0) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_PROFILE_LEVEL_0)) { | ||
return true; | ||
@@ -177,10 +177,10 @@ } | ||
Utils.isLevel1ImageProfile = function (profile) { | ||
if (Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_1_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_2_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_2_PROFILE_LEVEL_1)) { | ||
if (Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_COMPLIANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_COMPLIANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_CONFORMANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_CONFORMANCE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_PROFILE_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_LEVEL_1) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_PROFILE_LEVEL_1)) { | ||
return true; | ||
@@ -191,10 +191,10 @@ } | ||
Utils.isLevel2ImageProfile = function (profile) { | ||
if (Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_1_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_2_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfile.IMAGE_2_PROFILE_LEVEL_2)) { | ||
if (Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_COMPLIANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_COMPLIANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_0_CONFORMANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_CONFORMANCE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_1_PROFILE_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_LEVEL_2) || | ||
Utils.normalisedUrlsMatch(profile.toString(), ServiceProfileEnum.IMAGE_2_PROFILE_LEVEL_2)) { | ||
return true; | ||
@@ -436,3 +436,3 @@ } | ||
case 0: | ||
tokenService = authService.getService(ServiceProfile.AUTH_1_TOKEN); | ||
tokenService = authService.getService(ServiceProfileEnum.AUTH_1_TOKEN); | ||
if (!tokenService) return [3 /*break*/, 3]; | ||
@@ -439,0 +439,0 @@ return [4 /*yield*/, openTokenService(resource, tokenService)]; |
{ | ||
"name": "manifesto.js", | ||
"version": "4.0.0-pre.5", | ||
"version": "4.0.0-pre.6", | ||
"description": "IIIF Presentation API utility library for client and server", | ||
@@ -49,3 +49,3 @@ "main": "./dist-esmodule/index.js", | ||
"@edsilv/http-status-codes": "0.0.12", | ||
"@iiif/vocabulary": "1.0.5", | ||
"@iiif/vocabulary": "1.0.7", | ||
"request": "^2.83.0" | ||
@@ -52,0 +52,0 @@ }, |
@@ -7,2 +7,3 @@ // root service is string (only references to root services may be strings) | ||
var manifests = require('../fixtures/manifests'); | ||
var ServiceProfile = require('@iiif/vocabulary').ServiceProfile; | ||
@@ -20,5 +21,5 @@ var manifest; | ||
it('has no search service', function () { | ||
var service = manifest.getService(manifesto.ServiceProfile.SEARCH_0); | ||
var service = manifest.getService(ServiceProfile.SEARCH_0); | ||
expect(service).to.not.exist; | ||
}); | ||
}); |
@@ -5,2 +5,4 @@ var expect = require('chai').expect; | ||
var manifests = require('../fixtures/manifests'); | ||
var AnnotationMotivation = require('@iiif/vocabulary').AnnotationMotivation; | ||
var ExternalResourceType = require('@iiif/vocabulary').ExternalResourceType; | ||
@@ -25,5 +27,5 @@ describe('#loadsAnnotationList', function() { | ||
should.equal(annotation.getBody().length, 0); | ||
should.equal(annotation.getMotivation().toString(), 'sc:painting'); | ||
should.equal(annotation.getMotivation(), AnnotationMotivation.PAINTING); | ||
should.equal(annotation.getOn(), 'https://wellcomelibrary.org/iiif/b18035723/canvas/c2#xywh=928,317,609,56'); | ||
should.equal(annotation.getResource().getType().toString(), 'contentastext'); | ||
should.equal(annotation.getResource().getType(), ExternalResourceType.CONTENT_AS_TEXT); | ||
done(); | ||
@@ -30,0 +32,0 @@ }); |
@@ -5,2 +5,5 @@ var expect = require('chai').expect; | ||
var manifests = require('../fixtures/manifests'); | ||
var RenderingFormat = require('@iiif/vocabulary').RenderingFormat; | ||
var ServiceProfile = require('@iiif/vocabulary').ServiceProfile; | ||
var ViewingHint = require('@iiif/vocabulary').ViewingHint; | ||
@@ -44,3 +47,3 @@ var manifest, sequence; | ||
it('has a search service', function () { | ||
var service = manifest.getService(manifesto.ServiceProfile.SEARCH_0); | ||
var service = manifest.getService(ServiceProfile.SEARCH_0); | ||
expect(service).to.exist; | ||
@@ -56,7 +59,7 @@ }); | ||
var viewingHint = sequence.getViewingHint(); | ||
viewingHint.should.equal('paged'); | ||
viewingHint.should.equal(ViewingHint.PAGED); | ||
}); | ||
it('sequence has a rendering', function () { | ||
var rendering = sequence.getRendering(manifesto.RenderingFormat.PDF); | ||
var rendering = sequence.getRendering(RenderingFormat.PDF); | ||
rendering.getFormat().should.equal('application/pdf'); | ||
@@ -63,0 +66,0 @@ }); |
@@ -7,2 +7,3 @@ // nested collections | ||
var manifests = require('../fixtures/manifests'); | ||
var IIIFResourceType = require('@iiif/vocabulary').IIIFResourceType; | ||
@@ -21,3 +22,3 @@ var collection, manifest, firstCollection, secondCollection, secondManifest, thirdManifest; | ||
var type = collection.getIIIFResourceType(); | ||
type.should.equal('collection'); | ||
type.should.equal(IIIFResourceType.COLLECTION); | ||
expect(collection.isManifest()).to.equal(false); | ||
@@ -24,0 +25,0 @@ expect(collection.isCollection()).to.equal(true); |
@@ -7,2 +7,3 @@ // login | ||
var manifests = require('../fixtures/manifests'); | ||
var ServiceProfile = require('@iiif/vocabulary').ServiceProfile; | ||
@@ -27,3 +28,3 @@ var manifest, sequence, canvas, imageService; | ||
expect(resource).to.exist; | ||
var profile = manifesto.ServiceProfile.IMAGE_2_LEVEL_1; | ||
var profile = ServiceProfile.IMAGE_2_LEVEL_1; | ||
imageService = resource.getService(profile); | ||
@@ -34,3 +35,3 @@ expect(imageService).to.exist; | ||
it('imageService has login service', function () { | ||
var profile = manifesto.ServiceProfile.AUTH_0_LOGIN; | ||
var profile = ServiceProfile.AUTH_0_LOGIN; | ||
var loginService = imageService.getService(profile); | ||
@@ -37,0 +38,0 @@ expect(loginService).to.exist; |
@@ -5,2 +5,3 @@ var expect = require('chai').expect; | ||
var manifests = require('../fixtures/manifests'); | ||
var Behavior = require('@iiif/vocabulary').Behavior; | ||
@@ -21,4 +22,4 @@ var manifest; | ||
expect(behavior).to.exist; | ||
expect(behavior === 'auto-advance'); | ||
expect(behavior === Behavior.AUTO_ADVANCE); | ||
}); | ||
}); |
@@ -7,2 +7,3 @@ // nested collections | ||
var manifests = require('../fixtures/manifests'); | ||
var IIIFResourceType = require('@iiif/vocabulary').IIIFResourceType; | ||
@@ -21,3 +22,3 @@ var collection, manifest, firstCollection, secondCollection; | ||
var type = collection.getIIIFResourceType(); | ||
type.should.equal('collection'); | ||
type.should.equal(IIIFResourceType.COLLECTION); | ||
}); | ||
@@ -24,0 +25,0 @@ |
@@ -5,2 +5,4 @@ var expect = require('chai').expect; | ||
var manifests = require('../fixtures/manifests'); | ||
var IIIFResourceType = require('@iiif/vocabulary').IIIFResourceType; | ||
var ViewingDirection = require('@iiif/vocabulary').ViewingDirection; | ||
@@ -19,3 +21,3 @@ var collection; | ||
var viewingDirection = collection.getViewingDirection(); | ||
expect(viewingDirection).to.equal("right-to-left"); | ||
expect(viewingDirection).to.equal(ViewingDirection.RIGHT_TO_LEFT); | ||
}); | ||
@@ -25,3 +27,3 @@ | ||
var type = collection.getIIIFResourceType(); | ||
type.should.equal('collection'); | ||
type.should.equal(IIIFResourceType.COLLECTION); | ||
expect(collection.isManifest()).to.equal(false); | ||
@@ -28,0 +30,0 @@ // expect(collection.isCollection()).to.equal(true); todo |
@@ -5,2 +5,3 @@ var expect = require('chai').expect; | ||
var manifests = require('../fixtures/manifests'); | ||
var ViewingHint = require('@iiif/vocabulary').ViewingHint; | ||
@@ -21,3 +22,3 @@ var manifest; | ||
var viewingHint = manifest.getViewingHint(); | ||
viewingHint.should.equal('paged'); | ||
viewingHint.should.equal(ViewingHint.PAGED); | ||
}); | ||
@@ -24,0 +25,0 @@ }); |
@@ -5,2 +5,3 @@ var expect = require('chai').expect; | ||
var manifests = require('../fixtures/manifests'); | ||
var Behavior = require('@iiif/vocabulary').Behavior; | ||
@@ -21,3 +22,3 @@ var manifest; | ||
var behavior = manifest.getBehavior(); | ||
behavior.should.equal('paged'); | ||
behavior.should.equal(Behavior.PAGED); | ||
}); | ||
@@ -24,0 +25,0 @@ }); |
@@ -6,2 +6,3 @@ // root service is string (only references to root services may be strings) | ||
var manifests = require('../fixtures/manifests'); | ||
var ViewingDirection = require('@iiif/vocabulary').ViewingDirection; | ||
@@ -25,4 +26,4 @@ var manifest, sequence; | ||
var viewingDirection = sequence.getViewingDirection(); | ||
expect(viewingDirection).to.equal("right-to-left"); | ||
expect(viewingDirection).to.equal(ViewingDirection.RIGHT_TO_LEFT); | ||
}); | ||
}); |
@@ -5,2 +5,3 @@ var expect = require('chai').expect; | ||
var manifests = require('../fixtures/manifests'); | ||
var ServiceProfile = require('@iiif/vocabulary').ServiceProfile; | ||
@@ -25,3 +26,3 @@ var manifest, sequence; | ||
expect(resource).to.exist; | ||
var profile = manifesto.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1; | ||
var profile = ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1; | ||
imageService = resource.getService(profile); | ||
@@ -28,0 +29,0 @@ expect(imageService).to.exist; |
@@ -6,2 +6,3 @@ // ixif | ||
var manifests = require('../fixtures/manifests'); | ||
var ServiceProfile = require('@iiif/vocabulary').ServiceProfile; | ||
@@ -35,3 +36,3 @@ var manifest, sequence, element; | ||
it('element has an IxIF service (used for auth)', function () { | ||
var profile = manifesto.ServiceProfile.IXIF; | ||
var profile = ServiceProfile.IXIF; | ||
var service = element.getService(profile); | ||
@@ -38,0 +39,0 @@ expect(service).to.exist; |
@@ -6,2 +6,3 @@ // no autocomplete service | ||
var manifests = require('../fixtures/manifests'); | ||
var ServiceProfile = require('@iiif/vocabulary').ServiceProfile; | ||
@@ -19,5 +20,5 @@ var manifest; | ||
it('has no autocomplete service', function () { | ||
var service = manifest.getService(manifesto.ServiceProfile.SEARCH_0_AUTO_COMPLETE); | ||
var service = manifest.getService(ServiceProfile.SEARCH_0_AUTO_COMPLETE); | ||
expect(service).to.not.exist; | ||
}); | ||
}); |
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 too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
36753198
-1.43%435
-0.23%262873
-0.16%+ Added
- Removed
Updated