diff --git a/docs/docs/spec/data-types.yaml b/docs/docs/spec/data-types.yaml index c376edb7..8cff745a 100644 --- a/docs/docs/spec/data-types.yaml +++ b/docs/docs/spec/data-types.yaml @@ -61,11 +61,13 @@ components: - keywords - modified_date - published + - representative_image - thumbnail - title - visibility CollectionRepresentativeImage: type: object + nullable: true properties: work_id: type: string @@ -190,6 +192,7 @@ components: format: date-time digests: type: object + nullable: true additionalProperties: type: string description: @@ -197,6 +200,7 @@ components: nullable: true extracted_metadata: type: object + nullable: true additional_properties: true indexed_at: type: string @@ -218,6 +222,8 @@ components: - api_model - create_date - description + - digests + - extracted_metadata - indexed_at - modified_date - published @@ -234,6 +240,7 @@ components: - Supplemental GenericIdLabel: type: object + nullable: true properties: id: type: string @@ -319,6 +326,7 @@ components: - Resource Guide RepresentativeFileSet: type: object + nullable: true description: Information about the representative image for the resource properties: aspect_ratio: @@ -412,6 +420,7 @@ components: type: string collection: type: object + nullable: true description: The parent collection of the resource properties: id: @@ -503,6 +512,7 @@ components: desciption: Date/time of last index ingest_project: type: object + nullable: true description: Associated ingest project properties: id: @@ -515,6 +525,7 @@ components: - title ingest_sheet: type: object + nullable: true description: Associated ingest sheet properties: id: @@ -580,6 +591,7 @@ components: $ref: "#/components/schemas/PreservationLevel" project: type: object + nullable: true description: Project related information properties: desc: @@ -600,6 +612,13 @@ components: task_number: type: string nullable: true + required: + - desc + - cycle + - manager + - name + - proposer + - task_number provenance: type: array description: Location of Physical Object // will also include messy dates. Information about the provenance, such as origin, ownership and custodial history (chain of custody), of a resource. @@ -703,6 +722,7 @@ components: - box_number - caption - catalog_key + - collection - contributor - create_date - creator @@ -718,10 +738,13 @@ components: - identifier - iiif_manifest - indexed_at + - ingest_project + - ingest_sheet - keywords - language - legacy_identifier - library_unit + - license - location - modified_date - notes @@ -734,7 +757,9 @@ components: - publisher - related_material - related_url + - representative_file_set - rights_holder + - rights_statement - scope_and_contents - series - source diff --git a/package-lock.json b/package-lock.json index 505eb407..90631cc1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ "mocha": "^9.1.4", "nock": "^13.2.9", "nyc": "^15.1.0", + "openapi-typescript": "^6.1.0", "prettier": "^2.7.1", "sinon": "^15.0.1" } @@ -2036,6 +2037,18 @@ "version": "1.0.1", "license": "BSD-3-Clause" }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dev": true, + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, "node_modules/caching-transform": { "version": "4.0.0", "dev": true, @@ -2934,6 +2947,22 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "node_modules/fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -3994,6 +4023,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, "node_modules/methods": { "version": "1.1.2", "dev": true, @@ -4002,6 +4040,19 @@ "node": ">= 0.6" } }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/mime": { "version": "1.6.0", "dev": true, @@ -4427,6 +4478,53 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/openapi-typescript": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/openapi-typescript/-/openapi-typescript-6.1.0.tgz", + "integrity": "sha512-4G0hQu9zXHESZe4fZouucmA+6J5oKSBNYzG0gPbV9V4aKBNIwfUY86ur/cxyTMzuN9vQuAiMe//q4ZMXgMvGtQ==", + "dev": true, + "dependencies": { + "ansi-colors": "^4.1.3", + "fast-glob": "^3.2.12", + "js-yaml": "^4.1.0", + "supports-color": "^9.2.3", + "undici": "^5.12.0", + "yargs-parser": "^21.1.1" + }, + "bin": { + "openapi-typescript": "bin/cli.js" + } + }, + "node_modules/openapi-typescript/node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/openapi-typescript/node_modules/supports-color": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.3.1.tgz", + "integrity": "sha512-knBY82pjmnIzK3NifMo3RxEIRD9E0kIzV4BKcyTZ9+9kWgLMxd4PrsTSMoFQUabgRBbF8KOLRDCyKgNV+iK44Q==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/openapi-typescript/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, "node_modules/optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -5108,6 +5206,15 @@ "node": ">=8" } }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/string_decoder": { "version": "1.1.1", "dev": true, @@ -5348,6 +5455,18 @@ "node": ">= 4" } }, + "node_modules/undici": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.16.0.tgz", + "integrity": "sha512-KWBOXNv6VX+oJQhchXieUznEmnJMqgXMbs0xxH2t8q/FUAWSJvOSr/rMaZKnX5RIVq7JDn0JbP4BOnKG2SGXLQ==", + "dev": true, + "dependencies": { + "busboy": "^1.6.0" + }, + "engines": { + "node": ">=12.18" + } + }, "node_modules/universalify": { "version": "2.0.0", "dev": true, @@ -7024,6 +7143,15 @@ "buffer-equal-constant-time": { "version": "1.0.1" }, + "busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dev": true, + "requires": { + "streamsearch": "^1.1.0" + } + }, "caching-transform": { "version": "4.0.0", "dev": true, @@ -7661,6 +7789,19 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + } + }, "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -8324,10 +8465,26 @@ "semver": "^6.0.0" } }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, "methods": { "version": "1.1.2", "dev": true }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, "mime": { "version": "1.6.0", "dev": true @@ -8606,6 +8763,40 @@ "mimic-fn": "^2.1.0" } }, + "openapi-typescript": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/openapi-typescript/-/openapi-typescript-6.1.0.tgz", + "integrity": "sha512-4G0hQu9zXHESZe4fZouucmA+6J5oKSBNYzG0gPbV9V4aKBNIwfUY86ur/cxyTMzuN9vQuAiMe//q4ZMXgMvGtQ==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.3", + "fast-glob": "^3.2.12", + "js-yaml": "^4.1.0", + "supports-color": "^9.2.3", + "undici": "^5.12.0", + "yargs-parser": "^21.1.1" + }, + "dependencies": { + "ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true + }, + "supports-color": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.3.1.tgz", + "integrity": "sha512-knBY82pjmnIzK3NifMo3RxEIRD9E0kIzV4BKcyTZ9+9kWgLMxd4PrsTSMoFQUabgRBbF8KOLRDCyKgNV+iK44Q==", + "dev": true + }, + "yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true + } + } + }, "optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -9027,6 +9218,12 @@ } } }, + "streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "dev": true + }, "string_decoder": { "version": "1.1.1", "dev": true, @@ -9192,6 +9389,15 @@ "typesafe-actions": { "version": "5.1.0" }, + "undici": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.16.0.tgz", + "integrity": "sha512-KWBOXNv6VX+oJQhchXieUznEmnJMqgXMbs0xxH2t8q/FUAWSJvOSr/rMaZKnX5RIVq7JDn0JbP4BOnKG2SGXLQ==", + "dev": true, + "requires": { + "busboy": "^1.6.0" + } + }, "universalify": { "version": "2.0.0", "dev": true diff --git a/package.json b/package.json index 6a3a3463..f7ccd9f7 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "mocha": "^9.1.4", "nock": "^13.2.9", "nyc": "^15.1.0", + "openapi-typescript": "^6.1.0", "prettier": "^2.7.1", "sinon": "^15.0.1" }, @@ -51,4 +52,4 @@ ] } } -} \ No newline at end of file +} diff --git a/schemas/docs/docs/spec/data-types.ts b/schemas/docs/docs/spec/data-types.ts new file mode 100644 index 00000000..13a39f1c --- /dev/null +++ b/schemas/docs/docs/spec/data-types.ts @@ -0,0 +1,336 @@ +/** + * This file was auto-generated by openapi-typescript. + * Do not make direct changes to the file. + */ + + +export type paths = Record; + +export type webhooks = Record; + +export interface components { + schemas: { + Collection: { + admin_email: string | null; + api_link: string; + api_model: string; + /** Format: date-time */ + create_date: string; + description: string | null; + featured: boolean; + /** Format: uri */ + finding_aid_url: string | null; + /** Format: uuuid */ + id: string; + /** Format: date-time */ + indexed_at: string | null; + keywords: (string)[]; + /** Format: date-time */ + modified_date: string; + published: boolean; + representative_image: components["schemas"]["CollectionRepresentativeImage"]; + /** Format: uri */ + thumbnail: string; + title: string; + visibility: components["schemas"]["Visibility"]; + }; + CollectionRepresentativeImage: { + /** Format: uuid */ + work_id: string; + /** Format: uri */ + url: string; + } | null; + ControlledTerm: { + id: string; + facet: string; + label: string; + variants: (string)[]; + }; + ControlledTermWithRole: { + id: string; + facet: string; + label: string; + label_with_role: string; + role: string; + variants: (string)[]; + }; + FileSetBase: { + /** Format: uuid */ + id: string; + duration: number | null; + height: number | null; + label: string; + mime_type: string | null; + original_filename: string | null; + poster_offset: number | null; + rank: number; + /** Format: uri */ + representative_image_url: string | null; + role: components["schemas"]["FileSetRole"]; + /** Format: uri */ + streaming_url: string | null; + /** Format: uri */ + webvtt: string | null; + width: number | null; + }; + FileSet: components["schemas"]["FileSetBase"] & ({ + accession_number: string; + api_link: string; + api_model: string; + /** Format: date-time */ + create_date: string; + digests: ({ + [key: string]: string | undefined; + }) | null; + description: string | null; + extracted_metadata: Record | null; + indexed_at: string | null; + /** Format: date-time */ + modified_date: string; + published: boolean; + visibility: components["schemas"]["Visibility"]; + /** Format: uuid */ + work_id: string | null; + }); + /** + * @description Role of the file set + * @enum {string|null} + */ + FileSetRole: "Access" | "Auxiliary" | "Preservation" | "Supplemental" | null; + GenericIdLabel: { + id: string; + label: string; + } | null; + /** + * @description NUL Library Unit + * @enum {string|null} + */ + LibraryUnit: "Special Collections" | "Faculty Collections" | "Government and Geographic Information Collection" | "Herskovits Library" | "Music Library" | "Transportation Library" | "University Archives" | "University Main Library" | null; + /** + * @description The type of the note + * @enum {string} + */ + NoteType: "Awards," | "Bibliographical/Historical Note" | "Creation/Production Credits" | "General Note" | "Lanugage Note" | "Local Note" | "Performers" | "Statement of Responsibility" | "Venue/Event Date"; + /** @description Pagination info for the current response */ + PaginationInfo: { + /** @description Full URL to the next page of results */ + next_url?: string; + /** @description Full URL to the previous page of results */ + prev_url?: string; + /** @description Base URL to repeat this query for a given page */ + query_url?: string; + /** @description Tokenized query to use in subsequent GET requests */ + search_token?: string; + /** @description Index of current page of results */ + current_page?: number; + /** @description Number of results per page */ + limit?: number; + /** @description Starting index of first result on the current page */ + offset?: number; + /** @description Total number of results */ + total_hits?: number; + /** @description Total number of result pages */ + total_pages?: number; + }; + /** + * @description The preservation workflow applied to the resource + * @enum {string|null} + */ + PreservationLevel: "Level 1" | "Level 2" | "Level 3" | null; + /** + * @description Type of related resource + * @enum {string|null} + */ + RelatedUrlLabel: "Finding Aid" | "Hathi Trust" | "Related Information" | "Resource Guide" | null; + /** @description Information about the representative image for the resource */ + RepresentativeFileSet: ({ + aspect_ratio: number; + /** Format: uuid */ + id?: string | null; + /** Format: uri */ + url: string; + }) | null; + /** + * @description Preservation status of the resource + * @enum {string|null} + */ + Status: "Not Started" | "In Progress" | "Done" | null; + /** + * @description The access level of the resource + * @enum {string|null} + */ + Visibility: "Private" | "Institution" | "Public" | null; + /** + * @description The media type of the resource + * @enum {string|null} + */ + WorkType: "Audio" | "Image" | "Video" | null; + /** @description A single work response */ + Work: { + /** @description A summary of the resource */ + abstract: (string)[]; + /** @description Accession number for the work. Serves as basis for the filename. */ + accession_number: string; + alternate_title: (string)[]; + /** @description DC API url */ + api_link: string | null; + /** @description Type of resource. (Work, FileSet, Collection) */ + api_model: string | null; + /** @description Archival Resource Key (ARK) */ + ark: string; + /** @description Associated batch update operations */ + batch_ids: (string)[]; + /** @description Physical box name. Sometimes used with Distinctive Collections materials. */ + box_name: (string)[]; + /** @description Physical box number. Sometimes used with Distinctive Collections materials. */ + box_number: (string)[]; + /** @description The caption for a resource. */ + caption: (string)[]; + /** @description Alma bibliographic ID. */ + catalog_key: (string)[]; + /** @description The parent collection of the resource */ + collection: ({ + /** @description UUID of the collection */ + id: string; + /** @description Description of the collection */ + description?: string | null; + /** @description Title of the collection */ + title: string; + }) | null; + /** @description An entity responsible for making contributions to the resource */ + contributor: (components["schemas"]["ControlledTermWithRole"])[]; + /** + * Format: date-time + * @description The creation date of the record in the repository. + */ + create_date: string; + /** @description An entity primarily responsible for making the resource */ + creator: (components["schemas"]["ControlledTerm"])[]; + /** @description Associated csv metadata update operations */ + csv_metadata_update_jobs: (string)[]; + /** @description The cultural context of the resource. */ + cultural_context: (string)[]; + /** @description A point or a period of time associatied with an event in the lifecycle of the resource. */ + date_created: (string)[]; + /** @description An account of the resource */ + description: (string)[]; + /** @description File sets associated with the resource */ + file_sets: (components["schemas"]["FileSetBase"])[]; + /** @description Name of the containing folder. */ + folder_name: (string)[]; + /** @description Number of the containing folder. */ + folder_number: (string)[]; + /** @description Describes what the original object is, not what it is about. */ + genre: (components["schemas"]["ControlledTerm"])[]; + /** + * Format: uuid + * @description UUID for the work record in the repository + */ + id: string; + /** @description Identifiers for the object */ + identifier: (string)[]; + /** Format: uri */ + iiif_manifest: string | null; + /** Format: date-time */ + indexed_at: string | null; + /** @description Associated ingest project */ + ingest_project: { + /** Format: uuid */ + id: string; + title: string; + } | null; + /** @description Associated ingest sheet */ + ingest_sheet: { + /** Format: uuid */ + id: string; + title: string; + } | null; + /** @description Keywords or tags used to describe this content. */ + keywords: (string)[]; + /** @description A language of the resource. */ + language: (components["schemas"]["ControlledTerm"])[]; + /** @description PIDs from previous repository. */ + legacy_identifier: (string)[]; + library_unit: components["schemas"]["LibraryUnit"]; + /** @description Creative Commons licenses */ + license: components["schemas"]["GenericIdLabel"]; + /** @description Place of publication. */ + location: (components["schemas"]["ControlledTerm"])[]; + /** + * Format: date-time + * @description Date resource last modified in repository + */ + modified_date: string; + notes: ({ + note: string; + type: components["schemas"]["NoteType"]; + })[]; + /** @description The material or physical carrier of the resource. */ + physical_description_material: (string)[]; + /** @description The size or duration of the resource. */ + physical_description_size: (string)[]; + preservation_level: components["schemas"]["PreservationLevel"]; + /** @description Project related information */ + project: ({ + desc: string | null; + cycle: string | null; + manager: string | null; + name: string | null; + proposer: string | null; + task_number: string | null; + }) | null; + /** @description Location of Physical Object // will also include messy dates. Information about the provenance, such as origin, ownership and custodial history (chain of custody), of a resource. */ + provenance: (string)[]; + /** @description Resource is available on Digital Collections. */ + published: boolean; + /** @description An entity responsible for making the resource available. */ + publisher: (string)[]; + /** @description URL of a related resource. */ + related_url: ({ + /** Format: uri */ + url: string; + label: components["schemas"]["RelatedUrlLabel"]; + })[]; + representative_file_set: components["schemas"]["RepresentativeFileSet"]; + /** @description A person or organization owning or managing rights over the resource. */ + rights_holder: (string)[]; + /** @description Expresses the copyright status of the resource. */ + rights_statement: components["schemas"]["GenericIdLabel"]; + /** @description Sometimes used with Distincitive Collections materials */ + scope_and_contents: (string)[]; + /** @description Sometimes used with Distincitive Collections materials. Used for archival series and subseries information. */ + series: (string)[]; + /** @description A related resource from which the described resource is derived. Source of digital object - book, journal, etc. Follow Chicago Manual of Style for citation. */ + source: (string)[]; + status: components["schemas"]["Status"]; + /** @description A defined style, historical period, group, school, dynasty, movement, etc. whose characteristics are represented in the work. */ + style_period: (components["schemas"]["ControlledTerm"])[]; + /** @description A defined style, historical period, group, school, dynasty, movement, etc. whose characteristics are represented in the work. */ + subject: (components["schemas"]["ControlledTermWithRole"])[]; + /** @description Used to provide the titles of separate works or parts of a resource. Information provided may also contain statements of responsibility or other sequential designations. */ + table_of_contents: (string)[]; + /** @description A defined style, historical period, group, school, dynasty, movement, etc. whose characteristics are represented in the work. */ + technique: (components["schemas"]["ControlledTerm"])[]; + /** @description Terms of use of resource. */ + terms_of_use: string | null; + /** + * Format: uri + * @description Url of thumbnail image. + */ + thumbnail: string | null; + /** @description A name given to the resource */ + title: string | null; + visibility: components["schemas"]["Visibility"]; + work_type: components["schemas"]["WorkType"]; + }; + }; + responses: never; + parameters: never; + requestBodies: never; + headers: never; + pathItems: never; +} + +export type external = Record; + +export type operations = Record; diff --git a/schemas/docs/docs/spec/openapi.ts b/schemas/docs/docs/spec/openapi.ts new file mode 100644 index 00000000..d241acb2 --- /dev/null +++ b/schemas/docs/docs/spec/openapi.ts @@ -0,0 +1,206 @@ +/** + * This file was auto-generated by openapi-typescript. + * Do not make direct changes to the file. + */ + + +export interface paths { + "/collections": { + get: operations["getCollections"]; + }; + "/collections/{id}": { + get: operations["getCollectionById"]; + }; + "/collections/{id}/thumbnail": { + get: operations["getCollectionThumbnail"]; + }; + "/file-sets/{id}": { + get: operations["getFileSetById"]; + }; + "/file-sets/{id}/authorization": { + get: operations["getFileSetAuth"]; + }; + "/works/{id}": { + get: operations["getWorkById"]; + }; + "/works/{id}/similar": { + get: operations["getSimilarWorks"]; + }; + "/works/{id}/thumbnail": { + get: operations["getWorkThumbnail"]; + }; + "/search": { + get: operations["getSearch"]; + post: operations["postSearch"]; + }; + "/search/{models}": { + get: operations["getSearchWithModels"]; + post: operations["postSearchWithModels"]; + }; + "/oai": { + get: operations["oaiGet"]; + post: operations["oaiPost"]; + }; +} + +export type webhooks = Record; + +export type components = Record; + +export interface external { + + "data-types.yaml": string + "types.yaml": string +} + +export interface operations { + + getCollections: { + responses: { + 200: external["types.yaml"]["components"]["responses"]["SearchResponse"]; + }; + }; + getCollectionById: { + responses: { + 200: external["types.yaml"]["components"]["responses"]["DocumentResponse"]; + }; + }; + getCollectionThumbnail: { + responses: { + /** @description A thumbnail image for the given collection */ + 200: { + content: { + "image/jpeg": string; + }; + }; + }; + }; + getFileSetById: { + responses: { + 200: external["types.yaml"]["components"]["responses"]["DocumentResponse"]; + }; + }; + getFileSetAuth: { + responses: { + /** @description The resource is authorized */ + 204: never; + /** @description The resource is not authorized */ + 403: never; + }; + }; + getWorkById: { + responses: { + 200: external["types.yaml"]["components"]["responses"]["DocumentResponse"]; + }; + }; + getSimilarWorks: { + responses: { + 200: external["types.yaml"]["components"]["responses"]["SearchResponse"]; + }; + }; + getWorkThumbnail: { + responses: { + /** @description A thumbnail image for the given work */ + 200: { + content: { + "image/jpeg": string; + }; + }; + }; + }; + getSearch: { + responses: { + 200: external["types.yaml"]["components"]["responses"]["SearchResponse"]; + }; + }; + postSearch: { + requestBody?: { + content: { + "application/json": Record; + }; + }; + responses: { + 200: external["types.yaml"]["components"]["responses"]["SearchResponse"]; + }; + }; + getSearchWithModels: { + responses: { + 200: external["types.yaml"]["components"]["responses"]["SearchResponse"]; + }; + }; + postSearchWithModels: { + responses: { + 200: external["types.yaml"]["components"]["responses"]["SearchResponse"]; + }; + }; + oaiGet: { + parameters: { + /** @description All OAI-PMH verbs are supported. */ + /** + * @description Required for `GetRecord` requests + * @example d75a851f-b773-4bdf-baec-62a8ec974126 + */ + /** @description Required for `ListIdentifiers`, `ListRecords`, and `GetRecord` requests */ + /** + * @description Optional for `ListRecords` and `ListIdentifiers` requests, based on a record's modified date. Required format `YYYY:MM:DDThh:mm:ss.ffffffZ` + * @example "2023-01-01T08:12:23.561Z" + */ + /** + * @description Optional for `ListRecords` and `ListIdentifiers` requests, based on a record's modified date. Required format `YYYY:MM:DDThh:mm:ss.ffffffZ` + * @example "2023-01-12T12:03:59.224Z" + */ + /** + * @description Optional for `ListRecords` and `ListIdentifiers` requests, based on a collection id. + * @example c4f30015-88b5-4291-b3a6-8ac9b7c7069c + */ + /** @description Exclusive parameter for retrieving additional results */ + query: { + verb: "GetRecord" | "Identify" | "ListIdentifiers" | "ListMetadataFormats" | "ListRecords" | "ListSets"; + identifier?: string; + metadataPrefix?: "oai_dc"; + from?: string; + until?: string; + set?: string; + resumptionToken?: string; + }; + }; + responses: { + /** @description An OAI-PMH response document */ + 200: { + content: { + "application/xml": Record; + }; + }; + }; + }; + oaiPost: { + requestBody: { + content: { + "application/x-www-form-urlencoded": { + /** @description All OAI-PMH verbs are supported */ + verb?: string; + /** @description Required for `GetRecord` requests */ + identifier?: string; + /** @description Required for `ListIdentifiers`, `ListRecords`, and `GetRecord` requests. The only supported value is `"oai_dc"` currently. */ + metadataPrefix?: string; + /** @description Exclusive parameter for retrieving additional results */ + resumptionToken?: string; + /** @description Optional for `ListRecords` and `ListIdentifiers` requests, based on a record's modified date. Required format `YYYY:MM:DDThh:mm:ss.ffffffZ` */ + from?: string; + /** @description Optional for `ListRecords` and `ListIdentifiers` requests, based on a record's modified date. Required format `YYYY:MM:DDThh:mm:ss.ffffffZ` */ + until?: string; + /** @description Optional for `ListRecords` and `ListIdentifiers` requests, based on a collection id. */ + set?: string; + }; + }; + }; + responses: { + /** @description An OAI-PMH response document */ + 200: { + content: { + "application/xml": Record; + }; + }; + }; + }; +} diff --git a/schemas/docs/docs/spec/types.ts b/schemas/docs/docs/spec/types.ts new file mode 100644 index 00000000..513780dc --- /dev/null +++ b/schemas/docs/docs/spec/types.ts @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by openapi-typescript. + * Do not make direct changes to the file. + */ + + +export type paths = Record; + +export type webhooks = Record; + +export interface components { + schemas: { + /** @description A [IIIF Presentation v3.x](https://iiif.io/api/presentation/3.0/) Manifest */ + IiifPresentationManifest: Record; + /** @description A single index document */ + IndexDocument: Record; + OpenSearchResponse: { + /** @description An array of response documents */ + data?: (components["schemas"]["IndexDocument"])[]; + pagination?: external["data-types.yaml"]["components"]["schemas"]["PaginationInfo"]; + }; + }; + responses: { + /** @description A single document response */ + DocumentResponse: { + content: { + "application/json": { + data?: components["schemas"]["IndexDocument"]; + info?: Record; + }; + }; + }; + /** @description A page of search results */ + SearchResponse: { + content: { + "application/json": components["schemas"]["OpenSearchResponse"] | components["schemas"]["IiifPresentationManifest"]; + }; + }; + }; + parameters: { + /** @description Comma-delimited list of models to search */ + models: ("collections" | "file-sets" | "Works")[]; + /** @description Collection, FileSet, or Work ID */ + id: string; + /** @description Keyword query */ + query: string; + /** @description Search token from previous search response */ + searchToken: string; + /** @description Page number of results to retrieve */ + page: number; + /** @description Maximum number of results per page */ + size: number; + /** @description Comma-delimited list of fields to sort search results (e.g. "create_date:asc,modified_date:desc") */ + sort: string; + /** @description Desired output format */ + as: "iiif" | "opensearch"; + /** @description Desired aspect ratio */ + thumbnailAspect: "full" | "square"; + /** @description Size of largest dimension */ + thumbnailSize: number; + }; + requestBodies: never; + headers: never; + pathItems: never; +} + +export interface external { + + "data-types.yaml": Record +} + +export type operations = Record;